Merge branch 'master' of git://git.assembla.com/fpdb-eric

This commit is contained in:
Worros 2008-11-10 22:55:24 +10:00
commit 6de1ac1c82
7 changed files with 446 additions and 437 deletions

View File

@ -140,6 +140,7 @@ class GuiAutoImport (threading.Thread):
# Add directories to importer object.
for site in self.input_settings:
self.importer.addImportDirectory(self.input_settings[site][0], True, site, self.input_settings[site][1])
print "Adding import directories - Site: " + site + " dir: "+ str(self.input_settings[site][0])
self.do_import()
interval=int(self.intervalEntry.get_text())

View File

@ -116,13 +116,13 @@ class Hud:
return True
return False
def kill_hud(self, args):
def kill_hud(self, *args):
for k in self.stat_windows.keys():
self.stat_windows[k].window.destroy()
self.main_window.destroy()
self.deleted = True
def reposition_windows(self, args):
def reposition_windows(self, *args):
for w in self.stat_windows:
self.stat_windows[w].window.move(self.stat_windows[w].x,
self.stat_windows[w].y)
@ -259,7 +259,8 @@ class Stat_Window:
# This handles all callbacks from button presses on the event boxes in
# the stat windows. There is a bit of an ugly kludge to separate single-
# and double-clicks.
if event.button == 1: # left button event
if event.button == 3: # right button event
if event.type == gtk.gdk.BUTTON_PRESS: # left button single click
if self.sb_click > 0: return
self.sb_click = gobject.timeout_add(250, self.single_click, widget)
@ -270,12 +271,14 @@ class Stat_Window:
self.double_click(widget, event, *args)
if event.button == 2: # middle button event
pass
# print "middle button clicked"
if event.button == 3: # right button event
pass
# print "right button clicked"
if event.button == 1: # left button event
if event.state & gtk.gdk.SHIFT_MASK:
self.window.begin_resize_drag(gtk.gdk.WINDOW_EDGE_SOUTH_EAST, event.button, int(event.x_root), int(event.y_root), event.time)
else:
self.window.begin_move_drag(event.button, int(event.x_root), int(event.y_root), event.time)
def single_click(self, widget):
# Callback from the timeout in the single-click finding part of the
@ -349,8 +352,9 @@ class Stat_Window:
# font = pango.FontDescription("Sans 8")
self.label[r][c].modify_font(font)
if not os.name == 'nt': # seems to be a bug in opacity on windows
# if not os.name == 'nt': # seems to be a bug in opacity on windows
self.window.set_opacity(parent.colors['hudopacity'])
self.window.realize
self.window.move(self.x, self.y)
self.window.show_all()
@ -457,7 +461,7 @@ class Popup_window:
self.lab.set_text(pu_text)
self.window.show_all()
self.window.set_transient_for(stat_window.main_window)
self.window.set_transient_for(stat_window.window)
# set_keep_above(1) for windows
if os.name == 'nt': self.topify_window(self.window)

View File

@ -177,7 +177,11 @@ class Importer:
self.pos_in_file[file] = inputFile.tell()
inputFile.close()
try: # sometimes we seem to be getting an empty self.lines, in which case, we just want to return.
firstline = self.lines[0]
except:
# print "import_fpdb_file", file, site, self.lines, "\n"
return
if firstline.find("Tournament Summary")!=-1:
print "TODO: implement importing tournament summaries"