New xdxf dialog, one which provides methods to add new or change setting of existing...
[mdictionary] / src / plugins / xdxf / XdxfDialog.h
diff --git a/src/plugins/xdxf/XdxfDialog.h b/src/plugins/xdxf/XdxfDialog.h
new file mode 100644 (file)
index 0000000..a9af3d8
--- /dev/null
@@ -0,0 +1,96 @@
+/*******************************************************************************
+
+    This file is part of mDictionary.
+
+    mDictionary is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    mDictionary is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with mDictionary.  If not, see <http://www.gnu.org/licenses/>.
+
+    Copyright 2010 Comarch S.A.
+
+*******************************************************************************/
+
+//Created by Mateusz Półrola
+
+#ifndef XDXFDIALOG_H
+#define XDXFDIALOG_H
+
+#include <QDialog>
+#include "../../include/settings.h"
+#include <QtGui>
+#include "xdxfplugin.h"
+
+class XdxfDialog : public QDialog
+{
+    Q_OBJECT
+public:
+    enum XdxfDialogType {New, Change};
+
+    explicit XdxfDialog(XdxfPlugin* plugin = 0, XdxfDialogType type = New,
+                        QWidget *parent = 0);
+
+    Settings* getSettings();
+
+Q_SIGNALS:
+    void notify(Notify::NotifyType, QString, QWidget*);
+
+public Q_SLOTS:
+    void accept();
+
+private Q_SLOTS:
+    void selectFile();
+    void saveSettings();
+    void setGenerateCache(bool);
+    void setAccents(bool);
+
+    void showCacheInfo();
+    void showAccentsInfo();
+
+
+private:
+    void initializeUI();
+
+    QLabel* browseLabel;
+    QPushButton* browseButton;
+    QHBoxLayout* browseLayout;
+
+    QLabel* infoLabel;
+
+    QCheckBox* cacheCheckBox;
+    QCheckBox* accentsCheckBox;
+    QHBoxLayout* cacheLayout;
+    QHBoxLayout* accentsLayout;
+    QToolButton* cacheInfoToolButton;
+    QToolButton* accentsInfoToolButton;
+
+    QPushButton* saveButton;
+    QPushButton* addButton;
+
+    QString _dictionaryFilePath;
+
+    QScrollArea* scrollArea;
+
+    QWidget* widget;
+    QHBoxLayout* layout;
+
+    QVBoxLayout* mainVerticalLayout;
+    bool _generateCache;
+    bool _accents;
+    bool _lastAccents;
+
+    Settings* _settings;
+
+    XdxfPlugin* plugin;
+    XdxfDialogType type;
+};
+
+#endif // XDXFDIALOG_H