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

List:       kde-commits
Subject:    kdegraphics/kghostview
From:       David Faure <faure () kde ! org>
Date:       2004-07-05 10:41:41
Message-ID: 20040705104141.C70109986 () office ! kde ! org
[Download RAW message or body]

CVS commit by faure: 

Load and save display options (in particular the zoom value) in KGhostview's part.
This fixes a KOffice usability issue that my wife pointed out: she had to change
the zoom in the "print preview" dialog (to view the full page) every single time
she pressed the print preview button.
This code isn't activated in the standalone-kghostview case, which has its own
settings code.


  M +10 -3     kgv_view.cpp   1.186
  M +2 -1      kgv_view.h   1.82
  M +1 -1      kgvfactory.cpp   1.3


--- kdegraphics/kghostview/kgv_view.cpp  #1.185:1.186
@@ -85,4 +85,5 @@ KGVPart::KGVPart( QWidget* parentWidget,
     _isFileDirty( false ),
     _stickyOptions( false ),
+    _embeddedInKGhostView( !args.contains( "KParts::ReadOnlyPart" ) ),
     _customZoomIndex( -1 )
 {
@@ -343,10 +344,10 @@ KGVPart::KGVPart( QWidget* parentWidget,
     connect( _pageView, SIGNAL( ReadDown() ), SLOT( slotReadDown() ));
 
-    readSettings();
-
     QStringList items = document()->mediaNames();
     items.prepend( i18n( "Auto ") );
     _selectMedia->setItems( items );
 
+    readSettings();
+
     updatePageDepActions();
 }
@@ -434,4 +435,6 @@ void KGVPart::writeSettings()
     general.writeEntry( "ShowPageList", _showPageList->isChecked() );
     general.writeEntry( "ShowPageNames", _showPageLabels->isChecked() );
+    if ( !_embeddedInKGhostView )
+        general.writeEntry( "Display Options", DisplayOptions::toString( \
miniWidget()->displayOptions() ) );  general.sync();
 }
@@ -450,4 +453,9 @@ void KGVPart::readSettings()
 
     _showLogWindow = _configDialog->showMessages();
+    if ( !_embeddedInKGhostView ) {
+        DisplayOptions options;
+        if ( DisplayOptions::fromString( options, general.readEntry( "Display \
Options" ) ) ) +            setDisplayOptions( options );
+    }
 }
 
@@ -709,5 +717,4 @@ void KGVPart::slotOpenFileCompleted()
             _fileWatcher->addFile( m_file );
         slotWatchFile();
-        slotZoom( i18n( "zoom-factor (percentage)", "%1%" ). arg( 100 ) );
         updateZoomActions();
         emit completed();

--- kdegraphics/kghostview/kgv_view.h  #1.81:1.82
@@ -219,4 +219,5 @@ private:
     bool _showLogWindow    : 1;
     bool _stickyOptions    : 1;
+    bool _embeddedInKGhostView : 1;
 
     int _customZoomIndex;

--- kdegraphics/kghostview/kgvfactory.cpp  #1.2:1.3
@@ -65,6 +65,6 @@ KParts::Part *KGVFactory::createPartObje
      * as we did before.
      */
+    args << QString::fromLatin1( className );
     if ( !strcmp( className, "Browser/View" ) ) {
-            args << QString::fromLatin1( "Browser/View" );
             className = "KParts::ReadOnlyPart";
     }


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

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