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

List:       kde-commits
Subject:    [cervisia] /: Don't close the log dialog when "View" was clicked
From:       Martin Koller <kollix () aon ! at>
Date:       2015-09-30 17:48:27
Message-ID: E1ZhLUR-0002Qj-Sk () scm ! kde ! org
[Download RAW message or body]

Git commit b5c944458792db89f3760c5c884d59c3fe765fe2 by Martin Koller.
Committed on 30/09/2015 at 17:47.
Pushed by mkoller into branch 'master'.

Don't close the log dialog when "View" was clicked

M  +12   -2    logdialog.cpp
M  +1    -0    logdialog.h

http://commits.kde.org/cervisia/b5c944458792db89f3760c5c884d59c3fe765fe2

diff --git a/logdialog.cpp b/logdialog.cpp
index 4d057f8..7ad57b8 100644
--- a/logdialog.cpp
+++ b/logdialog.cpp
@@ -70,6 +70,7 @@ LogDialog::LogDialog(KConfig& cfg, QWidget *parent)
     setButtonGuiItem(User3, KGuiItem(i18n("&Find"), "edit-find"));
     setDefaultButton(Close);
     showButtonSeparator(true);
+    showButton(User3, false);
 
     splitter = new QSplitter(Qt::Vertical, this);
     setMainWidget(splitter);
@@ -207,8 +208,6 @@ LogDialog::LogDialog(KConfig& cfg, QWidget *parent)
     connect( this, SIGNAL(user3Clicked()),
              this, SLOT(findClicked()) );
 
-    connect(this,SIGNAL(okClicked()),
-            this, SLOT(slotOk()));
     connect(this,SIGNAL(applyClicked()),this,SLOT(slotApply()));
     setButtonGuiItem(Ok, KGuiItem(i18nc("to view revision A", "&View A"),"document-open"));
     setButtonGuiItem(Apply, KGuiItem(i18n("Create Patch...")));
@@ -429,6 +428,17 @@ bool LogDialog::parseCvsLog(OrgKdeCervisiaCvsserviceCvsserviceInterface* service
     return true;    // successful
 }
 
+void LogDialog::slotButtonClicked(int button)
+{
+    if ( button == KDialog::Ok )
+    {
+        // ok button (used for "view") shall not close the dialog
+        slotOk();
+        return;
+    }
+
+    KDialog::slotButtonClicked(button);
+}
 
 void LogDialog::slotOk()
 {
diff --git a/logdialog.h b/logdialog.h
index 9c97a47..8ffc8ec 100644
--- a/logdialog.h
+++ b/logdialog.h
@@ -59,6 +59,7 @@ public:
     bool parseCvsLog(OrgKdeCervisiaCvsserviceCvsserviceInterface* service, const QString& fileName);
 
 protected slots:
+    virtual void slotButtonClicked(int button);
     void slotOk();
     void slotApply();
 
[prev in list] [next in list] [prev in thread] [next in thread] 

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