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()
42 void TopResultDialog::changeEvent(QEvent *e)
44 QDialog::changeEvent(e);
46 case QEvent::LanguageChange:
47 ui->retranslateUi(this);
55 void TopResultDialog::on_buttonTopRefresh_clicked()
57 ui->labelTopList->clear();
58 ui->comboBoxTopCategory->clear();
59 emit refreshCategoryList();
62 void TopResultDialog::setCompoBoxCategories(QStringList list)
64 ui->comboBoxTopCategory->addItems(list);
67 void TopResultDialog::showTopList(QString str)
69 ui->labelTopList->setText(str);
72 int TopResultDialog::getRecentCategoryIndex()
74 return recentCategoryIndex;
77 void TopResultDialog::setLimitNr(int number)
82 int TopResultDialog::getLimitNr()
87 void TopResultDialog::on_comboBoxTopCategory_currentIndexChanged(int index)
89 ui->labelTopList->clear();
90 recentCategoryIndex = index;
91 emit refreshTopList(index);
94 void TopResultDialog::setLabelInfoToUser(QString infoText)
96 this->ui->labelInfoToUser->setText(infoText);
100 * This slot function called when ever info button clicked.
102 void TopResultDialog::on_pushButtonInfo_clicked()
104 if(!helpResultsDialog)
106 helpResultsDialog = new HelpResultsDialog;
108 connect(helpResultsDialog, SIGNAL(rejected()), this, SLOT(killHelpDialog()));
109 helpResultsDialog->show();
113 * This slot function called when ever dialog rejected.
115 void TopResultDialog::killHelpDialog()
117 if(helpResultsDialog)
119 qDebug() << "__Top result kill: helpResultsDialog";
120 delete helpResultsDialog;
121 helpResultsDialog = NULL;