Copyright 2010 Comarch S.A.
*******************************************************************************/
+/*!
+ \file XdxfDictSelectDialog.h
+ \brief Shows dialog with list of dictionaries allowing user
+ to select one of them.
-//Created by Mateusz Półrola
+ \author Mateusz Półrola <mateusz.polrola@comarch.com>
+ */
#ifndef XDXFDICTSELECTDIALOG_H
#define XDXFDICTSELECTDIALOG_H
#include <QDialog>
#include <QtGui>
+#include <QFile>
+#include <QDir>
+#include <QDeclarativeView>
+#include <QDeclarativeContext>
+
#include "DownloadDict.h"
+#include "DictsListModel.h"
#include "DictsModel.h"
#include "DictsProxyModel.h"
+#include "DictsProxyListModel.h"
+
+/*!
+ Shows dialog with list of dictionaries and informations about them,
+ allowing user to filter data based on dictionaries languages,
+ and to select one of them.
+*/
class XdxfDictSelectDialog : public QDialog {
Q_OBJECT
public:
- explicit XdxfDictSelectDialog(QList<DownloadDict> dicts,
+ /*!
+ Constructor
+ \param dicts list of DownloadDict objects describing dictionaries.
+ */
+ XdxfDictSelectDialog(QList<DownloadDict> dicts,
QWidget *parent = 0);
+
+ /*!
+ Returns download link of dictionary selected by user. This string is set
+ only when user select any dictionary (dialog was accepted), otherwise it
+ is empty.
+ */
QString link() { return _link;}
+private Q_SLOTS:
+ //! creates items for comboboxes and creates model with dicts info
+ void initializeDicts();
+
+ //! filters dicts after filtering settings change
+ void refreshDictList();
+
+ //! accept dialog and sets download link of clicked dictionary
+ void itemClicked(QModelIndex);
+
+ void itemClicked(QString link);
+
private:
+ QVBoxLayout* mainLayout;
+ QDeclarativeView *view;
+ DictsListModel* model2;
+ DictsProxyListModel *proxyModel2;
+
QTreeView* treeView;
DictsModel* model;
- DictsProxyModel *proxyModel;
+ DictsProxyModel *proxyModel; //used by treeView to allow filtering and sorti
QVBoxLayout* layout;
QHBoxLayout* checkBoxLayout;
QComboBox* langFrom;
QComboBox* langTo;
-
-private Q_SLOTS:
- void initializeDicts();
- void refreshDictList();
- void itemClicked(QModelIndex);
-
-private:
+ QLabel* langFromLabel;
+ QLabel* langToLabel;
QList<DownloadDict>* dictList;
QString _link;
};