From ad11b3992fbc6cb8f25f587e6061314f288e3730 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Mateusz=20P=C3=B3=C5=82rola?= Date: Thu, 5 Aug 2010 15:37:35 +0200 Subject: [PATCH] Moved files from old XdxfPlugin directory --- make-plugins | 2 +- trunk/src/plugins/xdxf/src/XdxfDictDialog.cpp | 39 +++++++ trunk/src/plugins/xdxf/src/XdxfDictDialog.h | 50 +++++++++ trunk/src/plugins/xdxf/src/XdxfLoadDialog.cpp | 110 ++++++++++++++++++++ trunk/src/plugins/xdxf/src/XdxfLoadDialog.h | 70 +++++++++++++ trunk/src/plugins/xdxf/src/XdxfPlugin.pro | 2 +- .../plugins/xdxf/src/XdxfPlugin/XdxfDictDialog.cpp | 39 ------- .../plugins/xdxf/src/XdxfPlugin/XdxfDictDialog.h | 50 --------- .../plugins/xdxf/src/XdxfPlugin/XdxfLoadDialog.cpp | 110 -------------------- .../plugins/xdxf/src/XdxfPlugin/XdxfLoadDialog.h | 70 ------------- trunk/src/plugins/xdxf/src/xdxfplugin.cpp | 2 +- 11 files changed, 272 insertions(+), 272 deletions(-) create mode 100644 trunk/src/plugins/xdxf/src/XdxfDictDialog.cpp create mode 100644 trunk/src/plugins/xdxf/src/XdxfDictDialog.h create mode 100644 trunk/src/plugins/xdxf/src/XdxfLoadDialog.cpp create mode 100644 trunk/src/plugins/xdxf/src/XdxfLoadDialog.h delete mode 100644 trunk/src/plugins/xdxf/src/XdxfPlugin/XdxfDictDialog.cpp delete mode 100644 trunk/src/plugins/xdxf/src/XdxfPlugin/XdxfDictDialog.h delete mode 100644 trunk/src/plugins/xdxf/src/XdxfPlugin/XdxfLoadDialog.cpp delete mode 100644 trunk/src/plugins/xdxf/src/XdxfPlugin/XdxfLoadDialog.h diff --git a/make-plugins b/make-plugins index 0cbfed9..40377d1 100755 --- a/make-plugins +++ b/make-plugins @@ -9,7 +9,7 @@ for pro in *; do qmake *.pro make clean make - mv `find . -name "*.so.*" -type f` "../../../base-build-desktop/$pro.so" + mv `find . -name "*.so.*" -type f` "../../../base/$pro.so" popd fi done diff --git a/trunk/src/plugins/xdxf/src/XdxfDictDialog.cpp b/trunk/src/plugins/xdxf/src/XdxfDictDialog.cpp new file mode 100644 index 0000000..0e672ce --- /dev/null +++ b/trunk/src/plugins/xdxf/src/XdxfDictDialog.cpp @@ -0,0 +1,39 @@ +/******************************************************************************* + + 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 . + + Copyright 2010 Comarch S.A. + +*******************************************************************************/ + +//Created by Mateusz Półrola + +#include "XdxfDictDialog.h" +#include "XdxfLoadDialog.h" + +XdxfDictDialog::XdxfDictDialog(QObject *parent) : + DictDialog(parent) { + +} + + +Settings* XdxfDictDialog::addNewDictionary(QWidget *parent) { + return XdxfLoadDialog::getSettings(parent); +} + +void XdxfDictDialog::changeSettings(QWidget *) { + +} diff --git a/trunk/src/plugins/xdxf/src/XdxfDictDialog.h b/trunk/src/plugins/xdxf/src/XdxfDictDialog.h new file mode 100644 index 0000000..4384fcd --- /dev/null +++ b/trunk/src/plugins/xdxf/src/XdxfDictDialog.h @@ -0,0 +1,50 @@ +/******************************************************************************* + + 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 . + + Copyright 2010 Comarch S.A. + +*******************************************************************************/ + +//Created by Mateusz Półrola + +#ifndef XDXFDICTDIALOG_H +#define XDXFDICTDIALOG_H + +#include "../../../includes/DictDialog.h" +#include "XdxfLoadDialog.h" + + +//! Implementation of DictDialog interface for xdxf plugin +class XdxfDictDialog : public DictDialog { + Q_OBJECT +public: + explicit XdxfDictDialog(QObject *parent = 0); + + /*! + Shows add new xdxf dictionary dialog and returns settings of new dict + \param parent parent widget on which will be displayed dialog + */ + Settings* addNewDictionary(QWidget *parent); + + /*! + Shows settings dialog and save new settings in plugin + \param parent parent widget on which will be displayed dialog + */ + void changeSettings(QWidget *parent); +}; + +#endif // XDXFDICTDIALOG_H diff --git a/trunk/src/plugins/xdxf/src/XdxfLoadDialog.cpp b/trunk/src/plugins/xdxf/src/XdxfLoadDialog.cpp new file mode 100644 index 0000000..2666ffa --- /dev/null +++ b/trunk/src/plugins/xdxf/src/XdxfLoadDialog.cpp @@ -0,0 +1,110 @@ +/******************************************************************************* + + 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 . + + Copyright 2010 Comarch S.A. + +*******************************************************************************/ + +//Created by Mateusz Półrola + +#include "XdxfLoadDialog.h" + +XdxfLoadDialog::XdxfLoadDialog(QWidget *parent) : + QDialog(parent) { + verticalLayout = new QVBoxLayout; + setLayout(verticalLayout); + + setWindowTitle(tr("Add new XDXF dictionary")); + + browseLayout = new QHBoxLayout; + verticalLayout->addLayout(browseLayout); + + browseButton = new QPushButton(tr("Browse")); + browseLabel = new QLabel(tr("Dictionary file: not selected")); + + browseLayout->addWidget(browseLabel); + browseLayout->addWidget(browseButton,0, Qt::AlignRight); + + + cacheLayout = new QHBoxLayout; + verticalLayout->addLayout(cacheLayout); + + cacheCheckBox = new QCheckBox(tr("Optimize for quicker searches (may take some time)")); + cacheCheckBox->setChecked(true); + cacheLayout->addWidget(cacheCheckBox); + + addButton = new QPushButton(tr("Add")); + + verticalLayout->addWidget(addButton); + + setModal(true); + + connect(browseButton, SIGNAL(clicked()), + this, SLOT(selectFile())); + + connect(addButton, SIGNAL(clicked()), + this, SLOT(addDictionary())); + + _dicitonaryFilePath = QString(); +} + +void XdxfLoadDialog::selectFile() { + QString fileName = QFileDialog::getOpenFileName(this, + tr("Select dictionary file"), + "", + tr("XDXF Files (*.xdxf)"), + NULL, + NULL); + if (!fileName.isEmpty()) { + browseLabel->setText(tr("Dictionary file: ") + fileName); + _dicitonaryFilePath = fileName; + } +} + +void XdxfLoadDialog::addDictionary() { + _generateCache = cacheCheckBox->isChecked(); + accept(); +} + +QString XdxfLoadDialog::dicitonaryFilePath() { + return _dicitonaryFilePath; +} + +bool XdxfLoadDialog::generateCache() { + return _generateCache; +} + +Settings* XdxfLoadDialog::getSettings(QWidget *parent) { + XdxfLoadDialog loadDialog(parent); + Settings* settings = new Settings; + + if(loadDialog.exec()==QDialog::Accepted) { + settings->setValue("dictionaryFile", loadDialog.dicitonaryFilePath()); + if(loadDialog.generateCache()) { + settings->setValue("cache", "1"); + } + else { + settings->setValue("cache", "0"); + } + + return settings; + } + + return NULL; +} + + diff --git a/trunk/src/plugins/xdxf/src/XdxfLoadDialog.h b/trunk/src/plugins/xdxf/src/XdxfLoadDialog.h new file mode 100644 index 0000000..3b102fc --- /dev/null +++ b/trunk/src/plugins/xdxf/src/XdxfLoadDialog.h @@ -0,0 +1,70 @@ +/******************************************************************************* + + 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 . + + Copyright 2010 Comarch S.A. + +*******************************************************************************/ + +//Created by Mateusz Półrola + +#ifndef XDXFLOADDIALOG_H +#define XDXFLOADDIALOG_H + +#include +#include +#include "../../../includes/settings.h" + +//! Displays dialog which allow user to add new xdxf dictionary +class XdxfLoadDialog : public QDialog { + Q_OBJECT +public: + explicit XdxfLoadDialog(QWidget *parent = 0); + + /*! Displays dialog and returns settings of new dictionary + \return Setting object containing new dictionary settings or NULL in + case which user cancel dialog + */ + static Settings* getSettings(QWidget *parent); + + //! Returns choosen by user dictionary file path + QString dicitonaryFilePath(); + + //! Returns if user want to cache dictionary + bool generateCache(); + +signals: + +public slots: + +private Q_SLOTS: + void selectFile(); + void addDictionary(); + +private: + QPushButton* addButton; + QPushButton* browseButton; + QLabel* browseLabel; + QCheckBox* cacheCheckBox; + QVBoxLayout* verticalLayout; + QHBoxLayout* browseLayout; + QHBoxLayout* cacheLayout; + QString _dicitonaryFilePath; + bool _generateCache; + +}; + +#endif // XDXFLOADDIALOG_H diff --git a/trunk/src/plugins/xdxf/src/XdxfPlugin.pro b/trunk/src/plugins/xdxf/src/XdxfPlugin.pro index c82bc62..0c4b06b 100644 --- a/trunk/src/plugins/xdxf/src/XdxfPlugin.pro +++ b/trunk/src/plugins/xdxf/src/XdxfPlugin.pro @@ -22,7 +22,7 @@ HEADERS += \ TranslationXdxf.h \ XdxfLoadDialog.h \ ../../../includes/DictDialog.h \ - XdxfDictDialog.h + XdxfDictDialog.h \ ../../../includes/translation.h \ ../../../includes/settings.h \ ../../../includes/CommonDictInterface.h \ diff --git a/trunk/src/plugins/xdxf/src/XdxfPlugin/XdxfDictDialog.cpp b/trunk/src/plugins/xdxf/src/XdxfPlugin/XdxfDictDialog.cpp deleted file mode 100644 index 0e672ce..0000000 --- a/trunk/src/plugins/xdxf/src/XdxfPlugin/XdxfDictDialog.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/******************************************************************************* - - 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 . - - Copyright 2010 Comarch S.A. - -*******************************************************************************/ - -//Created by Mateusz Półrola - -#include "XdxfDictDialog.h" -#include "XdxfLoadDialog.h" - -XdxfDictDialog::XdxfDictDialog(QObject *parent) : - DictDialog(parent) { - -} - - -Settings* XdxfDictDialog::addNewDictionary(QWidget *parent) { - return XdxfLoadDialog::getSettings(parent); -} - -void XdxfDictDialog::changeSettings(QWidget *) { - -} diff --git a/trunk/src/plugins/xdxf/src/XdxfPlugin/XdxfDictDialog.h b/trunk/src/plugins/xdxf/src/XdxfPlugin/XdxfDictDialog.h deleted file mode 100644 index b9292f6..0000000 --- a/trunk/src/plugins/xdxf/src/XdxfPlugin/XdxfDictDialog.h +++ /dev/null @@ -1,50 +0,0 @@ -/******************************************************************************* - - 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 . - - Copyright 2010 Comarch S.A. - -*******************************************************************************/ - -//Created by Mateusz Półrola - -#ifndef XDXFDICTDIALOG_H -#define XDXFDICTDIALOG_H - -#include "../../../../includes/DictDialog.h" -#include "XdxfLoadDialog.h" - - -//! Implementation of DictDialog interface for xdxf plugin -class XdxfDictDialog : public DictDialog { - Q_OBJECT -public: - explicit XdxfDictDialog(QObject *parent = 0); - - /*! - Shows add new xdxf dictionary dialog and returns settings of new dict - \param parent parent widget on which will be displayed dialog - */ - Settings* addNewDictionary(QWidget *parent); - - /*! - Shows settings dialog and save new settings in plugin - \param parent parent widget on which will be displayed dialog - */ - void changeSettings(QWidget *parent); -}; - -#endif // XDXFDICTDIALOG_H diff --git a/trunk/src/plugins/xdxf/src/XdxfPlugin/XdxfLoadDialog.cpp b/trunk/src/plugins/xdxf/src/XdxfPlugin/XdxfLoadDialog.cpp deleted file mode 100644 index 2666ffa..0000000 --- a/trunk/src/plugins/xdxf/src/XdxfPlugin/XdxfLoadDialog.cpp +++ /dev/null @@ -1,110 +0,0 @@ -/******************************************************************************* - - 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 . - - Copyright 2010 Comarch S.A. - -*******************************************************************************/ - -//Created by Mateusz Półrola - -#include "XdxfLoadDialog.h" - -XdxfLoadDialog::XdxfLoadDialog(QWidget *parent) : - QDialog(parent) { - verticalLayout = new QVBoxLayout; - setLayout(verticalLayout); - - setWindowTitle(tr("Add new XDXF dictionary")); - - browseLayout = new QHBoxLayout; - verticalLayout->addLayout(browseLayout); - - browseButton = new QPushButton(tr("Browse")); - browseLabel = new QLabel(tr("Dictionary file: not selected")); - - browseLayout->addWidget(browseLabel); - browseLayout->addWidget(browseButton,0, Qt::AlignRight); - - - cacheLayout = new QHBoxLayout; - verticalLayout->addLayout(cacheLayout); - - cacheCheckBox = new QCheckBox(tr("Optimize for quicker searches (may take some time)")); - cacheCheckBox->setChecked(true); - cacheLayout->addWidget(cacheCheckBox); - - addButton = new QPushButton(tr("Add")); - - verticalLayout->addWidget(addButton); - - setModal(true); - - connect(browseButton, SIGNAL(clicked()), - this, SLOT(selectFile())); - - connect(addButton, SIGNAL(clicked()), - this, SLOT(addDictionary())); - - _dicitonaryFilePath = QString(); -} - -void XdxfLoadDialog::selectFile() { - QString fileName = QFileDialog::getOpenFileName(this, - tr("Select dictionary file"), - "", - tr("XDXF Files (*.xdxf)"), - NULL, - NULL); - if (!fileName.isEmpty()) { - browseLabel->setText(tr("Dictionary file: ") + fileName); - _dicitonaryFilePath = fileName; - } -} - -void XdxfLoadDialog::addDictionary() { - _generateCache = cacheCheckBox->isChecked(); - accept(); -} - -QString XdxfLoadDialog::dicitonaryFilePath() { - return _dicitonaryFilePath; -} - -bool XdxfLoadDialog::generateCache() { - return _generateCache; -} - -Settings* XdxfLoadDialog::getSettings(QWidget *parent) { - XdxfLoadDialog loadDialog(parent); - Settings* settings = new Settings; - - if(loadDialog.exec()==QDialog::Accepted) { - settings->setValue("dictionaryFile", loadDialog.dicitonaryFilePath()); - if(loadDialog.generateCache()) { - settings->setValue("cache", "1"); - } - else { - settings->setValue("cache", "0"); - } - - return settings; - } - - return NULL; -} - - diff --git a/trunk/src/plugins/xdxf/src/XdxfPlugin/XdxfLoadDialog.h b/trunk/src/plugins/xdxf/src/XdxfPlugin/XdxfLoadDialog.h deleted file mode 100644 index fd367e5..0000000 --- a/trunk/src/plugins/xdxf/src/XdxfPlugin/XdxfLoadDialog.h +++ /dev/null @@ -1,70 +0,0 @@ -/******************************************************************************* - - 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 . - - Copyright 2010 Comarch S.A. - -*******************************************************************************/ - -//Created by Mateusz Półrola - -#ifndef XDXFLOADDIALOG_H -#define XDXFLOADDIALOG_H - -#include -#include -#include "../../../../includes/settings.h" - -//! Displays dialog which allow user to add new xdxf dictionary -class XdxfLoadDialog : public QDialog { - Q_OBJECT -public: - explicit XdxfLoadDialog(QWidget *parent = 0); - - /*! Displays dialog and returns settings of new dictionary - \return Setting object containing new dictionary settings or NULL in - case which user cancel dialog - */ - static Settings* getSettings(QWidget *parent); - - //! Returns choosen by user dictionary file path - QString dicitonaryFilePath(); - - //! Returns if user want to cache dictionary - bool generateCache(); - -signals: - -public slots: - -private Q_SLOTS: - void selectFile(); - void addDictionary(); - -private: - QPushButton* addButton; - QPushButton* browseButton; - QLabel* browseLabel; - QCheckBox* cacheCheckBox; - QVBoxLayout* verticalLayout; - QHBoxLayout* browseLayout; - QHBoxLayout* cacheLayout; - QString _dicitonaryFilePath; - bool _generateCache; - -}; - -#endif // XDXFLOADDIALOG_H diff --git a/trunk/src/plugins/xdxf/src/xdxfplugin.cpp b/trunk/src/plugins/xdxf/src/xdxfplugin.cpp index b06bca5..c1c161f 100644 --- a/trunk/src/plugins/xdxf/src/xdxfplugin.cpp +++ b/trunk/src/plugins/xdxf/src/xdxfplugin.cpp @@ -4,7 +4,7 @@ #include #include #include "TranslationXdxf.h" -#include "../../../../includes/settings.h" +#include "../../../includes/settings.h" XdxfPlugin::XdxfPlugin(QObject *parent) : CommonDictInterface(parent), _langFrom(tr("")), _langTo(tr("")),_name(tr("")), -- 1.7.9.5