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

List:       kde-commits
Subject:    extragear/office/skrooge
From:       Stephane Mankowski <stephane () mankowski ! fr>
Date:       2009-09-19 18:16:25
Message-ID: 1253384185.986298.26422.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1025799 by smankowski:

BUG: 200790: Search creation doesn't take not validate predicate 

 M  +1 -0      CHANGELOG  
 M  +21 -0     skgbankgui/skgpredicatcreator.cpp  
 M  +10 -3     skgbankgui/skgpredicatcreator.h  
 M  +8 -1      skgbankgui/skgquerydelegate.cpp  
 M  +3 -0      skgbankgui/skgquerydelegate.h  


--- trunk/extragear/office/skrooge/CHANGELOG #1025798:1025799
@@ -13,6 +13,7 @@
   *Correction bug 191966: Treeviews collapsed when updated 
   *Correction bug 207672: Align amount values on the right for cleaner views 
   *Correction bug 207713: Display some information after applying a process 
+  *Correction bug 200790: Search creation doesn't take not validate predicate 
   *New function to create template of operations
   *New function to schedule templates
   *New function to create template from existing operations
--- trunk/extragear/office/skrooge/skgbankgui/skgpredicatcreator.cpp #1025798:1025799
@@ -31,6 +31,7 @@
 #include <QDomDocument>
 #include <QTableWidget>
 #include <QCheckBox>
+#include <QApplication>
 
 SKGPredicatCreator::SKGPredicatCreator(QWidget *parent, SKGDocument* document, const \
                QString& attribute, bool iModeUpdate, const QStringList& iListAtt)
                 : QWidget(parent), updateMode(iModeUpdate), kValue1(NULL), \
kValue2(NULL), kAttributes(NULL) @@ -158,6 +159,11 @@
         kOperator->clear();
         kOperator->addItem ("" , "" );
 
+        if (kValue1) kValue1->installEventFilter ( this );
+        if (kValue2) kValue2->installEventFilter ( this );
+        if (kOperator) kOperator->installEventFilter ( this );
+        if (kAttributes) kOperator->installEventFilter ( this );
+
         QStringList listOps=SKGRuleObject::getListOfOperators(attType, updateMode);
         int nb=listOps.count();
         if (!editable && nb>1) nb=1;
@@ -181,6 +187,21 @@
         kAttributes=NULL;
 }
 
+bool SKGPredicatCreator::eventFilter ( QObject *object, QEvent *event )
+{
+        Q_UNUSED(object);
+        if (event->type()==QEvent::FocusIn || event->type()==QEvent::FocusOut) {
+                QObject* appliFocus=QApplication::focusWidget();
+
+                while (appliFocus) {
+                        if (appliFocus==this) break;
+                        appliFocus=appliFocus->parent();
+                }
+                if (!appliFocus) emit editingFinished();
+        }
+        return false;
+}
+
 void SKGPredicatCreator::onOperatorChanged()
 {
         QString req;
--- trunk/extragear/office/skrooge/skgbankgui/skgpredicatcreator.h #1025798:1025799
@@ -76,12 +76,19 @@
          * @param iText the description
          */
         virtual void setXmlDescription(const QString& iXML);
+
 signals:
+        void editingFinished();
 
+protected :
+        /**
+         * Event filtering
+         * @param object object
+         * @param event event
+         * @return In your reimplementation of this function, if you want to filter \
the event out, i.e. stop it being handled further, return true; otherwise return \
false. +         */
+        bool eventFilter ( QObject *object, QEvent *event );
 
-public slots:
-
-
 private slots:
         void onOperatorChanged();
 
--- trunk/extragear/office/skrooge/skgbankgui/skgquerydelegate.cpp #1025798:1025799
@@ -49,7 +49,7 @@
         QString attname=it_h->data(Qt::UserRole).toString();
 
         SKGPredicatCreator* editor=new SKGPredicatCreator(parent, document, attname, \
                updateMode, listAtt);
-
+        connect(editor, SIGNAL(editingFinished()), this, \
SLOT(commitAndCloseEditor()));  return editor;
 }
 
@@ -74,5 +74,12 @@
         } else QItemDelegate::setModelData (editor, model, index);
 }
 
+void SKGQueryDelegate::commitAndCloseEditor()
+{
+        SKGPredicatCreator *editor = qobject_cast<SKGPredicatCreator *>(sender());
+        emit commitData(editor);
+        emit closeEditor(editor);
+}
+
 #include "skgquerydelegate.moc"
 
--- trunk/extragear/office/skrooge/skgbankgui/skgquerydelegate.h #1025798:1025799
@@ -71,6 +71,9 @@
          */
         virtual void setModelData(QWidget *editor, QAbstractItemModel *model, const \
QModelIndex &index) const;  
+private slots:
+        void commitAndCloseEditor();
+
 private:
         Q_DISABLE_COPY(SKGQueryDelegate);
 


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

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