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

List:       koffice-devel
Subject:    Re: Patch for KPresenter (progress bar of "Select All")
From:       Toshitaka Fujioka <toshitaka () kde ! gr ! jp>
Date:       2001-06-22 15:47:00
[Download RAW message or body]

On Friday 22 June 2001 18:39, David Faure wrote:
> On Friday 22 June 2001 05:45, Toshitaka Fujioka wrote:
> > Hello,
> >
> > This patch displays progress bar when user executed "Select All".
> > (Werner listed this.)
> >
> > Please review.
>
> Very cool.
>
> Just nitpicking (as usual) :
>     for ( int i = 0; i <= static_cast<int>( objectList()->count() ); i++ )
> { is written simpler as
>     for ( uint i = 0; i <= objectList()->count(); i++ ) {

I see.

> Also, this patch adds a i18n( "Selecting..." ) which breaks the message
> freeze (unless kpresenter already has such a message somewhere else).
> Well, for one string that doesn't appear very long you might get away with
> it ;-)

When is the message freeze removed ?

> Oh, and
> +        if ( progress.wasCancelled() )
> +            break;
> This means that if I press Cancel, half of the objects will still be
> selected. I'm afraid you have to unselect the objects when cancel is
> pressed ? Then you need a progress bar for doing that, which has cancel
> too, etc. LOL :)))) In fact here it might be a good idea NOT to have cancel
> (after all, unselecting all objects is as simple as clicking somewhere).

Ah, I see. 

> Can QProgressDialog not have a cancel button ? Not sure.

I remade patch.

Thank you.
-- 
Toshitaka Fujioka
http://www.kde.org                The K Desktop Environment Project
                                                    fujioka@kde.org
http://www.kde.gr.jp               Japan KDE User's Group
                                                    toshitaka@kde.gr.jp

-- We offer the best Desktop Environment to you.  (This is my goal. ;-)) --     


["koffice-kpresenter-selecteAll-progressBar-20010623.diff" (text/plain)]

diff -ur koffice.orig/kpresenter/page.cc koffice/kpresenter/page.cc
--- koffice.orig/kpresenter/page.cc	Fri Jun 22 18:56:30 2001
+++ koffice/kpresenter/page.cc	Sat Jun 23 00:34:46 2001
@@ -1270,8 +1270,15 @@
 /*====================== select all objects ======================*/
 void Page::selectAllObj()
 {
-    for ( int i = 0; i <= static_cast<int>( objectList()->count() ); i++ )
+    QProgressDialog progress( i18n( "Selecting..." ), 0,
+                              objectList()->count(), this );
+
+    for ( uint i = 0; i <= objectList()->count(); i++ ) {
         selectObj( i );
+
+        progress.setProgress( i );
+        kapp->processEvents();
+    }
 
     mouseSelectedObject = true;
     emit objectSelectedChanged();

_______________________________________________
Koffice-devel mailing list
Koffice-devel@master.kde.org
http://master.kde.org/mailman/listinfo/koffice-devel


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

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