Route dialog height.
[speedfreak] / Client / topresultdialog.cpp
1 #include <QDebug>
2 #include "topresultdialog.h"
3 #include "ui_topresultdialog.h"
4
5 TopResultDialog::TopResultDialog(QWidget *parent) :
6     QDialog(parent),
7     ui(new Ui::TopResultDialog)
8 {
9     ui->setupUi(this);
10     this->setWindowTitle("Top Results");
11
12     //Set the amount of requested top results here, untill there is user input
13     setLimitNr(10);
14 }
15
16 TopResultDialog::~TopResultDialog()
17 {
18     delete ui;
19 }
20
21 void TopResultDialog::changeEvent(QEvent *e)
22 {
23     QDialog::changeEvent(e);
24     switch (e->type()) {
25     case QEvent::LanguageChange:
26         ui->retranslateUi(this);
27         break;
28     default:
29         break;
30     }
31 }
32
33
34 void TopResultDialog::on_buttonTopRefresh_clicked()
35 {
36     emit refreshCategoryList();
37 }
38
39 void TopResultDialog::setCompoBoxCategories(QStringList list)
40 {
41     ui->comboBoxTopCategory->addItems(list);
42 }
43
44 void TopResultDialog::showTopList(QString str)
45 {
46     ui->labelTopList->setText(str);
47 }
48
49 int TopResultDialog::getRecentCategoryIndex()
50 {
51     return recentCategoryIndex;
52 }
53
54 void TopResultDialog::setLimitNr(int number)
55 {
56     limitNr = number;
57 }
58
59 int TopResultDialog::getLimitNr()
60 {
61     return limitNr;
62 }
63
64 void TopResultDialog::on_comboBoxTopCategory_currentIndexChanged(int index)
65 {
66     recentCategoryIndex = index;
67     emit refreshTopList(index);
68 }
69
70 void TopResultDialog::setLabelInfoToUser(QString infoText)
71 {
72     this->ui->labelInfoToUser->setText(infoText);
73 }