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

List:       kde-core-devel
Subject:    kdebugdialog addition
From:       Andras Mantia <amantia () freemail ! hu>
Date:       2003-07-22 19:57:32
[Download RAW message or body]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

 I've got tired of start/close/start/close cycle with kdebugdialog, as if you 
use the instant search feature and you try to change the debug output for two 
apps (eg. kdevelop and quanta) you must do:
kdev -> check/uncheck -> OK -> restart -> q -> check/uncheck -> OK.

If you don't press OK, you will lose your modifications. So how about an OK 
that doesn't close the dialog, AKA Apply?

Andras

PS: The second "QPushButton *pApplyButton;" remained in the diff by mistake...

- -- 
Quanta Plus developer - http://quanta.sourceforge.net
K Desktop Environment - http://www.kde.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2-rc1-SuSE (GNU/Linux)

iD8DBQE/HZctTQdfac6L/08RAlnVAJ0QX4qClxiEB5t4Fy5DaEuEFW46HQCgl5QJ
sNfgvoHQJQDoHGiNgo0pT0M=
=qbX9
-----END PGP SIGNATURE-----

["kdebugdialog.diff" (text/x-diff)]

Index: kabstractdebugdialog.cpp
===================================================================
RCS file: /home/kde/kdebase/kdebugdialog/kabstractdebugdialog.cpp,v
retrieving revision 1.3
diff -u -r1.3 kabstractdebugdialog.cpp
--- kabstractdebugdialog.cpp	29 Dec 2001 17:09:52 -0000	1.3
+++ kabstractdebugdialog.cpp	22 Jul 2003 19:51:49 -0000
@@ -42,8 +42,12 @@
   pHelpButton = new QPushButton( i18n("&Help"), this );
   hbox->addWidget( pHelpButton );
   hbox->addStretch(10);
+  QSpacerItem *spacer = new QSpacerItem(40, 0);
+  hbox->addItem(spacer); 
   pOKButton = new QPushButton( i18n("&OK"), this );
   hbox->addWidget( pOKButton );
+  pApplyButton = new QPushButton( i18n("&Apply"), this );
+  hbox->addWidget( pApplyButton );
   pCancelButton = new QPushButton( i18n("&Cancel"), this );
   hbox->addWidget( pCancelButton );
 
@@ -51,13 +55,17 @@
   int w2 = pOKButton->sizeHint().width();
   int w3 = pCancelButton->sizeHint().width();
   int w4 = QMAX( w1, QMAX( w2, w3 ) );
+  int w5 = pApplyButton->sizeHint().width();
+  w4 = QMAX(w4, w5);
 
   pHelpButton->setFixedWidth( w4 );
   pOKButton->setFixedWidth( w4 );
+  pApplyButton->setFixedWidth( w4 );
   pCancelButton->setFixedWidth( w4 );
 
   connect( pHelpButton, SIGNAL( clicked() ), SLOT( slotShowHelp() ) );
   connect( pOKButton, SIGNAL( clicked() ), SLOT( accept() ) );
+  connect( pApplyButton, SIGNAL( clicked() ), SLOT( slotApply() ) );
   connect( pCancelButton, SIGNAL( clicked() ), SLOT( reject() ) );
 }
 
@@ -65,6 +73,12 @@
 {
   if (kapp)
     kapp->invokeHTMLHelp( "kdelibs/kdebug/index.html" );
+}
+
+void KAbstractDebugDialog::slotApply()
+{
+  save();
+  pConfig->sync();
 }
 
 #include "kabstractdebugdialog.moc"
Index: kabstractdebugdialog.h
===================================================================
RCS file: /home/kde/kdebase/kdebugdialog/kabstractdebugdialog.h,v
retrieving revision 1.2
diff -u -r1.2 kabstractdebugdialog.h
--- kabstractdebugdialog.h	10 May 2000 19:24:48 -0000	1.2
+++ kabstractdebugdialog.h	22 Jul 2003 19:51:49 -0000
@@ -40,11 +40,14 @@
 
 protected slots:
   void slotShowHelp();
+  void slotApply();
+  
 protected:
   KConfig* pConfig;
   QPushButton* pOKButton;
   QPushButton* pCancelButton;
   QPushButton* pHelpButton;
+  QPushButton* pApplyButton;
 };
 
 #endif
Index: klistdebugdialog.h
===================================================================
RCS file: /home/kde/kdebase/kdebugdialog/klistdebugdialog.h,v
retrieving revision 1.6
diff -u -r1.6 klistdebugdialog.h
--- klistdebugdialog.h	16 Apr 2003 13:16:55 -0000	1.6
+++ klistdebugdialog.h	22 Jul 2003 19:51:49 -0000
@@ -58,6 +58,7 @@
   QPtrList<QCheckBox> boxes;
   QStringList m_areaList;
   QVBox *m_box;
+  QPushButton *pApplyButton;
 };
 
 #endif


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

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