make profile editor opened the conext menu and improve its appearance

This commit is contained in:
Chris Jones 2008-11-01 00:50:34 +00:00
parent e244329725
commit 434c253237
4 changed files with 20 additions and 4 deletions

View File

@ -163,7 +163,5 @@ See the following bug report for more details:
(debugthread, debugsvr) = debugserver.spawn(locals())
term.debugaddress = debugsvr.server_address
# from terminatorlib.prefs_profile import ProfileEditor
# prefs = ProfileEditor ()
gtk.main()

View File

@ -30,9 +30,14 @@ class ProfileEditor:
self.window = gtk.Window ()
self.notebook = gtk.Notebook()
self.box = gtk.VBox()
self.closebut = gtk.Button(stock=gtk.STOCK_CLOSE)
self.butbox = gtk.HButtonBox()
self.applybut = gtk.Button(stock=gtk.STOCK_APPLY)
self.cancelbut = gtk.Button(stock=gtk.STOCK_CANCEL)
self.box.pack_start(self.notebook, False, False)
self.box.pack_end(self.closebut, False, False)
self.box.pack_end(self.butbox, False, False)
self.butbox.set_layout(gtk.BUTTONBOX_END)
self.butbox.pack_start(self.applybut, False, False)
self.butbox.pack_start(self.cancelbut, False, False)
self.window.add (self.box)
self.notebook.append_page (self.auto_add (gtk.Table (), self.globals), gtk.Label ("Global Settings"))
@ -41,6 +46,7 @@ class ProfileEditor:
self.notebook.append_page (self.auto_add (gtk.Table (), self.colours), gtk.Label ("Colours"))
self.notebook.append_page (self.auto_add (gtk.Table (), self.behaviour), gtk.Label ("Behaviour"))
def go (self):
self.window.show_all ()
def source_get_type (self, key):

View File

@ -29,6 +29,7 @@ from config import dbg, err, debug
from terminatorlib.keybindings import TerminatorKeybindings
from terminatorlib.terminatorterm import TerminatorTerm
from terminatorlib.prefs_profile import ProfileEditor
class TerminatorNotebookTabLabel(gtk.HBox):
def __init__(self, title, notebook, terminator):
@ -1038,3 +1039,7 @@ class Terminator:
widget._vte.grab_focus ()
def edit_profile (self, widget):
options = ProfileEditor()
options.go()
print "done"

View File

@ -985,6 +985,13 @@ text/plain
item = gtk.MenuItem ()
menu.append (item)
item = gtk.MenuItem (_("Ed_it profile"))
item.connect ("activate", lambda menu_item: self.terminator.edit_profile (self))
menu.append (item)
item = gtk.MenuItem ()
menu.append (item)
item = gtk.ImageMenuItem (gtk.STOCK_CLOSE)
item.connect ("activate", lambda menu_item: self.terminator.closeterm (self))
menu.append (item)