diff --git a/pyfpdb/Configuration.py b/pyfpdb/Configuration.py index ea2a8a78..7af32d03 100755 --- a/pyfpdb/Configuration.py +++ b/pyfpdb/Configuration.py @@ -1069,8 +1069,8 @@ class Config: def get_supported_games(self): """Get the list of supported games.""" sg = [] - for game in c.supported_games.keys(): - sg.append(c.supported_games[game].game_name) + for game in self.supported_games.keys(): + sg.append(self.supported_games[game].game_name) return sg def execution_path(self, filename): diff --git a/pyfpdb/fpdb.pyw b/pyfpdb/fpdb.pyw index 898b6ec5..24df913b 100755 --- a/pyfpdb/fpdb.pyw +++ b/pyfpdb/fpdb.pyw @@ -337,6 +337,62 @@ class fpdb: diatitle="Database Statistics") #end def dia_database_stats + def diaHudConfigurator(self, widget, data=None): + self.obtain_global_lock("diaHudConfigurator") + diaSelections = gtk.Dialog("HUD Configurator - choose category", + self.window, + gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT, + (gtk.STOCK_OK, gtk.RESPONSE_ACCEPT, + gtk.STOCK_CANCEL, gtk.RESPONSE_REJECT)) + + label=gtk.Label("Please select the game category for which you want to configure HUD stats:") + diaSelections.vbox.add(label) + label.show() + + #combo=gtk.ComboBox() + + comboGame = gtk.combo_box_new_text() + comboGame.connect("changed", self.hudConfiguratorComboSelection) + diaSelections.vbox.add(comboGame) + games=self.config.get_supported_games() + for game in games: + comboGame.append_text(game) + comboGame.show() + + comboRows = gtk.combo_box_new_text() + comboRows.connect("changed", self.hudConfiguratorComboSelection) + diaSelections.vbox.add(comboRows) + for i in range(1,8): + comboRows.append_text(str(i)+" rows") + comboRows.show() + + comboColumns = gtk.combo_box_new_text() + comboColumns.connect("changed", self.hudConfiguratorComboSelection) + diaSelections.vbox.add(comboColumns) + for i in range(1,8): + comboColumns.append_text(str(i)+" columns") + comboColumns.show() + + response=diaSelections.run() + if response == gtk.RESPONSE_ACCEPT: + print "clicked ok and selected:", self.hudConfiguratorGame,"with", str(self.hudConfiguratorRows), "rows and", str(self.hudConfiguratorColumns), "columns" + diaSelections.destroy() + + #TODO: bring up dialogue to actually select stats + #TODO: show explanation of what each stat means + self.release_global_lock() + #end def diaHudConfigurator + + def hudConfiguratorComboSelection(self, widget): + result=widget.get_active_text() + if result.endswith(" rows"): + self.hudConfiguratorRows=int(result[0]) + elif result.endswith(" columns"): + self.hudConfiguratorColumns=int(result[0]) + else: + self.hudConfiguratorGame=result + #end def hudConfiguratorComboSelection + def dia_dump_db(self, widget, data=None): self.db.dumpDatabase("database-dump.sql") #end def dia_database_stats @@ -640,6 +696,7 @@ class fpdb: