Added help and setting dialog's fonts changed bigger.
[speedfreak] / Client / topresultdialog.cpp
1 /*
2  * Topresultdialog
3  *
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
8  */
9
10 #include <QDebug>
11 #include "topresultdialog.h"
12 #include "ui_topresultdialog.h"
13
14 TopResultDialog::TopResultDialog(QWidget *parent) :
15     QDialog(parent),
16     ui(new Ui::TopResultDialog)
17 {
18     ui->setupUi(this);
19     this->setWindowTitle("Top Results");
20
21     //Set the amount of requested top results here, untill there is user input
22     setLimitNr(10);
23
24     //Button settings
25     ui->buttonTopRefresh->setAutoFillBackground(true);
26     ui->buttonTopRefresh->setStyleSheet("background-color: rgb(0, 0, 0); color: rgb(255, 255, 255)");
27 }
28
29 TopResultDialog::~TopResultDialog()
30 {
31     delete ui;
32 }
33
34 void TopResultDialog::changeEvent(QEvent *e)
35 {
36     QDialog::changeEvent(e);
37     switch (e->type()) {
38     case QEvent::LanguageChange:
39         ui->retranslateUi(this);
40         break;
41     default:
42         break;
43     }
44 }
45
46
47 void TopResultDialog::on_buttonTopRefresh_clicked()
48 {
49     ui->labelTopList->clear();
50     ui->comboBoxTopCategory->clear();
51     emit refreshCategoryList();
52 }
53
54 void TopResultDialog::setCompoBoxCategories(QStringList list)
55 {
56     ui->comboBoxTopCategory->addItems(list);
57 }
58
59 void TopResultDialog::showTopList(QString str)
60 {
61     ui->labelTopList->setText(str);
62 }
63
64 int TopResultDialog::getRecentCategoryIndex()
65 {
66     return recentCategoryIndex;
67 }
68
69 void TopResultDialog::setLimitNr(int number)
70 {
71     limitNr = number;
72 }
73
74 int TopResultDialog::getLimitNr()
75 {
76     return limitNr;
77 }
78
79 void TopResultDialog::on_comboBoxTopCategory_currentIndexChanged(int index)
80 {
81     ui->labelTopList->clear();
82     recentCategoryIndex = index;
83     emit refreshTopList(index);
84 }
85
86 void TopResultDialog::setLabelInfoToUser(QString infoText)
87 {
88     this->ui->labelInfoToUser->setText(infoText);
89 }