add --xloc and --yloc options for specifying where to start windows at

This commit is contained in:
Eric Blade 2010-11-27 19:16:15 -05:00
parent 2990e5856d
commit f94ad0126a
3 changed files with 18 additions and 2 deletions

View File

@ -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)

View File

@ -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()

View File

@ -14,7 +14,6 @@
#You should have received a copy of the GNU Affero General Public License
#along with this program. If not, see <http://www.gnu.org/licenses/>.
#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')