From 2f783041851a15bdce62447c83955731c6ed622b Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 21 Oct 2008 21:46:30 -0400 Subject: [PATCH 1/3] cleanup of config file consolidation --- pyfpdb/GuiAutoImport.py | 9 ++++++--- pyfpdb/GuiBulkImport.py | 3 ++- pyfpdb/HUD_main.py | 4 +++- pyfpdb/Hud.py | 5 +++-- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/pyfpdb/GuiAutoImport.py b/pyfpdb/GuiAutoImport.py index 320079e4..a6a994c7 100644 --- a/pyfpdb/GuiAutoImport.py +++ b/pyfpdb/GuiAutoImport.py @@ -123,9 +123,10 @@ class GuiAutoImport (threading.Thread): return self.mainVBox #end def get_vbox - def __init__(self, settings, debug=True): + def __init__(self, settings, config, debug=True): """Constructor for GuiAutoImport""" self.settings=settings + self.config=config self.importer = fpdb_import.Importer(self,self.settings) self.importer.setCallHud(True) self.importer.setMinPrint(30) @@ -164,7 +165,8 @@ class GuiAutoImport (threading.Thread): self.pathStarsLabel.show() self.starsDirPath=gtk.Entry() - self.starsDirPath.set_text(self.settings['hud-defaultPath']) + paths = self.config.get_default_paths("PokerStars") + self.starsDirPath.set_text(paths['hud-defaultPath']) self.pathHBox.pack_start(self.starsDirPath, False, True, 0) self.starsDirPath.show() @@ -178,7 +180,8 @@ class GuiAutoImport (threading.Thread): self.pathTiltLabel.show() self.tiltDirPath=gtk.Entry() - self.tiltDirPath.set_text(self.settings['hud-defaultPath']) + paths = self.config.get_default_paths("FullTilt") + self.tiltDirPath.set_text(paths['hud-defaultPath']) self.pathHBox.pack_start(self.tiltDirPath, False, True, 0) self.tiltDirPath.show() diff --git a/pyfpdb/GuiBulkImport.py b/pyfpdb/GuiBulkImport.py index 978f328d..ee5af2c6 100644 --- a/pyfpdb/GuiBulkImport.py +++ b/pyfpdb/GuiBulkImport.py @@ -76,9 +76,10 @@ class GuiBulkImport (threading.Thread): print "todo: implement bulk import thread" #end def run - def __init__(self, db, settings): + def __init__(self, db, settings, config): self.db=db self.settings=settings + self.config=config self.importer = fpdb_import.Importer(self,self.settings) self.vbox=gtk.VBox(False,1) diff --git a/pyfpdb/HUD_main.py b/pyfpdb/HUD_main.py index 4c0eccdd..b1d5df14 100755 --- a/pyfpdb/HUD_main.py +++ b/pyfpdb/HUD_main.py @@ -134,8 +134,10 @@ if __name__== "__main__": main_window = gtk.Window() main_window.connect("destroy", destroy) + eb = gtk.EventBox() label = gtk.Label('Closing this window will exit from the HUD.') - main_window.add(label) + eb.add(label) + main_window.add(eb) main_window.set_title("HUD Main Window") main_window.show_all() diff --git a/pyfpdb/Hud.py b/pyfpdb/Hud.py index 3abca197..b6233ec6 100644 --- a/pyfpdb/Hud.py +++ b/pyfpdb/Hud.py @@ -52,7 +52,7 @@ class Hud: self.max = max self.db_name = db_name self.deleted = False - self.stacked = False + self.stacked = True self.stat_windows = {} self.popup_windows = {} @@ -70,7 +70,8 @@ class Hud: self.main_window.connect("window-state-event", self.on_window_event) self.ebox = gtk.EventBox() - self.label = gtk.Label("Close this window to\nkill the HUD for\n %s" % (table.name)) + self.label = gtk.Label("Close this window to\nkill the HUD for\n %s\nMinimizing it hides stats." % + (table.name)) self.main_window.add(self.ebox) self.ebox.add(self.label) self.main_window.move(self.table.x, self.table.y) From 6d449b9a2e629a60931147e9ea19fb6ecbe5ab23 Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 21 Oct 2008 21:49:17 -0400 Subject: [PATCH 2/3] more cleanup of config file consolidation --- pyfpdb/fpdb.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyfpdb/fpdb.py b/pyfpdb/fpdb.py index 4e919f93..f56895f0 100755 --- a/pyfpdb/fpdb.py +++ b/pyfpdb/fpdb.py @@ -321,7 +321,7 @@ class fpdb: def tab_auto_import(self, widget, data): """opens the auto import tab""" - new_aimp_thread=GuiAutoImport.GuiAutoImport(self.settings) + new_aimp_thread=GuiAutoImport.GuiAutoImport(self.settings, self.config) self.threads.append(new_aimp_thread) aimp_tab=new_aimp_thread.get_vbox() self.add_and_display_tab(aimp_tab, "Auto Import") @@ -330,7 +330,7 @@ class fpdb: def tab_bulk_import(self, widget, data): """opens a tab for bulk importing""" #print "start of tab_bulk_import" - new_import_thread=GuiBulkImport.GuiBulkImport(self.db, self.settings) + new_import_thread=GuiBulkImport.GuiBulkImport(self.db, self.settings, self.config) self.threads.append(new_import_thread) bulk_tab=new_import_thread.get_vbox() self.add_and_display_tab(bulk_tab, "Bulk Import") From bc834a9d79aaa22e0d09b74b406dde92b6d36b57 Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 22 Oct 2008 10:14:25 -0400 Subject: [PATCH 3/3] more cleanup of config file consolidation --- pyfpdb/fpdb.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pyfpdb/fpdb.py b/pyfpdb/fpdb.py index f56895f0..ab038113 100755 --- a/pyfpdb/fpdb.py +++ b/pyfpdb/fpdb.py @@ -255,7 +255,7 @@ class fpdb: self.diaSetupWizard(path=defaultpath) #end def load_default_profile - def load_profile(self, filename): + def load_profile(self): """Loads profile from the provided path name. also see load_default_profile""" self.settings = {} if (os.sep=="/"): @@ -367,7 +367,8 @@ This program is licensed under the AGPL3, see docs"""+os.sep+"agpl-3.0.txt") self.threads=[] self.db=None self.config = Configuration.Config() - self.load_default_profile() + self.load_profile() +# self.load_default_profile() self.window = gtk.Window(gtk.WINDOW_TOPLEVEL) self.window.connect("delete_event", self.delete_event)