summaryrefslogtreecommitdiff
path: root/grc/gui/FileDialogs.py
diff options
context:
space:
mode:
Diffstat (limited to 'grc/gui/FileDialogs.py')
-rw-r--r--grc/gui/FileDialogs.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/grc/gui/FileDialogs.py b/grc/gui/FileDialogs.py
index 9d047b1ffd..c4daae3ad6 100644
--- a/grc/gui/FileDialogs.py
+++ b/grc/gui/FileDialogs.py
@@ -88,7 +88,7 @@ class FileDialogHelper(gtk.FileChooserDialog):
Implement a file chooser dialog with only necessary parameters.
"""
- def __init__(self, action, title):
+ def __init__(self, action, title, parent):
"""
FileDialogHelper contructor.
Create a save or open dialog with cancel and ok buttons.
@@ -99,7 +99,7 @@ class FileDialogHelper(gtk.FileChooserDialog):
title: the title of the dialog (string)
"""
ok_stock = {gtk.FILE_CHOOSER_ACTION_OPEN : 'gtk-open', gtk.FILE_CHOOSER_ACTION_SAVE : 'gtk-save'}[action]
- gtk.FileChooserDialog.__init__(self, title, None, action, ('gtk-cancel', gtk.RESPONSE_CANCEL, ok_stock, gtk.RESPONSE_OK))
+ gtk.FileChooserDialog.__init__(self, title, parent, action, ('gtk-cancel', gtk.RESPONSE_CANCEL, ok_stock, gtk.RESPONSE_OK))
self.set_select_multiple(False)
self.set_local_only(True)
self.add_filter(get_all_files_filter())
@@ -108,7 +108,7 @@ class FileDialogHelper(gtk.FileChooserDialog):
class FileDialog(FileDialogHelper):
"""A dialog box to save or open flow graph files. This is a base class, do not use."""
- def __init__(self, current_file_path=''):
+ def __init__(self, parent, current_file_path=''):
"""
FileDialog constructor.
@@ -117,25 +117,25 @@ class FileDialog(FileDialogHelper):
"""
if not current_file_path: current_file_path = path.join(DEFAULT_FILE_PATH, NEW_FLOGRAPH_TITLE + Preferences.file_extension())
if self.type == OPEN_FLOW_GRAPH:
- FileDialogHelper.__init__(self, gtk.FILE_CHOOSER_ACTION_OPEN, 'Open a Flow Graph from a File...')
+ FileDialogHelper.__init__(self, gtk.FILE_CHOOSER_ACTION_OPEN, 'Open a Flow Graph from a File...', parent)
self.add_and_set_filter(get_flow_graph_files_filter())
self.set_select_multiple(True)
elif self.type == SAVE_FLOW_GRAPH:
- FileDialogHelper.__init__(self, gtk.FILE_CHOOSER_ACTION_SAVE, 'Save a Flow Graph to a File...')
+ FileDialogHelper.__init__(self, gtk.FILE_CHOOSER_ACTION_SAVE, 'Save a Flow Graph to a File...', parent)
self.add_and_set_filter(get_flow_graph_files_filter())
self.set_current_name(path.basename(current_file_path))
elif self.type == SAVE_CONSOLE:
- FileDialogHelper.__init__(self, gtk.FILE_CHOOSER_ACTION_SAVE, 'Save Console to a File...')
+ FileDialogHelper.__init__(self, gtk.FILE_CHOOSER_ACTION_SAVE, 'Save Console to a File...', parent)
self.add_and_set_filter(get_text_files_filter())
file_path = path.splitext(path.basename(current_file_path))[0]
self.set_current_name(file_path) #show the current filename
elif self.type == SAVE_IMAGE:
- FileDialogHelper.__init__(self, gtk.FILE_CHOOSER_ACTION_SAVE, 'Save a Flow Graph Screen Shot...')
+ FileDialogHelper.__init__(self, gtk.FILE_CHOOSER_ACTION_SAVE, 'Save a Flow Graph Screen Shot...', parent)
self.add_and_set_filter(get_image_files_filter())
current_file_path = current_file_path + IMAGE_FILE_EXTENSION
self.set_current_name(path.basename(current_file_path)) #show the current filename
elif self.type == OPEN_QSS_THEME:
- FileDialogHelper.__init__(self, gtk.FILE_CHOOSER_ACTION_OPEN, 'Open a QSS theme...')
+ FileDialogHelper.__init__(self, gtk.FILE_CHOOSER_ACTION_OPEN, 'Open a QSS theme...', parent)
self.add_and_set_filter(get_qss_themes_filter())
self.set_select_multiple(False)
self.set_current_folder(path.dirname(current_file_path)) #current directory
@@ -228,8 +228,8 @@ class SaveImageFileDialog(FileDialog):
class SaveScreenShotDialog(SaveImageFileDialog):
- def __init__(self, current_file_path=''):
- SaveImageFileDialog.__init__(self, current_file_path)
+ def __init__(self, parent, current_file_path=''):
+ SaveImageFileDialog.__init__(self, parent, current_file_path)
self._button = button = gtk.CheckButton('_Background transparent')
self._button.set_active(Preferences.screen_shot_background_transparent())
self.set_extra_widget(button)