QFile file(":/xsl/xsl.xsl");
if(!file.open(QFile::ReadOnly))
- qDebug()<<"can't open a xslt file";
+ qDebug()<<"error can't open a xslt file";
else
xslt=file.readAll();
}
void WordListWidget::wordClicked(QModelIndex index) {
//we're getting translation based on data in index
- qDebug()<<searchResult[index.data().toString()].at(0)->dictionaryInfo();
+ //qDebug()<<searchResult[index.data().toString()].at(0)->dictionaryInfo();
Q_EMIT showTranslation(
searchResult[index.data().toString()]);
}
+/*******************************************************************************
+
+ 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.
+
+*******************************************************************************/
+
+/*! \file GoogleDictDialog.cpp
+ \author Jakub Jaszczynski <j.j.jaszczynski@gmail.com>
+*/
+
#include "GoogleDictDialog.h"
GoogleDictDialog::GoogleDictDialog(GooglePlugin *plugin, QObject *parent) :
}
void GoogleDictDialog::changeSettings(QWidget * parent) {
- qDebug()<<"tu";
GoogleSettingsDialog::changeSettings(plugin,parent);
}
+/*******************************************************************************
+
+ 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.
+
+*******************************************************************************/
+
+/*! \file GoogleDictDialog.h
+ \brief Class launch a dialogs witch generete new dictionary, or change
+ settings
+ \author Jakub Jaszczynski <j.j.jaszczynski@gmail.com>
+*/
+
#ifndef GOOGLEDICTDIALOG_H
#define GOOGLEDICTDIALOG_H
public:
explicit GoogleDictDialog(GooglePlugin* plugin, QObject *parent = 0);
/*!
- Shows add new xdxf dictionary dialog and returns settings of new dict
+ Shows add new google dictionary dialog and returns settings of new dict
\param parent parent widget on which will be displayed dialog
*/
Settings* addNewDictionary(QWidget *parent);
*******************************************************************************/
/*! \file GooglePlugin.cpp
+ \author Jakub Jaszczynski <j.j.jaszczynski@gmail.com>
*/
#include "GooglePlugin.h"
http->setHost("www.google.pl");
wait=true;
http->request(head, data);
- while(wait);
+ QString error("");
+ while(wait && (error=="" || error=="Unknown error"))
+ error=http->errorString();
+ if(error!="" && error!="Unknown error")
+ qDebug()<<error;
QString text = QString::fromUtf8(http->readAll());
text=jsonParse(text);
int pos=0,pos2=0;
int index=0;
int size=0;
- qDebug()<<result;
QString returnLang;
QString translation;
QString original;
returnLang=list1.at(index*2+1);
if(partOfSpeach.size()==0){
if(translation==original){
- qDebug()<<"This word don't exist";
+ // qDebug()<<"This word don't exist";
return QString("");
}
else
*******************************************************************************/
-
/*! \file GooglePlugin.h
+
+ \author Jakub Jaszczynski <j.j.jaszczynski@gmail.com>
*/
+
#ifndef GOOGLEPLUGIN_H
#define GOOGLEPLUGIN_H
+/*******************************************************************************
+
+ 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.
+
+*******************************************************************************/
+
+/*! \file GoogleSettingsDialog.cpp
+ \author Jakub Jaszczynski <j.j.jaszczynski@gmail.com>
+*/
+
#include "GoogleSettingsDialog.h"
#include <QDebug>
}
QString GoogleSettingsDialog::langFrom() {
- qDebug()<<_langFrom;
return _langFrom;
}
QString GoogleSettingsDialog::langTo() {
- qDebug()<<_langTo;
return _langTo;
}
Settings *settings = new Settings();
settings->setValue("langTo",languages.value(settingsDialog.langTo()));
settings->setValue("langFrom",languages.value(settingsDialog.langFrom()));
- qDebug()<<"gosc" << settings->value("langTo") <<settings->value("langFrom");
return settings;
}
return 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 <http://www.gnu.org/licenses/>.
+
+ Copyright 2010 Comarch S.A.
+
+*******************************************************************************/
+
+/*! \file GoogleSettingsDialog.h
+ \brief Class create dialog to get or change settings for Google Plagin
+ \author Jakub Jaszczynski <j.j.jaszczynski@gmail.com>
+*/
+
#ifndef GOOGLESETTINGSDIALOG_H
#define GOOGLESETTINGSDIALOG_H
public:
explicit GoogleSettingsDialog(QWidget *parent = 0,QString langTo ="",QString langFrom ="");
+ /*!
+ \param parent parent widget on which will be displayed dialog
+ \param langTo language witch is display in the comboBox as a startup item
+ \param langFrom language witch is display in the comboBox as a startup item
+ \returns function return settings to GooglePlugin
+ */
static Settings* getSettings(QWidget *parent,QString langTo ="",QString langFrom ="");
+
+ /*!
+ function set a new settings in plugin;
+ \param plugin plugin whose settings you will change
+ \param parent parent widget on which will be displayed dialog
+ */
static void changeSettings(GooglePlugin* plugin, QWidget *parent);
+
+ //! \return source language code iso 639-2
QString langFrom();
+
+ //! \return destination language code iso 639-2
QString langTo();
public slots:
+/*******************************************************************************
+
+ 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.
+
+*******************************************************************************/
+
+/*! \file TranslationGoogle.cpp
+ \author Jakub Jaszczynski <j.j.jaszczynski@gmail.com>
+*/
+
#include "TranslationGoogle.h"
TranslationGoogle::TranslationGoogle():_key(""),_trans(""),_dictionaryInfo("") {
+/*******************************************************************************
+
+ 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.
+
+*******************************************************************************/
+
+/*! \file TranslationGoogle.h
+ \author Jakub Jaszczynski <j.j.jaszczynski@gmail.com>
+*/
+
#ifndef TRANSLATIONGOOGLE_H
#define TRANSLATIONGOOGLE_H
*******************************************************************************/
/*! \file TranslationXdxf.cpp
+ \author Jakub Jaszczynski <j.j.jaszczynski@gmail.com>
*/
*******************************************************************************/
/*! \file xdxfplugin.cpp
+\author Jakub Jaszczynski <j.j.jaszczynski@gmail.com>
*/
#include "xdxfplugin.h"