Merge branch 'master' of git://git.assembla.com/fpdb-eric
This commit is contained in:
commit
e0c193b77d
|
@ -116,11 +116,7 @@ class HUD_main(object):
|
|||
# called by an event in the HUD, to kill this specific HUD
|
||||
if table in self.hud_dict:
|
||||
self.hud_dict[table].kill()
|
||||
try:
|
||||
# throws exception in windows sometimes (when closing using main_window menu?)
|
||||
self.hud_dict[table].main_window.destroy()
|
||||
except:
|
||||
pass
|
||||
self.hud_dict[table].main_window.destroy()
|
||||
self.vb.remove(self.hud_dict[table].tablehudlabel)
|
||||
del(self.hud_dict[table])
|
||||
self.main_window.resize(1,1)
|
||||
|
@ -131,7 +127,7 @@ class HUD_main(object):
|
|||
def idle_func():
|
||||
|
||||
gtk.gdk.threads_enter()
|
||||
try:
|
||||
try: # TODO: seriously need to decrease the scope of this block.. what are we expecting to error?
|
||||
newlabel = gtk.Label("%s - %s" % (table.site, table_name))
|
||||
self.vb.add(newlabel)
|
||||
newlabel.show()
|
||||
|
@ -174,12 +170,13 @@ class HUD_main(object):
|
|||
# function idle_func() to be run by the gui thread, at its leisure.
|
||||
def idle_func():
|
||||
gtk.gdk.threads_enter()
|
||||
try:
|
||||
self.hud_dict[table_name].update(new_hand_id, config)
|
||||
[aw.update_gui(new_hand_id) for aw in self.hud_dict[table_name].aux_windows]
|
||||
return False
|
||||
finally:
|
||||
gtk.gdk.threads_leave()
|
||||
# try:
|
||||
self.hud_dict[table_name].update(new_hand_id, config)
|
||||
[aw.update_gui(new_hand_id) for aw in self.hud_dict[table_name].aux_windows]
|
||||
# finally:
|
||||
gtk.gdk.threads_leave()
|
||||
return False
|
||||
|
||||
gobject.idle_add(idle_func)
|
||||
|
||||
def read_stdin(self): # This is the thread function
|
||||
|
|
|
@ -618,8 +618,50 @@ This program is licensed under the AGPL3, see docs"""+os.sep+"agpl-3.0.txt")
|
|||
|
||||
self.window.show()
|
||||
self.load_profile()
|
||||
|
||||
self.statusIcon = gtk.StatusIcon()
|
||||
self.statusIcon.set_from_stock(gtk.STOCK_HOME)
|
||||
self.statusIcon.set_tooltip("Free Poker Database")
|
||||
self.statusIcon.connect('activate', self.statusicon_activate)
|
||||
self.statusMenu = gtk.Menu()
|
||||
menuItem = gtk.ImageMenuItem(gtk.STOCK_ABOUT)
|
||||
menuItem.connect('activate', self.dia_about)
|
||||
self.statusMenu.append(menuItem)
|
||||
menuItem = gtk.ImageMenuItem(gtk.STOCK_QUIT)
|
||||
menuItem.connect('activate', self.quit)
|
||||
self.statusMenu.append(menuItem)
|
||||
self.statusIcon.connect('popup-menu', self.statusicon_menu, self.statusMenu)
|
||||
self.statusIcon.set_visible(True)
|
||||
|
||||
self.window.connect('window-state-event', self.window_state_event_cb)
|
||||
sys.stderr.write("fpdb starting ...")
|
||||
|
||||
def window_state_event_cb(self, window, event):
|
||||
print "window_state_event", event
|
||||
if event.changed_mask & gtk.gdk.WINDOW_STATE_ICONIFIED:
|
||||
if event.new_window_state & gtk.gdk.WINDOW_STATE_ICONIFIED:
|
||||
print "FPDB minimized"
|
||||
self.window.set_skip_taskbar_hint(True)
|
||||
self.window.set_skip_pager_hint(True)
|
||||
else:
|
||||
print "FPDB unminimized"
|
||||
self.window.set_skip_taskbar_hint(False)
|
||||
self.window.set_skip_pager_hint(False)
|
||||
|
||||
def statusicon_menu(self, widget, button, time, data = None):
|
||||
# we don't need to pass data here, since we do keep track of most all
|
||||
# our variables .. the example code that i looked at for this
|
||||
# didn't use any long scope variables.. which might be an alright
|
||||
# idea too sometime
|
||||
if button == 3:
|
||||
if data:
|
||||
data.show_all()
|
||||
data.popup(None, None, None, 3, time)
|
||||
pass
|
||||
|
||||
def statusicon_activate(self, widget, data = None):
|
||||
self.window.present()
|
||||
|
||||
def warning_box(self, str, diatitle="FPDB WARNING"):
|
||||
diaWarning = gtk.Dialog(title=diatitle, parent=None, flags=0, buttons=(gtk.STOCK_OK,gtk.RESPONSE_OK))
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user