-mdictionary_1.0.0-2_i386.deb user/education optional
+mdictionary_1.0.0-2_armel.deb user/education optional
-shlibs:Depends=libc6 (>= 2.1.3), libc6 (>= 2.3.6-6~), libgcc1 (>= 1:4.1.1), libqt4-xml (>= 4:4.5.3), libqtcore4 (>= 4:4.6.1), libqtgui4 (>= 4:4.6.1), libstdc++6 (>= 4.1.1)
-misc:Depends=
+shlibs:Depends=libc6 (>= 2.5.0-1), libgcc1 (>= 1:4.2.1), libqt4-core (>= 4.6.2~git20100401), libqt4-gui (>= 4.6.2~git20100401), libqt4-xml (>= 4.6.2~git20100401), libstdc++6 (>= 4.2.1)
+++ /dev/null
-all: clean refman.pdf
-
-pdf: refman.pdf
-
-refman.pdf: refman.tex
- pdflatex refman.tex
- makeindex refman.idx
- pdflatex refman.tex
- latex_count=5 ; \
- while egrep -s 'Rerun (LaTeX|to get cross-references right)' refman.log && [ $$latex_count -gt 0 ] ;\
- do \
- echo "Rerunning latex...." ;\
- pdflatex refman.tex ;\
- latex_count=`expr $$latex_count - 1` ;\
- done
-
-
-clean:
- rm -f *.ps *.dvi *.aux *.toc *.idx *.ind *.ilg *.log *.out refman.pdf
dictListWidget = new QListWidget;
verticalLayout->addWidget(dictListWidget);
+ dictListWidget->setSelectionMode(QAbstractItemView::SingleSelection);
+
addNewDictButton = new QPushButton(tr("Add"));
+ removeDictButton = new QPushButton(tr("Remove"));
+ settingsButton = new QPushButton(tr("Settings"));
+
+ removeDictButton->setEnabled(false);
+ settingsButton->setEnabled(false);
+
+ buttonGroup = new QHBoxLayout;
+
+ buttonGroup->addWidget(addNewDictButton);
+ buttonGroup->addWidget(removeDictButton);
+ buttonGroup->addWidget(settingsButton);
+
+ verticalLayout->addLayout(buttonGroup, Qt::AlignBottom);
- verticalLayout->addWidget(addNewDictButton, Qt::AlignBottom);
connect(addNewDictButton, SIGNAL(clicked()),
this, SLOT(addNewDictButtonClicked()));
+ connect(removeDictButton, SIGNAL(clicked()),
+ this, SLOT(removeButtonClicked()));
+
+ connect(settingsButton, SIGNAL(clicked()),
+ this, SLOT(settingsButtonClicked()));
+
+ connect(dictListWidget, SIGNAL(itemClicked(QListWidgetItem*)),
+ this, SLOT(itemSelected(QListWidgetItem*)));
+
+ refreshDictsList();
+
}
void DictManagerWidget::refreshDictsList() {
- QHash<CommonDictInterface*, bool> dicts = backbone->getDictionaries();
dictListWidget->clear();
+ dictsHash.clear();
+
+
+ QHash<CommonDictInterface*, bool> dicts = backbone->getDictionaries();
+
QHashIterator<CommonDictInterface*, bool> i(dicts);
}
dictListWidget->addItem(item);
+ dictsHash.insert(item, i.key());
}
}
void DictManagerWidget::showEvent(QShowEvent *e) {
refreshDictsList();
-
+ removeDictButton->setEnabled(false);
+ settingsButton->setEnabled(false);
QWidget::showEvent(e);
}
+void DictManagerWidget::hideEvent(QHideEvent *e)
+{
+ QList<CommonDictInterface*> checkedDicts;
+
+ for(int i=0; i<dictListWidget->count(); i++) {
+ QListWidgetItem* item = dictListWidget->item(i);
+ if(item->checkState() == Qt::Checked) {
+ checkedDicts.push_back(dictsHash[item]);
+ }
+ }
+ backbone->selectedDictionaries(checkedDicts);
+
+ qDebug()<<"asda";
+
+ QWidget::hideEvent(e);
+}
+
void DictManagerWidget::addNewDictButtonClicked() {
CommonDictInterface* selectedPlugin =
}
}
}
+
+void DictManagerWidget::itemSelected(QListWidgetItem *item) {
+ removeDictButton->setEnabled(true);
+ settingsButton->setEnabled(true);
+}
+
+void DictManagerWidget::removeButtonClicked() {
+ QList<QListWidgetItem*> selected = dictListWidget->selectedItems();
+ if(selected.count() > 0) {
+ backbone->removeDictionary(dictsHash[selected[0]]);
+ refreshDictsList();
+ }
+}
+
+void DictManagerWidget::settingsButtonClicked() {
+ QList<QListWidgetItem*> selected = dictListWidget->selectedItems();
+ if(selected.count() > 0) {
+ dictsHash[selected[0]]->dictDialog()->changeSettings(this);
+ }
+}
protected:
void showEvent(QShowEvent *e);
+ void hideEvent(QHideEvent *e);
private Q_SLOTS:
void addNewDictButtonClicked();
+ void itemSelected(QListWidgetItem*);
+ void removeButtonClicked();
+ void settingsButtonClicked();
private:
QPushButton* addNewDictButton;
+ QPushButton* removeDictButton;
+ QPushButton* settingsButton;
+
QVBoxLayout* verticalLayout;
+ QHBoxLayout* buttonGroup;
QListWidget* dictListWidget;
+
+ QHash<QListWidgetItem*, CommonDictInterface*> dictsHash;
+
Backbone* backbone;
void refreshDictsList();
void WordListWidget::showSearchResults() {
clear();
+ searchResult.clear();
QMultiHash<QString, Translation*> result = backbone->result();
QMultiHash<QString, Translation*>::iterator i;
#include "XdxfDictDialog.h"
#include "XdxfLoadDialog.h"
+#include "XdxfSettingsDialog.h"
+#include "xdxfplugin.h"
-XdxfDictDialog::XdxfDictDialog(QObject *parent) :
+XdxfDictDialog::XdxfDictDialog(XdxfPlugin *plugin, QObject *parent) :
DictDialog(parent) {
+ this->plugin = plugin;
}
return XdxfLoadDialog::getSettings(parent);
}
-void XdxfDictDialog::changeSettings(QWidget *) {
-
+void XdxfDictDialog::changeSettings(QWidget * parent) {
+ XdxfSettingsDialog::getSettings(plugin, parent);
}
#include "../../../includes/DictDialog.h"
#include "XdxfLoadDialog.h"
+class XdxfPlugin;
+
//! Implementation of DictDialog interface for xdxf plugin
class XdxfDictDialog : public DictDialog {
Q_OBJECT
public:
- explicit XdxfDictDialog(QObject *parent = 0);
+ explicit XdxfDictDialog(XdxfPlugin* plugin, 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
*/
void changeSettings(QWidget *parent);
+
+private:
+ XdxfPlugin* plugin;
};
#endif // XDXFDICTDIALOG_H
--- /dev/null
+/*******************************************************************************
+
+ 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
+
+#include "XdxfSettingsDialog.h"
+
+XdxfSettingsDialog::XdxfSettingsDialog(XdxfPlugin *plugin, QWidget *parent) :
+ QDialog(parent)
+{
+ this->plugin = plugin;
+ verticalLayout = new QVBoxLayout;
+ setLayout(verticalLayout);
+
+ setWindowTitle(tr("XDXF Settings"));
+
+
+ infoLabel = new QLabel;
+
+ infoLabel->setText(tr("Plugin type: ") + plugin->type() +"\n" +
+ tr("From: ") + plugin->langFrom() + "\n" +
+ tr("To: ") + plugin->langTo() + "\n" +
+ tr("Description: ") + plugin->name());
+
+ verticalLayout->addWidget(infoLabel);
+
+ browseLayout = new QHBoxLayout;
+ verticalLayout->addLayout(browseLayout);
+
+ browseButton = new QPushButton(tr("Browse"));
+ browseLabel = new QLabel(tr("Dictionary file: ") +
+ plugin->settings()->value("path"));
+
+ browseLayout->addWidget(browseLabel);
+ browseLayout->addWidget(browseButton,0, Qt::AlignRight);
+
+
+ cacheLayout = new QHBoxLayout;
+ verticalLayout->addLayout(cacheLayout);
+
+ cacheButton = new QPushButton(tr("Cache"));
+ if(plugin->settings()->value("Cached") == "true") {
+ cacheButton->setEnabled(false);
+ }
+
+ cacheLayout->addWidget(cacheButton);
+
+ saveButton = new QPushButton(tr("Save settings"));
+
+ verticalLayout->addWidget(saveButton);
+
+ setModal(true);
+
+ /* connect(browseButton, SIGNAL(clicked()),
+ this, SLOT(selectFile()));
+
+ connect(addButton, SIGNAL(clicked()),
+ this, SLOT(addDictionary()));*/
+
+ _dicitonaryFilePath = QString();
+}
+
+Settings* XdxfSettingsDialog::getSettings(XdxfPlugin *plugin,
+ QWidget *parent) {
+ XdxfSettingsDialog settingsDialog(plugin, parent);
+ //Settings* settings = new Settings;
+
+ if(settingsDialog.exec()==QDialog::Accepted) {
+
+
+ return NULL;
+ }
+
+ return NULL;
+}
+
+
--- /dev/null
+/*******************************************************************************
+
+ 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 XDXFSETTINGSDIALOG_H
+#define XDXFSETTINGSDIALOG_H
+
+#include <QDialog>
+#include "../../../includes/settings.h"
+#include <QtGui>
+#include "xdxfplugin.h"
+
+class XdxfSettingsDialog : public QDialog
+{
+ Q_OBJECT
+public:
+ explicit XdxfSettingsDialog(XdxfPlugin* plugin, QWidget *parent = 0);
+
+ static Settings* getSettings(XdxfPlugin* plugin, QWidget *parent);
+
+ //! Returns choosen by user dictionary file path
+ //QString dicitonaryFilePath();
+
+ //! Returns if user want to cache dictionary
+ // bool generateCache();
+
+signals:
+
+public slots:
+
+private:
+ QLabel* infoLabel;
+ QPushButton* saveButton;
+ QPushButton* browseButton;
+ QLabel* browseLabel;
+ QPushButton* cacheButton;
+ QVBoxLayout* verticalLayout;
+ QHBoxLayout* browseLayout;
+ QHBoxLayout* cacheLayout;
+ QString _dicitonaryFilePath;
+ bool _generateCache;
+ XdxfPlugin* plugin;
+};
+
+#endif // XDXFSETTINGSDIALOG_H
xdxfplugin.cpp \
TranslationXdxf.cpp \
XdxfLoadDialog.cpp \
- XdxfDictDialog.cpp
+ XdxfDictDialog.cpp \
+ XdxfSettingsDialog.cpp
HEADERS += \
../../../includes/translation.h \
../../../includes/settings.h \
../../../includes/CommonDictInterface.h \
+ XdxfSettingsDialog.h
_langFrom(tr("")), _langTo(tr("")),_name(tr("")),
_type(tr("xdxf")), _infoNote(tr("")) {
_settings = new Settings();
- _dictDialog = new XdxfDictDialog(this);
+ _dictDialog = new XdxfDictDialog(this, this);
_settings->setValue("Type","xdxf");
if(isCached())
_settings->setValue("Cached","true");
TEMPLATE=subdirs
-SUBDIRS=src tests
+SUBDIRS=src
check.target = check
check.CONFIG = recursive