+
+void PIRSelectMacroDialog::on_newButton_clicked()
+{
+ emit newMacroRequested();
+ accept();
+}
+
+
+void PIRSelectMacroDialog::on_editButton_clicked()
+{
+ // Find the first selected macro, if any:
+ QList<QTreeWidgetItem *> items = ui->macroTreeWidget->selectedItems();
+
+ if (items.size() > 0)
+ {
+ if (items[0]->parent() == 0)
+ {
+ QMaemo5InformationBox::information(0, "Cannot Edit MacroPacks");
+ }
+ else
+ {
+ emit editMacroRequested(items[0]);
+ }
+ }
+
+ accept();
+}
+
+
+void PIRSelectMacroDialog::on_deleteButton_clicked()
+{
+ // Find the first selected macro, if any:
+ QList<QTreeWidgetItem *> items = ui->macroTreeWidget->selectedItems();
+
+ if (items.size() > 0)
+ {
+ if (items[0]->parent() == 0)
+ {
+ QMaemo5InformationBox::information(0, "Cannot Delete MacroPacks");
+ }
+ else
+ {
+ emit deleteMacroRequested(items[0]);
+ }
+ }
+
+ accept();
+}
+
+
+void PIRSelectMacroDialog::resetIndices()
+{
+ ui->macroTreeWidget->setCurrentItem(
+ ui->macroTreeWidget->topLevelItem(0));
+}