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

Side by Side Diff: tryton/gui/main.py

Issue 116060: Add request state on status bar (Closed)
Patch Set: Add gettetx on message 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:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 if not self.status_hbox: 260 if not self.status_hbox:
261 self.status_hbox = gtk.HBox(spacing=2) 261 self.status_hbox = gtk.HBox(spacing=2)
262 update = False 262 update = False
263 self.vbox.pack_end(self.status_hbox, False, True, padding=2) 263 self.vbox.pack_end(self.status_hbox, False, True, padding=2)
264 264
265 if not update: 265 if not update:
266 self.sb_username = gtk.Label() 266 self.sb_username = gtk.Label()
267 self.sb_username.set_alignment(0.0, 0.5) 267 self.sb_username.set_alignment(0.0, 0.5)
268 self.status_hbox.pack_start(self.sb_username, True, True, padding=5) 268 self.status_hbox.pack_start(self.sb_username, True, True, padding=5)
269 269
270 self.sb_requests = gtk.Label()
271 self.sb_requests.set_alignment(0.5, 0.5)
272 self.status_hbox.pack_start(self.sb_requests, True, True,
273 padding=5)
274
270 self.sb_servername = gtk.Label() 275 self.sb_servername = gtk.Label()
271 self.sb_servername.set_alignment(1.0, 0.5) 276 self.sb_servername.set_alignment(1.0, 0.5)
272 self.status_hbox.pack_start(self.sb_servername, True, True, 277 self.status_hbox.pack_start(self.sb_servername, True, True,
273 padding=5) 278 padding=5)
274 279
275 self.secure_img = gtk.Image() 280 self.secure_img = gtk.Image()
276 self.secure_img.set_from_stock('tryton-lock', gtk.ICON_SIZE_MENU) 281 self.secure_img.set_from_stock('tryton-lock', gtk.ICON_SIZE_MENU)
277 self.status_hbox.pack_start(self.secure_img, False, True, padding=2) 282 self.status_hbox.pack_start(self.secure_img, False, True, padding=2)
278 283
279 self.status_hbox.show_all() 284 self.status_hbox.show_all()
(...skipping 775 matching lines...) Expand 10 before | Expand all | Expand 10 after
1055 else: 1060 else:
1056 ids, ids2 = rpc.execute('model', 'res.request', 'request_get') 1061 ids, ids2 = rpc.execute('model', 'res.request', 'request_get')
1057 label = _('Requests (%s/%s)') % (len(ids), len(ids2)) 1062 label = _('Requests (%s/%s)') % (len(ids), len(ids2))
1058 self.buttons['but_request'].set_label(label) 1063 self.buttons['but_request'].set_label(label)
1059 self.tooltips.set_tip(self.buttons['but_request'], label) 1064 self.tooltips.set_tip(self.buttons['but_request'], label)
1060 if not ids: 1065 if not ids:
1061 self.buttons['but_request'].set_stock_id('tryton-mail-message') 1066 self.buttons['but_request'].set_stock_id('tryton-mail-message')
1062 else: 1067 else:
1063 self.buttons['but_request'].set_stock_id( 1068 self.buttons['but_request'].set_stock_id(
1064 'tryton-mail-message-new') 1069 'tryton-mail-message-new')
1070 message = _('Waiting requests: %s received - %s sent') % (len(ids),
udono 2009/09/09 13:57:19 Iam not sure if 'Waiting requests' is a good term.
1071 len(ids2))
1072 self.sb_requests.set_text(message)
1065 return (ids, ids2) 1073 return (ids, ids2)
1066 except: 1074 except:
1067 if exception: 1075 if exception:
1068 raise 1076 raise
1069 return ([], []) 1077 return ([], [])
1070 1078
1071 def sig_login(self, widget=None, dbname=False, res=None): 1079 def sig_login(self, widget=None, dbname=False, res=None):
1072 self.sig_logout(widget, disconnect=False) 1080 self.sig_logout(widget, disconnect=False)
1073 if not res: 1081 if not res:
1074 try: 1082 try:
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
1133 if wid: 1141 if wid:
1134 if 'but_close' in wid.handlers: 1142 if 'but_close' in wid.handlers:
1135 res = wid.handlers['but_close']() 1143 res = wid.handlers['but_close']()
1136 if not res: 1144 if not res:
1137 return False 1145 return False
1138 res = self._win_del() 1146 res = self._win_del()
1139 else: 1147 else:
1140 res = False 1148 res = False
1141 self.sb_username.set_text('') 1149 self.sb_username.set_text('')
1142 self.sb_servername.set_text('') 1150 self.sb_servername.set_text('')
1151 self.sb_requests.set_text('')
1143 self.shortcut_unset() 1152 self.shortcut_unset()
1144 self.toolbutton_menu.set_sensitive(False) 1153 self.toolbutton_menu.set_sensitive(False)
1145 self.toolbutton_request.set_sensitive(False) 1154 self.toolbutton_request.set_sensitive(False)
1146 self.toolbutton_request.set_label(_('Request')) 1155 self.toolbutton_request.set_label(_('Request'))
1147 self.menuitem_user.set_sensitive(False) 1156 self.menuitem_user.set_sensitive(False)
1148 self.menuitem_form.set_sensitive(False) 1157 self.menuitem_form.set_sensitive(False)
1149 self.menuitem_plugins.set_sensitive(False) 1158 self.menuitem_plugins.set_sensitive(False)
1150 if disconnect: 1159 if disconnect:
1151 rpc.logout() 1160 rpc.logout()
1152 self.refresh_ssl() 1161 self.refresh_ssl()
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after
1540 1549
1541 if filename: 1550 if filename:
1542 file_ = file(filename, 'wb') 1551 file_ = file(filename, 'wb')
1543 file_.write(dump) 1552 file_.write(dump)
1544 file_.close() 1553 file_.close()
1545 common.message(_("Database backuped successfully!"), \ 1554 common.message(_("Database backuped successfully!"), \
1546 parent=self.window) 1555 parent=self.window)
1547 else: 1556 else:
1548 rpc.logout() 1557 rpc.logout()
1549 Main.get_main().refresh_ssl() 1558 Main.get_main().refresh_ssl()
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

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