~brenthuisman/par2deep

1fd422224863ac0b4ca9a49a7266f40c0ff563ac — Brent Huisman 1 year, 10 months ago 42105c5
partial implementation: contextmenu to change actions per file
12 files changed, 5 insertions(+), 117 deletions(-)

M .gitignore -rwxr-xr-x => -rw-r--r--
M LICENSE -rwxr-xr-x => -rw-r--r--
M README.md -rwxr-xr-x => -rw-r--r--
D par2deep.nsi
M par2deep/__init__.py -rwxr-xr-x => -rw-r--r--
M par2deep/__main__.py -rwxr-xr-x => -rw-r--r--
M par2deep/ask_yn.py -rwxr-xr-x => -rw-r--r--
M par2deep/cli.py -rwxr-xr-x => -rw-r--r--
M par2deep/gui.py -rwxr-xr-x => -rw-r--r--
M par2deep/par2deep.py -rwxr-xr-x => -rw-r--r--
M setup.py -rwxr-xr-x => -rw-r--r--
M setup_cx.py -rwxr-xr-x => -rw-r--r--
M .gitignore => .gitignore +0 -0

M LICENSE => LICENSE +0 -0

M README.md => README.md +0 -0

D par2deep.nsi => par2deep.nsi +0 -109
@@ 1,109 0,0 @@
;Get NSIS. Get winpython (zero). Install par2deep into Winpython. Compile par2deep.nsi.

!define AppName "par2deep"
!define AppAbb "par2deep"
SetCompressor LZMA

;--------------------------------
;Include Modern UI

  !include "MUI2.nsh"

;--------------------------------
;General

  ;Name and file
  Name "${AppName}"
  BrandingText "${AppName}"
  OutFile "${AppAbb}.exe"

  ;Default installation folder
  InstallDir "$PROGRAMFILES\${AppAbb}"

  ;Get installation folder from registry if available
  ;InstallDirRegKey HKCU "Software\${AppAbb}" ""

  ;Request application privileges for Windows Vista
  RequestExecutionLevel admin

;--------------------------------
;Interface Settings

  !define MUI_ABORTWARNING

  !define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\orange-install.ico"
  !define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\orange-uninstall.ico"
   
  ; MUI Settings / Header
  !define MUI_HEADERIMAGE
  !define MUI_HEADERIMAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Header\orange.bmp"
  !define MUI_HEADERIMAGE_UNBITMAP "${NSISDIR}\Contrib\Graphics\Header\orange-uninstall.bmp"
   
  ; MUI Settings / Wizard
  !define MUI_WELCOMEFINISHPAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Wizard\orange.bmp"
  !define MUI_UNWELCOMEFINISHPAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Wizard\orange-uninstall.bmp"

;--------------------------------
;Pages

  !insertmacro MUI_PAGE_WELCOME
  !insertmacro MUI_PAGE_DIRECTORY
  !insertmacro MUI_PAGE_INSTFILES
  !define MUI_FINISHPAGE_RUN "$INSTDIR\pythonw.exe"
  !define MUI_FINISHPAGE_RUN_PARAMETERS "$\"$INSTDIR\Scripts\par2deep-script.py$\""
  !insertmacro MUI_PAGE_FINISH
  
  !insertmacro MUI_UNPAGE_CONFIRM
  !insertmacro MUI_UNPAGE_INSTFILES
  
;--------------------------------
;Languages
 
  !insertmacro MUI_LANGUAGE "Dutch"
  !insertmacro MUI_LANGUAGE "English"

;--------------------------------
;Installer Sections

Section "Dummy Section" SecDummy

  SetOutPath "$INSTDIR"
  
  ;ADD YOUR OWN FILES HERE...
  File /r d:\par2deep\*.*

  ;Create shortcuts
  CreateDirectory "$SMPROGRAMS"
  CreateShortCut "$SMPROGRAMS\${AppName}.lnk" "$INSTDIR\pythonw.exe" "$\"$INSTDIR\Scripts\par2deep-script.py$\""
  CreateShortCut "$DESKTOP\${AppName}.lnk" "$INSTDIR\pythonw.exe" "$\"$INSTDIR\Scripts\par2deep-script.py$\""

  ;Store installation folder
  WriteRegStr HKCU "Software\${AppAbb}" "" $INSTDIR
  
  ;Create uninstaller
  WriteUninstaller "$INSTDIR\Uninstall.exe"

  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${AppAbb}" "DisplayName" "${AppName}"
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${AppAbb}" "UninstallString" "$\"$INSTDIR\Uninstall.exe$\""
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${AppAbb}" "InstallLocation" "$\"$INSTDIR$\""

SectionEnd

;--------------------------------
;Uninstaller Section

Section "Uninstall"

  ;ADD YOUR OWN FILES HERE...

  Delete "$INSTDIR\Uninstall.exe"

  RMDir /r "$INSTDIR"

  delete "$SMPROGRAMS\${AppName}.lnk"
  delete "$DESKTOP\${AppName}.lnk"

  DeleteRegKey /ifempty HKCU "Software\${AppAbb}"
  DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${AppAbb}"

SectionEnd

M par2deep/__init__.py => par2deep/__init__.py +0 -0

M par2deep/__main__.py => par2deep/__main__.py +0 -0

M par2deep/ask_yn.py => par2deep/ask_yn.py +0 -0

M par2deep/cli.py => par2deep/cli.py +0 -0

M par2deep/gui.py => par2deep/gui.py +5 -8
@@ 442,22 442,19 @@ class app_frame(Frame):
			self.startfile(tree.item(tree.selection()[0],"values")[0])
			return

		def do_popup(event):
		def show_contextmenu(event):
			print (tree.selection())
			popup = Menu(self.master, tearoff=0)
			popup.add_command(label="Next") # , command=next) etc...
			popup.add_command(label="Previous")
			popup.add_separator()
			popup.add_command(label="Home")
			# display the popup menu
			for node,label in nodes.items():
				popup.add_command(label=node)
			try:
				popup.tk_popup(event.x_root, event.y_root, 0)
				popup.tk_popup(event.x_root, event.y_root)
			finally:
				# make sure to release the grab (Tk 8.0a1 only)
				popup.grab_release()

		tree.bind("<Double-1>", doubleclick_tree)
		tree.bind("<Button-3>", do_popup)
		tree.bind("<Button-3>", show_contextmenu)

		for node,label in nodes.items():
			if len(getattr(self.p2d,node))==0:

M par2deep/par2deep.py => par2deep/par2deep.py +0 -0

M setup.py => setup.py +0 -0

M setup_cx.py => setup_cx.py +0 -0