diff options
Diffstat (limited to 'grc/src/gui')
-rw-r--r-- | grc/src/gui/ActionHandler.py | 9 | ||||
-rw-r--r-- | grc/src/gui/Constants.py | 13 | ||||
-rw-r--r-- | grc/src/gui/FileDialogs.py | 5 | ||||
-rw-r--r-- | grc/src/gui/MainWindow.py | 4 | ||||
-rw-r--r-- | grc/src/gui/Preferences.py | 4 |
5 files changed, 22 insertions, 13 deletions
diff --git a/grc/src/gui/ActionHandler.py b/grc/src/gui/ActionHandler.py index 95825bd0a..7558d16ae 100644 --- a/grc/src/gui/ActionHandler.py +++ b/grc/src/gui/ActionHandler.py @@ -18,9 +18,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA """ import os -import signal -from .. platforms.base.Constants import PY_GTK_ICON, IMAGE_FILE_EXTENSION -from Constants import DIR_LEFT, DIR_RIGHT +import signal +from Constants import DIR_LEFT, DIR_RIGHT, IMAGE_FILE_EXTENSION import Actions import pygtk pygtk.require('2.0') @@ -54,7 +53,9 @@ class ActionHandler: """ self.clipboard = None platform = Platform(platform) - if PY_GTK_ICON: gtk.window_set_default_icon_from_file(PY_GTK_ICON) + #setup icon using icon theme + try: gtk.window_set_default_icon(gtk.IconTheme().load_icon('gnuradio-grc', 256, 0)) + except: pass for action in Actions.ACTIONS_LIST: action.connect('activate', self._handle_actions) #setup the main window self.main_window = MainWindow(self.handle_states, platform) diff --git a/grc/src/gui/Constants.py b/grc/src/gui/Constants.py index 804fff4c9..f5803cc17 100644 --- a/grc/src/gui/Constants.py +++ b/grc/src/gui/Constants.py @@ -17,10 +17,19 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA """ -##The name for new/unsaved flow graphs +import os + +##default path for the open/save dialogs +DEFAULT_FILE_PATH = os.getcwd() + +##file extensions +FLOW_GRAPH_FILE_EXTENSION = '.grc' +IMAGE_FILE_EXTENSION = '.png' + +##name for new/unsaved flow graphs NEW_FLOGRAPH_TITLE = 'untitled' -##Rotation constants +##rotation constants DIR_LEFT = 'left' DIR_RIGHT = 'right' diff --git a/grc/src/gui/FileDialogs.py b/grc/src/gui/FileDialogs.py index 320c1161c..2758e909b 100644 --- a/grc/src/gui/FileDialogs.py +++ b/grc/src/gui/FileDialogs.py @@ -21,10 +21,9 @@ import pygtk pygtk.require('2.0') import gtk from Dialogs import MessageDialogHelper -from Constants import NEW_FLOGRAPH_TITLE -from .. platforms.base.Constants import \ +from Constants import \ DEFAULT_FILE_PATH, FLOW_GRAPH_FILE_EXTENSION, \ - IMAGE_FILE_EXTENSION + IMAGE_FILE_EXTENSION, NEW_FLOGRAPH_TITLE from os import path OPEN_FLOW_GRAPH = 'open flow graph' diff --git a/grc/src/gui/MainWindow.py b/grc/src/gui/MainWindow.py index 16bbd8dba..647c4db1e 100644 --- a/grc/src/gui/MainWindow.py +++ b/grc/src/gui/MainWindow.py @@ -19,8 +19,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA from Constants import \ MIN_WINDOW_WIDTH, MIN_WINDOW_HEIGHT, \ - NEW_FLOGRAPH_TITLE, REPORTS_WINDOW_HEIGHT -from .. platforms.base.Constants import FLOW_GRAPH_FILE_EXTENSION + NEW_FLOGRAPH_TITLE, REPORTS_WINDOW_HEIGHT, \ + FLOW_GRAPH_FILE_EXTENSION from Actions import APPLICATION_QUIT, FLOW_GRAPH_KILL import pygtk pygtk.require('2.0') diff --git a/grc/src/gui/Preferences.py b/grc/src/gui/Preferences.py index 08b3da5cc..80c4232b8 100644 --- a/grc/src/gui/Preferences.py +++ b/grc/src/gui/Preferences.py @@ -17,7 +17,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA """ -from .. platforms.base.Constants import HOME_DIR, FLOW_GRAPH_DTD +from .. platforms.base.Constants import FLOW_GRAPH_DTD from .. utils import ParseXML import Messages import os @@ -38,7 +38,7 @@ class _Preferences(object): #get prefs block self._prefs_block = platform.get_prefs_block() #prefs file path - self._prefs_file_path = os.path.join(HOME_DIR, self._prefs_block.get_param('prefs_file').get_value()) + self._prefs_file_path = os.path.join(os.path.expanduser('~'), self._prefs_block.get_param('prefs_file').get_value()) #load try: ParseXML.validate_dtd(self._prefs_file_path, FLOW_GRAPH_DTD) |