Update Graph Viewer to use config file, fill Entry with player_name field from the config.

This commit is contained in:
Worros 2008-10-25 14:57:29 +08:00
parent c48b2f3057
commit 389d9361b9
2 changed files with 5 additions and 2 deletions

View File

@ -101,7 +101,7 @@ class GuiGraphViewer (threading.Thread):
return line/100 return line/100
#end of def getRingProfitGraph #end of def getRingProfitGraph
def __init__(self, db, settings, querylist, debug=True): def __init__(self, db, settings, querylist, config, debug=True):
"""Constructor for GraphViewer""" """Constructor for GraphViewer"""
self.debug=debug self.debug=debug
#print "start of GraphViewer constructor" #print "start of GraphViewer constructor"
@ -134,6 +134,9 @@ class GuiGraphViewer (threading.Thread):
self.siteEntry.set_text("PS") self.siteEntry.set_text("PS")
self.settingsHBox.pack_start(self.siteEntry) self.settingsHBox.pack_start(self.siteEntry)
self.siteEntry.show() self.siteEntry.show()
#Note: Assumes PokerStars is in the config
self.nameEntry.set_text(config.supported_sites["PokerStars"].screen_name)
self.showButton=gtk.Button("Show/Refresh") self.showButton=gtk.Button("Show/Refresh")
self.showButton.connect("clicked", self.showClicked, "show clicked") self.showButton.connect("clicked", self.showClicked, "show clicked")

View File

@ -339,7 +339,7 @@ This program is licensed under the AGPL3, see docs"""+os.sep+"agpl-3.0.txt")
def tabGraphViewer(self, widget, data): def tabGraphViewer(self, widget, data):
"""opens a graph viewer tab""" """opens a graph viewer tab"""
#print "start of tabGraphViewer" #print "start of tabGraphViewer"
new_gv_thread=GuiGraphViewer.GuiGraphViewer(self.db, self.settings,self.querydict) new_gv_thread=GuiGraphViewer.GuiGraphViewer(self.db, self.settings, self.querydict, self.config)
self.threads.append(new_gv_thread) self.threads.append(new_gv_thread)
gv_tab=new_gv_thread.get_vbox() gv_tab=new_gv_thread.get_vbox()
self.add_and_display_tab(gv_tab, "Graphs") self.add_and_display_tab(gv_tab, "Graphs")