Bug 126475

Summary: Gwenview should start in the directory it was closed in last time
Product: [Applications] gwenview Reporter: Philipp Sternberg <philipp.sternberg>
Component: generalAssignee: Gwenview Bugs <gwenview-bugs-null>
Status: RESOLVED FIXED    
Severity: wishlist    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:

Description Philipp Sternberg 2006-04-29 17:49:11 UTC
Version:           1.3.1 (using KDE 3.5.1, Debian Package 4:3.5.1-2 (testing/unstable))
Compiler:          Target: i486-linux-gnu
OS:                Linux (i686) release 2.6.14.2y

Hi

like Gwenview very much esp. as it is very very usable. In terms of usability it would be nice if Gwenview would start in the directory in which it was closed the last time.

Ok, i'm not asking for making this standard behaviour, this may be annoying for useres how are used to see Gwenview starting in their home-directory. However it would be nice if this could be implemnted as an option (preferably configurable in the Misc. section of the configuration dialog or in a new section called "Startup")...

Regards

Philipp
Comment 1 Aurelien Gateau 2006-08-17 00:34:16 UTC
SVN commit 573656 by gateau:

Optionally remember last URL.
BUG: 126475


 M  +2 -0      NEWS  
 M  +28 -0     app/configrememberpage.ui  
 M  +7 -1      app/main.cpp  
 M  +4 -0      gvcore/rememberconfig.kcfg  


--- trunk/extragear/graphics/gwenview/NEWS #573655:573656
@@ -2,6 +2,8 @@
 - New features:
  - Use the same delete dialog as Amarok and Juk, to easily choose between
    sending files to trash or permanently deleting them.
+ - A page has been added to let the user select which settings should be
+   remembered when Gwenview is restarted.
 - Fixes:
  - The thumbnail files are now generated using correct name and permissions
    according to Thumbnail Managing Standard
--- trunk/extragear/graphics/gwenview/app/configrememberpage.ui #573655:573656
@@ -29,7 +29,35 @@
             <property name="text">
                 <string>State of filter</string>
             </property>
+            <property name="accel">
+                <string></string>
+            </property>
         </widget>
+        <widget class="QCheckBox">
+            <property name="name">
+                <cstring>kcfg_url</cstring>
+            </property>
+            <property name="text">
+                <string>Last opened URL</string>
+            </property>
+        </widget>
+        <spacer>
+            <property name="name">
+                <cstring>spacer1</cstring>
+            </property>
+            <property name="orientation">
+                <enum>Vertical</enum>
+            </property>
+            <property name="sizeType">
+                <enum>Expanding</enum>
+            </property>
+            <property name="sizeHint">
+                <size>
+                    <width>33</width>
+                    <height>104</height>
+                </size>
+            </property>
+        </spacer>
     </vbox>
 </widget>
 <layoutdefaults spacing="6" margin="11"/>
--- trunk/extragear/graphics/gwenview/app/main.cpp #573655:573656
@@ -29,6 +29,8 @@
 #include "gvcore/cache.h"
 #include "gvcore/fileviewcontroller.h"
 #include <../gvcore/fileviewconfig.h>
+#include <../gvcore/miscconfig.h>
+#include <../gvcore/rememberconfig.h>
 #include "mainwindow.h"
 namespace Gwenview {
 
@@ -145,7 +147,11 @@
 		if (args->count()>0) {
 			url=args->url(0);
 		} else {
-			url.setPath( QDir::currentDirPath() );
+			if (RememberConfig::url() && MiscConfig::history().count() > 0) {
+				url = KURL(MiscConfig::history()[0]);
+			} else {
+				url.setPath( QDir::currentDirPath() );
+			}
 		}
 		mainWindow->openURL(url);
 		
--- trunk/extragear/graphics/gwenview/gvcore/rememberconfig.kcfg #573655:573656
@@ -7,5 +7,9 @@
       <label>Whether Gwenview should remember the file filter.</label> 
       <default>false</default>
     </entry> 
+    <entry name="url" type="Bool"> 
+      <label>Whether Gwenview should remember the last URL.</label> 
+      <default>false</default>
+    </entry> 
   </group> 
 </kcfg>