7
7
import tkinter
8
8
from tkinter import messagebox
9
9
from tkinter import filedialog
10
+ import tkinter .ttk
10
11
import os
11
12
import platform
12
13
import sys
@@ -87,7 +88,12 @@ def un7zipper(_7za, zipfile, destination):
87
88
88
89
89
90
def start ():
90
- outputBox .delete (0 , tkinter .END )
91
+
92
+ #Clear outputBox
93
+ outputBox .configure (state = 'normal' )
94
+ outputBox .delete ('1.0' , tkinter .END )
95
+ outputBox .configure (state = 'disabled' )
96
+
91
97
sysname = platform .system ()
92
98
#Locate 7z binary
93
99
_7za = os .path .join (sysname , '7za' )
@@ -127,10 +133,7 @@ def start():
127
133
return
128
134
print ("7-Zip found!" )
129
135
130
- #Clear outputBox
131
- outputBox .configure (state = 'normal' )
132
- outputBox .delete ('1.0' , tkinter .END )
133
- outputBox .configure (state = 'disabled' )
136
+
134
137
135
138
#Variables
136
139
directory = SDentry .get ()
@@ -182,6 +185,9 @@ def start():
182
185
shutil .copy (cwdtemp + "DSi&3DS - SD card users/_nds/nds-bootstrap-hb-nightly.nds" , directory + "/_nds" )
183
186
shutil .copy (cwdtemp + "DSi&3DS - SD card users/_nds/nds-bootstrap-hb-release.nds" , directory + "/_nds" )
184
187
Path (directory + "/roms/" ).mkdir (parents = True ,exist_ok = True )
188
+ #Some Homebrew write to the _nds folder so it is better to clear it first
189
+ shutil .rmtree (cwdtemp + "_nds/" )
190
+ Path (cwdtemp + "_nds/" ).mkdir (parents = True ,exist_ok = True )
185
191
186
192
print ("TWiLight Menu ++ placed in" , directory )
187
193
outputbox ("TWiLight Menu ++ placed " )
@@ -208,9 +214,7 @@ def start():
208
214
#Extract Unlaunch
209
215
unzipper (unlaunchLocation ,directory )
210
216
211
- #Some Homebrew write to the _nds folder so it is better to clear it first
212
- shutil .rmtree (cwdtemp + "_nds/" )
213
- Path (cwdtemp + "_nds/" ).mkdir (parents = True ,exist_ok = True )
217
+
214
218
215
219
#Creates roms/nds if it does not exist
216
220
roms = directory + "/roms/nds/"
@@ -240,7 +244,8 @@ def start():
240
244
else :
241
245
un7zipper (_7za , downloadLocation , cwdtemp )
242
246
if "root" in item ["location" ]:
243
- distutils .dir_util .copy_tree (cwdtemp + item ["location" ]["root" ],directory + "/" + item ["location" ]["root" ])
247
+ Path (directory + (item ["location" ]["root" ].split ('/' )).pop ()).mkdir (parents = True ,exist_ok = True )
248
+ shutil .copy (cwdtemp + item ["location" ]["root" ],directory + ((item ["location" ]["root" ].split ('/' )).pop ().pop (0 )))
244
249
if "roms" in item ["location" ]:
245
250
shutil .copy (cwdtemp + item ["location" ]["roms" ],roms )
246
251
@@ -271,13 +276,31 @@ def extraHomebrew():
271
276
homebrewWindowLabel2 = tkinter .Label (homebrewWindow , text = "Select additional homebrew for download then press OK" )
272
277
homebrewWindowLabel2 .pack (anchor = "w" )
273
278
279
+ vscrollbar = tkinter .Scrollbar (homebrewWindow )
280
+ canvas = tkinter .Canvas (homebrewWindow , yscrollcommand = vscrollbar .set )
281
+ vscrollbar .config (command = canvas .yview )
282
+ vscrollbar .pack (side = tkinter .RIGHT , fill = tkinter .Y )
283
+
284
+ homebrewFrame = tkinter .Frame (canvas )
285
+ homebrewWindow .title ("Homebrew List" )
286
+ homebrewWindow .resizable (0 ,0 )
287
+ canvas .pack (side = "left" , fill = "both" , expand = True )
288
+ canvas .create_window (0 ,0 , window = homebrewFrame , anchor = "n" )
274
289
for count , x in enumerate (homebrewDB ):
275
- l = tkinter .Checkbutton (homebrewWindow , text = x ["title" ], variable = homebrewList [count ])
290
+ l = tkinter .Checkbutton (homebrewFrame , text = x ["title" ] + " by " + x [ "author " ], variable = homebrewList [count ])
276
291
l .pack (anchor = "w" )
292
+
293
+ frame = tkinter .ttk .Frame (homebrewWindow , relief = tkinter .RAISED , borderwidth = 1 )
294
+ frame .pack (fill = tkinter .BOTH , expand = True )
277
295
278
296
okButton = tkinter .Button (homebrewWindow , text = "OK" , font = ("Verdana" ,12 ,"bold" ), command = lambda :okButtonPress (homebrewWindow ))
279
- okButton .pack ()
297
+ okButton .pack (side = tkinter .RIGHT , padx = 5 , pady = 5 )
298
+ homebrewWindow .update ()
299
+ canvas .config (scrollregion = canvas .bbox ("all" ))
300
+
280
301
homebrewWindow .protocol ("WM_DELETE_WINDOW" ,lambda :okButtonPress (homebrewWindow ))
302
+
303
+
281
304
282
305
283
306
if (sys .version_info .major < 3 ):
0 commit comments