Added xdxf dict downloader
[mdictionary] / src / plugins / xdxf / XdxfDictSelectDialog.cpp
1 /*******************************************************************************
2
3     This file is part of mDictionary.
4
5     mDictionary is free software: you can redistribute it and/or modify
6     it under the terms of the GNU General Public License as published by
7     the Free Software Foundation, either version 3 of the License, or
8     (at your option) any later version.
9
10     mDictionary is distributed in the hope that it will be useful,
11     but WITHOUT ANY WARRANTY; without even the implied warranty of
12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13     GNU General Public License for more details.
14
15     You should have received a copy of the GNU General Public License
16     along with mDictionary.  If not, see <http://www.gnu.org/licenses/>.
17
18     Copyright 2010 Comarch S.A.
19
20 *******************************************************************************/
21
22 //Created by Mateusz Półrola
23
24 #include "XdxfDictSelectDialog.h"
25
26 XdxfDictSelectDialog::XdxfDictSelectDialog(QWidget *parent) :
27     QDialog(parent) {
28     layout = new QVBoxLayout;
29     setLayout(layout);
30
31     checkBoxLayout = new QHBoxLayout;
32     layout->addLayout(checkBoxLayout);
33
34     langFrom = new QComboBox;
35     langTo = new QComboBox;
36
37     checkBoxLayout->addWidget(langFrom);
38     checkBoxLayout->addWidget(langTo);
39
40
41     treeWidget = new QTreeWidget;
42     treeWidget->setRootIsDecorated(false);
43     treeWidget->setColumnCount(4);
44     QStringList headers;
45     headers << tr("From") << tr("To") << tr("Name") << tr("Size");
46     treeWidget->setHeaderLabels(headers);
47     treeWidget->setColumnWidth(0, 100);
48     treeWidget->setColumnWidth(1, 100);
49     treeWidget->setColumnWidth(2, 100);
50     treeWidget->setColumnWidth(3, 100);
51     layout->addWidget(treeWidget);
52
53
54     connect(langFrom, SIGNAL(currentIndexChanged(int)),
55             this, SLOT(refreshDictList()));
56
57     connect(langTo, SIGNAL(currentIndexChanged(int)),
58             this, SLOT(refreshDictList()));
59
60     #ifndef Q_WS_MAEMO_5
61         setMinimumSize(400,200);
62     #else
63         setMinimumHeight(350);
64     #endif
65
66     refreshDictList();
67 }
68
69
70 void XdxfDictSelectDialog::refreshDictList() {
71     QStringList l;
72     l << "pies" << "kot";
73     treeWidget->insertTopLevelItem(0, new QTreeWidgetItem(l));
74 }