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

List:       kde-commits
Subject:    KDE/kdepim/kmail
From:       Andreas Gungl <a.gungl () gmx ! de>
Date:       2006-01-01 20:37:08
Message-ID: 1136147828.629818.9387.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 493207 by gungl:

Q3ButtonGroup--

 M  +31 -17    kmfilterdlg.cpp  
 M  +4 -4      kmfilterdlg.h  


--- trunk/KDE/kdepim/kmail/kmfilterdlg.cpp #493206:493207
@@ -186,16 +186,16 @@
       vbl3->addStretch( 1 );
       mApplyOnIn = new QCheckBox( i18n("Apply this filter to incoming messages:"), \
mAdvOptsGroup );  vbl3->addWidget( mApplyOnIn );
-      Q3ButtonGroup *bg = new Q3ButtonGroup( 0, "bg" );
-      bg->setExclusive( true );
+      QButtonGroup *bg = new QButtonGroup( mAdvOptsGroup );
+      bg->setObjectName( "bg" );
       mApplyOnForAll = new QRadioButton( i18n("from all accounts"), mAdvOptsGroup );
-      bg->insert( mApplyOnForAll );
+      bg->addButton( mApplyOnForAll );
       vbl3->addWidget( mApplyOnForAll );
       mApplyOnForTraditional = new QRadioButton( i18n("from all but online IMAP \
                accounts"), mAdvOptsGroup );
-      bg->insert( mApplyOnForTraditional );
+      bg->addButton( mApplyOnForTraditional );
       vbl3->addWidget( mApplyOnForTraditional );
       mApplyOnForChecked = new QRadioButton( i18n("from checked accounts only"), \
                mAdvOptsGroup );
-      bg->insert( mApplyOnForChecked );
+      bg->addButton( mApplyOnForChecked );
       vbl3->addWidget( mApplyOnForChecked );
       vbl3->addStretch( 2 );
 
@@ -1038,6 +1038,8 @@
 KMFilterActionWidget::KMFilterActionWidget( QWidget *parent, const char* name )
   : KHBox( parent )
 {
+  setObjectName( name );
+
   int i;
 
   mComboBox = new QComboBox( FALSE, this );
@@ -1231,17 +1233,29 @@
 //=============================================================================
 
 KMPopFilterActionWidget::KMPopFilterActionWidget( const QString& title, QWidget \
                *parent, const char* name )
-  : Q3VButtonGroup( title, parent, name )
+  : QGroupBox( title, parent )
 {
-  mActionMap[Down] = new QRadioButton( i18n("&Download mail"), this );
-  mActionMap[Later] = new QRadioButton( i18n("Download mail la&ter"), this );
-  mActionMap[Delete] = new QRadioButton( i18n("D&elete mail from server"), this );
-  mIdMap[id(mActionMap[Later])] = Later;
-  mIdMap[id(mActionMap[Down])] = Down;
-  mIdMap[id(mActionMap[Delete])] = Delete;
+  setObjectName( name );
+  QButtonGroup *bg = new QButtonGroup( this );
 
-  connect( this, SIGNAL(clicked(int)),
-	   this, SLOT( slotActionClicked(int)) );
+  QRadioButton *downBtn = new QRadioButton( i18n("&Download mail"), this );
+  QRadioButton *laterBtn = new QRadioButton( i18n("Download mail la&ter"), this );
+  QRadioButton *deleteBtn = new QRadioButton( i18n("D&elete mail from server"), this \
); +
+  bg->addButton( downBtn );
+  bg->addButton( laterBtn );
+  bg->addButton( deleteBtn );
+
+  mActionMap.insert( Down, downBtn );
+  mActionMap.insert( Later, laterBtn );
+  mActionMap.insert( Delete, deleteBtn );
+
+  mButtonMap.insert( downBtn, Down );
+  mButtonMap.insert( laterBtn, Later );
+  mButtonMap.insert( deleteBtn, Delete );
+
+  connect( bg, SIGNAL(buttonClicked(QAbstractButton*)),
+	   this, SLOT(slotActionClicked(QAbstractButton*)) );
 }
 
 void KMPopFilterActionWidget::setAction( KMPopFilterAction aAction )
@@ -1268,10 +1282,10 @@
   return mAction;
 }
 
-void KMPopFilterActionWidget::slotActionClicked(int aId)
+void KMPopFilterActionWidget::slotActionClicked( QAbstractButton *btn )
 {
-  emit actionChanged(mIdMap[aId]);
-  setAction(mIdMap[aId]);
+  emit actionChanged( mButtonMap[btn] );
+  setAction( mButtonMap[btn] );
 }
 
 void KMPopFilterActionWidget::reset()
--- trunk/KDE/kdepim/kmail/kmfilterdlg.h #493206:493207
@@ -211,7 +211,7 @@
   QStackedWidget   *mWidgetStack;
 };
 
-class KMPopFilterActionWidget : public Q3VButtonGroup
+class KMPopFilterActionWidget : public QGroupBox
 {
   Q_OBJECT
 public:
@@ -223,16 +223,16 @@
   void reset();
 
 private slots:
-  void slotActionClicked(int aId);
+  void slotActionClicked( QAbstractButton *btn );
 
 private:
   KMPopFilterAction mAction;
   KMFilter mFilter;
   QMap<KMPopFilterAction, QRadioButton*> mActionMap;
-  QMap<int, KMPopFilterAction> mIdMap;
+  QMap<QAbstractButton*, KMPopFilterAction> mButtonMap;
 
 signals: // Signals
-  void actionChanged(const KMPopFilterAction aAction);
+  void actionChanged( const KMPopFilterAction aAction );
 };
 
 class KMFilterActionWidgetLister : public KWidgetLister


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

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