Slightly modified version of Custom Commands Dialog fix from David Chandler
Fixes LP#1414332 custom commands broadcast to grouped terminals from Mauro S M Rodrigues Remove pointless horizontal scrollbar from Layout Launcher
This commit is contained in:
commit
fe8d4899cb
|
@ -23,7 +23,7 @@
|
||||||
<object class="GtkScrolledWindow" id="scrolledwindow1">
|
<object class="GtkScrolledWindow" id="scrolledwindow1">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="hscrollbar_policy">automatic</property>
|
<property name="hscrollbar_policy">never</property>
|
||||||
<property name="vscrollbar_policy">automatic</property>
|
<property name="vscrollbar_policy">automatic</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkTreeView" id="layoutlist">
|
<object class="GtkTreeView" id="layoutlist">
|
||||||
|
|
|
@ -84,7 +84,8 @@ class CustomCommandsMenu(plugin.MenuItem):
|
||||||
menuitem.set_image(image)
|
menuitem.set_image(image)
|
||||||
else:
|
else:
|
||||||
menuitem = gtk.MenuItem(command["name"])
|
menuitem = gtk.MenuItem(command["name"])
|
||||||
menuitem.connect("activate", self._execute, {'terminal' : terminal, 'command' : command['command'] })
|
terminals = terminal.terminator.get_target_terms(terminal)
|
||||||
|
menuitem.connect("activate", self._execute, {'terminals' : terminals, 'command' : command['command'] })
|
||||||
submenu.append(menuitem)
|
submenu.append(menuitem)
|
||||||
|
|
||||||
def _save_config(self):
|
def _save_config(self):
|
||||||
|
@ -108,9 +109,10 @@ class CustomCommandsMenu(plugin.MenuItem):
|
||||||
|
|
||||||
def _execute(self, widget, data):
|
def _execute(self, widget, data):
|
||||||
command = data['command']
|
command = data['command']
|
||||||
if command[len(command)-1] != '\n':
|
if command[-1] != '\n':
|
||||||
command = command + '\n'
|
command = command + '\n'
|
||||||
data['terminal'].vte.feed_child(command)
|
for terminal in data['terminals']:
|
||||||
|
terminal.vte.feed_child(command)
|
||||||
|
|
||||||
def configure(self, widget, data = None):
|
def configure(self, widget, data = None):
|
||||||
ui = {}
|
ui = {}
|
||||||
|
@ -157,8 +159,13 @@ class CustomCommandsMenu(plugin.MenuItem):
|
||||||
column = gtk.TreeViewColumn("Command", renderer, text=CC_COL_COMMAND)
|
column = gtk.TreeViewColumn("Command", renderer, text=CC_COL_COMMAND)
|
||||||
treeview.append_column(column)
|
treeview.append_column(column)
|
||||||
|
|
||||||
|
scroll_window = gtk.ScrolledWindow()
|
||||||
|
scroll_window.set_size_request(500, 250)
|
||||||
|
scroll_window.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
|
||||||
|
scroll_window.add_with_viewport(treeview)
|
||||||
|
|
||||||
hbox = gtk.HBox()
|
hbox = gtk.HBox()
|
||||||
hbox.pack_start(treeview)
|
hbox.pack_start(scroll_window, True, True)
|
||||||
dbox.vbox.pack_start(hbox)
|
dbox.vbox.pack_start(hbox)
|
||||||
|
|
||||||
button_box = gtk.VBox()
|
button_box = gtk.VBox()
|
||||||
|
@ -206,7 +213,7 @@ class CustomCommandsMenu(plugin.MenuItem):
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
hbox.pack_start(button_box)
|
hbox.pack_start(button_box, False, True)
|
||||||
dbox.show_all()
|
dbox.show_all()
|
||||||
res = dbox.run()
|
res = dbox.run()
|
||||||
if res == gtk.RESPONSE_ACCEPT:
|
if res == gtk.RESPONSE_ACCEPT:
|
||||||
|
|
Loading…
Reference in New Issue