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

List:       koffice-devel
Subject:    [patch] Re: Presentation duration display
From:       Brad Hards <bhards () bigpond ! net ! au>
Date:       2004-05-02 1:13:47
Message-ID: 200405021113.47473.bhards () bigpond ! net ! au
[Download RAW message or body]

On Fri, 30 Apr 2004 10:03 pm, David Faure wrote:
> Well, it looks like it works then, there are no more complex cases than
> those two (except that Singapur has TimeFormat=%p %H:%M:%S so the removal
> of %p (am/pm) will lead to a leading space... no big deal though). I'll
> commit.
I've incorporated this, and the changes to the labels, and not displaying
slides that are disabled, which is my understanding of the rough concensus.

Adding functionality so that if you click on the slide title is going to be a
bit trickier (I'm guessing I need to subclass KListViewItem and reimplement
activated() or something like that). So that has to wait.

OK to commit this part?

Brad

Index: kpresenter_view.cc
===================================================================
RCS file: /home/kde/koffice/kpresenter/kpresenter_view.cc,v
retrieving revision 1.1008
diff -u -4 -p -r1.1008 kpresenter_view.cc
--- kpresenter_view.cc  23 Apr 2004 08:21:10 -0000      1.1008
+++ kpresenter_view.cc  2 May 2004 01:08:44 -0000
@@ -5900,12 +5900,20 @@ void KPresenterView::pddClosed()
     presDurationDia = 0;
 }

 // change from milliseconds to hh:mm:ss
+// in kdelibs 3.2.90, an additional method was added that basically
+// allows formatting of time as a duration. Before this, you can get
+// weirdness (such as a duration of 12:00:03 am) depending on how the
+// time format is set.
 QString KPresenterView::presentationDurationDataFormatChange( int _time )
 {
     QTime time( 0, 0, 0 );
-    return KGlobal::locale()->formatTime( time.addMSecs( _time ), true );
+#if KDE_IS_VERSION(3, 2, 90)
+    return KGlobal::locale()->formatTime( time.addMSecs( _time ), true, true );
+#else
+    return KGlobal::locale()->formatTime( time.addMSecs( _time ), true);
+#endif
 }

 KPrPage * KPresenterView::stickyPage() const
 {
Index: presdurationdia.cc
===================================================================
RCS file: /home/kde/koffice/kpresenter/presdurationdia.cc,v
retrieving revision 1.10
diff -u -4 -p -r1.10 presdurationdia.cc
--- presdurationdia.cc  3 Jan 2004 06:58:45 -0000       1.10
+++ presdurationdia.cc  2 May 2004 01:08:44 -0000
@@ -58,22 +58,24 @@ KPPresDurationDia::KPPresDurationDia( QW

 void KPPresDurationDia::setupSlideList( QWidget *_page )
 {
     slides = new KListView( _page );
-    slides->addColumn( i18n( "Slide No." ) );
-    slides->addColumn( i18n( "Slide Time" ) );
+    slides->addColumn( i18n( "No." ) );
+    slides->addColumn( i18n( "Display Duration" ) );
     slides->addColumn( i18n( "Slide Title" ) );
     slides->header()->setMovingEnabled( false );
     slides->setAllColumnsShowFocus( true );
     slides->setRootIsDecorated( false );
     slides->setSorting( -1 );

     for ( int i = doc->getPageNums() - 1; i >= 0; --i ) {
-        KListViewItem *item = new KListViewItem( slides );
-        item->setPixmap( 0, KPBarIcon( "newslide" ) );
-        item->setText( 0, QString( "%1" ).arg( i + 1 ) );
-        item->setText( 1, *m_durationListString.at( i ) );
-        item->setText( 2, doc->pageList().at( i )->pageTitle( i18n( "Slide %1" ).arg( i + 1 ) ) );
+        if ( doc->pageList().at( i )->isSlideSelected() ) {
+            KListViewItem *item = new KListViewItem( slides );
+            item->setPixmap( 0, KPBarIcon( "newslide" ) );
+            item->setText( 0, QString( "%1" ).arg( i + 1 ) );
+            item->setText( 1, *m_durationListString.at( i ) );
+            item->setText( 2, doc->pageList().at( i )->pageTitle( i18n( "Slide %1" ).arg( i + 1 ) ) );
+        }
     }
 }

 #include "presdurationdia.moc"
_______________________________________________
koffice-devel mailing list
koffice-devel@mail.kde.org
https://mail.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