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

List:       kde-commits
Subject:    kdepim/libkdepim
From:       Till Adam <adam () kde ! org>
Date:       2005-03-28 19:47:14
Message-ID: 20050328194714.2609F631 () office ! kde ! org
[Download RAW message or body]

CVS commit by tilladam: 

Remember the state of the progress dialog in between invocations. If it
is expanded it will auto-expand when new items appear until explicitely
collapsed.

BUGS: 88591


  M +11 -5     progressdialog.cpp   1.34
  M +1 -0      progressdialog.h   1.20


--- kdepim/libkdepim/progressdialog.cpp  #1.33:1.34
@@ -230,5 +230,5 @@ void TransactionItem::addSubTransaction(
 
 ProgressDialog::ProgressDialog( QWidget* alignWidget, QWidget* parent, const char* \
                name )
-    : OverlayWidget( alignWidget, parent, name )
+    : OverlayWidget( alignWidget, parent, name ), mWasLastShown( false )
 {
     setFrameStyle( QFrame::Panel | QFrame::Sunken ); // QFrame
@@ -297,7 +297,11 @@ void ProgressDialog::slotTransactionAdde
      }
    } else {
-     TransactionItem *ti = mScrollView->addTransactionItem( item, \
mTransactionsToListviewItems.empty() ); +     const bool first = \
mTransactionsToListviewItems.empty(); +     TransactionItem *ti = \
mScrollView->addTransactionItem( item, first );  if ( ti )
        mTransactionsToListviewItems.replace( item, ti );
+     if ( first && mWasLastShown )
+       QTimer::singleShot( 1000, this, SLOT( slotShow() ) );
+
    }
 }
@@ -375,4 +379,5 @@ void ProgressDialog::slotHide()
 void ProgressDialog::slotClose()
 {
+  mWasLastShown = false;
   setVisible( false );
 }
@@ -394,4 +399,5 @@ void ProgressDialog::slotToggleVisibilit
    * are no items to be shown anymore. Guard against that.
    */
+  mWasLastShown = !isShown();
   if ( isShown() || !mTransactionsToListviewItems.isEmpty() )
     setVisible( !isShown() );

--- kdepim/libkdepim/progressdialog.h  #1.19:1.20
@@ -147,4 +147,5 @@ protected:
   TransactionItem* mPreviousItem;
   QMap< const ProgressItem*, TransactionItem* > mTransactionsToListviewItems;
+  bool mWasLastShown;
 };
 


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

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