ChristianLowe / Grognaks-Mod-Manager

GMM allows users to easily install mods for the game FTL: Faster Than Light.
GNU General Public License v3.0
20 stars 7 forks source link

Patch to mostly fix blank on Mac #15

Closed sandymac closed 11 years ago

sandymac commented 11 years ago

This patch (sorry I don't speak git/github yet) mostly fixes my issue with GMM on my Mac. I get a blank window and the root.withdraw() and root.deiconify() lines hide/show windows as need so this isn't an issue. This blank window is most annoying because it's not apparent you have to close this window for GMM to actually work once you click the Patch button. This blank window still shows up at GMM exit with the patching completed successfully but it doesn't get in the way of patching there and the root.withdraw() method doesn't work for me.

--- main.py (revision b40ac4078ff7adf4b3975897ade43ab400794805)
+++ main.py (revision )
@@ -416,6 +416,8 @@

 allowzip = cfg.getboolean("settings", "allowzip")

+root = Tk() # Moved from below because it's needed for Darwin
+
 # Verify that the user put GMM in the right location
 if platform.system() == "Windows":
     if not os.path.isfile(os.path.join(dir_root, "FTLGame.exe")):
@@ -426,7 +428,9 @@
         msgbox.showerror(progname, "Grognak's Mod Manager must be located directly above the FTL folder")
         sys.exit(0)
 elif platform.system() == "Darwin":
+    root.withdraw()  # hide the blank window on Mac that holds things up.
     steam = msgbox.askyesno(progname, "Did you purchase FTL through Steam?")
+    root.deiconify() # undo hide of blank windows on Mac
     if steam == True:
         dir_res = os.path.join(os.environ['HOME'], 'Library/Application Support/Steam/SteamApps/common/FTL Faster Than Light/FTL.app/Contents/Resources')
     if steam == False or steam == None:
@@ -496,7 +500,7 @@
     modname_list = [word[:-4] for word in modorder_read]

 # Start the GUI
-root = Tk()
+#root = Tk() # Moved up above GMM in right place prompts.
 root.resizable(False, False)
 root.wm_title(progname)
 MainWindow(root)
pcg79 commented 11 years ago

+1 this. +1 this a hundred times (is that just +100?). I read through dozens of pages on the forums. I learned some python so I could do some debugging. I installed three different versions of python. All to fix this problem. I'm so glad I found this submission. Thank you!

Additionally, I can confirm that it fixes the problem.

For the record, the best way to submit a patch via Github is to fork the repo, make the change on your repo in a new branch, commit it, push the branch to your github repo, then come to this repo and click the "Pull Request" button. On the screen that appears you'll be able to choose your repo and branch on the right. Then submit it.

https://help.github.com/articles/using-pull-requests

ChristianLowe commented 11 years ago

If not fixed in 1.6, please make a new pull request.