1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-06-01 08:01:22 +03:00

Merge branch 'rel153'

This commit is contained in:
Jonathan Harris 2015-07-02 16:46:37 +01:00
commit e4e12509ae
5 changed files with 42 additions and 19 deletions

View File

@ -44,7 +44,7 @@ class AppWindow:
elif platform == 'linux2':
from PIL import Image, ImageTk
icon = ImageTk.PhotoImage(Image.open("EDMarketConnector.png"))
root.tk.call('wm', 'iconphoto', root, '-default', icon)
self.w.tk.call('wm', 'iconphoto', self.w, '-default', icon)
style = ttk.Style()
style.theme_use('clam')
@ -79,18 +79,18 @@ class AppWindow:
from Foundation import NSBundle
# https://www.tcl.tk/man/tcl/TkCmd/menu.htm
apple_menu = tk.Menu(menubar, name='apple')
apple_menu.add_command(label="About %s" % applongname, command=lambda:root.call('tk::mac::standardAboutPanel'))
apple_menu.add_command(label="About %s" % applongname, command=lambda:self.w.call('tk::mac::standardAboutPanel'))
apple_menu.add_command(label="Statistics", command=lambda:stats.StatsDialog(self.w, self.session))
apple_menu.add_command(label="Check for Update", command=lambda:self.updater.checkForUpdates())
menubar.add_cascade(menu=apple_menu)
window_menu = tk.Menu(menubar, name='window')
menubar.add_cascade(menu=window_menu)
# https://www.tcl.tk/man/tcl/TkCmd/tk_mac.htm
root.createcommand('tkAboutDialog', lambda:root.call('tk::mac::standardAboutPanel'))
root.createcommand("::tk::mac::Quit", self.onexit)
root.createcommand("::tk::mac::ShowPreferences", lambda:prefs.PreferencesDialog(self.w, self.login))
root.createcommand("::tk::mac::ReopenApplication", self.w.deiconify) # click on app in dock = restore
root.protocol("WM_DELETE_WINDOW", self.w.withdraw) # close button shouldn't quit app
self.w.createcommand('tkAboutDialog', lambda:self.w.call('tk::mac::standardAboutPanel'))
self.w.createcommand("::tk::mac::Quit", self.onexit)
self.w.createcommand("::tk::mac::ShowPreferences", lambda:prefs.PreferencesDialog(self.w, self.login))
self.w.createcommand("::tk::mac::ReopenApplication", self.w.deiconify) # click on app in dock = restore
self.w.protocol("WM_DELETE_WINDOW", self.w.withdraw) # close button shouldn't quit app
else:
file_menu = tk.Menu(menubar, tearoff=tk.FALSE)
file_menu.add_command(label="Statistics", command=lambda:stats.StatsDialog(self.w, self.session))
@ -99,7 +99,7 @@ class AppWindow:
file_menu.add_separator()
file_menu.add_command(label="Exit", command=self.onexit)
menubar.add_cascade(label="File", menu=file_menu)
root.protocol("WM_DELETE_WINDOW", self.onexit)
self.w.protocol("WM_DELETE_WINDOW", self.onexit)
if platform == 'linux2':
# Fix up menu to use same styling as everything else
(fg, bg, afg, abg) = (style.lookup('TLabel.label', 'foreground'),
@ -130,8 +130,8 @@ class AppWindow:
# Load updater after UI creation (for WinSparkle)
import update
self.updater = update.Updater(master)
master.bind_all('<<Quit>>', self.onexit) # user-generated
self.updater = update.Updater(self.w)
self.w.bind_all('<<Quit>>', self.onexit) # user-generated
# call after credentials have changed
@ -283,14 +283,8 @@ class AppWindow:
self.w.destroy()
# Run the app
if __name__ == "__main__":
if platform=='win32' and getattr(sys, 'frozen', False):
# By deault py2exe tries to write log to dirname(sys.executable) which fails when installed
import tempfile
sys.stderr = open(join(tempfile.gettempdir(), '%s.log' % appname), 'wt')
# Run the app
root = tk.Tk()
app = AppWindow(root)
root.mainloop()

View File

@ -280,6 +280,9 @@
<Component Id="cmpB252953A880253445EC0750D45BA4D2C" Guid="{54AD42EB-7305-45AA-953C-574921E90BAD}">
<File Id="fil5AA8155AC7EEAAB8D968EBD6C1D3DC74" KeyPath="yes" Source="SourceDir\tcl\tk8.5\ttk\sizegrip.tcl" />
</Component>
<Component Id="cmp9096943773180E24A57FAD7CA2663824" Guid="{F4A91FAD-5F8D-4007-B38E-2C706E87770B}">
<File Id="fil3E357787A95782E83591AD92D55452ED" KeyPath="yes" Source="SourceDir\tcl\tk8.5\ttk\spinbox.tcl" />
</Component>
<Component Id="cmpB298804A0993E19DC88246355CE928A1" Guid="{FC12F75C-6EF1-4AD5-BF60-55FC5E825605}">
<File Id="fil0AB9EE0CDCE3DE7BED31362ACB334CBA" KeyPath="yes" Source="SourceDir\tcl\tk8.5\ttk\treeview.tcl" />
</Component>
@ -289,6 +292,9 @@
<Component Id="cmp624ACFB58835F0C5EE70B6105D4A8C56" Guid="{D5534AC6-9A1B-4CE3-90E1-6B65D4FF86D6}">
<File Id="fil7057BBCBE2529C32CB6C0FF7A6A7B0EA" KeyPath="yes" Source="SourceDir\tcl\tk8.5\ttk\utils.tcl" />
</Component>
<Component Id="cmpD0643360E94197D8971CA1D6A7B81B5C" Guid="{198ADB32-56DD-4F29-B862-817DD6E92ECA}">
<File Id="filC1C9FD16B862068CBEEA8FE8C06864C7" KeyPath="yes" Source="SourceDir\tcl\tk8.5\ttk\vistaTheme.tcl" />
</Component>
<Component Id="cmpE2DB8F0A511E57F996B803AF1589A0D4" Guid="{92589FA4-E08B-4E45-856E-F266D6290E2A}">
<File Id="fil5D32585BD4F73F8D01539B1B8CEFEFB7" KeyPath="yes" Source="SourceDir\tcl\tk8.5\ttk\winTheme.tcl" />
</Component>
@ -384,9 +390,11 @@
<ComponentRef Id="cmp6F0C4A275C34B4CBF470061C49F48A62" />
<ComponentRef Id="cmp04E5FE0E0D39B434CD72E5668C8EA233" />
<ComponentRef Id="cmpB252953A880253445EC0750D45BA4D2C" />
<ComponentRef Id="cmp9096943773180E24A57FAD7CA2663824" />
<ComponentRef Id="cmpB298804A0993E19DC88246355CE928A1" />
<ComponentRef Id="cmp57DB57AE30ADD8A61D4FFFE148B291D7" />
<ComponentRef Id="cmp624ACFB58835F0C5EE70B6105D4A8C56" />
<ComponentRef Id="cmpD0643360E94197D8971CA1D6A7B81B5C" />
<ComponentRef Id="cmpE2DB8F0A511E57F996B803AF1589A0D4" />
<ComponentRef Id="cmp34D56605EFC92708697DA79019DC398C" />
</Feature>

View File

@ -6,7 +6,7 @@ from sys import platform
appname = 'EDMarketConnector'
applongname = 'E:D Market Connector'
appversion = '1.5.2.0'
appversion = '1.5.3.0'
if platform=='darwin':

View File

@ -95,7 +95,8 @@ setup(
name = APPLONGNAME,
version = VERSION,
app = [APP],
windows = [ {'script': APP,
windows = [ {'dest_base': APPNAME,
'script': 'winlauncher.py',
'icon_resources': [(0, '%s.ico' % APPNAME)],
'copyright': u'© 2015 Jonathan Harris',
'name': APPNAME, # WinSparkle

20
winlauncher.py Normal file
View File

@ -0,0 +1,20 @@
#!/usr/bin/python
#
# Launcher when running py2exe
import sys
getattr(sys, 'frozen') # Only intended to be run under py2exe
# By deault py2exe tries to write log to dirname(sys.executable) which fails when installed
from os.path import join
import tempfile
from config import appname
sys.stderr = open(join(tempfile.gettempdir(), '%s.log' % appname), 'wt')
import Tkinter as tk
from EDMarketConnector import AppWindow
# Run the app
root = tk.Tk()
app = AppWindow(root)
root.mainloop()