[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [cantor/labplot-integration] src: add optional parameter "--noprogress" to the Cantor Part which dis
From:       Alexander Rieder <alexanderrieder () gmail ! com>
Date:       2015-08-05 17:26:52
Message-ID: E1ZN2Sq-0007ux-Qf () scm ! kde ! org
[Download RAW message or body]

Git commit 3feb110c7966726cca09f7dbd88368d3a824d71b by Alexander Rieder.
Committed on 05/08/2015 at 17:43.
Pushed by arieder into branch 'labplot-integration'.

add optional parameter "--noprogress" to the Cantor Part which disables the
progress dialog while the backend is initialized

M  +1    -0    src/cantor.h
M  +11   -4    src/cantor_part.cpp
M  +2    -0    src/cantor_part.h
M  +1    -0    src/loadedexpression.h
M  +3    -0    src/textentry.h

http://commits.kde.org/cantor/3feb110c7966726cca09f7dbd88368d3a824d71b

diff --git a/src/cantor.h b/src/cantor.h
index 95ad83b..2a0a3e6 100644
--- a/src/cantor.h
+++ b/src/cantor.h
@@ -21,6 +21,7 @@
 #ifndef CANTOR_H
 #define CANTOR_H
 
+#include <QObject>
 #include <KParts/MainWindow>
 
 #include <QList>
diff --git a/src/cantor_part.cpp b/src/cantor_part.cpp
index 2b0b1be..c7aa5b1 100644
--- a/src/cantor_part.cpp
+++ b/src/cantor_part.cpp
@@ -119,6 +119,7 @@ CantorPart::CantorPart( QWidget *parentWidget, QObject *parent, const QVariantLi
     m_showBackendHelp=0;
     m_initProgressDlg=0;
     m_statusBarBlocked=false;
+    m_showProgressDlg=true;
 
     qDebug()<<"Created a CantorPart";
 
@@ -131,6 +132,15 @@ CantorPart::CantorPart( QWidget *parentWidget, QObject *parent, const QVariantLi
     else
         backendName=args.first().toString();
 
+    foreach(const QVariant& arg, args)
+    {
+        if (arg.toString() == QLatin1String("--noprogress") )
+        {
+            qWarning()<<"not showing the progress bar by request";
+            m_showProgressDlg=false;
+        }
+    }
+
     Cantor::Backend* b=Cantor::Backend::createBackend(backendName);
     if(!b)
     {
@@ -161,9 +171,6 @@ CantorPart::CantorPart( QWidget *parentWidget, QObject *parent, const QVariantLi
 
     Cantor::WorksheetAccessInterface* iface=new WorksheetAccessInterfaceImpl(this, m_worksheet);
 
-    qDebug()<<"there really should be a worksheet interface by now";
-
-
     // create our actions
     m_worksheet->createActions(actionCollection());
 
@@ -549,7 +556,7 @@ void CantorPart::worksheetSessionChanged()
     m_panelHandler->setSession(m_worksheet->session());
     adjustGuiToSession();
 
-    if(!m_initProgressDlg)
+    if(m_showProgressDlg && !m_initProgressDlg)
     {
         m_initProgressDlg = new QProgressDialog(widget());
         m_initProgressDlg->setWindowTitle(i18n("Cantor"));
diff --git a/src/cantor_part.h b/src/cantor_part.h
index c687ad9..d748ab6 100644
--- a/src/cantor_part.h
+++ b/src/cantor_part.h
@@ -158,6 +158,7 @@ private:
     Cantor::PanelPluginHandler* m_panelHandler;
 
     QProgressDialog* m_initProgressDlg;
+    bool m_showProgressDlg;
     QAction * m_evaluate;
     QAction * m_save;
     QAction * m_findNext;
@@ -171,6 +172,7 @@ private:
 
     QString m_cachedStatusMessage;
     bool m_statusBarBlocked;
+
 };
 
 
diff --git a/src/loadedexpression.h b/src/loadedexpression.h
index 1144ec4..dff6a20 100644
--- a/src/loadedexpression.h
+++ b/src/loadedexpression.h
@@ -23,6 +23,7 @@
 
 #include "lib/expression.h"
 
+#include <QIODevice>
 #include <KZip>
 #include <QDomElement>
 
diff --git a/src/textentry.h b/src/textentry.h
index d3693a5..59755ea 100644
--- a/src/textentry.h
+++ b/src/textentry.h
@@ -25,8 +25,11 @@
 #include <QString>
 #include <QDomElement>
 #include <QDomDocument>
+#include <QIODevice>
 #include <KZip>
 #include <QTextCursor>
+#include <KArchive>
+
 
 #include "worksheetentry.h"
 #include "worksheettextitem.h"
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic