* first commit from develop
[lichviet-widget] / settingsdlg.cpp
1 #include "settingsdlg.h"
2
3
4 SettingsDlg::SettingsDlg(QWidget *parent) :
5     QDialog(parent)
6 {
7     this->setWindowTitle(QString::fromUtf8("Lựa Chọn"));
8
9     buttonBox = new QDialogButtonBox(QDialogButtonBox::Save | QDialogButtonBox::Cancel);
10     buttonBox->setOrientation(Qt::Vertical);
11     connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
12     connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
13
14     tabWidget = new QTabWidget;
15     tabWidget ->addTab(new GeneralTab(), QString::fromUtf8("Hiển Thị "));
16     tabWidget ->addTab(new ThemeTab(), QString::fromUtf8("Kiểu Mẫu Widget"));
17
18     mainLayout = new QGridLayout(this);
19
20     mainLayout->addWidget(tabWidget,0,0,1,1);
21     mainLayout->addWidget(buttonBox,0,1,1,1);
22 \
23     this->setLayout(mainLayout);
24
25 }
26
27 void SettingsDlg::showSettingsDialog(){
28     this->show();
29 }
30
31 GeneralTab::GeneralTab(QWidget *parent)
32      : QWidget(parent)
33 {
34     mainLayout = new QVBoxLayout;
35     setLayout(mainLayout);
36 }
37
38 ThemeTab::ThemeTab(QWidget *parent)
39      : QWidget(parent)
40 {
41     themes = new QListWidget(this);
42     themes->addItem(new QListWidgetItem( QString::fromUtf8("Mặc định (344 x 200) pixel.")));
43     themes->addItem(new QListWidgetItem( QString::fromUtf8("Lớn (430 x 500) pixel.")));
44     mainLayout = new QVBoxLayout;
45     mainLayout->addWidget(themes);
46     setLayout(mainLayout);
47 }
48