-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#38: now remembers last visited directory #52
base: master
Are you sure you want to change the base?
#38: now remembers last visited directory #52
Conversation
This works by file selection using the GUI, or by file addition with a drag&drop operation. Signed-off-by: Joël Bourgault <[email protected]>
Signed-off-by: Joël BOURGAULT <[email protected]>
These I201 / I202 errors are really annoying, particularly when last commit for Photocollage v1.4.4 raised no complaints, and when I made no change to these lines. RRh. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tested it and it works good!
However I would prefer last_visited_dir
and folder
to default to None
, and not calling Gtk.FileChooserDialog.set_current_folder()
when we don't know what dir to show (i.e. on first use). This way, "recent files" would be shown instead, which is pretty handy. What do you think?
About commits: please don't use GitHub-specific things in commit titles (like issues numbers or usernames), it's hard to understand when reading emails, in git log
or when rebasing. Also this project uses Linux commit messages style for consistency and readability: this would give something like "gtkgui: Remember last visited directory" (feel free to read the commit log for examples!)
photocollage/gtkgui.py
Outdated
@@ -779,7 +786,9 @@ class PreviewFileChooserDialog(Gtk.FileChooserDialog): | |||
PREVIEW_MAX_SIZE = 256 | |||
|
|||
def __init__(self, **kw): | |||
folder = kw.pop('folder', '.') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The following would be more Pythonic and more readable, what do you think?
def __init__(self, folder='.', **kw):
super(PreviewFileChooserDialog, self).__init__(**kw)
self.set_current_folder(folder)
Also, changed signature of PreviewFileChooserDialog, to have `folder` as a visible parameter. Signed-off-by: Joël Bourgault <[email protected]>
Signed-off-by: Joël Bourgault <[email protected]>
Comments appreciated and agreed! I made the changes. (Well, almost all: may I avoid I also added the persistance of output folder selection. |
This works by file selection using the GUI, or by file addition with a
drag&drop operation.
Signed-off-by: Joël Bourgault [email protected]