X-Git-Url: https://vcs.maemo.org/git/?a=blobdiff_plain;f=forms%2Fpirfavoritesform.cpp;fp=forms%2Fpirfavoritesform.cpp;h=0000000000000000000000000000000000000000;hb=d359576506dc27d7352e1feaa8c38412818db99c;hp=adaa6569070a994b1e03aef1043d98b7c43e6deb;hpb=4a08d7494fbeaf202ea8eeaa641fd3ea808f9160;p=pierogi diff --git a/forms/pirfavoritesform.cpp b/forms/pirfavoritesform.cpp deleted file mode 100644 index adaa656..0000000 --- a/forms/pirfavoritesform.cpp +++ /dev/null @@ -1,111 +0,0 @@ -#include "pirfavoritesform.h" -#include "ui_pirfavoritesform.h" - -#include "mainwindow.h" -//#include "pirkeysetmanager.h" -#include "pirkeysetwidgetitem.h" - -#include - -PIRFavoritesForm::PIRFavoritesForm( - MainWindow *mw) - : QWidget(0), - ui(new Ui::PIRFavoritesForm), - mainWindow(mw) -{ - ui->setupUi(this); -} - -PIRFavoritesForm::~PIRFavoritesForm() -{ - delete ui; -} - - -void PIRFavoritesForm::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); - - mainWindow->keysetSelectionChanged( - ui->favoriteKeysetsWidget->currentItem()); - - // Tell the user about the change: - QMaemo5InformationBox::information( - 0, - ui->favoriteKeysetsWidget->item(position)->text()); -} - - -void PIRFavoritesForm::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); - - mainWindow->keysetSelectionChanged( - ui->favoriteKeysetsWidget->currentItem()); - - // Tell the user about the change: - QMaemo5InformationBox::information( - 0, - ui->favoriteKeysetsWidget->item(position)->text()); -} - - -void PIRFavoritesForm::addItem( - PIRKeysetWidgetItem *item) -{ - ui->favoriteKeysetsWidget->addItem(item); -} - - -QListWidget *PIRFavoritesForm::getFavoritesListWidget() -{ - return ui->favoriteKeysetsWidget; -} - - -void PIRFavoritesForm::on_addKeysetButton_clicked() -{ - mainWindow->addCurrentKeyset(ui->favoriteKeysetsWidget); -} - - -void PIRFavoritesForm::on_removeKeysetButton_clicked() -{ - mainWindow->removeFavoriteKeyset(ui->favoriteKeysetsWidget); -}