/**************************************************************************** ** ui.h extension file, included from the uic-generated form implementation. ** ** If you wish to add, delete or rename functions or slots use ** Qt Designer which will update this file, preserving your code. Create an ** init() function in place of a constructor, and a destroy() function in ** place of a destructor. *****************************************************************************/ #include "deletemacro.h" #include using namespace std; void DeleteMacro::init(Macros *M) { int anzahl,i; AllMacros=M; anzahl=AllMacros->count(); if ( anzahl > 0 ) for(i=0; i < anzahl; i++) MacroBox->insertItem(M->getMacroName(i)); } void DeleteMacro::addtoList() { int anzahl; anzahl=MacroBox->numRows(); if (anzahl > 0) for (int i=0; i < anzahl; i++) if ( MacroBox->isSelected(i)) { Macrostodelete->insertItem(MacroBox->text(i)); MacroBox->removeItem(i); } } void DeleteMacro::removefromList() { int anzahl; anzahl=Macrostodelete->numRows(); if (anzahl > 0) for (int i=0; i < anzahl; i++) if ( Macrostodelete->isSelected(i)) { MacroBox->insertItem(Macrostodelete->text(i)); Macrostodelete->removeItem(i); } } void DeleteMacro::accept() { QString s; int anzahl; anzahl=Macrostodelete->numRows(); if (anzahl > 0) for (int i=0; i < anzahl; i++) { s=Macrostodelete->text(i); int aktAnzahl=AllMacros->count(); if (aktAnzahl > 0) { for (int k=0; k < aktAnzahl; k ++) if ( s== AllMacros->getMacroName(k)) { AllMacros->deleteMacro(k); break; } } } QDialog::accept(); }