Added downloads of xdxf dicts
[mdictionary] / src / plugins / xdxf / XdxfDialog.cpp
index 6949e9a..da304b7 100644 (file)
@@ -57,6 +57,9 @@ XdxfDialog::XdxfDialog(XdxfPlugin *plugin,
 
         connect(downloadButton, SIGNAL(clicked()),
                 this, SLOT(downloadFile()));
+
+        connect(&XdxfPlugin::dictDownloader, SIGNAL(fileDownloaded(QString)),
+                this, SLOT(fileDownloaded(QString)));
     }
 
     connect(confirmButton, SIGNAL(clicked()),
@@ -64,6 +67,12 @@ XdxfDialog::XdxfDialog(XdxfPlugin *plugin,
 
 }
 
+void XdxfDialog::fileDownloaded(QString name) {
+    infoLabel->setText(tr("Dictionary file: %1").arg(XdxfPlugin::dictDownloader.downloadedFile()));
+    _dictionaryFilePath = XdxfPlugin::dictDownloader.downloadedFile();
+    updateGeometry();
+}
+
 
 void XdxfDialog::initializeUI() {
     mainVerticalLayout = new QVBoxLayout;
@@ -80,7 +89,7 @@ void XdxfDialog::initializeUI() {
 
         QHBoxLayout* buttonLayout = new QHBoxLayout;
         browseButton = new QPushButton(tr("Browse"));
-        browseButton->setMaximumWidth(150);
+        browseButton->setMaximumWidth(100);
 
         downloadButton = new QPushButton(tr("Download"));
         downloadButton->setMaximumWidth(150);