Merge branch 'develop'
[lichviet-widget] / settingsdlg.cpp
1 /*
2 Copyright (C) 2011  by Cuong Le <metacuong@gmail.com>
3
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program.  If not, see <http://www.gnu.org/licenses/>
16 */
17
18 #include "settingsdlg.h"
19
20
21 SettingsDlg::SettingsDlg(QWidget *parent) :
22     QDialog(parent)
23 {
24     this->setWindowTitle(QString::fromUtf8("Lựa Chọn"));
25
26     buttonBox = new QDialogButtonBox(QDialogButtonBox::Save | QDialogButtonBox::Cancel);
27     buttonBox->setOrientation(Qt::Vertical);
28     connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
29     connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
30
31     tabWidget = new QTabWidget;
32     tabWidget ->addTab(new GeneralTab(), QString::fromUtf8("Hiển Thị "));
33     tabWidget ->addTab(new ThemeTab(), QString::fromUtf8("Kiểu Mẫu Widget"));
34
35     mainLayout = new QGridLayout(this);
36
37     mainLayout->addWidget(tabWidget,0,0,1,1);
38     mainLayout->addWidget(buttonBox,0,1,1,1);
39 \
40     this->setLayout(mainLayout);
41
42 }
43
44 void SettingsDlg::showSettingsDialog(){
45     this->show();
46 }
47
48 GeneralTab::GeneralTab(QWidget *parent)
49      : QWidget(parent)
50 {
51     mainLayout = new QVBoxLayout;
52     setLayout(mainLayout);
53 }
54
55 ThemeTab::ThemeTab(QWidget *parent)
56      : QWidget(parent)
57 {
58     themes = new QListWidget(this);
59     themes->addItem(new QListWidgetItem( QString::fromUtf8("Mặc định (344 x 200) pixel.")));
60     themes->addItem(new QListWidgetItem( QString::fromUtf8("Lớn (430 x 500) pixel.")));
61     mainLayout = new QVBoxLayout;
62     mainLayout->addWidget(themes);
63     setLayout(mainLayout);
64 }
65