Caching dialog in xdxf is set to modal
[mdictionary] / src / plugins / xdxf / XdxfCachingDialog.cpp
index 3cf5bf3..29496d6 100644 (file)
@@ -28,9 +28,7 @@
 #include <QDebug>
 
 
-XdxfCachingDialog::XdxfCachingDialog(XdxfPlugin *parent) //:
-//    QDialog((QWidget*)parent)
-{
+XdxfCachingDialog::XdxfCachingDialog(XdxfPlugin *parent) {
     verticalLayout = new QVBoxLayout(this);
     setLayout(verticalLayout);
 
@@ -54,9 +52,16 @@ XdxfCachingDialog::XdxfCachingDialog(XdxfPlugin *parent) //:
     connect(cancelButton, SIGNAL(clicked()),
             this, SIGNAL(cancelCaching()));
 
-   connect(parent, SIGNAL(updateCachingProgress(int, int)),
-           this, SLOT(updateCachingProgress(int, int)));
+    connect(parent, SIGNAL(updateCachingProgress(int, int)),
+       this, SLOT(updateCachingProgress(int, int)));
     time.start();
+
+    setModal(true);
+}
+
+
+void XdxfCachingDialog::reject() {
+    return;
 }
 
 void XdxfCachingDialog::updateCachingProgress(int progress, int time) {
@@ -68,17 +73,7 @@ void XdxfCachingDialog::updateCachingProgress(int progress, int time) {
     int seconds = float((100 - progress)*time) / (5*1000);
 
     cachingLabel->setText(tr("Estimated time left: ") +
-                     /*QString::number(seconds)*/  tr("%n second(s)", "", seconds));
+                          tr("%n second(s)", "", seconds));
     if(progress >= 100)
-        this->hide();
-        
-
-}
-
-void XdxfCachingDialog::reject() {
-    return;
-}
-
-void XdxfCachingDialog::cancelButtonClicked(){
-    return;
+        this->accept();
 }