Esempio n. 1
0
 def create_killer(self):
   self.killer_menu = gtk.Menu()
   signums = [
     ('SIGTERM', 15),
     ('SIGKILL', 9),
     ('SIGINT', 2),
     ('SIGABRT', 6),
   ]
   for signame, signum in signums:
     menuitem = gtk.MenuItem()
     menuitem.set_label('{0} ({1})'.format(signame, signum))
     self.killer_menu.append(menuitem)
     menuitem.set_data('signum', signum)
     menuitem.connect('activate', self.on_killer_activate)
   self.killer_menu.show_all()
   self.killer_button = resources.load_button(
     'script_lightning.png', 'Send signal to children')
   self.tools.pack_start(self.killer_button, expand=False)
   self.killer_shell_menu = gtk.Menu()
   for signame, signum in signums:
     menuitem = gtk.MenuItem()
     menuitem.set_label('{0} ({1})'.format(signame, signum))
     self.killer_shell_menu.append(menuitem)
     menuitem.set_data('signum', signum)
     menuitem.connect('activate', self.on_killer_shell_activate)
   self.killer_shell_menu.show_all()
   self.killer_shell_button = resources.load_button(
     'application_lightning.png', 'Send signal to shell')
   self.tools.pack_start(self.killer_shell_button, expand=False)
Esempio n. 2
0
 def create_confirmer(self):
   self.confirmer = gtk.HBox()
   self.confirmer.set_spacing(3)
   self.confirmer.set_border_width(3)
   self.stack.pack_start(self.confirmer, expand=False)
   self.confirmer.set_no_show_all(True)
   self.confirm_label = gtk.Label()
   self.confirm_label.set_alignment(1, 0.5)
   self.confirmer.pack_start(self.confirm_label)
   self.confirm_yes_button = resources.load_button('tick.png', 'Yes, kill')
   self.confirm_no_button = resources.load_button('cross.png', 'No, save')
   self.confirmer.pack_start(self.confirm_yes_button, expand=False)
   self.confirmer.pack_start(self.confirm_no_button, expand=False)
   for child in self.confirmer.get_children():
     child.show()
Esempio n. 3
0
 def create_finder(self):
   self.finder = gtk.HBox()
   self.finder.set_spacing(3)
   self.stack.pack_start(self.finder, expand=False)
   self.finder.set_no_show_all(True)
   self.find_text = gtk.Entry()
   self.findnext_button = resources.load_button('resultset_next.png',
     'Find next')
   self.findprev_button = resources.load_button('resultset_previous.png',
     'Find previous')
   self.finder.pack_start(self.findprev_button, expand=False)
   self.finder.pack_start(self.findnext_button, expand=False)
   self.finder.pack_start(gtk.Label('re'), expand=False)
   self.finder.pack_start(self.find_text)
   for child in self.finder.get_children():
     child.show()
Esempio n. 4
0
 def create_tools(self):
   bar = gtk.HBox()
   for action in commands:
     if action is None:
       bar.pack_start(gtk.Alignment())
     else:
       button = resources.load_button(action.icon, action.label)
       bar.pack_start(button, expand=False)
       button.connect('clicked', self.on_button, action.key)
   bar.show_all()
   return bar
Esempio n. 5
0
 def create_tools(self):
     bar = gtk.HBox()
     for action in commands:
         if action is None:
             bar.pack_start(gtk.Alignment())
         else:
             button = resources.load_button(action.icon, action.label)
             bar.pack_start(button, expand=False)
             button.connect('clicked', self.on_button, action.key)
     bar.show_all()
     return bar
Esempio n. 6
0
 def create_tools(self):
   self.popinout_button = resources.load_button('terminal_pop_out.png',
     'Pop out terminals')
   self.update_popinout_button()
   self.close_button = resources.load_button('cross.png',
     'Close terminal window')
   self.browse_button = resources.load_button('folder.png',
     'Browse working directory')
   self.shell_button = resources.load_button('application_xp_terminal.png',
     'Open a shell in working directory')
   self.bookmark_button = resources.load_button('star.png',
     'Bookmark working directory')
   self.copy_button = resources.load_button('page_white_copy.png',
     'Copy selection')
   self.paste_button = resources.load_button('paste_plain.png',
     'Paste clipboard')
   self.selectall_button = resources.load_button('textfield_add.png',
     'Select all')
   self.selectnone_button = resources.load_button('textfield_delete.png',
     'Select None')
   self.find_button = resources.load_button('find.png',
     'Search for text', gtk.ToggleButton)
   self.tools2.pack_start(self.popinout_button, expand=False)
   self.tools2.pack_start(self.close_button, expand=False)
   self.tools.pack_start(self.browse_button, expand=False)
   self.tools.pack_start(self.shell_button, expand=False)
   self.tools.pack_start(self.bookmark_button, expand=False)
   self.tools2.pack_start(self.copy_button, expand=False)
   self.tools2.pack_start(self.paste_button, expand=False)
   self.tools2.pack_start(self.selectall_button, expand=False)
   self.tools2.pack_start(self.selectnone_button, expand=False)
   self.copy_button.set_sensitive(False)
   self.create_killer()
   self.create_confirmer()
   # This should work in VTE 0.26+ but doesn't in python-vte 0.28
   # so we make it conditional
   # TODO(afshar): fix this when python-vte is updated
   if hasattr(self.terminal, 'search_set_gregex'):
     self.tools.pack_start(self.find_button, expand=False)