commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] [gnuradio] 13/25: grc: Renamed reports window to conso


From: git
Subject: [Commit-gnuradio] [gnuradio] 13/25: grc: Renamed reports window to console.
Date: Fri, 27 May 2016 19:14:58 +0000 (UTC)

This is an automated email from the git hooks/post-receive script.

jcorgan pushed a commit to branch master
in repository gnuradio.

commit 4a739cb097d9e78593aae7d722a4834cd01cddd7
Author: Seth Hitefield <address@hidden>
Date:   Wed May 4 23:38:56 2016 -0400

    grc: Renamed reports window to console.
---
 grc/gui/ActionHandler.py | 38 ++++++++++++++----------------------
 grc/gui/Actions.py       | 24 +++++++++++------------
 grc/gui/Bars.py          |  6 +++---
 grc/gui/Constants.py     |  2 +-
 grc/gui/Dialogs.py       | 10 +++++-----
 grc/gui/FileDialogs.py   | 50 +++++++++++++++++++++++++++++++-----------------
 grc/gui/MainWindow.py    | 44 +++++++++++++++++++++---------------------
 grc/gui/Preferences.py   |  4 ++--
 8 files changed, 91 insertions(+), 87 deletions(-)

diff --git a/grc/gui/ActionHandler.py b/grc/gui/ActionHandler.py
index 13316af..4866a34 100644
--- a/grc/gui/ActionHandler.py
+++ b/grc/gui/ActionHandler.py
@@ -25,7 +25,7 @@ import subprocess
 
 from . import Dialogs, Preferences, Actions, Executor, Constants
 from .FileDialogs import (OpenFlowGraphFileDialog, SaveFlowGraphFileDialog,
-                          SaveReportsFileDialog, SaveScreenShotDialog,
+                          SaveConsoleFileDialog, SaveScreenShotDialog,
                           OpenQSSFileDialog)
 from .MainWindow import MainWindow
 from .ParserErrorsDialog import ParserErrorsDialog
@@ -63,7 +63,7 @@ class ActionHandler:
         self.get_page = self.main_window.get_page
         self.get_focus_flag = self.main_window.get_focus_flag
         #setup the messages
-        Messages.register_messenger(self.main_window.add_report_line)
+        Messages.register_messenger(self.main_window.add_console_line)
         Messages.send_init(platform)
         #initialize
         self.init_file_paths = file_paths
@@ -108,7 +108,6 @@ class ActionHandler:
         page = main.get_page()
         flow_graph = page.get_flow_graph() if page else None
 
-
         def flow_graph_update(fg=flow_graph):
             main.vars.update_gui()
             fg.update()
@@ -138,9 +137,9 @@ class ActionHandler:
                 Actions.FLOW_GRAPH_CLOSE, Actions.ABOUT_WINDOW_DISPLAY,
                 Actions.FLOW_GRAPH_SCREEN_CAPTURE, Actions.HELP_WINDOW_DISPLAY,
                 Actions.TYPES_WINDOW_DISPLAY, Actions.TOGGLE_BLOCKS_WINDOW,
-                Actions.TOGGLE_REPORTS_WINDOW, 
Actions.TOGGLE_HIDE_DISABLED_BLOCKS,
+                Actions.TOGGLE_CONSOLE_WINDOW, 
Actions.TOGGLE_HIDE_DISABLED_BLOCKS,
                 Actions.TOOLS_RUN_FDESIGN, Actions.TOGGLE_SCROLL_LOCK,
-                Actions.CLEAR_REPORTS, Actions.SAVE_REPORTS,
+                Actions.CLEAR_CONSOLE, Actions.SAVE_CONSOLE,
                 Actions.TOGGLE_AUTO_HIDE_PORT_LABELS, 
Actions.TOGGLE_SNAP_TO_GRID,
                 Actions.TOGGLE_SHOW_BLOCK_COMMENTS,
                 Actions.TOGGLE_SHOW_CODE_PREVIEW_TAB,
@@ -394,17 +393,11 @@ class ActionHandler:
             Dialogs.TypesDialog(flow_graph.get_parent())
         elif action == Actions.ERRORS_WINDOW_DISPLAY:
             Dialogs.ErrorsDialog(flow_graph)
-        elif action == Actions.TOGGLE_REPORTS_WINDOW:
-            if action.get_active():
-                main.update_panel_visibility(main.REPORTS, True)
-            else:
-                main.update_panel_visibility(main.REPORTS, False)
+        elif action == Actions.TOGGLE_CONSOLE_WINDOW:
+            main.update_panel_visibility(main.CONSOLE, action.get_active())
             action.save_to_preferences()
         elif action == Actions.TOGGLE_BLOCKS_WINDOW:
-            if action.get_active():
-                main.update_panel_visibility(main.BLOCKS, True)
-            else:
-                main.update_panel_visibility(main.BLOCKS, False)
+            main.update_panel_visibility(main.BLOCKS, action.get_active())
             action.save_to_preferences()
         elif action == Actions.TOGGLE_SCROLL_LOCK:
             active = action.get_active()
@@ -412,10 +405,10 @@ class ActionHandler:
             if active:
                 main.text_display.scroll_to_end()
             action.save_to_preferences()
-        elif action == Actions.CLEAR_REPORTS:
+        elif action == Actions.CLEAR_CONSOLE:
             main.text_display.clear()
-        elif action == Actions.SAVE_REPORTS:
-            file_path = SaveReportsFileDialog(page.get_file_path()).run()
+        elif action == Actions.SAVE_CONSOLE:
+            file_path = SaveConsoleFileDialog(page.get_file_path()).run()
             if file_path is not None:
                 main.text_display.save(file_path)
         elif action == Actions.TOGGLE_HIDE_DISABLED_BLOCKS:
@@ -445,15 +438,12 @@ class ActionHandler:
                 action.set_active(True)
                 action.set_sensitive(False)
             else:
-                if not action.get_sensitive():
-                    # This is occurring after variables are un-hidden
+                if action.get_sensitive():
+                    main.update_panel_visibility(main.VARIABLES, 
action.get_active())
+                else:  # This is occurring after variables are un-hidden
                     # Leave it enabled
                     action.set_sensitive(True)
                     action.set_active(True)
-                elif action.get_active():
-                    main.update_panel_visibility(main.VARIABLES, True)
-                else:
-                    main.update_panel_visibility(main.VARIABLES, False)
             
#Actions.TOGGLE_FLOW_GRAPH_VAR_EDITOR_SIDEBAR.set_sensitive(action.get_active())
             action.save_to_preferences()
         elif action == Actions.TOGGLE_FLOW_GRAPH_VAR_EDITOR_SIDEBAR:
@@ -711,7 +701,7 @@ class ActionHandler:
         Update the exec and stop buttons.
         Lock and unlock the mutex for race conditions with exec flow graph 
threads.
         """
-        sensitive =  self.main_window.get_flow_graph().is_valid() and not 
self.get_page().get_proc()
+        sensitive = self.main_window.get_flow_graph().is_valid() and not 
self.get_page().get_proc()
         Actions.FLOW_GRAPH_GEN.set_sensitive(sensitive)
         Actions.FLOW_GRAPH_EXEC.set_sensitive(sensitive)
         Actions.FLOW_GRAPH_KILL.set_sensitive(self.get_page().get_proc() is 
not None)
diff --git a/grc/gui/Actions.py b/grc/gui/Actions.py
index 1763ff6..9b2af36 100644
--- a/grc/gui/Actions.py
+++ b/grc/gui/Actions.py
@@ -402,11 +402,11 @@ ERRORS_WINDOW_DISPLAY = Action(
     tooltip='View flow graph errors',
     stock_id=gtk.STOCK_DIALOG_ERROR,
 )
-TOGGLE_REPORTS_WINDOW = ToggleAction(
-    label='Show _Reports Panel',
-    tooltip='Toggle visibility of the Report widget',
+TOGGLE_CONSOLE_WINDOW = ToggleAction(
+    label='Show _Console Panel',
+    tooltip='Toggle visibility of the console',
     keypresses=(gtk.keysyms.r, gtk.gdk.CONTROL_MASK),
-    preference_name='reports_window_visible'
+    preference_name='console_window_visible'
 )
 TOGGLE_BLOCKS_WINDOW = ToggleAction(
     label='Show _Block Tree Panel',
@@ -415,8 +415,8 @@ TOGGLE_BLOCKS_WINDOW = ToggleAction(
     preference_name='blocks_window_visible'
 )
 TOGGLE_SCROLL_LOCK = ToggleAction(
-    label='Reports Scroll _Lock',
-    tooltip='Toggle scroll lock for the report window',
+    label='Console Scroll _Lock',
+    tooltip='Toggle scroll lock for the console window',
     preference_name='scroll_lock'
 )
 ABOUT_WINDOW_DISPLAY = Action(
@@ -483,14 +483,14 @@ FIND_BLOCKS = Action(
     keypresses=(gtk.keysyms.f, gtk.gdk.CONTROL_MASK,
                 gtk.keysyms.slash, NO_MODS_MASK),
 )
-CLEAR_REPORTS = Action(
-    label='_Clear Reports',
-    tooltip='Clear Reports',
+CLEAR_CONSOLE = Action(
+    label='_Clear Console',
+    tooltip='Clear Console',
     stock_id=gtk.STOCK_CLEAR,
 )
-SAVE_REPORTS = Action(
-    label='_Save Reports',
-    tooltip='Save Reports',
+SAVE_CONSOLE = Action(
+    label='_Save Console',
+    tooltip='Save Console',
     stock_id=gtk.STOCK_SAVE,
 )
 OPEN_HIER = Action(
diff --git a/grc/gui/Bars.py b/grc/gui/Bars.py
index 5bbbdc0..a4819b9 100644
--- a/grc/gui/Bars.py
+++ b/grc/gui/Bars.py
@@ -98,10 +98,10 @@ MENU_BAR_LIST = (
     (gtk.Action('View', '_View', None, None), [
         Actions.TOGGLE_BLOCKS_WINDOW,
         None,
-        Actions.TOGGLE_REPORTS_WINDOW,
+        Actions.TOGGLE_CONSOLE_WINDOW,
         Actions.TOGGLE_SCROLL_LOCK,
-        Actions.SAVE_REPORTS,
-        Actions.CLEAR_REPORTS,
+        Actions.SAVE_CONSOLE,
+        Actions.CLEAR_CONSOLE,
         None,
         Actions.TOGGLE_HIDE_VARIABLES,
         Actions.TOGGLE_FLOW_GRAPH_VAR_EDITOR,
diff --git a/grc/gui/Constants.py b/grc/gui/Constants.py
index e267c6c..022564c 100644
--- a/grc/gui/Constants.py
+++ b/grc/gui/Constants.py
@@ -40,7 +40,7 @@ MIN_DIALOG_WIDTH = 500
 MIN_DIALOG_HEIGHT = 500
 # default sizes
 DEFAULT_BLOCKS_WINDOW_WIDTH = 100
-DEFAULT_REPORTS_WINDOW_WIDTH = 100
+DEFAULT_CONSOLE_WINDOW_WIDTH = 100
 
 DEFAULT_CANVAS_SIZE_DEFAULT = 1280, 1024
 
diff --git a/grc/gui/Dialogs.py b/grc/gui/Dialogs.py
index 6cfdd50..1d11435 100644
--- a/grc/gui/Dialogs.py
+++ b/grc/gui/Dialogs.py
@@ -92,21 +92,21 @@ class TextDisplay(SimpleTextDisplay):
         buffer.delete(buffer.get_start_iter(), buffer.get_end_iter())
 
     def save(self, file_path):
-        report_file = open(file_path, 'w')
+        console_file = open(file_path, 'w')
         buffer = self.get_buffer()
-        report_file.write(buffer.get_text(buffer.get_start_iter(), 
buffer.get_end_iter(), True))
-        report_file.close()
+        console_file.write(buffer.get_text(buffer.get_start_iter(), 
buffer.get_end_iter(), True))
+        console_file.close()
 
     # Callback functions to handle the scrolling lock and clear context menus 
options
     # Action functions are set by the ActionHandler's init function
     def clear_cb(self, menu_item, web_view):
-        Actions.CLEAR_REPORTS()
+        Actions.CLEAR_CONSOLE()
 
     def scroll_back_cb(self, menu_item, web_view):
         Actions.TOGGLE_SCROLL_LOCK()
 
     def save_cb(self, menu_item, web_view):
-        Actions.SAVE_REPORTS()
+        Actions.SAVE_CONSOLE()
 
     def populate_popup(self, view, menu):
         """Create a popup menu for the scroll lock and clear functions"""
diff --git a/grc/gui/FileDialogs.py b/grc/gui/FileDialogs.py
index 4b5770a..e9430b1 100644
--- a/grc/gui/FileDialogs.py
+++ b/grc/gui/FileDialogs.py
@@ -33,7 +33,7 @@ import Utils
 ##################################################
 OPEN_FLOW_GRAPH = 'open flow graph'
 SAVE_FLOW_GRAPH = 'save flow graph'
-SAVE_REPORTS = 'save reports'
+SAVE_CONSOLE = 'save console'
 SAVE_IMAGE = 'save image'
 OPEN_QSS_THEME = 'open qss theme'
 
@@ -43,46 +43,45 @@ File <b>$encode($filename)</b> Exists!\nWould you like to 
overwrite the existing
 FILE_DNE_MARKUP_TMPL="""\
 File <b>$encode($filename)</b> Does not Exist!"""
 
-##################################################
+
+
 # File Filters
-##################################################
-##the filter for flow graph files
 def get_flow_graph_files_filter():
     filter = gtk.FileFilter()
     filter.set_name('Flow Graph Files')
     filter.add_pattern('*'+Preferences.file_extension())
     return filter
 
+
 def get_text_files_filter():
     filter = gtk.FileFilter()
     filter.set_name('Text Files')
     filter.add_pattern('*'+TEXT_FILE_EXTENSION)
     return filter
 
-##the filter for image files
+
 def get_image_files_filter():
     filter = gtk.FileFilter()
     filter.set_name('Image Files')
     filter.add_pattern('*'+IMAGE_FILE_EXTENSION)
     return filter
 
-##the filter for all files
+
 def get_all_files_filter():
     filter = gtk.FileFilter()
     filter.set_name('All Files')
     filter.add_pattern('*')
     return filter
 
-##the filter for qss files
+
 def get_qss_themes_filter():
     filter = gtk.FileFilter()
     filter.set_name('QSS Themes')
     filter.add_pattern('*.qss')
     return filter
 
-##################################################
+
 # File Dialogs
-##################################################
 class FileDialogHelper(gtk.FileChooserDialog):
     """
     A wrapper class for the gtk file chooser dialog.
@@ -105,6 +104,7 @@ class FileDialogHelper(gtk.FileChooserDialog):
         self.set_local_only(True)
         self.add_filter(get_all_files_filter())
 
+
 class FileDialog(FileDialogHelper):
     """A dialog box to save or open flow graph files. This is a base class, do 
not use."""
 
@@ -124,8 +124,8 @@ class FileDialog(FileDialogHelper):
             FileDialogHelper.__init__(self, gtk.FILE_CHOOSER_ACTION_SAVE, 
'Save a Flow Graph to a File...')
             self.add_and_set_filter(get_flow_graph_files_filter())
             self.set_current_name(path.basename(current_file_path))
-        elif self.type == SAVE_REPORTS:
-            FileDialogHelper.__init__(self, gtk.FILE_CHOOSER_ACTION_SAVE, 
'Save Reports to a File...')
+        elif self.type == SAVE_CONSOLE:
+            FileDialogHelper.__init__(self, gtk.FILE_CHOOSER_ACTION_SAVE, 
'Save Console to a File...')
             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
@@ -164,11 +164,11 @@ class FileDialog(FileDialogHelper):
         #############################################
         # Handle Save Dialogs
         #############################################
-        if self.type in (SAVE_FLOW_GRAPH, SAVE_REPORTS, SAVE_IMAGE):
+        if self.type in (SAVE_FLOW_GRAPH, SAVE_CONSOLE, SAVE_IMAGE):
             filename = self.get_filename()
             extension = {
                 SAVE_FLOW_GRAPH: Preferences.file_extension(),
-                SAVE_REPORTS: TEXT_FILE_EXTENSION,
+                SAVE_CONSOLE: TEXT_FILE_EXTENSION,
                 SAVE_IMAGE: IMAGE_FILE_EXTENSION,
             }[self.type]
             #append the missing file extension if the filter matches
@@ -205,11 +205,25 @@ class FileDialog(FileDialogHelper):
         self.destroy()
         return filename
 
-class OpenFlowGraphFileDialog(FileDialog): type = OPEN_FLOW_GRAPH
-class SaveFlowGraphFileDialog(FileDialog): type = SAVE_FLOW_GRAPH
-class OpenQSSFileDialog(FileDialog): type = OPEN_QSS_THEME
-class SaveReportsFileDialog(FileDialog): type = SAVE_REPORTS
-class SaveImageFileDialog(FileDialog): type = SAVE_IMAGE
+
+class OpenFlowGraphFileDialog(FileDialog):
+    type = OPEN_FLOW_GRAPH
+
+
+class SaveFlowGraphFileDialog(FileDialog):
+    type = SAVE_FLOW_GRAPH
+
+
+class OpenQSSFileDialog(FileDialog):
+    type = OPEN_QSS_THEME
+
+
+class SaveConsoleFileDialog(FileDialog):
+    type = SAVE_CONSOLE
+
+
+class SaveImageFileDialog(FileDialog):
+    type = SAVE_IMAGE
 
 
 class SaveScreenShotDialog(SaveImageFileDialog):
diff --git a/grc/gui/MainWindow.py b/grc/gui/MainWindow.py
index 0b6bb74..1437391 100644
--- a/grc/gui/MainWindow.py
+++ b/grc/gui/MainWindow.py
@@ -25,7 +25,7 @@ from . import Bars, Actions, Preferences, Utils
 from .BlockTreeWindow import BlockTreeWindow
 from .VariableEditor import VariableEditor
 from .Constants import \
-    NEW_FLOGRAPH_TITLE, DEFAULT_REPORTS_WINDOW_WIDTH
+    NEW_FLOGRAPH_TITLE, DEFAULT_CONSOLE_WINDOW_WIDTH
 from .Dialogs import TextDisplay, MessageDialogHelper
 from .NotebookPage import NotebookPage
 
@@ -67,13 +67,13 @@ class MainWindow(gtk.Window):
 
     # Constants the action handler can use to indicate which panel visibility 
to change.
     BLOCKS = 0
-    REPORTS = 1
+    CONSOLE = 1
     VARIABLES = 2
 
     def __init__(self, platform, action_handler_callback):
         """
-        MainWindow contructor
-        Setup the menu, toolbar, flowgraph editor notebook, block selection 
window...
+        MainWindow constructor
+        Setup the menu, toolbar, flow graph editor notebook, block selection 
window...
         """
         self._platform = platform
 
@@ -107,15 +107,15 @@ class MainWindow(gtk.Window):
         self.page_to_be_closed = None
         self.current_page = None
         self.notebook.set_show_border(False)
-        self.notebook.set_scrollable(True) #scroll arrows for page tabs
+        self.notebook.set_scrollable(True)  # scroll arrows for page tabs
         self.notebook.connect('switch-page', self._handle_page_change)
 
         # Create the console window
         self.text_display = TextDisplay()
-        self.reports_scrolled_window = gtk.ScrolledWindow()
-        self.reports_scrolled_window.set_policy(gtk.POLICY_AUTOMATIC, 
gtk.POLICY_AUTOMATIC)
-        self.reports_scrolled_window.add(self.text_display)
-        self.reports_scrolled_window.set_size_request(-1, 
DEFAULT_REPORTS_WINDOW_WIDTH)
+        self.console_window = gtk.ScrolledWindow()
+        self.console_window.set_policy(gtk.POLICY_AUTOMATIC, 
gtk.POLICY_AUTOMATIC)
+        self.console_window.add(self.text_display)
+        self.console_window.set_size_request(-1, DEFAULT_CONSOLE_WINDOW_WIDTH)
 
         # Create the block tree and variable panels
         self.btwin = BlockTreeWindow(platform, self.get_flow_graph)
@@ -129,13 +129,13 @@ class MainWindow(gtk.Window):
         self.variable_panel_sidebar = Preferences.variable_editor_sidebar()
         if self.variable_panel_sidebar:
             self.left.pack1(self.notebook)
-            self.left.pack2(self.reports_scrolled_window, False)
+            self.left.pack2(self.console_window, False)
             self.right.pack1(self.btwin)
             self.right.pack2(self.vars, False)
         else:
-            # Put the variable editor in a panel with the reports
+            # Put the variable editor in a panel with the console
             self.left.pack1(self.notebook)
-            self.left_subpanel.pack1(self.reports_scrolled_window, 
shrink=False)
+            self.left_subpanel.pack1(self.console_window, shrink=False)
             self.left_subpanel.pack2(self.vars, resize=False, shrink=True)
             self.left.pack2(self.left_subpanel, False)
 
@@ -145,17 +145,17 @@ class MainWindow(gtk.Window):
         self.container.pack1(self.left)
         self.container.pack2(self.right, False)
 
-        #load preferences and show the main window
+        # load preferences and show the main window
         self.resize(*Preferences.main_window_size())
         self.container.set_position(Preferences.blocks_window_position())
-        self.left.set_position(Preferences.reports_window_position())
+        self.left.set_position(Preferences.console_window_position())
         if self.variable_panel_sidebar:
             
self.right.set_position(Preferences.variable_editor_position(sidebar=True))
         else:
             
self.left_subpanel.set_position(Preferences.variable_editor_position())
 
         self.show_all()
-        self.reports_scrolled_window.hide()
+        self.console_window.hide()
         self.vars.hide()
         self.btwin.hide()
 
@@ -198,8 +198,8 @@ class MainWindow(gtk.Window):
 
         if panel == self.BLOCKS:
             self.btwin.set_visible(visibility)
-        elif panel == self.REPORTS:
-            self.reports_scrolled_window.set_visible(visibility)
+        elif panel == self.CONSOLE:
+            self.console_window.set_visible(visibility)
         elif panel == self.VARIABLES:
             self.vars.set_visible(visibility)
         else:
@@ -216,16 +216,16 @@ class MainWindow(gtk.Window):
                 self.right.hide()
             else:
                 self.right.show()
-            if not self.vars.get_visible() and not 
self.reports_scrolled_window.get_visible():
+            if not self.vars.get_visible() and not 
self.console_window.get_visible():
                 self.left_subpanel.hide()
             else:
                 self.left_subpanel.show()
 
     ############################################################
-    # Report Window
+    # Console Window
     ############################################################
 
-    def add_report_line(self, line):
+    def add_console_line(self, line):
         """
         Place line at the end of the text buffer, then scroll its window all 
the way down.
 
@@ -297,7 +297,7 @@ class MainWindow(gtk.Window):
         Preferences.set_open_files(open_files)
         Preferences.file_open(open_file)
         Preferences.main_window_size(self.get_size())
-        Preferences.reports_window_position(self.left.get_position())
+        Preferences.console_window_position(self.left.get_position())
         Preferences.blocks_window_position(self.container.get_position())
         if self.variable_panel_sidebar:
             Preferences.variable_editor_position(self.right.get_position(), 
sidebar=True)
@@ -346,7 +346,7 @@ class MainWindow(gtk.Window):
         """
         Set the title of the main window.
         Set the titles on the page tabs.
-        Show/hide the reports window.
+        Show/hide the console window.
 
         Args:
             title: the window title
diff --git a/grc/gui/Preferences.py b/grc/gui/Preferences.py
index f74550c..5fbdfe9 100644
--- a/grc/gui/Preferences.py
+++ b/grc/gui/Preferences.py
@@ -140,8 +140,8 @@ def add_recent_file(file_name):
         set_recent_files(recent_files[:10])  # Keep up to 10 files
 
 
-def reports_window_position(pos=None):
-    return entry('reports_window_position', pos, default=-1) or 1
+def console_window_position(pos=None):
+    return entry('console_window_position', pos, default=-1) or 1
 
 
 def blocks_window_position(pos=None):



reply via email to

[Prev in Thread] Current Thread [Next in Thread]