summaryrefslogtreecommitdiff
path: root/grc/gui/Dialogs.py
diff options
context:
space:
mode:
Diffstat (limited to 'grc/gui/Dialogs.py')
-rw-r--r--grc/gui/Dialogs.py33
1 files changed, 12 insertions, 21 deletions
diff --git a/grc/gui/Dialogs.py b/grc/gui/Dialogs.py
index f2941250a8..6cfdd50a34 100644
--- a/grc/gui/Dialogs.py
+++ b/grc/gui/Dialogs.py
@@ -17,15 +17,13 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
"""
-import pygtk
-pygtk.require('2.0')
import gtk
import sys
from distutils.spawn import find_executable
-
-from . import Utils, Actions, Constants, Messages
+from . import Utils, Actions
+from ..core import Messages
class SimpleTextDisplay(gtk.TextView):
@@ -177,14 +175,14 @@ def ErrorsDialog(flowgraph): MessageDialogHelper(
class AboutDialog(gtk.AboutDialog):
"""A cute little about dialog."""
- def __init__(self, platform):
+ def __init__(self, config):
"""AboutDialog constructor."""
gtk.AboutDialog.__init__(self)
- self.set_name(platform.get_name())
- self.set_version(platform.get_version())
- self.set_license(platform.get_license())
- self.set_copyright(platform.get_license().splitlines()[0])
- self.set_website(platform.get_website())
+ self.set_name(config.name)
+ self.set_version(config.version)
+ self.set_license(config.license)
+ self.set_copyright(config.license.splitlines()[0])
+ self.set_website(config.website)
self.run()
self.destroy()
@@ -240,7 +238,7 @@ def MissingXTermDialog(xterm):
)
-def ChooseEditorDialog():
+def ChooseEditorDialog(config):
# Give the option to either choose an editor or use the default
# Always return true/false so the caller knows it was successful
buttons = (
@@ -266,10 +264,7 @@ def ChooseEditorDialog():
file_dialog.set_current_folder('/usr/bin')
try:
if file_dialog.run() == gtk.RESPONSE_OK:
- file_path = file_dialog.get_filename()
- Constants.prefs.set_string('grc', 'editor', file_path)
- Constants.prefs.save()
- Constants.EDITOR = file_path
+ config.editor = file_path = file_dialog.get_filename()
file_dialog.destroy()
return file_path
finally:
@@ -287,16 +282,12 @@ def ChooseEditorDialog():
if process is None:
raise ValueError("Can't find default editor executable")
# Save
- Constants.prefs.set_string('grc', 'editor', process)
- Constants.prefs.save()
- Constants.EDITOR = process
+ config.editor = process
return process
except Exception:
Messages.send('>>> Unable to load the default editor. Please choose an editor.\n')
# Just reset of the constant and force the user to select an editor the next time
- Constants.prefs.set_string('grc', 'editor', '')
- Constants.prefs.save()
- Constants.EDITOR = ""
+ config.editor = ''
return
Messages.send('>>> No editor selected.\n')