- Timestamp:
- 05/21/10 02:03:48 (2 years ago)
- Children:
- a6b884ed033bd91214c084f36a80eb9a0e049c6a
- Parents:
- eb367573c9a8c777f3776814ffd2d795e688b2ef
- git-committer:
- Luper Rouch <luper.rouch@…> (05/21/10 02:03:48)
- File:
-
- 1 edited
-
pyflu/pyflu/qt/util.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
pyflu/pyflu/qt/util.py
r782716f rba4fbc6 67 67 68 68 69 def get_open_path(parent, settings_path , filter=None):69 def get_open_path(parent, settings_path=None, filter=None): 70 70 """ 71 71 Shows an 'open file' dialog and returns the selected path. 72 72 73 73 Also remembers the selected folder, so that subsequent calls to this 74 function with the same ``settings_path``will open in the last selected74 function with the same *settings_path* will open in the last selected 75 75 directory. 76 76 77 If ``filter``is specified, it must be an iterable containing filters78 definitions. See the ``format_file_dialog_filter_string()`` docstring for77 If *filter* is specified, it must be an iterable containing filters 78 definitions. See the :func:`format_file_dialog_filter_string` docstring for 79 79 details. 80 80 … … 83 83 # Get the last used save directory 84 84 settings = QSettings() 85 last_dir = unicode(settings.value(settings_path, QVariant(u"")).toString()) 85 if settings_path is not None: 86 last_dir = unicode(settings.value(settings_path, 87 QVariant(u"")).toString()) 88 else: 89 last_dir = QString() 86 90 # Get save location 87 91 if filter is not None: … … 94 98 return None 95 99 open_path = unicode(open_path) 96 # Remember save location directory 97 settings.setValue(settings_path, QVariant(dirname(open_path))) 100 if settings_path is not None: 101 # Remember save location directory 102 settings.setValue(settings_path, QVariant(dirname(open_path))) 98 103 return open_path 99 104
Note: See TracChangeset
for help on using the changeset viewer.
