[gedit] Added save document before execution, no output and made UI more similar with snippets



commit ea9a7dcfa72b293c6610a352105b2f728e33d959
Author: Jesse van den Kieboom <jesse icecrew nl>
Date:   Thu May 21 22:21:37 2009 +0200

    Added save document before execution, no output and made UI more similar with snippets
    
    The manager of snippets and external tools are now more or less similar looking. Saving
    the active document, or all documents is now implemented. Additionally, it is now possible to
    disable showing tool output (unless there is an error)
---
 plugins/externaltools/tools/__init__.py    |   17 ++-
 plugins/externaltools/tools/functions.py   |   91 +++++++--
 plugins/externaltools/tools/library.py     |   11 +-
 plugins/externaltools/tools/manager.py     |  110 ++++++-----
 plugins/externaltools/tools/outputpanel.py |    4 +
 plugins/externaltools/tools/tools.ui       |  296 +++++++++++++++-------------
 6 files changed, 319 insertions(+), 210 deletions(-)

diff --git a/plugins/externaltools/tools/__init__.py b/plugins/externaltools/tools/__init__.py
index ea1ab07..f8f7cac 100644
--- a/plugins/externaltools/tools/__init__.py
+++ b/plugins/externaltools/tools/__init__.py
@@ -186,6 +186,8 @@ class ExternalToolsPlugin(gedit.Plugin):
     def __init__(self):
         super(ExternalToolsPlugin, self).__init__()
         
+        self._manager = None
+
         ToolLibrary().set_locations(self.get_data_dir())
 
     def activate(self, window):
@@ -203,13 +205,20 @@ class ExternalToolsPlugin(gedit.Plugin):
         return self.open_dialog()
 
     def open_dialog(self):
-        m = Manager(self.get_data_dir())
+        if not self._manager:
+            self._manager = Manager(self.get_data_dir())
+            self._manager.dialog.connect('destroy', self.on_manager_destroy)
 
-        m.run()
+        self._manager.run()
+        
         window = gedit.app_get_default().get_active_window()
+
         if window:
-            m.dialog.set_transient_for(window)
+            self._manager.dialog.set_transient_for(window)
+
+        return self._manager.dialog
 
-        return m.dialog
+    def on_manager_destroy(self, dialog):
+        self._manager = None
 
 # ex:ts=4:et:
diff --git a/plugins/externaltools/tools/functions.py b/plugins/externaltools/tools/functions.py
index f0b5893..bafcf59 100644
--- a/plugins/externaltools/tools/functions.py
+++ b/plugins/externaltools/tools/functions.py
@@ -32,13 +32,7 @@ def default(val, d):
         return d
 
 # ==== Capture related functions ====
-def capture_menu_action(action, window, node):
-
-    # Get the panel
-    panel = window.get_data("ExternalToolsPluginWindowData")._output_buffer
-    panel.show()
-    panel.clear()
-
+def run_external_tool(window, node):
     # Configure capture environment
     try:
         cwd = os.getcwd()
@@ -79,13 +73,20 @@ def capture_menu_action(action, window, node):
 
     capture.set_flags(capture.CAPTURE_BOTH)
 
-    # Assign the error output to the output panel
-    panel.process = capture
-
     # Get input text
     input_type = node.input
     output_type = node.output
 
+    # Get the panel
+    panel = window.get_data("ExternalToolsPluginWindowData")._output_buffer
+    panel.clear()
+
+    if output_type == 'output-panel':
+        panel.show()
+
+    # Assign the error output to the output panel
+    panel.process = capture
+
     if input_type != 'nothing' and view is not None:
         if input_type == 'document':
             start, end = document.get_bounds()
@@ -128,7 +129,7 @@ def capture_menu_action(action, window, node):
         document.begin_user_action()
         view.set_editable(False)
         view.set_cursor_visible(False)
-    elif output_type != 'output-panel' and view is not None:
+    elif output_type != 'output-panel' and output_type != 'nothing' and view is not None:
         document.begin_user_action()
         view.set_editable(False)
         view.set_cursor_visible(False)
@@ -144,33 +145,81 @@ def capture_menu_action(action, window, node):
         else:
             pos = document.get_end_iter()
         capture.connect('stdout-line', capture_stdout_line_document, document, pos)
-    else:
+    elif output_type != 'nothing':
         capture.connect('stdout-line', capture_stdout_line_panel, panel)
         document.begin_user_action()
 
-    capture.connect('stderr-line',   capture_stderr_line_panel,   panel)
-    capture.connect('begin-execute', capture_begin_execute_panel, panel, node.name)
-    capture.connect('end-execute',   capture_end_execute_panel,   panel, view,
-                    output_type in ('new-document','replace-document'))
+    capture.connect('stderr-line', capture_stderr_line_panel, panel)
+    capture.connect('begin-execute', capture_begin_execute_panel, panel, view, node.name)    
+    capture.connect('end-execute', capture_end_execute_panel, panel, view, output_type)
 
     # Run the command
-    view.get_window(gtk.TEXT_WINDOW_TEXT).set_cursor(gdk.Cursor(gdk.WATCH))
     capture.execute()
-    document.end_user_action()
+    
+    if output_type != 'nothing':
+        document.end_user_action()
+
+class MultipleDocumentsSaver:
+    def __init__(self, window, docs, node):
+        self._window = window
+        self._node = node
+        self._error = False
+
+        self._counter = len(docs)
+        self._signal_ids = {}
+        self._counter = 0
+
+        signals = {}
+
+        for doc in docs:
+            signals[doc] = doc.connect('saving', self.on_document_saving)
+            gedit.commands.save_document(window, doc)
+            doc.disconnect(signals[doc])
+    
+    def on_document_saving(self, doc, size, total_size):
+        self._counter += 1
+        self._signal_ids[doc] = doc.connect('saved', self.on_document_saved)
+
+    def on_document_saved(self, doc, error):
+        if error:
+            self._error = True
+        
+        doc.disconnect(self._signal_ids[doc])
+        del self._signal_ids[doc]
+        
+        self._counter -= 1
+        
+        if self._counter == 0 and not self._error:
+            run_external_tool(self._window, self._node)
+
+def capture_menu_action(action, window, node):
+    if node.save_files == 'document' and window.get_active_document():
+        MultipleDocumentsSaver(window, [window.get_active_document()], node)
+        return
+    elif node.save_files == 'all':
+        MultipleDocumentsSaver(window, window.get_documents(), node)
+        return
+
+    run_external_tool(window, node)
 
 def capture_stderr_line_panel(capture, line, panel):
+    if not panel.visible():
+        panel.show()
+
     panel.write(line, panel.error_tag)
 
-def capture_begin_execute_panel(capture, panel, label):
+def capture_begin_execute_panel(capture, panel, view, label):
+    view.get_window(gtk.TEXT_WINDOW_TEXT).set_cursor(gdk.Cursor(gdk.WATCH))
+
     panel['stop'].set_sensitive(True)
     panel.clear()
     panel.write(_("Running tool:"), panel.italic_tag);
     panel.write(" %s\n\n" % label, panel.bold_tag);
 
-def capture_end_execute_panel(capture, exit_code, panel, view, update_type):
+def capture_end_execute_panel(capture, exit_code, panel, view, output_type):
     panel['stop'].set_sensitive(False)
 
-    if update_type:
+    if output_type in ('new-document','replace-document'):
         doc = view.get_buffer()
         start = doc.get_start_iter()
         end = start.copy()
diff --git a/plugins/externaltools/tools/library.py b/plugins/externaltools/tools/library.py
index 5026547..2cd34af 100644
--- a/plugins/externaltools/tools/library.py
+++ b/plugins/externaltools/tools/library.py
@@ -95,7 +95,8 @@ class ToolLibrary(Singleton):
             tool.shortcut = xtool.get('accelerator')
             tool.applicability = xtool.get('applicability')
             tool.output = xtool.get('output')
-            tool.input = xtool.get('input')                    
+            tool.input = xtool.get('input')
+
             tool.save_with_script(xtool.text)
 
     def get_full_path(self, path, mode='r', system = True, local = True):
@@ -313,6 +314,14 @@ class Tool(object):
         self._set_property_if_changed('Output', value)
     output = property(get_output, set_output)
 
+    def get_save_files(self):
+        save_files = self._properties.get('Save-files')
+        if save_files: return save_files
+        return 'nothing'
+    def set_save_files(self, value):
+        self._set_property_if_changed('Save-files', value)
+    save_files = property(get_save_files, set_save_files)
+
     # There is no property for this one because this function is quite
     # expensive to perform
     def get_script(self):
diff --git a/plugins/externaltools/tools/manager.py b/plugins/externaltools/tools/manager.py
index 82856cf..a5752ec 100644
--- a/plugins/externaltools/tools/manager.py
+++ b/plugins/externaltools/tools/manager.py
@@ -25,29 +25,19 @@ import os.path
 from library import *
 from functions import *
 import hashlib
+from xml.sax import saxutils
 
-class Singleton(object):
-    _instance = None
-
-    def __new__(cls, *args, **kwargs):
-        if not cls._instance:
-            cls._instance = super(Singleton, cls).__new__(
-                             cls, *args, **kwargs)
-            cls._instance.__init_once__()
-
-        return cls._instance
-
-class Manager(Singleton):
+class Manager:
     LABEL_COLUMN = 0 # For Combo and Tree
-    NODE_COLUMN  = 1 # For Tree only
+    NODE_COLUMN = 1 # For Tree only
     NAME_COLUMN = 1  # For Combo only
 
     def __init__(self, datadir):
         self.datadir = datadir
-
-    def __init_once__(self):
         self.default_size = None
         self.dialog = None
+        
+        self.build()
     
     def build(self):
         callbacks = {
@@ -70,10 +60,14 @@ class Manager(Singleton):
             self.dialog.set_default_size(*self.default_size)
         
         self.view = self.ui.get_object('view')
-        for name in ['input', 'output', 'applicability']:
+        
+        for name in ['input', 'output', 'applicability', 'save-files']:
             self.__init_combobox(name)
+
         self.__init_tools_model()
         self.__init_tools_view()
+        
+        self.do_update()
     
     def run(self):
         if self.dialog == None:
@@ -101,11 +95,14 @@ class Manager(Singleton):
         column = gtk.TreeViewColumn('Tools')
         renderer = gtk.CellRendererText()
         column.pack_start(renderer, False)
-        column.set_attributes(renderer, text = self.LABEL_COLUMN)
         renderer.set_property('editable', True)
         self.view.append_column(column)
+        
+        column.set_cell_data_func(renderer, self.get_cell_data_cb)
 
         renderer.connect('edited', self.on_view_label_cell_edited)
+        renderer.connect('editing-started', self.on_view_label_cell_editing_started)
+        
         self.selection_changed_id = self.view.get_selection().connect('changed', self.on_view_selection_changed, None)
 
     def __init_combobox(self, name):
@@ -152,7 +149,7 @@ class Manager(Singleton):
         self.current_node.input = combo_value(self, 'input')
         self.current_node.output = combo_value(self, 'output')
         self.current_node.applicability = combo_value(self, 'applicability')
-        self.current_node.comment = self['description'].get_text()
+        self.current_node.save_files = combo_value(self, 'save-files')
 
         buf = self['commands'].get_buffer()
         script  = buf.get_text(*buf.get_bounds())
@@ -165,18 +162,14 @@ class Manager(Singleton):
             self.current_node.save()
 
     def clear_fields(self):
-        self['description'].set_text('')
         self['accelerator'].set_text('')
         self['commands'].get_buffer().set_text('')
 
-        for nm in ('input', 'output', 'applicability'):
+        for nm in ('input', 'output', 'applicability', 'save-files'):
             self[nm].set_active(0)
-
-        self['title'].set_label(_('Edit tool <i>%s</i>:') % '') # a bit ugly, but we're string frozen
     
     def fill_fields(self):
         node = self.current_node
-        self['description'].set_text(default(node.comment, _('A Brand New Tool')))
         self['accelerator'].set_text(default(node.shortcut, ''))
 
         buf = self['commands'].get_buffer()
@@ -193,15 +186,36 @@ class Manager(Singleton):
         else:
             buf.set_highlight_syntax(False)
 
-        for nm in ('input', 'output', 'applicability'):
+        for nm in ('input', 'output', 'applicability', 'save-files'):
             model = self[nm].get_model()
             piter = model.get_iter_first()
             
             self.set_active_by_name(nm,
-                                    default(node.__getattribute__(nm),
+                                    default(node.__getattribute__(nm.replace('-', '_')),
                                     model.get_value(piter, self.NAME_COLUMN)))
 
-        self['title'].set_label(_('Edit tool <i>%s</i>:') % node.name)
+    def do_update(self):
+        piter, node = self.get_selected_tool()
+
+        removable = piter is not None and node is not None and node.is_local()
+
+        self['remove-tool-button'].set_sensitive(removable)
+        self['revert-tool-button'].set_sensitive(removable)
+
+        if node is not None and node.is_global():
+            self['remove-tool-button'].hide()
+            self['revert-tool-button'].show()
+        else:
+            self['remove-tool-button'].show()
+            self['revert-tool-button'].hide()
+
+        if node is not None:
+            self.current_node = node
+            self.fill_fields()
+            self['tool-table'].set_sensitive(True)
+        else:
+            self.clear_fields()
+            self['tool-table'].set_sensitive(False)       
 
     def on_new_tool_button_clicked(self, button):
         self.save_current_tool()
@@ -249,30 +263,19 @@ class Manager(Singleton):
             node = self.model.get_value(piter, self.NODE_COLUMN)
             node.name = new_text
             self.model.set(piter, self.LABEL_COLUMN, new_text)
-            self['title'].set_label(_('Edit tool <i>%s</i>:') % new_text)
+            self.save_current_tool()
 
+    def on_view_label_cell_editing_started(self, renderer, editable, path):
+            piter = self.model.get_iter(path)
+            label = self.model.get_value(piter, self.LABEL_COLUMN)
+
+            if isinstance(editable, gtk.Entry):
+                editable.set_text(label)
+                editable.grab_focus()
+    
     def on_view_selection_changed(self, selection, userdata):
-        print 'saving current tool'
         self.save_current_tool()
-        piter, node = self.get_selected_tool()
-
-        removable = piter is not None and node is not None and node.is_local()
-        self['remove-tool-button'].set_sensitive(removable)
-        self['revert-tool-button'].set_sensitive(removable)
-        if node is not None and node.is_global():
-            self['remove-tool-button'].hide()
-            self['revert-tool-button'].show()
-        else:
-            self['remove-tool-button'].show()
-            self['revert-tool-button'].hide()
-
-        if node is not None:
-            self.current_node = node
-            self.fill_fields()
-            self['tool-table'].set_sensitive(True)
-        else:
-            self.clear_fields()
-            self['tool-table'].set_sensitive(False)
+        self.do_update()
 
     def set_accelerator(self, keyval, mod):
         # Check whether accelerator already exists
@@ -357,5 +360,18 @@ class Manager(Singleton):
         for window in gedit.app_get_default().get_windows():
             helper = window.get_data("ExternalToolsPluginWindowData")
             helper.menu.update()
+   
+    def get_cell_data_cb(self, column, cell, model, iter):
+        lbl = model.get_value(iter, self.LABEL_COLUMN)
+        node = model.get_value(iter, self.NODE_COLUMN)
+
+        escaped = saxutils.escape(lbl)
+
+        if node.shortcut:
+            markup = '%s (<b>%s</b>)' % (escaped, saxutils.escape(node.shortcut))
+        else:
+            markup = escaped
+            
+        cell.set_property('markup', markup)
 
 # ex:et:ts=4:
diff --git a/plugins/externaltools/tools/outputpanel.py b/plugins/externaltools/tools/outputpanel.py
index 07d3620..c085b5f 100644
--- a/plugins/externaltools/tools/outputpanel.py
+++ b/plugins/externaltools/tools/outputpanel.py
@@ -84,6 +84,10 @@ class OutputPanel(UniqueById):
 
     def clear(self):
         self['view'].get_buffer().set_text("")
+    
+    def visible(self):
+        panel = self.window.get_bottom_panel()
+        return panel.props.visible and panel.item_is_active(self.panel)
 
     def write(self, text, tag = None):
         buffer = self['view'].get_buffer()
diff --git a/plugins/externaltools/tools/tools.ui b/plugins/externaltools/tools/tools.ui
index b1c8fdd..c107c53 100644
--- a/plugins/externaltools/tools/tools.ui
+++ b/plugins/externaltools/tools/tools.ui
@@ -1,30 +1,34 @@
 <?xml version="1.0"?>
-<!-- Generated with glade3
-	Version: 2.91.3
-	Date: Sat Nov 18 13:58:59 2006
-	User: sf
-	Host: antea
--->
 <interface>
+  <requires lib="gtk+" version="2.16"/>
+  <!-- interface-naming-policy toplevel-contextual -->
   <object class="GtkListStore" id="model_save_files">
     <columns>
+      <!-- column-name gchararray -->
+      <column type="gchararray"/>
+      <!-- column-name gchararray -->
       <column type="gchararray"/>
     </columns>
     <data>
       <row>
         <col id="0" translatable="yes">Nothing</col>
+        <col id="1">nothing</col>
       </row>
       <row>
         <col id="0" translatable="yes">Current document</col>
+        <col id="1">document</col>
       </row>
       <row>
         <col id="0" translatable="yes">All documents</col>
+        <col id="1">all</col>
       </row>
     </data>
   </object>
   <object class="GtkListStore" id="model_input">
     <columns>
+      <!-- column-name gchararray -->
       <column type="gchararray"/>
+      <!-- column-name gchararray1 -->
       <column type="gchararray"/>
     </columns>
     <data>
@@ -52,10 +56,16 @@
   </object>
   <object class="GtkListStore" id="model_output">
     <columns>
+      <!-- column-name gchararray -->
       <column type="gchararray"/>
+      <!-- column-name gchararray1 -->
       <column type="gchararray"/>
     </columns>
     <data>
+	  <row>
+        <col id="0" translatable="yes">Nothing</col>
+        <col id="1">nothing</col>
+      </row>
       <row>
         <col id="0" translatable="yes">Display in bottom pane</col>
         <col id="1">output-panel</col>
@@ -84,7 +94,9 @@
   </object>
   <object class="GtkListStore" id="model_applicability">
     <columns>
+      <!-- column-name gchararray -->
       <column type="gchararray"/>
+      <!-- column-name gchararray1 -->
       <column type="gchararray"/>
     </columns>
     <data>
@@ -110,16 +122,18 @@
       </row>
     </data>
   </object>
-  <object class="GtkSourceBuffer" id="commands_buffer"/>
+  <object class="GeditDocument" id="commands_buffer">
+  	<property name="highlight-matching-brackets">True</property>
+  </object>
   <object class="GtkDialog" id="tool-manager-dialog">
     <property name="title" translatable="yes">External Tools Manager</property>
     <property name="default_width">750</property>
     <property name="default_height">500</property>
-    <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+    <property name="type_hint">dialog</property>
     <property name="skip_taskbar_hint">True</property>
     <property name="has_separator">False</property>
-    <signal handler="on_tool_manager_dialog_focus_out" name="focus_out_event"/>
-    <signal handler="on_tool_manager_dialog_response" name="response"/>
+    <signal name="focus_out_event" handler="on_tool_manager_dialog_focus_out"/>
+    <signal name="response" handler="on_tool_manager_dialog_response"/>
     <child internal-child="vbox">
       <object class="GtkVBox" id="tool-manager-dialog-vbox">
         <property name="visible">True</property>
@@ -128,7 +142,7 @@
             <property name="visible">True</property>
             <property name="can_focus">True</property>
             <property name="border_width">6</property>
-            <property name="position">1</property>
+            <property name="position">275</property>
             <child>
               <object class="GtkVBox" id="vbox2">
                 <property name="visible">True</property>
@@ -136,7 +150,7 @@
                 <child>
                   <object class="GtkLabel" id="label20">
                     <property name="visible">True</property>
-                    <property name="xalign">0.000000</property>
+                    <property name="xalign">0</property>
                     <property name="label" translatable="yes">_Tools:</property>
                     <property name="use_underline">True</property>
                     <property name="mnemonic_widget">view</property>
@@ -144,14 +158,16 @@
                   <packing>
                     <property name="expand">False</property>
                     <property name="fill">False</property>
+                    <property name="position">0</property>
                   </packing>
                 </child>
                 <child>
                   <object class="GtkScrolledWindow" id="scrolled_window1">
                     <property name="visible">True</property>
-                    <property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
-                    <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
-                    <property name="shadow_type">GTK_SHADOW_IN</property>
+                    <property name="can_focus">False</property>
+                    <property name="hscrollbar_policy">automatic</property>
+                    <property name="vscrollbar_policy">automatic</property>
+                    <property name="shadow_type">in</property>
                     <child>
                       <object class="GtkTreeView" id="view">
                         <property name="visible">True</property>
@@ -168,37 +184,68 @@
                 <child>
                   <object class="GtkHBox" id="hbox2">
                     <property name="visible">True</property>
-                    <property name="spacing">8</property>
-                    <property name="homogeneous">True</property>
+                    <property name="spacing">6</property>
                     <child>
                       <object class="GtkButton" id="new-tool-button">
                         <property name="visible">True</property>
+                        <property name="can_focus">False</property>
                         <property name="can_default">True</property>
-                        <property name="label">gtk-new</property>
-                        <property name="use_stock">True</property>
-                        <signal handler="on_new_tool_button_clicked" name="clicked"/>
+                        <property name="receives_default">False</property>
+                        <signal name="clicked" handler="on_new_tool_button_clicked"/>
+                        <child>
+                          <object class="GtkImage" id="new-tool-image">
+                            <property name="visible">True</property>
+                            <property name="stock">gtk-new</property>
+                            <property name="icon-size">4</property>
+                          </object>
+                        </child>
                       </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                        <property name="position">0</property>
+                      </packing>
                     </child>
                     <child>
-                      <object class="GtkButton" id="remove-tool-button">
-                        <property name="visible">True</property>
-                        <property name="can_default">True</property>
-                        <property name="label">gtk-remove</property>
-                        <property name="use_stock">True</property>
-                        <signal handler="on_remove_tool_button_clicked" name="clicked"/>
+                      <object class="GtkButton" id="revert-tool-button">
+                        <property name="can_focus">False</property>
+                        <property name="receives_default">False</property>
+                        <signal name="clicked" handler="on_remove_tool_button_clicked"/>
+                        <child>
+                          <object class="GtkImage" id="revert-tool-image">
+                            <property name="visible">True</property>
+                            <property name="stock">gtk-revert-to-saved</property>
+                            <property name="icon-size">4</property>
+                          </object>
+                        </child>
                       </object>
                       <packing>
-                        <property name="position">1</property>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                        <property name="pack_type">end</property>
+                        <property name="position">2</property>
                       </packing>
                     </child>
                     <child>
-                      <object class="GtkButton" id="revert-tool-button">
-                        <property name="label">gtk-revert-to-saved</property>
-                        <property name="use_stock">True</property>
-                        <signal handler="on_remove_tool_button_clicked" name="clicked"/>
+                      <object class="GtkButton" id="remove-tool-button">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="can_default">True</property>
+                        <property name="receives_default">False</property>
+                        <signal name="clicked" handler="on_remove_tool_button_clicked"/>
+                        <child>
+                          <object class="GtkImage" id="remove-tool-image">
+                            <property name="visible">True</property>
+                            <property name="stock">gtk-delete</property>
+                            <property name="icon-size">4</property>
+                          </object>
+                        </child>
                       </object>
                       <packing>
-                        <property name="position">2</property>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                        <property name="pack_type">end</property>
+                        <property name="position">1</property>
                       </packing>
                     </child>
                   </object>
@@ -210,6 +257,7 @@
                 </child>
               </object>
               <packing>
+                <property name="resize">False</property>
                 <property name="shrink">False</property>
               </packing>
             </child>
@@ -220,14 +268,16 @@
                 <child>
                   <object class="GtkLabel" id="title">
                     <property name="visible">True</property>
-                    <property name="xalign">0.000000</property>
-                    <property name="label" translatable="yes">Edit tool &lt;i&gt;make&lt;/i&gt;:</property>
-                    <property name="use_markup">True</property>
-                    <property name="mnemonic_widget">view</property>
+                    <property name="xalign">0</property>
+                    <property name="yalign">0.5</property>
+                    <property name="label" translatable="yes">_Edit:</property>
+                    <property name="mnemonic_widget">commands</property>
+                    <property name="use_underline">True</property>
                   </object>
                   <packing>
                     <property name="expand">False</property>
                     <property name="fill">False</property>
+                    <property name="position">0</property>
                   </packing>
                 </child>
                 <child>
@@ -241,61 +291,23 @@
                       <packing>
                         <property name="expand">False</property>
                         <property name="fill">False</property>
+                        <property name="position">0</property>
                       </packing>
                     </child>
                     <child>
                       <object class="GtkTable" id="tool-table">
                         <property name="visible">True</property>
-                        <property name="n_rows">7</property>
+                        <property name="n_rows">6</property>
                         <property name="n_columns">2</property>
                         <property name="column_spacing">6</property>
                         <property name="row_spacing">6</property>
                         <child>
-                          <object class="GtkScrolledWindow" id="scrolledwindow3">
-                            <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
-                            <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
-                            <property name="shadow_type">GTK_SHADOW_IN</property>
-                            <child>
-                              <object class="GtkSourceView" id="commands">
-                                <property name="wrap_mode">GTK_WRAP_WORD</property>
-                                <property name="buffer">commands_buffer</property>
-                                <property name="visible">True</property>
-                                <property name="can_focus">True</property>
-                              </object>
-                            </child>
-                          </object>
-                          <packing>
-                            <property name="left_attach">1</property>
-                            <property name="right_attach">2</property>
-                            <property name="top_attach">2</property>
-                            <property name="bottom_attach">3</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <object class="GtkEntry" id="description">
-                            <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="invisible_char">*</property>
-                            <property name="text">Run &#x201C;make&#x201D; in the document dir</property>
-                          </object>
-                          <packing>
-                            <property name="left_attach">1</property>
-                            <property name="right_attach">2</property>
-                            <property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
-                            <property name="y_options">GTK_FILL</property>
-                          </packing>
-                        </child>
-                        <child>
                           <object class="GtkEntry" id="accelerator">
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
-                            <property name="invisible_char">*</property>
-                            <property name="text">F7</property>
-                            <signal handler="on_accelerator_focus_out" name="focus_out_event"/>
-                            <signal handler="on_accelerator_focus_in" name="focus_in_event"/>
-                            <signal handler="on_accelerator_key_press" name="key_press_event"/>
+                            <signal name="key_press_event" handler="on_accelerator_key_press"/>
+                            <signal name="focus_out_event" handler="on_accelerator_focus_out"/>
+                            <signal name="focus_in_event" handler="on_accelerator_focus_in"/>
                           </object>
                           <packing>
                             <property name="left_attach">1</property>
@@ -308,8 +320,8 @@
                         </child>
                         <child>
                           <object class="GtkComboBox" id="applicability">
-                            <property name="model">model_applicability</property>
                             <property name="visible">True</property>
+                            <property name="model">model_applicability</property>
                             <child>
                               <object class="GtkCellRendererText" id="input_renderer"/>
                               <attributes>
@@ -320,18 +332,18 @@
                           <packing>
                             <property name="left_attach">1</property>
                             <property name="right_attach">2</property>
-                            <property name="top_attach">6</property>
-                            <property name="bottom_attach">7</property>
+                            <property name="top_attach">5</property>
+                            <property name="bottom_attach">6</property>
                             <property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
                             <property name="y_options">GTK_FILL</property>
                           </packing>
                         </child>
                         <child>
                           <object class="GtkComboBox" id="output">
-                            <property name="model">model_output</property>
                             <property name="visible">True</property>
+                            <property name="model">model_output</property>
                             <child>
-                              <object class="GtkCellRendererText" id="input_renderer"/>
+                              <object class="GtkCellRendererText" id="input_renderer1"/>
                               <attributes>
                                 <attribute name="text">0</attribute>
                               </attributes>
@@ -340,18 +352,18 @@
                           <packing>
                             <property name="left_attach">1</property>
                             <property name="right_attach">2</property>
-                            <property name="top_attach">5</property>
-                            <property name="bottom_attach">6</property>
+                            <property name="top_attach">4</property>
+                            <property name="bottom_attach">5</property>
                             <property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
                             <property name="y_options">GTK_FILL</property>
                           </packing>
                         </child>
                         <child>
                           <object class="GtkComboBox" id="input">
-                            <property name="model">model_input</property>
                             <property name="visible">True</property>
+                            <property name="model">model_input</property>
                             <child>
-                              <object class="GtkCellRendererText" id="input_renderer"/>
+                              <object class="GtkCellRendererText" id="input_renderer2"/>
                               <attributes>
                                 <attribute name="text">0</attribute>
                               </attributes>
@@ -360,8 +372,8 @@
                           <packing>
                             <property name="left_attach">1</property>
                             <property name="right_attach">2</property>
-                            <property name="top_attach">4</property>
-                            <property name="bottom_attach">5</property>
+                            <property name="top_attach">3</property>
+                            <property name="bottom_attach">4</property>
                             <property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
                             <property name="y_options">GTK_FILL</property>
                           </packing>
@@ -369,6 +381,7 @@
                         <child>
                           <object class="GtkComboBox" id="save-files">
                             <property name="model">model_save_files</property>
+                            <property name="visible">True</property>
                             <child>
                               <object class="GtkCellRendererText" id="renderer1"/>
                               <attributes>
@@ -379,8 +392,8 @@
                           <packing>
                             <property name="left_attach">1</property>
                             <property name="right_attach">2</property>
-                            <property name="top_attach">3</property>
-                            <property name="bottom_attach">4</property>
+                            <property name="top_attach">2</property>
+                            <property name="bottom_attach">3</property>
                             <property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
                             <property name="y_options">GTK_FILL</property>
                           </packing>
@@ -388,81 +401,67 @@
                         <child>
                           <object class="GtkLabel" id="label23">
                             <property name="visible">True</property>
-                            <property name="xalign">0.000000</property>
+                            <property name="xalign">0</property>
                             <property name="label" translatable="yes">_Applicability:</property>
                             <property name="use_underline">True</property>
                             <property name="mnemonic_widget">applicability</property>
                           </object>
                           <packing>
-                            <property name="top_attach">6</property>
-                            <property name="bottom_attach">7</property>
-                            <property name="x_options">GTK_FILL</property>
-                            <property name="y_options"/>
-                          </packing>
-                        </child>
-                        <child>
-                          <object class="GtkLabel" id="label4">
-                            <property name="visible">True</property>
-                            <property name="xalign">0.000000</property>
-                            <property name="yalign">0.000000</property>
-                            <property name="label" translatable="yes">Co_mmand(s):</property>
-                            <property name="use_underline">True</property>
-                            <property name="mnemonic_widget">scrolledwindow3</property>
-                          </object>
-                          <packing>
-                            <property name="top_attach">2</property>
-                            <property name="bottom_attach">3</property>
+                            <property name="top_attach">5</property>
+                            <property name="bottom_attach">6</property>
                             <property name="x_options">GTK_FILL</property>
-                            <property name="y_options">GTK_FILL</property>
+                            <property name="y_options"></property>
                           </packing>
                         </child>
                         <child>
                           <object class="GtkLabel" id="label8">
                             <property name="visible">True</property>
-                            <property name="xalign">0.000000</property>
+                            <property name="xalign">0</property>
                             <property name="label" translatable="yes">_Output:</property>
                             <property name="use_underline">True</property>
                             <property name="mnemonic_widget">output</property>
                           </object>
                           <packing>
-                            <property name="top_attach">5</property>
-                            <property name="bottom_attach">6</property>
+                            <property name="top_attach">4</property>
+                            <property name="bottom_attach">5</property>
                             <property name="x_options">GTK_FILL</property>
-                            <property name="y_options"/>
+                            <property name="y_options"></property>
                           </packing>
                         </child>
                         <child>
                           <object class="GtkLabel" id="label7">
                             <property name="visible">True</property>
-                            <property name="xalign">0.000000</property>
+                            <property name="xalign">0</property>
                             <property name="label" translatable="yes">_Input:</property>
                             <property name="use_underline">True</property>
                             <property name="mnemonic_widget">input</property>
                           </object>
                           <packing>
-                            <property name="top_attach">4</property>
-                            <property name="bottom_attach">5</property>
+                            <property name="top_attach">3</property>
+                            <property name="bottom_attach">4</property>
                             <property name="x_options">GTK_FILL</property>
-                            <property name="y_options"/>
+                            <property name="y_options"></property>
                           </packing>
                         </child>
                         <child>
                           <object class="GtkLabel" id="label6">
-                            <property name="xalign">0.000000</property>
+                            <property name="xalign">0</property>
                             <property name="label" translatable="yes">_Save:</property>
                             <property name="use_underline">True</property>
+                            <property name="mnemonic_widget">save-files</property>
+                            <property name="visible">True</property>
                           </object>
                           <packing>
-                            <property name="top_attach">3</property>
-                            <property name="bottom_attach">4</property>
+                            <property name="top_attach">2</property>
+                            <property name="bottom_attach">3</property>
                             <property name="x_options">GTK_FILL</property>
-                            <property name="y_options"/>
+                            <property name="y_options"></property>
                           </packing>
                         </child>
                         <child>
                           <object class="GtkLabel" id="label3">
                             <property name="visible">True</property>
-                            <property name="xalign">0.000000</property>
+                            <property name="xalign">0</property>
                             <property name="label" translatable="yes">_Shortcut Key:</property>
                             <property name="use_underline">True</property>
                             <property name="mnemonic_widget">accelerator</property>
@@ -471,20 +470,32 @@
                             <property name="top_attach">1</property>
                             <property name="bottom_attach">2</property>
                             <property name="x_options">GTK_FILL</property>
-                            <property name="y_options"/>
+                            <property name="y_options"></property>
                           </packing>
                         </child>
                         <child>
-                          <object class="GtkLabel" id="label5">
+                          <object class="GtkScrolledWindow" id="scrolledwindow1">
                             <property name="visible">True</property>
-                            <property name="xalign">0.000000</property>
-                            <property name="label" translatable="yes">_Description:</property>
-                            <property name="use_underline">True</property>
-                            <property name="mnemonic_widget">description</property>
+                            <property name="can_focus">True</property>
+                            <property name="hscrollbar_policy">automatic</property>
+                            <property name="vscrollbar_policy">automatic</property>
+                            <property name="shadow_type">in</property>
+                            <child>
+		                      <object class="GeditView" id="commands">
+		                        <property name="buffer">commands_buffer</property>
+		                        <property name="visible">True</property>
+		                        <property name="auto-indent">True</property>
+		                        <property name="insert-spaces-instead-of-tabs">False</property>
+		                        <property name="smart-home-end">GTK_SOURCE_SMART_HOME_END_AFTER</property>
+		                        <property name="tab-width">2</property>
+		                        <property name="highlight-current-line">True</property>
+		                        <property name="show-right-margin">False</property>
+		                        <property name="show-line-numbers">True</property>
+		                      </object>
+		                    </child>
                           </object>
                           <packing>
-                            <property name="x_options">GTK_FILL</property>
-                            <property name="y_options"/>
+                            <property name="right_attach">2</property>
                           </packing>
                         </child>
                       </object>
@@ -499,6 +510,7 @@
                 </child>
               </object>
               <packing>
+                <property name="resize">True</property>
                 <property name="shrink">False</property>
               </packing>
             </child>
@@ -510,32 +522,42 @@
         <child internal-child="action_area">
           <object class="GtkHButtonBox" id="hbuttonbox1">
             <property name="visible">True</property>
-            <property name="layout_style">GTK_BUTTONBOX_END</property>
+            <property name="layout_style">end</property>
             <child>
               <object class="GtkButton" id="button1">
+                <property name="label">gtk-help</property>
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="can_default">True</property>
-                <property name="label">gtk-help</property>
+                <property name="receives_default">False</property>
                 <property name="use_stock">True</property>
               </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">0</property>
+              </packing>
             </child>
             <child>
               <object class="GtkButton" id="button2">
+                <property name="label">gtk-close</property>
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="can_default">True</property>
-                <property name="label">gtk-close</property>
+                <property name="receives_default">False</property>
                 <property name="use_stock">True</property>
               </object>
               <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
                 <property name="position">1</property>
               </packing>
             </child>
           </object>
           <packing>
             <property name="expand">False</property>
-            <property name="pack_type">GTK_PACK_END</property>
+            <property name="pack_type">end</property>
+            <property name="position">0</property>
           </packing>
         </child>
       </object>



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