add history widget
authorjakub <jakub.jaszczynski@comarch.com>
Fri, 21 Jan 2011 08:55:45 +0000 (09:55 +0100)
committerjakub <jakub.jaszczynski@comarch.com>
Fri, 21 Jan 2011 08:55:45 +0000 (09:55 +0100)
22 files changed:
src/mdictionary/gui/DictTypeSelectDialog.cpp
src/mdictionary/gui/HistoryListDialog.cpp
src/mdictionary/gui/HistoryListDialog.h
src/mdictionary/gui/HistoryListModel.cpp [new file with mode: 0644]
src/mdictionary/gui/HistoryListModel.h [new file with mode: 0644]
src/mdictionary/gui/MainWindow.cpp
src/mdictionary/mdictionary.pro
src/mdictionary/qml/DictTypeSelectDialog.qml
src/mdictionary/qml/HistoryListDialog.qml [new file with mode: 0644]
src/mdictionary/qml/ProgressBar.qml
src/mdictionary/qml/StarDictDialog.qml [new file with mode: 0644]
src/mdictionary/qml/XdxfDialog.qml
src/mdictionary/qml/XdxfDictDownloader.qml [new file with mode: 0644]
src/plugins/google/GoogleDialog.h
src/plugins/google/google.pro
src/plugins/stardict/stardict.pro
src/plugins/xdxf/XdxfDialog.h
src/plugins/xdxf/XdxfDictDownloadProgressDialog.cpp
src/plugins/xdxf/XdxfDictDownloadProgressDialog.h
src/plugins/xdxf/XdxfDictDownloader.cpp
src/plugins/xdxf/XdxfDictDownloader.h
src/plugins/xdxf/xdxf.pro

index 4ab853b..bf61dd2 100644 (file)
@@ -41,9 +41,8 @@ DictTypeSelectDialog::DictTypeSelectDialog(QList<CommonDictInterface *> plugins,
     qmlView = new QDeclarativeView(this);
 
     ctxt = qmlView->rootContext();
-
-//    model = new DictTypeModel(plugins, this);
     ctxt->setContextProperty("dictTypeModel", &model);
+
     qmlView->setSource(QUrl::fromLocalFile("/usr/share/mdictionary/qml/DictTypeSelectDialog.qml"));
 
     _selectedPlugin = 0;
index 0074181..804f907 100644 (file)
 #include "HistoryListDialog.h"
 
 HistoryListDialog::HistoryListDialog(QStringList words, QWidget *parent):
-        QDialog(parent)
-{
+        QDialog(parent) {
+
+    oryginalList = words;
     verticalLayout = new QVBoxLayout(this);
     setLayout(verticalLayout);
+    setModal(true);
+    setWindowFlags(Qt::Popup);
+
+#ifndef Q_WS_MAEMO_5
+
+    HistoryListModel *model=new HistoryListModel(words,this);
+    view= new QDeclarativeView();
+    QDeclarativeContext* ctxt=view->rootContext();
+    ctxt->setContextProperty("historyTypeModel", model);
+    view->setSource(QUrl::fromLocalFile("/usr/share/mdictionary/qml/HistoryListDialog.qml"));
+    view->setResizeMode(QDeclarativeView::SizeRootObjectToView);
+    view->setAlignment(Qt::AlignCenter);
+    view->show();
 
+    view->setMinimumWidth(250);
+    view->setMaximumWidth(250);
+    view->setMinimumHeight(300);
+    view->setWindowFlags(Qt::Popup);
+    verticalLayout->addWidget(view);
+
+    QGraphicsObject *rootObject = view->rootObject();
+
+    connect(rootObject,SIGNAL(selectedRow(int)),
+            this,SLOT(itemClicked(int)));
+
+#else
     #ifndef Q_WS_MAEMO_5
         setWindowFlags(Qt::Popup);
         QLabel* title = new QLabel(tr("History"));
         verticalLayout->addWidget(title,0, Qt::AlignCenter);
     #endif
-
-    oryginalList = words;
-
     historyListWidget = new QListWidget(this);
     verticalLayout->addWidget(historyListWidget);
 
@@ -50,14 +73,13 @@ HistoryListDialog::HistoryListDialog(QStringList words, QWidget *parent):
         historyListWidget->addItem(item);
     }
 
-     setModal(true);
-
      setWindowTitle(tr("History"));
 
      setMinimumHeight(300);
 
      connect(historyListWidget, SIGNAL(activated(QModelIndex)),
              this, SLOT(itemClicked(QModelIndex)));
+#endif
 }
 
 
@@ -67,6 +89,11 @@ void HistoryListDialog::itemClicked(QModelIndex index) {
     accept();
 }
 
+void HistoryListDialog::itemClicked(int index) {
+    _selectedWord = oryginalList[index];
+    _selectedRow = index;
+    accept();
+}
 
 QString HistoryListDialog::selectedWord() {
     return _selectedWord;
@@ -77,6 +104,11 @@ int HistoryListDialog::selectedRow() {
 }
 
 int HistoryListDialog::exec() {
+ #ifndef Q_WS_MAEMO_5
+
+ #else
     historyListWidget->setFocus();
+ #endif
+
     QDialog::exec();
 }
index a4de93a..4e9ce4a 100644 (file)
 #ifndef HISTORYLISTDIALOG_H
 #define HISTORYLISTDIALOG_H
 
+#include <QtGui>
 #include <QDialog>
+#include <QDeclarativeView>
+#include <QDeclarativeContext>
+
 #include "SearchBarWidget.h"
 #include "../../include/History.h"
-#include <QtGui>
+#include "HistoryListModel.h"
 
 
 /*!
@@ -59,8 +63,12 @@ public Q_SLOTS:
 
 private Q_SLOTS:
     void itemClicked(QModelIndex);
+    void itemClicked(int);
 
 private:
+    QDeclarativeView *view;
+    QVBoxLayout* mainLayout;
+
     QListWidget* historyListWidget;
     QVBoxLayout* verticalLayout;
     QString _selectedWord;
diff --git a/src/mdictionary/gui/HistoryListModel.cpp b/src/mdictionary/gui/HistoryListModel.cpp
new file mode 100644 (file)
index 0000000..27a9ca6
--- /dev/null
@@ -0,0 +1,40 @@
+#include "HistoryListModel.h"
+
+HistoryListModel::HistoryListModel(QStringList words, QObject *parent) :
+        QAbstractListModel(parent) {
+
+    QHash<int, QByteArray> roles;
+    roles[WordRole] = "word";
+    roles[NumberRole] = "number";
+    setRoleNames(roles);
+    setHistoryTypes(words);
+}
+
+int HistoryListModel::rowCount(const QModelIndex &parent) const {
+    return _words.count();
+}
+
+void HistoryListModel::setHistoryTypes(QStringList words) {
+    for(int i = 0; i < words.count(); i++) {
+        addType(words[i]);
+    }
+}
+
+QVariant HistoryListModel::data(const QModelIndex & index, int role) const
+{
+    if (index.row() < 0 || index.row() > _words.count())
+        return QVariant();
+
+    const QString word = _words[index.row()];
+    if (role == WordRole)
+        return word;
+    if (role == NumberRole)
+        return index.row();
+    return QVariant();
+}
+
+void HistoryListModel::addType(QString word) {
+    beginInsertRows(QModelIndex(), rowCount(), rowCount());
+    _words << word;
+    endInsertRows();
+}
diff --git a/src/mdictionary/gui/HistoryListModel.h b/src/mdictionary/gui/HistoryListModel.h
new file mode 100644 (file)
index 0000000..8073790
--- /dev/null
@@ -0,0 +1,31 @@
+#ifndef HISTORYLISTMODEL_H
+#define HISTORYLISTMODEL_H
+
+#include <QAbstractListModel>
+#include <QHash>
+#include "../../include/GUIInterface.h"
+
+
+class HistoryListModel : public QAbstractListModel
+{
+    Q_OBJECT
+public:
+    enum histotyTypeRoles
+    {
+        WordRole = Qt::UserRole + 1,
+        NumberRole
+    };
+    explicit HistoryListModel(QStringList words, QObject *parent = 0);
+
+    int rowCount(const QModelIndex & parent = QModelIndex()) const;
+
+    QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const;
+
+private:
+    void setHistoryTypes(QStringList words);
+    void addType(QString word);
+
+    QStringList  _words;
+};
+
+#endif // HISTORYLISTMODEL_H
index 48f3159..2b6bafc 100644 (file)
@@ -374,7 +374,7 @@ void MainWindow::showHistory(QPoint p) {
     HistoryListDialog historyDialog(backbone->history()->list(), this );// searchBarWidget);
     #ifndef Q_WS_MAEMO_5
         p.setX(p.x() - historyDialog.sizeHint().width() + 5);
-        p.setY(p.y() - historyDialog.sizeHint().height() - 80);
+        p.setY(p.y() - historyDialog.sizeHint().height()- 10); //- 80);
         historyDialog.move(p);
     #endif
 
@@ -600,6 +600,4 @@ void MainWindow::removeBookmarks() {
         backbone->removeAllBookmarks();
         ((WordListWidget*)wordListWidget)->clear();
     }
-
-
 }
index fea6334..75ebf14 100644 (file)
@@ -40,7 +40,8 @@ SOURCES += gui/main.cpp \
     gui/NotifyManager.cpp \
     gui/SpinBox.cpp \
     gui/DictTypeModel.cpp \
-    gui/DictManagerModel.cpp
+    gui/DictManagerModel.cpp \
+    gui/HistoryListModel.cpp
 
 HEADERS += gui/MainWindow.h \
     backbone/ConfigGenerator.h \
@@ -73,7 +74,8 @@ HEADERS += gui/MainWindow.h \
     gui/NotifyManager.h \
     gui/SpinBox.h \
     gui/DictTypeModel.h \
-    gui/DictManagerModel.h
+    gui/DictManagerModel.h \
+    gui/HistoryListModel.h
 
 RESOURCES += ../../data/gui.qrc
 
@@ -97,7 +99,8 @@ OTHER_FILES += \
     qml/ScrollBar.qml \
     qml/Checkbox.qml \
     qml/MySpinBox.qml \
-    qml/SettingsWidget.qml
+    qml/SettingsWidget.qml \
+    qml/HistoryListDialog.qml
 
 target.path = $$BIN_DIR
 INSTALLS += target
@@ -219,6 +222,7 @@ unix {
         qmls.files += ./qml/Checkbox.qml
         qmls.files += ./qml/MySpinBox.qml
         qmls.files += ./qml/SettingsWidget.qml
+        qmls.files += ./qml/HistoryListDialog.qml
     }
        
     INSTALLS += desktop icon64 shared service css css_images qmls
index e57069a..ac20bfe 100644 (file)
@@ -63,5 +63,4 @@ Rectangle {
         }
         model: dictTypeModel
     }
-
 }
diff --git a/src/mdictionary/qml/HistoryListDialog.qml b/src/mdictionary/qml/HistoryListDialog.qml
new file mode 100644 (file)
index 0000000..feb7ad9
--- /dev/null
@@ -0,0 +1,69 @@
+import Qt 4.7
+
+Rectangle {
+    SystemPalette { id: myPalette; colorGroup: SystemPalette.Active }
+    color : myPalette.window;
+
+    signal selectedRow(int nr)
+
+    id: rectangle1
+    width: 100
+    height: 300
+
+
+    Rectangle {
+        id: rectangle2
+        color: "#ffffff"
+        anchors.topMargin: 20
+        anchors.fill: parent
+    }
+
+    ElementsListView{
+
+        id: historyList
+        width: rectangle1.width
+        anchors.topMargin: 20
+        anchors.bottom: parent.bottom
+        anchors.top: parent.top
+        highlightResizeSpeed: 1000
+        delegate: Component{
+            id: historyListDelegate
+            Item {
+                width: rectangle1.width
+                height: typeText.height
+                MouseArea{
+                    anchors.fill: parent
+                    onClicked: {
+                        historyList.currentIndex = number
+                    }
+                    onDoubleClicked: {
+                        selectedRow(number)
+                    }
+                }
+                Row {
+                    Text {
+                        id: typeText
+                        text: (number+1) +". "+word
+                        width: rectangle1.width
+                    }
+                }
+            }
+        }
+        model: historyTypeModel
+    }
+
+    Text {
+        id: text1
+        x: 29
+        y: 0
+        width: 80
+        height: 20
+        text: qsTr("History");
+        anchors.horizontalCenterOffset: 19
+        anchors.topMargin: 0
+        anchors.top: parent.top
+        anchors.horizontalCenter: parent.horizontalCenter
+        font.pixelSize: 12
+    }
+
+}
index 2e102c3..2a0de49 100644 (file)
@@ -10,7 +10,13 @@ Rectangle {
 
     function setMax(intiger) { maximum=intiger }
     function setMin(intiger) { minimum=intiger }
-    function setValue(intiger) { value= intiger }
+    function setValue(intiger) {
+        value= intiger;
+        if(intiger>-1){
+            highlight.anchors.leftMargin=0;
+            highlight.anchors.position=0;
+        }
+    }
     function setValue2(intiger) { value2= intiger }
 
     width: 250;
@@ -40,11 +46,11 @@ Rectangle {
             }
         }
 
-        Behavior on anchors.leftMargin {
+        Behavior on position {
             SequentialAnimation{
-                loops: Animation.Infinite
-                SmoothedAnimation { velocity: 450; to: progressBar.width - 96}
-                SmoothedAnimation { velocity: 450; to: 6 }
+                loops:  (value>-1)?0:Animation.Infinite
+                SmoothedAnimation { velocity:450 ; to: progressBar.width - 96}
+                SmoothedAnimation { velocity: 450 ; to: 6 }
             }
         }
 
@@ -68,6 +74,6 @@ Rectangle {
         anchors.verticalCenter: parent.verticalCenter
         color: "white"
         font.bold: true
-        text: (value>-1) ? (Math.floor((value - minimum) / (maximum - minimum) * 100) + '%') : ("???");
+        text: (value>-1) ? (Math.floor((value - minimum) / (maximum - minimum) * 100) + '%') : ("");
     }
 }
diff --git a/src/mdictionary/qml/StarDictDialog.qml b/src/mdictionary/qml/StarDictDialog.qml
new file mode 100644 (file)
index 0000000..2291d11
--- /dev/null
@@ -0,0 +1,94 @@
+import Qt 4.7
+
+Rectangle{
+    property bool newPlugin:false;
+
+    function setInfo(string){
+        textInfo.text = string;
+    }
+    function setPath(string){
+        textPath.text = string;
+    }
+    function setButtonText(string){
+        saveButton.textInButton=string;
+    }
+    function setNew(bool){
+        newPlugin=bool;
+    }
+
+    signal saveButtonClicked();
+    signal browseButtonClicked();
+    signal heightChange(int intiger);
+
+    id:rectangle1
+    width: 220
+    height: newPlugin ? textPath.height+50 : textInfo.height+50
+
+    onHeightChanged:{
+        heightChange((newPlugin ? textPath.height+50 : textInfo.height+50));
+        //console.log( "debug" + (newPlugin ? textPath.paintedHeight+55 : textInfo.paintedHeight+55));
+    }
+
+
+
+    SystemPalette { id: myPalette; colorGroup: SystemPalette.Active }
+    color : myPalette.window;
+
+
+    Text {
+        id: textInfo
+        text: "Tekst: "
+        height: paintedHeight+5;
+        anchors.right: parent.right
+        anchors.left: parent.left
+        anchors.top: parent.top
+        wrapMode: Text.Wrap;
+        transformOrigin: Item.Left
+        font.pixelSize: 12
+    }
+
+    Text {
+        id: textPath
+        text: qsTr("Dictionary file: not selected")
+        height: paintedHeight+5;
+        anchors.top: parent.top
+        anchors.right: browseButton.left
+        anchors.left: parent.left
+        wrapMode: Text.Wrap;
+        transformOrigin: Item.Left
+        font.pixelSize: 12
+        opacity: 0
+    }
+
+    Button {
+        id: browseButton
+        width: 80;
+        height: 25;
+        textInButton: qsTr("Browse");
+        anchors.top: parent.top
+        anchors.topMargin: 10
+        anchors.right: parent.right
+        opacity: 0
+        onClicked: rectangle1.browseButtonClicked();
+    }
+
+    Button {
+        id: saveButton
+        height: 30
+        anchors.bottom: parent.bottom
+        textInButton: qsTr("Save")
+        anchors.right: parent.right
+        anchors.left: parent.left
+        onClicked: rectangle1.saveButtonClicked();
+    }
+
+    states: [
+        State {
+            name: "new"
+            when: newPlugin==true
+            PropertyChanges { target: textInfo; opacity: 0}
+            PropertyChanges { target: textPath; opacity: 1}
+            PropertyChanges { target: browseButton; opacity: 1 }
+        }
+    ]
+}
index 1b71ff3..e16180b 100644 (file)
@@ -41,7 +41,6 @@ Rectangle{
         textPath.text=string;
     }
 
-
     signal saveButtonClicked();
     signal downloadButtonClicked();
     signal browseButtonClicked();
diff --git a/src/mdictionary/qml/XdxfDictDownloader.qml b/src/mdictionary/qml/XdxfDictDownloader.qml
new file mode 100644 (file)
index 0000000..6973147
--- /dev/null
@@ -0,0 +1,81 @@
+import Qt 4.7
+
+Rectangle {
+    id: rectangle1
+    width: 250
+    height: 80
+
+
+    SystemPalette { id: myPalette; colorGroup: SystemPalette.Active }
+    color : myPalette.window;
+
+    function setValue(intiger){
+        console.log("ala value " +intiger);
+        progressbar1.setValue(intiger);
+    }
+    function setText(string){
+        console.log("ala text " +string);
+        text.text=string;
+    }
+    function setMaximumValue(intiger){
+        console.log("ala max " +intiger);
+        if(intiger==0){
+            timerUp.running=true;
+            setValue(-1);
+        }
+        else{
+            timerUp.running=false;
+            progressbar1.setMax(intiger);
+        }
+    }
+
+    signal cancelDownloading();
+
+    Text {
+        id: text
+        text: qsTr("Downloading dictionaries list");
+        anchors.right: parent.right
+        anchors.left: parent.left
+        font.pixelSize: 12
+        horizontalAlignment: Text.AlignHCenter;
+    }
+
+    ProgressBar {
+        id: progressbar1
+        anchors.top: text.bottom
+        anchors.horizontalCenter: parent.horizontalCenter
+        value: -1
+        value2: 30
+    }
+
+    Button {
+        id: button1
+        height: 25;
+        textInButton: qsTr("Cancel");
+        anchors.top: progressbar1.bottom
+        anchors.right: parent.right
+        anchors.left: parent.left
+        onClicked: {
+            console.log("click");
+            rectangle1.cancelDownloading();
+        }
+    }
+
+    Timer {
+        property bool progressMax:true;
+        id:timerUp;
+        interval: 50;
+        running: false;
+        repeat: true
+        onTriggered:{
+            if(progressMax==true){
+                 progressbar1.setValue2(0);
+                 progressMax=false;
+            }
+            else{
+                progressbar1.setValue2(100);
+                progressMax=true;
+            }
+        }
+    }
+}
index dfb798d..52464b1 100644 (file)
@@ -32,6 +32,8 @@
 #include <QDialog>
 #include "../../include/settings.h"
 #include <QtGui>
+#include <QDeclarativeView>
+
 #include "GooglePlugin.h"
 
 /*!
@@ -88,6 +90,9 @@ private Q_SLOTS:
     void changeLangButtonClicked();
 
 private:
+    QVBoxLayout* mainLayout;
+    QDeclarativeView *view;
+
     void initializeUI();
 
     //! saves new settings after acceptance of dialog
index 444472c..54b09cd 100644 (file)
@@ -4,7 +4,8 @@ include(../plugin.pri)
 
 QT = core \
     gui \
-    network
+    network \
+    declarative
 
 maemo5:QT += maemo5
 
@@ -30,12 +31,25 @@ TRANSLATIONS += pl_PL.ts \
 RESOURCES += \
     google.qrc
 
-
 unix {
-  INSTALLS += plugin-icon
-
-  plugin-icon.path = $$DATA_DIR
-  plugin-icon.files += google.png
+    meego {
+        qmls.path = $$DATA_DIR/qml
+        qmls.files += ../../mdictionary/qml/GoogleDialog.qml
+    }
+    else:maemo5 {
+        qmls.path = $$DATA_DIR/qml
+        qmls.files += ../../mdictionary/qml/GoogleDialog.qml
+    }
+    else {
+        qmls.path = $$DATA_DIR/qml
+        qmls.files += ../../mdictionary/qml/GoogleDialog.qml
+    }
+
+    plugin-icon.path = $$DATA_DIR
+    plugin-icon.files += google.png
+
+    INSTALLS += plugin-icon \
+                qmls
 }
 check.commands = echo 'No check here'
 QMAKE_EXTRA_TARGETS += check
index 47a8f38..96b6a25 100644 (file)
@@ -65,5 +65,4 @@ check.commands = echo \
                 'No check here'
 QMAKE_EXTRA_TARGETS += check
 
-OTHER_FILES += \
-    ../../mdictionary/qml/StarDictDialog.qml \
+OTHER_FILES += ../../mdictionary/qml/StarDictDialog.qml
index 2f1a053..d1775da 100644 (file)
@@ -33,6 +33,7 @@
 #include "../../include/settings.h"
 #include <QtGui>
 #include <QDeclarativeView>
+
 #include "xdxfplugin.h"
 
 
index 8f89199..5bf2ca7 100644 (file)
 
 XdxfDictDownloadProgressDialog::XdxfDictDownloadProgressDialog(QWidget*parent):
     QDialog(parent) {
+qDebug()<<"etap 01";
+#ifndef Q_WS_MAEMO_5
+    view= new QDeclarativeView();
+    view->setSource(QUrl::fromLocalFile("/usr/share/mdictionary/qml/XdxfDictDownloader.qml"));
+    view->setResizeMode(QDeclarativeView::SizeRootObjectToView);
+    view->setAlignment(Qt::AlignCenter);
+    view->show();
+
+    mainLayout = new QVBoxLayout;
+    mainLayout->addWidget(view);
+    setLayout(mainLayout);
+    view->setWindowTitle(tr("Progres Dialog"));
+
+    QGraphicsObject *rootObject = view->rootObject();
+
+    connect(this, SIGNAL(setValue(QVariant)),
+           rootObject, SLOT(setValue(QVariant)));
+    connect(this, SIGNAL(setTextt(QVariant)),
+           rootObject, SLOT(setText(QVariant)));
+    connect(this, SIGNAL(setMaximumValue(QVariant)),
+           rootObject, SLOT(setMaximumValue(QVariant)));
+
+    connect(rootObject, SIGNAL(cancelDownloading()),
+           this, SLOT(reject()));
+
+#else
     verticalLayout = new QVBoxLayout(this);
     setLayout(verticalLayout);
 
@@ -54,32 +80,52 @@ XdxfDictDownloadProgressDialog::XdxfDictDownloadProgressDialog(QWidget*parent):
     #ifndef Q_WS_MAEMO_5
         setMinimumWidth(350);
     #endif
+#endif
 }
 
 
 void XdxfDictDownloadProgressDialog::show() {
+qDebug()<<"etap 02";
+#ifndef Q_WS_MAEMO_5
+    emit setMaximumValue(0);
+    maximumValue=0;
+#else
     downloadProgressBar->setMaximum(0);
     QDialog::show();
+#endif
+    QDialog::show();
 }
 
 
 void XdxfDictDownloadProgressDialog::setText(QString text) {
+qDebug()<<"etap 03";
+
+#ifndef Q_WS_MAEMO_5
+    emit setTextt(text);
+#else
     setWindowTitle(text);
-    #ifndef Q_WS_MAEMO_5
-        downloadLabel->setText(text);
-    #endif
+#endif
 }
 
 
 void XdxfDictDownloadProgressDialog::updateProgress(float progress) {
+qDebug()<<"etap 04";
+#ifndef Q_WS_MAEMO_5
+    if(maximumValue == 0) {
+        emit setMaximumValue(100);
+    }
+    emit setValue((int)(progress*100));
+#else
     if(downloadProgressBar->maximum() == 0) {
         downloadProgressBar->setMaximum(100);
     }
     downloadProgressBar->setValue(progress*100);
+#endif
 }
 
 
 void XdxfDictDownloadProgressDialog::reject() {
+qDebug()<<"etap 05";
     #ifndef Q_WS_MAEMO_5
         Q_EMIT cancelDownloading();
     #else
index 2a1efc3..a103de6 100644 (file)
@@ -30,6 +30,7 @@
 
 #include <QDialog>
 #include <QtGui>
+#include <QDeclarativeView>
 
 /*!
     Shows downloading progress bar. Currently it displays "busy bar".
@@ -56,10 +57,19 @@ public Q_SLOTS:
     void show();
 
 Q_SIGNALS:
+    void setMaximumValue(QVariant value);
+    void setTextt(QVariant text);
+    void setValue(QVariant value);
+
     //! signal emitted when user cancels downloading of a dictionary
     void cancelDownloading();
 
 private:
+    QVBoxLayout* mainLayout;
+    QDeclarativeView *view;
+    int maximumValue;
+
+
     QLabel* downloadLabel;
     QProgressBar* downloadProgressBar;
     QPushButton* cancelButton;
index 60f01bf..9995e9c 100644 (file)
@@ -72,6 +72,7 @@ void XdxfDictDownloader::download(QWidget *parent) {
     connect(this, SIGNAL(downloadProgress(float)),
             progressDialog, SLOT(updateProgress(float)));
 
+    qDebug()<<"etam 3.1";
     progressDialog->setText(tr("Downloading dictionaries list"));
     progressDialog->show();
 }
@@ -175,7 +176,7 @@ void XdxfDictDownloader::dictListReceived(QNetworkReply *reply) {
     XdxfDictSelectDialog selectDialog(dicts, parentDialog);
 
     if(selectDialog.exec()==QDialog::Accepted) {
-
+        qDebug()<<"etap 3.2";
         progressDialog->setText(tr("Downloading dictionary"));
         progressDialog->show();
 
@@ -244,3 +245,4 @@ bool XdxfDictDownloader::extract(QString file) {
 }
 
 
+
index ebd048d..171fadd 100644 (file)
 #define XDXFDICTDOWNLOADER_H
 
 #include <QObject>
-#include "XdxfDictSelectDialog.h"
 #include <QTimer>
 #include <QNetworkAccessManager>
 #include <QNetworkReply>
 #include <DownloadDict.h>
+#include <string.h>
+#include <errno.h>
+
+#include "XdxfDictSelectDialog.h"
 #include "XdxfDictDownloadProgressDialog.h"
 #include "../../include/Notify.h"
 #include "HttpDownloader.h"
-#include <string.h>
-#include <errno.h>
 
 /*!
     XdxfDictDownloader is responsible for getting dict list from XDXF website
@@ -71,6 +72,7 @@ Q_SIGNALS:
 
     //! emmited what is update Download Progress
     void downloadProgress(float);
+    void downloadProgress2(QVariant);
 
 private Q_SLOTS:
     //! obtained list of dictionaries from website
index f342bfb..929060c 100644 (file)
@@ -52,8 +52,8 @@ RESOURCES += xdxf.qrc
 TRANSLATIONS += pl_PL.ts \
                 en_US.ts
 
-OTHER_FILES += \
-    ../../mdictionary/qml/XdxfDialog.qml
+OTHER_FILES += ../../mdictionary/qml/XdxfDialog.qml \
+    ../../mdictionary/qml/XdxfDictDownloader.qml
 
 unix {
     dicts.path = $$PLUGINS_DIR
@@ -73,6 +73,7 @@ unix {
     else {
         qmls.path = $$DATA_DIR/qml
         qmls.files += ../../mdictionary/qml/XdxfDialog.qml
+        qmls.files += ../../mdictionary/qml/XdxfDictDownloader.qml
     }
 
     INSTALLS += dicts \