4 * @author Olavi Pulkkinen <olavi.pulkkinena@fudeco.com>
5 * @author Toni Jussila <toni.jussila@fudeco.com>
6 * @copyright (c) 2010 Speed Freak team
7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
11 #include "topresultdialog.h"
12 #include "ui_topresultdialog.h"
14 TopResultDialog::TopResultDialog(QWidget *parent) :
15 QDialog(parent), ui(new Ui::TopResultDialog)
19 helpResultsDialog = NULL;
21 this->setWindowTitle("Top Results");
23 //Set the amount of requested top results here, untill there is user input
27 ui->buttonTopRefresh->setAutoFillBackground(true);
28 ui->buttonTopRefresh->setStyleSheet("background-color: rgb(0, 0, 0); color: rgb(255, 255, 255)");
29 ui->pushButtonInfo->setAutoFillBackground(true);
30 ui->pushButtonInfo->setStyleSheet("background-color: rgb(0, 0, 0); color: rgb(255, 255, 255)");
33 ui->labelInfoToUser->setText("");
34 ui->labelTopList->setText("");
37 TopResultDialog::~TopResultDialog()
39 qDebug() << "__~TopResultDialog";
43 void TopResultDialog::changeEvent(QEvent *e)
45 QDialog::changeEvent(e);
47 case QEvent::LanguageChange:
48 ui->retranslateUi(this);
56 void TopResultDialog::on_buttonTopRefresh_clicked()
58 ui->labelTopList->clear();
59 ui->comboBoxTopCategory->clear();
60 emit refreshCategoryList();
63 void TopResultDialog::setCompoBoxCategories(QStringList list)
65 ui->comboBoxTopCategory->addItems(list);
68 void TopResultDialog::showTopList(QString str)
70 qDebug() << "__showTopList";
71 ui->labelTopList->setText(str);
74 int TopResultDialog::getRecentCategoryIndex()
76 return recentCategoryIndex;
79 void TopResultDialog::setLimitNr(int number)
84 int TopResultDialog::getLimitNr()
89 void TopResultDialog::on_comboBoxTopCategory_currentIndexChanged(int index)
91 ui->labelTopList->clear();
92 recentCategoryIndex = index;
93 emit refreshTopList(index);
96 void TopResultDialog::setLabelInfoToUser(QString infoText)
98 this->ui->labelInfoToUser->setText(infoText);
102 * This slot function called when ever info button clicked.
104 void TopResultDialog::on_pushButtonInfo_clicked()
106 if(!helpResultsDialog)
108 helpResultsDialog = new HelpResultsDialog;
110 connect(helpResultsDialog, SIGNAL(rejected()), this, SLOT(killHelpDialog()));
111 helpResultsDialog->show();
115 * This slot function called when ever dialog rejected.
117 void TopResultDialog::killHelpDialog()
119 if(helpResultsDialog)
121 qDebug() << "__Top result kill: helpResultsDialog";
122 delete helpResultsDialog;
123 helpResultsDialog = NULL;