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

List:       kde-commits
Subject:    kdebase/kcontrol/kcontrol
From:       Waldo Bastian <bastian () kde ! org>
Date:       2004-08-09 20:36:04
Message-ID: 20040809203604.7A2B59985 () office ! kde ! org
[Download RAW message or body]

CVS commit by waba: 

Don't open dialog with multiple modules more than once (BR49530)
CCMAIL: 49530-done@bugs.kde.org


  M +2 -0      .cvsignore   1.13
  M +1 -1      Makefile.am   1.75
  M +30 -6     kcmshell.cpp   1.78
  M +14 -0     kcmshell.h   1.3


--- kdebase/kcontrol/kcontrol/.cvsignore  #1.12:1.13
@@ -13,4 +13,6 @@
 kcmshell.la.cpp
 kcmshell_dummy.cpp
+kcmshell.kidl
+kcmshell_skel.cpp
 kcontrol
 kcontrol.la.cpp

--- kdebase/kcontrol/kcontrol/Makefile.am  #1.74:1.75
@@ -43,5 +43,5 @@
 kcontrol_la_LDFLAGS = $(all_libraries) -module -avoid-version
 
-kcmshell_la_SOURCES = kcmshell.cpp kcdialog.cpp kcdialog.skel
+kcmshell_la_SOURCES = kcmshell.cpp kcdialog.cpp kcdialog.skel kcmshell.skel
 kcmshell_la_LIBADD = libkcontrolcommon.la $(LIB_KDEUI) $(LIB_KSYCOCA) $(LIB_KUTILS)
 kcmshell_la_LDFLAGS = $(all_libraries) -module -avoid-version

--- kdebase/kcontrol/kcontrol/kcmshell.cpp  #1.77:1.78
@@ -23,16 +23,17 @@
 
 #include <qfile.h>
+#include <qxembed.h>
 
 #include <dcopclient.h>
 
-#include <kdebug.h>
-#include <kstandarddirs.h>
+#include <kaboutdata.h>
 #include <kcmdlineargs.h>
+#include <kdebug.h>
 #include <kdesktopfile.h>
-#include <qxembed.h>
 #include <kiconloader.h>
-#include <kmessagebox.h>
 #include <klibloader.h>
-#include <kaboutdata.h>
+#include <kmessagebox.h>
+#include <kstandarddirs.h>
+#include <kstartupinfo.h>
 #include <kwin.h>
 
@@ -81,4 +82,15 @@ static KService::Ptr locateModule(const 
 }
 
+KCMShellMultiDialog::KCMShellMultiDialog(QWidget *parent, const char *name, bool modal)
+  : KCMultiDialog(parent, name, modal),
+    DCOPObject("dialog")
+{
+}
+
+void KCMShellMultiDialog::activate( QCString asn_id )
+{
+    KStartupInfo::setNewStartupId( this, asn_id );
+}
+
 void
 kcmApplication::setDCOPName(const QCString &dcopName)
@@ -274,4 +286,6 @@ extern "C" int kdemain(int _argc, char *
     }
 
+    QCString dcopName;
+
     // multiple control modules
     KService::List modules;
@@ -280,4 +294,7 @@ extern "C" int kdemain(int _argc, char *
         if (service)
         {
+                if (!dcopName.isEmpty())
+                   dcopName += "_";
+                dcopName += args->arg(i);
                 modules.append(service);
                 continue;
@@ -287,6 +304,13 @@ extern "C" int kdemain(int _argc, char *
     if (modules.count() < 1) return -1;
 
+    app.setDCOPName(dcopName);
+    if (app.isRunning())
+    {
+        app.waitForExit();
+        return 0;
+    }
+
     // create the dialog
-    KCMultiDialog * dlg = new KCMultiDialog(0, 0, true);
+    KCMultiDialog * dlg = new KCMShellMultiDialog(0, 0, true);
 
     // Needed for modules that use d'n'd (not really the right

--- kdebase/kcontrol/kcontrol/kcmshell.h  #1.2:1.3
@@ -22,5 +22,19 @@
 #define __kcmshell_h__
 
+#include <dcopobject.h>
+
 #include <kapplication.h>
+#include <kcmultidialog.h>
+
+class KCMShellMultiDialog : public KCMultiDialog, public DCOPObject
+{
+  Q_OBJECT
+  K_DCOP
+public:
+  KCMShellMultiDialog(QWidget *parent=0, const char *name=0, bool modal=false);
+
+k_dcop:
+  virtual void activate( QCString asn_id );
+};
 
 class kcmApplication : public KApplication


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

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