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

List:       kde-commits
Subject:    playground/sysadmin/shaman/shaman
From:       Lukas Appelhans <l.appelhans () gmx ! de>
Date:       2010-02-12 23:38:29
Message-ID: 1266017909.817350.24332.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1089360 by lappelhans:

Integrate the process queue options into the review queue dialog...


 M  +30 -36    src/processqueue/ReviewQueueDialog.cpp  
 M  +6 -0      src/processqueue/ReviewQueueDialog.h  
 M  +7 -1      ui/ReviewQueueDialog.ui  


--- trunk/playground/sysadmin/shaman/shaman/src/processqueue/ReviewQueueDialog.cpp \
#1089359:1089360 @@ -318,6 +318,21 @@
         ui.downloadLabel->setText(i18n("%1 will be downloaded", \
KGlobal::locale()->formatByteSize(downloadSize)));  }
 
+    m_processQueueOptions.clear();
+    QVBoxLayout *lay = new QVBoxLayout;
+
+    foreach (Shaman::ProcessQueueOption * const option,
+             Shaman::Base::instance()->core()->backend()->availableProcessQueueOptions()) \
{ +        QCheckBox *box = new QCheckBox(option->name());
+        box->setWhatsThis(option->description());
+        box->setToolTip(option->description());
+        lay->addWidget(box);
+        m_processQueueOptions.insert(option, box);
+    }
+
+    ui.processingOptionsWidget->setLayout(lay);
+    ui.processingOptionsWidget->hide();
+
     setModal(true);
 
     connect(this, SIGNAL(accepted()), SLOT(slotAccepted()));
@@ -335,6 +350,20 @@
         if (item->checkState(0) == Qt::Checked)
             returnPackages << packages[item->text(0)];
     }
+
+    Shaman::ProcessQueueOption::List newopts;
+    QHash<Shaman::ProcessQueueOption*, QCheckBox*>::const_iterator i;
+    for (i = m_processQueueOptions.constBegin(); i != \
m_processQueueOptions.constEnd(); ++i) { +        if (i.value()->isChecked()) {
+            kDebug() << "Option " << i.key()->name() << " enabled";
+            newopts.append(i.key());
+        }
+    }
+
+    m_handler->m_options = newopts;
+    m_handler->unmarkTargets();
+    m_handler->markTargets();
+
     emit processQueue(returnPackages);
 }
 
@@ -345,40 +374,5 @@
 
 void ReviewQueueDialog::slotChangeProcessingOptions()
 {
-    KDialog *dial = new KDialog(this);
-    dial->setButtons(KDialog::Ok | KDialog::Cancel);
-    dial->setModal(true);
-    dial->setWindowTitle(i18n("Set queue options"));
-    QHash<Shaman::ProcessQueueOption*, QCheckBox*> checkboxes;
-    QVBoxLayout *lay = new QVBoxLayout;
-
-    foreach (Shaman::ProcessQueueOption * const option,
-             Shaman::Base::instance()->core()->backend()->availableProcessQueueOptions()) \
                {
-        QCheckBox *box = new QCheckBox(option->name());
-        box->setWhatsThis(option->description());
-        box->setToolTip(option->description());
-        lay->addWidget(box);
-        checkboxes.insert(option, box);
-    }
-
-    QWidget *w = new QWidget;
-    w->setLayout(lay);
-    dial->setMainWidget(w);
-
-    if (dial->exec() == KDialog::Accepted) {
-        // Set the options and start again
-        Shaman::ProcessQueueOption::List newopts;
-        QHash<Shaman::ProcessQueueOption*, QCheckBox*>::const_iterator i;
-        for (i = checkboxes.constBegin(); i != checkboxes.constEnd(); ++i) {
-            if (i.value()->isChecked()) {
-                kDebug() << "Option " << i.key()->name() << " enabled";
-                newopts.append(i.key());
-            }
-        }
-
-        m_handler->m_options = newopts;
-        m_handler->unmarkTargets();
-        m_handler->markTargets();
-        deleteLater();
-    }
+    ui.processingOptionsWidget->setVisible(ui.changeProcessOptions->isChecked());
 }
--- trunk/playground/sysadmin/shaman/shaman/src/processqueue/ReviewQueueDialog.h \
#1089359:1089360 @@ -21,7 +21,12 @@
 class ProcessQueueHandler;
 class QTreeWidget;
 class QTreeWidgetItem;
+class QCheckBox;
 
+namespace Shaman {
+    class ProcessQueueOption;
+}
+
 class ReviewQueueDelegate : public QStyledItemDelegate
 {
     Q_OBJECT
@@ -72,6 +77,7 @@
         Ui::ReviewQueueDialog ui;
         ReviewQueueDelegate * m_delegate;
         ProcessQueueHandler * m_handler;
+        QHash<Shaman::ProcessQueueOption*, QCheckBox*> m_processQueueOptions;
 };
 
 #endif
--- trunk/playground/sysadmin/shaman/shaman/ui/ReviewQueueDialog.ui #1089359:1089360
@@ -7,7 +7,7 @@
     <x>0</x>
     <y>0</y>
     <width>370</width>
-    <height>262</height>
+    <height>226</height>
    </rect>
   </property>
   <layout class="QGridLayout" name="gridLayout">
@@ -68,10 +68,16 @@
        <property name="text">
         <string>Change processing options</string>
        </property>
+       <property name="checkable">
+        <bool>true</bool>
+       </property>
       </widget>
      </item>
     </layout>
    </item>
+   <item row="6" column="0">
+    <widget class="QWidget" name="processingOptionsWidget" native="true"/>
+   </item>
   </layout>
  </widget>
  <customwidgets>


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

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