#include <QMutex>
#include <QtGui/QMessageBox>
#include <QSettings>
+#include <QMaemo5InformationBox>
#include "pirkeysetwidgetitem.h"
#include "pirselectkeysetform.h"
void MainWindow::on_soundModeButton_pressed()
{
- startRepeating(PictureMode_Key);
+ startRepeating(SoundMode_Key);
}
void MainWindow::on_soundModeButton_released()
stopRepeatingFlag = true;
}
+
+QWidget *MainWindow::getSecondaryWindow()
+{
+ return secondaryForm;
+}
+
+
+void MainWindow::selectPrevFavKeyset()
+{
+ int size = ui->favoriteKeysetsWidget->count();
+
+ if (size == 0)
+ {
+ // No favorites, so nothing to do!
+ return;
+ }
+
+ int position = ui->favoriteKeysetsWidget->currentRow();
+
+ --position;
+ if (position < 0)
+ {
+ position = size - 1;
+ }
+
+ ui->favoriteKeysetsWidget->setCurrentRow(
+ position,
+ QItemSelectionModel::ClearAndSelect);
+
+ // Tell the user about the change:
+ QMaemo5InformationBox::information(
+ 0,
+ ui->favoriteKeysetsWidget->item(position)->text());
+}
+
+
+void MainWindow::selectNextFavKeyset()
+{
+ int size = ui->favoriteKeysetsWidget->count();
+
+ if (size == 0)
+ {
+ // No favorites, so just return:
+ return;
+ }
+
+ int position = ui->favoriteKeysetsWidget->currentRow();
+
+ ++position;
+ if (position == size)
+ {
+ position = 0;
+ }
+
+ ui->favoriteKeysetsWidget->setCurrentRow(
+ position,
+ QItemSelectionModel::ClearAndSelect);
+
+ // Tell the user about the change:
+ QMaemo5InformationBox::information(
+ 0,
+ ui->favoriteKeysetsWidget->item(position)->text());
+}