Skip to content

Commit

Permalink
Minor GUI fixes, + PyInstaller spec
Browse files Browse the repository at this point in the history
Save As dialog defaults (yay), auto splitting window correct size on loading new files.
  • Loading branch information
danthedeckie authored Apr 10, 2019
1 parent 585e99d commit 6d9f013
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 2 deletions.
37 changes: 37 additions & 0 deletions QLC-file-ferret.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# -*- mode: python -*-

block_cipher = None


a = Analysis(['gui.py'],
pathex=['I:\\Public Ministries\\AV Team\\07 - Projects\\2019 - DF - QLC File Fixer'],
binaries=[],
datas=[('icons\\', 'icons')],
hiddenimports=[],
hookspath=[],
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False)
pyz = PYZ(a.pure, a.zipped_data,
cipher=block_cipher)
exe = EXE(pyz,
a.scripts,
[],
exclude_binaries=True,
name='QLC-file-ferret',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
onefile=True,
console=False )
coll = COLLECT(exe,
a.binaries,
a.zipfiles,
a.datas,
strip=False,
upx=True,
name='QLC-file-ferret')
21 changes: 19 additions & 2 deletions gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
########

import sys
from os.path import basename, abspath, dirname, join as joindir
from os.path import basename, abspath, dirname, join as joindir, splitext

import tkinter as tk
import tkinter.ttk as ttk
Expand Down Expand Up @@ -94,8 +94,16 @@ def create_widgets(self):
self.toolbar.pack(fill=tk.BOTH, expand=1)

def save_as(self):
oldpath = abspath(self.filename)
base, extn = splitext(basename(oldpath))
new_default_name = base + '_modified' + extn
filename = asksaveasfile(
filetypes=[("QLC+ File", '*.qxw')]
title="Save File as",
defaultextension=".qxf",
initialdir=dirname(oldpath),
initialfile=new_default_name,
filetypes=[("QLC+ File", '*.qxw')],

)

if not filename: return
Expand All @@ -104,6 +112,7 @@ def save_as(self):

self.qfile.write(filename)
self.filename = filename
self.filenameText.set(basename(self.filename))
self.update_treeview()

def load_file(self):
Expand Down Expand Up @@ -223,6 +232,14 @@ def load_file(self, filename=None):
x = QLCFileBox(self.filesArea, filename)
self.filesArea.add(x, minsize=100)

# resize all panes:

panes = self.filesArea.panes()
panesize = self.filesArea.winfo_width() / len(panes)
for pane in panes:
self.filesArea.paneconfigure(pane, width = panesize)



if __name__ == '__main__':
app = Application()
Expand Down

0 comments on commit 6d9f013

Please sign in to comment.