From f94ad0126ad6d912e72ea81562f8aa7603b01d1f Mon Sep 17 00:00:00 2001 From: Eric Blade Date: Sat, 27 Nov 2010 19:16:15 -0500 Subject: [PATCH] add --xloc and --yloc options for specifying where to start windows at --- pyfpdb/HUD_main.pyw | 6 ++++++ pyfpdb/Options.py | 4 ++++ pyfpdb/fpdb.pyw | 10 ++++++++-- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/pyfpdb/HUD_main.pyw b/pyfpdb/HUD_main.pyw index 54484c45..098ff57a 100755 --- a/pyfpdb/HUD_main.pyw +++ b/pyfpdb/HUD_main.pyw @@ -102,6 +102,12 @@ class HUD_main(object): # a main window self.main_window = gtk.Window() + if options.xloc is not None or options.yloc is not None: + if options.xloc is None: + options.xloc = 0 + if options.yloc is None: + options.yloc = 0 + self.main_window.move(options.xloc,options.yloc) self.main_window.connect("client_moved", self.client_moved) self.main_window.connect("client_resized", self.client_resized) self.main_window.connect("client_destroyed", self.client_destroyed) diff --git a/pyfpdb/Options.py b/pyfpdb/Options.py index b8be3d2a..d66675c5 100644 --- a/pyfpdb/Options.py +++ b/pyfpdb/Options.py @@ -59,6 +59,10 @@ def fpdb_options(): help=_("File to be split is a PokerStars or Full Tilt Poker archive file")) parser.add_option("-n", "--numhands", dest="hands", default="100", type="int", help=_("How many hands do you want saved to each file. Default is 100")) + parser.add_option("--xloc", dest="xloc", default=None, type="int", + help=_("X location to open window")) + parser.add_option("--yloc", dest="yloc", default=None, type="int", + help=_("Y location to open Window")) (options, argv) = parser.parse_args() diff --git a/pyfpdb/fpdb.pyw b/pyfpdb/fpdb.pyw index 3660dd57..0135aa26 100755 --- a/pyfpdb/fpdb.pyw +++ b/pyfpdb/fpdb.pyw @@ -14,7 +14,6 @@ #You should have received a copy of the GNU Affero General Public License #along with this program. If not, see . #In the "official" distribution you can find the license in agpl-3.0.txt. - import L10n _ = L10n.get_translation() @@ -1097,6 +1096,13 @@ You can find the full license texts in agpl-3.0.txt, gpl-2.0.txt, gpl-3.0.txt an self.visible = False self.window = gtk.Window(gtk.WINDOW_TOPLEVEL) + if options.xloc is not None or options.yloc is not None: + if options.xloc is None: + options.xloc = 0 + if options.yloc is None: + options.yloc = 0 + self.window.move(options.xloc,options.yloc) + self.window.connect("delete_event", self.delete_event) self.window.connect("destroy", self.destroy) self.window.set_title("Free Poker DB - v%s" % (VERSION, )) @@ -1148,7 +1154,7 @@ You can find the full license texts in agpl-3.0.txt, gpl-2.0.txt, gpl-3.0.txt an cards = os.path.join(os.getcwd(), '..','gfx','fpdb-cards.png') if os.path.exists(cards): self.statusIcon.set_from_file(cards) - self.window.set_icon_from_file(cards) + self.window.set_icon_from_file(cards) elif os.path.exists('/usr/share/pixmaps/fpdb-cards.png'): self.statusIcon.set_from_file('/usr/share/pixmaps/fpdb-cards.png') self.window.set_icon_from_file('/usr/share/pixmaps/fpdb-cards.png')