Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(2987)

Delta Between Two Patch Sets: tryton/gui/main.py

Issue 115085: Add "Forms/Statusbar" option (Closed)
Left Patch Set: Created 15 years, 7 months ago
Right Patch Set: Call set_statusbar before set_menubar Created 15 years, 7 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « tryton/config.py ('k') | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 #This file is part of Tryton. The COPYRIGHT file at the top level of 1 #This file is part of Tryton. The COPYRIGHT file at the top level of
2 #this repository contains the full copyright notices and license terms. 2 #this repository contains the full copyright notices and license terms.
3 import os 3 import os
4 import sys 4 import sys
5 import gettext 5 import gettext
6 import urlparse 6 import urlparse
7 import gobject 7 import gobject
8 import gtk 8 import gtk
9 import tryton.rpc as rpc 9 import tryton.rpc as rpc
10 from tryton.config import CONFIG, TRYTON_ICON, PIXMAPS_DIR, DATA_DIR, get_home_d ir 10 from tryton.config import CONFIG, TRYTON_ICON, PIXMAPS_DIR, DATA_DIR, get_home_d ir
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 self.tooltips = common.Tooltips() 102 self.tooltips = common.Tooltips()
103 103
104 toolbar = gtk.Toolbar() 104 toolbar = gtk.Toolbar()
105 self.toolbar = toolbar 105 self.toolbar = toolbar
106 toolbar.set_orientation(gtk.ORIENTATION_HORIZONTAL) 106 toolbar.set_orientation(gtk.ORIENTATION_HORIZONTAL)
107 toolbar.set_style(gtk.TOOLBAR_BOTH) 107 toolbar.set_style(gtk.TOOLBAR_BOTH)
108 108
109 self.vbox = gtk.VBox() 109 self.vbox = gtk.VBox()
110 self.window.add(self.vbox) 110 self.window.add(self.vbox)
111 111
112 self.status_hbox = None
112 self.menubar = None 113 self.menubar = None
113 self.menuitem_user = None 114 self.menuitem_user = None
114 self.menuitem_form = None 115 self.menuitem_form = None
115 self.menuitem_plugins = None 116 self.menuitem_plugins = None
116 117
118 self.set_statusbar()
117 self.set_menubar() 119 self.set_menubar()
118 120
119 if igemacintegration: 121 if igemacintegration:
120 self.macmenu = igemacintegration.MacMenu() 122 self.macmenu = igemacintegration.MacMenu()
121 quit_item = gtk.MenuItem(_('Quit')) 123 quit_item = gtk.MenuItem(_('Quit'))
122 quit_item.connect('activate', self.sig_close) 124 quit_item.connect('activate', self.sig_close)
123 self.macmenu.set_quit_menu_item(quit_item) 125 self.macmenu.set_quit_menu_item(quit_item)
124 self.macdock = igemacintegration.MacDock() 126 self.macdock = igemacintegration.MacDock()
125 self.macdock.connect('quit-activate', self.sig_close) 127 self.macdock.connect('quit-activate', self.sig_close)
126 128
127 self.vbox.pack_start(toolbar, False, True) 129 self.vbox.pack_start(toolbar, False, True)
128 130
129 self.buttons = {} 131 self.buttons = {}
130 self._set_toolbar() 132 self._set_toolbar()
131 self.set_toolbar_label() 133 self.set_toolbar_label()
132 134
133 self.notebook = gtk.Notebook() 135 self.notebook = gtk.Notebook()
134 self.notebook.popup_enable() 136 self.notebook.popup_enable()
135 self.notebook.set_scrollable(True) 137 self.notebook.set_scrollable(True)
136 self.notebook.connect_after('switch-page', self._sig_page_changt) 138 self.notebook.connect_after('switch-page', self._sig_page_changt)
137 self.vbox.pack_start(self.notebook, True, True) 139 self.vbox.pack_start(self.notebook, True, True)
138
139 self.status_hbox = None
140 self.set_statusbar()
141 140
142 self.window.show_all() 141 self.window.show_all()
143 142
144 self.pages = [] 143 self.pages = []
145 self.previous_pages = {} 144 self.previous_pages = {}
146 self.current_page = 0 145 self.current_page = 0
147 self.last_page = 0 146 self.last_page = 0
148 147
149 if CONFIG['client.modepda']: 148 if CONFIG['client.modepda']:
150 self.radiomenuitem_pda.set_active(True) 149 self.radiomenuitem_pda.set_active(True)
(...skipping 819 matching lines...) Expand 10 before | Expand all | Expand 10 after
970 self.toolbar.show() 969 self.toolbar.show()
971 else: 970 else:
972 self.toolbar.hide() 971 self.toolbar.hide()
973 972
974 def sig_statusbar_change(self, value): 973 def sig_statusbar_change(self, value):
975 CONFIG['form.statusbar'] = value 974 CONFIG['form.statusbar'] = value
976 return self.sig_statusbar_show() 975 return self.sig_statusbar_show()
977 976
978 def sig_statusbar_show(self): 977 def sig_statusbar_show(self):
979 statusbar = CONFIG['form.statusbar'] 978 statusbar = CONFIG['form.statusbar']
980 try: 979 if statusbar:
ced1 2009/09/10 10:09:03 Why a try except ?
981 if statusbar: 980 self.status_hbox.show()
982 self.status_hbox.show() 981 else:
983 else: 982 self.status_hbox.hide()
984 self.status_hbox.hide()
985 except:
986 return
987 983
988 def sig_mode_change(self, pda_mode=False): 984 def sig_mode_change(self, pda_mode=False):
989 CONFIG['client.modepda'] = pda_mode 985 CONFIG['client.modepda'] = pda_mode
990 return 986 return
991 987
992 def sig_toolbar(self, option): 988 def sig_toolbar(self, option):
993 CONFIG['client.toolbar'] = option 989 CONFIG['client.toolbar'] = option
994 if option == 'default': 990 if option == 'default':
995 self.toolbar.set_style(False) 991 self.toolbar.set_style(False)
996 elif option == 'both': 992 elif option == 'both':
(...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after
1572 1568
1573 if filename: 1569 if filename:
1574 file_ = file(filename, 'wb') 1570 file_ = file(filename, 'wb')
1575 file_.write(dump) 1571 file_.write(dump)
1576 file_.close() 1572 file_.close()
1577 common.message(_("Database backuped successfully!"), \ 1573 common.message(_("Database backuped successfully!"), \
1578 parent=self.window) 1574 parent=self.window)
1579 else: 1575 else:
1580 rpc.logout() 1576 rpc.logout()
1581 Main.get_main().refresh_ssl() 1577 Main.get_main().refresh_ssl()
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b