+
+void PIRMacro::storeSettings(
+ QSettings &settings)
+{
+ settings.setValue("macroName", text(0));
+ settings.setValue("macroKey", key);
+ settings.setValue("macroButtonID", buttonID);
+
+ CommandSequence::const_iterator i = commands.begin();
+
+ int index = 0;
+ while (i != commands.end())
+ {
+ (*i)->storeSettings(settings, index);
+ ++index;
+ ++i;
+ }
+}
+
+
+QString PIRMacro::getCommandType(
+ int index)
+{
+ CommandSequence::iterator i = commands.begin();
+
+ // Advance 'index' steps into the sequence:
+ while (i != commands.end() && index)
+ {
+ ++i;
+ --index;
+ }
+
+ if (i != commands.end())
+ {
+ return (*i)->getTypeString();
+ }
+
+ return "";
+}
+
+
+QString PIRMacro::getCommandName(
+ int index)
+{
+ CommandSequence::iterator i = commands.begin();
+
+ while (i != commands.end() && index)
+ {
+ ++i;
+ --index;
+ }
+
+ if (i != commands.end())
+ {
+ return (*i)->getName();
+ }
+
+ return "";