From db877ba121ff87a4e029daf8555d85dfef45993a Mon Sep 17 00:00:00 2001 From: Petr Mrázek Date: Mon, 9 Feb 2015 01:51:14 +0100 Subject: NOISSUE move everything. --- BuildConfig.cpp.in | 56 - BuildConfig.h | 63 - CMakeLists.txt | 784 +------- MMCError.h | 25 - MultiMC.cpp | 633 ------ MultiMC.h | 188 -- application/BuildConfig.cpp.in | 56 + application/BuildConfig.h | 63 + application/CMakeLists.txt | 473 +++++ application/ColumnResizer.cpp | 202 ++ application/ColumnResizer.h | 38 + application/ConsoleWindow.cpp | 260 +++ application/ConsoleWindow.h | 65 + application/GuiUtil.cpp | 48 + application/GuiUtil.h | 9 + application/InstancePageProvider.cpp | 0 application/InstancePageProvider.h | 52 + application/InstanceProxyModel.cpp | 23 + application/InstanceProxyModel.h | 13 + application/MainWindow.cpp | 2069 ++++++++++++++++++++ application/MainWindow.h | 218 +++ application/MultiMC.cpp | 632 ++++++ application/MultiMC.h | 188 ++ application/NagUtils.cpp | 38 + application/NagUtils.h | 23 + application/Platform.h | 32 + application/Platform_Other.cpp | 27 + application/Platform_X11.cpp | 62 + application/dialogs/AboutDialog.cpp | 127 ++ application/dialogs/AboutDialog.h | 47 + application/dialogs/AboutDialog.ui | 544 +++++ application/dialogs/AccountSelectDialog.cpp | 85 + application/dialogs/AccountSelectDialog.h | 90 + application/dialogs/AccountSelectDialog.ui | 56 + application/dialogs/CopyInstanceDialog.cpp | 101 + application/dialogs/CopyInstanceDialog.h | 52 + application/dialogs/CopyInstanceDialog.ui | 161 ++ application/dialogs/CustomMessageBox.cpp | 35 + application/dialogs/CustomMessageBox.h | 26 + application/dialogs/EditAccountDialog.cpp | 51 + application/dialogs/EditAccountDialog.h | 60 + application/dialogs/EditAccountDialog.ui | 94 + application/dialogs/IconPickerDialog.cpp | 156 ++ application/dialogs/IconPickerDialog.h | 48 + application/dialogs/IconPickerDialog.ui | 67 + application/dialogs/LoginDialog.cpp | 110 ++ application/dialogs/LoginDialog.h | 58 + application/dialogs/LoginDialog.ui | 77 + application/dialogs/ModEditDialogCommon.cpp | 40 + application/dialogs/ModEditDialogCommon.h | 9 + application/dialogs/NewInstanceDialog.cpp | 207 ++ application/dialogs/NewInstanceDialog.h | 59 + application/dialogs/NewInstanceDialog.ui | 309 +++ application/dialogs/NotificationDialog.cpp | 84 + application/dialogs/NotificationDialog.h | 44 + application/dialogs/NotificationDialog.ui | 85 + application/dialogs/ProgressDialog.cpp | 125 ++ application/dialogs/ProgressDialog.h | 65 + application/dialogs/ProgressDialog.ui | 66 + application/dialogs/UpdateDialog.cpp | 186 ++ application/dialogs/UpdateDialog.h | 61 + application/dialogs/UpdateDialog.ui | 106 + application/dialogs/VersionSelectDialog.cpp | 177 ++ application/dialogs/VersionSelectDialog.h | 66 + application/dialogs/VersionSelectDialog.ui | 110 ++ application/groupview/GroupView.cpp | 1003 ++++++++++ application/groupview/GroupView.h | 125 ++ application/groupview/GroupedProxyModel.cpp | 42 + application/groupview/GroupedProxyModel.h | 15 + application/groupview/InstanceDelegate.cpp | 362 ++++ application/groupview/InstanceDelegate.h | 35 + application/groupview/VisualGroup.cpp | 301 +++ application/groupview/VisualGroup.h | 91 + application/install_prereqs.cmake.in | 24 + application/main.cpp | 43 + application/package/linux/MultiMC | 80 + application/pagedialog/PageDialog.cpp | 62 + application/pagedialog/PageDialog.h | 36 + application/pages/BasePage.h | 38 + application/pages/BasePageProvider.h | 69 + application/pages/InstanceSettingsPage.cpp | 216 ++ application/pages/InstanceSettingsPage.h | 74 + application/pages/InstanceSettingsPage.ui | 453 +++++ application/pages/LogPage.cpp | 222 +++ application/pages/LogPage.h | 86 + application/pages/LogPage.ui | 140 ++ application/pages/ModFolderPage.cpp | 160 ++ application/pages/ModFolderPage.h | 94 + application/pages/ModFolderPage.ui | 124 ++ application/pages/NotesPage.cpp | 21 + application/pages/NotesPage.h | 61 + application/pages/NotesPage.ui | 60 + application/pages/OtherLogsPage.cpp | 150 ++ application/pages/OtherLogsPage.h | 72 + application/pages/OtherLogsPage.ui | 117 ++ application/pages/ResourcePackPage.h | 19 + application/pages/ScreenshotsPage.cpp | 362 ++++ application/pages/ScreenshotsPage.h | 79 + application/pages/ScreenshotsPage.ui | 109 ++ application/pages/TexturePackPage.h | 17 + application/pages/VersionPage.cpp | 321 +++ application/pages/VersionPage.h | 80 + application/pages/VersionPage.ui | 204 ++ application/pages/global/AccountListPage.cpp | 142 ++ application/pages/global/AccountListPage.h | 86 + application/pages/global/AccountListPage.ui | 115 ++ application/pages/global/ExternalToolsPage.cpp | 238 +++ application/pages/global/ExternalToolsPage.h | 74 + application/pages/global/ExternalToolsPage.ui | 197 ++ application/pages/global/JavaPage.cpp | 146 ++ application/pages/global/JavaPage.h | 73 + application/pages/global/JavaPage.ui | 303 +++ application/pages/global/MinecraftPage.cpp | 92 + application/pages/global/MinecraftPage.h | 70 + application/pages/global/MinecraftPage.ui | 148 ++ application/pages/global/MultiMCPage.cpp | 459 +++++ application/pages/global/MultiMCPage.h | 100 + application/pages/global/MultiMCPage.ui | 532 +++++ application/pages/global/ProxyPage.cpp | 95 + application/pages/global/ProxyPage.h | 66 + application/pages/global/ProxyPage.ui | 197 ++ application/resources/MultiMC.icns | Bin 0 -> 437319 bytes application/resources/MultiMC.ico | Bin 0 -> 76126 bytes application/resources/MultiMC.manifest | 27 + application/resources/OSX/OSX.qrc | 35 + application/resources/OSX/index.theme | 11 + application/resources/OSX/scalable/about.svg | 20 + application/resources/OSX/scalable/accounts.svg | 16 + application/resources/OSX/scalable/bug.svg | 25 + application/resources/OSX/scalable/centralmods.svg | 16 + application/resources/OSX/scalable/checkupdate.svg | 22 + application/resources/OSX/scalable/copy.svg | 18 + application/resources/OSX/scalable/coremods.svg | 21 + .../resources/OSX/scalable/externaltools.svg | 14 + .../resources/OSX/scalable/instance-settings.svg | 25 + application/resources/OSX/scalable/jarmods.svg | 30 + application/resources/OSX/scalable/java.svg | 33 + application/resources/OSX/scalable/loadermods.svg | 14 + application/resources/OSX/scalable/log.svg | 19 + application/resources/OSX/scalable/minecraft.svg | 12 + application/resources/OSX/scalable/multimc.svg | 18 + application/resources/OSX/scalable/new.svg | 19 + application/resources/OSX/scalable/news.svg | 16 + application/resources/OSX/scalable/notes.svg | 21 + application/resources/OSX/scalable/patreon.svg | 15 + application/resources/OSX/scalable/proxy.svg | 16 + application/resources/OSX/scalable/quickmods.svg | 18 + application/resources/OSX/scalable/refresh.svg | 16 + .../resources/OSX/scalable/resourcepacks.svg | 17 + application/resources/OSX/scalable/screenshots.svg | 19 + application/resources/OSX/scalable/settings.svg | 25 + application/resources/OSX/scalable/status-bad.svg | 11 + application/resources/OSX/scalable/status-good.svg | 19 + .../resources/OSX/scalable/status-yellow.svg | 16 + application/resources/OSX/scalable/viewfolder.svg | 16 + application/resources/backgrounds/backgrounds.qrc | 6 + application/resources/backgrounds/catbgrnd2.png | Bin 0 -> 78285 bytes application/resources/iOS/iOS.qrc | 35 + application/resources/iOS/index.theme | 11 + application/resources/iOS/scalable/about.svg | 16 + application/resources/iOS/scalable/accounts.svg | 14 + application/resources/iOS/scalable/bug.svg | 22 + application/resources/iOS/scalable/centralmods.svg | 13 + application/resources/iOS/scalable/checkupdate.svg | 16 + application/resources/iOS/scalable/copy.svg | 13 + application/resources/iOS/scalable/coremods.svg | 18 + .../resources/iOS/scalable/externaltools.svg | 13 + .../resources/iOS/scalable/instance-settings.svg | 19 + application/resources/iOS/scalable/jarmods.svg | 31 + application/resources/iOS/scalable/java.svg | 33 + application/resources/iOS/scalable/loadermods.svg | 14 + application/resources/iOS/scalable/log.svg | 13 + application/resources/iOS/scalable/minecraft.svg | 8 + application/resources/iOS/scalable/multimc.svg | 13 + application/resources/iOS/scalable/new.svg | 13 + application/resources/iOS/scalable/news.svg | 14 + application/resources/iOS/scalable/notes.svg | 15 + application/resources/iOS/scalable/patreon.svg | 12 + application/resources/iOS/scalable/proxy.svg | 11 + application/resources/iOS/scalable/quickmods.svg | 14 + application/resources/iOS/scalable/refresh.svg | 13 + .../resources/iOS/scalable/resourcepacks.svg | 15 + application/resources/iOS/scalable/screenshots.svg | 14 + application/resources/iOS/scalable/settings.svg | 19 + application/resources/iOS/scalable/status-bad.svg | 10 + application/resources/iOS/scalable/status-good.svg | 18 + .../resources/iOS/scalable/status-yellow.svg | 56 + application/resources/iOS/scalable/viewfolder.svg | 12 + application/resources/instances/brick.png | Bin 0 -> 713 bytes application/resources/instances/broken.png | Bin 0 -> 1139 bytes application/resources/instances/chicken.png | Bin 0 -> 1181 bytes application/resources/instances/chicken128.png | Bin 0 -> 6369 bytes application/resources/instances/creeper.png | Bin 0 -> 1524 bytes application/resources/instances/creeper128.png | Bin 0 -> 9046 bytes application/resources/instances/derp.png | Bin 0 -> 5225 bytes application/resources/instances/diamond.png | Bin 0 -> 708 bytes application/resources/instances/dirt.png | Bin 0 -> 482 bytes application/resources/instances/enderman.png | Bin 0 -> 2429 bytes application/resources/instances/enderpearl.png | Bin 0 -> 2120 bytes application/resources/instances/enderpearl128.png | Bin 0 -> 21425 bytes application/resources/instances/ftb_glow.png | Bin 0 -> 1747 bytes application/resources/instances/ftb_glow128.png | Bin 0 -> 12708 bytes application/resources/instances/ftb_logo.png | Bin 0 -> 1607 bytes application/resources/instances/ftb_logo128.png | Bin 0 -> 7883 bytes application/resources/instances/gear.png | Bin 0 -> 2414 bytes application/resources/instances/gear128.png | Bin 0 -> 18321 bytes application/resources/instances/gold.png | Bin 0 -> 978 bytes application/resources/instances/grass.png | Bin 0 -> 618 bytes application/resources/instances/herobrine.png | Bin 0 -> 1034 bytes application/resources/instances/herobrine128.png | Bin 0 -> 4937 bytes application/resources/instances/infinity.png | Bin 0 -> 1714 bytes application/resources/instances/infinity128.png | Bin 0 -> 9237 bytes application/resources/instances/instances.qrc | 49 + application/resources/instances/iron.png | Bin 0 -> 532 bytes application/resources/instances/kitten.png | Bin 0 -> 1605 bytes application/resources/instances/magitech.png | Bin 0 -> 2646 bytes application/resources/instances/magitech128.png | Bin 0 -> 23097 bytes application/resources/instances/meat.png | Bin 0 -> 1514 bytes application/resources/instances/meat128.png | Bin 0 -> 10583 bytes application/resources/instances/netherstar.png | Bin 0 -> 1942 bytes application/resources/instances/netherstar128.png | Bin 0 -> 14062 bytes application/resources/instances/planks.png | Bin 0 -> 461 bytes application/resources/instances/skeleton.png | Bin 0 -> 696 bytes application/resources/instances/skeleton128.png | Bin 0 -> 3673 bytes application/resources/instances/squarecreeper.png | Bin 0 -> 1623 bytes .../resources/instances/squarecreeper128.png | Bin 0 -> 9136 bytes application/resources/instances/steve.png | Bin 0 -> 969 bytes application/resources/instances/steve128.png | Bin 0 -> 4312 bytes application/resources/instances/stone.png | Bin 0 -> 438 bytes application/resources/instances/tnt.png | Bin 0 -> 378 bytes .../resources/instances/updateavailable.png | Bin 0 -> 2480 bytes application/resources/multimc.rc | 29 + application/resources/multimc/16x16/about.png | Bin 0 -> 1270 bytes application/resources/multimc/16x16/bug.png | Bin 0 -> 734 bytes application/resources/multimc/16x16/cat.png | Bin 0 -> 736 bytes .../resources/multimc/16x16/centralmods.png | Bin 0 -> 1145 bytes .../resources/multimc/16x16/checkupdate.png | Bin 0 -> 1212 bytes application/resources/multimc/16x16/copy.png | Bin 0 -> 957 bytes application/resources/multimc/16x16/coremods.png | Bin 0 -> 702 bytes application/resources/multimc/16x16/help.png | Bin 0 -> 1297 bytes .../resources/multimc/16x16/instance-settings.png | Bin 0 -> 1410 bytes application/resources/multimc/16x16/jarmods.png | Bin 0 -> 693 bytes application/resources/multimc/16x16/loadermods.png | Bin 0 -> 731 bytes application/resources/multimc/16x16/log.png | Bin 0 -> 630 bytes application/resources/multimc/16x16/minecraft.png | Bin 0 -> 782 bytes application/resources/multimc/16x16/new.png | Bin 0 -> 1175 bytes application/resources/multimc/16x16/news.png | Bin 0 -> 727 bytes application/resources/multimc/16x16/noaccount.png | Bin 0 -> 334 bytes application/resources/multimc/16x16/patreon.png | Bin 0 -> 682 bytes application/resources/multimc/16x16/refresh.png | Bin 0 -> 931 bytes .../resources/multimc/16x16/resourcepacks.png | Bin 0 -> 1207 bytes .../resources/multimc/16x16/screenshots.png | Bin 0 -> 976 bytes application/resources/multimc/16x16/settings.png | Bin 0 -> 1410 bytes application/resources/multimc/16x16/status-bad.png | Bin 0 -> 643 bytes .../resources/multimc/16x16/status-good.png | Bin 0 -> 714 bytes .../resources/multimc/16x16/status-yellow.png | Bin 0 -> 590 bytes application/resources/multimc/16x16/viewfolder.png | Bin 0 -> 852 bytes application/resources/multimc/22x22/about.png | Bin 0 -> 1693 bytes application/resources/multimc/22x22/bug.png | Bin 0 -> 1180 bytes application/resources/multimc/22x22/cat.png | Bin 0 -> 1034 bytes .../resources/multimc/22x22/centralmods.png | Bin 0 -> 1561 bytes .../resources/multimc/22x22/checkupdate.png | Bin 0 -> 1635 bytes application/resources/multimc/22x22/copy.png | Bin 0 -> 1004 bytes application/resources/multimc/22x22/help.png | Bin 0 -> 1735 bytes .../resources/multimc/22x22/instance-settings.png | Bin 0 -> 1964 bytes application/resources/multimc/22x22/new.png | Bin 0 -> 1440 bytes application/resources/multimc/22x22/news.png | Bin 0 -> 1173 bytes application/resources/multimc/22x22/patreon.png | Bin 0 -> 976 bytes application/resources/multimc/22x22/refresh.png | Bin 0 -> 1283 bytes .../resources/multimc/22x22/screenshots.png | Bin 0 -> 1320 bytes application/resources/multimc/22x22/settings.png | Bin 0 -> 1964 bytes application/resources/multimc/22x22/status-bad.png | Bin 0 -> 968 bytes .../resources/multimc/22x22/status-good.png | Bin 0 -> 994 bytes .../resources/multimc/22x22/status-yellow.png | Bin 0 -> 803 bytes application/resources/multimc/22x22/viewfolder.png | Bin 0 -> 1006 bytes application/resources/multimc/24x24/cat.png | Bin 0 -> 1252 bytes application/resources/multimc/24x24/coremods.png | Bin 0 -> 1281 bytes application/resources/multimc/24x24/jarmods.png | Bin 0 -> 1170 bytes application/resources/multimc/24x24/loadermods.png | Bin 0 -> 1240 bytes application/resources/multimc/24x24/log.png | Bin 0 -> 1117 bytes application/resources/multimc/24x24/minecraft.png | Bin 0 -> 1500 bytes application/resources/multimc/24x24/noaccount.png | Bin 0 -> 344 bytes application/resources/multimc/24x24/patreon.png | Bin 0 -> 1034 bytes .../resources/multimc/24x24/resourcepacks.png | Bin 0 -> 2000 bytes application/resources/multimc/24x24/status-bad.png | Bin 0 -> 1102 bytes .../resources/multimc/24x24/status-good.png | Bin 0 -> 1066 bytes .../resources/multimc/24x24/status-yellow.png | Bin 0 -> 872 bytes .../resources/multimc/256x256/minecraft.png | Bin 0 -> 49869 bytes application/resources/multimc/32x32/about.png | Bin 0 -> 2658 bytes application/resources/multimc/32x32/bug.png | Bin 0 -> 1772 bytes application/resources/multimc/32x32/cat.png | Bin 0 -> 1678 bytes .../resources/multimc/32x32/centralmods.png | Bin 0 -> 2119 bytes .../resources/multimc/32x32/checkupdate.png | Bin 0 -> 2480 bytes application/resources/multimc/32x32/copy.png | Bin 0 -> 1401 bytes application/resources/multimc/32x32/coremods.png | Bin 0 -> 1758 bytes application/resources/multimc/32x32/help.png | Bin 0 -> 2720 bytes .../resources/multimc/32x32/instance-settings.png | Bin 0 -> 2983 bytes application/resources/multimc/32x32/jarmods.png | Bin 0 -> 1566 bytes application/resources/multimc/32x32/loadermods.png | Bin 0 -> 1708 bytes application/resources/multimc/32x32/log.png | Bin 0 -> 1460 bytes application/resources/multimc/32x32/minecraft.png | Bin 0 -> 2495 bytes application/resources/multimc/32x32/new.png | Bin 0 -> 1769 bytes application/resources/multimc/32x32/news.png | Bin 0 -> 1752 bytes application/resources/multimc/32x32/noaccount.png | Bin 0 -> 363 bytes application/resources/multimc/32x32/patreon.png | Bin 0 -> 1450 bytes application/resources/multimc/32x32/refresh.png | Bin 0 -> 2182 bytes .../resources/multimc/32x32/resourcepacks.png | Bin 0 -> 2818 bytes .../resources/multimc/32x32/screenshots.png | Bin 0 -> 1892 bytes application/resources/multimc/32x32/settings.png | Bin 0 -> 2983 bytes application/resources/multimc/32x32/status-bad.png | Bin 0 -> 1422 bytes .../resources/multimc/32x32/status-good.png | Bin 0 -> 1400 bytes .../resources/multimc/32x32/status-yellow.png | Bin 0 -> 1158 bytes application/resources/multimc/32x32/viewfolder.png | Bin 0 -> 1518 bytes application/resources/multimc/48x48/about.png | Bin 0 -> 3995 bytes application/resources/multimc/48x48/bug.png | Bin 0 -> 3124 bytes application/resources/multimc/48x48/cat.png | Bin 0 -> 2733 bytes .../resources/multimc/48x48/centralmods.png | Bin 0 -> 3201 bytes .../resources/multimc/48x48/checkupdate.png | Bin 0 -> 4196 bytes application/resources/multimc/48x48/copy.png | Bin 0 -> 1952 bytes application/resources/multimc/48x48/help.png | Bin 0 -> 4170 bytes .../resources/multimc/48x48/instance-settings.png | Bin 0 -> 4797 bytes application/resources/multimc/48x48/log.png | Bin 0 -> 2825 bytes application/resources/multimc/48x48/minecraft.png | Bin 0 -> 5077 bytes application/resources/multimc/48x48/new.png | Bin 0 -> 2870 bytes application/resources/multimc/48x48/news.png | Bin 0 -> 3333 bytes application/resources/multimc/48x48/noaccount.png | Bin 0 -> 387 bytes application/resources/multimc/48x48/patreon.png | Bin 0 -> 2317 bytes application/resources/multimc/48x48/refresh.png | Bin 0 -> 3743 bytes .../resources/multimc/48x48/screenshots.png | Bin 0 -> 3010 bytes application/resources/multimc/48x48/settings.png | Bin 0 -> 4797 bytes application/resources/multimc/48x48/status-bad.png | Bin 0 -> 2389 bytes .../resources/multimc/48x48/status-good.png | Bin 0 -> 2248 bytes .../resources/multimc/48x48/status-yellow.png | Bin 0 -> 1773 bytes application/resources/multimc/48x48/viewfolder.png | Bin 0 -> 1945 bytes application/resources/multimc/64x64/about.png | Bin 0 -> 5513 bytes application/resources/multimc/64x64/bug.png | Bin 0 -> 4263 bytes application/resources/multimc/64x64/cat.png | Bin 0 -> 4033 bytes .../resources/multimc/64x64/centralmods.png | Bin 0 -> 4408 bytes .../resources/multimc/64x64/checkupdate.png | Bin 0 -> 5858 bytes application/resources/multimc/64x64/copy.png | Bin 0 -> 2884 bytes application/resources/multimc/64x64/coremods.png | Bin 0 -> 5036 bytes application/resources/multimc/64x64/help.png | Bin 0 -> 5402 bytes .../resources/multimc/64x64/instance-settings.png | Bin 0 -> 7125 bytes application/resources/multimc/64x64/jarmods.png | Bin 0 -> 4003 bytes application/resources/multimc/64x64/loadermods.png | Bin 0 -> 4406 bytes application/resources/multimc/64x64/log.png | Bin 0 -> 3686 bytes application/resources/multimc/64x64/new.png | Bin 0 -> 3949 bytes application/resources/multimc/64x64/news.png | Bin 0 -> 4968 bytes application/resources/multimc/64x64/patreon.png | Bin 0 -> 3212 bytes application/resources/multimc/64x64/refresh.png | Bin 0 -> 5745 bytes .../resources/multimc/64x64/resourcepacks.png | Bin 0 -> 6805 bytes .../resources/multimc/64x64/screenshots.png | Bin 0 -> 4518 bytes application/resources/multimc/64x64/settings.png | Bin 0 -> 7125 bytes application/resources/multimc/64x64/status-bad.png | Bin 0 -> 2827 bytes .../resources/multimc/64x64/status-good.png | Bin 0 -> 2954 bytes .../resources/multimc/64x64/status-yellow.png | Bin 0 -> 2358 bytes application/resources/multimc/64x64/viewfolder.png | Bin 0 -> 2134 bytes application/resources/multimc/8x8/noaccount.png | Bin 0 -> 284 bytes application/resources/multimc/index.theme | 42 + application/resources/multimc/multimc.qrc | 206 ++ application/resources/multimc/scalable/bug.svg | 387 ++++ .../resources/multimc/scalable/centralmods.svg | 346 ++++ .../resources/multimc/scalable/checkupdate.svg | 167 ++ application/resources/multimc/scalable/console.svg | 228 +++ .../resources/multimc/scalable/console_error.svg | 247 +++ application/resources/multimc/scalable/java.svg | 773 ++++++++ application/resources/multimc/scalable/multimc.svg | 1993 +++++++++++++++++++ application/resources/multimc/scalable/new.svg | 127 ++ application/resources/multimc/scalable/news.svg | 296 +++ application/resources/multimc/scalable/proxy.svg | 260 +++ .../multimc/scalable/screenshot-placeholder.svg | 86 + .../resources/multimc/scalable/screenshots.svg | 1231 ++++++++++++ .../resources/multimc/scalable/status-bad.svg | 142 ++ .../resources/multimc/scalable/status-good.svg | 201 ++ .../resources/multimc/scalable/status-yellow.svg | 155 ++ .../resources/multimc/scalable/viewfolder.svg | 122 ++ application/resources/pe_blue/index.theme | 11 + application/resources/pe_blue/pe_blue.qrc | 35 + application/resources/pe_blue/scalable/about.svg | 16 + .../resources/pe_blue/scalable/accounts.svg | 46 + application/resources/pe_blue/scalable/bug.svg | 47 + .../resources/pe_blue/scalable/centralmods.svg | 43 + .../resources/pe_blue/scalable/checkupdate.svg | 43 + application/resources/pe_blue/scalable/copy.svg | 41 + .../resources/pe_blue/scalable/coremods.svg | 41 + .../resources/pe_blue/scalable/externaltools.svg | 41 + .../pe_blue/scalable/instance-settings.svg | 46 + application/resources/pe_blue/scalable/jarmods.svg | 22 + application/resources/pe_blue/scalable/java.svg | 47 + .../resources/pe_blue/scalable/loadermods.svg | 42 + application/resources/pe_blue/scalable/log.svg | 41 + .../resources/pe_blue/scalable/minecraft.svg | 44 + application/resources/pe_blue/scalable/multimc.svg | 61 + application/resources/pe_blue/scalable/new.svg | 44 + application/resources/pe_blue/scalable/news.svg | 13 + application/resources/pe_blue/scalable/notes.svg | 46 + application/resources/pe_blue/scalable/patreon.svg | 41 + application/resources/pe_blue/scalable/proxy.svg | 45 + .../resources/pe_blue/scalable/quickmods.svg | 43 + application/resources/pe_blue/scalable/refresh.svg | 41 + .../resources/pe_blue/scalable/resourcepacks.svg | 13 + .../resources/pe_blue/scalable/screenshots.svg | 44 + .../resources/pe_blue/scalable/settings.svg | 46 + .../resources/pe_blue/scalable/status-bad.svg | 10 + .../resources/pe_blue/scalable/status-good.svg | 15 + .../resources/pe_blue/scalable/status-yellow.svg | 16 + .../resources/pe_blue/scalable/viewfolder.svg | 42 + application/resources/pe_colored/index.theme | 11 + application/resources/pe_colored/pe_colored.qrc | 35 + .../resources/pe_colored/scalable/about.svg | 19 + .../resources/pe_colored/scalable/accounts.svg | 20 + application/resources/pe_colored/scalable/bug.svg | 17 + .../resources/pe_colored/scalable/centralmods.svg | 18 + .../resources/pe_colored/scalable/checkupdate.svg | 13 + application/resources/pe_colored/scalable/copy.svg | 16 + .../resources/pe_colored/scalable/coremods.svg | 16 + .../pe_colored/scalable/externaltools.svg | 13 + .../pe_colored/scalable/instance-settings.svg | 18 + .../resources/pe_colored/scalable/jarmods.svg | 22 + application/resources/pe_colored/scalable/java.svg | 49 + .../resources/pe_colored/scalable/loadermods.svg | 15 + application/resources/pe_colored/scalable/log.svg | 16 + .../resources/pe_colored/scalable/minecraft.svg | 14 + .../resources/pe_colored/scalable/multimc.svg | 32 + application/resources/pe_colored/scalable/new.svg | 16 + application/resources/pe_colored/scalable/news.svg | 13 + .../resources/pe_colored/scalable/notes.svg | 21 + .../resources/pe_colored/scalable/patreon.svg | 12 + .../resources/pe_colored/scalable/proxy.svg | 15 + .../resources/pe_colored/scalable/quickmods.svg | 14 + .../resources/pe_colored/scalable/refresh.svg | 11 + .../pe_colored/scalable/resourcepacks.svg | 15 + .../resources/pe_colored/scalable/screenshots.svg | 16 + .../resources/pe_colored/scalable/settings.svg | 18 + .../resources/pe_colored/scalable/status-bad.svg | 10 + .../resources/pe_colored/scalable/status-good.svg | 15 + .../pe_colored/scalable/status-yellow.svg | 16 + .../resources/pe_colored/scalable/viewfolder.svg | 17 + application/resources/pe_dark/index.theme | 11 + application/resources/pe_dark/pe_dark.qrc | 35 + application/resources/pe_dark/scalable/about.svg | 15 + .../resources/pe_dark/scalable/accounts.svg | 46 + application/resources/pe_dark/scalable/bug.svg | 47 + .../resources/pe_dark/scalable/centralmods.svg | 40 + .../resources/pe_dark/scalable/checkupdate.svg | 12 + application/resources/pe_dark/scalable/copy.svg | 40 + .../resources/pe_dark/scalable/coremods.svg | 41 + .../resources/pe_dark/scalable/externaltools.svg | 41 + .../pe_dark/scalable/instance-settings.svg | 43 + application/resources/pe_dark/scalable/jarmods.svg | 41 + application/resources/pe_dark/scalable/java.svg | 48 + .../resources/pe_dark/scalable/loadermods.svg | 42 + application/resources/pe_dark/scalable/log.svg | 41 + .../resources/pe_dark/scalable/minecraft.svg | 44 + application/resources/pe_dark/scalable/multimc.svg | 61 + application/resources/pe_dark/scalable/new.svg | 41 + application/resources/pe_dark/scalable/news.svg | 13 + application/resources/pe_dark/scalable/notes.svg | 46 + application/resources/pe_dark/scalable/patreon.svg | 41 + application/resources/pe_dark/scalable/proxy.svg | 43 + .../resources/pe_dark/scalable/quickmods.svg | 43 + application/resources/pe_dark/scalable/refresh.svg | 11 + .../resources/pe_dark/scalable/resourcepacks.svg | 13 + .../resources/pe_dark/scalable/screenshots.svg | 44 + .../resources/pe_dark/scalable/settings.svg | 43 + .../resources/pe_dark/scalable/status-bad.svg | 10 + .../resources/pe_dark/scalable/status-good.svg | 12 + .../resources/pe_dark/scalable/status-yellow.svg | 16 + .../resources/pe_dark/scalable/viewfolder.svg | 39 + application/resources/pe_light/index.theme | 11 + application/resources/pe_light/pe_light.qrc | 36 + application/resources/pe_light/scalable/about.svg | 15 + .../resources/pe_light/scalable/accounts.svg | 46 + application/resources/pe_light/scalable/bug.svg | 47 + .../resources/pe_light/scalable/centralmods.svg | 41 + .../resources/pe_light/scalable/checkupdate.svg | 13 + application/resources/pe_light/scalable/copy.svg | 40 + .../resources/pe_light/scalable/coremods.svg | 41 + .../resources/pe_light/scalable/externaltools.svg | 41 + .../pe_light/scalable/instance-settings.svg | 43 + .../resources/pe_light/scalable/jarmods.svg | 41 + application/resources/pe_light/scalable/java.svg | 49 + .../resources/pe_light/scalable/loadermods.svg | 42 + application/resources/pe_light/scalable/log.svg | 41 + .../resources/pe_light/scalable/minecraft.svg | 44 + .../resources/pe_light/scalable/multimc.svg | 61 + application/resources/pe_light/scalable/new.svg | 41 + application/resources/pe_light/scalable/news.svg | 12 + application/resources/pe_light/scalable/notes.svg | 46 + .../resources/pe_light/scalable/patreon.svg | 40 + application/resources/pe_light/scalable/proxy.svg | 45 + .../resources/pe_light/scalable/quickmods.svg | 43 + .../resources/pe_light/scalable/refresh.svg | 11 + .../resources/pe_light/scalable/resourcepacks.svg | 13 + .../resources/pe_light/scalable/screenshots.svg | 44 + .../resources/pe_light/scalable/settings.svg | 43 + .../resources/pe_light/scalable/status-bad.svg | 10 + .../resources/pe_light/scalable/status-good.svg | 12 + .../resources/pe_light/scalable/status-yellow.svg | 16 + .../resources/pe_light/scalable/viewfolder.svg | 40 + application/resources/sources/clucker.svg | 404 ++++ application/resources/sources/creeper.svg | 775 ++++++++ application/resources/sources/enderpearl.svg | 271 +++ application/resources/sources/ftb-glow.svg | 606 ++++++ application/resources/sources/ftb-logo.svg | 257 +++ application/resources/sources/gear.svg | 434 ++++ application/resources/sources/herobrine.svg | 583 ++++++ application/resources/sources/magitech.svg | 886 +++++++++ application/resources/sources/meat.svg | 371 ++++ application/resources/sources/netherstar.svg | 342 ++++ application/resources/sources/pskeleton.svg | 581 ++++++ application/resources/sources/skeleton.svg | 610 ++++++ application/resources/sources/squarecreeper.svg | 828 ++++++++ application/resources/sources/steve.svg | 534 +++++ application/resources/versions/LWJGL/2.9.0.json | 45 + .../LWJGL/2.9.1-nightly-20130708-debug3.json | 45 + application/resources/versions/LWJGL/2.9.1.json | 45 + .../versions/LWJGL/2.9.2-nightly-20140822.json | 45 + application/resources/versions/minecraft.json | 668 +++++++ application/resources/versions/versions.qrc | 12 + application/widgets/Common.cpp | 27 + application/widgets/Common.h | 6 + application/widgets/IconLabel.cpp | 43 + application/widgets/IconLabel.h | 26 + application/widgets/LabeledToolButton.cpp | 86 + application/widgets/LabeledToolButton.h | 37 + application/widgets/LineSeparator.cpp | 37 + application/widgets/LineSeparator.h | 18 + application/widgets/MCModInfoFrame.cpp | 111 ++ application/widgets/MCModInfoFrame.h | 46 + application/widgets/MCModInfoFrame.ui | 68 + application/widgets/ModListView.cpp | 62 + application/widgets/ModListView.h | 27 + application/widgets/PageContainer.cpp | 210 ++ application/widgets/PageContainer.h | 63 + application/widgets/PageContainer_p.h | 123 ++ application/widgets/ServerStatus.cpp | 129 ++ application/widgets/ServerStatus.h | 37 + application/widgets/VersionListView.cpp | 147 ++ application/widgets/VersionListView.h | 43 + depends/javacheck/CMakeLists.txt | 2 - depends/launcher/CMakeLists.txt | 1 - gui/ColumnResizer.cpp | 202 -- gui/ColumnResizer.h | 38 - gui/ConsoleWindow.cpp | 260 --- gui/ConsoleWindow.h | 65 - gui/GuiUtil.cpp | 48 - gui/GuiUtil.h | 9 - gui/InstancePageProvider.cpp | 0 gui/InstancePageProvider.h | 52 - gui/InstanceProxyModel.cpp | 23 - gui/InstanceProxyModel.h | 13 - gui/MainWindow.cpp | 2069 -------------------- gui/MainWindow.h | 218 --- gui/NagUtils.cpp | 38 - gui/NagUtils.h | 23 - gui/Platform.h | 32 - gui/Platform_Other.cpp | 27 - gui/Platform_X11.cpp | 62 - gui/dialogs/AboutDialog.cpp | 127 -- gui/dialogs/AboutDialog.h | 47 - gui/dialogs/AboutDialog.ui | 544 ----- gui/dialogs/AccountSelectDialog.cpp | 85 - gui/dialogs/AccountSelectDialog.h | 90 - gui/dialogs/AccountSelectDialog.ui | 56 - gui/dialogs/CopyInstanceDialog.cpp | 101 - gui/dialogs/CopyInstanceDialog.h | 52 - gui/dialogs/CopyInstanceDialog.ui | 161 -- gui/dialogs/CustomMessageBox.cpp | 35 - gui/dialogs/CustomMessageBox.h | 26 - gui/dialogs/EditAccountDialog.cpp | 51 - gui/dialogs/EditAccountDialog.h | 60 - gui/dialogs/EditAccountDialog.ui | 94 - gui/dialogs/IconPickerDialog.cpp | 156 -- gui/dialogs/IconPickerDialog.h | 48 - gui/dialogs/IconPickerDialog.ui | 67 - gui/dialogs/LoginDialog.cpp | 110 -- gui/dialogs/LoginDialog.h | 58 - gui/dialogs/LoginDialog.ui | 77 - gui/dialogs/ModEditDialogCommon.cpp | 40 - gui/dialogs/ModEditDialogCommon.h | 9 - gui/dialogs/NewInstanceDialog.cpp | 207 -- gui/dialogs/NewInstanceDialog.h | 59 - gui/dialogs/NewInstanceDialog.ui | 309 --- gui/dialogs/NotificationDialog.cpp | 84 - gui/dialogs/NotificationDialog.h | 44 - gui/dialogs/NotificationDialog.ui | 85 - gui/dialogs/ProgressDialog.cpp | 125 -- gui/dialogs/ProgressDialog.h | 65 - gui/dialogs/ProgressDialog.ui | 66 - gui/dialogs/UpdateDialog.cpp | 186 -- gui/dialogs/UpdateDialog.h | 61 - gui/dialogs/UpdateDialog.ui | 106 - gui/dialogs/VersionSelectDialog.cpp | 177 -- gui/dialogs/VersionSelectDialog.h | 66 - gui/dialogs/VersionSelectDialog.ui | 110 -- gui/groupview/GroupView.cpp | 1003 ---------- gui/groupview/GroupView.h | 125 -- gui/groupview/GroupedProxyModel.cpp | 42 - gui/groupview/GroupedProxyModel.h | 15 - gui/groupview/InstanceDelegate.cpp | 362 ---- gui/groupview/InstanceDelegate.h | 35 - gui/groupview/VisualGroup.cpp | 301 --- gui/groupview/VisualGroup.h | 91 - gui/pagedialog/PageDialog.cpp | 62 - gui/pagedialog/PageDialog.h | 36 - gui/pages/BasePage.h | 38 - gui/pages/BasePageProvider.h | 69 - gui/pages/InstanceSettingsPage.cpp | 216 -- gui/pages/InstanceSettingsPage.h | 74 - gui/pages/InstanceSettingsPage.ui | 453 ----- gui/pages/LogPage.cpp | 222 --- gui/pages/LogPage.h | 86 - gui/pages/LogPage.ui | 140 -- gui/pages/ModFolderPage.cpp | 160 -- gui/pages/ModFolderPage.h | 94 - gui/pages/ModFolderPage.ui | 124 -- gui/pages/NotesPage.cpp | 21 - gui/pages/NotesPage.h | 61 - gui/pages/NotesPage.ui | 60 - gui/pages/OtherLogsPage.cpp | 150 -- gui/pages/OtherLogsPage.h | 72 - gui/pages/OtherLogsPage.ui | 117 -- gui/pages/ResourcePackPage.h | 19 - gui/pages/ScreenshotsPage.cpp | 362 ---- gui/pages/ScreenshotsPage.h | 79 - gui/pages/ScreenshotsPage.ui | 109 -- gui/pages/TexturePackPage.h | 17 - gui/pages/VersionPage.cpp | 321 --- gui/pages/VersionPage.h | 80 - gui/pages/VersionPage.ui | 204 -- gui/pages/global/AccountListPage.cpp | 142 -- gui/pages/global/AccountListPage.h | 86 - gui/pages/global/AccountListPage.ui | 115 -- gui/pages/global/ExternalToolsPage.cpp | 238 --- gui/pages/global/ExternalToolsPage.h | 74 - gui/pages/global/ExternalToolsPage.ui | 197 -- gui/pages/global/JavaPage.cpp | 146 -- gui/pages/global/JavaPage.h | 73 - gui/pages/global/JavaPage.ui | 303 --- gui/pages/global/MinecraftPage.cpp | 92 - gui/pages/global/MinecraftPage.h | 70 - gui/pages/global/MinecraftPage.ui | 148 -- gui/pages/global/MultiMCPage.cpp | 459 ----- gui/pages/global/MultiMCPage.h | 100 - gui/pages/global/MultiMCPage.ui | 532 ----- gui/pages/global/ProxyPage.cpp | 95 - gui/pages/global/ProxyPage.h | 67 - gui/pages/global/ProxyPage.ui | 197 -- gui/widgets/Common.cpp | 27 - gui/widgets/Common.h | 6 - gui/widgets/IconLabel.cpp | 43 - gui/widgets/IconLabel.h | 26 - gui/widgets/LabeledToolButton.cpp | 86 - gui/widgets/LabeledToolButton.h | 37 - gui/widgets/LineSeparator.cpp | 37 - gui/widgets/LineSeparator.h | 18 - gui/widgets/MCModInfoFrame.cpp | 111 -- gui/widgets/MCModInfoFrame.h | 46 - gui/widgets/MCModInfoFrame.ui | 68 - gui/widgets/ModListView.cpp | 62 - gui/widgets/ModListView.h | 27 - gui/widgets/PageContainer.cpp | 210 -- gui/widgets/PageContainer.h | 63 - gui/widgets/PageContainer_p.h | 123 -- gui/widgets/ServerStatus.cpp | 129 -- gui/widgets/ServerStatus.h | 37 - gui/widgets/VersionListView.cpp | 147 -- gui/widgets/VersionListView.h | 43 - install_prereqs.cmake.in | 24 - logic/BaseInstaller.cpp | 4 +- logic/BaseInstance.cpp | 10 +- logic/BaseInstance.h | 10 +- logic/BaseProcess.cpp | 3 +- logic/BaseVersionList.cpp | 4 +- logic/BaseVersionList.h | 2 +- logic/CMakeLists.txt | 258 +++ logic/Env.cpp | 4 +- logic/InstanceList.cpp | 12 +- logic/InstanceList.h | 2 +- logic/MMCError.h | 25 + logic/auth/MojangAccountList.cpp | 4 +- logic/auth/MojangAccountList.h | 2 +- logic/auth/YggdrasilTask.cpp | 8 +- logic/auth/YggdrasilTask.h | 4 +- logic/auth/flows/AuthenticateTask.cpp | 4 +- logic/auth/flows/AuthenticateTask.h | 2 +- logic/auth/flows/RefreshTask.cpp | 4 +- logic/auth/flows/RefreshTask.h | 2 +- logic/auth/flows/ValidateTask.cpp | 4 +- logic/auth/flows/ValidateTask.h | 2 +- logic/forge/ForgeInstaller.cpp | 16 +- logic/forge/ForgeInstaller.h | 2 +- logic/forge/ForgeMirrors.cpp | 2 +- logic/forge/ForgeMirrors.h | 8 +- logic/forge/ForgeVersion.cpp | 2 +- logic/forge/ForgeVersion.h | 2 +- logic/forge/ForgeVersionList.cpp | 10 +- logic/forge/ForgeVersionList.h | 8 +- logic/forge/ForgeXzDownload.cpp | 2 +- logic/forge/ForgeXzDownload.h | 4 +- logic/forge/LegacyForge.h | 2 +- logic/ftb/FTBPlugin.cpp | 10 +- logic/ftb/FTBPlugin.h | 2 +- logic/ftb/FTBProfileStrategy.cpp | 8 +- logic/ftb/FTBVersion.h | 2 +- logic/ftb/LegacyFTBInstance.cpp | 2 +- logic/ftb/LegacyFTBInstance.h | 2 +- logic/ftb/OneSixFTBInstance.cpp | 14 +- logic/ftb/OneSixFTBInstance.h | 2 +- logic/icons/IconList.h | 4 +- logic/java/JavaCheckerJob.h | 2 +- logic/java/JavaUtils.cpp | 8 +- logic/java/JavaVersionList.cpp | 6 +- logic/java/JavaVersionList.h | 6 +- logic/liteloader/LiteLoaderInstaller.cpp | 8 +- logic/liteloader/LiteLoaderInstaller.h | 4 +- logic/liteloader/LiteLoaderVersionList.cpp | 6 +- logic/liteloader/LiteLoaderVersionList.h | 10 +- logic/minecraft/GradleSpecifier.h | 2 +- logic/minecraft/JarMod.cpp | 2 +- logic/minecraft/JarUtils.cpp | 2 +- logic/minecraft/LegacyInstance.cpp | 13 +- logic/minecraft/LegacyInstance.h | 7 +- logic/minecraft/LegacyUpdate.cpp | 20 +- logic/minecraft/LegacyUpdate.h | 6 +- logic/minecraft/LwjglVersionList.cpp | 2 +- logic/minecraft/LwjglVersionList.h | 4 +- logic/minecraft/MinecraftInstance.cpp | 6 +- logic/minecraft/MinecraftInstance.h | 4 +- logic/minecraft/MinecraftProcess.cpp | 4 +- logic/minecraft/MinecraftProcess.h | 4 +- logic/minecraft/MinecraftProfile.cpp | 4 +- logic/minecraft/MinecraftVersion.cpp | 2 +- logic/minecraft/MinecraftVersion.h | 2 +- logic/minecraft/MinecraftVersionList.cpp | 6 +- logic/minecraft/MinecraftVersionList.h | 8 +- logic/minecraft/Mod.cpp | 2 +- logic/minecraft/ModList.h | 2 +- logic/minecraft/OneSixInstance.cpp | 16 +- logic/minecraft/OneSixInstance.h | 6 +- logic/minecraft/OneSixLibrary.h | 6 +- logic/minecraft/OneSixProfileStrategy.cpp | 10 +- logic/minecraft/OneSixUpdate.cpp | 20 +- logic/minecraft/OneSixUpdate.h | 6 +- logic/minecraft/ParseUtils.cpp | 2 +- logic/minecraft/ProfileUtils.cpp | 4 +- logic/minecraft/RawLibrary.cpp | 2 +- logic/minecraft/RawLibrary.h | 6 +- logic/minecraft/SkinUtils.cpp | 6 +- logic/minecraft/VersionBuilder.cpp | 14 +- logic/minecraft/VersionFile.cpp | 10 +- logic/minecraft/VersionFile.h | 4 +- logic/net/ByteArrayDownload.cpp | 2 +- logic/net/CacheDownload.cpp | 2 +- logic/net/HttpMetaCache.cpp | 2 +- logic/net/MD5EtagDownload.cpp | 2 +- logic/net/NetAction.h | 2 +- logic/net/NetJob.h | 4 +- logic/net/PasteUpload.cpp | 2 +- logic/net/PasteUpload.h | 2 +- logic/news/NewsChecker.h | 2 +- logic/notifications/NotificationChecker.cpp | 4 +- logic/notifications/NotificationChecker.h | 4 +- logic/screenshots/ImgurAlbumCreation.cpp | 4 +- logic/screenshots/ImgurAlbumCreation.h | 2 +- logic/screenshots/ImgurUpload.cpp | 4 +- logic/screenshots/ImgurUpload.h | 2 +- logic/settings/INIFile.cpp | 2 +- logic/settings/INISettingsObject.h | 4 +- logic/settings/Setting.cpp | 2 +- logic/settings/SettingsObject.cpp | 6 +- logic/status/StatusChecker.cpp | 5 +- logic/status/StatusChecker.h | 2 +- logic/tools/BaseExternalTool.cpp | 11 +- logic/tools/BaseExternalTool.h | 13 +- logic/tools/BaseProfiler.cpp | 4 +- logic/tools/BaseProfiler.h | 2 +- logic/tools/JProfiler.cpp | 22 +- logic/tools/JProfiler.h | 4 +- logic/tools/JVisualVM.cpp | 19 +- logic/tools/JVisualVM.h | 4 +- logic/tools/MCEditTool.cpp | 24 +- logic/tools/MCEditTool.h | 4 +- logic/trans/TranslationDownloader.cpp | 9 +- logic/updater/DownloadTask.cpp | 4 +- logic/updater/DownloadTask.h | 4 +- logic/updater/GoUpdate.cpp | 2 +- logic/updater/GoUpdate.h | 2 +- logic/updater/UpdateChecker.h | 2 +- main.cpp | 43 - package/linux/MultiMC | 80 - resources/MultiMC.icns | Bin 437319 -> 0 bytes resources/MultiMC.ico | Bin 76126 -> 0 bytes resources/MultiMC.manifest | 27 - resources/OSX/OSX.qrc | 35 - resources/OSX/index.theme | 11 - resources/OSX/scalable/about.svg | 20 - resources/OSX/scalable/accounts.svg | 16 - resources/OSX/scalable/bug.svg | 25 - resources/OSX/scalable/centralmods.svg | 16 - resources/OSX/scalable/checkupdate.svg | 22 - resources/OSX/scalable/copy.svg | 18 - resources/OSX/scalable/coremods.svg | 21 - resources/OSX/scalable/externaltools.svg | 14 - resources/OSX/scalable/instance-settings.svg | 25 - resources/OSX/scalable/jarmods.svg | 30 - resources/OSX/scalable/java.svg | 33 - resources/OSX/scalable/loadermods.svg | 14 - resources/OSX/scalable/log.svg | 19 - resources/OSX/scalable/minecraft.svg | 12 - resources/OSX/scalable/multimc.svg | 18 - resources/OSX/scalable/new.svg | 19 - resources/OSX/scalable/news.svg | 16 - resources/OSX/scalable/notes.svg | 21 - resources/OSX/scalable/patreon.svg | 15 - resources/OSX/scalable/proxy.svg | 16 - resources/OSX/scalable/quickmods.svg | 18 - resources/OSX/scalable/refresh.svg | 16 - resources/OSX/scalable/resourcepacks.svg | 17 - resources/OSX/scalable/screenshots.svg | 19 - resources/OSX/scalable/settings.svg | 25 - resources/OSX/scalable/status-bad.svg | 11 - resources/OSX/scalable/status-good.svg | 19 - resources/OSX/scalable/status-yellow.svg | 16 - resources/OSX/scalable/viewfolder.svg | 16 - resources/backgrounds/backgrounds.qrc | 6 - resources/backgrounds/catbgrnd2.png | Bin 78285 -> 0 bytes resources/iOS/iOS.qrc | 35 - resources/iOS/index.theme | 11 - resources/iOS/scalable/about.svg | 16 - resources/iOS/scalable/accounts.svg | 14 - resources/iOS/scalable/bug.svg | 22 - resources/iOS/scalable/centralmods.svg | 13 - resources/iOS/scalable/checkupdate.svg | 16 - resources/iOS/scalable/copy.svg | 13 - resources/iOS/scalable/coremods.svg | 18 - resources/iOS/scalable/externaltools.svg | 13 - resources/iOS/scalable/instance-settings.svg | 19 - resources/iOS/scalable/jarmods.svg | 31 - resources/iOS/scalable/java.svg | 33 - resources/iOS/scalable/loadermods.svg | 14 - resources/iOS/scalable/log.svg | 13 - resources/iOS/scalable/minecraft.svg | 8 - resources/iOS/scalable/multimc.svg | 13 - resources/iOS/scalable/new.svg | 13 - resources/iOS/scalable/news.svg | 14 - resources/iOS/scalable/notes.svg | 15 - resources/iOS/scalable/patreon.svg | 12 - resources/iOS/scalable/proxy.svg | 11 - resources/iOS/scalable/quickmods.svg | 14 - resources/iOS/scalable/refresh.svg | 13 - resources/iOS/scalable/resourcepacks.svg | 15 - resources/iOS/scalable/screenshots.svg | 14 - resources/iOS/scalable/settings.svg | 19 - resources/iOS/scalable/status-bad.svg | 10 - resources/iOS/scalable/status-good.svg | 18 - resources/iOS/scalable/status-yellow.svg | 56 - resources/iOS/scalable/viewfolder.svg | 12 - resources/instances/brick.png | Bin 713 -> 0 bytes resources/instances/broken.png | Bin 1139 -> 0 bytes resources/instances/chicken.png | Bin 1181 -> 0 bytes resources/instances/chicken128.png | Bin 6369 -> 0 bytes resources/instances/creeper.png | Bin 1524 -> 0 bytes resources/instances/creeper128.png | Bin 9046 -> 0 bytes resources/instances/derp.png | Bin 5225 -> 0 bytes resources/instances/diamond.png | Bin 708 -> 0 bytes resources/instances/dirt.png | Bin 482 -> 0 bytes resources/instances/enderman.png | Bin 2429 -> 0 bytes resources/instances/enderpearl.png | Bin 2120 -> 0 bytes resources/instances/enderpearl128.png | Bin 21425 -> 0 bytes resources/instances/ftb_glow.png | Bin 1747 -> 0 bytes resources/instances/ftb_glow128.png | Bin 12708 -> 0 bytes resources/instances/ftb_logo.png | Bin 1607 -> 0 bytes resources/instances/ftb_logo128.png | Bin 7883 -> 0 bytes resources/instances/gear.png | Bin 2414 -> 0 bytes resources/instances/gear128.png | Bin 18321 -> 0 bytes resources/instances/gold.png | Bin 978 -> 0 bytes resources/instances/grass.png | Bin 618 -> 0 bytes resources/instances/herobrine.png | Bin 1034 -> 0 bytes resources/instances/herobrine128.png | Bin 4937 -> 0 bytes resources/instances/infinity.png | Bin 1714 -> 0 bytes resources/instances/infinity128.png | Bin 9237 -> 0 bytes resources/instances/instances.qrc | 49 - resources/instances/iron.png | Bin 532 -> 0 bytes resources/instances/kitten.png | Bin 1605 -> 0 bytes resources/instances/magitech.png | Bin 2646 -> 0 bytes resources/instances/magitech128.png | Bin 23097 -> 0 bytes resources/instances/meat.png | Bin 1514 -> 0 bytes resources/instances/meat128.png | Bin 10583 -> 0 bytes resources/instances/netherstar.png | Bin 1942 -> 0 bytes resources/instances/netherstar128.png | Bin 14062 -> 0 bytes resources/instances/planks.png | Bin 461 -> 0 bytes resources/instances/skeleton.png | Bin 696 -> 0 bytes resources/instances/skeleton128.png | Bin 3673 -> 0 bytes resources/instances/squarecreeper.png | Bin 1623 -> 0 bytes resources/instances/squarecreeper128.png | Bin 9136 -> 0 bytes resources/instances/steve.png | Bin 969 -> 0 bytes resources/instances/steve128.png | Bin 4312 -> 0 bytes resources/instances/stone.png | Bin 438 -> 0 bytes resources/instances/tnt.png | Bin 378 -> 0 bytes resources/instances/updateavailable.png | Bin 2480 -> 0 bytes resources/multimc.rc | 29 - resources/multimc/16x16/about.png | Bin 1270 -> 0 bytes resources/multimc/16x16/bug.png | Bin 734 -> 0 bytes resources/multimc/16x16/cat.png | Bin 736 -> 0 bytes resources/multimc/16x16/centralmods.png | Bin 1145 -> 0 bytes resources/multimc/16x16/checkupdate.png | Bin 1212 -> 0 bytes resources/multimc/16x16/copy.png | Bin 957 -> 0 bytes resources/multimc/16x16/coremods.png | Bin 702 -> 0 bytes resources/multimc/16x16/help.png | Bin 1297 -> 0 bytes resources/multimc/16x16/instance-settings.png | Bin 1410 -> 0 bytes resources/multimc/16x16/jarmods.png | Bin 693 -> 0 bytes resources/multimc/16x16/loadermods.png | Bin 731 -> 0 bytes resources/multimc/16x16/log.png | Bin 630 -> 0 bytes resources/multimc/16x16/minecraft.png | Bin 782 -> 0 bytes resources/multimc/16x16/new.png | Bin 1175 -> 0 bytes resources/multimc/16x16/news.png | Bin 727 -> 0 bytes resources/multimc/16x16/noaccount.png | Bin 334 -> 0 bytes resources/multimc/16x16/patreon.png | Bin 682 -> 0 bytes resources/multimc/16x16/refresh.png | Bin 931 -> 0 bytes resources/multimc/16x16/resourcepacks.png | Bin 1207 -> 0 bytes resources/multimc/16x16/screenshots.png | Bin 976 -> 0 bytes resources/multimc/16x16/settings.png | Bin 1410 -> 0 bytes resources/multimc/16x16/status-bad.png | Bin 643 -> 0 bytes resources/multimc/16x16/status-good.png | Bin 714 -> 0 bytes resources/multimc/16x16/status-yellow.png | Bin 590 -> 0 bytes resources/multimc/16x16/viewfolder.png | Bin 852 -> 0 bytes resources/multimc/22x22/about.png | Bin 1693 -> 0 bytes resources/multimc/22x22/bug.png | Bin 1180 -> 0 bytes resources/multimc/22x22/cat.png | Bin 1034 -> 0 bytes resources/multimc/22x22/centralmods.png | Bin 1561 -> 0 bytes resources/multimc/22x22/checkupdate.png | Bin 1635 -> 0 bytes resources/multimc/22x22/copy.png | Bin 1004 -> 0 bytes resources/multimc/22x22/help.png | Bin 1735 -> 0 bytes resources/multimc/22x22/instance-settings.png | Bin 1964 -> 0 bytes resources/multimc/22x22/new.png | Bin 1440 -> 0 bytes resources/multimc/22x22/news.png | Bin 1173 -> 0 bytes resources/multimc/22x22/patreon.png | Bin 976 -> 0 bytes resources/multimc/22x22/refresh.png | Bin 1283 -> 0 bytes resources/multimc/22x22/screenshots.png | Bin 1320 -> 0 bytes resources/multimc/22x22/settings.png | Bin 1964 -> 0 bytes resources/multimc/22x22/status-bad.png | Bin 968 -> 0 bytes resources/multimc/22x22/status-good.png | Bin 994 -> 0 bytes resources/multimc/22x22/status-yellow.png | Bin 803 -> 0 bytes resources/multimc/22x22/viewfolder.png | Bin 1006 -> 0 bytes resources/multimc/24x24/cat.png | Bin 1252 -> 0 bytes resources/multimc/24x24/coremods.png | Bin 1281 -> 0 bytes resources/multimc/24x24/jarmods.png | Bin 1170 -> 0 bytes resources/multimc/24x24/loadermods.png | Bin 1240 -> 0 bytes resources/multimc/24x24/log.png | Bin 1117 -> 0 bytes resources/multimc/24x24/minecraft.png | Bin 1500 -> 0 bytes resources/multimc/24x24/noaccount.png | Bin 344 -> 0 bytes resources/multimc/24x24/patreon.png | Bin 1034 -> 0 bytes resources/multimc/24x24/resourcepacks.png | Bin 2000 -> 0 bytes resources/multimc/24x24/status-bad.png | Bin 1102 -> 0 bytes resources/multimc/24x24/status-good.png | Bin 1066 -> 0 bytes resources/multimc/24x24/status-yellow.png | Bin 872 -> 0 bytes resources/multimc/256x256/minecraft.png | Bin 49869 -> 0 bytes resources/multimc/32x32/about.png | Bin 2658 -> 0 bytes resources/multimc/32x32/bug.png | Bin 1772 -> 0 bytes resources/multimc/32x32/cat.png | Bin 1678 -> 0 bytes resources/multimc/32x32/centralmods.png | Bin 2119 -> 0 bytes resources/multimc/32x32/checkupdate.png | Bin 2480 -> 0 bytes resources/multimc/32x32/copy.png | Bin 1401 -> 0 bytes resources/multimc/32x32/coremods.png | Bin 1758 -> 0 bytes resources/multimc/32x32/help.png | Bin 2720 -> 0 bytes resources/multimc/32x32/instance-settings.png | Bin 2983 -> 0 bytes resources/multimc/32x32/jarmods.png | Bin 1566 -> 0 bytes resources/multimc/32x32/loadermods.png | Bin 1708 -> 0 bytes resources/multimc/32x32/log.png | Bin 1460 -> 0 bytes resources/multimc/32x32/minecraft.png | Bin 2495 -> 0 bytes resources/multimc/32x32/new.png | Bin 1769 -> 0 bytes resources/multimc/32x32/news.png | Bin 1752 -> 0 bytes resources/multimc/32x32/noaccount.png | Bin 363 -> 0 bytes resources/multimc/32x32/patreon.png | Bin 1450 -> 0 bytes resources/multimc/32x32/refresh.png | Bin 2182 -> 0 bytes resources/multimc/32x32/resourcepacks.png | Bin 2818 -> 0 bytes resources/multimc/32x32/screenshots.png | Bin 1892 -> 0 bytes resources/multimc/32x32/settings.png | Bin 2983 -> 0 bytes resources/multimc/32x32/status-bad.png | Bin 1422 -> 0 bytes resources/multimc/32x32/status-good.png | Bin 1400 -> 0 bytes resources/multimc/32x32/status-yellow.png | Bin 1158 -> 0 bytes resources/multimc/32x32/viewfolder.png | Bin 1518 -> 0 bytes resources/multimc/48x48/about.png | Bin 3995 -> 0 bytes resources/multimc/48x48/bug.png | Bin 3124 -> 0 bytes resources/multimc/48x48/cat.png | Bin 2733 -> 0 bytes resources/multimc/48x48/centralmods.png | Bin 3201 -> 0 bytes resources/multimc/48x48/checkupdate.png | Bin 4196 -> 0 bytes resources/multimc/48x48/copy.png | Bin 1952 -> 0 bytes resources/multimc/48x48/help.png | Bin 4170 -> 0 bytes resources/multimc/48x48/instance-settings.png | Bin 4797 -> 0 bytes resources/multimc/48x48/log.png | Bin 2825 -> 0 bytes resources/multimc/48x48/minecraft.png | Bin 5077 -> 0 bytes resources/multimc/48x48/new.png | Bin 2870 -> 0 bytes resources/multimc/48x48/news.png | Bin 3333 -> 0 bytes resources/multimc/48x48/noaccount.png | Bin 387 -> 0 bytes resources/multimc/48x48/patreon.png | Bin 2317 -> 0 bytes resources/multimc/48x48/refresh.png | Bin 3743 -> 0 bytes resources/multimc/48x48/screenshots.png | Bin 3010 -> 0 bytes resources/multimc/48x48/settings.png | Bin 4797 -> 0 bytes resources/multimc/48x48/status-bad.png | Bin 2389 -> 0 bytes resources/multimc/48x48/status-good.png | Bin 2248 -> 0 bytes resources/multimc/48x48/status-yellow.png | Bin 1773 -> 0 bytes resources/multimc/48x48/viewfolder.png | Bin 1945 -> 0 bytes resources/multimc/64x64/about.png | Bin 5513 -> 0 bytes resources/multimc/64x64/bug.png | Bin 4263 -> 0 bytes resources/multimc/64x64/cat.png | Bin 4033 -> 0 bytes resources/multimc/64x64/centralmods.png | Bin 4408 -> 0 bytes resources/multimc/64x64/checkupdate.png | Bin 5858 -> 0 bytes resources/multimc/64x64/copy.png | Bin 2884 -> 0 bytes resources/multimc/64x64/coremods.png | Bin 5036 -> 0 bytes resources/multimc/64x64/help.png | Bin 5402 -> 0 bytes resources/multimc/64x64/instance-settings.png | Bin 7125 -> 0 bytes resources/multimc/64x64/jarmods.png | Bin 4003 -> 0 bytes resources/multimc/64x64/loadermods.png | Bin 4406 -> 0 bytes resources/multimc/64x64/log.png | Bin 3686 -> 0 bytes resources/multimc/64x64/new.png | Bin 3949 -> 0 bytes resources/multimc/64x64/news.png | Bin 4968 -> 0 bytes resources/multimc/64x64/patreon.png | Bin 3212 -> 0 bytes resources/multimc/64x64/refresh.png | Bin 5745 -> 0 bytes resources/multimc/64x64/resourcepacks.png | Bin 6805 -> 0 bytes resources/multimc/64x64/screenshots.png | Bin 4518 -> 0 bytes resources/multimc/64x64/settings.png | Bin 7125 -> 0 bytes resources/multimc/64x64/status-bad.png | Bin 2827 -> 0 bytes resources/multimc/64x64/status-good.png | Bin 2954 -> 0 bytes resources/multimc/64x64/status-yellow.png | Bin 2358 -> 0 bytes resources/multimc/64x64/viewfolder.png | Bin 2134 -> 0 bytes resources/multimc/8x8/noaccount.png | Bin 284 -> 0 bytes resources/multimc/index.theme | 42 - resources/multimc/multimc.qrc | 206 -- resources/multimc/scalable/bug.svg | 387 ---- resources/multimc/scalable/centralmods.svg | 346 ---- resources/multimc/scalable/checkupdate.svg | 167 -- resources/multimc/scalable/console.svg | 228 --- resources/multimc/scalable/console_error.svg | 247 --- resources/multimc/scalable/java.svg | 773 -------- resources/multimc/scalable/multimc.svg | 1993 ------------------- resources/multimc/scalable/new.svg | 127 -- resources/multimc/scalable/news.svg | 296 --- resources/multimc/scalable/proxy.svg | 260 --- .../multimc/scalable/screenshot-placeholder.svg | 86 - resources/multimc/scalable/screenshots.svg | 1231 ------------ resources/multimc/scalable/status-bad.svg | 142 -- resources/multimc/scalable/status-good.svg | 201 -- resources/multimc/scalable/status-yellow.svg | 155 -- resources/multimc/scalable/viewfolder.svg | 122 -- resources/pe_blue/index.theme | 11 - resources/pe_blue/pe_blue.qrc | 35 - resources/pe_blue/scalable/about.svg | 16 - resources/pe_blue/scalable/accounts.svg | 46 - resources/pe_blue/scalable/bug.svg | 47 - resources/pe_blue/scalable/centralmods.svg | 43 - resources/pe_blue/scalable/checkupdate.svg | 43 - resources/pe_blue/scalable/copy.svg | 41 - resources/pe_blue/scalable/coremods.svg | 41 - resources/pe_blue/scalable/externaltools.svg | 41 - resources/pe_blue/scalable/instance-settings.svg | 46 - resources/pe_blue/scalable/jarmods.svg | 22 - resources/pe_blue/scalable/java.svg | 47 - resources/pe_blue/scalable/loadermods.svg | 42 - resources/pe_blue/scalable/log.svg | 41 - resources/pe_blue/scalable/minecraft.svg | 44 - resources/pe_blue/scalable/multimc.svg | 61 - resources/pe_blue/scalable/new.svg | 44 - resources/pe_blue/scalable/news.svg | 13 - resources/pe_blue/scalable/notes.svg | 46 - resources/pe_blue/scalable/patreon.svg | 41 - resources/pe_blue/scalable/proxy.svg | 45 - resources/pe_blue/scalable/quickmods.svg | 43 - resources/pe_blue/scalable/refresh.svg | 41 - resources/pe_blue/scalable/resourcepacks.svg | 13 - resources/pe_blue/scalable/screenshots.svg | 44 - resources/pe_blue/scalable/settings.svg | 46 - resources/pe_blue/scalable/status-bad.svg | 10 - resources/pe_blue/scalable/status-good.svg | 15 - resources/pe_blue/scalable/status-yellow.svg | 16 - resources/pe_blue/scalable/viewfolder.svg | 42 - resources/pe_colored/index.theme | 11 - resources/pe_colored/pe_colored.qrc | 35 - resources/pe_colored/scalable/about.svg | 19 - resources/pe_colored/scalable/accounts.svg | 20 - resources/pe_colored/scalable/bug.svg | 17 - resources/pe_colored/scalable/centralmods.svg | 18 - resources/pe_colored/scalable/checkupdate.svg | 13 - resources/pe_colored/scalable/copy.svg | 16 - resources/pe_colored/scalable/coremods.svg | 16 - resources/pe_colored/scalable/externaltools.svg | 13 - .../pe_colored/scalable/instance-settings.svg | 18 - resources/pe_colored/scalable/jarmods.svg | 22 - resources/pe_colored/scalable/java.svg | 49 - resources/pe_colored/scalable/loadermods.svg | 15 - resources/pe_colored/scalable/log.svg | 16 - resources/pe_colored/scalable/minecraft.svg | 14 - resources/pe_colored/scalable/multimc.svg | 32 - resources/pe_colored/scalable/new.svg | 16 - resources/pe_colored/scalable/news.svg | 13 - resources/pe_colored/scalable/notes.svg | 21 - resources/pe_colored/scalable/patreon.svg | 12 - resources/pe_colored/scalable/proxy.svg | 15 - resources/pe_colored/scalable/quickmods.svg | 14 - resources/pe_colored/scalable/refresh.svg | 11 - resources/pe_colored/scalable/resourcepacks.svg | 15 - resources/pe_colored/scalable/screenshots.svg | 16 - resources/pe_colored/scalable/settings.svg | 18 - resources/pe_colored/scalable/status-bad.svg | 10 - resources/pe_colored/scalable/status-good.svg | 15 - resources/pe_colored/scalable/status-yellow.svg | 16 - resources/pe_colored/scalable/viewfolder.svg | 17 - resources/pe_dark/index.theme | 11 - resources/pe_dark/pe_dark.qrc | 35 - resources/pe_dark/scalable/about.svg | 15 - resources/pe_dark/scalable/accounts.svg | 46 - resources/pe_dark/scalable/bug.svg | 47 - resources/pe_dark/scalable/centralmods.svg | 40 - resources/pe_dark/scalable/checkupdate.svg | 12 - resources/pe_dark/scalable/copy.svg | 40 - resources/pe_dark/scalable/coremods.svg | 41 - resources/pe_dark/scalable/externaltools.svg | 41 - resources/pe_dark/scalable/instance-settings.svg | 43 - resources/pe_dark/scalable/jarmods.svg | 41 - resources/pe_dark/scalable/java.svg | 48 - resources/pe_dark/scalable/loadermods.svg | 42 - resources/pe_dark/scalable/log.svg | 41 - resources/pe_dark/scalable/minecraft.svg | 44 - resources/pe_dark/scalable/multimc.svg | 61 - resources/pe_dark/scalable/new.svg | 41 - resources/pe_dark/scalable/news.svg | 13 - resources/pe_dark/scalable/notes.svg | 46 - resources/pe_dark/scalable/patreon.svg | 41 - resources/pe_dark/scalable/proxy.svg | 43 - resources/pe_dark/scalable/quickmods.svg | 43 - resources/pe_dark/scalable/refresh.svg | 11 - resources/pe_dark/scalable/resourcepacks.svg | 13 - resources/pe_dark/scalable/screenshots.svg | 44 - resources/pe_dark/scalable/settings.svg | 43 - resources/pe_dark/scalable/status-bad.svg | 10 - resources/pe_dark/scalable/status-good.svg | 12 - resources/pe_dark/scalable/status-yellow.svg | 16 - resources/pe_dark/scalable/viewfolder.svg | 39 - resources/pe_light/index.theme | 11 - resources/pe_light/pe_light.qrc | 36 - resources/pe_light/scalable/about.svg | 15 - resources/pe_light/scalable/accounts.svg | 46 - resources/pe_light/scalable/bug.svg | 47 - resources/pe_light/scalable/centralmods.svg | 41 - resources/pe_light/scalable/checkupdate.svg | 13 - resources/pe_light/scalable/copy.svg | 40 - resources/pe_light/scalable/coremods.svg | 41 - resources/pe_light/scalable/externaltools.svg | 41 - resources/pe_light/scalable/instance-settings.svg | 43 - resources/pe_light/scalable/jarmods.svg | 41 - resources/pe_light/scalable/java.svg | 49 - resources/pe_light/scalable/loadermods.svg | 42 - resources/pe_light/scalable/log.svg | 41 - resources/pe_light/scalable/minecraft.svg | 44 - resources/pe_light/scalable/multimc.svg | 61 - resources/pe_light/scalable/new.svg | 41 - resources/pe_light/scalable/news.svg | 12 - resources/pe_light/scalable/notes.svg | 46 - resources/pe_light/scalable/patreon.svg | 40 - resources/pe_light/scalable/proxy.svg | 45 - resources/pe_light/scalable/quickmods.svg | 43 - resources/pe_light/scalable/refresh.svg | 11 - resources/pe_light/scalable/resourcepacks.svg | 13 - resources/pe_light/scalable/screenshots.svg | 44 - resources/pe_light/scalable/settings.svg | 43 - resources/pe_light/scalable/status-bad.svg | 10 - resources/pe_light/scalable/status-good.svg | 12 - resources/pe_light/scalable/status-yellow.svg | 16 - resources/pe_light/scalable/viewfolder.svg | 40 - resources/sources/clucker.svg | 404 ---- resources/sources/creeper.svg | 775 -------- resources/sources/enderpearl.svg | 271 --- resources/sources/ftb-glow.svg | 606 ------ resources/sources/ftb-logo.svg | 257 --- resources/sources/gear.svg | 434 ---- resources/sources/herobrine.svg | 583 ------ resources/sources/magitech.svg | 886 --------- resources/sources/meat.svg | 371 ---- resources/sources/netherstar.svg | 342 ---- resources/sources/pskeleton.svg | 581 ------ resources/sources/skeleton.svg | 610 ------ resources/sources/squarecreeper.svg | 828 -------- resources/sources/steve.svg | 534 ----- resources/versions/LWJGL/2.9.0.json | 45 - .../LWJGL/2.9.1-nightly-20130708-debug3.json | 45 - resources/versions/LWJGL/2.9.1.json | 45 - .../versions/LWJGL/2.9.2-nightly-20140822.json | 45 - resources/versions/minecraft.json | 668 ------- resources/versions/versions.qrc | 12 - tests/CMakeLists.txt | 11 +- tests/tst_DownloadTask.cpp | 8 +- tests/tst_UpdateChecker.cpp | 2 +- tests/tst_gradlespecifier.cpp | 2 +- tests/tst_inifile.cpp | 2 +- tests/tst_pathutils.cpp | 2 +- tests/tst_userutils.cpp | 2 +- translations/CMakeLists.txt | 16 - 1199 files changed, 39515 insertions(+), 39568 deletions(-) delete mode 100644 BuildConfig.cpp.in delete mode 100644 BuildConfig.h delete mode 100644 MMCError.h delete mode 100644 MultiMC.cpp delete mode 100644 MultiMC.h create mode 100644 application/BuildConfig.cpp.in create mode 100644 application/BuildConfig.h create mode 100644 application/CMakeLists.txt create mode 100644 application/ColumnResizer.cpp create mode 100644 application/ColumnResizer.h create mode 100644 application/ConsoleWindow.cpp create mode 100644 application/ConsoleWindow.h create mode 100644 application/GuiUtil.cpp create mode 100644 application/GuiUtil.h create mode 100644 application/InstancePageProvider.cpp create mode 100644 application/InstancePageProvider.h create mode 100644 application/InstanceProxyModel.cpp create mode 100644 application/InstanceProxyModel.h create mode 100644 application/MainWindow.cpp create mode 100644 application/MainWindow.h create mode 100644 application/MultiMC.cpp create mode 100644 application/MultiMC.h create mode 100644 application/NagUtils.cpp create mode 100644 application/NagUtils.h create mode 100644 application/Platform.h create mode 100644 application/Platform_Other.cpp create mode 100644 application/Platform_X11.cpp create mode 100644 application/dialogs/AboutDialog.cpp create mode 100644 application/dialogs/AboutDialog.h create mode 100644 application/dialogs/AboutDialog.ui create mode 100644 application/dialogs/AccountSelectDialog.cpp create mode 100644 application/dialogs/AccountSelectDialog.h create mode 100644 application/dialogs/AccountSelectDialog.ui create mode 100644 application/dialogs/CopyInstanceDialog.cpp create mode 100644 application/dialogs/CopyInstanceDialog.h create mode 100644 application/dialogs/CopyInstanceDialog.ui create mode 100644 application/dialogs/CustomMessageBox.cpp create mode 100644 application/dialogs/CustomMessageBox.h create mode 100644 application/dialogs/EditAccountDialog.cpp create mode 100644 application/dialogs/EditAccountDialog.h create mode 100644 application/dialogs/EditAccountDialog.ui create mode 100644 application/dialogs/IconPickerDialog.cpp create mode 100644 application/dialogs/IconPickerDialog.h create mode 100644 application/dialogs/IconPickerDialog.ui create mode 100644 application/dialogs/LoginDialog.cpp create mode 100644 application/dialogs/LoginDialog.h create mode 100644 application/dialogs/LoginDialog.ui create mode 100644 application/dialogs/ModEditDialogCommon.cpp create mode 100644 application/dialogs/ModEditDialogCommon.h create mode 100644 application/dialogs/NewInstanceDialog.cpp create mode 100644 application/dialogs/NewInstanceDialog.h create mode 100644 application/dialogs/NewInstanceDialog.ui create mode 100644 application/dialogs/NotificationDialog.cpp create mode 100644 application/dialogs/NotificationDialog.h create mode 100644 application/dialogs/NotificationDialog.ui create mode 100644 application/dialogs/ProgressDialog.cpp create mode 100644 application/dialogs/ProgressDialog.h create mode 100644 application/dialogs/ProgressDialog.ui create mode 100644 application/dialogs/UpdateDialog.cpp create mode 100644 application/dialogs/UpdateDialog.h create mode 100644 application/dialogs/UpdateDialog.ui create mode 100644 application/dialogs/VersionSelectDialog.cpp create mode 100644 application/dialogs/VersionSelectDialog.h create mode 100644 application/dialogs/VersionSelectDialog.ui create mode 100644 application/groupview/GroupView.cpp create mode 100644 application/groupview/GroupView.h create mode 100644 application/groupview/GroupedProxyModel.cpp create mode 100644 application/groupview/GroupedProxyModel.h create mode 100644 application/groupview/InstanceDelegate.cpp create mode 100644 application/groupview/InstanceDelegate.h create mode 100644 application/groupview/VisualGroup.cpp create mode 100644 application/groupview/VisualGroup.h create mode 100644 application/install_prereqs.cmake.in create mode 100644 application/main.cpp create mode 100755 application/package/linux/MultiMC create mode 100644 application/pagedialog/PageDialog.cpp create mode 100644 application/pagedialog/PageDialog.h create mode 100644 application/pages/BasePage.h create mode 100644 application/pages/BasePageProvider.h create mode 100644 application/pages/InstanceSettingsPage.cpp create mode 100644 application/pages/InstanceSettingsPage.h create mode 100644 application/pages/InstanceSettingsPage.ui create mode 100644 application/pages/LogPage.cpp create mode 100644 application/pages/LogPage.h create mode 100644 application/pages/LogPage.ui create mode 100644 application/pages/ModFolderPage.cpp create mode 100644 application/pages/ModFolderPage.h create mode 100644 application/pages/ModFolderPage.ui create mode 100644 application/pages/NotesPage.cpp create mode 100644 application/pages/NotesPage.h create mode 100644 application/pages/NotesPage.ui create mode 100644 application/pages/OtherLogsPage.cpp create mode 100644 application/pages/OtherLogsPage.h create mode 100644 application/pages/OtherLogsPage.ui create mode 100644 application/pages/ResourcePackPage.h create mode 100644 application/pages/ScreenshotsPage.cpp create mode 100644 application/pages/ScreenshotsPage.h create mode 100644 application/pages/ScreenshotsPage.ui create mode 100644 application/pages/TexturePackPage.h create mode 100644 application/pages/VersionPage.cpp create mode 100644 application/pages/VersionPage.h create mode 100644 application/pages/VersionPage.ui create mode 100644 application/pages/global/AccountListPage.cpp create mode 100644 application/pages/global/AccountListPage.h create mode 100644 application/pages/global/AccountListPage.ui create mode 100644 application/pages/global/ExternalToolsPage.cpp create mode 100644 application/pages/global/ExternalToolsPage.h create mode 100644 application/pages/global/ExternalToolsPage.ui create mode 100644 application/pages/global/JavaPage.cpp create mode 100644 application/pages/global/JavaPage.h create mode 100644 application/pages/global/JavaPage.ui create mode 100644 application/pages/global/MinecraftPage.cpp create mode 100644 application/pages/global/MinecraftPage.h create mode 100644 application/pages/global/MinecraftPage.ui create mode 100644 application/pages/global/MultiMCPage.cpp create mode 100644 application/pages/global/MultiMCPage.h create mode 100644 application/pages/global/MultiMCPage.ui create mode 100644 application/pages/global/ProxyPage.cpp create mode 100644 application/pages/global/ProxyPage.h create mode 100644 application/pages/global/ProxyPage.ui create mode 100644 application/resources/MultiMC.icns create mode 100644 application/resources/MultiMC.ico create mode 100644 application/resources/MultiMC.manifest create mode 100644 application/resources/OSX/OSX.qrc create mode 100644 application/resources/OSX/index.theme create mode 100644 application/resources/OSX/scalable/about.svg create mode 100644 application/resources/OSX/scalable/accounts.svg create mode 100644 application/resources/OSX/scalable/bug.svg create mode 100644 application/resources/OSX/scalable/centralmods.svg create mode 100644 application/resources/OSX/scalable/checkupdate.svg create mode 100644 application/resources/OSX/scalable/copy.svg create mode 100644 application/resources/OSX/scalable/coremods.svg create mode 100644 application/resources/OSX/scalable/externaltools.svg create mode 100644 application/resources/OSX/scalable/instance-settings.svg create mode 100644 application/resources/OSX/scalable/jarmods.svg create mode 100644 application/resources/OSX/scalable/java.svg create mode 100644 application/resources/OSX/scalable/loadermods.svg create mode 100644 application/resources/OSX/scalable/log.svg create mode 100644 application/resources/OSX/scalable/minecraft.svg create mode 100644 application/resources/OSX/scalable/multimc.svg create mode 100644 application/resources/OSX/scalable/new.svg create mode 100644 application/resources/OSX/scalable/news.svg create mode 100644 application/resources/OSX/scalable/notes.svg create mode 100644 application/resources/OSX/scalable/patreon.svg create mode 100644 application/resources/OSX/scalable/proxy.svg create mode 100644 application/resources/OSX/scalable/quickmods.svg create mode 100644 application/resources/OSX/scalable/refresh.svg create mode 100644 application/resources/OSX/scalable/resourcepacks.svg create mode 100644 application/resources/OSX/scalable/screenshots.svg create mode 100644 application/resources/OSX/scalable/settings.svg create mode 100644 application/resources/OSX/scalable/status-bad.svg create mode 100644 application/resources/OSX/scalable/status-good.svg create mode 100644 application/resources/OSX/scalable/status-yellow.svg create mode 100644 application/resources/OSX/scalable/viewfolder.svg create mode 100644 application/resources/backgrounds/backgrounds.qrc create mode 100644 application/resources/backgrounds/catbgrnd2.png create mode 100644 application/resources/iOS/iOS.qrc create mode 100644 application/resources/iOS/index.theme create mode 100644 application/resources/iOS/scalable/about.svg create mode 100644 application/resources/iOS/scalable/accounts.svg create mode 100644 application/resources/iOS/scalable/bug.svg create mode 100644 application/resources/iOS/scalable/centralmods.svg create mode 100644 application/resources/iOS/scalable/checkupdate.svg create mode 100644 application/resources/iOS/scalable/copy.svg create mode 100644 application/resources/iOS/scalable/coremods.svg create mode 100644 application/resources/iOS/scalable/externaltools.svg create mode 100644 application/resources/iOS/scalable/instance-settings.svg create mode 100644 application/resources/iOS/scalable/jarmods.svg create mode 100644 application/resources/iOS/scalable/java.svg create mode 100644 application/resources/iOS/scalable/loadermods.svg create mode 100644 application/resources/iOS/scalable/log.svg create mode 100644 application/resources/iOS/scalable/minecraft.svg create mode 100644 application/resources/iOS/scalable/multimc.svg create mode 100644 application/resources/iOS/scalable/new.svg create mode 100644 application/resources/iOS/scalable/news.svg create mode 100644 application/resources/iOS/scalable/notes.svg create mode 100644 application/resources/iOS/scalable/patreon.svg create mode 100644 application/resources/iOS/scalable/proxy.svg create mode 100644 application/resources/iOS/scalable/quickmods.svg create mode 100644 application/resources/iOS/scalable/refresh.svg create mode 100644 application/resources/iOS/scalable/resourcepacks.svg create mode 100644 application/resources/iOS/scalable/screenshots.svg create mode 100644 application/resources/iOS/scalable/settings.svg create mode 100644 application/resources/iOS/scalable/status-bad.svg create mode 100644 application/resources/iOS/scalable/status-good.svg create mode 100644 application/resources/iOS/scalable/status-yellow.svg create mode 100644 application/resources/iOS/scalable/viewfolder.svg create mode 100644 application/resources/instances/brick.png create mode 100644 application/resources/instances/broken.png create mode 100644 application/resources/instances/chicken.png create mode 100644 application/resources/instances/chicken128.png create mode 100644 application/resources/instances/creeper.png create mode 100644 application/resources/instances/creeper128.png create mode 100644 application/resources/instances/derp.png create mode 100644 application/resources/instances/diamond.png create mode 100644 application/resources/instances/dirt.png create mode 100644 application/resources/instances/enderman.png create mode 100644 application/resources/instances/enderpearl.png create mode 100644 application/resources/instances/enderpearl128.png create mode 100644 application/resources/instances/ftb_glow.png create mode 100644 application/resources/instances/ftb_glow128.png create mode 100644 application/resources/instances/ftb_logo.png create mode 100644 application/resources/instances/ftb_logo128.png create mode 100644 application/resources/instances/gear.png create mode 100644 application/resources/instances/gear128.png create mode 100644 application/resources/instances/gold.png create mode 100644 application/resources/instances/grass.png create mode 100644 application/resources/instances/herobrine.png create mode 100644 application/resources/instances/herobrine128.png create mode 100644 application/resources/instances/infinity.png create mode 100644 application/resources/instances/infinity128.png create mode 100644 application/resources/instances/instances.qrc create mode 100644 application/resources/instances/iron.png create mode 100644 application/resources/instances/kitten.png create mode 100644 application/resources/instances/magitech.png create mode 100644 application/resources/instances/magitech128.png create mode 100644 application/resources/instances/meat.png create mode 100644 application/resources/instances/meat128.png create mode 100644 application/resources/instances/netherstar.png create mode 100644 application/resources/instances/netherstar128.png create mode 100644 application/resources/instances/planks.png create mode 100644 application/resources/instances/skeleton.png create mode 100644 application/resources/instances/skeleton128.png create mode 100644 application/resources/instances/squarecreeper.png create mode 100644 application/resources/instances/squarecreeper128.png create mode 100644 application/resources/instances/steve.png create mode 100644 application/resources/instances/steve128.png create mode 100644 application/resources/instances/stone.png create mode 100644 application/resources/instances/tnt.png create mode 100644 application/resources/instances/updateavailable.png create mode 100644 application/resources/multimc.rc create mode 100644 application/resources/multimc/16x16/about.png create mode 100644 application/resources/multimc/16x16/bug.png create mode 100644 application/resources/multimc/16x16/cat.png create mode 100644 application/resources/multimc/16x16/centralmods.png create mode 100644 application/resources/multimc/16x16/checkupdate.png create mode 100644 application/resources/multimc/16x16/copy.png create mode 100644 application/resources/multimc/16x16/coremods.png create mode 100644 application/resources/multimc/16x16/help.png create mode 100644 application/resources/multimc/16x16/instance-settings.png create mode 100644 application/resources/multimc/16x16/jarmods.png create mode 100644 application/resources/multimc/16x16/loadermods.png create mode 100644 application/resources/multimc/16x16/log.png create mode 100644 application/resources/multimc/16x16/minecraft.png create mode 100644 application/resources/multimc/16x16/new.png create mode 100644 application/resources/multimc/16x16/news.png create mode 100644 application/resources/multimc/16x16/noaccount.png create mode 100644 application/resources/multimc/16x16/patreon.png create mode 100644 application/resources/multimc/16x16/refresh.png create mode 100644 application/resources/multimc/16x16/resourcepacks.png create mode 100644 application/resources/multimc/16x16/screenshots.png create mode 100644 application/resources/multimc/16x16/settings.png create mode 100644 application/resources/multimc/16x16/status-bad.png create mode 100644 application/resources/multimc/16x16/status-good.png create mode 100644 application/resources/multimc/16x16/status-yellow.png create mode 100644 application/resources/multimc/16x16/viewfolder.png create mode 100644 application/resources/multimc/22x22/about.png create mode 100644 application/resources/multimc/22x22/bug.png create mode 100644 application/resources/multimc/22x22/cat.png create mode 100644 application/resources/multimc/22x22/centralmods.png create mode 100644 application/resources/multimc/22x22/checkupdate.png create mode 100644 application/resources/multimc/22x22/copy.png create mode 100644 application/resources/multimc/22x22/help.png create mode 100644 application/resources/multimc/22x22/instance-settings.png create mode 100644 application/resources/multimc/22x22/new.png create mode 100644 application/resources/multimc/22x22/news.png create mode 100644 application/resources/multimc/22x22/patreon.png create mode 100644 application/resources/multimc/22x22/refresh.png create mode 100644 application/resources/multimc/22x22/screenshots.png create mode 100644 application/resources/multimc/22x22/settings.png create mode 100644 application/resources/multimc/22x22/status-bad.png create mode 100644 application/resources/multimc/22x22/status-good.png create mode 100644 application/resources/multimc/22x22/status-yellow.png create mode 100644 application/resources/multimc/22x22/viewfolder.png create mode 100644 application/resources/multimc/24x24/cat.png create mode 100644 application/resources/multimc/24x24/coremods.png create mode 100644 application/resources/multimc/24x24/jarmods.png create mode 100644 application/resources/multimc/24x24/loadermods.png create mode 100644 application/resources/multimc/24x24/log.png create mode 100644 application/resources/multimc/24x24/minecraft.png create mode 100644 application/resources/multimc/24x24/noaccount.png create mode 100644 application/resources/multimc/24x24/patreon.png create mode 100644 application/resources/multimc/24x24/resourcepacks.png create mode 100644 application/resources/multimc/24x24/status-bad.png create mode 100644 application/resources/multimc/24x24/status-good.png create mode 100644 application/resources/multimc/24x24/status-yellow.png create mode 100644 application/resources/multimc/256x256/minecraft.png create mode 100644 application/resources/multimc/32x32/about.png create mode 100644 application/resources/multimc/32x32/bug.png create mode 100644 application/resources/multimc/32x32/cat.png create mode 100644 application/resources/multimc/32x32/centralmods.png create mode 100644 application/resources/multimc/32x32/checkupdate.png create mode 100644 application/resources/multimc/32x32/copy.png create mode 100644 application/resources/multimc/32x32/coremods.png create mode 100644 application/resources/multimc/32x32/help.png create mode 100644 application/resources/multimc/32x32/instance-settings.png create mode 100644 application/resources/multimc/32x32/jarmods.png create mode 100644 application/resources/multimc/32x32/loadermods.png create mode 100644 application/resources/multimc/32x32/log.png create mode 100644 application/resources/multimc/32x32/minecraft.png create mode 100644 application/resources/multimc/32x32/new.png create mode 100644 application/resources/multimc/32x32/news.png create mode 100644 application/resources/multimc/32x32/noaccount.png create mode 100644 application/resources/multimc/32x32/patreon.png create mode 100644 application/resources/multimc/32x32/refresh.png create mode 100644 application/resources/multimc/32x32/resourcepacks.png create mode 100644 application/resources/multimc/32x32/screenshots.png create mode 100644 application/resources/multimc/32x32/settings.png create mode 100644 application/resources/multimc/32x32/status-bad.png create mode 100644 application/resources/multimc/32x32/status-good.png create mode 100644 application/resources/multimc/32x32/status-yellow.png create mode 100644 application/resources/multimc/32x32/viewfolder.png create mode 100644 application/resources/multimc/48x48/about.png create mode 100644 application/resources/multimc/48x48/bug.png create mode 100644 application/resources/multimc/48x48/cat.png create mode 100644 application/resources/multimc/48x48/centralmods.png create mode 100644 application/resources/multimc/48x48/checkupdate.png create mode 100644 application/resources/multimc/48x48/copy.png create mode 100644 application/resources/multimc/48x48/help.png create mode 100644 application/resources/multimc/48x48/instance-settings.png create mode 100644 application/resources/multimc/48x48/log.png create mode 100644 application/resources/multimc/48x48/minecraft.png create mode 100644 application/resources/multimc/48x48/new.png create mode 100644 application/resources/multimc/48x48/news.png create mode 100644 application/resources/multimc/48x48/noaccount.png create mode 100644 application/resources/multimc/48x48/patreon.png create mode 100644 application/resources/multimc/48x48/refresh.png create mode 100644 application/resources/multimc/48x48/screenshots.png create mode 100644 application/resources/multimc/48x48/settings.png create mode 100644 application/resources/multimc/48x48/status-bad.png create mode 100644 application/resources/multimc/48x48/status-good.png create mode 100644 application/resources/multimc/48x48/status-yellow.png create mode 100644 application/resources/multimc/48x48/viewfolder.png create mode 100644 application/resources/multimc/64x64/about.png create mode 100644 application/resources/multimc/64x64/bug.png create mode 100644 application/resources/multimc/64x64/cat.png create mode 100644 application/resources/multimc/64x64/centralmods.png create mode 100644 application/resources/multimc/64x64/checkupdate.png create mode 100644 application/resources/multimc/64x64/copy.png create mode 100644 application/resources/multimc/64x64/coremods.png create mode 100644 application/resources/multimc/64x64/help.png create mode 100644 application/resources/multimc/64x64/instance-settings.png create mode 100644 application/resources/multimc/64x64/jarmods.png create mode 100644 application/resources/multimc/64x64/loadermods.png create mode 100644 application/resources/multimc/64x64/log.png create mode 100644 application/resources/multimc/64x64/new.png create mode 100644 application/resources/multimc/64x64/news.png create mode 100644 application/resources/multimc/64x64/patreon.png create mode 100644 application/resources/multimc/64x64/refresh.png create mode 100644 application/resources/multimc/64x64/resourcepacks.png create mode 100644 application/resources/multimc/64x64/screenshots.png create mode 100644 application/resources/multimc/64x64/settings.png create mode 100644 application/resources/multimc/64x64/status-bad.png create mode 100644 application/resources/multimc/64x64/status-good.png create mode 100644 application/resources/multimc/64x64/status-yellow.png create mode 100644 application/resources/multimc/64x64/viewfolder.png create mode 100644 application/resources/multimc/8x8/noaccount.png create mode 100644 application/resources/multimc/index.theme create mode 100644 application/resources/multimc/multimc.qrc create mode 100644 application/resources/multimc/scalable/bug.svg create mode 100644 application/resources/multimc/scalable/centralmods.svg create mode 100644 application/resources/multimc/scalable/checkupdate.svg create mode 100644 application/resources/multimc/scalable/console.svg create mode 100644 application/resources/multimc/scalable/console_error.svg create mode 100644 application/resources/multimc/scalable/java.svg create mode 100644 application/resources/multimc/scalable/multimc.svg create mode 100644 application/resources/multimc/scalable/new.svg create mode 100644 application/resources/multimc/scalable/news.svg create mode 100644 application/resources/multimc/scalable/proxy.svg create mode 100644 application/resources/multimc/scalable/screenshot-placeholder.svg create mode 100644 application/resources/multimc/scalable/screenshots.svg create mode 100644 application/resources/multimc/scalable/status-bad.svg create mode 100644 application/resources/multimc/scalable/status-good.svg create mode 100644 application/resources/multimc/scalable/status-yellow.svg create mode 100644 application/resources/multimc/scalable/viewfolder.svg create mode 100644 application/resources/pe_blue/index.theme create mode 100644 application/resources/pe_blue/pe_blue.qrc create mode 100644 application/resources/pe_blue/scalable/about.svg create mode 100644 application/resources/pe_blue/scalable/accounts.svg create mode 100644 application/resources/pe_blue/scalable/bug.svg create mode 100644 application/resources/pe_blue/scalable/centralmods.svg create mode 100644 application/resources/pe_blue/scalable/checkupdate.svg create mode 100644 application/resources/pe_blue/scalable/copy.svg create mode 100644 application/resources/pe_blue/scalable/coremods.svg create mode 100644 application/resources/pe_blue/scalable/externaltools.svg create mode 100644 application/resources/pe_blue/scalable/instance-settings.svg create mode 100644 application/resources/pe_blue/scalable/jarmods.svg create mode 100644 application/resources/pe_blue/scalable/java.svg create mode 100644 application/resources/pe_blue/scalable/loadermods.svg create mode 100644 application/resources/pe_blue/scalable/log.svg create mode 100644 application/resources/pe_blue/scalable/minecraft.svg create mode 100644 application/resources/pe_blue/scalable/multimc.svg create mode 100644 application/resources/pe_blue/scalable/new.svg create mode 100644 application/resources/pe_blue/scalable/news.svg create mode 100644 application/resources/pe_blue/scalable/notes.svg create mode 100644 application/resources/pe_blue/scalable/patreon.svg create mode 100644 application/resources/pe_blue/scalable/proxy.svg create mode 100644 application/resources/pe_blue/scalable/quickmods.svg create mode 100644 application/resources/pe_blue/scalable/refresh.svg create mode 100644 application/resources/pe_blue/scalable/resourcepacks.svg create mode 100644 application/resources/pe_blue/scalable/screenshots.svg create mode 100644 application/resources/pe_blue/scalable/settings.svg create mode 100644 application/resources/pe_blue/scalable/status-bad.svg create mode 100644 application/resources/pe_blue/scalable/status-good.svg create mode 100644 application/resources/pe_blue/scalable/status-yellow.svg create mode 100644 application/resources/pe_blue/scalable/viewfolder.svg create mode 100644 application/resources/pe_colored/index.theme create mode 100644 application/resources/pe_colored/pe_colored.qrc create mode 100644 application/resources/pe_colored/scalable/about.svg create mode 100644 application/resources/pe_colored/scalable/accounts.svg create mode 100644 application/resources/pe_colored/scalable/bug.svg create mode 100644 application/resources/pe_colored/scalable/centralmods.svg create mode 100644 application/resources/pe_colored/scalable/checkupdate.svg create mode 100644 application/resources/pe_colored/scalable/copy.svg create mode 100644 application/resources/pe_colored/scalable/coremods.svg create mode 100644 application/resources/pe_colored/scalable/externaltools.svg create mode 100644 application/resources/pe_colored/scalable/instance-settings.svg create mode 100644 application/resources/pe_colored/scalable/jarmods.svg create mode 100644 application/resources/pe_colored/scalable/java.svg create mode 100644 application/resources/pe_colored/scalable/loadermods.svg create mode 100644 application/resources/pe_colored/scalable/log.svg create mode 100644 application/resources/pe_colored/scalable/minecraft.svg create mode 100644 application/resources/pe_colored/scalable/multimc.svg create mode 100644 application/resources/pe_colored/scalable/new.svg create mode 100644 application/resources/pe_colored/scalable/news.svg create mode 100644 application/resources/pe_colored/scalable/notes.svg create mode 100644 application/resources/pe_colored/scalable/patreon.svg create mode 100644 application/resources/pe_colored/scalable/proxy.svg create mode 100644 application/resources/pe_colored/scalable/quickmods.svg create mode 100644 application/resources/pe_colored/scalable/refresh.svg create mode 100644 application/resources/pe_colored/scalable/resourcepacks.svg create mode 100644 application/resources/pe_colored/scalable/screenshots.svg create mode 100644 application/resources/pe_colored/scalable/settings.svg create mode 100644 application/resources/pe_colored/scalable/status-bad.svg create mode 100644 application/resources/pe_colored/scalable/status-good.svg create mode 100644 application/resources/pe_colored/scalable/status-yellow.svg create mode 100644 application/resources/pe_colored/scalable/viewfolder.svg create mode 100644 application/resources/pe_dark/index.theme create mode 100644 application/resources/pe_dark/pe_dark.qrc create mode 100644 application/resources/pe_dark/scalable/about.svg create mode 100644 application/resources/pe_dark/scalable/accounts.svg create mode 100644 application/resources/pe_dark/scalable/bug.svg create mode 100644 application/resources/pe_dark/scalable/centralmods.svg create mode 100644 application/resources/pe_dark/scalable/checkupdate.svg create mode 100644 application/resources/pe_dark/scalable/copy.svg create mode 100644 application/resources/pe_dark/scalable/coremods.svg create mode 100644 application/resources/pe_dark/scalable/externaltools.svg create mode 100644 application/resources/pe_dark/scalable/instance-settings.svg create mode 100644 application/resources/pe_dark/scalable/jarmods.svg create mode 100644 application/resources/pe_dark/scalable/java.svg create mode 100644 application/resources/pe_dark/scalable/loadermods.svg create mode 100644 application/resources/pe_dark/scalable/log.svg create mode 100644 application/resources/pe_dark/scalable/minecraft.svg create mode 100644 application/resources/pe_dark/scalable/multimc.svg create mode 100644 application/resources/pe_dark/scalable/new.svg create mode 100644 application/resources/pe_dark/scalable/news.svg create mode 100644 application/resources/pe_dark/scalable/notes.svg create mode 100644 application/resources/pe_dark/scalable/patreon.svg create mode 100644 application/resources/pe_dark/scalable/proxy.svg create mode 100644 application/resources/pe_dark/scalable/quickmods.svg create mode 100644 application/resources/pe_dark/scalable/refresh.svg create mode 100644 application/resources/pe_dark/scalable/resourcepacks.svg create mode 100644 application/resources/pe_dark/scalable/screenshots.svg create mode 100644 application/resources/pe_dark/scalable/settings.svg create mode 100644 application/resources/pe_dark/scalable/status-bad.svg create mode 100644 application/resources/pe_dark/scalable/status-good.svg create mode 100644 application/resources/pe_dark/scalable/status-yellow.svg create mode 100644 application/resources/pe_dark/scalable/viewfolder.svg create mode 100644 application/resources/pe_light/index.theme create mode 100644 application/resources/pe_light/pe_light.qrc create mode 100644 application/resources/pe_light/scalable/about.svg create mode 100644 application/resources/pe_light/scalable/accounts.svg create mode 100644 application/resources/pe_light/scalable/bug.svg create mode 100644 application/resources/pe_light/scalable/centralmods.svg create mode 100644 application/resources/pe_light/scalable/checkupdate.svg create mode 100644 application/resources/pe_light/scalable/copy.svg create mode 100644 application/resources/pe_light/scalable/coremods.svg create mode 100644 application/resources/pe_light/scalable/externaltools.svg create mode 100644 application/resources/pe_light/scalable/instance-settings.svg create mode 100644 application/resources/pe_light/scalable/jarmods.svg create mode 100644 application/resources/pe_light/scalable/java.svg create mode 100644 application/resources/pe_light/scalable/loadermods.svg create mode 100644 application/resources/pe_light/scalable/log.svg create mode 100644 application/resources/pe_light/scalable/minecraft.svg create mode 100644 application/resources/pe_light/scalable/multimc.svg create mode 100644 application/resources/pe_light/scalable/new.svg create mode 100644 application/resources/pe_light/scalable/news.svg create mode 100644 application/resources/pe_light/scalable/notes.svg create mode 100644 application/resources/pe_light/scalable/patreon.svg create mode 100644 application/resources/pe_light/scalable/proxy.svg create mode 100644 application/resources/pe_light/scalable/quickmods.svg create mode 100644 application/resources/pe_light/scalable/refresh.svg create mode 100644 application/resources/pe_light/scalable/resourcepacks.svg create mode 100644 application/resources/pe_light/scalable/screenshots.svg create mode 100644 application/resources/pe_light/scalable/settings.svg create mode 100644 application/resources/pe_light/scalable/status-bad.svg create mode 100644 application/resources/pe_light/scalable/status-good.svg create mode 100644 application/resources/pe_light/scalable/status-yellow.svg create mode 100644 application/resources/pe_light/scalable/viewfolder.svg create mode 100644 application/resources/sources/clucker.svg create mode 100644 application/resources/sources/creeper.svg create mode 100644 application/resources/sources/enderpearl.svg create mode 100644 application/resources/sources/ftb-glow.svg create mode 100644 application/resources/sources/ftb-logo.svg create mode 100644 application/resources/sources/gear.svg create mode 100644 application/resources/sources/herobrine.svg create mode 100644 application/resources/sources/magitech.svg create mode 100644 application/resources/sources/meat.svg create mode 100644 application/resources/sources/netherstar.svg create mode 100644 application/resources/sources/pskeleton.svg create mode 100644 application/resources/sources/skeleton.svg create mode 100644 application/resources/sources/squarecreeper.svg create mode 100644 application/resources/sources/steve.svg create mode 100644 application/resources/versions/LWJGL/2.9.0.json create mode 100644 application/resources/versions/LWJGL/2.9.1-nightly-20130708-debug3.json create mode 100644 application/resources/versions/LWJGL/2.9.1.json create mode 100644 application/resources/versions/LWJGL/2.9.2-nightly-20140822.json create mode 100644 application/resources/versions/minecraft.json create mode 100644 application/resources/versions/versions.qrc create mode 100644 application/widgets/Common.cpp create mode 100644 application/widgets/Common.h create mode 100644 application/widgets/IconLabel.cpp create mode 100644 application/widgets/IconLabel.h create mode 100644 application/widgets/LabeledToolButton.cpp create mode 100644 application/widgets/LabeledToolButton.h create mode 100644 application/widgets/LineSeparator.cpp create mode 100644 application/widgets/LineSeparator.h create mode 100644 application/widgets/MCModInfoFrame.cpp create mode 100644 application/widgets/MCModInfoFrame.h create mode 100644 application/widgets/MCModInfoFrame.ui create mode 100644 application/widgets/ModListView.cpp create mode 100644 application/widgets/ModListView.h create mode 100644 application/widgets/PageContainer.cpp create mode 100644 application/widgets/PageContainer.h create mode 100644 application/widgets/PageContainer_p.h create mode 100644 application/widgets/ServerStatus.cpp create mode 100644 application/widgets/ServerStatus.h create mode 100644 application/widgets/VersionListView.cpp create mode 100644 application/widgets/VersionListView.h delete mode 100644 gui/ColumnResizer.cpp delete mode 100644 gui/ColumnResizer.h delete mode 100644 gui/ConsoleWindow.cpp delete mode 100644 gui/ConsoleWindow.h delete mode 100644 gui/GuiUtil.cpp delete mode 100644 gui/GuiUtil.h delete mode 100644 gui/InstancePageProvider.cpp delete mode 100644 gui/InstancePageProvider.h delete mode 100644 gui/InstanceProxyModel.cpp delete mode 100644 gui/InstanceProxyModel.h delete mode 100644 gui/MainWindow.cpp delete mode 100644 gui/MainWindow.h delete mode 100644 gui/NagUtils.cpp delete mode 100644 gui/NagUtils.h delete mode 100644 gui/Platform.h delete mode 100644 gui/Platform_Other.cpp delete mode 100644 gui/Platform_X11.cpp delete mode 100644 gui/dialogs/AboutDialog.cpp delete mode 100644 gui/dialogs/AboutDialog.h delete mode 100644 gui/dialogs/AboutDialog.ui delete mode 100644 gui/dialogs/AccountSelectDialog.cpp delete mode 100644 gui/dialogs/AccountSelectDialog.h delete mode 100644 gui/dialogs/AccountSelectDialog.ui delete mode 100644 gui/dialogs/CopyInstanceDialog.cpp delete mode 100644 gui/dialogs/CopyInstanceDialog.h delete mode 100644 gui/dialogs/CopyInstanceDialog.ui delete mode 100644 gui/dialogs/CustomMessageBox.cpp delete mode 100644 gui/dialogs/CustomMessageBox.h delete mode 100644 gui/dialogs/EditAccountDialog.cpp delete mode 100644 gui/dialogs/EditAccountDialog.h delete mode 100644 gui/dialogs/EditAccountDialog.ui delete mode 100644 gui/dialogs/IconPickerDialog.cpp delete mode 100644 gui/dialogs/IconPickerDialog.h delete mode 100644 gui/dialogs/IconPickerDialog.ui delete mode 100644 gui/dialogs/LoginDialog.cpp delete mode 100644 gui/dialogs/LoginDialog.h delete mode 100644 gui/dialogs/LoginDialog.ui delete mode 100644 gui/dialogs/ModEditDialogCommon.cpp delete mode 100644 gui/dialogs/ModEditDialogCommon.h delete mode 100644 gui/dialogs/NewInstanceDialog.cpp delete mode 100644 gui/dialogs/NewInstanceDialog.h delete mode 100644 gui/dialogs/NewInstanceDialog.ui delete mode 100644 gui/dialogs/NotificationDialog.cpp delete mode 100644 gui/dialogs/NotificationDialog.h delete mode 100644 gui/dialogs/NotificationDialog.ui delete mode 100644 gui/dialogs/ProgressDialog.cpp delete mode 100644 gui/dialogs/ProgressDialog.h delete mode 100644 gui/dialogs/ProgressDialog.ui delete mode 100644 gui/dialogs/UpdateDialog.cpp delete mode 100644 gui/dialogs/UpdateDialog.h delete mode 100644 gui/dialogs/UpdateDialog.ui delete mode 100644 gui/dialogs/VersionSelectDialog.cpp delete mode 100644 gui/dialogs/VersionSelectDialog.h delete mode 100644 gui/dialogs/VersionSelectDialog.ui delete mode 100644 gui/groupview/GroupView.cpp delete mode 100644 gui/groupview/GroupView.h delete mode 100644 gui/groupview/GroupedProxyModel.cpp delete mode 100644 gui/groupview/GroupedProxyModel.h delete mode 100644 gui/groupview/InstanceDelegate.cpp delete mode 100644 gui/groupview/InstanceDelegate.h delete mode 100644 gui/groupview/VisualGroup.cpp delete mode 100644 gui/groupview/VisualGroup.h delete mode 100644 gui/pagedialog/PageDialog.cpp delete mode 100644 gui/pagedialog/PageDialog.h delete mode 100644 gui/pages/BasePage.h delete mode 100644 gui/pages/BasePageProvider.h delete mode 100644 gui/pages/InstanceSettingsPage.cpp delete mode 100644 gui/pages/InstanceSettingsPage.h delete mode 100644 gui/pages/InstanceSettingsPage.ui delete mode 100644 gui/pages/LogPage.cpp delete mode 100644 gui/pages/LogPage.h delete mode 100644 gui/pages/LogPage.ui delete mode 100644 gui/pages/ModFolderPage.cpp delete mode 100644 gui/pages/ModFolderPage.h delete mode 100644 gui/pages/ModFolderPage.ui delete mode 100644 gui/pages/NotesPage.cpp delete mode 100644 gui/pages/NotesPage.h delete mode 100644 gui/pages/NotesPage.ui delete mode 100644 gui/pages/OtherLogsPage.cpp delete mode 100644 gui/pages/OtherLogsPage.h delete mode 100644 gui/pages/OtherLogsPage.ui delete mode 100644 gui/pages/ResourcePackPage.h delete mode 100644 gui/pages/ScreenshotsPage.cpp delete mode 100644 gui/pages/ScreenshotsPage.h delete mode 100644 gui/pages/ScreenshotsPage.ui delete mode 100644 gui/pages/TexturePackPage.h delete mode 100644 gui/pages/VersionPage.cpp delete mode 100644 gui/pages/VersionPage.h delete mode 100644 gui/pages/VersionPage.ui delete mode 100644 gui/pages/global/AccountListPage.cpp delete mode 100644 gui/pages/global/AccountListPage.h delete mode 100644 gui/pages/global/AccountListPage.ui delete mode 100644 gui/pages/global/ExternalToolsPage.cpp delete mode 100644 gui/pages/global/ExternalToolsPage.h delete mode 100644 gui/pages/global/ExternalToolsPage.ui delete mode 100644 gui/pages/global/JavaPage.cpp delete mode 100644 gui/pages/global/JavaPage.h delete mode 100644 gui/pages/global/JavaPage.ui delete mode 100644 gui/pages/global/MinecraftPage.cpp delete mode 100644 gui/pages/global/MinecraftPage.h delete mode 100644 gui/pages/global/MinecraftPage.ui delete mode 100644 gui/pages/global/MultiMCPage.cpp delete mode 100644 gui/pages/global/MultiMCPage.h delete mode 100644 gui/pages/global/MultiMCPage.ui delete mode 100644 gui/pages/global/ProxyPage.cpp delete mode 100644 gui/pages/global/ProxyPage.h delete mode 100644 gui/pages/global/ProxyPage.ui delete mode 100644 gui/widgets/Common.cpp delete mode 100644 gui/widgets/Common.h delete mode 100644 gui/widgets/IconLabel.cpp delete mode 100644 gui/widgets/IconLabel.h delete mode 100644 gui/widgets/LabeledToolButton.cpp delete mode 100644 gui/widgets/LabeledToolButton.h delete mode 100644 gui/widgets/LineSeparator.cpp delete mode 100644 gui/widgets/LineSeparator.h delete mode 100644 gui/widgets/MCModInfoFrame.cpp delete mode 100644 gui/widgets/MCModInfoFrame.h delete mode 100644 gui/widgets/MCModInfoFrame.ui delete mode 100644 gui/widgets/ModListView.cpp delete mode 100644 gui/widgets/ModListView.h delete mode 100644 gui/widgets/PageContainer.cpp delete mode 100644 gui/widgets/PageContainer.h delete mode 100644 gui/widgets/PageContainer_p.h delete mode 100644 gui/widgets/ServerStatus.cpp delete mode 100644 gui/widgets/ServerStatus.h delete mode 100644 gui/widgets/VersionListView.cpp delete mode 100644 gui/widgets/VersionListView.h delete mode 100644 install_prereqs.cmake.in create mode 100644 logic/CMakeLists.txt create mode 100644 logic/MMCError.h delete mode 100644 main.cpp delete mode 100755 package/linux/MultiMC delete mode 100644 resources/MultiMC.icns delete mode 100644 resources/MultiMC.ico delete mode 100644 resources/MultiMC.manifest delete mode 100644 resources/OSX/OSX.qrc delete mode 100644 resources/OSX/index.theme delete mode 100644 resources/OSX/scalable/about.svg delete mode 100644 resources/OSX/scalable/accounts.svg delete mode 100644 resources/OSX/scalable/bug.svg delete mode 100644 resources/OSX/scalable/centralmods.svg delete mode 100644 resources/OSX/scalable/checkupdate.svg delete mode 100644 resources/OSX/scalable/copy.svg delete mode 100644 resources/OSX/scalable/coremods.svg delete mode 100644 resources/OSX/scalable/externaltools.svg delete mode 100644 resources/OSX/scalable/instance-settings.svg delete mode 100644 resources/OSX/scalable/jarmods.svg delete mode 100644 resources/OSX/scalable/java.svg delete mode 100644 resources/OSX/scalable/loadermods.svg delete mode 100644 resources/OSX/scalable/log.svg delete mode 100644 resources/OSX/scalable/minecraft.svg delete mode 100644 resources/OSX/scalable/multimc.svg delete mode 100644 resources/OSX/scalable/new.svg delete mode 100644 resources/OSX/scalable/news.svg delete mode 100644 resources/OSX/scalable/notes.svg delete mode 100644 resources/OSX/scalable/patreon.svg delete mode 100644 resources/OSX/scalable/proxy.svg delete mode 100644 resources/OSX/scalable/quickmods.svg delete mode 100644 resources/OSX/scalable/refresh.svg delete mode 100644 resources/OSX/scalable/resourcepacks.svg delete mode 100644 resources/OSX/scalable/screenshots.svg delete mode 100644 resources/OSX/scalable/settings.svg delete mode 100644 resources/OSX/scalable/status-bad.svg delete mode 100644 resources/OSX/scalable/status-good.svg delete mode 100644 resources/OSX/scalable/status-yellow.svg delete mode 100644 resources/OSX/scalable/viewfolder.svg delete mode 100644 resources/backgrounds/backgrounds.qrc delete mode 100644 resources/backgrounds/catbgrnd2.png delete mode 100644 resources/iOS/iOS.qrc delete mode 100644 resources/iOS/index.theme delete mode 100644 resources/iOS/scalable/about.svg delete mode 100644 resources/iOS/scalable/accounts.svg delete mode 100644 resources/iOS/scalable/bug.svg delete mode 100644 resources/iOS/scalable/centralmods.svg delete mode 100644 resources/iOS/scalable/checkupdate.svg delete mode 100644 resources/iOS/scalable/copy.svg delete mode 100644 resources/iOS/scalable/coremods.svg delete mode 100644 resources/iOS/scalable/externaltools.svg delete mode 100644 resources/iOS/scalable/instance-settings.svg delete mode 100644 resources/iOS/scalable/jarmods.svg delete mode 100644 resources/iOS/scalable/java.svg delete mode 100644 resources/iOS/scalable/loadermods.svg delete mode 100644 resources/iOS/scalable/log.svg delete mode 100644 resources/iOS/scalable/minecraft.svg delete mode 100644 resources/iOS/scalable/multimc.svg delete mode 100644 resources/iOS/scalable/new.svg delete mode 100644 resources/iOS/scalable/news.svg delete mode 100644 resources/iOS/scalable/notes.svg delete mode 100644 resources/iOS/scalable/patreon.svg delete mode 100644 resources/iOS/scalable/proxy.svg delete mode 100644 resources/iOS/scalable/quickmods.svg delete mode 100644 resources/iOS/scalable/refresh.svg delete mode 100644 resources/iOS/scalable/resourcepacks.svg delete mode 100644 resources/iOS/scalable/screenshots.svg delete mode 100644 resources/iOS/scalable/settings.svg delete mode 100644 resources/iOS/scalable/status-bad.svg delete mode 100644 resources/iOS/scalable/status-good.svg delete mode 100644 resources/iOS/scalable/status-yellow.svg delete mode 100644 resources/iOS/scalable/viewfolder.svg delete mode 100644 resources/instances/brick.png delete mode 100644 resources/instances/broken.png delete mode 100644 resources/instances/chicken.png delete mode 100644 resources/instances/chicken128.png delete mode 100644 resources/instances/creeper.png delete mode 100644 resources/instances/creeper128.png delete mode 100644 resources/instances/derp.png delete mode 100644 resources/instances/diamond.png delete mode 100644 resources/instances/dirt.png delete mode 100644 resources/instances/enderman.png delete mode 100644 resources/instances/enderpearl.png delete mode 100644 resources/instances/enderpearl128.png delete mode 100644 resources/instances/ftb_glow.png delete mode 100644 resources/instances/ftb_glow128.png delete mode 100644 resources/instances/ftb_logo.png delete mode 100644 resources/instances/ftb_logo128.png delete mode 100644 resources/instances/gear.png delete mode 100644 resources/instances/gear128.png delete mode 100644 resources/instances/gold.png delete mode 100644 resources/instances/grass.png delete mode 100644 resources/instances/herobrine.png delete mode 100644 resources/instances/herobrine128.png delete mode 100644 resources/instances/infinity.png delete mode 100644 resources/instances/infinity128.png delete mode 100644 resources/instances/instances.qrc delete mode 100644 resources/instances/iron.png delete mode 100644 resources/instances/kitten.png delete mode 100644 resources/instances/magitech.png delete mode 100644 resources/instances/magitech128.png delete mode 100644 resources/instances/meat.png delete mode 100644 resources/instances/meat128.png delete mode 100644 resources/instances/netherstar.png delete mode 100644 resources/instances/netherstar128.png delete mode 100644 resources/instances/planks.png delete mode 100644 resources/instances/skeleton.png delete mode 100644 resources/instances/skeleton128.png delete mode 100644 resources/instances/squarecreeper.png delete mode 100644 resources/instances/squarecreeper128.png delete mode 100644 resources/instances/steve.png delete mode 100644 resources/instances/steve128.png delete mode 100644 resources/instances/stone.png delete mode 100644 resources/instances/tnt.png delete mode 100644 resources/instances/updateavailable.png delete mode 100644 resources/multimc.rc delete mode 100644 resources/multimc/16x16/about.png delete mode 100644 resources/multimc/16x16/bug.png delete mode 100644 resources/multimc/16x16/cat.png delete mode 100644 resources/multimc/16x16/centralmods.png delete mode 100644 resources/multimc/16x16/checkupdate.png delete mode 100644 resources/multimc/16x16/copy.png delete mode 100644 resources/multimc/16x16/coremods.png delete mode 100644 resources/multimc/16x16/help.png delete mode 100644 resources/multimc/16x16/instance-settings.png delete mode 100644 resources/multimc/16x16/jarmods.png delete mode 100644 resources/multimc/16x16/loadermods.png delete mode 100644 resources/multimc/16x16/log.png delete mode 100644 resources/multimc/16x16/minecraft.png delete mode 100644 resources/multimc/16x16/new.png delete mode 100644 resources/multimc/16x16/news.png delete mode 100644 resources/multimc/16x16/noaccount.png delete mode 100644 resources/multimc/16x16/patreon.png delete mode 100644 resources/multimc/16x16/refresh.png delete mode 100644 resources/multimc/16x16/resourcepacks.png delete mode 100644 resources/multimc/16x16/screenshots.png delete mode 100644 resources/multimc/16x16/settings.png delete mode 100644 resources/multimc/16x16/status-bad.png delete mode 100644 resources/multimc/16x16/status-good.png delete mode 100644 resources/multimc/16x16/status-yellow.png delete mode 100644 resources/multimc/16x16/viewfolder.png delete mode 100644 resources/multimc/22x22/about.png delete mode 100644 resources/multimc/22x22/bug.png delete mode 100644 resources/multimc/22x22/cat.png delete mode 100644 resources/multimc/22x22/centralmods.png delete mode 100644 resources/multimc/22x22/checkupdate.png delete mode 100644 resources/multimc/22x22/copy.png delete mode 100644 resources/multimc/22x22/help.png delete mode 100644 resources/multimc/22x22/instance-settings.png delete mode 100644 resources/multimc/22x22/new.png delete mode 100644 resources/multimc/22x22/news.png delete mode 100644 resources/multimc/22x22/patreon.png delete mode 100644 resources/multimc/22x22/refresh.png delete mode 100644 resources/multimc/22x22/screenshots.png delete mode 100644 resources/multimc/22x22/settings.png delete mode 100644 resources/multimc/22x22/status-bad.png delete mode 100644 resources/multimc/22x22/status-good.png delete mode 100644 resources/multimc/22x22/status-yellow.png delete mode 100644 resources/multimc/22x22/viewfolder.png delete mode 100644 resources/multimc/24x24/cat.png delete mode 100644 resources/multimc/24x24/coremods.png delete mode 100644 resources/multimc/24x24/jarmods.png delete mode 100644 resources/multimc/24x24/loadermods.png delete mode 100644 resources/multimc/24x24/log.png delete mode 100644 resources/multimc/24x24/minecraft.png delete mode 100644 resources/multimc/24x24/noaccount.png delete mode 100644 resources/multimc/24x24/patreon.png delete mode 100644 resources/multimc/24x24/resourcepacks.png delete mode 100644 resources/multimc/24x24/status-bad.png delete mode 100644 resources/multimc/24x24/status-good.png delete mode 100644 resources/multimc/24x24/status-yellow.png delete mode 100644 resources/multimc/256x256/minecraft.png delete mode 100644 resources/multimc/32x32/about.png delete mode 100644 resources/multimc/32x32/bug.png delete mode 100644 resources/multimc/32x32/cat.png delete mode 100644 resources/multimc/32x32/centralmods.png delete mode 100644 resources/multimc/32x32/checkupdate.png delete mode 100644 resources/multimc/32x32/copy.png delete mode 100644 resources/multimc/32x32/coremods.png delete mode 100644 resources/multimc/32x32/help.png delete mode 100644 resources/multimc/32x32/instance-settings.png delete mode 100644 resources/multimc/32x32/jarmods.png delete mode 100644 resources/multimc/32x32/loadermods.png delete mode 100644 resources/multimc/32x32/log.png delete mode 100644 resources/multimc/32x32/minecraft.png delete mode 100644 resources/multimc/32x32/new.png delete mode 100644 resources/multimc/32x32/news.png delete mode 100644 resources/multimc/32x32/noaccount.png delete mode 100644 resources/multimc/32x32/patreon.png delete mode 100644 resources/multimc/32x32/refresh.png delete mode 100644 resources/multimc/32x32/resourcepacks.png delete mode 100644 resources/multimc/32x32/screenshots.png delete mode 100644 resources/multimc/32x32/settings.png delete mode 100644 resources/multimc/32x32/status-bad.png delete mode 100644 resources/multimc/32x32/status-good.png delete mode 100644 resources/multimc/32x32/status-yellow.png delete mode 100644 resources/multimc/32x32/viewfolder.png delete mode 100644 resources/multimc/48x48/about.png delete mode 100644 resources/multimc/48x48/bug.png delete mode 100644 resources/multimc/48x48/cat.png delete mode 100644 resources/multimc/48x48/centralmods.png delete mode 100644 resources/multimc/48x48/checkupdate.png delete mode 100644 resources/multimc/48x48/copy.png delete mode 100644 resources/multimc/48x48/help.png delete mode 100644 resources/multimc/48x48/instance-settings.png delete mode 100644 resources/multimc/48x48/log.png delete mode 100644 resources/multimc/48x48/minecraft.png delete mode 100644 resources/multimc/48x48/new.png delete mode 100644 resources/multimc/48x48/news.png delete mode 100644 resources/multimc/48x48/noaccount.png delete mode 100644 resources/multimc/48x48/patreon.png delete mode 100644 resources/multimc/48x48/refresh.png delete mode 100644 resources/multimc/48x48/screenshots.png delete mode 100644 resources/multimc/48x48/settings.png delete mode 100644 resources/multimc/48x48/status-bad.png delete mode 100644 resources/multimc/48x48/status-good.png delete mode 100644 resources/multimc/48x48/status-yellow.png delete mode 100644 resources/multimc/48x48/viewfolder.png delete mode 100644 resources/multimc/64x64/about.png delete mode 100644 resources/multimc/64x64/bug.png delete mode 100644 resources/multimc/64x64/cat.png delete mode 100644 resources/multimc/64x64/centralmods.png delete mode 100644 resources/multimc/64x64/checkupdate.png delete mode 100644 resources/multimc/64x64/copy.png delete mode 100644 resources/multimc/64x64/coremods.png delete mode 100644 resources/multimc/64x64/help.png delete mode 100644 resources/multimc/64x64/instance-settings.png delete mode 100644 resources/multimc/64x64/jarmods.png delete mode 100644 resources/multimc/64x64/loadermods.png delete mode 100644 resources/multimc/64x64/log.png delete mode 100644 resources/multimc/64x64/new.png delete mode 100644 resources/multimc/64x64/news.png delete mode 100644 resources/multimc/64x64/patreon.png delete mode 100644 resources/multimc/64x64/refresh.png delete mode 100644 resources/multimc/64x64/resourcepacks.png delete mode 100644 resources/multimc/64x64/screenshots.png delete mode 100644 resources/multimc/64x64/settings.png delete mode 100644 resources/multimc/64x64/status-bad.png delete mode 100644 resources/multimc/64x64/status-good.png delete mode 100644 resources/multimc/64x64/status-yellow.png delete mode 100644 resources/multimc/64x64/viewfolder.png delete mode 100644 resources/multimc/8x8/noaccount.png delete mode 100644 resources/multimc/index.theme delete mode 100644 resources/multimc/multimc.qrc delete mode 100644 resources/multimc/scalable/bug.svg delete mode 100644 resources/multimc/scalable/centralmods.svg delete mode 100644 resources/multimc/scalable/checkupdate.svg delete mode 100644 resources/multimc/scalable/console.svg delete mode 100644 resources/multimc/scalable/console_error.svg delete mode 100644 resources/multimc/scalable/java.svg delete mode 100644 resources/multimc/scalable/multimc.svg delete mode 100644 resources/multimc/scalable/new.svg delete mode 100644 resources/multimc/scalable/news.svg delete mode 100644 resources/multimc/scalable/proxy.svg delete mode 100644 resources/multimc/scalable/screenshot-placeholder.svg delete mode 100644 resources/multimc/scalable/screenshots.svg delete mode 100644 resources/multimc/scalable/status-bad.svg delete mode 100644 resources/multimc/scalable/status-good.svg delete mode 100644 resources/multimc/scalable/status-yellow.svg delete mode 100644 resources/multimc/scalable/viewfolder.svg delete mode 100644 resources/pe_blue/index.theme delete mode 100644 resources/pe_blue/pe_blue.qrc delete mode 100644 resources/pe_blue/scalable/about.svg delete mode 100644 resources/pe_blue/scalable/accounts.svg delete mode 100644 resources/pe_blue/scalable/bug.svg delete mode 100644 resources/pe_blue/scalable/centralmods.svg delete mode 100644 resources/pe_blue/scalable/checkupdate.svg delete mode 100644 resources/pe_blue/scalable/copy.svg delete mode 100644 resources/pe_blue/scalable/coremods.svg delete mode 100644 resources/pe_blue/scalable/externaltools.svg delete mode 100644 resources/pe_blue/scalable/instance-settings.svg delete mode 100644 resources/pe_blue/scalable/jarmods.svg delete mode 100644 resources/pe_blue/scalable/java.svg delete mode 100644 resources/pe_blue/scalable/loadermods.svg delete mode 100644 resources/pe_blue/scalable/log.svg delete mode 100644 resources/pe_blue/scalable/minecraft.svg delete mode 100644 resources/pe_blue/scalable/multimc.svg delete mode 100644 resources/pe_blue/scalable/new.svg delete mode 100644 resources/pe_blue/scalable/news.svg delete mode 100644 resources/pe_blue/scalable/notes.svg delete mode 100644 resources/pe_blue/scalable/patreon.svg delete mode 100644 resources/pe_blue/scalable/proxy.svg delete mode 100644 resources/pe_blue/scalable/quickmods.svg delete mode 100644 resources/pe_blue/scalable/refresh.svg delete mode 100644 resources/pe_blue/scalable/resourcepacks.svg delete mode 100644 resources/pe_blue/scalable/screenshots.svg delete mode 100644 resources/pe_blue/scalable/settings.svg delete mode 100644 resources/pe_blue/scalable/status-bad.svg delete mode 100644 resources/pe_blue/scalable/status-good.svg delete mode 100644 resources/pe_blue/scalable/status-yellow.svg delete mode 100644 resources/pe_blue/scalable/viewfolder.svg delete mode 100644 resources/pe_colored/index.theme delete mode 100644 resources/pe_colored/pe_colored.qrc delete mode 100644 resources/pe_colored/scalable/about.svg delete mode 100644 resources/pe_colored/scalable/accounts.svg delete mode 100644 resources/pe_colored/scalable/bug.svg delete mode 100644 resources/pe_colored/scalable/centralmods.svg delete mode 100644 resources/pe_colored/scalable/checkupdate.svg delete mode 100644 resources/pe_colored/scalable/copy.svg delete mode 100644 resources/pe_colored/scalable/coremods.svg delete mode 100644 resources/pe_colored/scalable/externaltools.svg delete mode 100644 resources/pe_colored/scalable/instance-settings.svg delete mode 100644 resources/pe_colored/scalable/jarmods.svg delete mode 100644 resources/pe_colored/scalable/java.svg delete mode 100644 resources/pe_colored/scalable/loadermods.svg delete mode 100644 resources/pe_colored/scalable/log.svg delete mode 100644 resources/pe_colored/scalable/minecraft.svg delete mode 100644 resources/pe_colored/scalable/multimc.svg delete mode 100644 resources/pe_colored/scalable/new.svg delete mode 100644 resources/pe_colored/scalable/news.svg delete mode 100644 resources/pe_colored/scalable/notes.svg delete mode 100644 resources/pe_colored/scalable/patreon.svg delete mode 100644 resources/pe_colored/scalable/proxy.svg delete mode 100644 resources/pe_colored/scalable/quickmods.svg delete mode 100644 resources/pe_colored/scalable/refresh.svg delete mode 100644 resources/pe_colored/scalable/resourcepacks.svg delete mode 100644 resources/pe_colored/scalable/screenshots.svg delete mode 100644 resources/pe_colored/scalable/settings.svg delete mode 100644 resources/pe_colored/scalable/status-bad.svg delete mode 100644 resources/pe_colored/scalable/status-good.svg delete mode 100644 resources/pe_colored/scalable/status-yellow.svg delete mode 100644 resources/pe_colored/scalable/viewfolder.svg delete mode 100644 resources/pe_dark/index.theme delete mode 100644 resources/pe_dark/pe_dark.qrc delete mode 100644 resources/pe_dark/scalable/about.svg delete mode 100644 resources/pe_dark/scalable/accounts.svg delete mode 100644 resources/pe_dark/scalable/bug.svg delete mode 100644 resources/pe_dark/scalable/centralmods.svg delete mode 100644 resources/pe_dark/scalable/checkupdate.svg delete mode 100644 resources/pe_dark/scalable/copy.svg delete mode 100644 resources/pe_dark/scalable/coremods.svg delete mode 100644 resources/pe_dark/scalable/externaltools.svg delete mode 100644 resources/pe_dark/scalable/instance-settings.svg delete mode 100644 resources/pe_dark/scalable/jarmods.svg delete mode 100644 resources/pe_dark/scalable/java.svg delete mode 100644 resources/pe_dark/scalable/loadermods.svg delete mode 100644 resources/pe_dark/scalable/log.svg delete mode 100644 resources/pe_dark/scalable/minecraft.svg delete mode 100644 resources/pe_dark/scalable/multimc.svg delete mode 100644 resources/pe_dark/scalable/new.svg delete mode 100644 resources/pe_dark/scalable/news.svg delete mode 100644 resources/pe_dark/scalable/notes.svg delete mode 100644 resources/pe_dark/scalable/patreon.svg delete mode 100644 resources/pe_dark/scalable/proxy.svg delete mode 100644 resources/pe_dark/scalable/quickmods.svg delete mode 100644 resources/pe_dark/scalable/refresh.svg delete mode 100644 resources/pe_dark/scalable/resourcepacks.svg delete mode 100644 resources/pe_dark/scalable/screenshots.svg delete mode 100644 resources/pe_dark/scalable/settings.svg delete mode 100644 resources/pe_dark/scalable/status-bad.svg delete mode 100644 resources/pe_dark/scalable/status-good.svg delete mode 100644 resources/pe_dark/scalable/status-yellow.svg delete mode 100644 resources/pe_dark/scalable/viewfolder.svg delete mode 100644 resources/pe_light/index.theme delete mode 100644 resources/pe_light/pe_light.qrc delete mode 100644 resources/pe_light/scalable/about.svg delete mode 100644 resources/pe_light/scalable/accounts.svg delete mode 100644 resources/pe_light/scalable/bug.svg delete mode 100644 resources/pe_light/scalable/centralmods.svg delete mode 100644 resources/pe_light/scalable/checkupdate.svg delete mode 100644 resources/pe_light/scalable/copy.svg delete mode 100644 resources/pe_light/scalable/coremods.svg delete mode 100644 resources/pe_light/scalable/externaltools.svg delete mode 100644 resources/pe_light/scalable/instance-settings.svg delete mode 100644 resources/pe_light/scalable/jarmods.svg delete mode 100644 resources/pe_light/scalable/java.svg delete mode 100644 resources/pe_light/scalable/loadermods.svg delete mode 100644 resources/pe_light/scalable/log.svg delete mode 100644 resources/pe_light/scalable/minecraft.svg delete mode 100644 resources/pe_light/scalable/multimc.svg delete mode 100644 resources/pe_light/scalable/new.svg delete mode 100644 resources/pe_light/scalable/news.svg delete mode 100644 resources/pe_light/scalable/notes.svg delete mode 100644 resources/pe_light/scalable/patreon.svg delete mode 100644 resources/pe_light/scalable/proxy.svg delete mode 100644 resources/pe_light/scalable/quickmods.svg delete mode 100644 resources/pe_light/scalable/refresh.svg delete mode 100644 resources/pe_light/scalable/resourcepacks.svg delete mode 100644 resources/pe_light/scalable/screenshots.svg delete mode 100644 resources/pe_light/scalable/settings.svg delete mode 100644 resources/pe_light/scalable/status-bad.svg delete mode 100644 resources/pe_light/scalable/status-good.svg delete mode 100644 resources/pe_light/scalable/status-yellow.svg delete mode 100644 resources/pe_light/scalable/viewfolder.svg delete mode 100644 resources/sources/clucker.svg delete mode 100644 resources/sources/creeper.svg delete mode 100644 resources/sources/enderpearl.svg delete mode 100644 resources/sources/ftb-glow.svg delete mode 100644 resources/sources/ftb-logo.svg delete mode 100644 resources/sources/gear.svg delete mode 100644 resources/sources/herobrine.svg delete mode 100644 resources/sources/magitech.svg delete mode 100644 resources/sources/meat.svg delete mode 100644 resources/sources/netherstar.svg delete mode 100644 resources/sources/pskeleton.svg delete mode 100644 resources/sources/skeleton.svg delete mode 100644 resources/sources/squarecreeper.svg delete mode 100644 resources/sources/steve.svg delete mode 100644 resources/versions/LWJGL/2.9.0.json delete mode 100644 resources/versions/LWJGL/2.9.1-nightly-20130708-debug3.json delete mode 100644 resources/versions/LWJGL/2.9.1.json delete mode 100644 resources/versions/LWJGL/2.9.2-nightly-20140822.json delete mode 100644 resources/versions/minecraft.json delete mode 100644 resources/versions/versions.qrc delete mode 100644 translations/CMakeLists.txt diff --git a/BuildConfig.cpp.in b/BuildConfig.cpp.in deleted file mode 100644 index 04cfbf05..00000000 --- a/BuildConfig.cpp.in +++ /dev/null @@ -1,56 +0,0 @@ -#include "BuildConfig.h" -#include - -Config BuildConfig; - -Config::Config() -{ - // Version information - VERSION_MAJOR = @MultiMC_VERSION_MAJOR@; - VERSION_MINOR = @MultiMC_VERSION_MINOR@; - VERSION_HOTFIX = @MultiMC_VERSION_HOTFIX@; - VERSION_BUILD = @MultiMC_VERSION_BUILD@; - - VERSION_CHANNEL = "@MultiMC_VERSION_CHANNEL@"; - BUILD_PLATFORM = "@MultiMC_BUILD_PLATFORM@"; - CHANLIST_URL = "@MultiMC_CHANLIST_URL@"; - NOTIFICATION_URL = "@MultiMC_NOTIFICATION_URL@"; - FULL_VERSION_STR = "@MultiMC_VERSION_MAJOR@.@MultiMC_VERSION_MINOR@.@MultiMC_VERSION_BUILD@"; - - UPDATER_DRY_RUN = @MultiMC_UPDATER_DRY_RUN_value@; - UPDATER_FORCE_LOCAL = @MultiMC_UPDATER_FORCE_LOCAL_value@; - - GIT_COMMIT = "@MultiMC_GIT_COMMIT@"; - VERSION_STR = "@MultiMC_VERSION_STRING@"; - NEWS_RSS_URL = "@MultiMC_NEWS_RSS_URL@"; -} - -QString Config::printableVersionString() const -{ - QString vstr = QString("%1.%2").arg(QString::number(VERSION_MAJOR), QString::number(VERSION_MINOR)); - - if (VERSION_HOTFIX > 0) vstr += "." + QString::number(VERSION_HOTFIX); - - // If the build is a development build or release candidate, add that info to the end. - if(VERSION_CHANNEL == "stable") - { - return vstr; - } - else if(VERSION_CHANNEL == "develop") - { - vstr += "-dev-" + QString::number(VERSION_BUILD); - } - else if(VERSION_CHANNEL == "unstable") - { - vstr += "-nuke-" + QString::number(VERSION_BUILD); - } - else if(VERSION_CHANNEL == "custom") - { - vstr += "-local"; - } - else - { - vstr += "-" + VERSION_CHANNEL + "-" + QString::number(VERSION_BUILD); - } - return vstr; -} diff --git a/BuildConfig.h b/BuildConfig.h deleted file mode 100644 index 60aefeb4..00000000 --- a/BuildConfig.h +++ /dev/null @@ -1,63 +0,0 @@ -#pragma once -#include - -/** - * \brief The Config class holds all the build-time information passed from the build system. - */ -class Config -{ -public: - Config(); - /// The major version number. - int VERSION_MAJOR; - /// The minor version number. - int VERSION_MINOR; - /// The hotfix number. - int VERSION_HOTFIX; - /// The build number. - int VERSION_BUILD; - - /** - * The version channel - * This is used by the updater to determine what channel the current version came from. - */ - QString VERSION_CHANNEL; - - /// A short string identifying this build's platform. For example, "lin64" or "win32". - QString BUILD_PLATFORM; - - /// URL for the updater's channel - QString CHANLIST_URL; - - /// URL for notifications - QString NOTIFICATION_URL; - - /// Used for matching notifications - QString FULL_VERSION_STR; - - /// enabled for updater dry run - bool UPDATER_DRY_RUN; - - /// enabled for updater dry run - bool UPDATER_FORCE_LOCAL; - - /// The commit hash of this build - QString GIT_COMMIT; - - /// This is printed on start to standard output - QString VERSION_STR; - - /** - * This is used to fetch the news RSS feed. - * It defaults in CMakeLists.txt to "http://multimc.org/rss.xml" - */ - QString NEWS_RSS_URL; - - /** - * \brief Converts the Version to a string. - * \return The version number in string format (major.minor.revision.build). - */ - QString printableVersionString() const; -}; - -extern Config BuildConfig; diff --git a/CMakeLists.txt b/CMakeLists.txt index f06a7902..53de9aa0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,13 +10,12 @@ if(WIN32) cmake_policy(SET CMP0020 OLD) endif() -project(MultiMC) +project(Megatron) enable_testing() ######## Set CMake options ######## set(CMAKE_AUTOMOC ON) set(CMAKE_INCLUDE_CURRENT_DIR ON) -set(FILES_TO_TRANSLATE ) ######## Set module path ######## set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/") @@ -47,7 +46,6 @@ find_package(Qt5Concurrent REQUIRED) find_package(Qt5Network REQUIRED) find_package(Qt5Test REQUIRED) find_package(Qt5Xml REQUIRED) -find_package(Qt5LinguistTools REQUIRED) find_package(Qt5WebKitWidgets REQUIRED) include_directories( @@ -78,95 +76,6 @@ if(${BIGENDIAN}) add_definitions(-DMULTIMC_BIG_ENDIAN) endif(${BIGENDIAN}) -######## Set URLs ######## -set(MultiMC_NEWS_RSS_URL "http://multimc.org/rss.xml" CACHE STRING "URL to fetch MultiMC's news RSS feed from.") - -######## Set version numbers ######## -set(MultiMC_VERSION_MAJOR 0) -set(MultiMC_VERSION_MINOR 4) -set(MultiMC_VERSION_HOTFIX 5) - -# Build number -set(MultiMC_VERSION_BUILD -1 CACHE STRING "Build number. -1 for no build number.") - -# Version type -set(MultiMC_VERSION_TYPE "Custom" CACHE STRING "MultiMC's version type. This should be one of 'Custom', 'Release', 'ReleaseCandidate', or 'Development', depending on what type of version this is.") - -# Build platform. -set(MultiMC_BUILD_PLATFORM "" CACHE STRING "A short string identifying the platform that this build was built for. Only used by the notification system and to display in the about dialog.") - -# Version channel -set(MultiMC_VERSION_CHANNEL "" CACHE STRING "The current build's channel. Included in the version string.") - -# Channel list URL -set(MultiMC_CHANLIST_URL "" CACHE STRING "URL for the channel list.") - -# Updater enabled? -set(MultiMC_UPDATER false CACHE BOOL "Whether or not the update system is enabled. If this is enabled, you must also set MultiMC_CHANLIST_URL and MultiMC_VERSION_CHANNEL in order for it to work properly.") - -# Notification URL -set(MultiMC_NOTIFICATION_URL "" CACHE STRING "URL for checking for notifications.") - -set(MultiMC_RELEASE_VERSION_NAME "${MultiMC_VERSION_MAJOR}.${MultiMC_VERSION_MINOR}") -if(MultiMC_VERSION_HOTFIX GREATER 0) - set(MultiMC_RELEASE_VERSION_NAME "${MultiMC_RELEASE_VERSION_NAME}.${MultiMC_VERSION_HOTFIX}") -endif() - -# Build a version string to display in the configure logs. -if(MultiMC_VERSION_TYPE STREQUAL "Custom") - message(STATUS "Version Type: Custom") - set(MultiMC_VERSION_STRING "${MultiMC_RELEASE_VERSION_NAME}") -elseif(MultiMC_VERSION_TYPE STREQUAL "Release") - message(STATUS "Version Type: Stable Release") - set(MultiMC_VERSION_STRING "${MultiMC_RELEASE_VERSION_NAME}") -elseif(MultiMC_VERSION_TYPE STREQUAL "Development") - message(STATUS "Version Type: Development") - set(MultiMC_VERSION_STRING "${MultiMC_RELEASE_VERSION_NAME}-dev${MultiMC_VERSION_BUILD}") -else() - message(ERROR "Invalid build type.") -endif() - -message(STATUS "MultiMC 5 Version: ${MultiMC_VERSION_STRING}") - -# If the update system is enabled, make sure MultiMC_CHANLIST_URL and MultiMC_VERSION_CHANNEL are set. -if(MultiMC_UPDATER) - if(MultiMC_VERSION_CHANNEL STREQUAL "") - message(FATAL_ERROR "Update system is enabled, but MultiMC_VERSION_CHANNEL is not set.\n" - "Please ensure the CMake variables MultiMC_VERSION_CHANNEL, MultiMC_CHANLIST_URL, and MultiMC_VERSION_BUILD are set.") - endif() - if(MultiMC_CHANLIST_URL STREQUAL "") - message(FATAL_ERROR "Update system is enabled, but MultiMC_CHANLIST_URL is not set.\n" - "Please ensure the CMake variables MultiMC_VERSION_CHANNEL, MultiMC_CHANLIST_URL, and MultiMC_VERSION_BUILD are set.") - endif() - if(MultiMC_VERSION_BUILD LESS 0) - message(FATAL_ERROR "Update system is enabled, but MultiMC_VERSION_BUILD is not set.\n" - "Please ensure the CMake variables MultiMC_VERSION_CHANNEL, MultiMC_CHANLIST_URL, and MultiMC_VERSION_BUILD are set.") - endif() - message(STATUS "Updater is enabled. Channel list URL: ${MultiMC_CHANLIST_URL}") -endif() - -#### Updater-related build config options #### -option(MultiMC_UPDATER_DRY_RUN "Enable updater dry-run mode -- for updater development." OFF) -option(MultiMC_UPDATER_FORCE_LOCAL "Do not download updated updater -- for updater development." OFF) - -if(MultiMC_UPDATER_DRY_RUN) - set(MultiMC_UPDATER_DRY_RUN_value "true") -else() - set(MultiMC_UPDATER_DRY_RUN_value "false") -endif() - -if(MultiMC_UPDATER_FORCE_LOCAL) - set(MultiMC_UPDATER_FORCE_LOCAL_value "true") -else() - set(MultiMC_UPDATER_FORCE_LOCAL_value "false") -endif() - -#### For QuickMods -option(MultiMC_WEBKIT_INSPECTOR "Enable the QWebInspector for debugging" OFF) -if(MultiMC_WEBKIT_INSPECTOR) - add_definitions(-DWEBKIT_INSPECTOR) -endif() - #### Custom target to just print the version. add_custom_target(version echo "Version: ${MultiMC_VERSION_STRING}") @@ -175,40 +84,6 @@ include(GitFunctions) git_run(COMMAND rev-parse HEAD DEFAULT "Unknown" OUTPUT_VAR MultiMC_GIT_COMMIT) message(STATUS "Git commit: ${MultiMC_GIT_COMMIT}") -######## Configure header ######## -configure_file("${PROJECT_SOURCE_DIR}/BuildConfig.cpp.in" "${PROJECT_BINARY_DIR}/BuildConfig.cpp") - -######## Packaging/install paths setup ######## - -if(UNIX AND APPLE) - set(BINARY_DEST_DIR MultiMC.app/Contents/MacOS) - set(PLUGIN_DEST_DIR MultiMC.app/Contents/MacOS) - set(QTCONF_DEST_DIR MultiMC.app/Contents/Resources) - set(APPS "\${CMAKE_INSTALL_PREFIX}/MultiMC.app") - - set(MACOSX_BUNDLE_BUNDLE_NAME "MultiMC") - set(MACOSX_BUNDLE_INFO_STRING "MultiMC Minecraft launcher and management utility.") - set(MACOSX_BUNDLE_GUI_IDENTIFIER "org.multimc.MultiMC5") - set(MACOSX_BUNDLE_BUNDLE_VERSION "${MultiMC_VERSION_MAJOR}.${MultiMC_VERSION_MINOR}.${MultiMC_VERSION_HOTFIX}.${MultiMC_VERSION_BUILD}") - set(MACOSX_BUNDLE_SHORT_VERSION_STRING "${MultiMC_VERSION_MAJOR}.${MultiMC_VERSION_MINOR}.${MultiMC_VERSION_HOTFIX}.${MultiMC_VERSION_BUILD}") - set(MACOSX_BUNDLE_LONG_VERSION_STRING "${MultiMC_VERSION_MAJOR}.${MultiMC_VERSION_MINOR}.${MultiMC_VERSION_HOTFIX}.${MultiMC_VERSION_BUILD}") - set(MACOSX_BUNDLE_ICON_FILE MultiMC.icns) - set(MACOSX_BUNDLE_COPYRIGHT "Copyright 2014 MultiMC Contributors") -elseif(UNIX) - set(BINARY_DEST_DIR bin) - set(PLUGIN_DEST_DIR plugins) - set(QTCONF_DEST_DIR .) - set(APPS "\${CMAKE_INSTALL_PREFIX}/bin/MultiMC") -elseif(WIN32) - set(BINARY_DEST_DIR .) - set(PLUGIN_DEST_DIR .) - set(QTCONF_DEST_DIR .) - set(APPS "\${CMAKE_INSTALL_PREFIX}/MultiMC.exe") -endif() - -# directories to look for dependencies -set(DIRS ${QT_LIBS_DIR} ${QT_LIBEXECS_DIR}) - ################################ Included Libs ################################ include(ExternalProject) @@ -259,660 +134,11 @@ include_directories(${LOGICALGUI_INCLUDE_DIR}) add_subdirectory(depends/iconfix) include_directories(${ICONFIX_INCLUDE_DIR}) -################################ FILES ################################ - -######## Sources and headers ######## -SET(MULTIMC_SOURCES - # Application base - MultiMC.h - MultiMC.cpp - MMCError.h - BuildConfig.h - ${PROJECT_BINARY_DIR}/BuildConfig.cpp - - # GUI - general utilities - gui/GuiUtil.h - gui/GuiUtil.cpp - gui/ColumnResizer.h - gui/ColumnResizer.cpp - gui/InstanceProxyModel.h - gui/InstanceProxyModel.cpp - - # GUI - windows - gui/MainWindow.h - gui/MainWindow.cpp - gui/ConsoleWindow.h - gui/ConsoleWindow.cpp - - gui/InstancePageProvider.h - gui/InstancePageProvider.cpp - - # GUI - page dialog pages - gui/pages/BasePage.h - gui/pages/VersionPage.cpp - gui/pages/VersionPage.h - gui/pages/TexturePackPage.h - gui/pages/ResourcePackPage.h - gui/pages/ModFolderPage.cpp - gui/pages/ModFolderPage.h - gui/pages/NotesPage.cpp - gui/pages/NotesPage.h - gui/pages/LegacyUpgradePage.cpp - gui/pages/LegacyUpgradePage.h - gui/pages/LegacyJarModPage.cpp - gui/pages/LegacyJarModPage.h - gui/pages/LogPage.cpp - gui/pages/LogPage.h - gui/pages/InstanceSettingsPage.cpp - gui/pages/InstanceSettingsPage.h - gui/pages/ScreenshotsPage.cpp - gui/pages/ScreenshotsPage.h - gui/pages/OtherLogsPage.cpp - gui/pages/OtherLogsPage.h - - # GUI - global settings pages - gui/pages/global/AccountListPage.cpp - gui/pages/global/AccountListPage.h - gui/pages/global/ExternalToolsPage.cpp - gui/pages/global/ExternalToolsPage.h - gui/pages/global/JavaPage.cpp - gui/pages/global/JavaPage.h - gui/pages/global/MinecraftPage.cpp - gui/pages/global/MinecraftPage.h - gui/pages/global/MultiMCPage.cpp - gui/pages/global/MultiMCPage.h - gui/pages/global/ProxyPage.cpp - gui/pages/global/ProxyPage.h - - # GUI - dialogs - gui/dialogs/AboutDialog.cpp - gui/dialogs/AboutDialog.h - gui/dialogs/AccountSelectDialog.cpp - gui/dialogs/AccountSelectDialog.h - gui/dialogs/CopyInstanceDialog.cpp - gui/dialogs/CopyInstanceDialog.h - gui/dialogs/CustomMessageBox.cpp - gui/dialogs/CustomMessageBox.h - gui/dialogs/EditAccountDialog.cpp - gui/dialogs/EditAccountDialog.h - gui/dialogs/IconPickerDialog.cpp - gui/dialogs/IconPickerDialog.h - gui/dialogs/LoginDialog.cpp - gui/dialogs/LoginDialog.h - gui/dialogs/ModEditDialogCommon.cpp - gui/dialogs/ModEditDialogCommon.h - gui/dialogs/NewInstanceDialog.cpp - gui/dialogs/NewInstanceDialog.h - gui/dialogs/NotificationDialog.cpp - gui/dialogs/NotificationDialog.h - gui/pagedialog/PageDialog.cpp - gui/pagedialog/PageDialog.h - gui/dialogs/ProgressDialog.cpp - gui/dialogs/ProgressDialog.h - gui/dialogs/UpdateDialog.cpp - gui/dialogs/UpdateDialog.h - gui/dialogs/VersionSelectDialog.cpp - gui/dialogs/VersionSelectDialog.h - - - # GUI - widgets - gui/widgets/Common.cpp - gui/widgets/Common.h - gui/widgets/IconLabel.cpp - gui/widgets/IconLabel.h - gui/widgets/LabeledToolButton.cpp - gui/widgets/LabeledToolButton.h - gui/widgets/LineSeparator.cpp - gui/widgets/LineSeparator.h - gui/widgets/MCModInfoFrame.cpp - gui/widgets/MCModInfoFrame.h - gui/widgets/ModListView.cpp - gui/widgets/ModListView.h - gui/widgets/PageContainer.cpp - gui/widgets/PageContainer.h - gui/widgets/PageContainer_p.h - gui/widgets/ServerStatus.cpp - gui/widgets/ServerStatus.h - gui/widgets/VersionListView.cpp - gui/widgets/VersionListView.h - - - # GUI - instance group view - gui/groupview/GroupedProxyModel.cpp - gui/groupview/GroupedProxyModel.h - gui/groupview/GroupView.cpp - gui/groupview/GroupView.h - gui/groupview/InstanceDelegate.cpp - gui/groupview/InstanceDelegate.h - gui/groupview/VisualGroup.cpp - gui/groupview/VisualGroup.h - - # LOGIC - Base classes and infrastructure - logic/BaseVersion.h - logic/BaseProcess.h - logic/BaseProcess.cpp - logic/BaseInstance.h - logic/BaseInstance.cpp - logic/minecraft/Mod.h - logic/minecraft/Mod.cpp - logic/minecraft/ModList.h - logic/minecraft/ModList.cpp - - # sets and maps for deciding based on versions - logic/minecraft/VersionFilterData.h - logic/minecraft/VersionFilterData.cpp - - # Annoying nag screen logic - gui/NagUtils.h - gui/NagUtils.cpp - - # Player skin utilities - logic/minecraft/SkinUtils.h - logic/minecraft/SkinUtils.cpp - - # misc model filter - - # JSON parsing helpers - logic/MMCJson.h - logic/MMCJson.cpp - - # RW lock protected map - logic/RWStorage.h - - # A variable that has an implicit default value and keeps track of changes - logic/DefaultVariable.h - - # network stuffs - logic/Env.h - logic/Env.cpp - logic/net/NetAction.h - logic/net/MD5EtagDownload.h - logic/net/MD5EtagDownload.cpp - logic/net/ByteArrayDownload.h - logic/net/ByteArrayDownload.cpp - logic/net/CacheDownload.h - logic/net/CacheDownload.cpp - logic/net/NetJob.h - logic/net/NetJob.cpp - logic/net/HttpMetaCache.h - logic/net/HttpMetaCache.cpp - logic/net/PasteUpload.h - logic/net/PasteUpload.cpp - logic/net/URLConstants.h - logic/net/URLConstants.cpp - - # Yggdrasil login stuff - logic/auth/AuthSession.h - logic/auth/AuthSession.cpp - logic/auth/MojangAccountList.h - logic/auth/MojangAccountList.cpp - logic/auth/MojangAccount.h - logic/auth/MojangAccount.cpp - logic/auth/YggdrasilTask.h - logic/auth/YggdrasilTask.cpp - logic/auth/flows/AuthenticateTask.h - logic/auth/flows/AuthenticateTask.cpp - logic/auth/flows/RefreshTask.cpp - logic/auth/flows/RefreshTask.cpp - logic/auth/flows/ValidateTask.h - logic/auth/flows/ValidateTask.cpp - - # Update system - logic/updater/GoUpdate.h - logic/updater/GoUpdate.cpp - logic/updater/UpdateChecker.h - logic/updater/UpdateChecker.cpp - logic/updater/DownloadTask.h - logic/updater/DownloadTask.cpp - - # Notifications - short warning messages - logic/notifications/NotificationChecker.h - logic/notifications/NotificationChecker.cpp - - # News System - logic/news/NewsChecker.h - logic/news/NewsChecker.cpp - logic/news/NewsEntry.h - logic/news/NewsEntry.cpp - - # Status system - logic/status/StatusChecker.h - logic/status/StatusChecker.cpp - - # legacy instances - logic/minecraft/LegacyInstance.h - logic/minecraft/LegacyInstance.cpp - logic/minecraft/LegacyUpdate.h - logic/minecraft/LegacyUpdate.cpp - - # OneSix instances - logic/minecraft/OneSixUpdate.h - logic/minecraft/OneSixUpdate.cpp - logic/minecraft/OneSixInstance.h - logic/minecraft/OneSixInstance.cpp - - # a smart pointer wrapper intended for safer use with Qt signal/slot mechanisms - logic/QObjectPtr.h - - # Common utils for instances - logic/minecraft/JarUtils.h - logic/minecraft/JarUtils.cpp - - # Minecraft support - logic/minecraft/GradleSpecifier.h - logic/minecraft/MinecraftProfile.cpp - logic/minecraft/MinecraftProfile.h - logic/minecraft/JarMod.cpp - logic/minecraft/JarMod.h - logic/minecraft/MinecraftInstance.cpp - logic/minecraft/MinecraftInstance.h - logic/minecraft/MinecraftProcess.cpp - logic/minecraft/MinecraftProcess.h - logic/minecraft/MinecraftVersion.cpp - logic/minecraft/MinecraftVersion.h - logic/minecraft/MinecraftVersionList.cpp - logic/minecraft/MinecraftVersionList.h - logic/minecraft/NullProfileStrategy.h - logic/minecraft/OneSixLibrary.cpp - logic/minecraft/OneSixLibrary.h - logic/minecraft/OneSixProfileStrategy.cpp - logic/minecraft/OneSixProfileStrategy.h - logic/minecraft/OneSixRule.cpp - logic/minecraft/OneSixRule.h - logic/minecraft/OpSys.cpp - logic/minecraft/OpSys.h - logic/minecraft/ParseUtils.cpp - logic/minecraft/ParseUtils.h - logic/minecraft/ProfileUtils.cpp - logic/minecraft/ProfileUtils.h - logic/minecraft/ProfileStrategy.h - logic/minecraft/RawLibrary.cpp - logic/minecraft/RawLibrary.h - logic/minecraft/VersionBuilder.cpp - logic/minecraft/VersionBuilder.h - logic/minecraft/VersionBuildError.h - logic/minecraft/VersionFile.cpp - logic/minecraft/VersionFile.h - logic/minecraft/ProfilePatch.h - logic/minecraft/VersionSource.h - - # A Recursive file system watcher - logic/RecursiveFileSystemWatcher.h - logic/RecursiveFileSystemWatcher.cpp - - # Various base classes - logic/BaseInstaller.h - logic/BaseInstaller.cpp - logic/BaseVersionList.h - logic/BaseVersionList.cpp - - logic/InstanceList.h - logic/InstanceList.cpp - logic/minecraft/LwjglVersionList.h - logic/minecraft/LwjglVersionList.cpp - - # FTB - logic/ftb/OneSixFTBInstance.h - logic/ftb/OneSixFTBInstance.cpp - logic/ftb/LegacyFTBInstance.h - logic/ftb/LegacyFTBInstance.cpp - logic/ftb/FTBProfileStrategy.h - logic/ftb/FTBProfileStrategy.cpp - logic/ftb/FTBPlugin.h - logic/ftb/FTBPlugin.cpp - - # the screenshots feature - logic/screenshots/Screenshot.h - logic/screenshots/ImgurUpload.h - logic/screenshots/ImgurUpload.cpp - logic/screenshots/ImgurAlbumCreation.h - logic/screenshots/ImgurAlbumCreation.cpp - - # Icons - logic/icons/MMCIcon.h - logic/icons/MMCIcon.cpp - logic/icons/IconList.h - logic/icons/IconList.cpp - - # Tasks - logic/tasks/ProgressProvider.h - logic/tasks/Task.h - logic/tasks/Task.cpp - logic/tasks/ThreadTask.h - logic/tasks/ThreadTask.cpp - logic/tasks/SequentialTask.h - logic/tasks/SequentialTask.cpp - - # Settings - logic/settings/INIFile.cpp - logic/settings/INIFile.h - logic/settings/INISettingsObject.cpp - logic/settings/INISettingsObject.h - logic/settings/OverrideSetting.cpp - logic/settings/OverrideSetting.h - logic/settings/Setting.cpp - logic/settings/Setting.h - logic/settings/SettingsObject.cpp - logic/settings/SettingsObject.h - - # Java related code - logic/java/JavaChecker.h - logic/java/JavaChecker.cpp - logic/java/JavaUtils.h - logic/java/JavaUtils.cpp - logic/java/JavaVersionList.h - logic/java/JavaVersionList.cpp - logic/java/JavaCheckerJob.h - logic/java/JavaCheckerJob.cpp - - # Assets - logic/minecraft/AssetsUtils.h - logic/minecraft/AssetsUtils.cpp - - # Tools - logic/tools/BaseExternalTool.h - logic/tools/BaseExternalTool.cpp - logic/tools/MCEditTool.h - logic/tools/MCEditTool.cpp - logic/tools/BaseProfiler.h - logic/tools/BaseProfiler.cpp - logic/tools/JProfiler.h - logic/tools/JProfiler.cpp - logic/tools/JVisualVM.h - logic/tools/JVisualVM.cpp - - # Forge and all things forge related - logic/forge/ForgeVersion.h - logic/forge/ForgeVersion.cpp - logic/forge/ForgeVersionList.h - logic/forge/ForgeVersionList.cpp - logic/forge/ForgeMirror.h - logic/forge/ForgeMirrors.h - logic/forge/ForgeMirrors.cpp - logic/forge/ForgeXzDownload.h - logic/forge/ForgeXzDownload.cpp - logic/forge/LegacyForge.h - logic/forge/LegacyForge.cpp - logic/forge/ForgeInstaller.h - logic/forge/ForgeInstaller.cpp - - # Liteloader and related things - logic/liteloader/LiteLoaderInstaller.h - logic/liteloader/LiteLoaderInstaller.cpp - logic/liteloader/LiteLoaderVersionList.h - logic/liteloader/LiteLoaderVersionList.cpp - - # Translations - logic/trans/TranslationDownloader.h - logic/trans/TranslationDownloader.cpp -) - - -######## UIs ######## -SET(MULTIMC_UIS - # Option pages - gui/pages/VersionPage.ui - gui/pages/ModFolderPage.ui - gui/pages/LegacyUpgradePage.ui - gui/pages/LegacyJarModPage.ui - gui/pages/LogPage.ui - gui/pages/InstanceSettingsPage.ui - gui/pages/NotesPage.ui - gui/pages/ScreenshotsPage.ui - gui/pages/OtherLogsPage.ui - - # Global settings pages - gui/pages/global/AccountListPage.ui - gui/pages/global/ExternalToolsPage.ui - gui/pages/global/JavaPage.ui - gui/pages/global/MinecraftPage.ui - gui/pages/global/MultiMCPage.ui - gui/pages/global/ProxyPage.ui - - # Dialogs - gui/dialogs/CopyInstanceDialog.ui - gui/dialogs/NewInstanceDialog.ui - gui/dialogs/AboutDialog.ui - gui/dialogs/VersionSelectDialog.ui - gui/dialogs/ProgressDialog.ui - gui/dialogs/IconPickerDialog.ui - gui/dialogs/AccountSelectDialog.ui - gui/dialogs/EditAccountDialog.ui - gui/dialogs/LoginDialog.ui - gui/dialogs/UpdateDialog.ui - gui/dialogs/NotificationDialog.ui - - # Widgets/other - gui/widgets/MCModInfoFrame.ui -) - -set(FILES_TO_TRANSLATE) -foreach(file ${MULTIMC_SOURCES}) - get_filename_component(absfile "${file}" ABSOLUTE) - list(APPEND FILES_TO_TRANSLATE "${absfile}") -endforeach() - -foreach(file ${MULTIMC_UIS}) - get_filename_component(absfile "${file}" ABSOLUTE) - list(APPEND FILES_TO_TRANSLATE "${absfile}") -endforeach() - -set(MULTIMC_QRCS - resources/backgrounds/backgrounds.qrc - resources/multimc/multimc.qrc - resources/pe_dark/pe_dark.qrc - resources/pe_light/pe_light.qrc - resources/pe_colored/pe_colored.qrc - resources/pe_blue/pe_blue.qrc - resources/OSX/OSX.qrc - resources/iOS/iOS.qrc - resources/instances/instances.qrc - resources/versions/versions.qrc -) - - -######## Windows resource files ######## -if(WIN32) - set(MULTIMC_RCS resources/multimc.rc) -endif() - -####### X11 Stuff ####### -if(UNIX AND NOT APPLE) - find_package(Qt5X11Extras REQUIRED) - set(MultiMC_LINK_ADDITIONAL_LIBS ${MultiMC_LINK_ADDITIONAL_LIBS} Qt5::X11Extras) - set(MultiMC_LINK_ADDITIONAL_LIBS ${MultiMC_LINK_ADDITIONAL_LIBS} xcb) - list(APPEND MULTIMC_SOURCES gui/Platform_X11.cpp) -else() - list(APPEND MULTIMC_SOURCES gui/Platform_Other.cpp) -endif() - - -################################ COMPILE ################################ - -# Link additional libraries -if(WIN32) - set(MultiMC_LINK_ADDITIONAL_LIBS ${MultiMC_LINK_ADDITIONAL_LIBS} Qt5::WinMain) -endif(WIN32) - -# Tell CMake that MultiMCLauncher.jar is generated. -#SET_SOURCE_FILES_PROPERTIES(${PROJECT_BINARY_DIR}/depends/launcher/MultiMCLauncher.jar GENERATED) -#SET_SOURCE_FILES_PROPERTIES(${PROJECT_BINARY_DIR}/depends/javacheck/JavaCheck.jar GENERATED) - -# Qt 5 stuff -qt5_wrap_ui(MULTIMC_UI ${MULTIMC_UIS}) -qt5_add_resources(MULTIMC_RESOURCES ${MULTIMC_QRCS}) - -# Add common library -add_library(MultiMC_common STATIC ${MULTIMC_SOURCES} ${MULTIMC_UI} ${MULTIMC_RESOURCES}) - -# Add executable -add_executable(MultiMC MACOSX_BUNDLE WIN32 main.cpp ${MULTIMC_RCS}) - -# Link -target_link_libraries(MultiMC MultiMC_common) - -target_link_libraries(MultiMC_common xz-embedded unpack200 iconfix libUtil LogicalGui - ${QUAZIP_LIBRARIES} Qt5::Core Qt5::Xml Qt5::Widgets Qt5::Network Qt5::Concurrent Qt5::WebKitWidgets - ${MultiMC_LINK_ADDITIONAL_LIBS} -) - -target_link_libraries(MultiMC_common Qt5::Core Qt5::Widgets Qt5::Network Qt5::Concurrent Qt5::WebKitWidgets - ${MultiMC_LINK_ADDITIONAL_LIBS} -) - -add_dependencies(MultiMC_common QuaZIP) - -################################ INSTALLATION AND PACKAGING ################################ - -######## Install ######## - -#### Executable #### -if(APPLE AND UNIX) ## OSX - install(TARGETS MultiMC - BUNDLE DESTINATION . COMPONENT Runtime - RUNTIME DESTINATION MultiMC.app/Contents/MacOS COMPONENT Runtime - ) - -elseif(UNIX) ## LINUX and similar - install(TARGETS MultiMC - BUNDLE DESTINATION . COMPONENT Runtime - RUNTIME DESTINATION bin COMPONENT Runtime - ) - install(PROGRAMS package/linux/MultiMC DESTINATION .) - -elseif(WIN32) ## WINDOWS - install(TARGETS MultiMC - BUNDLE DESTINATION . COMPONENT Runtime - LIBRARY DESTINATION . COMPONENT Runtime - RUNTIME DESTINATION . COMPONENT Runtime - ) -endif() - -#### Dist package logic #### - -if(CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo") - # Image formats - install( - DIRECTORY "${QT_PLUGINS_DIR}/imageformats" - DESTINATION ${PLUGIN_DEST_DIR} - COMPONENT Runtime - REGEX "tga|tiff|mng" EXCLUDE - ) - # Icon engines - install( - DIRECTORY "${QT_PLUGINS_DIR}/iconengines" - DESTINATION ${PLUGIN_DEST_DIR} - COMPONENT Runtime - REGEX "fontawesome" EXCLUDE - ) - # Platform plugins - install( - DIRECTORY "${QT_PLUGINS_DIR}/platforms" - DESTINATION ${PLUGIN_DEST_DIR} - COMPONENT Runtime - REGEX "minimal|linuxfb|offscreen" EXCLUDE - ) -else() - # Image formats - install( - DIRECTORY "${QT_PLUGINS_DIR}/imageformats" - DESTINATION ${PLUGIN_DEST_DIR} - COMPONENT Runtime - REGEX "tga|tiff|mng" EXCLUDE - REGEX "d\\." EXCLUDE - REGEX "_debug\\." EXCLUDE - ) - # Icon engines - install( - DIRECTORY "${QT_PLUGINS_DIR}/iconengines" - DESTINATION ${PLUGIN_DEST_DIR} - COMPONENT Runtime - REGEX "fontawesome" EXCLUDE - REGEX "d\\." EXCLUDE - REGEX "_debug\\." EXCLUDE - ) - # Platform plugins - install( - DIRECTORY "${QT_PLUGINS_DIR}/platforms" - DESTINATION ${PLUGIN_DEST_DIR} - COMPONENT Runtime - REGEX "minimal|linuxfb|offscreen" EXCLUDE - REGEX "d\\." EXCLUDE - REGEX "_debug\\." EXCLUDE - ) - if(APPLE) - # Accessible plugin to make buttons look decent on osx - install( - DIRECTORY "${QT_PLUGINS_DIR}/accessible" - DESTINATION ${PLUGIN_DEST_DIR} - COMPONENT Runtime - REGEX "quick" EXCLUDE - REGEX "d\\." EXCLUDE - REGEX "_debug\\." EXCLUDE - ) - endif() -endif() - -# qtconf -install( - CODE " -file(WRITE \"\${CMAKE_INSTALL_PREFIX}/${QTCONF_DEST_DIR}/qt.conf\" \"\") -" - COMPONENT Runtime -) - -# ICNS file for OS X -if(APPLE) - install(FILES resources/MultiMC.icns DESTINATION MultiMC.app/Contents/Resources) -endif() - -configure_file( - "${CMAKE_CURRENT_SOURCE_DIR}/install_prereqs.cmake.in" - "${CMAKE_CURRENT_BINARY_DIR}/install_prereqs.cmake" - @ONLY -) -install(SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/install_prereqs.cmake" COMPONENT Runtime) - - - -######## Package ######## - -# Package with CPack -if(UNIX) - if(APPLE) - set(CPACK_GENERATOR "ZIP") - else() - set(CPACK_GENERATOR "TGZ") - endif() -elseif(WIN32) - set(CPACK_GENERATOR "ZIP") -endif() -set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY 0) - -set(CPACK_PACKAGE_NAME "MultiMC 5") -set(CPACK_PACKAGE_VENDOR "") -set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "MultiMC - Minecraft launcher and management tool.") -set(CPACK_PACKAGE_VERSION "${MultiMC_VERSION_MAJOR}.${MultiMC_VERSION_MINOR}.${MultiMC_VERSION_REV}.${MultiMC_VERSION_BUILD}") -set(CPACK_PACKAGE_VERSION_MAJOR ${MultiMC_VERSION_MAJOR}) -set(CPACK_PACKAGE_VERSION_MINOR ${MultiMC_VERSION_MINOR}) -set(CPACK_PACKAGE_VERSION_PATCH ${MultiMC_VERSION_REV}) - -if(CPACK_GENERATOR STREQUAL "NSIS") - set(CPACK_PACKAGE_FILE_NAME "Setup-MultiMC") -else() - set(CPACK_PACKAGE_FILE_NAME "MultiMC") -endif() - -if(WIN32) - set(CPACK_PACKAGE_INSTALL_DIRECTORY "MultiMC 5") -endif() - -include(CPack) - include(Coverity) -# Translations -add_subdirectory(translations) - # Tests add_subdirectory(tests) + +add_subdirectory(logic) + +add_subdirectory(application) diff --git a/MMCError.h b/MMCError.h deleted file mode 100644 index e81054a6..00000000 --- a/MMCError.h +++ /dev/null @@ -1,25 +0,0 @@ -#pragma once -#include -#include -#include - -class MMCError : public std::exception -{ -public: - MMCError(QString cause) - { - exceptionCause = cause; - qCritical() << "Exception: " + cause; - }; - virtual ~MMCError() noexcept {} - virtual const char *what() const noexcept - { - return exceptionCause.toLocal8Bit(); - }; - virtual QString cause() const - { - return exceptionCause; - } -private: - QString exceptionCause; -}; diff --git a/MultiMC.cpp b/MultiMC.cpp deleted file mode 100644 index 2ce668f2..00000000 --- a/MultiMC.cpp +++ /dev/null @@ -1,633 +0,0 @@ -#include "MultiMC.h" -#include "BuildConfig.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "gui/dialogs/VersionSelectDialog.h" -#include "logic/InstanceList.h" -#include "logic/auth/MojangAccountList.h" -#include "logic/icons/IconList.h" -#include "logic/minecraft/LwjglVersionList.h" -#include "logic/minecraft/MinecraftVersionList.h" -#include "logic/liteloader/LiteLoaderVersionList.h" - -#include "logic/forge/ForgeVersionList.h" - -#include "logic/net/HttpMetaCache.h" -#include "logic/net/URLConstants.h" -#include "logic/Env.h" - -#include "logic/java/JavaUtils.h" - -#include "logic/updater/UpdateChecker.h" - -#include "logic/tools/JProfiler.h" -#include "logic/tools/JVisualVM.h" -#include "logic/tools/MCEditTool.h" - -#include "pathutils.h" -#include "cmdutils.h" -#include -#include "logic/settings/INISettingsObject.h" -#include "logic/settings/Setting.h" - - -#include "logic/trans/TranslationDownloader.h" - -#include "logic/ftb/FTBPlugin.h" - -using namespace Util::Commandline; - -MultiMC::MultiMC(int &argc, char **argv, bool test_mode) : QApplication(argc, argv) -{ - setOrganizationName("MultiMC"); - setApplicationName("MultiMC5"); - - startTime = QDateTime::currentDateTime(); - - setAttribute(Qt::AA_UseHighDpiPixmaps); - // Don't quit on hiding the last window - this->setQuitOnLastWindowClosed(false); - - // Commandline parsing - QHash args; - { - Parser parser(FlagStyle::GNU, ArgumentStyle::SpaceAndEquals); - - // --help - parser.addSwitch("help"); - parser.addShortOpt("help", 'h'); - parser.addDocumentation("help", "display this help and exit."); - // --version - parser.addSwitch("version"); - parser.addShortOpt("version", 'V'); - parser.addDocumentation("version", "display program version and exit."); - // --dir - parser.addOption("dir", applicationDirPath()); - parser.addShortOpt("dir", 'd'); - parser.addDocumentation("dir", "use the supplied directory as MultiMC root instead of " - "the binary location (use '.' for current)"); - - // parse the arguments - try - { - args = parser.parse(arguments()); - } - catch (ParsingError e) - { - std::cerr << "CommandLineError: " << e.what() << std::endl; - std::cerr << "Try '%1 -h' to get help on MultiMC's command line parameters." - << std::endl; - m_status = MultiMC::Failed; - return; - } - - // display help and exit - if (args["help"].toBool()) - { - std::cout << qPrintable(parser.compileHelp(arguments()[0])); - m_status = MultiMC::Succeeded; - return; - } - - // display version and exit - if (args["version"].toBool()) - { - std::cout << "Version " << BuildConfig.VERSION_STR.toStdString() << std::endl; - std::cout << "Git " << BuildConfig.GIT_COMMIT.toStdString() << std::endl; - m_status = MultiMC::Succeeded; - return; - } - } - - QString origcwdPath = QDir::currentPath(); - QString binPath = applicationDirPath(); - QString adjustedBy; - // change directory - QString dirParam = args["dir"].toString(); - if (!dirParam.isEmpty()) - { - // the dir param. it makes multimc data path point to whatever the user specified - // on command line - adjustedBy += "Command line " + dirParam; - dataPath = dirParam; - } - else - { - dataPath = applicationDirPath(); - adjustedBy += "Fallback to binary path " + dataPath; - } - - if (!ensureFolderPathExists(dataPath) || !QDir::setCurrent(dataPath)) - { - // BAD STUFF. WHAT DO? - initLogger(); - qCritical() << "Failed to set work path. Will exit. NOW."; - m_status = MultiMC::Failed; - return; - } - - // in test mode, root path is the same as the binary path. - if (test_mode) - { - rootPath = binPath; - } - else - { -#ifdef Q_OS_LINUX - QDir foo(PathCombine(binPath, "..")); - rootPath = foo.absolutePath(); -#elif defined(Q_OS_WIN32) - rootPath = binPath; -#elif defined(Q_OS_MAC) - QDir foo(PathCombine(binPath, "../..")); - rootPath = foo.absolutePath(); -#endif - } - -// static data paths... mostly just for translations -#ifdef Q_OS_LINUX - QDir foo(PathCombine(binPath, "..")); - staticDataPath = foo.absolutePath(); -#elif defined(Q_OS_WIN32) - staticDataPath = binPath; -#elif defined(Q_OS_MAC) - QDir foo(PathCombine(rootPath, "Contents/Resources")); - staticDataPath = foo.absolutePath(); -#endif - - // init the logger - initLogger(); - - qDebug() << "MultiMC 5, (c) 2013-2015 MultiMC Contributors"; - qDebug() << "Version : " << BuildConfig.VERSION_STR; - qDebug() << "Git commit : " << BuildConfig.GIT_COMMIT; - if (adjustedBy.size()) - { - qDebug() << "Work dir before adjustment : " << origcwdPath; - qDebug() << "Work dir after adjustment : " << QDir::currentPath(); - qDebug() << "Adjusted by : " << adjustedBy; - } - else - { - qDebug() << "Work dir : " << QDir::currentPath(); - } - qDebug() << "Binary path : " << binPath; - qDebug() << "Application root path : " << rootPath; - qDebug() << "Static data path : " << staticDataPath; - - // load settings - initGlobalSettings(test_mode); - - // load translations - initTranslations(); - - // initialize the updater - m_updateChecker.reset(new UpdateChecker(BuildConfig.CHANLIST_URL, BuildConfig.VERSION_CHANNEL, BuildConfig.VERSION_BUILD)); - - m_translationChecker.reset(new TranslationDownloader()); - - // load icons - initIcons(); - - // and instances - auto InstDirSetting = m_settings->getSetting("InstanceDir"); - // instance path: check for problems with '!' in instance path and warn the user in the log - // and rememer that we have to show him a dialog when the gui starts (if it does so) - QString instDir = m_settings->get("InstanceDir").toString(); - qDebug() << "Instance path : " << instDir; - if (checkProblemticPathJava(QDir(instDir))) - { - qWarning() - << "Your instance path contains \'!\' and this is known to cause java problems"; - } - m_instances.reset(new InstanceList(m_settings, InstDirSetting->get().toString(), this)); - qDebug() << "Loading Instances..."; - m_instances->loadList(); - connect(InstDirSetting.get(), SIGNAL(SettingChanged(const Setting &, QVariant)), - m_instances.get(), SLOT(on_InstFolderChanged(const Setting &, QVariant))); - - // and accounts - m_accounts.reset(new MojangAccountList(this)); - qDebug() << "Loading accounts..."; - m_accounts->setListFilePath("accounts.json", true); - m_accounts->loadList(); - - // init the http meta cache - ENV.initHttpMetaCache(rootPath, staticDataPath); - - // create the global network manager - ENV.m_qnam.reset(new QNetworkAccessManager(this)); - - // init proxy settings - { - QString proxyTypeStr = settings()->get("ProxyType").toString(); - QString addr = settings()->get("ProxyAddr").toString(); - int port = settings()->get("ProxyPort").value(); - QString user = settings()->get("ProxyUser").toString(); - QString pass = settings()->get("ProxyPass").toString(); - ENV.updateProxySettings(proxyTypeStr, addr, port, user, pass); - } - - m_translationChecker->downloadTranslations(); - - //FIXME: what to do with these? - m_profilers.insert("jprofiler", - std::shared_ptr(new JProfilerFactory())); - m_profilers.insert("jvisualvm", - std::shared_ptr(new JVisualVMFactory())); - for (auto profiler : m_profilers.values()) - { - profiler->registerSettings(m_settings); - } - - //FIXME: what to do with these? - m_tools.insert("mcedit", std::shared_ptr(new MCEditFactory())); - for (auto tool : m_tools.values()) - { - tool->registerSettings(m_settings); - } - - connect(this, SIGNAL(aboutToQuit()), SLOT(onExit())); - m_status = MultiMC::Initialized; -} - -MultiMC::~MultiMC() -{ - if (m_mmc_translator) - { - removeTranslator(m_mmc_translator.get()); - } - if (m_qt_translator) - { - removeTranslator(m_qt_translator.get()); - } -} - -void MultiMC::initTranslations() -{ - QLocale locale(m_settings->get("Language").toString()); - QLocale::setDefault(locale); - qDebug() << "Your language is" << locale.bcp47Name(); - m_qt_translator.reset(new QTranslator()); - if (m_qt_translator->load("qt_" + locale.bcp47Name(), - QLibraryInfo::location(QLibraryInfo::TranslationsPath))) - { - qDebug() << "Loading Qt Language File for" - << locale.bcp47Name().toLocal8Bit().constData() << "..."; - if (!installTranslator(m_qt_translator.get())) - { - qCritical() << "Loading Qt Language File failed."; - m_qt_translator.reset(); - } - } - else - { - m_qt_translator.reset(); - } - - m_mmc_translator.reset(new QTranslator()); - if (m_mmc_translator->load("mmc_" + locale.bcp47Name(), staticDataPath + "/translations")) - { - qDebug() << "Loading MMC Language File for" - << locale.bcp47Name().toLocal8Bit().constData() << "..."; - if (!installTranslator(m_mmc_translator.get())) - { - qCritical() << "Loading MMC Language File failed."; - m_mmc_translator.reset(); - } - } - else - { - m_mmc_translator.reset(); - } -} - -void MultiMC::initIcons() -{ - auto setting = MMC->settings()->getSetting("IconsDir"); - ENV.m_icons.reset(new IconList(QString(":/icons/instances/"), setting->get().toString())); - connect(setting.get(), &Setting::SettingChanged,[&](const Setting &, QVariant value) - { - ENV.m_icons->directoryChanged(value.toString()); - }); -} - - -void moveFile(const QString &oldName, const QString &newName) -{ - QFile::remove(newName); - QFile::copy(oldName, newName); - QFile::remove(oldName); -} - - -void appDebugOutput(QtMsgType type, const QMessageLogContext &context, const QString &msg) -{ - const char *levels = "DWCF"; - const QString format("%1 %2 %3\n"); - - qint64 msecstotal = MMC->timeSinceStart(); - qint64 seconds = msecstotal / 1000; - qint64 msecs = msecstotal % 1000; - QString foo; - char buf[1025] = {0}; - ::snprintf(buf, 1024, "%5lld.%03lld", seconds, msecs); - - QString out = format.arg(buf).arg(levels[type]).arg(msg); - - MMC->logFile->write(out.toUtf8()); - MMC->logFile->flush(); - QTextStream(stderr) << out.toLocal8Bit(); - fflush(stderr); -} - -void MultiMC::initLogger() -{ - static const QString logBase = "MultiMC-%0.log"; - - moveFile(logBase.arg(3), logBase.arg(4)); - moveFile(logBase.arg(2), logBase.arg(3)); - moveFile(logBase.arg(1), logBase.arg(2)); - moveFile(logBase.arg(0), logBase.arg(1)); - - qInstallMessageHandler(appDebugOutput); - - logFile = std::make_shared(logBase.arg(0)); - logFile->open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Truncate); -} - -void MultiMC::initGlobalSettings(bool test_mode) -{ - m_settings.reset(new INISettingsObject("multimc.cfg", this)); - // Updates - m_settings->registerSetting("UpdateChannel", BuildConfig.VERSION_CHANNEL); - m_settings->registerSetting("AutoUpdate", true); - m_settings->registerSetting("IconTheme", QString("multimc")); - - // Notifications - m_settings->registerSetting("ShownNotifications", QString()); - - // Remembered state - m_settings->registerSetting("LastUsedGroupForNewInstance", QString()); - - QString defaultMonospace; - int defaultSize = 11; -#ifdef Q_OS_WIN32 - defaultMonospace = "Courier"; - defaultSize = 10; -#elif defined(Q_OS_MAC) - defaultMonospace = "Menlo"; -#else - defaultMonospace = "Monospace"; -#endif - if(!test_mode) - { - // resolve the font so the default actually matches - QFont consoleFont; - consoleFont.setFamily(defaultMonospace); - consoleFont.setStyleHint(QFont::Monospace); - consoleFont.setFixedPitch(true); - QFontInfo consoleFontInfo(consoleFont); - QString resolvedDefaultMonospace = consoleFontInfo.family(); - QFont resolvedFont(resolvedDefaultMonospace); - qDebug() << "Detected default console font:" << resolvedDefaultMonospace - << ", substitutions:" << resolvedFont.substitutions().join(','); - m_settings->registerSetting("ConsoleFont", resolvedDefaultMonospace); - } - else - { - // in test mode, we don't have UI, so we don't do any font resolving - m_settings->registerSetting("ConsoleFont", defaultMonospace); - } - m_settings->registerSetting("ConsoleFontSize", defaultSize); - - FTBPlugin::initialize(m_settings); - - // Folders - m_settings->registerSetting("InstanceDir", "instances"); - m_settings->registerSetting({"CentralModsDir", "ModsDir"}, "mods"); - m_settings->registerSetting({"LWJGLDir", "LwjglDir"}, "lwjgl"); - m_settings->registerSetting("IconsDir", "icons"); - - // Editors - m_settings->registerSetting("JsonEditor", QString()); - - // Language - m_settings->registerSetting("Language", QLocale(QLocale::system().language()).bcp47Name()); - - // Console - m_settings->registerSetting("ShowConsole", true); - m_settings->registerSetting("RaiseConsole", true); - m_settings->registerSetting("AutoCloseConsole", true); - m_settings->registerSetting("LogPrePostOutput", true); - - // Console Colors - // m_settings->registerSetting("SysMessageColor", QColor(Qt::blue)); - // m_settings->registerSetting("StdOutColor", QColor(Qt::black)); - // m_settings->registerSetting("StdErrColor", QColor(Qt::red)); - - // Window Size - m_settings->registerSetting({"LaunchMaximized", "MCWindowMaximize"}, false); - m_settings->registerSetting({"MinecraftWinWidth", "MCWindowWidth"}, 854); - m_settings->registerSetting({"MinecraftWinHeight", "MCWindowHeight"}, 480); - - // Proxy Settings - m_settings->registerSetting("ProxyType", "None"); - m_settings->registerSetting({"ProxyAddr", "ProxyHostName"}, "127.0.0.1"); - m_settings->registerSetting("ProxyPort", 8080); - m_settings->registerSetting({"ProxyUser", "ProxyUsername"}, ""); - m_settings->registerSetting({"ProxyPass", "ProxyPassword"}, ""); - - // Memory - m_settings->registerSetting({"MinMemAlloc", "MinMemoryAlloc"}, 512); - m_settings->registerSetting({"MaxMemAlloc", "MaxMemoryAlloc"}, 1024); - m_settings->registerSetting("PermGen", 128); - - // Java Settings - m_settings->registerSetting("JavaPath", ""); - m_settings->registerSetting("LastHostname", ""); - m_settings->registerSetting("JavaDetectionHack", ""); - m_settings->registerSetting("JvmArgs", ""); - - // Custom Commands - m_settings->registerSetting({"PreLaunchCommand", "PreLaunchCmd"}, ""); - m_settings->registerSetting({"PostExitCommand", "PostExitCmd"}, ""); - - // The cat - m_settings->registerSetting("TheCat", false); - - m_settings->registerSetting("InstSortMode", "Name"); - m_settings->registerSetting("SelectedInstance", QString()); - - // Window state and geometry - m_settings->registerSetting("MainWindowState", ""); - m_settings->registerSetting("MainWindowGeometry", ""); - - m_settings->registerSetting("ConsoleWindowState", ""); - m_settings->registerSetting("ConsoleWindowGeometry", ""); - - m_settings->registerSetting("SettingsGeometry", ""); - - m_settings->registerSetting("PagedGeometry", ""); -} - -std::shared_ptr MultiMC::lwjgllist() -{ - if (!m_lwjgllist) - { - m_lwjgllist.reset(new LWJGLVersionList()); - ENV.registerVersionList("org.lwjgl.legacy", m_lwjgllist); - } - return m_lwjgllist; -} - -std::shared_ptr MultiMC::forgelist() -{ - if (!m_forgelist) - { - m_forgelist.reset(new ForgeVersionList()); - ENV.registerVersionList("net.minecraftforge", m_forgelist); - } - return m_forgelist; -} - -std::shared_ptr MultiMC::liteloaderlist() -{ - if (!m_liteloaderlist) - { - m_liteloaderlist.reset(new LiteLoaderVersionList()); - ENV.registerVersionList("com.mumfrey.liteloader", m_liteloaderlist); - } - return m_liteloaderlist; -} - -std::shared_ptr MultiMC::minecraftlist() -{ - if (!m_minecraftlist) - { - m_minecraftlist.reset(new MinecraftVersionList()); - ENV.registerVersionList("net.minecraft", m_minecraftlist); - } - return m_minecraftlist; -} - -std::shared_ptr MultiMC::javalist() -{ - if (!m_javalist) - { - m_javalist.reset(new JavaVersionList()); - ENV.registerVersionList("com.java", m_javalist); - } - return m_javalist; -} - -void MultiMC::installUpdates(const QString updateFilesDir, UpdateFlags flags) -{ - // if we are going to update on exit, save the params now - if (flags & OnExit) - { - m_updateOnExitPath = updateFilesDir; - m_updateOnExitFlags = flags & ~OnExit; - return; - } - // otherwise if there already were some params for on exit update, clear them and continue - else if (m_updateOnExitPath.size()) - { - m_updateOnExitFlags = None; - m_updateOnExitPath.clear(); - } - qDebug() << "Installing updates."; -#ifdef WINDOWS - QString finishCmd = applicationFilePath(); - QString updaterBinary = PathCombine(applicationDirPath(), "updater.exe"); -#elif LINUX - QString finishCmd = PathCombine(root(), "MultiMC"); - QString updaterBinary = PathCombine(applicationDirPath(), "updater"); -#elif OSX - QString finishCmd = applicationFilePath(); - QString updaterBinary = PathCombine(applicationDirPath(), "updater"); -#else -#error Unsupported operating system. -#endif - - QStringList args; - // ./updater --install-dir $INSTALL_DIR --package-dir $UPDATEFILES_DIR --script - // $UPDATEFILES_DIR/file_list.xml --wait $PID --mode main - args << "--install-dir" << root(); - args << "--package-dir" << updateFilesDir; - args << "--script" << PathCombine(updateFilesDir, "file_list.xml"); - args << "--wait" << QString::number(applicationPid()); - if (flags & DryRun) - args << "--dry-run"; - if (flags & RestartOnFinish) - { - args << "--finish-cmd" << finishCmd; - args << "--finish-dir" << dataPath; - } - qDebug() << "Running updater with command" << updaterBinary << args.join(" "); - QFile::setPermissions(updaterBinary, (QFileDevice::Permission)0x7755); - - if (!QProcess::startDetached(updaterBinary, args /*, root()*/)) - { - qCritical() << "Failed to start the updater process!"; - return; - } - - ENV.destroy(); - // Now that we've started the updater, quit MultiMC. - quit(); -} - -void MultiMC::setIconTheme(const QString& name) -{ - XdgIcon::setThemeName(name); -} - -QIcon MultiMC::getThemedIcon(const QString& name) -{ - return XdgIcon::fromTheme(name); -} - -void MultiMC::onExit() -{ - if(m_instances) - { - m_instances->saveGroupList(); - } - if (m_updateOnExitPath.size()) - { - installUpdates(m_updateOnExitPath, m_updateOnExitFlags); - } - ENV.destroy(); - if(logFile) - { - logFile->flush(); - logFile->close(); - } -} - -bool MultiMC::openJsonEditor(const QString &filename) -{ - const QString file = QDir::current().absoluteFilePath(filename); - if (m_settings->get("JsonEditor").toString().isEmpty()) - { - return QDesktopServices::openUrl(QUrl::fromLocalFile(file)); - } - else - { - return QProcess::startDetached(m_settings->get("JsonEditor").toString(), QStringList() - << file); - } -} - -#include "MultiMC.moc" diff --git a/MultiMC.h b/MultiMC.h deleted file mode 100644 index b78bbbd2..00000000 --- a/MultiMC.h +++ /dev/null @@ -1,188 +0,0 @@ -#pragma once - -#include -#include -#include -#include -#include -#include - -class QFile; -class MinecraftVersionList; -class LWJGLVersionList; -class HttpMetaCache; -class SettingsObject; -class InstanceList; -class MojangAccountList; -class IconList; -class QNetworkAccessManager; -class ForgeVersionList; -class LiteLoaderVersionList; -class JavaVersionList; -class UpdateChecker; -class BaseProfilerFactory; -class BaseDetachedToolFactory; -class TranslationDownloader; - -#if defined(MMC) -#undef MMC -#endif -#define MMC (static_cast(QCoreApplication::instance())) - -enum UpdateFlag -{ - None = 0x0, - RestartOnFinish = 0x1, - DryRun = 0x2, - OnExit = 0x4 -}; -Q_DECLARE_FLAGS(UpdateFlags, UpdateFlag); -Q_DECLARE_OPERATORS_FOR_FLAGS(UpdateFlags); - -class MultiMC : public QApplication -{ - // friends for the purpose of limiting access to deprecated stuff - friend class MultiMCPage; - friend class MainWindow; - Q_OBJECT -public: - enum Status - { - Failed, - Succeeded, - Initialized - }; - -public: - MultiMC(int &argc, char **argv, bool test_mode = false); - virtual ~MultiMC(); - - // InstanceList, IconList, OneSixFTBInstance, LegacyUpdate, LegacyInstance, MCEditTool, JVisualVM, MinecraftInstance, JProfiler, BaseInstance - std::shared_ptr settings() - { - return m_settings; - } - - qint64 timeSinceStart() const - { - return startTime.msecsTo(QDateTime::currentDateTime()); - } - - QIcon getThemedIcon(const QString& name); - - void setIconTheme(const QString& name); - - // DownloadUpdateTask - std::shared_ptr updateChecker() - { - return m_updateChecker; - } - - std::shared_ptr minecraftlist(); - std::shared_ptr lwjgllist(); - std::shared_ptr forgelist(); - std::shared_ptr liteloaderlist(); - std::shared_ptr javalist(); - - // APPLICATION ONLY - std::shared_ptr instances() - { - return m_instances; - } - - // APPLICATION ONLY - std::shared_ptr accounts() - { - return m_accounts; - } - - // APPLICATION ONLY - Status status() - { - return m_status; - } - - // APPLICATION ONLY - QMap> profilers() - { - return m_profilers; - } - - // APPLICATION ONLY - QMap> tools() - { - return m_tools; - } - - // APPLICATION ONLY - void installUpdates(const QString updateFilesDir, UpdateFlags flags = None); - - /*! - * Opens a json file using either a system default editor, or, if note empty, the editor - * specified in the settings - */ - bool openJsonEditor(const QString &filename); - -protected: /* to be removed! */ - // FIXME: remove. used by MultiMCPage to enumerate translations. - /// this is the static data. it stores things that don't move. - const QString &staticData() - { - return staticDataPath; - } - - // FIXME: remove. used by MainWindow to create application update tasks - /// this is the root of the 'installation'. Used for automatic updates - const QString &root() - { - return rootPath; - } - -private slots: - /** - * Do all the things that should be done before we exit - */ - void onExit(); - -private: - void initLogger(); - - void initIcons(); - - void initGlobalSettings(bool test_mode); - - void initTranslations(); - -private: - friend class UpdateCheckerTest; - friend class DownloadTaskTest; - - QDateTime startTime; - - std::shared_ptr m_qt_translator; - std::shared_ptr m_mmc_translator; - std::shared_ptr m_settings; - std::shared_ptr m_instances; - std::shared_ptr m_updateChecker; - std::shared_ptr m_accounts; - std::shared_ptr m_lwjgllist; - std::shared_ptr m_forgelist; - std::shared_ptr m_liteloaderlist; - std::shared_ptr m_minecraftlist; - std::shared_ptr m_javalist; - std::shared_ptr m_translationChecker; - - QMap> m_profilers; - QMap> m_tools; - - QString m_updateOnExitPath; - UpdateFlags m_updateOnExitFlags = None; - - QString rootPath; - QString staticDataPath; - QString dataPath; - - Status m_status = MultiMC::Failed; -public: - std::shared_ptr logFile; -}; diff --git a/application/BuildConfig.cpp.in b/application/BuildConfig.cpp.in new file mode 100644 index 00000000..04cfbf05 --- /dev/null +++ b/application/BuildConfig.cpp.in @@ -0,0 +1,56 @@ +#include "BuildConfig.h" +#include + +Config BuildConfig; + +Config::Config() +{ + // Version information + VERSION_MAJOR = @MultiMC_VERSION_MAJOR@; + VERSION_MINOR = @MultiMC_VERSION_MINOR@; + VERSION_HOTFIX = @MultiMC_VERSION_HOTFIX@; + VERSION_BUILD = @MultiMC_VERSION_BUILD@; + + VERSION_CHANNEL = "@MultiMC_VERSION_CHANNEL@"; + BUILD_PLATFORM = "@MultiMC_BUILD_PLATFORM@"; + CHANLIST_URL = "@MultiMC_CHANLIST_URL@"; + NOTIFICATION_URL = "@MultiMC_NOTIFICATION_URL@"; + FULL_VERSION_STR = "@MultiMC_VERSION_MAJOR@.@MultiMC_VERSION_MINOR@.@MultiMC_VERSION_BUILD@"; + + UPDATER_DRY_RUN = @MultiMC_UPDATER_DRY_RUN_value@; + UPDATER_FORCE_LOCAL = @MultiMC_UPDATER_FORCE_LOCAL_value@; + + GIT_COMMIT = "@MultiMC_GIT_COMMIT@"; + VERSION_STR = "@MultiMC_VERSION_STRING@"; + NEWS_RSS_URL = "@MultiMC_NEWS_RSS_URL@"; +} + +QString Config::printableVersionString() const +{ + QString vstr = QString("%1.%2").arg(QString::number(VERSION_MAJOR), QString::number(VERSION_MINOR)); + + if (VERSION_HOTFIX > 0) vstr += "." + QString::number(VERSION_HOTFIX); + + // If the build is a development build or release candidate, add that info to the end. + if(VERSION_CHANNEL == "stable") + { + return vstr; + } + else if(VERSION_CHANNEL == "develop") + { + vstr += "-dev-" + QString::number(VERSION_BUILD); + } + else if(VERSION_CHANNEL == "unstable") + { + vstr += "-nuke-" + QString::number(VERSION_BUILD); + } + else if(VERSION_CHANNEL == "custom") + { + vstr += "-local"; + } + else + { + vstr += "-" + VERSION_CHANNEL + "-" + QString::number(VERSION_BUILD); + } + return vstr; +} diff --git a/application/BuildConfig.h b/application/BuildConfig.h new file mode 100644 index 00000000..60aefeb4 --- /dev/null +++ b/application/BuildConfig.h @@ -0,0 +1,63 @@ +#pragma once +#include + +/** + * \brief The Config class holds all the build-time information passed from the build system. + */ +class Config +{ +public: + Config(); + /// The major version number. + int VERSION_MAJOR; + /// The minor version number. + int VERSION_MINOR; + /// The hotfix number. + int VERSION_HOTFIX; + /// The build number. + int VERSION_BUILD; + + /** + * The version channel + * This is used by the updater to determine what channel the current version came from. + */ + QString VERSION_CHANNEL; + + /// A short string identifying this build's platform. For example, "lin64" or "win32". + QString BUILD_PLATFORM; + + /// URL for the updater's channel + QString CHANLIST_URL; + + /// URL for notifications + QString NOTIFICATION_URL; + + /// Used for matching notifications + QString FULL_VERSION_STR; + + /// enabled for updater dry run + bool UPDATER_DRY_RUN; + + /// enabled for updater dry run + bool UPDATER_FORCE_LOCAL; + + /// The commit hash of this build + QString GIT_COMMIT; + + /// This is printed on start to standard output + QString VERSION_STR; + + /** + * This is used to fetch the news RSS feed. + * It defaults in CMakeLists.txt to "http://multimc.org/rss.xml" + */ + QString NEWS_RSS_URL; + + /** + * \brief Converts the Version to a string. + * \return The version number in string format (major.minor.revision.build). + */ + QString printableVersionString() const; +}; + +extern Config BuildConfig; diff --git a/application/CMakeLists.txt b/application/CMakeLists.txt new file mode 100644 index 00000000..58a90efa --- /dev/null +++ b/application/CMakeLists.txt @@ -0,0 +1,473 @@ +project(MultiMC-Application) + +######## Set URLs ######## +set(MultiMC_NEWS_RSS_URL "http://multimc.org/rss.xml" CACHE STRING "URL to fetch MultiMC's news RSS feed from.") + +######## Set version numbers ######## +set(MultiMC_VERSION_MAJOR 0) +set(MultiMC_VERSION_MINOR 4) +set(MultiMC_VERSION_HOTFIX 5) + +# Build number +set(MultiMC_VERSION_BUILD -1 CACHE STRING "Build number. -1 for no build number.") + +# Version type +set(MultiMC_VERSION_TYPE "Custom" CACHE STRING "MultiMC's version type. This should be one of 'Custom', 'Release', 'ReleaseCandidate', or 'Development', depending on what type of version this is.") + +# Build platform. +set(MultiMC_BUILD_PLATFORM "" CACHE STRING "A short string identifying the platform that this build was built for. Only used by the notification system and to display in the about dialog.") + +# Version channel +set(MultiMC_VERSION_CHANNEL "" CACHE STRING "The current build's channel. Included in the version string.") + +# Channel list URL +set(MultiMC_CHANLIST_URL "" CACHE STRING "URL for the channel list.") + +# Updater enabled? +set(MultiMC_UPDATER false CACHE BOOL "Whether or not the update system is enabled. If this is enabled, you must also set MultiMC_CHANLIST_URL and MultiMC_VERSION_CHANNEL in order for it to work properly.") + +# Notification URL +set(MultiMC_NOTIFICATION_URL "" CACHE STRING "URL for checking for notifications.") + +set(MultiMC_RELEASE_VERSION_NAME "${MultiMC_VERSION_MAJOR}.${MultiMC_VERSION_MINOR}") +if(MultiMC_VERSION_HOTFIX GREATER 0) + set(MultiMC_RELEASE_VERSION_NAME "${MultiMC_RELEASE_VERSION_NAME}.${MultiMC_VERSION_HOTFIX}") +endif() + +# Build a version string to display in the configure logs. +if(MultiMC_VERSION_TYPE STREQUAL "Custom") + message(STATUS "Version Type: Custom") + set(MultiMC_VERSION_STRING "${MultiMC_RELEASE_VERSION_NAME}") +elseif(MultiMC_VERSION_TYPE STREQUAL "Release") + message(STATUS "Version Type: Stable Release") + set(MultiMC_VERSION_STRING "${MultiMC_RELEASE_VERSION_NAME}") +elseif(MultiMC_VERSION_TYPE STREQUAL "Development") + message(STATUS "Version Type: Development") + set(MultiMC_VERSION_STRING "${MultiMC_RELEASE_VERSION_NAME}-dev${MultiMC_VERSION_BUILD}") +else() + message(ERROR "Invalid build type.") +endif() + +message(STATUS "MultiMC 5 Version: ${MultiMC_VERSION_STRING}") + +# If the update system is enabled, make sure MultiMC_CHANLIST_URL and MultiMC_VERSION_CHANNEL are set. +if(MultiMC_UPDATER) + if(MultiMC_VERSION_CHANNEL STREQUAL "") + message(FATAL_ERROR "Update system is enabled, but MultiMC_VERSION_CHANNEL is not set.\n" + "Please ensure the CMake variables MultiMC_VERSION_CHANNEL, MultiMC_CHANLIST_URL, and MultiMC_VERSION_BUILD are set.") + endif() + if(MultiMC_CHANLIST_URL STREQUAL "") + message(FATAL_ERROR "Update system is enabled, but MultiMC_CHANLIST_URL is not set.\n" + "Please ensure the CMake variables MultiMC_VERSION_CHANNEL, MultiMC_CHANLIST_URL, and MultiMC_VERSION_BUILD are set.") + endif() + if(MultiMC_VERSION_BUILD LESS 0) + message(FATAL_ERROR "Update system is enabled, but MultiMC_VERSION_BUILD is not set.\n" + "Please ensure the CMake variables MultiMC_VERSION_CHANNEL, MultiMC_CHANLIST_URL, and MultiMC_VERSION_BUILD are set.") + endif() + message(STATUS "Updater is enabled. Channel list URL: ${MultiMC_CHANLIST_URL}") +endif() + +#### Updater-related build config options #### +option(MultiMC_UPDATER_DRY_RUN "Enable updater dry-run mode -- for updater development." OFF) +option(MultiMC_UPDATER_FORCE_LOCAL "Do not download updated updater -- for updater development." OFF) + +if(MultiMC_UPDATER_DRY_RUN) + set(MultiMC_UPDATER_DRY_RUN_value "true") +else() + set(MultiMC_UPDATER_DRY_RUN_value "false") +endif() + +if(MultiMC_UPDATER_FORCE_LOCAL) + set(MultiMC_UPDATER_FORCE_LOCAL_value "true") +else() + set(MultiMC_UPDATER_FORCE_LOCAL_value "false") +endif() + +######## Configure header ######## +configure_file("${PROJECT_SOURCE_DIR}/BuildConfig.cpp.in" "${PROJECT_BINARY_DIR}/BuildConfig.cpp") + +######## Packaging/install paths setup ######## + +if(UNIX AND APPLE) + set(BINARY_DEST_DIR MultiMC.app/Contents/MacOS) + set(PLUGIN_DEST_DIR MultiMC.app/Contents/MacOS) + set(QTCONF_DEST_DIR MultiMC.app/Contents/Resources) + set(APPS "\${CMAKE_INSTALL_PREFIX}/MultiMC.app") + + set(MACOSX_BUNDLE_BUNDLE_NAME "MultiMC") + set(MACOSX_BUNDLE_INFO_STRING "MultiMC Minecraft launcher and management utility.") + set(MACOSX_BUNDLE_GUI_IDENTIFIER "org.multimc.MultiMC5") + set(MACOSX_BUNDLE_BUNDLE_VERSION "${MultiMC_VERSION_MAJOR}.${MultiMC_VERSION_MINOR}.${MultiMC_VERSION_HOTFIX}.${MultiMC_VERSION_BUILD}") + set(MACOSX_BUNDLE_SHORT_VERSION_STRING "${MultiMC_VERSION_MAJOR}.${MultiMC_VERSION_MINOR}.${MultiMC_VERSION_HOTFIX}.${MultiMC_VERSION_BUILD}") + set(MACOSX_BUNDLE_LONG_VERSION_STRING "${MultiMC_VERSION_MAJOR}.${MultiMC_VERSION_MINOR}.${MultiMC_VERSION_HOTFIX}.${MultiMC_VERSION_BUILD}") + set(MACOSX_BUNDLE_ICON_FILE MultiMC.icns) + set(MACOSX_BUNDLE_COPYRIGHT "Copyright 2014 MultiMC Contributors") +elseif(UNIX) + set(BINARY_DEST_DIR bin) + set(PLUGIN_DEST_DIR plugins) + set(QTCONF_DEST_DIR .) + set(APPS "\${CMAKE_INSTALL_PREFIX}/bin/MultiMC") +elseif(WIN32) + set(BINARY_DEST_DIR .) + set(PLUGIN_DEST_DIR .) + set(QTCONF_DEST_DIR .) + set(APPS "\${CMAKE_INSTALL_PREFIX}/MultiMC.exe") +endif() + +# directories to look for dependencies +set(DIRS ${QT_LIBS_DIR} ${QT_LIBEXECS_DIR}) + +################################ FILES ################################ + +######## Sources and headers ######## +SET(MULTIMC_SOURCES + # Application base + main.cpp + MultiMC.h + MultiMC.cpp + BuildConfig.h + ${PROJECT_BINARY_DIR}/BuildConfig.cpp + + # GUI - general utilities + GuiUtil.h + GuiUtil.cpp + ColumnResizer.h + ColumnResizer.cpp + InstanceProxyModel.h + InstanceProxyModel.cpp + + # GUI - windows + MainWindow.h + MainWindow.cpp + ConsoleWindow.h + ConsoleWindow.cpp + + # page provider for instances + InstancePageProvider.h + InstancePageProvider.cpp + + # Annoying nag screen logic + NagUtils.h + NagUtils.cpp + + + # GUI - page dialog pages + pages/BasePage.h + pages/VersionPage.cpp + pages/VersionPage.h + pages/TexturePackPage.h + pages/ResourcePackPage.h + pages/ModFolderPage.cpp + pages/ModFolderPage.h + pages/NotesPage.cpp + pages/NotesPage.h + pages/LogPage.cpp + pages/LogPage.h + pages/InstanceSettingsPage.cpp + pages/InstanceSettingsPage.h + pages/ScreenshotsPage.cpp + pages/ScreenshotsPage.h + pages/OtherLogsPage.cpp + pages/OtherLogsPage.h + + # GUI - global settings pages + pages/global/AccountListPage.cpp + pages/global/AccountListPage.h + pages/global/ExternalToolsPage.cpp + pages/global/ExternalToolsPage.h + pages/global/JavaPage.cpp + pages/global/JavaPage.h + pages/global/MinecraftPage.cpp + pages/global/MinecraftPage.h + pages/global/MultiMCPage.cpp + pages/global/MultiMCPage.h + pages/global/ProxyPage.cpp + pages/global/ProxyPage.h + + # GUI - dialogs + dialogs/AboutDialog.cpp + dialogs/AboutDialog.h + dialogs/AccountSelectDialog.cpp + dialogs/AccountSelectDialog.h + dialogs/CopyInstanceDialog.cpp + dialogs/CopyInstanceDialog.h + dialogs/CustomMessageBox.cpp + dialogs/CustomMessageBox.h + dialogs/EditAccountDialog.cpp + dialogs/EditAccountDialog.h + dialogs/IconPickerDialog.cpp + dialogs/IconPickerDialog.h + dialogs/LoginDialog.cpp + dialogs/LoginDialog.h + dialogs/ModEditDialogCommon.cpp + dialogs/ModEditDialogCommon.h + dialogs/NewInstanceDialog.cpp + dialogs/NewInstanceDialog.h + dialogs/NotificationDialog.cpp + dialogs/NotificationDialog.h + pagedialog/PageDialog.cpp + pagedialog/PageDialog.h + dialogs/ProgressDialog.cpp + dialogs/ProgressDialog.h + dialogs/UpdateDialog.cpp + dialogs/UpdateDialog.h + dialogs/VersionSelectDialog.cpp + dialogs/VersionSelectDialog.h + + + # GUI - widgets + widgets/Common.cpp + widgets/Common.h + widgets/IconLabel.cpp + widgets/IconLabel.h + widgets/LabeledToolButton.cpp + widgets/LabeledToolButton.h + widgets/LineSeparator.cpp + widgets/LineSeparator.h + widgets/MCModInfoFrame.cpp + widgets/MCModInfoFrame.h + widgets/ModListView.cpp + widgets/ModListView.h + widgets/PageContainer.cpp + widgets/PageContainer.h + widgets/PageContainer_p.h + widgets/ServerStatus.cpp + widgets/ServerStatus.h + widgets/VersionListView.cpp + widgets/VersionListView.h + + + # GUI - instance group view + groupview/GroupedProxyModel.cpp + groupview/GroupedProxyModel.h + groupview/GroupView.cpp + groupview/GroupView.h + groupview/InstanceDelegate.cpp + groupview/InstanceDelegate.h + groupview/VisualGroup.cpp + groupview/VisualGroup.h +) + +######## UIs ######## +SET(MULTIMC_UIS + # Option pages + pages/VersionPage.ui + pages/ModFolderPage.ui + pages/LogPage.ui + pages/InstanceSettingsPage.ui + pages/NotesPage.ui + pages/ScreenshotsPage.ui + pages/OtherLogsPage.ui + + # Global settings pages + pages/global/AccountListPage.ui + pages/global/ExternalToolsPage.ui + pages/global/JavaPage.ui + pages/global/MinecraftPage.ui + pages/global/MultiMCPage.ui + pages/global/ProxyPage.ui + + # Dialogs + dialogs/CopyInstanceDialog.ui + dialogs/NewInstanceDialog.ui + dialogs/AboutDialog.ui + dialogs/VersionSelectDialog.ui + dialogs/ProgressDialog.ui + dialogs/IconPickerDialog.ui + dialogs/AccountSelectDialog.ui + dialogs/EditAccountDialog.ui + dialogs/LoginDialog.ui + dialogs/UpdateDialog.ui + dialogs/NotificationDialog.ui + + # Widgets/other + widgets/MCModInfoFrame.ui +) + +set(MULTIMC_QRCS + resources/backgrounds/backgrounds.qrc + resources/multimc/multimc.qrc + resources/pe_dark/pe_dark.qrc + resources/pe_light/pe_light.qrc + resources/pe_colored/pe_colored.qrc + resources/pe_blue/pe_blue.qrc + resources/OSX/OSX.qrc + resources/iOS/iOS.qrc + resources/instances/instances.qrc + resources/versions/versions.qrc +) + +######## Windows resource files ######## +if(WIN32) + set(MULTIMC_RCS resources/multimc.rc) +endif() + +####### X11 Stuff ####### +if(UNIX AND NOT APPLE) + find_package(Qt5X11Extras REQUIRED) + set(MultiMC_LINK_ADDITIONAL_LIBS ${MultiMC_LINK_ADDITIONAL_LIBS} xcb Qt5::X11Extras) + list(APPEND MULTIMC_SOURCES Platform_X11.cpp) +else() + list(APPEND MULTIMC_SOURCES Platform_Other.cpp) +endif() + + +# Link additional libraries +if(WIN32) + set(MultiMC_LINK_ADDITIONAL_LIBS ${MultiMC_LINK_ADDITIONAL_LIBS} Qt5::WinMain) +endif(WIN32) + +include_directories(../logic) + +# Qt 5 stuff +qt5_wrap_ui(MULTIMC_UI ${MULTIMC_UIS}) +qt5_add_resources(MULTIMC_RESOURCES ${MULTIMC_QRCS}) + +# Add executable +add_executable(MultiMC MACOSX_BUNDLE WIN32 ${MULTIMC_SOURCES} ${MULTIMC_UI} ${MULTIMC_RESOURCES} ${MULTIMC_RCS}) +target_link_libraries(MultiMC MultiMC_logic xz-embedded unpack200 iconfix libUtil LogicalGui + ${QUAZIP_LIBRARIES} Qt5::Core Qt5::Xml Qt5::Widgets Qt5::Network Qt5::Concurrent Qt5::WebKitWidgets + ${MultiMC_LINK_ADDITIONAL_LIBS}) + +################################ INSTALLATION AND PACKAGING ################################ + +######## Install ######## + +#### Executable #### +if(APPLE AND UNIX) ## OSX + install(TARGETS MultiMC + BUNDLE DESTINATION . COMPONENT Runtime + RUNTIME DESTINATION MultiMC.app/Contents/MacOS COMPONENT Runtime + ) + +elseif(UNIX) ## LINUX and similar + install(TARGETS MultiMC + BUNDLE DESTINATION . COMPONENT Runtime + RUNTIME DESTINATION bin COMPONENT Runtime + ) + install(PROGRAMS package/linux/MultiMC DESTINATION .) + +elseif(WIN32) ## WINDOWS + install(TARGETS MultiMC + BUNDLE DESTINATION . COMPONENT Runtime + LIBRARY DESTINATION . COMPONENT Runtime + RUNTIME DESTINATION . COMPONENT Runtime + ) +endif() + +#### Java bits #### +install_jar(JavaCheck "${BINARY_DEST_DIR}/jars") +install_jar(NewLaunch "${BINARY_DEST_DIR}/jars") + +#### Dist package logic #### + +if(CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo") + # Image formats + install( + DIRECTORY "${QT_PLUGINS_DIR}/imageformats" + DESTINATION ${PLUGIN_DEST_DIR} + COMPONENT Runtime + REGEX "tga|tiff|mng" EXCLUDE + ) + # Icon engines + install( + DIRECTORY "${QT_PLUGINS_DIR}/iconengines" + DESTINATION ${PLUGIN_DEST_DIR} + COMPONENT Runtime + REGEX "fontawesome" EXCLUDE + ) + # Platform plugins + install( + DIRECTORY "${QT_PLUGINS_DIR}/platforms" + DESTINATION ${PLUGIN_DEST_DIR} + COMPONENT Runtime + REGEX "minimal|linuxfb|offscreen" EXCLUDE + ) +else() + # Image formats + install( + DIRECTORY "${QT_PLUGINS_DIR}/imageformats" + DESTINATION ${PLUGIN_DEST_DIR} + COMPONENT Runtime + REGEX "tga|tiff|mng" EXCLUDE + REGEX "d\\." EXCLUDE + REGEX "_debug\\." EXCLUDE + ) + # Icon engines + install( + DIRECTORY "${QT_PLUGINS_DIR}/iconengines" + DESTINATION ${PLUGIN_DEST_DIR} + COMPONENT Runtime + REGEX "fontawesome" EXCLUDE + REGEX "d\\." EXCLUDE + REGEX "_debug\\." EXCLUDE + ) + # Platform plugins + install( + DIRECTORY "${QT_PLUGINS_DIR}/platforms" + DESTINATION ${PLUGIN_DEST_DIR} + COMPONENT Runtime + REGEX "minimal|linuxfb|offscreen" EXCLUDE + REGEX "d\\." EXCLUDE + REGEX "_debug\\." EXCLUDE + ) + if(APPLE) + # Accessible plugin to make buttons look decent on osx + install( + DIRECTORY "${QT_PLUGINS_DIR}/accessible" + DESTINATION ${PLUGIN_DEST_DIR} + COMPONENT Runtime + REGEX "quick" EXCLUDE + REGEX "d\\." EXCLUDE + REGEX "_debug\\." EXCLUDE + ) + endif() +endif() + +# qtconf +install( + CODE " +file(WRITE \"\${CMAKE_INSTALL_PREFIX}/${QTCONF_DEST_DIR}/qt.conf\" \"\") +" + COMPONENT Runtime +) + +# ICNS file for OS X +if(APPLE) + install(FILES resources/MultiMC.icns DESTINATION MultiMC.app/Contents/Resources) +endif() + +configure_file( + "${CMAKE_CURRENT_SOURCE_DIR}/install_prereqs.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/install_prereqs.cmake" + @ONLY +) +install(SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/install_prereqs.cmake" COMPONENT Runtime) + + + +######## Package ######## + +# Package with CPack +if(UNIX) + if(APPLE) + set(CPACK_GENERATOR "ZIP") + else() + set(CPACK_GENERATOR "TGZ") + endif() +elseif(WIN32) + set(CPACK_GENERATOR "ZIP") +endif() +set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY 0) + +set(CPACK_PACKAGE_NAME "MultiMC 5") +set(CPACK_PACKAGE_VENDOR "") +set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "MultiMC - Minecraft launcher and management tool.") +set(CPACK_PACKAGE_VERSION "${MultiMC_VERSION_MAJOR}.${MultiMC_VERSION_MINOR}.${MultiMC_VERSION_REV}.${MultiMC_VERSION_BUILD}") +set(CPACK_PACKAGE_VERSION_MAJOR ${MultiMC_VERSION_MAJOR}) +set(CPACK_PACKAGE_VERSION_MINOR ${MultiMC_VERSION_MINOR}) +set(CPACK_PACKAGE_VERSION_PATCH ${MultiMC_VERSION_REV}) + +set(CPACK_PACKAGE_FILE_NAME "MultiMC") + +include(CPack) diff --git a/application/ColumnResizer.cpp b/application/ColumnResizer.cpp new file mode 100644 index 00000000..1c5597aa --- /dev/null +++ b/application/ColumnResizer.cpp @@ -0,0 +1,202 @@ +/* + * Copyright 2011 Aurélien Gâteau + * License: LGPL v2.1 or later (see COPYING) + */ +#include "ColumnResizer.h" + +#include +#include +#include +#include +#include +#include + +class FormLayoutWidgetItem : public QWidgetItem +{ +public: + FormLayoutWidgetItem(QWidget* widget, QFormLayout* formLayout, QFormLayout::ItemRole itemRole) + : QWidgetItem(widget) + , m_width(-1) + , m_formLayout(formLayout) + , m_itemRole(itemRole) + {} + + QSize sizeHint() const + { + QSize size = QWidgetItem::sizeHint(); + if (m_width != -1) { + size.setWidth(m_width); + } + return size; + } + + QSize minimumSize() const + { + QSize size = QWidgetItem::minimumSize(); + if (m_width != -1) { + size.setWidth(m_width); + } + return size; + } + + QSize maximumSize() const + { + QSize size = QWidgetItem::maximumSize(); + if (m_width != -1) { + size.setWidth(m_width); + } + return size; + } + + void setWidth(int width) + { + if (width != m_width) { + m_width = width; + invalidate(); + } + } + + void setGeometry(const QRect& _rect) + { + QRect rect = _rect; + int width = widget()->sizeHint().width(); + if (m_itemRole == QFormLayout::LabelRole && m_formLayout->labelAlignment() & Qt::AlignRight) { + rect.setLeft(rect.right() - width); + } + QWidgetItem::setGeometry(rect); + } + + QFormLayout* formLayout() const + { + return m_formLayout; + } + +private: + int m_width; + QFormLayout* m_formLayout; + QFormLayout::ItemRole m_itemRole; +}; + +typedef QPair GridColumnInfo; + +class ColumnResizerPrivate +{ +public: + ColumnResizerPrivate(ColumnResizer* q_ptr) + : q(q_ptr) + , m_updateTimer(new QTimer(q)) + { + m_updateTimer->setSingleShot(true); + m_updateTimer->setInterval(0); + QObject::connect(m_updateTimer, SIGNAL(timeout()), q, SLOT(updateWidth())); + } + + void scheduleWidthUpdate() + { + m_updateTimer->start(); + } + + ColumnResizer* q; + QTimer* m_updateTimer; + QList m_widgets; + QList m_wrWidgetItemList; + QList m_gridColumnInfoList; +}; + +ColumnResizer::ColumnResizer(QObject* parent) +: QObject(parent) +, d(new ColumnResizerPrivate(this)) +{} + +ColumnResizer::~ColumnResizer() +{ + delete d; +} + +void ColumnResizer::addWidget(QWidget* widget) +{ + d->m_widgets.append(widget); + widget->installEventFilter(this); + d->scheduleWidthUpdate(); +} + +void ColumnResizer::updateWidth() +{ + int width = 0; + Q_FOREACH(QWidget* widget, d->m_widgets) { + width = qMax(widget->sizeHint().width(), width); + } + Q_FOREACH(FormLayoutWidgetItem* item, d->m_wrWidgetItemList) { + item->setWidth(width); + item->formLayout()->update(); + } + Q_FOREACH(GridColumnInfo info, d->m_gridColumnInfoList) { + info.first->setColumnMinimumWidth(info.second, width); + } +} + +bool ColumnResizer::eventFilter(QObject*, QEvent* event) +{ + if (event->type() == QEvent::Resize) { + d->scheduleWidthUpdate(); + } + return false; +} + +void ColumnResizer::addWidgetsFromLayout(QLayout* layout, int column) +{ + Q_ASSERT(column >= 0); + QGridLayout* gridLayout = qobject_cast(layout); + QFormLayout* formLayout = qobject_cast(layout); + if (gridLayout) { + addWidgetsFromGridLayout(gridLayout, column); + } else if (formLayout) { + if (column > QFormLayout::SpanningRole) { + qCritical() << "column should not be more than" << QFormLayout::SpanningRole << "for QFormLayout"; + return; + } + QFormLayout::ItemRole role = static_cast(column); + addWidgetsFromFormLayout(formLayout, role); + } else { + qCritical() << "Don't know how to handle layout" << layout; + } +} + +void ColumnResizer::addWidgetsFromGridLayout(QGridLayout* layout, int column) +{ + for (int row = 0; row < layout->rowCount(); ++row) { + QLayoutItem* item = layout->itemAtPosition(row, column); + if (!item) { + continue; + } + QWidget* widget = item->widget(); + if (!widget) { + continue; + } + addWidget(widget); + } + d->m_gridColumnInfoList << GridColumnInfo(layout, column); +} + +void ColumnResizer::addWidgetsFromFormLayout(QFormLayout* layout, QFormLayout::ItemRole role) +{ + for (int row = 0; row < layout->rowCount(); ++row) { + QLayoutItem* item = layout->itemAt(row, role); + if (!item) { + continue; + } + QWidget* widget = item->widget(); + if (!widget) { + continue; + } + layout->removeItem(item); + delete item; + FormLayoutWidgetItem* newItem = new FormLayoutWidgetItem(widget, layout, role); + layout->setItem(row, role, newItem); + addWidget(widget); + d->m_wrWidgetItemList << newItem; + } +} + +#include +// vi: ts=4 sw=4 et diff --git a/application/ColumnResizer.h b/application/ColumnResizer.h new file mode 100644 index 00000000..4bbac383 --- /dev/null +++ b/application/ColumnResizer.h @@ -0,0 +1,38 @@ +/* + * Copyright 2011 Aurélien Gâteau + * License: LGPL v2.1 or later (see COPYING) + */ +#pragma once + +#include + +#include +#include + +class QEvent; +class QGridLayout; +class QLayout; +class QWidget; + +class ColumnResizerPrivate; +class ColumnResizer : public QObject +{ + Q_OBJECT +public: + ColumnResizer(QObject* parent = 0); + ~ColumnResizer(); + + void addWidget(QWidget* widget); + void addWidgetsFromLayout(QLayout*, int column); + void addWidgetsFromGridLayout(QGridLayout*, int column); + void addWidgetsFromFormLayout(QFormLayout*, QFormLayout::ItemRole role); + +private Q_SLOTS: + void updateWidth(); + +protected: + bool eventFilter(QObject*, QEvent* event); + +private: + ColumnResizerPrivate* const d; +}; diff --git a/application/ConsoleWindow.cpp b/application/ConsoleWindow.cpp new file mode 100644 index 00000000..52c68299 --- /dev/null +++ b/application/ConsoleWindow.cpp @@ -0,0 +1,260 @@ +/* Copyright 2013-2015 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "ConsoleWindow.h" +#include "MultiMC.h" + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include "widgets/PageContainer.h" +#include "pages/LogPage.h" +#include "InstancePageProvider.h" + +#include "icons/IconList.h" + +class LogPageProvider : public BasePageProvider +{ +public: + LogPageProvider(BasePageProviderPtr parent, BasePage * log_page) + { + m_parent = parent; + m_log_page = log_page; + } + virtual QString dialogTitle() {return "Fake";}; + virtual QList getPages() + { + auto pages = m_parent->getPages(); + pages.prepend(m_log_page); + return pages; + } +private: + BasePageProviderPtr m_parent; + BasePage * m_log_page; +}; + +ConsoleWindow::ConsoleWindow(BaseProcess *process, QWidget *parent) + : QMainWindow(parent), m_proc(process) +{ + MultiMCPlatform::fixWM_CLASS(this); + setAttribute(Qt::WA_DeleteOnClose); + + auto instance = m_proc->instance(); + auto icon = ENV.icons()->getIcon(instance->iconKey()); + QString windowTitle = tr("Console window for ") + instance->name(); + + // Set window properties + { + setWindowIcon(icon); + setWindowTitle(windowTitle); + } + + // Add page container + { + auto mainLayout = new QVBoxLayout; + auto provider = std::make_shared(m_proc->instance()); + auto baseprovider = std::dynamic_pointer_cast(provider); + auto proxy_provider = std::make_shared(baseprovider, new LogPage(m_proc)); + m_container = new PageContainer(proxy_provider, "console", this); + mainLayout->addWidget(m_container); + mainLayout->setSpacing(0); + mainLayout->setContentsMargins(0,0,0,0); + setLayout(mainLayout); + setCentralWidget(m_container); + } + + // Add custom buttons to the page container layout. + { + auto horizontalLayout = new QHBoxLayout(); + horizontalLayout->setObjectName(QStringLiteral("horizontalLayout")); + horizontalLayout->setContentsMargins(6, -1, 6, -1); + + auto btnHelp = new QPushButton(); + btnHelp->setText(tr("Help")); + horizontalLayout->addWidget(btnHelp); + connect(btnHelp, SIGNAL(clicked(bool)), m_container, SLOT(help())); + + auto spacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); + horizontalLayout->addSpacerItem(spacer); + + m_killButton = new QPushButton(); + m_killButton->setText(tr("Kill Minecraft")); + horizontalLayout->addWidget(m_killButton); + connect(m_killButton, SIGNAL(clicked(bool)), SLOT(on_btnKillMinecraft_clicked())); + + m_closeButton = new QPushButton(); + m_closeButton->setText(tr("Close")); + horizontalLayout->addWidget(m_closeButton); + connect(m_closeButton, SIGNAL(clicked(bool)), SLOT(on_closeButton_clicked())); + + m_container->addButtons(horizontalLayout); + } + + // restore window state + { + auto base64State = MMC->settings()->get("ConsoleWindowState").toByteArray(); + restoreState(QByteArray::fromBase64(base64State)); + auto base64Geometry = MMC->settings()->get("ConsoleWindowGeometry").toByteArray(); + restoreGeometry(QByteArray::fromBase64(base64Geometry)); + } + + // Set up tray icon + { + m_trayIcon = new QSystemTrayIcon(icon, this); + m_trayIcon->setToolTip(windowTitle); + + connect(m_trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), + SLOT(iconActivated(QSystemTrayIcon::ActivationReason))); + m_trayIcon->show(); + } + + // Set up signal connections + connect(m_proc, SIGNAL(ended(InstancePtr, int, QProcess::ExitStatus)), this, + SLOT(onEnded(InstancePtr, int, QProcess::ExitStatus))); + connect(m_proc, SIGNAL(prelaunch_failed(InstancePtr, int, QProcess::ExitStatus)), this, + SLOT(onEnded(InstancePtr, int, QProcess::ExitStatus))); + connect(m_proc, SIGNAL(launch_failed(InstancePtr)), this, + SLOT(onLaunchFailed(InstancePtr))); + + setMayClose(false); + + if (m_proc->instance()->settings().get("ShowConsole").toBool()) + { + show(); + } +} + +void ConsoleWindow::iconActivated(QSystemTrayIcon::ActivationReason reason) +{ + switch (reason) + { + case QSystemTrayIcon::Trigger: + { + toggleConsole(); + } + default: + return; + } +} + +void ConsoleWindow::on_closeButton_clicked() +{ + close(); +} + +void ConsoleWindow::setMayClose(bool mayclose) +{ + if(mayclose) + m_closeButton->setText(tr("Close")); + else + m_closeButton->setText(tr("Hide")); + m_mayclose = mayclose; +} + +void ConsoleWindow::toggleConsole() +{ + if (isVisible()) + { + if(!isActiveWindow()) + { + activateWindow(); + return; + } + hide(); + } + else + { + show(); + } +} + +void ConsoleWindow::closeEvent(QCloseEvent *event) +{ + if (!m_mayclose) + { + toggleConsole(); + event->ignore(); + } + else if(m_container->requestClose(event)) + { + MMC->settings()->set("ConsoleWindowState", saveState().toBase64()); + MMC->settings()->set("ConsoleWindowGeometry", saveGeometry().toBase64()); + + emit isClosing(); + m_trayIcon->hide(); + event->accept(); + } +} + +void ConsoleWindow::on_btnKillMinecraft_clicked() +{ + m_killButton->setEnabled(false); + auto response = CustomMessageBox::selectable( + this, tr("Kill Minecraft?"), + tr("This can cause the instance to get corrupted and should only be used if Minecraft " + "is frozen for some reason"), + QMessageBox::Question, QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes)->exec(); + if (response == QMessageBox::Yes) + m_proc->killProcess(); + else + m_killButton->setEnabled(true); +} + +void ConsoleWindow::onEnded(InstancePtr instance, int code, QProcess::ExitStatus status) +{ + bool peacefulExit = code == 0 && status != QProcess::CrashExit; + m_killButton->setEnabled(false); + setMayClose(true); + if (instance->settings().get("AutoCloseConsole").toBool()) + { + if (peacefulExit) + { + this->close(); + return; + } + } + if (!isVisible()) + { + show(); + } + // Raise Window + if (MMC->settings()->get("RaiseConsole").toBool()) + { + raise(); + activateWindow(); + } +} + +void ConsoleWindow::onLaunchFailed(InstancePtr instance) +{ + m_killButton->setEnabled(false); + + setMayClose(true); + + if (!isVisible()) + show(); +} +ConsoleWindow::~ConsoleWindow() +{ + +} diff --git a/application/ConsoleWindow.h b/application/ConsoleWindow.h new file mode 100644 index 00000000..6e3849c5 --- /dev/null +++ b/application/ConsoleWindow.h @@ -0,0 +1,65 @@ +/* Copyright 2013-2015 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include +#include "BaseProcess.h" + +class QPushButton; +class PageContainer; +class ConsoleWindow : public QMainWindow +{ + Q_OBJECT + +public: + explicit ConsoleWindow(BaseProcess *proc, QWidget *parent = 0); + virtual ~ConsoleWindow(); + + /** + * @brief specify if the window is allowed to close + * @param mayclose + * used to keep it alive while MC runs + */ + void setMayClose(bool mayclose); + +signals: + void isClosing(); + +private +slots: + void on_closeButton_clicked(); + void on_btnKillMinecraft_clicked(); + + void onEnded(InstancePtr instance, int code, QProcess::ExitStatus status); + void onLaunchFailed(InstancePtr instance); + + // FIXME: add handlers for the other MinecraftProcess signals (pre/post launch command + // failures) + + void iconActivated(QSystemTrayIcon::ActivationReason); + void toggleConsole(); +protected: + void closeEvent(QCloseEvent *); + +private: + BaseProcess *m_proc = nullptr; + bool m_mayclose = true; + QSystemTrayIcon *m_trayIcon = nullptr; + PageContainer *m_container = nullptr; + QPushButton *m_closeButton = nullptr; + QPushButton *m_killButton = nullptr; +}; diff --git a/application/GuiUtil.cpp b/application/GuiUtil.cpp new file mode 100644 index 00000000..fb42b9bc --- /dev/null +++ b/application/GuiUtil.cpp @@ -0,0 +1,48 @@ +#include "GuiUtil.h" + +#include +#include +#include + +#include "dialogs/ProgressDialog.h" +#include "net/PasteUpload.h" +#include "dialogs/CustomMessageBox.h" + +void GuiUtil::uploadPaste(const QString &text, QWidget *parentWidget) +{ + ProgressDialog dialog(parentWidget); + std::unique_ptr paste(new PasteUpload(parentWidget, text)); + + if (!paste->validateText()) + { + CustomMessageBox::selectable( + parentWidget, QObject::tr("Upload failed"), + QObject::tr("The log file is too big. You'll have to upload it manually."), + QMessageBox::Warning)->exec(); + return; + } + + dialog.exec(paste.get()); + if (!paste->successful()) + { + CustomMessageBox::selectable(parentWidget, QObject::tr("Upload failed"), + paste->failReason(), QMessageBox::Critical)->exec(); + } + else + { + const QString link = paste->pasteLink(); + setClipboardText(link); + QDesktopServices::openUrl(link); + CustomMessageBox::selectable( + parentWidget, QObject::tr("Upload finished"), + QObject::tr("The link to the uploaded log has been opened in " + "the default " + "browser and placed in your clipboard.").arg(link), + QMessageBox::Information)->exec(); + } +} + +void GuiUtil::setClipboardText(const QString &text) +{ + QApplication::clipboard()->setText(text); +} diff --git a/application/GuiUtil.h b/application/GuiUtil.h new file mode 100644 index 00000000..9f872f75 --- /dev/null +++ b/application/GuiUtil.h @@ -0,0 +1,9 @@ +#pragma once + +#include + +namespace GuiUtil +{ +void uploadPaste(const QString &text, QWidget *parentWidget); +void setClipboardText(const QString &text); +} diff --git a/application/InstancePageProvider.cpp b/application/InstancePageProvider.cpp new file mode 100644 index 00000000..e69de29b diff --git a/application/InstancePageProvider.h b/application/InstancePageProvider.h new file mode 100644 index 00000000..a19e21c8 --- /dev/null +++ b/application/InstancePageProvider.h @@ -0,0 +1,52 @@ +#pragma once +#include "minecraft/OneSixInstance.h" +#include "pages/BasePage.h" +#include "pages/VersionPage.h" +#include "pages/ModFolderPage.h" +#include "pages/ResourcePackPage.h" +#include "pages/TexturePackPage.h" +#include "pages/NotesPage.h" +#include "pages/ScreenshotsPage.h" +#include "pages/InstanceSettingsPage.h" +#include "pages/OtherLogsPage.h" +#include "pages/BasePageProvider.h" +#include + +class InstancePageProvider : public QObject, public BasePageProvider +{ + Q_OBJECT +public: + explicit InstancePageProvider(InstancePtr parent) + { + inst = parent; + } + + virtual ~InstancePageProvider() {}; + virtual QList getPages() override + { + QList values; + std::shared_ptr onesix = std::dynamic_pointer_cast(inst); + if(onesix) + { + values.append(new VersionPage(onesix.get())); + values.append(new ModFolderPage(onesix.get(), onesix->loaderModList(), "mods", "loadermods", + tr("Loader mods"), "Loader-mods")); + values.append(new CoreModFolderPage(onesix.get(), onesix->coreModList(), "coremods", "coremods", + tr("Core mods"), "Core-mods")); + values.append(new ResourcePackPage(onesix.get())); + values.append(new TexturePackPage(onesix.get())); + values.append(new NotesPage(onesix.get())); + values.append(new ScreenshotsPage(PathCombine(onesix->minecraftRoot(), "screenshots"))); + values.append(new InstanceSettingsPage(onesix.get())); + values.append(new OtherLogsPage(onesix->minecraftRoot())); + } + return values; + } + + virtual QString dialogTitle() override + { + return tr("Edit Instance (%1)").arg(inst->name()); + } +protected: + InstancePtr inst; +}; diff --git a/application/InstanceProxyModel.cpp b/application/InstanceProxyModel.cpp new file mode 100644 index 00000000..2048252c --- /dev/null +++ b/application/InstanceProxyModel.cpp @@ -0,0 +1,23 @@ +#include "InstanceProxyModel.h" +#include "MultiMC.h" +#include + +InstanceProxyModel::InstanceProxyModel(QObject *parent) : GroupedProxyModel(parent) +{ +} + +bool InstanceProxyModel::subSortLessThan(const QModelIndex &left, + const QModelIndex &right) const +{ + BaseInstance *pdataLeft = static_cast(left.internalPointer()); + BaseInstance *pdataRight = static_cast(right.internalPointer()); + QString sortMode = MMC->settings()->get("InstSortMode").toString(); + if (sortMode == "LastLaunch") + { + return pdataLeft->lastLaunch() > pdataRight->lastLaunch(); + } + else + { + return QString::localeAwareCompare(pdataLeft->name(), pdataRight->name()) < 0; + } +} diff --git a/application/InstanceProxyModel.h b/application/InstanceProxyModel.h new file mode 100644 index 00000000..e558efc4 --- /dev/null +++ b/application/InstanceProxyModel.h @@ -0,0 +1,13 @@ +#include "groupview/GroupedProxyModel.h" + +/** + * A proxy model that is responsible for sorting instances into groups + */ +class InstanceProxyModel : public GroupedProxyModel +{ +public: + explicit InstanceProxyModel(QObject *parent = 0); + +protected: + virtual bool subSortLessThan(const QModelIndex &left, const QModelIndex &right) const; +}; diff --git a/application/MainWindow.cpp b/application/MainWindow.cpp new file mode 100644 index 00000000..8e235e19 --- /dev/null +++ b/application/MainWindow.cpp @@ -0,0 +1,2069 @@ +/* Copyright 2013-2015 MultiMC Contributors + * + * Authors: Andrew Okin + * Peterix + * Orochimarufan + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include "MultiMC.h" +#include "BuildConfig.h" + +#include "MainWindow.h" + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +class Ui_MainWindow +{ +public: + QAction *actionAddInstance; + QAction *actionViewInstanceFolder; + QAction *actionRefresh; + QAction *actionViewCentralModsFolder; + QAction *actionCheckUpdate; + QAction *actionSettings; + QAction *actionReportBug; + QAction *actionPatreon; + QAction *actionMoreNews; + QAction *actionAbout; + QAction *actionLaunchInstance; + QAction *actionRenameInstance; + QAction *actionChangeInstGroup; + QAction *actionChangeInstIcon; + QAction *actionEditInstNotes; + QAction *actionEditInstance; + QAction *actionViewSelectedInstFolder; + QAction *actionDeleteInstance; + QAction *actionConfig_Folder; + QAction *actionCAT; + QAction *actionCopyInstance; + QAction *actionManageAccounts; + QAction *actionLaunchInstanceOffline; + QAction *actionScreenshots; + QAction *actionInstanceSettings; + QAction *actionExportInstance; + QWidget *centralWidget; + QHBoxLayout *horizontalLayout; + QToolBar *mainToolBar; + QStatusBar *statusBar; + QToolBar *instanceToolBar; + QToolBar *newsToolBar; + + void setupUi(QMainWindow *MainWindow) + { + if (MainWindow->objectName().isEmpty()) + { + MainWindow->setObjectName(QStringLiteral("MainWindow")); + } + MainWindow->resize(694, 563); + MainWindow->setWindowIcon(MMC->getThemedIcon("multimc")); + actionAddInstance = new QAction(MainWindow); + actionAddInstance->setObjectName(QStringLiteral("actionAddInstance")); + actionAddInstance->setIcon(MMC->getThemedIcon("new")); + actionViewInstanceFolder = new QAction(MainWindow); + actionViewInstanceFolder->setObjectName(QStringLiteral("actionViewInstanceFolder")); + actionViewInstanceFolder->setIcon(MMC->getThemedIcon("viewfolder")); + actionRefresh = new QAction(MainWindow); + actionRefresh->setObjectName(QStringLiteral("actionRefresh")); + actionRefresh->setIcon(MMC->getThemedIcon("refresh")); + actionViewCentralModsFolder = new QAction(MainWindow); + actionViewCentralModsFolder->setObjectName(QStringLiteral("actionViewCentralModsFolder")); + actionViewCentralModsFolder->setIcon(MMC->getThemedIcon("centralmods")); + actionCheckUpdate = new QAction(MainWindow); + actionCheckUpdate->setObjectName(QStringLiteral("actionCheckUpdate")); + actionCheckUpdate->setIcon(MMC->getThemedIcon("checkupdate")); + actionSettings = new QAction(MainWindow); + actionSettings->setObjectName(QStringLiteral("actionSettings")); + actionSettings->setIcon(MMC->getThemedIcon("settings")); + actionSettings->setMenuRole(QAction::PreferencesRole); + actionReportBug = new QAction(MainWindow); + actionReportBug->setObjectName(QStringLiteral("actionReportBug")); + actionReportBug->setIcon(MMC->getThemedIcon("bug")); + actionPatreon = new QAction(MainWindow); + actionPatreon->setObjectName(QStringLiteral("actionPatreon")); + actionPatreon->setIcon(MMC->getThemedIcon("patreon")); + actionMoreNews = new QAction(MainWindow); + actionMoreNews->setObjectName(QStringLiteral("actionMoreNews")); + actionMoreNews->setIcon(MMC->getThemedIcon("news")); + actionAbout = new QAction(MainWindow); + actionAbout->setObjectName(QStringLiteral("actionAbout")); + actionAbout->setIcon(MMC->getThemedIcon("about")); + actionAbout->setMenuRole(QAction::AboutRole); + actionLaunchInstance = new QAction(MainWindow); + actionLaunchInstance->setObjectName(QStringLiteral("actionLaunchInstance")); + actionRenameInstance = new QAction(MainWindow); + actionRenameInstance->setObjectName(QStringLiteral("actionRenameInstance")); + actionChangeInstGroup = new QAction(MainWindow); + actionChangeInstGroup->setObjectName(QStringLiteral("actionChangeInstGroup")); + actionChangeInstIcon = new QAction(MainWindow); + actionChangeInstIcon->setObjectName(QStringLiteral("actionChangeInstIcon")); + actionChangeInstIcon->setEnabled(true); + actionChangeInstIcon->setIcon(QIcon(":/icons/instances/infinity")); + actionChangeInstIcon->setIconVisibleInMenu(true); + actionEditInstNotes = new QAction(MainWindow); + actionEditInstNotes->setObjectName(QStringLiteral("actionEditInstNotes")); + actionEditInstance = new QAction(MainWindow); + actionEditInstance->setObjectName(QStringLiteral("actionEditInstance")); + actionViewSelectedInstFolder = new QAction(MainWindow); + actionViewSelectedInstFolder->setObjectName(QStringLiteral("actionViewSelectedInstFolder")); + actionDeleteInstance = new QAction(MainWindow); + actionDeleteInstance->setObjectName(QStringLiteral("actionDeleteInstance")); + actionConfig_Folder = new QAction(MainWindow); + actionConfig_Folder->setObjectName(QStringLiteral("actionConfig_Folder")); + actionCAT = new QAction(MainWindow); + actionCAT->setObjectName(QStringLiteral("actionCAT")); + actionCAT->setCheckable(true); + actionCAT->setIcon(MMC->getThemedIcon("cat")); + actionCopyInstance = new QAction(MainWindow); + actionCopyInstance->setObjectName(QStringLiteral("actionCopyInstance")); + actionCopyInstance->setIcon(MMC->getThemedIcon("copy")); + actionManageAccounts = new QAction(MainWindow); + actionManageAccounts->setObjectName(QStringLiteral("actionManageAccounts")); + actionLaunchInstanceOffline = new QAction(MainWindow); + actionLaunchInstanceOffline->setObjectName(QStringLiteral("actionLaunchInstanceOffline")); + actionScreenshots = new QAction(MainWindow); + actionScreenshots->setObjectName(QStringLiteral("actionScreenshots")); + actionInstanceSettings = new QAction(MainWindow); + actionInstanceSettings->setObjectName(QStringLiteral("actionInstanceSettings")); + actionExportInstance = new QAction(MainWindow); + actionExportInstance->setObjectName(QStringLiteral("actionExportInstance")); + centralWidget = new QWidget(MainWindow); + centralWidget->setObjectName(QStringLiteral("centralWidget")); + horizontalLayout = new QHBoxLayout(centralWidget); + horizontalLayout->setSpacing(0); + horizontalLayout->setContentsMargins(11, 11, 11, 11); + horizontalLayout->setObjectName(QStringLiteral("horizontalLayout")); + horizontalLayout->setSizeConstraint(QLayout::SetDefaultConstraint); + horizontalLayout->setContentsMargins(0, 0, 0, 0); + MainWindow->setCentralWidget(centralWidget); + mainToolBar = new QToolBar(MainWindow); + mainToolBar->setObjectName(QStringLiteral("mainToolBar")); + mainToolBar->setMovable(false); + mainToolBar->setAllowedAreas(Qt::TopToolBarArea); + mainToolBar->setToolButtonStyle(Qt::ToolButtonIconOnly); + mainToolBar->setFloatable(false); + MainWindow->addToolBar(Qt::TopToolBarArea, mainToolBar); + statusBar = new QStatusBar(MainWindow); + statusBar->setObjectName(QStringLiteral("statusBar")); + MainWindow->setStatusBar(statusBar); + instanceToolBar = new QToolBar(MainWindow); + instanceToolBar->setObjectName(QStringLiteral("instanceToolBar")); + instanceToolBar->setEnabled(true); + instanceToolBar->setAllowedAreas(Qt::LeftToolBarArea|Qt::RightToolBarArea); + instanceToolBar->setIconSize(QSize(80, 80)); + instanceToolBar->setToolButtonStyle(Qt::ToolButtonIconOnly); + instanceToolBar->setFloatable(false); + MainWindow->addToolBar(Qt::RightToolBarArea, instanceToolBar); + newsToolBar = new QToolBar(MainWindow); + newsToolBar->setObjectName(QStringLiteral("newsToolBar")); + newsToolBar->setMovable(false); + newsToolBar->setAllowedAreas(Qt::BottomToolBarArea); + newsToolBar->setIconSize(QSize(16, 16)); + newsToolBar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); + newsToolBar->setFloatable(false); + MainWindow->addToolBar(Qt::BottomToolBarArea, newsToolBar); + + mainToolBar->addAction(actionAddInstance); + mainToolBar->addAction(actionCopyInstance); + mainToolBar->addSeparator(); + mainToolBar->addAction(actionViewInstanceFolder); + mainToolBar->addAction(actionViewCentralModsFolder); + mainToolBar->addAction(actionRefresh); + mainToolBar->addSeparator(); + mainToolBar->addAction(actionCheckUpdate); + mainToolBar->addAction(actionSettings); + mainToolBar->addSeparator(); + mainToolBar->addAction(actionReportBug); + mainToolBar->addAction(actionAbout); + mainToolBar->addSeparator(); + mainToolBar->addAction(actionPatreon); + mainToolBar->addAction(actionCAT); + instanceToolBar->addAction(actionChangeInstIcon); + instanceToolBar->addAction(actionLaunchInstance); + instanceToolBar->addAction(actionLaunchInstanceOffline); + instanceToolBar->addAction(actionChangeInstGroup); + instanceToolBar->addSeparator(); + instanceToolBar->addAction(actionEditInstance); + instanceToolBar->addAction(actionInstanceSettings); + instanceToolBar->addAction(actionEditInstNotes); + instanceToolBar->addAction(actionScreenshots); + instanceToolBar->addSeparator(); + instanceToolBar->addAction(actionViewSelectedInstFolder); + instanceToolBar->addAction(actionConfig_Folder); + instanceToolBar->addSeparator(); + instanceToolBar->addAction(actionExportInstance); + instanceToolBar->addAction(actionDeleteInstance); + newsToolBar->addAction(actionMoreNews); + + retranslateUi(MainWindow); + + QMetaObject::connectSlotsByName(MainWindow); + } // setupUi + + void retranslateUi(QMainWindow *MainWindow) + { + MainWindow->setWindowTitle(QApplication::translate("MainWindow", "MultiMC 5", 0)); + actionAddInstance->setText(QApplication::translate("MainWindow", "Add Instance", 0)); + actionAddInstance->setToolTip(QApplication::translate("MainWindow", "Add a new instance.", 0)); + actionAddInstance->setStatusTip(QApplication::translate("MainWindow", "Add a new instance.", 0)); + actionViewInstanceFolder->setText(QApplication::translate("MainWindow", "View Instance Folder", 0)); + actionViewInstanceFolder->setToolTip(QApplication::translate("MainWindow", "Open the instance folder in a file browser.", 0)); + actionViewInstanceFolder->setStatusTip(QApplication::translate("MainWindow", "Open the instance folder in a file browser.", 0)); + actionRefresh->setText(QApplication::translate("MainWindow", "Refresh", 0)); + actionRefresh->setToolTip(QApplication::translate("MainWindow", "Reload the instance list.", 0)); + actionRefresh->setStatusTip(QApplication::translate("MainWindow", "Reload the instance list.", 0)); + actionViewCentralModsFolder->setText(QApplication::translate("MainWindow", "View Central Mods Folder", 0)); + actionViewCentralModsFolder->setToolTip(QApplication::translate("MainWindow", "Open the central mods folder in a file browser.", 0)); + actionViewCentralModsFolder->setStatusTip(QApplication::translate("MainWindow", "Open the central mods folder in a file browser.", 0)); + actionCheckUpdate->setText(QApplication::translate("MainWindow", "Check for Updates", 0)); + actionCheckUpdate->setToolTip(QApplication::translate("MainWindow", "Check for new updates for MultiMC", 0)); + actionCheckUpdate->setStatusTip(QApplication::translate("MainWindow", "Check for new updates for MultiMC", 0)); + actionSettings->setText(QApplication::translate("MainWindow", "Settings", 0)); + actionSettings->setToolTip(QApplication::translate("MainWindow", "Change settings.", 0)); + actionSettings->setStatusTip(QApplication::translate("MainWindow", "Change settings.", 0)); + actionReportBug->setText(QApplication::translate("MainWindow", "Report a Bug", 0)); + actionReportBug->setToolTip(QApplication::translate("MainWindow", "Open the bug tracker to report a bug with MultiMC.", 0)); + actionReportBug->setStatusTip(QApplication::translate("MainWindow", "Open the bug tracker to report a bug with MultiMC.", 0)); + actionPatreon->setText(QApplication::translate("MainWindow", "Support us on Patreon!", 0)); + actionPatreon->setToolTip(QApplication::translate("MainWindow", "Open the MultiMC Patreon page.", 0)); + actionPatreon->setStatusTip(QApplication::translate("MainWindow", "Open the MultiMC Patreon page.", 0)); + actionMoreNews->setText(QApplication::translate("MainWindow", "More News", 0)); + actionMoreNews->setIconText(QApplication::translate("MainWindow", "More news...", 0)); + actionMoreNews->setToolTip(QApplication::translate("MainWindow", "Open the MultiMC development blog to read more news about MultiMC.", 0)); + actionMoreNews->setStatusTip(QApplication::translate("MainWindow", "Open the MultiMC development blog to read more news about MultiMC.", 0)); + actionAbout->setText(QApplication::translate("MainWindow", "About MultiMC", 0)); + actionAbout->setToolTip(QApplication::translate("MainWindow", "View information about MultiMC.", 0)); + actionAbout->setStatusTip(QApplication::translate("MainWindow", "About MultiMC", 0)); + actionLaunchInstance->setText(QApplication::translate("MainWindow", "Play", 0)); + actionLaunchInstance->setToolTip(QApplication::translate("MainWindow", "Launch the selected instance.", 0)); + actionLaunchInstance->setStatusTip(QApplication::translate("MainWindow", "Launch the selected instance.", 0)); + actionRenameInstance->setText(QApplication::translate("MainWindow", "Instance Name", 0)); + actionRenameInstance->setToolTip(QApplication::translate("MainWindow", "Rename the selected instance.", 0)); + actionRenameInstance->setStatusTip(QApplication::translate("MainWindow", "Rename the selected instance.", 0)); + actionChangeInstGroup->setText(QApplication::translate("MainWindow", "Change Group", 0)); + actionChangeInstGroup->setToolTip(QApplication::translate("MainWindow", "Change the selected instance's group.", 0)); + actionChangeInstGroup->setStatusTip(QApplication::translate("MainWindow", "Change the selected instance's group.", 0)); + actionChangeInstIcon->setText(QApplication::translate("MainWindow", "Change Icon", 0)); + actionChangeInstIcon->setToolTip(QApplication::translate("MainWindow", "Change the selected instance's icon.", 0)); + actionChangeInstIcon->setStatusTip(QApplication::translate("MainWindow", "Change the selected instance's icon.", 0)); + actionEditInstNotes->setText(QApplication::translate("MainWindow", "Edit Notes", 0)); + actionEditInstNotes->setToolTip(QApplication::translate("MainWindow", "Edit the notes for the selected instance.", 0)); + actionEditInstNotes->setStatusTip(QApplication::translate("MainWindow", "Edit the notes for the selected instance.", 0)); + actionEditInstance->setText(QApplication::translate("MainWindow", "Edit Instance", 0)); + actionEditInstance->setIconText(QApplication::translate("MainWindow", "Edit Instance", 0)); + actionEditInstance->setToolTip(QApplication::translate("MainWindow", "Change the instance settings, mods and versions.", 0)); + actionEditInstance->setStatusTip(QApplication::translate("MainWindow", "Change the instance settings, mods and versions.", 0)); + actionViewSelectedInstFolder->setText(QApplication::translate("MainWindow", "Instance Folder", 0)); + actionViewSelectedInstFolder->setToolTip(QApplication::translate("MainWindow", "Open the selected instance's root folder in a file browser.", 0)); + actionViewSelectedInstFolder->setStatusTip(QApplication::translate("MainWindow", "Open the selected instance's root folder in a file browser.", 0)); + actionDeleteInstance->setText(QApplication::translate("MainWindow", "Delete", 0)); + actionDeleteInstance->setToolTip(QApplication::translate("MainWindow", "Delete the selected instance.", 0)); + actionDeleteInstance->setStatusTip(QApplication::translate("MainWindow", "Delete the selected instance.", 0)); + actionConfig_Folder->setText(QApplication::translate("MainWindow", "Config Folder", 0)); + actionConfig_Folder->setToolTip(QApplication::translate("MainWindow", "Open the instance's config folder", 0)); + actionCAT->setText(QApplication::translate("MainWindow", "Meow", 0)); + actionCAT->setToolTip(QApplication::translate("MainWindow", "

It's a fluffy kitty :3

", 0)); + actionCopyInstance->setText(QApplication::translate("MainWindow", "Copy Instance", 0)); + actionCopyInstance->setToolTip(QApplication::translate("MainWindow", "Copy the selected instance.", 0)); + actionCopyInstance->setStatusTip(QApplication::translate("MainWindow", "Add a new instance.", 0)); + actionManageAccounts->setText(QApplication::translate("MainWindow", "Manage Accounts", 0)); + actionManageAccounts->setToolTip(QApplication::translate("MainWindow", "Manage your Mojang or Minecraft accounts.", 0)); + actionLaunchInstanceOffline->setText(QApplication::translate("MainWindow", "Play Offline", 0)); + actionLaunchInstanceOffline->setToolTip(QApplication::translate("MainWindow", "Launch the selected instance in offline mode.", 0)); + actionLaunchInstanceOffline->setStatusTip(QApplication::translate("MainWindow", "Launch the selected instance.", 0)); + actionScreenshots->setText(QApplication::translate("MainWindow", "Manage Screenshots", 0)); + actionScreenshots->setToolTip(QApplication::translate("MainWindow", "

View and upload screenshots for this instance

", 0)); + actionInstanceSettings->setText(QApplication::translate("MainWindow", "Instance Settings", 0)); + actionInstanceSettings->setToolTip(QApplication::translate("MainWindow", "Change the settings specific to the instance", 0)); + actionExportInstance->setText(QApplication::translate("MainWindow", "Export Instance", 0)); + mainToolBar->setWindowTitle(QApplication::translate("MainWindow", "Main Toolbar", 0)); + instanceToolBar->setWindowTitle(QApplication::translate("MainWindow", "Instance Toolbar", 0)); + newsToolBar->setWindowTitle(QApplication::translate("MainWindow", "News Toolbar", 0)); + } // retranslateUi + +}; + +namespace Ui { + class MainWindow: public Ui_MainWindow {}; +} // namespace Ui + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "osutils.h" +#include "userutils.h" +#include "pathutils.h" + +#include "groupview/GroupView.h" +#include "groupview/InstanceDelegate.h" +#include "InstanceProxyModel.h" + +#include "Platform.h" + +#include "widgets/LabeledToolButton.h" +#include "widgets/ServerStatus.h" + +#include "dialogs/NewInstanceDialog.h" +#include "dialogs/ProgressDialog.h" +#include "dialogs/AboutDialog.h" +#include "dialogs/VersionSelectDialog.h" +#include "dialogs/CustomMessageBox.h" +#include "dialogs/IconPickerDialog.h" +#include "dialogs/CopyInstanceDialog.h" +#include "dialogs/AccountSelectDialog.h" +#include "dialogs/UpdateDialog.h" +#include "dialogs/EditAccountDialog.h" +#include "dialogs/NotificationDialog.h" + +#include "pages/global/MultiMCPage.h" +#include "pages/global/ExternalToolsPage.h" +#include "pages/global/AccountListPage.h" +#include "pages/global/ProxyPage.h" +#include "pages/global/JavaPage.h" +#include "pages/global/MinecraftPage.h" + +#include "ConsoleWindow.h" +#include "pagedialog/PageDialog.h" + +#include "InstanceList.h" +#include "minecraft/MinecraftVersionList.h" +#include "minecraft/LwjglVersionList.h" +#include "icons/IconList.h" +#include "java/JavaVersionList.h" + +#include "auth/flows/AuthenticateTask.h" +#include "auth/flows/RefreshTask.h" + +#include "updater/DownloadTask.h" + +#include "news/NewsChecker.h" + +#include "net/URLConstants.h" +#include "net/NetJob.h" +#include "Env.h" + +#include "BaseInstance.h" +#include "BaseProcess.h" +#include "java/JavaUtils.h" +#include "NagUtils.h" +#include "InstancePageProvider.h" +#include "minecraft/SkinUtils.h" + +//#include "minecraft/LegacyInstance.h" + +#include +#include +#include +#include + +#include "tools/BaseProfiler.h" + +MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) +{ + MultiMCPlatform::fixWM_CLASS(this); + ui->setupUi(this); + + // initialize the news checker + m_newsChecker.reset(new NewsChecker(BuildConfig.NEWS_RSS_URL)); + + QString winTitle = + QString("MultiMC 5 - Version %1").arg(BuildConfig.printableVersionString()); + if (!BuildConfig.BUILD_PLATFORM.isEmpty()) + winTitle += " on " + BuildConfig.BUILD_PLATFORM; + setWindowTitle(winTitle); + + // OSX magic. + setUnifiedTitleAndToolBarOnMac(true); + + // Global shortcuts + { + // FIXME: This is kinda weird. and bad. We need some kind of managed shutdown. + auto q = new QShortcut(QKeySequence::Quit, this); + connect(q, SIGNAL(activated()), qApp, SLOT(quit())); + } + + // The instance action toolbar customizations + { + // disabled until we have an instance selected + ui->instanceToolBar->setEnabled(false); + + // the rename label is inside the rename tool button + renameButton = new LabeledToolButton(); + renameButton->setText("Instance Name"); + renameButton->setToolTip(ui->actionRenameInstance->toolTip()); + connect(renameButton, SIGNAL(clicked(bool)), SLOT(on_actionRenameInstance_triggered())); + ui->instanceToolBar->insertWidget(ui->actionLaunchInstance, renameButton); + ui->instanceToolBar->insertSeparator(ui->actionLaunchInstance); + renameButton->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); + } + + // Add the news label to the news toolbar. + { + newsLabel = new QToolButton(); + newsLabel->setIcon(MMC->getThemedIcon("news")); + newsLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); + newsLabel->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); + ui->newsToolBar->insertWidget(ui->actionMoreNews, newsLabel); + QObject::connect(newsLabel, &QAbstractButton::clicked, this, + &MainWindow::newsButtonClicked); + QObject::connect(m_newsChecker.get(), &NewsChecker::newsLoaded, this, + &MainWindow::updateNewsLabel); + updateNewsLabel(); + } + + // Create the instance list widget + { + view = new GroupView(ui->centralWidget); + + view->setSelectionMode(QAbstractItemView::SingleSelection); + // view->setCategoryDrawer(drawer); + // view->setCollapsibleBlocks(true); + // view->setViewMode(QListView::IconMode); + // view->setFlow(QListView::LeftToRight); + // view->setWordWrap(true); + // view->setMouseTracking(true); + // view->viewport()->setAttribute(Qt::WA_Hover); + auto delegate = new ListViewDelegate(); + view->setItemDelegate(delegate); + // view->setSpacing(10); + // view->setUniformItemWidths(true); + + // do not show ugly blue border on the mac + view->setAttribute(Qt::WA_MacShowFocusRect, false); + + view->installEventFilter(this); + + proxymodel = new InstanceProxyModel(this); + // proxymodel->setSortRole(KCategorizedSortFilterProxyModel::CategorySortRole); + // proxymodel->setFilterRole(KCategorizedSortFilterProxyModel::CategorySortRole); + // proxymodel->setDynamicSortFilter ( true ); + + // FIXME: instList should be global-ish, or at least not tied to the main window... + // maybe the application itself? + proxymodel->setSourceModel(MMC->instances().get()); + proxymodel->sort(0); + view->setFrameShape(QFrame::NoFrame); + view->setModel(proxymodel); + + view->setContextMenuPolicy(Qt::CustomContextMenu); + connect(view, SIGNAL(customContextMenuRequested(const QPoint &)), this, + SLOT(showInstanceContextMenu(const QPoint &))); + + ui->horizontalLayout->addWidget(view); + } + // The cat background + { + bool cat_enable = MMC->settings()->get("TheCat").toBool(); + ui->actionCAT->setChecked(cat_enable); + connect(ui->actionCAT, SIGNAL(toggled(bool)), SLOT(onCatToggled(bool))); + setCatBackground(cat_enable); + } + // start instance when double-clicked + connect(view, SIGNAL(doubleClicked(const QModelIndex &)), this, + SLOT(instanceActivated(const QModelIndex &))); + // track the selection -- update the instance toolbar + connect(view->selectionModel(), + SIGNAL(currentChanged(const QModelIndex &, const QModelIndex &)), this, + SLOT(instanceChanged(const QModelIndex &, const QModelIndex &))); + + // track icon changes and update the toolbar! + connect(ENV.icons().get(), SIGNAL(iconUpdated(QString)), SLOT(iconUpdated(QString))); + + // model reset -> selection is invalid. All the instance pointers are wrong. + // FIXME: stop using POINTERS everywhere + connect(MMC->instances().get(), SIGNAL(dataIsInvalid()), SLOT(selectionBad())); + + m_statusLeft = new QLabel(tr("No instance selected"), this); + m_statusRight = new ServerStatus(this); + statusBar()->addPermanentWidget(m_statusLeft, 1); + statusBar()->addPermanentWidget(m_statusRight, 0); + + // Add "manage accounts" button, right align + QWidget *spacer = new QWidget(); + spacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); + ui->mainToolBar->addWidget(spacer); + + accountMenu = new QMenu(this); + manageAccountsAction = new QAction(tr("Manage Accounts"), this); + manageAccountsAction->setCheckable(false); + connect(manageAccountsAction, SIGNAL(triggered(bool)), this, + SLOT(on_actionManageAccounts_triggered())); + + repopulateAccountsMenu(); + + accountMenuButton = new QToolButton(this); + accountMenuButton->setText(tr("Accounts")); + accountMenuButton->setMenu(accountMenu); + accountMenuButton->setPopupMode(QToolButton::InstantPopup); + accountMenuButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); + accountMenuButton->setIcon(MMC->getThemedIcon("noaccount")); + + QWidgetAction *accountMenuButtonAction = new QWidgetAction(this); + accountMenuButtonAction->setDefaultWidget(accountMenuButton); + + ui->mainToolBar->addAction(accountMenuButtonAction); + + // set up global pages dialog + { + m_globalSettingsProvider = std::make_shared(tr("Settings")); + m_globalSettingsProvider->addPage(); + m_globalSettingsProvider->addPage(); + m_globalSettingsProvider->addPage(); + m_globalSettingsProvider->addPage(); + m_globalSettingsProvider->addPage(); + m_globalSettingsProvider->addPage(); + } + + // Update the menu when the active account changes. + // Shouldn't have to use lambdas here like this, but if I don't, the compiler throws a fit. + // Template hell sucks... + connect(MMC->accounts().get(), &MojangAccountList::activeAccountChanged, [this] + { activeAccountChanged(); }); + connect(MMC->accounts().get(), &MojangAccountList::listChanged, [this] + { repopulateAccountsMenu(); }); + + // Show initial account + activeAccountChanged(); + + auto accounts = MMC->accounts(); + + QList skin_dls; + for (int i = 0; i < accounts->count(); i++) + { + auto account = accounts->at(i); + if (account != nullptr) + { + for (auto profile : account->profiles()) + { + auto meta = Env::getInstance().metacache()->resolveEntry("skins", profile.name + ".png"); + auto action = CacheDownload::make( + QUrl("http://" + URLConstants::SKINS_BASE + profile.name + ".png"), meta); + skin_dls.append(action); + meta->stale = true; + } + } + } + if (!skin_dls.isEmpty()) + { + auto job = new NetJob("Startup player skins download"); + connect(job, SIGNAL(succeeded()), SLOT(skinJobFinished())); + connect(job, SIGNAL(failed()), SLOT(skinJobFinished())); + for (auto action : skin_dls) + { + job->addNetAction(action); + } + skin_download_job.reset(job); + job->start(); + } + + // run the things that load and download other things... FIXME: this is NOT the place + // FIXME: invisible actions in the background = NOPE. + { + if (!MMC->minecraftlist()->isLoaded()) + { + m_versionLoadTask = MMC->minecraftlist()->getLoadTask(); + startTask(m_versionLoadTask); + } + if (!MMC->lwjgllist()->isLoaded()) + { + MMC->lwjgllist()->loadList(); + } + + m_newsChecker->reloadNews(); + updateNewsLabel(); + + // set up the updater object. + auto updater = MMC->updateChecker(); + connect(updater.get(), &UpdateChecker::updateAvailable, this, + &MainWindow::updateAvailable); + connect(updater.get(), &UpdateChecker::noUpdateFound, this, + &MainWindow::updateNotAvailable); + // if automatic update checks are allowed, start one. + if (MMC->settings()->get("AutoUpdate").toBool()) + { + auto updater = MMC->updateChecker(); + updater->checkForUpdate(MMC->settings()->get("UpdateChannel").toString(), false); + } + auto checker = new NotificationChecker(); + checker->setNotificationsUrl(QUrl(BuildConfig.NOTIFICATION_URL)); + checker->setApplicationChannel(BuildConfig.VERSION_CHANNEL); + checker->setApplicationPlatform(BuildConfig.BUILD_PLATFORM); + checker->setApplicationFullVersion(BuildConfig.FULL_VERSION_STR); + m_notificationChecker.reset(checker); + connect(m_notificationChecker.get(), + &NotificationChecker::notificationCheckFinished, this, + &MainWindow::notificationsChanged); + checker->checkForNotifications(); + } + + setSelectedInstanceById(MMC->settings()->get("SelectedInstance").toString()); + + // removing this looks stupid + view->setFocus(); +} + +MainWindow::~MainWindow() +{ + delete ui; + delete proxymodel; +} + +void MainWindow::skinJobFinished() +{ + activeAccountChanged(); + skin_download_job.reset(); +} + +void MainWindow::showInstanceContextMenu(const QPoint &pos) +{ + QList actions; + + QAction *actionSep = new QAction("", this); + actionSep->setSeparator(true); + + bool onInstance = view->indexAt(pos).isValid(); + if (onInstance) + { + actions = ui->instanceToolBar->actions(); + + QAction *actionVoid = new QAction(m_selectedInstance->name(), this); + actionVoid->setEnabled(false); + + QAction *actionRename = new QAction(tr("Rename"), this); + actionRename->setToolTip(ui->actionRenameInstance->toolTip()); + + QAction *actionCopyInstance = new QAction(tr("Copy instance"), this); + actionCopyInstance->setToolTip(ui->actionCopyInstance->toolTip()); + + connect(actionRename, SIGNAL(triggered(bool)), + SLOT(on_actionRenameInstance_triggered())); + connect(actionCopyInstance, SIGNAL(triggered(bool)), + SLOT(on_actionCopyInstance_triggered())); + + actions.replace(1, actionRename); + actions.prepend(actionSep); + actions.prepend(actionVoid); + actions.append(actionCopyInstance); + } + else + { + QAction *actionVoid = new QAction(tr("MultiMC"), this); + actionVoid->setEnabled(false); + + QAction *actionCreateInstance = new QAction(tr("Create instance"), this); + actionCreateInstance->setToolTip(ui->actionAddInstance->toolTip()); + + connect(actionCreateInstance, SIGNAL(triggered(bool)), + SLOT(on_actionAddInstance_triggered())); + + actions.prepend(actionSep); + actions.prepend(actionVoid); + actions.append(actionCreateInstance); + } + QMenu myMenu; + myMenu.addActions(actions); + if (onInstance) + myMenu.setEnabled(m_selectedInstance->canLaunch()); + myMenu.exec(view->mapToGlobal(pos)); +} + +void MainWindow::updateToolsMenu() +{ + if (ui->actionLaunchInstance->menu()) + { + ui->actionLaunchInstance->menu()->deleteLater(); + } + QMenu *launchMenu = new QMenu(this); + QAction *normalLaunch = launchMenu->addAction(tr("Launch")); + connect(normalLaunch, &QAction::triggered, [this]() + { doLaunch(); }); + launchMenu->addSeparator()->setText(tr("Profilers")); + for (auto profiler : MMC->profilers().values()) + { + QAction *profilerAction = launchMenu->addAction(profiler->name()); + QString error; + if (!profiler->check(&error)) + { + profilerAction->setDisabled(true); + profilerAction->setToolTip( + tr("Profiler not setup correctly. Go into settings, \"External Tools\".")); + } + else + { + connect(profilerAction, &QAction::triggered, [this, profiler]() + { doLaunch(true, profiler.get()); }); + } + } + launchMenu->addSeparator()->setText(tr("Tools")); + for (auto tool : MMC->tools().values()) + { + QAction *toolAction = launchMenu->addAction(tool->name()); + QString error; + if (!tool->check(&error)) + { + toolAction->setDisabled(true); + toolAction->setToolTip( + tr("Tool not setup correctly. Go into settings, \"External Tools\".")); + } + else + { + connect(toolAction, &QAction::triggered, [this, tool]() + { tool->createDetachedTool(m_selectedInstance, this)->run(); }); + } + } + ui->actionLaunchInstance->setMenu(launchMenu); +} + +void MainWindow::repopulateAccountsMenu() +{ + accountMenu->clear(); + + std::shared_ptr accounts = MMC->accounts(); + MojangAccountPtr active_account = accounts->activeAccount(); + + QString active_username = ""; + if (active_account != nullptr) + { + active_username = accounts->activeAccount()->username(); + } + + if (accounts->count() <= 0) + { + QAction *action = new QAction(tr("No accounts added!"), this); + action->setEnabled(false); + accountMenu->addAction(action); + + accountMenu->addSeparator(); + } + else + { + // TODO: Nicer way to iterate? + for (int i = 0; i < accounts->count(); i++) + { + MojangAccountPtr account = accounts->at(i); + + // Styling hack + QAction *section = new QAction(account->username(), this); + section->setEnabled(false); + accountMenu->addAction(section); + + for (auto profile : account->profiles()) + { + QAction *action = new QAction(profile.name, this); + action->setData(account->username()); + action->setCheckable(true); + if (active_username == account->username()) + { + action->setChecked(true); + } + + action->setIcon(SkinUtils::getFaceFromCache(profile.name)); + accountMenu->addAction(action); + connect(action, SIGNAL(triggered(bool)), SLOT(changeActiveAccount())); + } + + accountMenu->addSeparator(); + } + } + + QAction *action = new QAction(tr("No Default Account"), this); + action->setCheckable(true); + action->setIcon(MMC->getThemedIcon("noaccount")); + action->setData(""); + if (active_username.isEmpty()) + { + action->setChecked(true); + } + + accountMenu->addAction(action); + connect(action, SIGNAL(triggered(bool)), SLOT(changeActiveAccount())); + + accountMenu->addSeparator(); + accountMenu->addAction(manageAccountsAction); +} + +/* + * Assumes the sender is a QAction + */ +void MainWindow::changeActiveAccount() +{ + QAction *sAction = (QAction *)sender(); + // Profile's associated Mojang username + // Will need to change when profiles are properly implemented + if (sAction->data().type() != QVariant::Type::String) + return; + + QVariant data = sAction->data(); + QString id = ""; + if (!data.isNull()) + { + id = data.toString(); + } + + MMC->accounts()->setActiveAccount(id); + + activeAccountChanged(); +} + +void MainWindow::activeAccountChanged() +{ + repopulateAccountsMenu(); + + MojangAccountPtr account = MMC->accounts()->activeAccount(); + + if (account != nullptr && account->username() != "") + { + const AccountProfile *profile = account->currentProfile(); + if (profile != nullptr) + { + accountMenuButton->setIcon(SkinUtils::getFaceFromCache(profile->name)); + return; + } + } + + // Set the icon to the "no account" icon. + accountMenuButton->setIcon(MMC->getThemedIcon("noaccount")); +} + +bool MainWindow::eventFilter(QObject *obj, QEvent *ev) +{ + if (obj == view) + { + if (ev->type() == QEvent::KeyPress) + { + QKeyEvent *keyEvent = static_cast(ev); + switch (keyEvent->key()) + { + case Qt::Key_Enter: + case Qt::Key_Return: + on_actionLaunchInstance_triggered(); + return true; + case Qt::Key_Delete: + on_actionDeleteInstance_triggered(); + return true; + case Qt::Key_F5: + on_actionRefresh_triggered(); + return true; + case Qt::Key_F2: + on_actionRenameInstance_triggered(); + return true; + default: + break; + } + } + } + return QMainWindow::eventFilter(obj, ev); +} + +void MainWindow::updateNewsLabel() +{ + if (m_newsChecker->isLoadingNews()) + { + newsLabel->setText(tr("Loading news...")); + newsLabel->setEnabled(false); + } + else + { + QList entries = m_newsChecker->getNewsEntries(); + if (entries.length() > 0) + { + newsLabel->setText(entries[0]->title); + newsLabel->setEnabled(true); + } + else + { + newsLabel->setText(tr("No news available.")); + newsLabel->setEnabled(false); + } + } +} + +void MainWindow::updateAvailable(GoUpdate::Status status) +{ + UpdateDialog dlg; + UpdateAction action = (UpdateAction)dlg.exec(); + switch (action) + { + case UPDATE_LATER: + qDebug() << "Update will be installed later."; + break; + case UPDATE_NOW: + downloadUpdates(status); + break; + case UPDATE_ONEXIT: + downloadUpdates(status, true); + break; + } +} + +void MainWindow::updateNotAvailable() +{ + UpdateDialog dlg(false); + dlg.exec(); +} + +QList stringToIntList(const QString &string) +{ + QStringList split = string.split(',', QString::SkipEmptyParts); + QList out; + for (int i = 0; i < split.size(); ++i) + { + out.append(split.at(i).toInt()); + } + return out; +} +QString intListToString(const QList &list) +{ + QStringList slist; + for (int i = 0; i < list.size(); ++i) + { + slist.append(QString::number(list.at(i))); + } + return slist.join(','); +} +void MainWindow::notificationsChanged() +{ + QList entries = + m_notificationChecker->notificationEntries(); + QList shownNotifications = + stringToIntList(MMC->settings()->get("ShownNotifications").toString()); + for (auto it = entries.begin(); it != entries.end(); ++it) + { + NotificationChecker::NotificationEntry entry = *it; + if (!shownNotifications.contains(entry.id)) + { + NotificationDialog dialog(entry, this); + if (dialog.exec() == NotificationDialog::DontShowAgain) + { + shownNotifications.append(entry.id); + } + } + } + MMC->settings()->set("ShownNotifications", intListToString(shownNotifications)); +} + +void MainWindow::downloadUpdates(GoUpdate::Status status, bool installOnExit) +{ + qDebug() << "Downloading updates."; + // TODO: If the user chooses to update on exit, we should download updates in the + // background. + // Doing so is a bit complicated, because we'd have to make sure it finished downloading + // before actually exiting MultiMC. + ProgressDialog updateDlg(this); + status.rootPath = MMC->rootPath; + + GoUpdate::DownloadTask updateTask(status, &updateDlg); + // If the task succeeds, install the updates. + if (updateDlg.exec(&updateTask)) + { + UpdateFlags baseFlags = None; + if (BuildConfig.UPDATER_DRY_RUN) + baseFlags |= DryRun; + if (installOnExit) + MMC->installUpdates(updateTask.updateFilesDir(), baseFlags | OnExit); + else + MMC->installUpdates(updateTask.updateFilesDir(), baseFlags | RestartOnFinish); + } +} + +void MainWindow::onCatToggled(bool state) +{ + setCatBackground(state); + MMC->settings()->set("TheCat", state); +} + +void MainWindow::setCatBackground(bool enabled) +{ + if (enabled) + { + view->setStyleSheet("GroupView" + "{" + "background-image: url(:/backgrounds/kitteh);" + "background-attachment: fixed;" + "background-clip: padding;" + "background-position: top right;" + "background-repeat: none;" + "background-color:palette(base);" + "}"); + } + else + { + view->setStyleSheet(QString()); + } +} + +static QFileInfo findRecursive(const QString &dir, const QString &name) +{ + for (const auto info : QDir(dir).entryInfoList(QDir::NoDotAndDotDot | QDir::Dirs | QDir::Files, QDir::DirsLast)) + { + if (info.isFile() && info.fileName() == name) + { + return info; + } + else if (info.isDir()) + { + const QFileInfo res = findRecursive(info.absoluteFilePath(), name); + if (res.isFile() && res.exists()) + { + return res; + } + } + } + return QFileInfo(); +} + +// FIXME: eliminate, should not be needed +void MainWindow::waitForMinecraftVersions() +{ + if (!MMC->minecraftlist()->isLoaded() && m_versionLoadTask && + m_versionLoadTask->isRunning()) + { + QEventLoop waitLoop; + waitLoop.connect(m_versionLoadTask, SIGNAL(failed(QString)), SLOT(quit())); + waitLoop.connect(m_versionLoadTask, SIGNAL(succeeded()), SLOT(quit())); + waitLoop.exec(); + } +} + +void MainWindow::instanceFromZipPack(QString instName, QString instGroup, QString instIcon, QUrl url) +{ + InstancePtr newInstance; + + QString instancesDir = MMC->settings()->get("InstanceDir").toString(); + QString instDirName = DirNameFromString(instName, instancesDir); + QString instDir = PathCombine(instancesDir, instDirName); + + QString archivePath; + if (url.isLocalFile()) + { + archivePath = url.toLocalFile(); + } + else + { + const QString path = url.host() + '/' + url.path(); + auto entry = ENV.metacache()->resolveEntry("general", path); + CacheDownloadPtr dl = CacheDownload::make(url, entry); + NetJob job(tr("Modpack download")); + job.addNetAction(dl); + + // FIXME: possibly causes endless loop problems + ProgressDialog dlDialog(this); + if (dlDialog.exec(&job) != QDialog::Accepted) + { + return; + } + archivePath = entry->getFullPath(); + } + + QTemporaryDir extractTmpDir; + QDir extractDir(extractTmpDir.path()); + qDebug() << "Attempting to create instance from" << archivePath; + if (JlCompress::extractDir(archivePath, extractDir.absolutePath()).isEmpty()) + { + CustomMessageBox::selectable(this, tr("Error"), + tr("Failed to extract modpack"), QMessageBox::Warning)->show(); + return; + } + const QFileInfo instanceCfgFile = findRecursive(extractDir.absolutePath(), "instance.cfg"); + if (!instanceCfgFile.isFile() || !instanceCfgFile.exists()) + { + CustomMessageBox::selectable(this, tr("Error"), tr("Archive does not contain instance.cfg"))->show(); + return; + } + if (!copyPath(instanceCfgFile.absoluteDir().absolutePath(), instDir)) + { + CustomMessageBox::selectable(this, tr("Error"), tr("Unable to copy instance"))->show(); + return; + } + + auto error = MMC->instances()->loadInstance(newInstance, instDir); + QString errorMsg = tr("Failed to load instance %1: ").arg(instDirName); + switch (error) + { + case InstanceList::UnknownLoadError: + errorMsg += tr("Unkown error"); + CustomMessageBox::selectable(this, tr("Error"), errorMsg, QMessageBox::Warning)->show(); + return; + case InstanceList::NotAnInstance: + errorMsg += tr("Not an instance"); + CustomMessageBox::selectable(this, tr("Error"), errorMsg, QMessageBox::Warning)->show(); + return; + } + + newInstance->setName(instName); + newInstance->setIconKey(instIcon); + newInstance->setGroupInitial(instGroup); + MMC->instances()->add(InstancePtr(newInstance)); + MMC->instances()->saveGroupList(); + + finalizeInstance(newInstance); +} + +void MainWindow::instanceFromVersion(QString instName, QString instGroup, QString instIcon, BaseVersionPtr version) +{ + InstancePtr newInstance; + + QString instancesDir = MMC->settings()->get("InstanceDir").toString(); + QString instDirName = DirNameFromString(instName, instancesDir); + QString instDir = PathCombine(instancesDir, instDirName); + auto error = MMC->instances()->createInstance(newInstance, version, instDir); + QString errorMsg = tr("Failed to create instance %1: ").arg(instDirName); + switch (error) + { + case InstanceList::NoCreateError: + break; + + case InstanceList::InstExists: + { + errorMsg += tr("An instance with the given directory name already exists."); + CustomMessageBox::selectable(this, tr("Error"), errorMsg, QMessageBox::Warning)->show(); + return; + } + + case InstanceList::CantCreateDir: + { + errorMsg += tr("Failed to create the instance directory."); + CustomMessageBox::selectable(this, tr("Error"), errorMsg, QMessageBox::Warning)->show(); + return; + } + + default: + { + errorMsg += tr("Unknown instance loader error %1").arg(error); + CustomMessageBox::selectable(this, tr("Error"), errorMsg, QMessageBox::Warning)->show(); + return; + } + } + newInstance->setName(instName); + newInstance->setIconKey(instIcon); + newInstance->setGroupInitial(instGroup); + MMC->instances()->add(InstancePtr(newInstance)); + MMC->instances()->saveGroupList(); + finalizeInstance(newInstance); +} + +void MainWindow::finalizeInstance(InstancePtr inst) +{ + if (MMC->accounts()->anyAccountIsValid()) + { + ProgressDialog loadDialog(this); + auto update = inst->doUpdate(); + connect(update.get(), &Task::failed, [this](QString reason) + { + QString error = QString("Instance load failed: %1").arg(reason); + CustomMessageBox::selectable(this, tr("Error"), error, QMessageBox::Warning) + ->show(); + }); + loadDialog.exec(update.get()); + } + else + { + CustomMessageBox::selectable( + this, tr("Error"), + tr("MultiMC cannot download Minecraft or update instances unless you have at least " + "one account added.\nPlease add your Mojang or Minecraft account."), + QMessageBox::Warning)->show(); + } +} + + +void MainWindow::on_actionAddInstance_triggered() +{ + waitForMinecraftVersions(); + + NewInstanceDialog newInstDlg(this); + if (!newInstDlg.exec()) + return; + + MMC->settings()->set("LastUsedGroupForNewInstance", newInstDlg.instGroup()); + + const QUrl modpackUrl = newInstDlg.modpackUrl(); + + + if (modpackUrl.isValid()) + { + instanceFromZipPack(newInstDlg.instName(), newInstDlg.instGroup(), newInstDlg.iconKey(), modpackUrl); + } + else + { + instanceFromVersion(newInstDlg.instName(), newInstDlg.instGroup(), newInstDlg.iconKey(), newInstDlg.selectedVersion()); + } +} + +void MainWindow::on_actionCopyInstance_triggered() +{ + if (!m_selectedInstance) + return; + + CopyInstanceDialog copyInstDlg(m_selectedInstance, this); + if (!copyInstDlg.exec()) + return; + + QString instancesDir = MMC->settings()->get("InstanceDir").toString(); + QString instDirName = DirNameFromString(copyInstDlg.instName(), instancesDir); + QString instDir = PathCombine(instancesDir, instDirName); + + InstancePtr newInstance; + auto error = MMC->instances()->copyInstance(newInstance, m_selectedInstance, instDir); + + QString errorMsg = tr("Failed to create instance %1: ").arg(instDirName); + switch (error) + { + case InstanceList::NoCreateError: + newInstance->setName(copyInstDlg.instName()); + newInstance->setGroupInitial(copyInstDlg.instGroup()); + newInstance->setIconKey(copyInstDlg.iconKey()); + MMC->instances()->add(newInstance); + return; + + case InstanceList::InstExists: + { + errorMsg += tr("An instance with the given directory name already exists."); + CustomMessageBox::selectable(this, tr("Error"), errorMsg, QMessageBox::Warning)->show(); + break; + } + + case InstanceList::CantCreateDir: + { + errorMsg += tr("Failed to create the instance directory."); + CustomMessageBox::selectable(this, tr("Error"), errorMsg, QMessageBox::Warning)->show(); + break; + } + + default: + { + errorMsg += tr("Unknown instance loader error %1").arg(error); + CustomMessageBox::selectable(this, tr("Error"), errorMsg, QMessageBox::Warning)->show(); + break; + } + } +} + +void MainWindow::on_actionChangeInstIcon_triggered() +{ + if (!m_selectedInstance) + return; + + IconPickerDialog dlg(this); + dlg.exec(m_selectedInstance->iconKey()); + if (dlg.result() == QDialog::Accepted) + { + m_selectedInstance->setIconKey(dlg.selectedIconKey); + auto ico = ENV.icons()->getBigIcon(dlg.selectedIconKey); + ui->actionChangeInstIcon->setIcon(ico); + } +} + +void MainWindow::iconUpdated(QString icon) +{ + if (icon == m_currentInstIcon) + { + ui->actionChangeInstIcon->setIcon(ENV.icons()->getBigIcon(m_currentInstIcon)); + } +} + +void MainWindow::updateInstanceToolIcon(QString new_icon) +{ + m_currentInstIcon = new_icon; + ui->actionChangeInstIcon->setIcon(ENV.icons()->getBigIcon(m_currentInstIcon)); +} + +void MainWindow::setSelectedInstanceById(const QString &id) +{ + if (id.isNull()) + return; + const QModelIndex index = MMC->instances()->getInstanceIndexById(id); + if (index.isValid()) + { + QModelIndex selectionIndex = proxymodel->mapFromSource(index); + view->selectionModel()->setCurrentIndex(selectionIndex, QItemSelectionModel::ClearAndSelect); + } +} + +void MainWindow::on_actionChangeInstGroup_triggered() +{ + if (!m_selectedInstance) + return; + + bool ok = false; + QString name(m_selectedInstance->group()); + auto groups = MMC->instances()->getGroups(); + groups.insert(0, ""); + groups.sort(Qt::CaseInsensitive); + int foo = groups.indexOf(name); + + name = QInputDialog::getItem(this, tr("Group name"), tr("Enter a new group name."), groups, + foo, true, &ok); + name = name.simplified(); + if (ok) + m_selectedInstance->setGroupPost(name); +} + +void MainWindow::on_actionViewInstanceFolder_triggered() +{ + QString str = MMC->settings()->get("InstanceDir").toString(); + openDirInDefaultProgram(str); +} + +void MainWindow::on_actionRefresh_triggered() +{ + MMC->instances()->loadList(); +} + +void MainWindow::on_actionViewCentralModsFolder_triggered() +{ + openDirInDefaultProgram(MMC->settings()->get("CentralModsDir").toString(), true); +} + +void MainWindow::on_actionConfig_Folder_triggered() +{ + if (m_selectedInstance) + { + QString str = m_selectedInstance->instanceConfigFolder(); + openDirInDefaultProgram(QDir(str).absolutePath()); + } +} + +void MainWindow::on_actionCheckUpdate_triggered() +{ + auto updater = MMC->updateChecker(); + updater->checkForUpdate(MMC->settings()->get("UpdateChannel").toString(), true); +} + +template +void ShowPageDialog(T raw_provider, QWidget * parent, QString open_page = QString()) +{ + auto provider = std::dynamic_pointer_cast(raw_provider); + if(!provider) + return; + PageDialog dlg(provider, open_page, parent); + dlg.exec(); +} + +void ShowInstancePageDialog(InstancePtr instance, QWidget * parent, QString open_page = QString()) +{ + auto provider = std::make_shared(instance); + ShowPageDialog(provider, parent, open_page); +} + +void MainWindow::on_actionSettings_triggered() +{ + ShowPageDialog(m_globalSettingsProvider, this, "global-settings"); + // FIXME: quick HACK to make this work. improve, optimize. + proxymodel->invalidate(); + proxymodel->sort(0); + updateToolsMenu(); + update(); +} + +void MainWindow::on_actionInstanceSettings_triggered() +{ + ShowInstancePageDialog(m_selectedInstance, this, "settings"); +} + +void MainWindow::on_actionEditInstNotes_triggered() +{ + ShowInstancePageDialog(m_selectedInstance, this, "notes"); +} + +void MainWindow::on_actionEditInstance_triggered() +{ + ShowInstancePageDialog(m_selectedInstance, this); +} + +void MainWindow::on_actionScreenshots_triggered() +{ + ShowInstancePageDialog(m_selectedInstance, this, "screenshots"); +} + + +void MainWindow::on_actionManageAccounts_triggered() +{ + ShowPageDialog(m_globalSettingsProvider, this, "accounts"); +} + +void MainWindow::on_actionReportBug_triggered() +{ + openWebPage(QUrl("https://github.com/MultiMC/MultiMC5/issues")); +} + +void MainWindow::on_actionPatreon_triggered() +{ + openWebPage(QUrl("http://www.patreon.com/multimc")); +} + +void MainWindow::on_actionMoreNews_triggered() +{ + openWebPage(QUrl("http://multimc.org/posts.html")); +} + +void MainWindow::newsButtonClicked() +{ + QList entries = m_newsChecker->getNewsEntries(); + if (entries.count() > 0) + openWebPage(QUrl(entries[0]->link)); + else + openWebPage(QUrl("http://multimc.org/posts.html")); +} + +void MainWindow::on_actionAbout_triggered() +{ + AboutDialog dialog(this); + dialog.exec(); +} + +void MainWindow::on_mainToolBar_visibilityChanged(bool) +{ + // Don't allow hiding the main toolbar. + // This is the only way I could find to prevent it... :/ + ui->mainToolBar->setVisible(true); +} + +void MainWindow::on_actionDeleteInstance_triggered() +{ + if (m_selectedInstance) + { + auto response = CustomMessageBox::selectable( + this, tr("CAREFUL"), tr("This is permanent! Are you sure?\nAbout to delete: ") + + m_selectedInstance->name(), + QMessageBox::Question, QMessageBox::Yes | QMessageBox::No)->exec(); + if (response == QMessageBox::Yes) + { + m_selectedInstance->nuke(); + } + } +} + +#include + +bool compressSubDir(QuaZip* zip, QString dir, QString origDir, QString prefix) +{ + if (!zip) return false; + if (zip->getMode()!=QuaZip::mdCreate && zip->getMode()!=QuaZip::mdAppend && zip->getMode()!=QuaZip::mdAdd) + { + return false; + } + + QDir directory(dir); + if (!directory.exists()) return false; + + QDir origDirectory(origDir); + if (dir != origDir) + { + QuaZipFile dirZipFile(zip); + auto dirPrefix = PathCombine(prefix, origDirectory.relativeFilePath(dir)) + "/"; + if (!dirZipFile.open(QIODevice::WriteOnly, QuaZipNewInfo(dirPrefix, dir), 0, 0, 0)) + { + return false; + } + dirZipFile.close(); + } + + QFileInfoList files = directory.entryInfoList(QDir::AllDirs | QDir::NoDotAndDotDot | QDir::Hidden); + for (auto file: files) + { + if(!compressSubDir(zip,file.absoluteFilePath(),origDir, prefix)) + { + return false; + } + } + + files = directory.entryInfoList(QDir::Files); + for (auto file: files) + { + if(!file.isFile()) + { + continue; + } + + if(file.absoluteFilePath()==zip->getZipName()) + { + continue; + } + + QString filename = origDirectory.relativeFilePath(file.absoluteFilePath()); + if(prefix.size()) + { + filename = PathCombine(prefix, filename); + } + if (!JlCompress::compressFile(zip,file.absoluteFilePath(),filename)) + { + return false; + } + } + + return true; +} + +bool compressDir(QString zipFile, QString dir, QString prefix = QString()) +{ + QuaZip zip(zipFile); + QDir().mkpath(QFileInfo(zipFile).absolutePath()); + if(!zip.open(QuaZip::mdCreate)) + { + QFile::remove(zipFile); + return false; + } + + QSet added; + if (!compressSubDir(&zip,dir,dir,prefix)) + { + QFile::remove(zipFile); + return false; + } + zip.close(); + if(zip.getZipError()!=0) + { + QFile::remove(zipFile); + return false; + } + return true; +} + +void MainWindow::on_actionExportInstance_triggered() +{ + if (m_selectedInstance) + { + auto name = RemoveInvalidFilenameChars(m_selectedInstance->name()); + + const QString output = QFileDialog::getSaveFileName(this, tr("Export %1") + .arg(m_selectedInstance->name()), + PathCombine(QDir::homePath(), name + ".zip") , "Zip (*.zip)"); + if (output.isNull()) + { + return; + } + if (QFile::exists(output)) + { + int ret = QMessageBox::question(this, tr("Overwrite?"), tr("This file already exists. Do you want to overwrite it?"), + QMessageBox::No, QMessageBox::Yes); + if (ret == QMessageBox::No) + { + return; + } + } + + if (!compressDir(output, m_selectedInstance->instanceRoot(), name)) + { + QMessageBox::warning(this, tr("Error"), tr("Unable to export instance")); + } + } +} + +void MainWindow::on_actionRenameInstance_triggered() +{ + if (m_selectedInstance) + { + bool ok = false; + QString name(m_selectedInstance->name()); + name = + QInputDialog::getText(this, tr("Instance name"), tr("Enter a new instance name."), + QLineEdit::Normal, name, &ok); + + if (name.length() > 0) + { + if (ok && name.length()) + { + m_selectedInstance->setName(name); + renameButton->setText(name); + } + } + } +} + +void MainWindow::on_actionViewSelectedInstFolder_triggered() +{ + if (m_selectedInstance) + { + QString str = m_selectedInstance->instanceRoot(); + openDirInDefaultProgram(QDir(str).absolutePath()); + } +} + +void MainWindow::closeEvent(QCloseEvent *event) +{ + // Save the window state and geometry. + + MMC->settings()->set("MainWindowState", saveState().toBase64()); + MMC->settings()->set("MainWindowGeometry", saveGeometry().toBase64()); + + QMainWindow::closeEvent(event); + QApplication::exit(); +} +/* +void MainWindow::on_instanceView_customContextMenuRequested(const QPoint &pos) +{ + QMenu *instContextMenu = new QMenu("Instance", this); + + // Add the actions from the toolbar to the context menu. + instContextMenu->addActions(ui->instanceToolBar->actions()); + + instContextMenu->exec(view->mapToGlobal(pos)); +} +*/ +void MainWindow::instanceActivated(QModelIndex index) +{ + if (!index.isValid()) + return; + QString id = index.data(InstanceList::InstanceIDRole).toString(); + InstancePtr inst = MMC->instances()->getInstanceById(id); + if (!inst) + return; + + NagUtils::checkJVMArgs(inst->settings().get("JvmArgs").toString(), this); + + doLaunch(); +} + +void MainWindow::on_actionLaunchInstance_triggered() +{ + if (m_selectedInstance) + { + NagUtils::checkJVMArgs(m_selectedInstance->settings().get("JvmArgs").toString(), this); + doLaunch(); + } +} + +void MainWindow::on_actionLaunchInstanceOffline_triggered() +{ + if (m_selectedInstance) + { + NagUtils::checkJVMArgs(m_selectedInstance->settings().get("JvmArgs").toString(), this); + doLaunch(false); + } +} + +void MainWindow::doLaunch(bool online, BaseProfilerFactory *profiler) +{ + if (!m_selectedInstance) + return; + + // Find an account to use. + std::shared_ptr accounts = MMC->accounts(); + MojangAccountPtr account = accounts->activeAccount(); + if (accounts->count() <= 0) + { + // Tell the user they need to log in at least one account in order to play. + auto reply = CustomMessageBox::selectable( + this, tr("No Accounts"), + tr("In order to play Minecraft, you must have at least one Mojang or Minecraft " + "account logged in to MultiMC." + "Would you like to open the account manager to add an account now?"), + QMessageBox::Information, QMessageBox::Yes | QMessageBox::No)->exec(); + + if (reply == QMessageBox::Yes) + { + // Open the account manager. + on_actionManageAccounts_triggered(); + } + } + else if (account.get() == nullptr) + { + // If no default account is set, ask the user which one to use. + AccountSelectDialog selectDialog(tr("Which account would you like to use?"), + AccountSelectDialog::GlobalDefaultCheckbox, this); + + selectDialog.exec(); + + // Launch the instance with the selected account. + account = selectDialog.selectedAccount(); + + // If the user said to use the account as default, do that. + if (selectDialog.useAsGlobalDefault() && account.get() != nullptr) + accounts->setActiveAccount(account->username()); + } + + // if no account is selected, we bail + if (!account.get()) + return; + + // we try empty password first :) + QString password; + // we loop until the user succeeds in logging in or gives up + bool tryagain = true; + // the failure. the default failure. + QString failReason = tr("Your account is currently not logged in. Please enter " + "your password to log in again."); + + while (tryagain) + { + AuthSessionPtr session(new AuthSession()); + session->wants_online = online; + auto task = account->login(session, password); + if (task) + { + // We'll need to validate the access token to make sure the account + // is still logged in. + ProgressDialog progDialog(this); + if (online) + progDialog.setSkipButton(true, tr("Play Offline")); + progDialog.exec(task.get()); + if (!task->successful()) + { + failReason = task->failReason(); + } + } + switch (session->status) + { + case AuthSession::Undetermined: + { + qCritical() << "Received undetermined session status during login. Bye."; + tryagain = false; + break; + } + case AuthSession::RequiresPassword: + { + EditAccountDialog passDialog(failReason, this, EditAccountDialog::PasswordField); + if (passDialog.exec() == QDialog::Accepted) + { + password = passDialog.password(); + } + else + { + tryagain = false; + } + break; + } + case AuthSession::PlayableOffline: + { + // we ask the user for a player name + bool ok = false; + QString usedname = session->player_name; + QString name = QInputDialog::getText(this, tr("Player name"), + tr("Choose your offline mode player name."), + QLineEdit::Normal, session->player_name, &ok); + if (!ok) + { + tryagain = false; + break; + } + if (name.length()) + { + usedname = name; + } + session->MakeOffline(usedname); + // offline flavored game from here :3 + } + case AuthSession::PlayableOnline: + { + // update first if the server actually responded + if (session->auth_server_online) + { + updateInstance(m_selectedInstance, session, profiler); + } + else + { + launchInstance(m_selectedInstance, session, profiler); + } + tryagain = false; + } + } + } +} + +void MainWindow::updateInstance(InstancePtr instance, AuthSessionPtr session, + BaseProfilerFactory *profiler) +{ + auto updateTask = instance->doUpdate(); + if (!updateTask) + { + launchInstance(instance, session, profiler); + return; + } + ProgressDialog tDialog(this); + connect(updateTask.get(), &Task::succeeded, [this, instance, session, profiler] + { launchInstance(instance, session, profiler); }); + connect(updateTask.get(), SIGNAL(failed(QString)), SLOT(onGameUpdateError(QString))); + tDialog.exec(updateTask.get()); +} + +void MainWindow::launchInstance(InstancePtr instance, AuthSessionPtr session, + BaseProfilerFactory *profiler) +{ + Q_ASSERT_X(instance != NULL, "launchInstance", "instance is NULL"); + Q_ASSERT_X(session.get() != nullptr, "launchInstance", "session is NULL"); + + QString launchScript; + + BaseProcess *proc = instance->prepareForLaunch(session); + if (!proc) + return; + + this->hide(); + + console = new ConsoleWindow(proc); + connect(console, SIGNAL(isClosing()), this, SLOT(instanceEnded())); + + proc->setHeader("MultiMC version: " + BuildConfig.printableVersionString() + "\n\n"); + proc->arm(); + + if (profiler) + { + QString error; + if (!profiler->check(&error)) + { + QMessageBox::critical(this, tr("Error"), + tr("Couldn't start profiler: %1").arg(error)); + proc->abort(); + return; + } + BaseProfiler *profilerInstance = profiler->createProfiler(instance, this); + QProgressDialog dialog; + dialog.setMinimum(0); + dialog.setMaximum(0); + dialog.setValue(0); + dialog.setLabelText(tr("Waiting for profiler...")); + connect(&dialog, &QProgressDialog::canceled, profilerInstance, + &BaseProfiler::abortProfiling); + dialog.show(); + connect(profilerInstance, &BaseProfiler::readyToLaunch, + [&dialog, this, proc](const QString & message) + { + dialog.accept(); + QMessageBox msg; + msg.setText(tr("The game launch is delayed until you press the " + "button. This is the right time to setup the profiler, as the " + "profiler server is running now.\n\n%1").arg(message)); + msg.setWindowTitle(tr("Waiting")); + msg.setIcon(QMessageBox::Information); + msg.addButton(tr("Launch"), QMessageBox::AcceptRole); + msg.exec(); + proc->launch(); + }); + connect(profilerInstance, &BaseProfiler::abortLaunch, + [&dialog, this, proc](const QString & message) + { + dialog.accept(); + QMessageBox msg; + msg.setText(tr("Couldn't start the profiler: %1").arg(message)); + msg.setWindowTitle(tr("Error")); + msg.setIcon(QMessageBox::Critical); + msg.addButton(QMessageBox::Ok); + msg.exec(); + proc->abort(); + }); + profilerInstance->beginProfiling(proc); + dialog.exec(); + } + else + { + proc->launch(); + } +} + +void MainWindow::onGameUpdateError(QString error) +{ + CustomMessageBox::selectable(this, tr("Error updating instance"), error, + QMessageBox::Warning)->show(); +} + +void MainWindow::taskStart() +{ + // Nothing to do here yet. +} + +void MainWindow::taskEnd() +{ + QObject *sender = QObject::sender(); + if (sender == m_versionLoadTask) + m_versionLoadTask = NULL; + + sender->deleteLater(); +} + +void MainWindow::startTask(Task *task) +{ + connect(task, SIGNAL(started()), SLOT(taskStart())); + connect(task, SIGNAL(succeeded()), SLOT(taskEnd())); + connect(task, SIGNAL(failed(QString)), SLOT(taskEnd())); + task->start(); +} + +// BrowserDialog +void MainWindow::openWebPage(QUrl url) +{ + QDesktopServices::openUrl(url); +} + +void MainWindow::instanceChanged(const QModelIndex ¤t, const QModelIndex &previous) +{ + if(!current.isValid()) + { + MMC->settings()->set("SelectedInstance", QString()); + selectionBad(); + return; + } + QString id = current.data(InstanceList::InstanceIDRole).toString(); + m_selectedInstance = MMC->instances()->getInstanceById(id); + if ( m_selectedInstance ) + { + ui->instanceToolBar->setEnabled(m_selectedInstance->canLaunch()); + renameButton->setText(m_selectedInstance->name()); + m_statusLeft->setText(m_selectedInstance->getStatusbarDescription()); + updateInstanceToolIcon(m_selectedInstance->iconKey()); + + updateToolsMenu(); + + MMC->settings()->set("SelectedInstance", m_selectedInstance->id()); + } + else + { + MMC->settings()->set("SelectedInstance", QString()); + selectionBad(); + return; + } +} + +void MainWindow::selectionBad() +{ + // start by reseting everything... + m_selectedInstance = nullptr; + + statusBar()->clearMessage(); + ui->instanceToolBar->setEnabled(false); + renameButton->setText(tr("Rename Instance")); + updateInstanceToolIcon("infinity"); + + // ...and then see if we can enable the previously selected instance + setSelectedInstanceById(MMC->settings()->get("SelectedInstance").toString()); +} + +void MainWindow::instanceEnded() +{ + this->show(); +} + +void MainWindow::checkSetDefaultJava() +{ + const QString javaHack = "IntelHack"; + bool askForJava = false; + do + { + QString currentHostName = QHostInfo::localHostName(); + QString oldHostName = MMC->settings()->get("LastHostname").toString(); + if (currentHostName != oldHostName) + { + MMC->settings()->set("LastHostname", currentHostName); + askForJava = true; + break; + } + QString currentJavaPath = MMC->settings()->get("JavaPath").toString(); + if (currentJavaPath.isEmpty()) + { + askForJava = true; + break; + } + if(!currentJavaPath.contains('/')) + { + currentJavaPath = QStandardPaths::findExecutable(currentJavaPath); + } + QFile currentJavaBin(currentJavaPath); + if(!currentJavaBin.exists()) + { + askForJava = true; + break; + } + #if defined Q_OS_WIN32 + QString currentHack = MMC->settings()->get("JavaDetectionHack").toString(); + if (currentHack != javaHack) + { + CustomMessageBox::selectable( + this, tr("Java detection forced"), + tr("Because of graphics performance issues caused by Intel drivers on Windows, " + "MultiMC java detection was forced. Please select a Java " + "version.

If you have custom java versions set for your instances, " + "make sure you use the 'javaw.exe' executable."), + QMessageBox::Warning)->exec(); + askForJava = true; + break; + } + #endif + } while (0); + + if (askForJava) + { + qDebug() << "Java path needs resetting, showing Java selection dialog..."; + + JavaVersionPtr java; + + VersionSelectDialog vselect(MMC->javalist().get(), tr("Select a Java version"), this, + false); + vselect.setResizeOn(2); + vselect.exec(); + + if (vselect.selectedVersion()) + java = std::dynamic_pointer_cast(vselect.selectedVersion()); + else + { + CustomMessageBox::selectable( + this, tr("Invalid version selected"), + tr("You didn't select a valid Java version, so MultiMC will " + "select the default. " + "You can change this in the settings dialog."), + QMessageBox::Warning)->show(); + + JavaUtils ju; + java = ju.GetDefaultJava(); + } + if (java) + { + MMC->settings()->set("JavaPath", java->path); + MMC->settings()->set("JavaDetectionHack", javaHack); + } + else + MMC->settings()->set("JavaPath", QString("java")); + } +} + +void MainWindow::checkInstancePathForProblems() +{ + QString instanceFolder = MMC->settings()->get("InstanceDir").toString(); + if (checkProblemticPathJava(QDir(instanceFolder))) + { + QMessageBox warning; + warning.setText(tr( + "Your instance folder contains \'!\' and this is known to cause Java problems!")); + warning.setInformativeText( + tr("You have now three options:
" + " - ignore this warning
" + " - change the instance dir in the settings
" + " - move this installation of MultiMC5 to a different folder")); + warning.setDefaultButton(QMessageBox::Ok); + warning.exec(); + } +} diff --git a/application/MainWindow.h b/application/MainWindow.h new file mode 100644 index 00000000..96d9c7bb --- /dev/null +++ b/application/MainWindow.h @@ -0,0 +1,218 @@ +/* Copyright 2013-2015 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include +#include + +#include "BaseInstance.h" +#include "auth/MojangAccount.h" +#include "net/NetJob.h" +#include "updater/GoUpdate.h" + +class NewsChecker; +class NotificationChecker; +class QToolButton; +class InstanceProxyModel; +class LabeledToolButton; +class QLabel; +class MinecraftProcess; +class ConsoleWindow; +class BaseProfilerFactory; +class GenericPageProvider; + +namespace Ui +{ +class MainWindow; +} + +class MainWindow : public QMainWindow +{ + Q_OBJECT + +public: + explicit MainWindow(QWidget *parent = 0); + ~MainWindow(); + + void closeEvent(QCloseEvent *event); + + // Browser Dialog + void openWebPage(QUrl url); + + void checkSetDefaultJava(); + void checkInstancePathForProblems(); + +private +slots: + void onCatToggled(bool); + + void on_actionAbout_triggered(); + + void on_actionAddInstance_triggered(); + + void on_actionCopyInstance_triggered(); + + void on_actionChangeInstGroup_triggered(); + + void on_actionChangeInstIcon_triggered(); + + void on_actionViewInstanceFolder_triggered(); + + void on_actionConfig_Folder_triggered(); + + void on_actionViewSelectedInstFolder_triggered(); + + void on_actionRefresh_triggered(); + + void on_actionViewCentralModsFolder_triggered(); + + void on_actionCheckUpdate_triggered(); + + void on_actionSettings_triggered(); + + void on_actionInstanceSettings_triggered(); + + void on_actionManageAccounts_triggered(); + + void on_actionReportBug_triggered(); + + void on_actionPatreon_triggered(); + + void on_actionMoreNews_triggered(); + + void newsButtonClicked(); + + void on_mainToolBar_visibilityChanged(bool); + + // void on_instanceView_customContextMenuRequested(const QPoint &pos); + + void on_actionLaunchInstance_triggered(); + + void on_actionLaunchInstanceOffline_triggered(); + + void on_actionDeleteInstance_triggered(); + + void on_actionExportInstance_triggered(); + + void on_actionRenameInstance_triggered(); + + void on_actionEditInstance_triggered(); + + void on_actionEditInstNotes_triggered(); + + void on_actionScreenshots_triggered(); + + /*! + * Launches the currently selected instance with the default account. + * If no default account is selected, prompts the user to pick an account. + */ + void doLaunch(bool online = true, BaseProfilerFactory *profiler = 0); + + /*! + * Launches the given instance with the given account. + * This function assumes that the given account has a valid, usable access token. + */ + void launchInstance(InstancePtr instance, AuthSessionPtr session, BaseProfilerFactory *profiler = 0); + + /*! + * Prepares the given instance for launch with the given account. + */ + void updateInstance(InstancePtr instance, AuthSessionPtr account, BaseProfilerFactory *profiler = 0); + + void onGameUpdateError(QString error); + + void taskStart(); + void taskEnd(); + + void instanceEnded(); + + // called when an icon is changed in the icon model. + void iconUpdated(QString); + + void showInstanceContextMenu(const QPoint &); + + void updateToolsMenu(); + + void skinJobFinished(); +public +slots: + void instanceActivated(QModelIndex); + + void instanceChanged(const QModelIndex ¤t, const QModelIndex &previous); + + void selectionBad(); + + void startTask(Task *task); + + void updateAvailable(GoUpdate::Status status); + + void updateNotAvailable(); + + void notificationsChanged(); + + void activeAccountChanged(); + + void changeActiveAccount(); + + void repopulateAccountsMenu(); + + void updateNewsLabel(); + + /*! + * Runs the DownloadTask and installs updates. + */ + void downloadUpdates(GoUpdate::Status status, bool installOnExit = false); + +protected: + bool eventFilter(QObject *obj, QEvent *ev); + void setCatBackground(bool enabled); + void updateInstanceToolIcon(QString new_icon); + + void setSelectedInstanceById(const QString &id); + + void waitForMinecraftVersions(); + void instanceFromVersion(QString instName, QString instGroup, QString instIcon, BaseVersionPtr version); + void instanceFromZipPack(QString instName, QString instGroup, QString instIcon, QUrl url); + void finalizeInstance(InstancePtr inst); + +private: + Ui::MainWindow *ui; + class GroupView *view; + InstanceProxyModel *proxymodel; + NetJobPtr skin_download_job; + MinecraftProcess *proc; + ConsoleWindow *console; + LabeledToolButton *renameButton; + QToolButton *changeIconButton; + QToolButton *newsLabel; + + std::shared_ptr m_globalSettingsProvider; + std::shared_ptr m_newsChecker; + std::shared_ptr m_notificationChecker; + + InstancePtr m_selectedInstance; + QString m_currentInstIcon; + + Task *m_versionLoadTask; + + QLabel *m_statusLeft; + class ServerStatus *m_statusRight; + + QMenu *accountMenu; + QToolButton *accountMenuButton; + QAction *manageAccountsAction; +}; diff --git a/application/MultiMC.cpp b/application/MultiMC.cpp new file mode 100644 index 00000000..ba6d7880 --- /dev/null +++ b/application/MultiMC.cpp @@ -0,0 +1,632 @@ +#include "MultiMC.h" +#include "BuildConfig.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "dialogs/VersionSelectDialog.h" +#include "InstanceList.h" +#include "auth/MojangAccountList.h" +#include "icons/IconList.h" +#include "minecraft/LwjglVersionList.h" +#include "minecraft/MinecraftVersionList.h" +#include "liteloader/LiteLoaderVersionList.h" + +#include "forge/ForgeVersionList.h" + +#include "net/HttpMetaCache.h" +#include "net/URLConstants.h" +#include "Env.h" + +#include "java/JavaUtils.h" + +#include "updater/UpdateChecker.h" + +#include "tools/JProfiler.h" +#include "tools/JVisualVM.h" +#include "tools/MCEditTool.h" + +#include "pathutils.h" +#include "cmdutils.h" +#include +#include "settings/INISettingsObject.h" +#include "settings/Setting.h" + +#include "trans/TranslationDownloader.h" + +#include "ftb/FTBPlugin.h" + +using namespace Util::Commandline; + +MultiMC::MultiMC(int &argc, char **argv, bool test_mode) : QApplication(argc, argv) +{ + setOrganizationName("MultiMC"); + setApplicationName("MultiMC5"); + + startTime = QDateTime::currentDateTime(); + + setAttribute(Qt::AA_UseHighDpiPixmaps); + // Don't quit on hiding the last window + this->setQuitOnLastWindowClosed(false); + + // Commandline parsing + QHash args; + { + Parser parser(FlagStyle::GNU, ArgumentStyle::SpaceAndEquals); + + // --help + parser.addSwitch("help"); + parser.addShortOpt("help", 'h'); + parser.addDocumentation("help", "display this help and exit."); + // --version + parser.addSwitch("version"); + parser.addShortOpt("version", 'V'); + parser.addDocumentation("version", "display program version and exit."); + // --dir + parser.addOption("dir", applicationDirPath()); + parser.addShortOpt("dir", 'd'); + parser.addDocumentation("dir", "use the supplied directory as MultiMC root instead of " + "the binary location (use '.' for current)"); + + // parse the arguments + try + { + args = parser.parse(arguments()); + } + catch (ParsingError e) + { + std::cerr << "CommandLineError: " << e.what() << std::endl; + std::cerr << "Try '%1 -h' to get help on MultiMC's command line parameters." + << std::endl; + m_status = MultiMC::Failed; + return; + } + + // display help and exit + if (args["help"].toBool()) + { + std::cout << qPrintable(parser.compileHelp(arguments()[0])); + m_status = MultiMC::Succeeded; + return; + } + + // display version and exit + if (args["version"].toBool()) + { + std::cout << "Version " << BuildConfig.VERSION_STR.toStdString() << std::endl; + std::cout << "Git " << BuildConfig.GIT_COMMIT.toStdString() << std::endl; + m_status = MultiMC::Succeeded; + return; + } + } + + QString origcwdPath = QDir::currentPath(); + QString binPath = applicationDirPath(); + QString adjustedBy; + // change directory + QString dirParam = args["dir"].toString(); + if (!dirParam.isEmpty()) + { + // the dir param. it makes multimc data path point to whatever the user specified + // on command line + adjustedBy += "Command line " + dirParam; + dataPath = dirParam; + } + else + { + dataPath = applicationDirPath(); + adjustedBy += "Fallback to binary path " + dataPath; + } + + if (!ensureFolderPathExists(dataPath) || !QDir::setCurrent(dataPath)) + { + // BAD STUFF. WHAT DO? + initLogger(); + qCritical() << "Failed to set work path. Will exit. NOW."; + m_status = MultiMC::Failed; + return; + } + + // in test mode, root path is the same as the binary path. + if (test_mode) + { + rootPath = binPath; + } + else + { +#ifdef Q_OS_LINUX + QDir foo(PathCombine(binPath, "..")); + rootPath = foo.absolutePath(); +#elif defined(Q_OS_WIN32) + rootPath = binPath; +#elif defined(Q_OS_MAC) + QDir foo(PathCombine(binPath, "../..")); + rootPath = foo.absolutePath(); +#endif + } + +// static data paths... mostly just for translations +#ifdef Q_OS_LINUX + QDir foo(PathCombine(binPath, "..")); + staticDataPath = foo.absolutePath(); +#elif defined(Q_OS_WIN32) + staticDataPath = binPath; +#elif defined(Q_OS_MAC) + QDir foo(PathCombine(rootPath, "Contents/Resources")); + staticDataPath = foo.absolutePath(); +#endif + + // init the logger + initLogger(); + + qDebug() << "MultiMC 5, (c) 2013-2015 MultiMC Contributors"; + qDebug() << "Version : " << BuildConfig.VERSION_STR; + qDebug() << "Git commit : " << BuildConfig.GIT_COMMIT; + if (adjustedBy.size()) + { + qDebug() << "Work dir before adjustment : " << origcwdPath; + qDebug() << "Work dir after adjustment : " << QDir::currentPath(); + qDebug() << "Adjusted by : " << adjustedBy; + } + else + { + qDebug() << "Work dir : " << QDir::currentPath(); + } + qDebug() << "Binary path : " << binPath; + qDebug() << "Application root path : " << rootPath; + qDebug() << "Static data path : " << staticDataPath; + + // load settings + initGlobalSettings(test_mode); + + // load translations + initTranslations(); + + // initialize the updater + m_updateChecker.reset(new UpdateChecker(BuildConfig.CHANLIST_URL, BuildConfig.VERSION_CHANNEL, BuildConfig.VERSION_BUILD)); + + m_translationChecker.reset(new TranslationDownloader()); + + // load icons + initIcons(); + + // and instances + auto InstDirSetting = m_settings->getSetting("InstanceDir"); + // instance path: check for problems with '!' in instance path and warn the user in the log + // and rememer that we have to show him a dialog when the gui starts (if it does so) + QString instDir = m_settings->get("InstanceDir").toString(); + qDebug() << "Instance path : " << instDir; + if (checkProblemticPathJava(QDir(instDir))) + { + qWarning() + << "Your instance path contains \'!\' and this is known to cause java problems"; + } + m_instances.reset(new InstanceList(m_settings, InstDirSetting->get().toString(), this)); + qDebug() << "Loading Instances..."; + m_instances->loadList(); + connect(InstDirSetting.get(), SIGNAL(SettingChanged(const Setting &, QVariant)), + m_instances.get(), SLOT(on_InstFolderChanged(const Setting &, QVariant))); + + // and accounts + m_accounts.reset(new MojangAccountList(this)); + qDebug() << "Loading accounts..."; + m_accounts->setListFilePath("accounts.json", true); + m_accounts->loadList(); + + // init the http meta cache + ENV.initHttpMetaCache(rootPath, staticDataPath); + + // create the global network manager + ENV.m_qnam.reset(new QNetworkAccessManager(this)); + + // init proxy settings + { + QString proxyTypeStr = settings()->get("ProxyType").toString(); + QString addr = settings()->get("ProxyAddr").toString(); + int port = settings()->get("ProxyPort").value(); + QString user = settings()->get("ProxyUser").toString(); + QString pass = settings()->get("ProxyPass").toString(); + ENV.updateProxySettings(proxyTypeStr, addr, port, user, pass); + } + + m_translationChecker->downloadTranslations(); + + //FIXME: what to do with these? + m_profilers.insert("jprofiler", + std::shared_ptr(new JProfilerFactory())); + m_profilers.insert("jvisualvm", + std::shared_ptr(new JVisualVMFactory())); + for (auto profiler : m_profilers.values()) + { + profiler->registerSettings(m_settings); + } + + //FIXME: what to do with these? + m_tools.insert("mcedit", std::shared_ptr(new MCEditFactory())); + for (auto tool : m_tools.values()) + { + tool->registerSettings(m_settings); + } + + connect(this, SIGNAL(aboutToQuit()), SLOT(onExit())); + m_status = MultiMC::Initialized; +} + +MultiMC::~MultiMC() +{ + if (m_mmc_translator) + { + removeTranslator(m_mmc_translator.get()); + } + if (m_qt_translator) + { + removeTranslator(m_qt_translator.get()); + } +} + +void MultiMC::initTranslations() +{ + QLocale locale(m_settings->get("Language").toString()); + QLocale::setDefault(locale); + qDebug() << "Your language is" << locale.bcp47Name(); + m_qt_translator.reset(new QTranslator()); + if (m_qt_translator->load("qt_" + locale.bcp47Name(), + QLibraryInfo::location(QLibraryInfo::TranslationsPath))) + { + qDebug() << "Loading Qt Language File for" + << locale.bcp47Name().toLocal8Bit().constData() << "..."; + if (!installTranslator(m_qt_translator.get())) + { + qCritical() << "Loading Qt Language File failed."; + m_qt_translator.reset(); + } + } + else + { + m_qt_translator.reset(); + } + + m_mmc_translator.reset(new QTranslator()); + if (m_mmc_translator->load("mmc_" + locale.bcp47Name(), staticDataPath + "/translations")) + { + qDebug() << "Loading MMC Language File for" + << locale.bcp47Name().toLocal8Bit().constData() << "..."; + if (!installTranslator(m_mmc_translator.get())) + { + qCritical() << "Loading MMC Language File failed."; + m_mmc_translator.reset(); + } + } + else + { + m_mmc_translator.reset(); + } +} + +void MultiMC::initIcons() +{ + auto setting = MMC->settings()->getSetting("IconsDir"); + ENV.m_icons.reset(new IconList(QString(":/icons/instances/"), setting->get().toString())); + connect(setting.get(), &Setting::SettingChanged,[&](const Setting &, QVariant value) + { + ENV.m_icons->directoryChanged(value.toString()); + }); +} + + +void moveFile(const QString &oldName, const QString &newName) +{ + QFile::remove(newName); + QFile::copy(oldName, newName); + QFile::remove(oldName); +} + + +void appDebugOutput(QtMsgType type, const QMessageLogContext &context, const QString &msg) +{ + const char *levels = "DWCF"; + const QString format("%1 %2 %3\n"); + + qint64 msecstotal = MMC->timeSinceStart(); + qint64 seconds = msecstotal / 1000; + qint64 msecs = msecstotal % 1000; + QString foo; + char buf[1025] = {0}; + ::snprintf(buf, 1024, "%5lld.%03lld", seconds, msecs); + + QString out = format.arg(buf).arg(levels[type]).arg(msg); + + MMC->logFile->write(out.toUtf8()); + MMC->logFile->flush(); + QTextStream(stderr) << out.toLocal8Bit(); + fflush(stderr); +} + +void MultiMC::initLogger() +{ + static const QString logBase = "MultiMC-%0.log"; + + moveFile(logBase.arg(3), logBase.arg(4)); + moveFile(logBase.arg(2), logBase.arg(3)); + moveFile(logBase.arg(1), logBase.arg(2)); + moveFile(logBase.arg(0), logBase.arg(1)); + + qInstallMessageHandler(appDebugOutput); + + logFile = std::make_shared(logBase.arg(0)); + logFile->open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Truncate); +} + +void MultiMC::initGlobalSettings(bool test_mode) +{ + m_settings.reset(new INISettingsObject("multimc.cfg", this)); + // Updates + m_settings->registerSetting("UpdateChannel", BuildConfig.VERSION_CHANNEL); + m_settings->registerSetting("AutoUpdate", true); + m_settings->registerSetting("IconTheme", QString("multimc")); + + // Notifications + m_settings->registerSetting("ShownNotifications", QString()); + + // Remembered state + m_settings->registerSetting("LastUsedGroupForNewInstance", QString()); + + QString defaultMonospace; + int defaultSize = 11; +#ifdef Q_OS_WIN32 + defaultMonospace = "Courier"; + defaultSize = 10; +#elif defined(Q_OS_MAC) + defaultMonospace = "Menlo"; +#else + defaultMonospace = "Monospace"; +#endif + if(!test_mode) + { + // resolve the font so the default actually matches + QFont consoleFont; + consoleFont.setFamily(defaultMonospace); + consoleFont.setStyleHint(QFont::Monospace); + consoleFont.setFixedPitch(true); + QFontInfo consoleFontInfo(consoleFont); + QString resolvedDefaultMonospace = consoleFontInfo.family(); + QFont resolvedFont(resolvedDefaultMonospace); + qDebug() << "Detected default console font:" << resolvedDefaultMonospace + << ", substitutions:" << resolvedFont.substitutions().join(','); + m_settings->registerSetting("ConsoleFont", resolvedDefaultMonospace); + } + else + { + // in test mode, we don't have UI, so we don't do any font resolving + m_settings->registerSetting("ConsoleFont", defaultMonospace); + } + m_settings->registerSetting("ConsoleFontSize", defaultSize); + + FTBPlugin::initialize(m_settings); + + // Folders + m_settings->registerSetting("InstanceDir", "instances"); + m_settings->registerSetting({"CentralModsDir", "ModsDir"}, "mods"); + m_settings->registerSetting({"LWJGLDir", "LwjglDir"}, "lwjgl"); + m_settings->registerSetting("IconsDir", "icons"); + + // Editors + m_settings->registerSetting("JsonEditor", QString()); + + // Language + m_settings->registerSetting("Language", QLocale(QLocale::system().language()).bcp47Name()); + + // Console + m_settings->registerSetting("ShowConsole", true); + m_settings->registerSetting("RaiseConsole", true); + m_settings->registerSetting("AutoCloseConsole", true); + m_settings->registerSetting("LogPrePostOutput", true); + + // Console Colors + // m_settings->registerSetting("SysMessageColor", QColor(Qt::blue)); + // m_settings->registerSetting("StdOutColor", QColor(Qt::black)); + // m_settings->registerSetting("StdErrColor", QColor(Qt::red)); + + // Window Size + m_settings->registerSetting({"LaunchMaximized", "MCWindowMaximize"}, false); + m_settings->registerSetting({"MinecraftWinWidth", "MCWindowWidth"}, 854); + m_settings->registerSetting({"MinecraftWinHeight", "MCWindowHeight"}, 480); + + // Proxy Settings + m_settings->registerSetting("ProxyType", "None"); + m_settings->registerSetting({"ProxyAddr", "ProxyHostName"}, "127.0.0.1"); + m_settings->registerSetting("ProxyPort", 8080); + m_settings->registerSetting({"ProxyUser", "ProxyUsername"}, ""); + m_settings->registerSetting({"ProxyPass", "ProxyPassword"}, ""); + + // Memory + m_settings->registerSetting({"MinMemAlloc", "MinMemoryAlloc"}, 512); + m_settings->registerSetting({"MaxMemAlloc", "MaxMemoryAlloc"}, 1024); + m_settings->registerSetting("PermGen", 128); + + // Java Settings + m_settings->registerSetting("JavaPath", ""); + m_settings->registerSetting("LastHostname", ""); + m_settings->registerSetting("JavaDetectionHack", ""); + m_settings->registerSetting("JvmArgs", ""); + + // Custom Commands + m_settings->registerSetting({"PreLaunchCommand", "PreLaunchCmd"}, ""); + m_settings->registerSetting({"PostExitCommand", "PostExitCmd"}, ""); + + // The cat + m_settings->registerSetting("TheCat", false); + + m_settings->registerSetting("InstSortMode", "Name"); + m_settings->registerSetting("SelectedInstance", QString()); + + // Window state and geometry + m_settings->registerSetting("MainWindowState", ""); + m_settings->registerSetting("MainWindowGeometry", ""); + + m_settings->registerSetting("ConsoleWindowState", ""); + m_settings->registerSetting("ConsoleWindowGeometry", ""); + + m_settings->registerSetting("SettingsGeometry", ""); + + m_settings->registerSetting("PagedGeometry", ""); +} + +std::shared_ptr MultiMC::lwjgllist() +{ + if (!m_lwjgllist) + { + m_lwjgllist.reset(new LWJGLVersionList()); + ENV.registerVersionList("org.lwjgl.legacy", m_lwjgllist); + } + return m_lwjgllist; +} + +std::shared_ptr MultiMC::forgelist() +{ + if (!m_forgelist) + { + m_forgelist.reset(new ForgeVersionList()); + ENV.registerVersionList("net.minecraftforge", m_forgelist); + } + return m_forgelist; +} + +std::shared_ptr MultiMC::liteloaderlist() +{ + if (!m_liteloaderlist) + { + m_liteloaderlist.reset(new LiteLoaderVersionList()); + ENV.registerVersionList("com.mumfrey.liteloader", m_liteloaderlist); + } + return m_liteloaderlist; +} + +std::shared_ptr MultiMC::minecraftlist() +{ + if (!m_minecraftlist) + { + m_minecraftlist.reset(new MinecraftVersionList()); + ENV.registerVersionList("net.minecraft", m_minecraftlist); + } + return m_minecraftlist; +} + +std::shared_ptr MultiMC::javalist() +{ + if (!m_javalist) + { + m_javalist.reset(new JavaVersionList()); + ENV.registerVersionList("com.java", m_javalist); + } + return m_javalist; +} + +void MultiMC::installUpdates(const QString updateFilesDir, UpdateFlags flags) +{ + // if we are going to update on exit, save the params now + if (flags & OnExit) + { + m_updateOnExitPath = updateFilesDir; + m_updateOnExitFlags = flags & ~OnExit; + return; + } + // otherwise if there already were some params for on exit update, clear them and continue + else if (m_updateOnExitPath.size()) + { + m_updateOnExitFlags = None; + m_updateOnExitPath.clear(); + } + qDebug() << "Installing updates."; +#ifdef WINDOWS + QString finishCmd = applicationFilePath(); + QString updaterBinary = PathCombine(applicationDirPath(), "updater.exe"); +#elif LINUX + QString finishCmd = PathCombine(root(), "MultiMC"); + QString updaterBinary = PathCombine(applicationDirPath(), "updater"); +#elif OSX + QString finishCmd = applicationFilePath(); + QString updaterBinary = PathCombine(applicationDirPath(), "updater"); +#else +#error Unsupported operating system. +#endif + + QStringList args; + // ./updater --install-dir $INSTALL_DIR --package-dir $UPDATEFILES_DIR --script + // $UPDATEFILES_DIR/file_list.xml --wait $PID --mode main + args << "--install-dir" << root(); + args << "--package-dir" << updateFilesDir; + args << "--script" << PathCombine(updateFilesDir, "file_list.xml"); + args << "--wait" << QString::number(applicationPid()); + if (flags & DryRun) + args << "--dry-run"; + if (flags & RestartOnFinish) + { + args << "--finish-cmd" << finishCmd; + args << "--finish-dir" << dataPath; + } + qDebug() << "Running updater with command" << updaterBinary << args.join(" "); + QFile::setPermissions(updaterBinary, (QFileDevice::Permission)0x7755); + + if (!QProcess::startDetached(updaterBinary, args /*, root()*/)) + { + qCritical() << "Failed to start the updater process!"; + return; + } + + ENV.destroy(); + // Now that we've started the updater, quit MultiMC. + quit(); +} + +void MultiMC::setIconTheme(const QString& name) +{ + XdgIcon::setThemeName(name); +} + +QIcon MultiMC::getThemedIcon(const QString& name) +{ + return XdgIcon::fromTheme(name); +} + +void MultiMC::onExit() +{ + if(m_instances) + { + m_instances->saveGroupList(); + } + if (m_updateOnExitPath.size()) + { + installUpdates(m_updateOnExitPath, m_updateOnExitFlags); + } + ENV.destroy(); + if(logFile) + { + logFile->flush(); + logFile->close(); + } +} + +bool MultiMC::openJsonEditor(const QString &filename) +{ + const QString file = QDir::current().absoluteFilePath(filename); + if (m_settings->get("JsonEditor").toString().isEmpty()) + { + return QDesktopServices::openUrl(QUrl::fromLocalFile(file)); + } + else + { + return QProcess::startDetached(m_settings->get("JsonEditor").toString(), QStringList() + << file); + } +} + +#include "MultiMC.moc" diff --git a/application/MultiMC.h b/application/MultiMC.h new file mode 100644 index 00000000..b78bbbd2 --- /dev/null +++ b/application/MultiMC.h @@ -0,0 +1,188 @@ +#pragma once + +#include +#include +#include +#include +#include +#include + +class QFile; +class MinecraftVersionList; +class LWJGLVersionList; +class HttpMetaCache; +class SettingsObject; +class InstanceList; +class MojangAccountList; +class IconList; +class QNetworkAccessManager; +class ForgeVersionList; +class LiteLoaderVersionList; +class JavaVersionList; +class UpdateChecker; +class BaseProfilerFactory; +class BaseDetachedToolFactory; +class TranslationDownloader; + +#if defined(MMC) +#undef MMC +#endif +#define MMC (static_cast(QCoreApplication::instance())) + +enum UpdateFlag +{ + None = 0x0, + RestartOnFinish = 0x1, + DryRun = 0x2, + OnExit = 0x4 +}; +Q_DECLARE_FLAGS(UpdateFlags, UpdateFlag); +Q_DECLARE_OPERATORS_FOR_FLAGS(UpdateFlags); + +class MultiMC : public QApplication +{ + // friends for the purpose of limiting access to deprecated stuff + friend class MultiMCPage; + friend class MainWindow; + Q_OBJECT +public: + enum Status + { + Failed, + Succeeded, + Initialized + }; + +public: + MultiMC(int &argc, char **argv, bool test_mode = false); + virtual ~MultiMC(); + + // InstanceList, IconList, OneSixFTBInstance, LegacyUpdate, LegacyInstance, MCEditTool, JVisualVM, MinecraftInstance, JProfiler, BaseInstance + std::shared_ptr settings() + { + return m_settings; + } + + qint64 timeSinceStart() const + { + return startTime.msecsTo(QDateTime::currentDateTime()); + } + + QIcon getThemedIcon(const QString& name); + + void setIconTheme(const QString& name); + + // DownloadUpdateTask + std::shared_ptr updateChecker() + { + return m_updateChecker; + } + + std::shared_ptr minecraftlist(); + std::shared_ptr lwjgllist(); + std::shared_ptr forgelist(); + std::shared_ptr liteloaderlist(); + std::shared_ptr javalist(); + + // APPLICATION ONLY + std::shared_ptr instances() + { + return m_instances; + } + + // APPLICATION ONLY + std::shared_ptr accounts() + { + return m_accounts; + } + + // APPLICATION ONLY + Status status() + { + return m_status; + } + + // APPLICATION ONLY + QMap> profilers() + { + return m_profilers; + } + + // APPLICATION ONLY + QMap> tools() + { + return m_tools; + } + + // APPLICATION ONLY + void installUpdates(const QString updateFilesDir, UpdateFlags flags = None); + + /*! + * Opens a json file using either a system default editor, or, if note empty, the editor + * specified in the settings + */ + bool openJsonEditor(const QString &filename); + +protected: /* to be removed! */ + // FIXME: remove. used by MultiMCPage to enumerate translations. + /// this is the static data. it stores things that don't move. + const QString &staticData() + { + return staticDataPath; + } + + // FIXME: remove. used by MainWindow to create application update tasks + /// this is the root of the 'installation'. Used for automatic updates + const QString &root() + { + return rootPath; + } + +private slots: + /** + * Do all the things that should be done before we exit + */ + void onExit(); + +private: + void initLogger(); + + void initIcons(); + + void initGlobalSettings(bool test_mode); + + void initTranslations(); + +private: + friend class UpdateCheckerTest; + friend class DownloadTaskTest; + + QDateTime startTime; + + std::shared_ptr m_qt_translator; + std::shared_ptr m_mmc_translator; + std::shared_ptr m_settings; + std::shared_ptr m_instances; + std::shared_ptr m_updateChecker; + std::shared_ptr m_accounts; + std::shared_ptr m_lwjgllist; + std::shared_ptr m_forgelist; + std::shared_ptr m_liteloaderlist; + std::shared_ptr m_minecraftlist; + std::shared_ptr m_javalist; + std::shared_ptr m_translationChecker; + + QMap> m_profilers; + QMap> m_tools; + + QString m_updateOnExitPath; + UpdateFlags m_updateOnExitFlags = None; + + QString rootPath; + QString staticDataPath; + QString dataPath; + + Status m_status = MultiMC::Failed; +public: + std::shared_ptr logFile; +}; diff --git a/application/NagUtils.cpp b/application/NagUtils.cpp new file mode 100644 index 00000000..41e2f63e --- /dev/null +++ b/application/NagUtils.cpp @@ -0,0 +1,38 @@ +/* Copyright 2013-2015 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "NagUtils.h" +#include "dialogs/CustomMessageBox.h" + +namespace NagUtils +{ +void checkJVMArgs(QString jvmargs, QWidget *parent) +{ + if (jvmargs.contains("-XX:PermSize=") || jvmargs.contains(QRegExp("-Xm[sx]"))) + { + CustomMessageBox::selectable( + parent, QObject::tr("JVM arguments warning"), + QObject::tr("You tried to manually set a JVM memory option (using " + " \"-XX:PermSize\", \"-Xmx\" or \"-Xms\") - there" + " are dedicated boxes for these in the settings (Java" + " tab, in the Memory group at the top).\n" + "Your manual settings will be overridden by the" + " dedicated options.\n" + "This message will be displayed until you remove them" + " from the JVM arguments."), + QMessageBox::Warning)->exec(); + } +} +} diff --git a/application/NagUtils.h b/application/NagUtils.h new file mode 100644 index 00000000..d757703a --- /dev/null +++ b/application/NagUtils.h @@ -0,0 +1,23 @@ +/* Copyright 2013-2015 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +namespace NagUtils +{ +void checkJVMArgs(QString args, QWidget *parent); +} diff --git a/application/Platform.h b/application/Platform.h new file mode 100644 index 00000000..349e5ecc --- /dev/null +++ b/application/Platform.h @@ -0,0 +1,32 @@ +/* Copyright 2013-2015 MultiMC Contributors + * + * Authors: Orochimarufan + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +/** + * @file Platform.h + * This file contains platform-specific functions, tweaks and fixes. + */ + +#include + +class MultiMCPlatform +{ +public: + // X11 WM_CLASS + static void fixWM_CLASS(QWidget *widget); +}; diff --git a/application/Platform_Other.cpp b/application/Platform_Other.cpp new file mode 100644 index 00000000..7eaf91d4 --- /dev/null +++ b/application/Platform_Other.cpp @@ -0,0 +1,27 @@ +/* Copyright 2013-2015 MultiMC Contributors + * + * Authors: Orochimarufan + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +/** + * Stub for non-X11 platforms + * @brief MultiMCPlatform::fixWM_CLASS + * @param widget + */ +void MultiMCPlatform::fixWM_CLASS(QWidget *widget) +{ + Q_UNUSED(widget); +} diff --git a/application/Platform_X11.cpp b/application/Platform_X11.cpp new file mode 100644 index 00000000..baca15dd --- /dev/null +++ b/application/Platform_X11.cpp @@ -0,0 +1,62 @@ +/* Copyright 2013-2015 MultiMC Contributors + * + * Authors: Orochimarufan + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include + +static QByteArray WM_CLASS = "MultiMC5\0MultiMC5"; + +template +static inline unsigned int XcbCallVoid(xcb_void_cookie_t (*func)(xcb_connection_t *, ArgTypes...), ArgTypes2... args...) +{ + return func(QX11Info::connection(), args...).sequence; +} + +static void getAtoms(size_t n, xcb_atom_t *atoms, const char *const names[], bool create) +{ + xcb_connection_t *conn = QX11Info::connection(); + xcb_intern_atom_cookie_t *cookies = (xcb_intern_atom_cookie_t *)malloc(sizeof(xcb_intern_atom_cookie_t) * 2); + for (size_t i = 0; i < n; ++i) + cookies[i] = xcb_intern_atom(conn, create, strlen(names[i]), names[i]); + memset(atoms, 0, sizeof(xcb_atom_t) * n); + for (size_t i = 0; i < n; ++i) + { + xcb_intern_atom_reply_t *r = xcb_intern_atom_reply(conn, cookies[i], 0); + if (r) + { + atoms[i] = r->atom; + free(r); + } + } + free(cookies); +} + +static inline xcb_atom_t getAtom(const char *name, bool create=false) +{ + xcb_atom_t atom; + getAtoms(1, &atom, &name, create); + return atom; +} + +void MultiMCPlatform::fixWM_CLASS(QWidget *widget) +{ + static const xcb_atom_t atom = getAtom("WM_CLASS"); + XcbCallVoid(xcb_change_property, XCB_PROP_MODE_REPLACE, + widget->winId(), atom, XCB_ATOM_STRING, 8, WM_CLASS.count(), + WM_CLASS.constData()); +} diff --git a/application/dialogs/AboutDialog.cpp b/application/dialogs/AboutDialog.cpp new file mode 100644 index 00000000..abcc76f2 --- /dev/null +++ b/application/dialogs/AboutDialog.cpp @@ -0,0 +1,127 @@ +/* Copyright 2013-2015 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "AboutDialog.h" +#include "ui_AboutDialog.h" +#include +#include "MultiMC.h" +#include "Platform.h" +#include "BuildConfig.h" + +#include + +// Credits +// This is a hack, but I can't think of a better way to do this easily without screwing with QTextDocument... +QString getCreditsHtml(QStringList patrons) +{ + QString creditsHtml = QObject::tr( + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "

MultiMC Developers

" + "

Andrew Okin <forkk@forkk.net>

" + "

Petr Mrázek <peterix@gmail.com>

" + "

Sky Welch <multimc@bunnies.io>

" + "

Jan (02JanDal) <02jandal@gmail.com>

" + "" + "

With thanks to

" + "

Orochimarufan <orochimarufan.x3@gmail.com>

" + "

TakSuyu <taksuyu@gmail.com>

" + "

Kilobyte <stiepen22@gmx.de>

" + "

Robotbrain <@skylordelros>

" + "

Rootbear75 <@rootbear75> (build server)

" + "" + "

Patreon Patrons

" + "%1" + "" + "" + ""); + if (patrons.isEmpty()) + return creditsHtml.arg(QObject::tr("

Loading...

")); + else + { + QString patronsStr; + for (QString patron : patrons) + { + patronsStr.append(QString("

%1

").arg(patron)); + } + + return creditsHtml.arg(patronsStr); + } +} + +AboutDialog::AboutDialog(QWidget *parent) : QDialog(parent), ui(new Ui::AboutDialog) +{ + MultiMCPlatform::fixWM_CLASS(this); + ui->setupUi(this); + + QString chtml = getCreditsHtml(QStringList()); + ui->creditsText->setHtml(chtml); + + ui->urlLabel->setOpenExternalLinks(true); + + ui->icon->setPixmap(MMC->getThemedIcon("multimc").pixmap(64)); + ui->title->setText("MultiMC 5"); + + ui->versionLabel->setText(tr("Version") +": " + BuildConfig.printableVersionString()); + ui->platformLabel->setText(tr("Platform") +": " + BuildConfig.BUILD_PLATFORM); + + if (BuildConfig.VERSION_BUILD >= 0) + ui->buildNumLabel->setText(tr("Build Number") +": " + QString::number(BuildConfig.VERSION_BUILD)); + else + ui->buildNumLabel->setVisible(false); + + if (!BuildConfig.VERSION_CHANNEL.isEmpty()) + ui->channelLabel->setText(tr("Channel") +": " + BuildConfig.VERSION_CHANNEL); + else + ui->channelLabel->setVisible(false); + + connect(ui->closeButton, SIGNAL(clicked()), SLOT(close())); + + connect(ui->aboutQt, &QPushButton::clicked, &QApplication::aboutQt); + + loadPatronList(); +} + +AboutDialog::~AboutDialog() +{ + delete ui; +} + +void AboutDialog::loadPatronList() +{ + NetJob* job = new NetJob("Patreon Patron List"); + patronListDownload = ByteArrayDownload::make(QUrl("http://files.multimc.org/patrons.txt")); + job->addNetAction(patronListDownload); + connect(job, &NetJob::succeeded, this, &AboutDialog::patronListLoaded); + job->start(); +} + +void AboutDialog::patronListLoaded() +{ + QString patronListStr(patronListDownload->m_data); + QString html = getCreditsHtml(patronListStr.split("\n", QString::SkipEmptyParts)); + ui->creditsText->setHtml(html); +} + diff --git a/application/dialogs/AboutDialog.h b/application/dialogs/AboutDialog.h new file mode 100644 index 00000000..1885e9c0 --- /dev/null +++ b/application/dialogs/AboutDialog.h @@ -0,0 +1,47 @@ +/* Copyright 2013-2015 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#include + +namespace Ui +{ +class AboutDialog; +} + +class AboutDialog : public QDialog +{ + Q_OBJECT + +public: + explicit AboutDialog(QWidget *parent = 0); + ~AboutDialog(); + +public +slots: + /// Starts loading a list of Patreon patrons. + void loadPatronList(); + + /// Slot for when the patron list loads successfully. + void patronListLoaded(); + +private: + Ui::AboutDialog *ui; + + ByteArrayDownloadPtr patronListDownload; +}; diff --git a/application/dialogs/AboutDialog.ui b/application/dialogs/AboutDialog.ui new file mode 100644 index 00000000..2b5f8b78 --- /dev/null +++ b/application/dialogs/AboutDialog.ui @@ -0,0 +1,544 @@ + + + AboutDialog + + + + 0 + 0 + 707 + 593 + + + + + 450 + 400 + + + + About MultiMC + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 64 + 64 + + + + + 64 + 64 + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + 15 + + + + MultiMC 5 + + + Qt::AlignCenter + + + + + + + 0 + + + + + 0 + 0 + 695 + 297 + + + + About + + + + + + Version: + + + Qt::AlignCenter + + + + + + + Platform: + + + Qt::AlignCenter + + + + + + + Build Number: + + + Qt::AlignCenter + + + + + + + Channel: + + + Qt::AlignCenter + + + + + + + true + + + <html><head/><body><p>MultiMC is a custom launcher that makes managing Minecraft easier by allowing you to have multiple instances of Minecraft at once.</p></body></html> + + + Qt::AlignCenter + + + true + + + + + + + + 8 + true + + + + © 2013-2015 MultiMC Contributors + + + Qt::AlignCenter + + + + + + + + 10 + + + + <html><head/><body><p><a href="http://github.com/MultiMC/MultiMC5"><span style=" text-decoration: underline; color:#0000ff;">http://github.com/MultiMC/MultiMC5</span></a></p></body></html> + + + Qt::AlignCenter + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + 0 + 0 + 695 + 297 + + + + Credits + + + + + + true + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Oxygen-Sans'; font-size:11pt; font-weight:400; font-style:normal;"> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif'; font-size:9pt;"><br /></p></body></html> + + + Qt::TextBrowserInteraction + + + + + + + No Language file loaded. + + + true + + + + + + + + + 0 + 0 + 695 + 297 + + + + License + + + + + + + 0 + 0 + + + + + DejaVu Sans Mono + + + + true + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'DejaVu Sans Mono'; font-size:11pt; font-weight:400; font-style:normal;"> +<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Bitstream Vera Sans'; font-size:18pt; font-weight:600;">MultiMC</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">Copyright 2012-2014 MultiMC Contributors</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">you may not use this file except in compliance with the License.</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">You may obtain a copy of the License at</span></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10pt;"><br /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;"> http://www.apache.org/licenses/LICENSE-2.0</span></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10pt;"><br /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">Unless required by applicable law or agreed to in writing, software</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">See the License for the specific language governing permissions and</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">limitations under the License.</span></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10pt;"><br /></p> +<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Bitstream Vera Sans'; font-size:18pt; font-weight:600;">QSLog</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">Copyright (c) 2010, Razvan Petru</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">All rights reserved.</span></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"><br /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">Redistribution and use in source and binary forms, with or without modification,</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">are permitted provided that the following conditions are met:</span></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"><br /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">* Redistributions of source code must retain the above copyright notice, this</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> list of conditions and the following disclaimer.</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">* Redistributions in binary form must reproduce the above copyright notice, this</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> list of conditions and the following disclaimer in the documentation and/or other</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> materials provided with the distribution.</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">* The name of the contributors may not be used to endorse or promote products</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> derived from this software without specific prior written permission.</span></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"><br /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &quot;AS IS&quot; AND</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">OF THE POSSIBILITY OF SUCH DAMAGE.</span></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"><br /></p> +<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Bitstream Vera Sans'; font-size:18pt; font-weight:600;">Group View (instance view)</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> /*</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> * Copyright (C) 2007 Rafael Fernández López &lt;ereslibre@kde.org&gt;</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> * Copyright (C) 2007 John Tapsell &lt;tapsell@kde.org&gt;</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> *</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> * This library is free software; you can redistribute it and/or</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> * modify it under the terms of the GNU Library General Public</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> * License as published by the Free Software Foundation; either</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> * version 2 of the License, or (at your option) any later version.</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> *</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> * This library is distributed in the hope that it will be useful,</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> * Library General Public License for more details.</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> *</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> * You should have received a copy of the GNU Library General Public License</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> * along with this library; see the file COPYING.LIB. If not, write to</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> * Boston, MA 02110-1301, USA.</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> */</span></p> +<p align="center" style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"><br /></p> +<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Bitstream Vera Sans'; font-size:18pt; font-weight:600;">Batch icon set</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">You are free to use Batch (the &quot;icon set&quot;) or any part thereof (the &quot;icons&quot;)</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">in any personal, open-source or commercial work without obligation of payment</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">(monetary or otherwise) or attribution. Do not sell the icon set, host</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">the icon set or rent the icon set (either in existing or modified form).</span></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"><br /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">While attribution is optional, it is always appreciated.</span></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"><br /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">Intellectual property rights are not transferred with the download of the icons.</span></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"><br /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL ADAM WHITCROFT</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL,</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THE USE OF THE ICONS,</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.</span></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10pt;"><br /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://adamwhitcroft.com/batch/"><span style=" text-decoration: underline; color:#68a0df;">http://adamwhitcroft.com/batch/</span></a></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10pt;"><br /></p> +<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Bitstream Vera Sans'; font-size:18pt; font-weight:600;">Pack200</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">The GNU General Public License (GPL)</span></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"><br /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">Version 2, June 1991</span></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"><br /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">+ &quot;CLASSPATH&quot; EXCEPTION TO THE GPL</span></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"><br /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">Certain source files distributed by Oracle America and/or its affiliates are</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">subject to the following clarification and special exception to the GPL, but</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">only where Oracle has expressly included in the particular source file's header</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">the words &quot;Oracle designates this particular file as subject to the &quot;Classpath&quot;</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">exception as provided by Oracle in the LICENSE file that accompanied this code.&quot;</span></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"><br /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> Linking this library statically or dynamically with other modules is making</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> a combined work based on this library. Thus, the terms and conditions of</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> the GNU General Public License cover the whole combination.</span></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"><br /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> As a special exception, the copyright holders of this library give you</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> permission to link this library with independent modules to produce an</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> executable, regardless of the license terms of these independent modules,</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> and to copy and distribute the resulting executable under terms of your</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> choice, provided that you also meet, for each linked independent module,</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> the terms and conditions of the license of that module. An independent</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> module is a module which is not derived from or based on this library. If</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> you modify this library, you may extend this exception to your version of</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> the library, but you are not obligated to do so. If you do not wish to do</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> so, delete this exception statement from your version.</span></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"><br /></p> +<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Bitstream Vera Sans'; font-size:18pt; font-weight:600;">Quazip</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">Copyright (C) 2005-2011 Sergey A. Tachenov</span></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"><br /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">This program is free software; you can redistribute it and/or modify it</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">under the terms of the GNU Lesser General Public License as published by</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">the Free Software Foundation; either version 2 of the License, or (at</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">your option) any later version.</span></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"><br /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">This program is distributed in the hope that it will be useful, but</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">WITHOUT ANY WARRANTY; without even the implied warranty of</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">General Public License for more details.</span></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"><br /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">You should have received a copy of the GNU Lesser General Public License</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">along with this program; if not, write to the Free Software Foundation,</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA</span></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"><br /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">See COPYING file for the full LGPL text.</span></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"><br /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">Original ZIP package is copyrighted by Gilles Vollant, see</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">quazip/(un)zip.h files for details, basically it's zlib license.</span></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"><br /></p> +<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Bitstream Vera Sans'; font-size:18pt; font-weight:600;">xz-minidec</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">/*</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> * XZ decompressor</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> *</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> * Authors: Lasse Collin &lt;lasse.collin@tukaani.org&gt;</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> * Igor Pavlov &lt;http://7-zip.org/&gt;</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> *</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> * This file has been put into the public domain.</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> * You can do whatever you want with this file.</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> */</span></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"><br /></p> +<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Bitstream Vera Sans'; font-size:18pt; font-weight:600;">Java IconLoader class</span></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">Copyright (c) 2011, Chris Molini</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">All rights reserved.</span></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"><br /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">Redistribution and use in source and binary forms, with or without</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">modification, are permitted provided that the following conditions are met:</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> * Redistributions of source code must retain the above copyright</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> notice, this list of conditions and the following disclaimer.</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> * Redistributions in binary form must reproduce the above copyright</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> notice, this list of conditions and the following disclaimer in the</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> documentation and/or other materials provided with the distribution.</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> * Neither the name of the &lt;organization&gt; nor the</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> names of its contributors may be used to endorse or promote products</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> derived from this software without specific prior written permission.</span></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"><br /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &quot;AS IS&quot; AND</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">DISCLAIMED. IN NO EVENT SHALL &lt;COPYRIGHT HOLDER&gt; BE LIABLE FOR ANY</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</span></p> +<p align="center" style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"><br /></p> +<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Bitstream Vera Sans'; font-size:18pt; font-weight:600;">ColumnResizer</span></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"><br /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">/*</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> * Copyright 2011 Aurélien Gâteau &lt;agateau@kde.org&gt;</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> * License: LGPL v2.1 or later (see COPYING)</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> */</span></p></body></html> + + + Qt::TextBrowserInteraction + + + + + + + + + 0 + 0 + 695 + 297 + + + + Forking/Redistribution + + + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Oxygen-Sans'; font-size:11pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Bitstream Vera Sans';">We keep MultiMC open source because we think it's important to be able to see the source code for a project like this, and we do so using the Apache license.</span></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Bitstream Vera Sans';"><br /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Bitstream Vera Sans';">Part of the reason for using the Apache license is we don't want people using the &quot;MultiMC&quot; name when redistributing the project. This means people must take the time to go through the source code and remove all references to &quot;MultiMC&quot;, including but not limited to the project icon and the title of windows, (no *MultiMC-fork* in the title).</span></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Bitstream Vera Sans';"><br /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Bitstream Vera Sans';">The Apache license covers reasonable use for the name - a mention of the project's origins in the About dialog and the license is acceptable. However, it should be abundantly clear that the project is a fork </span><span style=" font-family:'Bitstream Vera Sans'; font-weight:600;">without</span><span style=" font-family:'Bitstream Vera Sans';"> implying that you have our blessing.</span></p></body></html> + + + Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + + + + + + + + + + + + + false + + + About Qt + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Close + + + + + + + + + + + + diff --git a/application/dialogs/AccountSelectDialog.cpp b/application/dialogs/AccountSelectDialog.cpp new file mode 100644 index 00000000..3bf83d62 --- /dev/null +++ b/application/dialogs/AccountSelectDialog.cpp @@ -0,0 +1,85 @@ +/* Copyright 2013-2015 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "AccountSelectDialog.h" +#include "ui_AccountSelectDialog.h" + +#include + +#include + +#include + +#include + +AccountSelectDialog::AccountSelectDialog(const QString &message, int flags, QWidget *parent) + : QDialog(parent), ui(new Ui::AccountSelectDialog) +{ + ui->setupUi(this); + + m_accounts = MMC->accounts(); + ui->listView->setModel(m_accounts.get()); + ui->listView->hideColumn(MojangAccountList::ActiveColumn); + + // Set the message label. + ui->msgLabel->setVisible(!message.isEmpty()); + ui->msgLabel->setText(message); + + // Flags... + ui->globalDefaultCheck->setVisible(flags & GlobalDefaultCheckbox); + ui->instDefaultCheck->setVisible(flags & InstanceDefaultCheckbox); + qDebug() << flags; + + // Select the first entry in the list. + ui->listView->setCurrentIndex(ui->listView->model()->index(0, 0)); + + connect(ui->listView, SIGNAL(doubleClicked(QModelIndex)), SLOT(on_buttonBox_accepted())); +} + +AccountSelectDialog::~AccountSelectDialog() +{ + delete ui; +} + +MojangAccountPtr AccountSelectDialog::selectedAccount() const +{ + return m_selected; +} + +bool AccountSelectDialog::useAsGlobalDefault() const +{ + return ui->globalDefaultCheck->isChecked(); +} + +bool AccountSelectDialog::useAsInstDefaullt() const +{ + return ui->instDefaultCheck->isChecked(); +} + +void AccountSelectDialog::on_buttonBox_accepted() +{ + QModelIndexList selection = ui->listView->selectionModel()->selectedIndexes(); + if (selection.size() > 0) + { + QModelIndex selected = selection.first(); + m_selected = selected.data(MojangAccountList::PointerRole).value(); + } + close(); +} + +void AccountSelectDialog::on_buttonBox_rejected() +{ + close(); +} diff --git a/application/dialogs/AccountSelectDialog.h b/application/dialogs/AccountSelectDialog.h new file mode 100644 index 00000000..21784032 --- /dev/null +++ b/application/dialogs/AccountSelectDialog.h @@ -0,0 +1,90 @@ +/* Copyright 2013-2015 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#include + +#include "auth/MojangAccountList.h" + +namespace Ui +{ +class AccountSelectDialog; +} + +class AccountSelectDialog : public QDialog +{ + Q_OBJECT +public: + enum Flags + { + NoFlags = 0, + + /*! + * Shows a check box on the dialog that allows the user to specify that the account + * they've selected should be used as the global default for all instances. + */ + GlobalDefaultCheckbox, + + /*! + * Shows a check box on the dialog that allows the user to specify that the account + * they've selected should be used as the default for the instance they are currently launching. + * This is not currently implemented. + */ + InstanceDefaultCheckbox, + }; + + /*! + * Constructs a new account select dialog with the given parent and message. + * The message will be shown at the top of the dialog. It is an empty string by default. + */ + explicit AccountSelectDialog(const QString& message="", int flags=0, QWidget *parent = 0); + ~AccountSelectDialog(); + + /*! + * Gets a pointer to the account that the user selected. + * This is null if the user clicked cancel or hasn't clicked OK yet. + */ + MojangAccountPtr selectedAccount() const; + + /*! + * Returns true if the user checked the "use as global default" checkbox. + * If the checkbox wasn't shown, this function returns false. + */ + bool useAsGlobalDefault() const; + + /*! + * Returns true if the user checked the "use as instance default" checkbox. + * If the checkbox wasn't shown, this function returns false. + */ + bool useAsInstDefaullt() const; + +public +slots: + void on_buttonBox_accepted(); + + void on_buttonBox_rejected(); + +protected: + std::shared_ptr m_accounts; + + //! The account that was selected when the user clicked OK. + MojangAccountPtr m_selected; + +private: + Ui::AccountSelectDialog *ui; +}; diff --git a/application/dialogs/AccountSelectDialog.ui b/application/dialogs/AccountSelectDialog.ui new file mode 100644 index 00000000..7af1512a --- /dev/null +++ b/application/dialogs/AccountSelectDialog.ui @@ -0,0 +1,56 @@ + + + AccountSelectDialog + + + + 0 + 0 + 413 + 300 + + + + Select an Account + + + + + + Select an account. + + + + + + + + + + + + Use as default? + + + + + + + Use as default for this instance only? + + + + + + + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + diff --git a/application/dialogs/CopyInstanceDialog.cpp b/application/dialogs/CopyInstanceDialog.cpp new file mode 100644 index 00000000..7c98978b --- /dev/null +++ b/application/dialogs/CopyInstanceDialog.cpp @@ -0,0 +1,101 @@ +/* Copyright 2013-2015 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +#include "MultiMC.h" +#include "CopyInstanceDialog.h" +#include "ui_CopyInstanceDialog.h" + +#include "Platform.h" +#include "dialogs/VersionSelectDialog.h" +#include "dialogs/ProgressDialog.h" +#include "dialogs/IconPickerDialog.h" + +#include "BaseVersion.h" +#include "icons/IconList.h" +#include "tasks/Task.h" +#include "BaseInstance.h" +#include "InstanceList.h" + +CopyInstanceDialog::CopyInstanceDialog(InstancePtr original, QWidget *parent) + :QDialog(parent), ui(new Ui::CopyInstanceDialog), m_original(original) +{ + MultiMCPlatform::fixWM_CLASS(this); + ui->setupUi(this); + resize(minimumSizeHint()); + layout()->setSizeConstraint(QLayout::SetFixedSize); + + InstIconKey = original->iconKey(); + ui->iconButton->setIcon(ENV.icons()->getIcon(InstIconKey)); + ui->instNameTextBox->setText(original->name()); + ui->instNameTextBox->setFocus(); + auto groups = MMC->instances()->getGroups().toSet(); + auto groupList = QStringList(groups.toList()); + groupList.sort(Qt::CaseInsensitive); + groupList.removeOne(""); + groupList.push_front(""); + ui->groupBox->addItems(groupList); + int index = groupList.indexOf(m_original->group()); + if(index == -1) + { + index = 0; + } + ui->groupBox->setCurrentIndex(index); + ui->groupBox->lineEdit()->setPlaceholderText(tr("No group")); +} + +CopyInstanceDialog::~CopyInstanceDialog() +{ + delete ui; +} + +void CopyInstanceDialog::updateDialogState() +{ + ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(!instName().isEmpty()); +} + +QString CopyInstanceDialog::instName() const +{ + return ui->instNameTextBox->text(); +} + +QString CopyInstanceDialog::iconKey() const +{ + return InstIconKey; +} + +QString CopyInstanceDialog::instGroup() const +{ + return ui->groupBox->currentText(); +} + +void CopyInstanceDialog::on_iconButton_clicked() +{ + IconPickerDialog dlg(this); + dlg.exec(InstIconKey); + + if (dlg.result() == QDialog::Accepted) + { + InstIconKey = dlg.selectedIconKey; + ui->iconButton->setIcon(ENV.icons()->getIcon(InstIconKey)); + } +} + +void CopyInstanceDialog::on_instNameTextBox_textChanged(const QString &arg1) +{ + updateDialogState(); +} diff --git a/application/dialogs/CopyInstanceDialog.h b/application/dialogs/CopyInstanceDialog.h new file mode 100644 index 00000000..faa20615 --- /dev/null +++ b/application/dialogs/CopyInstanceDialog.h @@ -0,0 +1,52 @@ +/* Copyright 2013-2015 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include "BaseVersion.h" +#include + +class BaseInstance; + +namespace Ui +{ +class CopyInstanceDialog; +} + +class CopyInstanceDialog : public QDialog +{ + Q_OBJECT + +public: + explicit CopyInstanceDialog(InstancePtr original, QWidget *parent = 0); + ~CopyInstanceDialog(); + + void updateDialogState(); + + QString instName() const; + QString instGroup() const; + QString iconKey() const; + +private +slots: + void on_iconButton_clicked(); + void on_instNameTextBox_textChanged(const QString &arg1); + +private: + Ui::CopyInstanceDialog *ui; + QString InstIconKey; + InstancePtr m_original; +}; diff --git a/application/dialogs/CopyInstanceDialog.ui b/application/dialogs/CopyInstanceDialog.ui new file mode 100644 index 00000000..2615168c --- /dev/null +++ b/application/dialogs/CopyInstanceDialog.ui @@ -0,0 +1,161 @@ + + + CopyInstanceDialog + + + Qt::ApplicationModal + + + + 0 + 0 + 345 + 205 + + + + Copy Instance + + + + :/icons/toolbar/copy:/icons/toolbar/copy + + + true + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + :/icons/instances/infinity:/icons/instances/infinity + + + + 80 + 80 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + Name + + + + + + + Qt::Horizontal + + + + + + + + + Group + + + groupBox + + + + + + + + 0 + 0 + + + + true + + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + + + + buttonBox + accepted() + CopyInstanceDialog + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + CopyInstanceDialog + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/application/dialogs/CustomMessageBox.cpp b/application/dialogs/CustomMessageBox.cpp new file mode 100644 index 00000000..0fb5bd19 --- /dev/null +++ b/application/dialogs/CustomMessageBox.cpp @@ -0,0 +1,35 @@ +/* Copyright 2013-2015 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "CustomMessageBox.h" + +namespace CustomMessageBox +{ +QMessageBox *selectable(QWidget *parent, const QString &title, const QString &text, + QMessageBox::Icon icon, QMessageBox::StandardButtons buttons, + QMessageBox::StandardButton defaultButton) +{ + QMessageBox *messageBox = new QMessageBox(parent); + messageBox->setWindowTitle(title); + messageBox->setText(text); + messageBox->setStandardButtons(buttons); + messageBox->setDefaultButton(defaultButton); + messageBox->setTextInteractionFlags(Qt::TextSelectableByMouse); + messageBox->setIcon(icon); + messageBox->setTextInteractionFlags(Qt::TextBrowserInteraction); + + return messageBox; +} +} diff --git a/application/dialogs/CustomMessageBox.h b/application/dialogs/CustomMessageBox.h new file mode 100644 index 00000000..0a7202d7 --- /dev/null +++ b/application/dialogs/CustomMessageBox.h @@ -0,0 +1,26 @@ +/* Copyright 2013-2015 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +namespace CustomMessageBox +{ +QMessageBox *selectable(QWidget *parent, const QString &title, const QString &text, + QMessageBox::Icon icon = QMessageBox::NoIcon, + QMessageBox::StandardButtons buttons = QMessageBox::Ok, + QMessageBox::StandardButton defaultButton = QMessageBox::NoButton); +} diff --git a/application/dialogs/EditAccountDialog.cpp b/application/dialogs/EditAccountDialog.cpp new file mode 100644 index 00000000..b78cebee --- /dev/null +++ b/application/dialogs/EditAccountDialog.cpp @@ -0,0 +1,51 @@ +/* Copyright 2013-2015 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "EditAccountDialog.h" +#include "ui_EditAccountDialog.h" +#include +#include + +EditAccountDialog::EditAccountDialog(const QString &text, QWidget *parent, int flags) + : QDialog(parent), ui(new Ui::EditAccountDialog) +{ + ui->setupUi(this); + + ui->label->setText(text); + ui->label->setVisible(!text.isEmpty()); + + ui->userTextBox->setVisible(flags & UsernameField); + ui->passTextBox->setVisible(flags & PasswordField); +} + +EditAccountDialog::~EditAccountDialog() +{ + delete ui; +} + +void EditAccountDialog::on_label_linkActivated(const QString &link) +{ + QDesktopServices::openUrl(QUrl(link)); +} + +QString EditAccountDialog::username() const +{ + return ui->userTextBox->text(); +} + +QString EditAccountDialog::password() const +{ + return ui->passTextBox->text(); +} diff --git a/application/dialogs/EditAccountDialog.h b/application/dialogs/EditAccountDialog.h new file mode 100644 index 00000000..df8b21bf --- /dev/null +++ b/application/dialogs/EditAccountDialog.h @@ -0,0 +1,60 @@ +/* Copyright 2013-2015 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +namespace Ui +{ +class EditAccountDialog; +} + +class EditAccountDialog : public QDialog +{ + Q_OBJECT + +public: + explicit EditAccountDialog(const QString &text = "", QWidget *parent = 0, + int flags = UsernameField | PasswordField); + ~EditAccountDialog(); + + /*! + * Gets the text entered in the dialog's username field. + */ + QString username() const; + + /*! + * Gets the text entered in the dialog's password field. + */ + QString password() const; + + enum Flags + { + NoFlags = 0, + + //! Specifies that the dialog should have a username field. + UsernameField, + + //! Specifies that the dialog should have a password field. + PasswordField, + }; + +private slots: + void on_label_linkActivated(const QString &link); + +private: + Ui::EditAccountDialog *ui; +}; diff --git a/application/dialogs/EditAccountDialog.ui b/application/dialogs/EditAccountDialog.ui new file mode 100644 index 00000000..5f727bd4 --- /dev/null +++ b/application/dialogs/EditAccountDialog.ui @@ -0,0 +1,94 @@ + + + EditAccountDialog + + + + 0 + 0 + 400 + 148 + + + + Edit Account + + + + + + Message label placeholder. + + + Qt::RichText + + + Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + + + + + + + Email / Username + + + + + + + QLineEdit::Password + + + Password + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + + buttonBox + accepted() + EditAccountDialog + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + EditAccountDialog + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/application/dialogs/IconPickerDialog.cpp b/application/dialogs/IconPickerDialog.cpp new file mode 100644 index 00000000..cafd47b7 --- /dev/null +++ b/application/dialogs/IconPickerDialog.cpp @@ -0,0 +1,156 @@ +/* Copyright 2013-2015 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include + +#include "MultiMC.h" + +#include "IconPickerDialog.h" +#include "ui_IconPickerDialog.h" + +#include "Platform.h" +#include "groupview/InstanceDelegate.h" + +#include "icons/IconList.h" + +IconPickerDialog::IconPickerDialog(QWidget *parent) + : QDialog(parent), ui(new Ui::IconPickerDialog) +{ + MultiMCPlatform::fixWM_CLASS(this); + ui->setupUi(this); + setWindowModality(Qt::WindowModal); + + auto contentsWidget = ui->iconView; + contentsWidget->setViewMode(QListView::IconMode); + contentsWidget->setFlow(QListView::LeftToRight); + contentsWidget->setIconSize(QSize(48, 48)); + contentsWidget->setMovement(QListView::Static); + contentsWidget->setResizeMode(QListView::Adjust); + contentsWidget->setSelectionMode(QAbstractItemView::SingleSelection); + contentsWidget->setSpacing(5); + contentsWidget->setWordWrap(false); + contentsWidget->setWrapping(true); + contentsWidget->setUniformItemSizes(true); + contentsWidget->setTextElideMode(Qt::ElideRight); + contentsWidget->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel); + contentsWidget->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn); + contentsWidget->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + contentsWidget->setItemDelegate(new ListViewDelegate()); + + // contentsWidget->setAcceptDrops(true); + contentsWidget->setDropIndicatorShown(true); + contentsWidget->viewport()->setAcceptDrops(true); + contentsWidget->setDragDropMode(QAbstractItemView::DropOnly); + contentsWidget->setDefaultDropAction(Qt::CopyAction); + + contentsWidget->installEventFilter(this); + + contentsWidget->setModel(ENV.icons().get()); + + auto buttonAdd = ui->buttonBox->addButton(tr("Add Icon"), QDialogButtonBox::ResetRole); + auto buttonRemove = + ui->buttonBox->addButton(tr("Remove Icon"), QDialogButtonBox::ResetRole); + + connect(buttonAdd, SIGNAL(clicked(bool)), SLOT(addNewIcon())); + connect(buttonRemove, SIGNAL(clicked(bool)), SLOT(removeSelectedIcon())); + + connect(contentsWidget, SIGNAL(doubleClicked(QModelIndex)), SLOT(activated(QModelIndex))); + + connect(contentsWidget->selectionModel(), + SIGNAL(selectionChanged(QItemSelection, QItemSelection)), + SLOT(selectionChanged(QItemSelection, QItemSelection))); +} +bool IconPickerDialog::eventFilter(QObject *obj, QEvent *evt) +{ + if (obj != ui->iconView) + return QDialog::eventFilter(obj, evt); + if (evt->type() != QEvent::KeyPress) + { + return QDialog::eventFilter(obj, evt); + } + QKeyEvent *keyEvent = static_cast(evt); + switch (keyEvent->key()) + { + case Qt::Key_Delete: + removeSelectedIcon(); + return true; + case Qt::Key_Plus: + addNewIcon(); + return true; + default: + break; + } + return QDialog::eventFilter(obj, evt); +} + +void IconPickerDialog::addNewIcon() +{ + //: The title of the select icons open file dialog + QString selectIcons = tr("Select Icons"); + //: The type of icon files + QStringList fileNames = QFileDialog::getOpenFileNames(this, selectIcons, QString(), + tr("Icons") + "(*.png *.jpg *.jpeg *.ico)"); + ENV.icons()->installIcons(fileNames); +} + +void IconPickerDialog::removeSelectedIcon() +{ + ENV.icons()->deleteIcon(selectedIconKey); +} + +void IconPickerDialog::activated(QModelIndex index) +{ + selectedIconKey = index.data(Qt::UserRole).toString(); + accept(); +} + +void IconPickerDialog::selectionChanged(QItemSelection selected, QItemSelection deselected) +{ + if (selected.empty()) + return; + + QString key = selected.first().indexes().first().data(Qt::UserRole).toString(); + if (!key.isEmpty()) + selectedIconKey = key; +} + +int IconPickerDialog::exec(QString selection) +{ + auto list = ENV.icons(); + auto contentsWidget = ui->iconView; + selectedIconKey = selection; + + int index_nr = list->getIconIndex(selection); + auto model_index = list->index(index_nr); + contentsWidget->selectionModel()->select( + model_index, QItemSelectionModel::Current | QItemSelectionModel::Select); + + QMetaObject::invokeMethod(this, "delayed_scroll", Qt::QueuedConnection, + Q_ARG(QModelIndex, model_index)); + return QDialog::exec(); +} + +void IconPickerDialog::delayed_scroll(QModelIndex model_index) +{ + auto contentsWidget = ui->iconView; + contentsWidget->scrollTo(model_index); +} + +IconPickerDialog::~IconPickerDialog() +{ + delete ui; +} diff --git a/application/dialogs/IconPickerDialog.h b/application/dialogs/IconPickerDialog.h new file mode 100644 index 00000000..610d9306 --- /dev/null +++ b/application/dialogs/IconPickerDialog.h @@ -0,0 +1,48 @@ +/* Copyright 2013-2015 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once +#include +#include + +namespace Ui +{ +class IconPickerDialog; +} + +class IconPickerDialog : public QDialog +{ + Q_OBJECT + +public: + explicit IconPickerDialog(QWidget *parent = 0); + ~IconPickerDialog(); + int exec(QString selection); + QString selectedIconKey; + +protected: + virtual bool eventFilter(QObject *, QEvent *); + +private: + Ui::IconPickerDialog *ui; + +private +slots: + void selectionChanged(QItemSelection, QItemSelection); + void activated(QModelIndex); + void delayed_scroll(QModelIndex); + void addNewIcon(); + void removeSelectedIcon(); +}; diff --git a/application/dialogs/IconPickerDialog.ui b/application/dialogs/IconPickerDialog.ui new file mode 100644 index 00000000..c548edfb --- /dev/null +++ b/application/dialogs/IconPickerDialog.ui @@ -0,0 +1,67 @@ + + + IconPickerDialog + + + + 0 + 0 + 676 + 555 + + + + Pick icon + + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + + buttonBox + accepted() + IconPickerDialog + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + IconPickerDialog + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/application/dialogs/LoginDialog.cpp b/application/dialogs/LoginDialog.cpp new file mode 100644 index 00000000..3af5c702 --- /dev/null +++ b/application/dialogs/LoginDialog.cpp @@ -0,0 +1,110 @@ +/* Copyright 2013-2015 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "LoginDialog.h" +#include "ui_LoginDialog.h" + +#include "auth/YggdrasilTask.h" + +#include + +LoginDialog::LoginDialog(QWidget *parent) : QDialog(parent), ui(new Ui::LoginDialog) +{ + ui->setupUi(this); + ui->progressBar->setVisible(false); + ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false); + + connect(ui->buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept); + connect(ui->buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject); +} + +LoginDialog::~LoginDialog() +{ + delete ui; +} + +// Stage 1: User interaction +void LoginDialog::accept() +{ + setUserInputsEnabled(false); + ui->progressBar->setVisible(true); + + // Setup the login task and start it + m_account = MojangAccount::createFromUsername(ui->userTextBox->text()); + m_loginTask = m_account->login(nullptr, ui->passTextBox->text()); + connect(m_loginTask.get(), &ProgressProvider::failed, this, &LoginDialog::onTaskFailed); + connect(m_loginTask.get(), &ProgressProvider::succeeded, this, + &LoginDialog::onTaskSucceeded); + connect(m_loginTask.get(), &ProgressProvider::status, this, &LoginDialog::onTaskStatus); + connect(m_loginTask.get(), &ProgressProvider::progress, this, &LoginDialog::onTaskProgress); + m_loginTask->start(); +} + +void LoginDialog::setUserInputsEnabled(bool enable) +{ + ui->userTextBox->setEnabled(enable); + ui->passTextBox->setEnabled(enable); + ui->buttonBox->setEnabled(enable); +} + +// Enable the OK button only when both textboxes contain something. +void LoginDialog::on_userTextBox_textEdited(const QString &newText) +{ + ui->buttonBox->button(QDialogButtonBox::Ok) + ->setEnabled(!newText.isEmpty() && !ui->passTextBox->text().isEmpty()); +} +void LoginDialog::on_passTextBox_textEdited(const QString &newText) +{ + ui->buttonBox->button(QDialogButtonBox::Ok) + ->setEnabled(!newText.isEmpty() && !ui->userTextBox->text().isEmpty()); +} + +void LoginDialog::onTaskFailed(const QString &reason) +{ + // Set message + ui->label->setText("" + reason + ""); + + // Re-enable user-interaction + setUserInputsEnabled(true); + ui->progressBar->setVisible(false); +} + +void LoginDialog::onTaskSucceeded() +{ + QDialog::accept(); +} + +void LoginDialog::onTaskStatus(const QString &status) +{ + ui->label->setText(status); +} + +void LoginDialog::onTaskProgress(qint64 current, qint64 total) +{ + ui->progressBar->setMaximum(total); + ui->progressBar->setValue(current); +} + +// Public interface +MojangAccountPtr LoginDialog::newAccount(QWidget *parent, QString msg) +{ + LoginDialog dlg(parent); + dlg.ui->label->setText(msg); + if (dlg.exec() == QDialog::Accepted) + { + return dlg.m_account; + } + return 0; +} diff --git a/application/dialogs/LoginDialog.h b/application/dialogs/LoginDialog.h new file mode 100644 index 00000000..63c95fb8 --- /dev/null +++ b/application/dialogs/LoginDialog.h @@ -0,0 +1,58 @@ +/* Copyright 2013-2015 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include + +#include "auth/MojangAccount.h" + +namespace Ui +{ +class LoginDialog; +} + +class LoginDialog : public QDialog +{ + Q_OBJECT + +public: + ~LoginDialog(); + + static MojangAccountPtr newAccount(QWidget *parent, QString message); + +private: + explicit LoginDialog(QWidget *parent = 0); + + void setUserInputsEnabled(bool enable); + +protected +slots: + void accept(); + + void onTaskFailed(const QString &reason); + void onTaskSucceeded(); + void onTaskStatus(const QString &status); + void onTaskProgress(qint64 current, qint64 total); + + void on_userTextBox_textEdited(const QString &newText); + void on_passTextBox_textEdited(const QString &newText); + +private: + Ui::LoginDialog *ui; + MojangAccountPtr m_account; + std::shared_ptr m_loginTask; +}; diff --git a/application/dialogs/LoginDialog.ui b/application/dialogs/LoginDialog.ui new file mode 100644 index 00000000..b24b1c0c --- /dev/null +++ b/application/dialogs/LoginDialog.ui @@ -0,0 +1,77 @@ + + + LoginDialog + + + + 0 + 0 + 400 + 162 + + + + + 0 + 0 + + + + Add Account + + + + + + Message label placeholder. + + + Qt::RichText + + + Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + + + + + + + Email / Username + + + + + + + QLineEdit::Password + + + Password + + + + + + + 24 + + + false + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + diff --git a/application/dialogs/ModEditDialogCommon.cpp b/application/dialogs/ModEditDialogCommon.cpp new file mode 100644 index 00000000..4a2115d8 --- /dev/null +++ b/application/dialogs/ModEditDialogCommon.cpp @@ -0,0 +1,40 @@ +#include "ModEditDialogCommon.h" +#include "CustomMessageBox.h" +#include + +bool lastfirst(QModelIndexList &list, int &first, int &last) +{ + if (list.isEmpty()) + return false; + first = last = list[0].row(); + for (auto item : list) + { + int row = item.row(); + if (row < first) + first = row; + if (row > last) + last = row; + } + return true; +} + +void showWebsiteForMod(QWidget *parentDlg, Mod &m) +{ + QString url = m.homeurl(); + if (url.size()) + { + // catch the cases where the protocol is missing + if (!url.startsWith("http")) + { + url = "http://" + url; + } + QDesktopServices::openUrl(url); + } + else + { + CustomMessageBox::selectable( + parentDlg, QObject::tr("How sad!"), + QObject::tr("The mod author didn't provide a website link for this mod."), + QMessageBox::Warning); + } +} diff --git a/application/dialogs/ModEditDialogCommon.h b/application/dialogs/ModEditDialogCommon.h new file mode 100644 index 00000000..e2afb98a --- /dev/null +++ b/application/dialogs/ModEditDialogCommon.h @@ -0,0 +1,9 @@ +#pragma once +#include +#include +#include +#include + +bool lastfirst(QModelIndexList &list, int &first, int &last); + +void showWebsiteForMod(QWidget *parentDlg, Mod &m); diff --git a/application/dialogs/NewInstanceDialog.cpp b/application/dialogs/NewInstanceDialog.cpp new file mode 100644 index 00000000..b3aa805b --- /dev/null +++ b/application/dialogs/NewInstanceDialog.cpp @@ -0,0 +1,207 @@ +/* Copyright 2013-2015 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "MultiMC.h" +#include "NewInstanceDialog.h" +#include "ui_NewInstanceDialog.h" + +#include +#include +#include +#include +#include + +#include "Platform.h" +#include "VersionSelectDialog.h" +#include "ProgressDialog.h" +#include "IconPickerDialog.h" + +#include +#include +#include +#include + +class UrlValidator : public QValidator +{ +public: + using QValidator::QValidator; + + State validate(QString &in, int &pos) const + { + const QUrl url(in); + if (url.isValid() && !url.isRelative() && !url.isEmpty()) + { + return Acceptable; + } + else if (QFile::exists(in)) + { + return Acceptable; + } + else + { + return Intermediate; + } + } +}; + +NewInstanceDialog::NewInstanceDialog(QWidget *parent) + : QDialog(parent), ui(new Ui::NewInstanceDialog) +{ + MultiMCPlatform::fixWM_CLASS(this); + ui->setupUi(this); + resize(minimumSizeHint()); + layout()->setSizeConstraint(QLayout::SetFixedSize); + + setSelectedVersion(MMC->minecraftlist()->getLatestStable(), true); + InstIconKey = "infinity"; + ui->iconButton->setIcon(ENV.icons()->getIcon(InstIconKey)); + + ui->modpackEdit->setValidator(new UrlValidator(ui->modpackEdit)); + connect(ui->modpackEdit, &QLineEdit::textChanged, this, &NewInstanceDialog::updateDialogState); + connect(ui->modpackBox, &QRadioButton::clicked, this, &NewInstanceDialog::updateDialogState); + connect(ui->versionBox, &QRadioButton::clicked, this, &NewInstanceDialog::updateDialogState); + + auto groups = MMC->instances()->getGroups().toSet(); + auto groupList = QStringList(groups.toList()); + groupList.sort(Qt::CaseInsensitive); + groupList.removeOne(""); + QString oldValue = MMC->settings()->get("LastUsedGroupForNewInstance").toString(); + groupList.push_front(oldValue); + groupList.push_front(""); + ui->groupBox->addItems(groupList); + int index = groupList.indexOf(oldValue); + if(index == -1) + { + index = 0; + } + ui->groupBox->setCurrentIndex(index); + ui->groupBox->lineEdit()->setPlaceholderText(tr("No group")); +} + +NewInstanceDialog::~NewInstanceDialog() +{ + delete ui; +} + +void NewInstanceDialog::updateDialogState() +{ + bool allowOK = !instName().isEmpty() && + (ui->versionBox->isChecked() && m_selectedVersion || + (ui->modpackBox->isChecked() && ui->modpackEdit->hasAcceptableInput())); + ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(allowOK); +} + +void NewInstanceDialog::setSelectedVersion(BaseVersionPtr version, bool initial) +{ + m_selectedVersion = version; + + if (m_selectedVersion) + { + ui->versionTextBox->setText(version->name()); + if(ui->instNameTextBox->text().isEmpty() && !initial) + { + ui->instNameTextBox->setText(version->name()); + } + } + else + { + ui->versionTextBox->setText(""); + } + + updateDialogState(); +} + +QString NewInstanceDialog::instName() const +{ + return ui->instNameTextBox->text(); +} +QString NewInstanceDialog::instGroup() const +{ + return ui->groupBox->currentText(); +} +QString NewInstanceDialog::iconKey() const +{ + return InstIconKey; +} +QUrl NewInstanceDialog::modpackUrl() const +{ + if (ui->modpackBox->isChecked()) + { + const QUrl url(ui->modpackEdit->text()); + if (url.isValid() && !url.isRelative() && !url.host().isEmpty()) + { + return url; + } + else + { + return QUrl::fromLocalFile(ui->modpackEdit->text()); + } + } + else + { + return QUrl(); + } +} + +BaseVersionPtr NewInstanceDialog::selectedVersion() const +{ + return m_selectedVersion; +} + +void NewInstanceDialog::on_btnChangeVersion_clicked() +{ + VersionSelectDialog vselect(MMC->minecraftlist().get(), tr("Change Minecraft version"), + this); + vselect.exec(); + if (vselect.result() == QDialog::Accepted) + { + BaseVersionPtr version = vselect.selectedVersion(); + if (version) + setSelectedVersion(version); + } +} + +void NewInstanceDialog::on_iconButton_clicked() +{ + IconPickerDialog dlg(this); + dlg.exec(InstIconKey); + + if (dlg.result() == QDialog::Accepted) + { + InstIconKey = dlg.selectedIconKey; + ui->iconButton->setIcon(ENV.icons()->getIcon(InstIconKey)); + } +} + +void NewInstanceDialog::on_instNameTextBox_textChanged(const QString &arg1) +{ + updateDialogState(); +} + +void NewInstanceDialog::on_modpackBtn_clicked() +{ + const QUrl url = QFileDialog::getOpenFileUrl(this, tr("Choose modpack"), modpackUrl(), tr("Zip (*.zip)")); + if (url.isValid()) + { + if (url.isLocalFile()) + { + ui->modpackEdit->setText(url.toLocalFile()); + } + else + { + ui->modpackEdit->setText(url.toString()); + } + } +} diff --git a/application/dialogs/NewInstanceDialog.h b/application/dialogs/NewInstanceDialog.h new file mode 100644 index 00000000..bc3152b9 --- /dev/null +++ b/application/dialogs/NewInstanceDialog.h @@ -0,0 +1,59 @@ +/* Copyright 2013-2015 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#include "BaseVersion.h" + +namespace Ui +{ +class NewInstanceDialog; +} + +class NewInstanceDialog : public QDialog +{ + Q_OBJECT + +public: + explicit NewInstanceDialog(QWidget *parent = 0); + ~NewInstanceDialog(); + + void updateDialogState(); + + void setSelectedVersion(BaseVersionPtr version, bool initial = false); + + void loadVersionList(); + + QString instName() const; + QString instGroup() const; + QString iconKey() const; + QUrl modpackUrl() const; + BaseVersionPtr selectedVersion() const; + +private +slots: + void on_btnChangeVersion_clicked(); + void on_iconButton_clicked(); + void on_modpackBtn_clicked(); + void on_instNameTextBox_textChanged(const QString &arg1); + +private: + Ui::NewInstanceDialog *ui; + + BaseVersionPtr m_selectedVersion; + QString InstIconKey; +}; diff --git a/application/dialogs/NewInstanceDialog.ui b/application/dialogs/NewInstanceDialog.ui new file mode 100644 index 00000000..6cb0c97c --- /dev/null +++ b/application/dialogs/NewInstanceDialog.ui @@ -0,0 +1,309 @@ + + + NewInstanceDialog + + + Qt::ApplicationModal + + + + 0 + 0 + 277 + 404 + + + + New Instance + + + + :/icons/toolbar/new:/icons/toolbar/new + + + true + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + :/icons/instances/infinity:/icons/instances/infinity + + + + 80 + 80 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + Name + + + + + + + Qt::Horizontal + + + + + + + + + &Group: + + + groupBox + + + + + + + + 0 + 0 + + + + true + + + + + + + + + + + false + + + ... + + + + + + + false + + + http:// + + + + + + + true + + + + + + + ... + + + + + + + Impor&t Modpack (local file or link): + + + + + + + Vani&lla Minecraft (select version): + + + true + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + Qt::Horizontal + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + instNameTextBox + groupBox + versionBox + versionTextBox + btnChangeVersion + modpackBox + modpackEdit + modpackBtn + iconButton + + + + + buttonBox + accepted() + NewInstanceDialog + accept() + + + 257 + 333 + + + 157 + 274 + + + + + buttonBox + rejected() + NewInstanceDialog + reject() + + + 325 + 333 + + + 286 + 274 + + + + + modpackBox + toggled(bool) + modpackEdit + setEnabled(bool) + + + 81 + 229 + + + 236 + 221 + + + + + modpackBox + toggled(bool) + modpackBtn + setEnabled(bool) + + + 129 + 225 + + + 328 + 229 + + + + + versionBox + toggled(bool) + versionTextBox + setEnabled(bool) + + + 93 + 195 + + + 213 + 191 + + + + + versionBox + toggled(bool) + btnChangeVersion + setEnabled(bool) + + + 104 + 198 + + + 322 + 192 + + + + + diff --git a/application/dialogs/NotificationDialog.cpp b/application/dialogs/NotificationDialog.cpp new file mode 100644 index 00000000..8f920371 --- /dev/null +++ b/application/dialogs/NotificationDialog.cpp @@ -0,0 +1,84 @@ +#include "NotificationDialog.h" +#include "ui_NotificationDialog.h" + +#include + +NotificationDialog::NotificationDialog(const NotificationChecker::NotificationEntry &entry, QWidget *parent) : + QDialog(parent, Qt::MSWindowsFixedSizeDialogHint | Qt::WindowTitleHint | Qt::CustomizeWindowHint), + ui(new Ui::NotificationDialog) +{ + ui->setupUi(this); + + QStyle::StandardPixmap icon; + switch (entry.type) + { + case NotificationChecker::NotificationEntry::Critical: + icon = QStyle::SP_MessageBoxCritical; + break; + case NotificationChecker::NotificationEntry::Warning: + icon = QStyle::SP_MessageBoxWarning; + break; + case NotificationChecker::NotificationEntry::Information: + icon = QStyle::SP_MessageBoxInformation; + break; + } + ui->iconLabel->setPixmap(style()->standardPixmap(icon, 0, this)); + ui->messageLabel->setText(entry.message); + + m_dontShowAgainText = tr("Don't show again"); + m_closeText = tr("Close"); + + ui->dontShowAgainBtn->setText(m_dontShowAgainText + QString(" (%1)").arg(m_dontShowAgainTime)); + ui->closeBtn->setText(m_closeText + QString(" (%1)").arg(m_closeTime)); + + startTimer(1000); +} + +NotificationDialog::~NotificationDialog() +{ + delete ui; +} + +void NotificationDialog::timerEvent(QTimerEvent *event) +{ + if (m_dontShowAgainTime > 0) + { + m_dontShowAgainTime--; + if (m_dontShowAgainTime == 0) + { + ui->dontShowAgainBtn->setText(m_dontShowAgainText); + ui->dontShowAgainBtn->setEnabled(true); + } + else + { + ui->dontShowAgainBtn->setText(m_dontShowAgainText + QString(" (%1)").arg(m_dontShowAgainTime)); + } + } + if (m_closeTime > 0) + { + m_closeTime--; + if (m_closeTime == 0) + { + ui->closeBtn->setText(m_closeText); + ui->closeBtn->setEnabled(true); + } + else + { + ui->closeBtn->setText(m_closeText + QString(" (%1)").arg(m_closeTime)); + } + } + + if (m_closeTime == 0 && m_dontShowAgainTime == 0) + { + killTimer(event->timerId()); + } +} + +void NotificationDialog::on_dontShowAgainBtn_clicked() +{ + done(DontShowAgain); +} +void NotificationDialog::on_closeBtn_clicked() +{ + done(Normal); +} diff --git a/application/dialogs/NotificationDialog.h b/application/dialogs/NotificationDialog.h new file mode 100644 index 00000000..27b9e853 --- /dev/null +++ b/application/dialogs/NotificationDialog.h @@ -0,0 +1,44 @@ +#ifndef NOTIFICATIONDIALOG_H +#define NOTIFICATIONDIALOG_H + +#include + +#include "notifications/NotificationChecker.h" + +namespace Ui { +class NotificationDialog; +} + +class NotificationDialog : public QDialog +{ + Q_OBJECT + +public: + explicit NotificationDialog(const NotificationChecker::NotificationEntry &entry, QWidget *parent = 0); + ~NotificationDialog(); + + enum ExitCode + { + Normal, + DontShowAgain + }; + +protected: + void timerEvent(QTimerEvent *event); + +private: + Ui::NotificationDialog *ui; + + int m_dontShowAgainTime = 10; + int m_closeTime = 5; + + QString m_dontShowAgainText; + QString m_closeText; + +private +slots: + void on_dontShowAgainBtn_clicked(); + void on_closeBtn_clicked(); +}; + +#endif // NOTIFICATIONDIALOG_H diff --git a/application/dialogs/NotificationDialog.ui b/application/dialogs/NotificationDialog.ui new file mode 100644 index 00000000..a2a276e9 --- /dev/null +++ b/application/dialogs/NotificationDialog.ui @@ -0,0 +1,85 @@ + + + NotificationDialog + + + + 0 + 0 + 320 + 240 + + + + Dialog + + + + + + + + TextLabel + + + + + + + TextLabel + + + true + + + true + + + Qt::TextBrowserInteraction + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + false + + + Don't show again + + + + + + + false + + + Close + + + + + + + + + + diff --git a/application/dialogs/ProgressDialog.cpp b/application/dialogs/ProgressDialog.cpp new file mode 100644 index 00000000..61ebaa28 --- /dev/null +++ b/application/dialogs/ProgressDialog.cpp @@ -0,0 +1,125 @@ +/* Copyright 2013-2015 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "ProgressDialog.h" +#include "ui_ProgressDialog.h" + +#include + +#include "tasks/Task.h" +#include "Platform.h" + +ProgressDialog::ProgressDialog(QWidget *parent) : QDialog(parent), ui(new Ui::ProgressDialog) +{ + MultiMCPlatform::fixWM_CLASS(this); + ui->setupUi(this); + this->setWindowFlags(this->windowFlags() & ~Qt::WindowContextHelpButtonHint); + setSkipButton(false); + changeProgress(0, 100); +} + +void ProgressDialog::setSkipButton(bool present, QString label) +{ + ui->skipButton->setEnabled(present); + ui->skipButton->setVisible(present); + ui->skipButton->setText(label); + updateSize(); +} + +void ProgressDialog::on_skipButton_clicked(bool checked) +{ + Q_UNUSED(checked); + task->abort(); +} + +ProgressDialog::~ProgressDialog() +{ + delete ui; +} + +void ProgressDialog::updateSize() +{ + resize(QSize(480, minimumSizeHint().height())); +} + +int ProgressDialog::exec(ProgressProvider *task) +{ + this->task = task; + + // Connect signals. + connect(task, SIGNAL(started()), SLOT(onTaskStarted())); + connect(task, SIGNAL(failed(QString)), SLOT(onTaskFailed(QString))); + connect(task, SIGNAL(succeeded()), SLOT(onTaskSucceeded())); + connect(task, SIGNAL(status(QString)), SLOT(changeStatus(const QString &))); + connect(task, SIGNAL(progress(qint64, qint64)), SLOT(changeProgress(qint64, qint64))); + + // if this didn't connect to an already running task, invoke start + if(!task->isRunning()) + task->start(); + if(task->isRunning()) + return QDialog::exec(); + else + return QDialog::Accepted; +} + +ProgressProvider *ProgressDialog::getTask() +{ + return task; +} + +void ProgressDialog::onTaskStarted() +{ +} + +void ProgressDialog::onTaskFailed(QString failure) +{ + reject(); +} + +void ProgressDialog::onTaskSucceeded() +{ + accept(); +} + +void ProgressDialog::changeStatus(const QString &status) +{ + ui->statusLabel->setText(status); + updateSize(); +} + +void ProgressDialog::changeProgress(qint64 current, qint64 total) +{ + ui->taskProgressBar->setMaximum(total); + ui->taskProgressBar->setValue(current); +} + +void ProgressDialog::keyPressEvent(QKeyEvent *e) +{ + if (e->key() == Qt::Key_Escape) + return; + QDialog::keyPressEvent(e); +} + +void ProgressDialog::closeEvent(QCloseEvent *e) +{ + if (task && task->isRunning()) + { + e->ignore(); + } + else + { + QDialog::closeEvent(e); + } +} diff --git a/application/dialogs/ProgressDialog.h b/application/dialogs/ProgressDialog.h new file mode 100644 index 00000000..d5153680 --- /dev/null +++ b/application/dialogs/ProgressDialog.h @@ -0,0 +1,65 @@ +/* Copyright 2013-2015 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +class ProgressProvider; + +namespace Ui +{ +class ProgressDialog; +} + +class ProgressDialog : public QDialog +{ + Q_OBJECT + +public: + explicit ProgressDialog(QWidget *parent = 0); + ~ProgressDialog(); + + void updateSize(); + + int exec(ProgressProvider *task); + + void setSkipButton(bool present, QString label = QString()); + + ProgressProvider *getTask(); + +public +slots: + void onTaskStarted(); + void onTaskFailed(QString failure); + void onTaskSucceeded(); + + void changeStatus(const QString &status); + void changeProgress(qint64 current, qint64 total); + + +private +slots: + void on_skipButton_clicked(bool checked); + +protected: + virtual void keyPressEvent(QKeyEvent *e); + virtual void closeEvent(QCloseEvent *e); + +private: + Ui::ProgressDialog *ui; + + ProgressProvider *task; +}; diff --git a/application/dialogs/ProgressDialog.ui b/application/dialogs/ProgressDialog.ui new file mode 100644 index 00000000..04b8fef3 --- /dev/null +++ b/application/dialogs/ProgressDialog.ui @@ -0,0 +1,66 @@ + + + ProgressDialog + + + + 0 + 0 + 400 + 100 + + + + + 400 + 0 + + + + + 600 + 16777215 + + + + Please wait... + + + + + + Task Status... + + + true + + + + + + + 24 + + + false + + + + + + + + 0 + 0 + + + + Skip + + + + + + + + diff --git a/application/dialogs/UpdateDialog.cpp b/application/dialogs/UpdateDialog.cpp new file mode 100644 index 00000000..f7e0bcd6 --- /dev/null +++ b/application/dialogs/UpdateDialog.cpp @@ -0,0 +1,186 @@ +#include "UpdateDialog.h" +#include "ui_UpdateDialog.h" +#include "Platform.h" +#include +#include "MultiMC.h" +#include + +UpdateDialog::UpdateDialog(bool hasUpdate, QWidget *parent) : QDialog(parent), ui(new Ui::UpdateDialog) +{ + MultiMCPlatform::fixWM_CLASS(this); + ui->setupUi(this); + auto channel = MMC->settings()->get("UpdateChannel").toString(); + if(hasUpdate) + { + ui->label->setText(tr("A new %1 update is available!").arg(channel)); + } + else + { + ui->label->setText(tr("No %1 updates found. You are running the latest version.").arg(channel)); + ui->btnUpdateNow->setDisabled(true); + ui->btnUpdateOnExit->setDisabled(true); + } + loadChangelog(); +} + +UpdateDialog::~UpdateDialog() +{ +} + +void UpdateDialog::loadChangelog() +{ + auto channel = MMC->settings()->get("UpdateChannel").toString(); + dljob.reset(new NetJob("Changelog")); + auto url = QString("https://raw.githubusercontent.com/MultiMC/MultiMC5/%1/changelog.md").arg(channel); + changelogDownload = ByteArrayDownload::make(QUrl(url)); + dljob->addNetAction(changelogDownload); + connect(dljob.get(), &NetJob::succeeded, this, &UpdateDialog::changelogLoaded); + connect(dljob.get(), &NetJob::failed, this, &UpdateDialog::changelogFailed); + dljob->start(); +} + +// TODO: this will be replaced. +QString reprocessMarkdown(QString markdown) +{ + QString htmlData; + QTextStream html(&htmlData); + auto lines = markdown.split(QRegExp("[\r]?[\n]"),QString::KeepEmptyParts); + enum + { + BASE, + LIST1, + LIST2 + }state = BASE; + html << ""; + int i = 0; + auto procLine = [&](QString line) -> QString + { + // [GitHub issues](https://github.com/MultiMC/MultiMC5/issues) + line.replace(QRegExp("\\[([^\\]]+)\\]\\(([^\\)]+)\\)"), "\\1"); + return line; + }; + for(auto line: lines) + { + if(line.isEmpty()) + { + // html << "
\n"; + } + else switch (state) + { + case BASE: + if(line.startsWith("##")) + { + html << "

" << procLine(line.mid(2)) << "

\n"; + } + else if(line.startsWith("#")) + { + html << "

" << procLine(line.mid(1)) << "

\n"; + } + else if(line.startsWith("- ")) + { + state = LIST1; + html << "
    \n"; + html << "
  • " << procLine(line.mid(2)) << "
  • \n"; + } + else qCritical() << "Invalid input on line " << i << ": " << line; + break; + case LIST1: + if(line.startsWith("##")) + { + state = BASE; + html << "
\n"; + html << "

" << procLine(line.mid(2)) << "

\n"; + } + else if(line.startsWith("#")) + { + state = BASE; + html << "\n"; + html << "

" << procLine(line.mid(1)) << "

\n"; + } + else if(line.startsWith("- ")) + { + html << "
  • " << procLine(line.mid(2)) << "
  • \n"; + } + else if(line.startsWith(" - ")) + { + state = LIST2; + html << "
      \n"; + html << "
    • " << procLine(line.mid(4)) << "
    • \n"; + } + else qCritical() << "Invalid input on line " << i << ": " << line; + break; + case LIST2: + if(line.startsWith("##")) + { + state = BASE; + html << "
    \n"; + html << "\n"; + html << "

    " << procLine(line.mid(2)) << "

    \n"; + } + else if(line.startsWith("#")) + { + state = BASE; + html << "\n"; + html << "\n"; + html << "

    " << procLine(line.mid(1)) << "

    \n"; + } + else if(line.startsWith("- ")) + { + state = LIST1; + html << "\n"; + html << "
  • " << procLine(line.mid(2)) << "
  • \n"; + } + else if(line.startsWith(" - ")) + { + html << "
  • " << procLine(line.mid(4)) << "
  • \n"; + } + else qCritical() << "Invalid input on line " << i << ": " << line; + break; + } + i++; + } + if(state == LIST2) + { + html << "\n"; + state = LIST1; + } + if(state == LIST1) + { + html << "\n"; + state = BASE; + } + if (state != BASE) + { + qCritical() << "Reprocessing markdown didn't end in a final state!"; + } + html << "\n"; + qDebug() << htmlData; + return htmlData; +} + +void UpdateDialog::changelogLoaded() +{ + auto rawMarkdown = QString::fromUtf8(changelogDownload->m_data); + auto html = reprocessMarkdown(rawMarkdown); + ui->changelogBrowser->setHtml(html); +} + +void UpdateDialog::changelogFailed() +{ + ui->changelogBrowser->setHtml(tr("

    Failed to fetch changelog...

    ")); +} + +void UpdateDialog::on_btnUpdateLater_clicked() +{ + reject(); +} + +void UpdateDialog::on_btnUpdateNow_clicked() +{ + done(UPDATE_NOW); +} + +void UpdateDialog::on_btnUpdateOnExit_clicked() +{ + done(UPDATE_ONEXIT); +} diff --git a/application/dialogs/UpdateDialog.h b/application/dialogs/UpdateDialog.h new file mode 100644 index 00000000..2ab2ff7c --- /dev/null +++ b/application/dialogs/UpdateDialog.h @@ -0,0 +1,61 @@ +/* Copyright 2013-2015 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include "net/ByteArrayDownload.h" +#include "net/NetJob.h" + +namespace Ui +{ +class UpdateDialog; +} + +enum UpdateAction +{ + UPDATE_LATER = QDialog::Rejected, + UPDATE_NOW = QDialog::Accepted, + UPDATE_ONEXIT = 2 +}; + +class UpdateDialog : public QDialog +{ + Q_OBJECT + +public: + explicit UpdateDialog(bool hasUpdate = true, QWidget *parent = 0); + ~UpdateDialog(); + +private: + Ui::UpdateDialog *ui; +public slots: + void on_btnUpdateNow_clicked(); + void on_btnUpdateOnExit_clicked(); + void on_btnUpdateLater_clicked(); + + /// Starts loading the changelog + void loadChangelog(); + + /// Slot for when the chengelog loads successfully. + void changelogLoaded(); + + /// Slot for when the chengelog fails to load... + void changelogFailed(); + +private: + ByteArrayDownloadPtr changelogDownload; + NetJobPtr dljob; +}; diff --git a/application/dialogs/UpdateDialog.ui b/application/dialogs/UpdateDialog.ui new file mode 100644 index 00000000..06f4f086 --- /dev/null +++ b/application/dialogs/UpdateDialog.ui @@ -0,0 +1,106 @@ + + + UpdateDialog + + + + 0 + 0 + 657 + 673 + + + + MultiMC Update + + + + :/icons/toolbar/checkupdate:/icons/toolbar/checkupdate + + + + + + + + + 14 + + + + + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + changelogBrowser + + + + + + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Bitstream Vera Sans'; font-size:11pt; font-weight:400; font-style:normal;"> +<p align="center" style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:22pt;">Loading changelog...</span></p></body></html> + + + true + + + + + + + + + + 0 + 0 + + + + Update now + + + + + + + Update after MultiMC closes + + + + + + + + 0 + 0 + + + + Don't update yet + + + + + + + + + changelogBrowser + btnUpdateNow + btnUpdateOnExit + btnUpdateLater + + + + + + diff --git a/application/dialogs/VersionSelectDialog.cpp b/application/dialogs/VersionSelectDialog.cpp new file mode 100644 index 00000000..d1be4ad0 --- /dev/null +++ b/application/dialogs/VersionSelectDialog.cpp @@ -0,0 +1,177 @@ +/* Copyright 2013-2015 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "VersionSelectDialog.h" +#include "ui_VersionSelectDialog.h" + +#include + +#include +#include "Platform.h" + +#include +#include +#include +#include +#include + +class VersionSelectProxyModel : public QSortFilterProxyModel +{ + Q_OBJECT +public: + VersionSelectProxyModel(QObject *parent = 0) : QSortFilterProxyModel(parent) + { + } + + struct Filter + { + QString string; + bool exact = false; + }; + + QHash filters() const + { + return m_filters; + } + void setFilter(const int column, const QString &filter, const bool exact) + { + Filter f; + f.string = filter; + f.exact = exact; + m_filters[column] = f; + invalidateFilter(); + } + void clearFilters() + { + m_filters.clear(); + invalidateFilter(); + } + +protected: + bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const + { + for (auto it = m_filters.begin(); it != m_filters.end(); ++it) + { + const QString version = + sourceModel()->index(source_row, it.key()).data().toString(); + + if (it.value().exact) + { + if (version != it.value().string) + { + return false; + } + continue; + } + + if (!Util::versionIsInInterval(version, it.value().string)) + { + return false; + } + } + return true; + } + + QHash m_filters; +}; + +VersionSelectDialog::VersionSelectDialog(BaseVersionList *vlist, QString title, QWidget *parent, + bool cancelable) + : QDialog(parent), ui(new Ui::VersionSelectDialog) +{ + MultiMCPlatform::fixWM_CLASS(this); + ui->setupUi(this); + setWindowModality(Qt::WindowModal); + setWindowTitle(title); + + m_vlist = vlist; + + m_proxyModel = new VersionSelectProxyModel(this); + m_proxyModel->setSourceModel(vlist); + + ui->listView->setModel(m_proxyModel); + ui->listView->header()->setSectionResizeMode(QHeaderView::ResizeToContents); + ui->listView->header()->setSectionResizeMode(resizeOnColumn, QHeaderView::Stretch); + + if (!cancelable) + { + ui->buttonBox->button(QDialogButtonBox::Cancel)->setEnabled(false); + } +} + +void VersionSelectDialog::setEmptyString(QString emptyString) +{ + ui->listView->setEmptyString(emptyString); +} + +VersionSelectDialog::~VersionSelectDialog() +{ + delete ui; +} + +void VersionSelectDialog::setResizeOn(int column) +{ + ui->listView->header()->setSectionResizeMode(resizeOnColumn, QHeaderView::ResizeToContents); + resizeOnColumn = column; + ui->listView->header()->setSectionResizeMode(resizeOnColumn, QHeaderView::Stretch); +} + +int VersionSelectDialog::exec() +{ + QDialog::open(); + if (!m_vlist->isLoaded()) + { + loadList(); + } + m_proxyModel->invalidate(); + return QDialog::exec(); +} + +void VersionSelectDialog::loadList() +{ + Task *loadTask = m_vlist->getLoadTask(); + if (!loadTask) + { + return; + } + ProgressDialog *taskDlg = new ProgressDialog(this); + loadTask->setParent(taskDlg); + taskDlg->exec(loadTask); + delete taskDlg; +} + +BaseVersionPtr VersionSelectDialog::selectedVersion() const +{ + auto currentIndex = ui->listView->selectionModel()->currentIndex(); + auto variant = m_proxyModel->data(currentIndex, BaseVersionList::VersionPointerRole); + return variant.value(); +} + +void VersionSelectDialog::on_refreshButton_clicked() +{ + loadList(); +} + +void VersionSelectDialog::setExactFilter(int column, QString filter) +{ + m_proxyModel->setFilter(column, filter, true); +} + +void VersionSelectDialog::setFuzzyFilter(int column, QString filter) +{ + m_proxyModel->setFilter(column, filter, false); +} + +#include "VersionSelectDialog.moc" diff --git a/application/dialogs/VersionSelectDialog.h b/application/dialogs/VersionSelectDialog.h new file mode 100644 index 00000000..69e52fe6 --- /dev/null +++ b/application/dialogs/VersionSelectDialog.h @@ -0,0 +1,66 @@ +/* Copyright 2013-2015 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include + +#include "BaseVersion.h" + +class BaseVersionList; + +namespace Ui +{ +class VersionSelectDialog; +} + +class VersionSelectProxyModel; + +class VersionSelectDialog : public QDialog +{ + Q_OBJECT + +public: + explicit VersionSelectDialog(BaseVersionList *vlist, QString title, QWidget *parent = 0, + bool cancelable = true); + ~VersionSelectDialog(); + + virtual int exec(); + + //! Starts a task that loads the list. + void loadList(); + + BaseVersionPtr selectedVersion() const; + + void setFuzzyFilter(int column, QString filter); + void setExactFilter(int column, QString filter); + void setEmptyString(QString emptyString); + void setResizeOn(int column); + void setUseLatest(const bool useLatest); + +private +slots: + void on_refreshButton_clicked(); + +private: + Ui::VersionSelectDialog *ui; + + BaseVersionList *m_vlist; + + VersionSelectProxyModel *m_proxyModel; + + int resizeOnColumn = 0; +}; diff --git a/application/dialogs/VersionSelectDialog.ui b/application/dialogs/VersionSelectDialog.ui new file mode 100644 index 00000000..e4014e11 --- /dev/null +++ b/application/dialogs/VersionSelectDialog.ui @@ -0,0 +1,110 @@ + + + VersionSelectDialog + + + + 0 + 0 + 400 + 347 + + + + Choose Version + + + + + + Qt::ScrollBarAlwaysOff + + + true + + + false + + + false + + + true + + + true + + + false + + + + + + + + + Reloads the version list. + + + &Refresh + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + + + VersionListView + QTreeView +
    widgets/VersionListView.h
    +
    +
    + + + + buttonBox + accepted() + VersionSelectDialog + accept() + + + 257 + 290 + + + 157 + 274 + + + + + buttonBox + rejected() + VersionSelectDialog + reject() + + + 325 + 290 + + + 286 + 274 + + + + +
    diff --git a/application/groupview/GroupView.cpp b/application/groupview/GroupView.cpp new file mode 100644 index 00000000..89694b87 --- /dev/null +++ b/application/groupview/GroupView.cpp @@ -0,0 +1,1003 @@ +#include "GroupView.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "VisualGroup.h" +#include + +template bool listsIntersect(const QList &l1, const QList t2) +{ + for (auto &item : l1) + { + if (t2.contains(item)) + { + return true; + } + } + return false; +} + +GroupView::GroupView(QWidget *parent) + : QAbstractItemView(parent) +{ + setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); + setAcceptDrops(true); + setAutoScroll(true); +} + +GroupView::~GroupView() +{ + qDeleteAll(m_groups); + m_groups.clear(); +} + +void GroupView::setModel(QAbstractItemModel *model) +{ + QAbstractItemView::setModel(model); + connect(model, &QAbstractItemModel::modelReset, this, &GroupView::modelReset); +} + +void GroupView::dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, + const QVector &roles) +{ + scheduleDelayedItemsLayout(); +} +void GroupView::rowsInserted(const QModelIndex &parent, int start, int end) +{ + scheduleDelayedItemsLayout(); +} + +void GroupView::rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end) +{ + scheduleDelayedItemsLayout(); +} + +class LocaleString : public QString +{ +public: + LocaleString(const char *s) : QString(s) + { + } + LocaleString(const QString &s) : QString(s) + { + } +}; + +inline bool operator<(const LocaleString &lhs, const LocaleString &rhs) +{ + return (QString::localeAwareCompare(lhs, rhs) < 0); +} + +void GroupView::updateGeometries() +{ + geometryCache.clear(); + int previousScroll = verticalScrollBar()->value(); + + QMap cats; + + for (int i = 0; i < model()->rowCount(); ++i) + { + const QString groupName = + model()->index(i, 0).data(GroupViewRoles::GroupRole).toString(); + if (!cats.contains(groupName)) + { + VisualGroup *old = this->category(groupName); + if (old) + { + cats.insert(groupName, new VisualGroup(old)); + } + else + { + cats.insert(groupName, new VisualGroup(groupName, this)); + } + } + } + + /*if (m_editedCategory) + { + m_editedCategory = cats[m_editedCategory->text]; + }*/ + + qDeleteAll(m_groups); + m_groups = cats.values(); + + for (auto cat : m_groups) + { + cat->update(); + } + + if (m_groups.isEmpty()) + { + verticalScrollBar()->setRange(0, 0); + } + else + { + int totalHeight = 0; + // top margin + totalHeight += m_categoryMargin; + int itemScroll = 0; + for (auto category : m_groups) + { + category->m_verticalPosition = totalHeight; + totalHeight += category->totalHeight() + m_categoryMargin; + if(!itemScroll && category->totalHeight() != 0) + { + itemScroll = category->contentHeight() / category->numRows(); + } + } + // do not divide by zero + if(itemScroll == 0) + itemScroll = 64; + + totalHeight += m_bottomMargin; + verticalScrollBar()->setSingleStep ( itemScroll ); + const int rowsPerPage = qMax ( viewport()->height() / itemScroll, 1 ); + verticalScrollBar()->setPageStep ( rowsPerPage * itemScroll ); + + verticalScrollBar()->setRange(0, totalHeight - height()); + } + + verticalScrollBar()->setValue(qMin(previousScroll, verticalScrollBar()->maximum())); + + viewport()->update(); +} + +void GroupView::modelReset() +{ + scheduleDelayedItemsLayout(); + executeDelayedItemsLayout(); +} + +bool GroupView::isIndexHidden(const QModelIndex &index) const +{ + VisualGroup *cat = category(index); + if (cat) + { + return cat->collapsed; + } + else + { + return false; + } +} + +VisualGroup *GroupView::category(const QModelIndex &index) const +{ + return category(index.data(GroupViewRoles::GroupRole).toString()); +} + +VisualGroup *GroupView::category(const QString &cat) const +{ + for (auto group : m_groups) + { + if (group->text == cat) + { + return group; + } + } + return nullptr; +} + +VisualGroup *GroupView::categoryAt(const QPoint &pos) const +{ + for (auto group : m_groups) + { + if(group->hitScan(pos) & VisualGroup::CheckboxHit) + { + return group; + } + } + return nullptr; +} + +int GroupView::calculateItemsPerRow() const +{ + return qFloor((qreal)(contentWidth()) / (qreal)(itemWidth() + m_spacing)); +} + +int GroupView::contentWidth() const +{ + return width() - m_leftMargin - m_rightMargin; +} + +int GroupView::itemWidth() const +{ + return m_itemWidth; +} + +void GroupView::mousePressEvent(QMouseEvent *event) +{ + // endCategoryEditor(); + + QPoint visualPos = event->pos(); + QPoint geometryPos = event->pos() + offset(); + + QPersistentModelIndex index = indexAt(visualPos); + + m_pressedIndex = index; + m_pressedAlreadySelected = selectionModel()->isSelected(m_pressedIndex); + m_pressedPosition = geometryPos; + + m_pressedCategory = categoryAt(geometryPos); + if (m_pressedCategory) + { + setState(m_pressedCategory->collapsed ? ExpandingState : CollapsingState); + event->accept(); + return; + } + + if (index.isValid() && (index.flags() & Qt::ItemIsEnabled)) + { + if(index != currentIndex()) + { + // FIXME: better! + m_currentCursorColumn = -1; + } + // we disable scrollTo for mouse press so the item doesn't change position + // when the user is interacting with it (ie. clicking on it) + bool autoScroll = hasAutoScroll(); + setAutoScroll(false); + selectionModel()->setCurrentIndex(index, QItemSelectionModel::NoUpdate); + + setAutoScroll(autoScroll); + QRect rect(visualPos, visualPos); + setSelection(rect, QItemSelectionModel::ClearAndSelect); + + // signal handlers may change the model + emit pressed(index); + } + else + { + // Forces a finalize() even if mouse is pressed, but not on a item + selectionModel()->select(QModelIndex(), QItemSelectionModel::Select); + } +} + +void GroupView::mouseMoveEvent(QMouseEvent *event) +{ + QPoint topLeft; + QPoint visualPos = event->pos(); + QPoint geometryPos = event->pos() + offset(); + + if (state() == ExpandingState || state() == CollapsingState) + { + return; + } + + if (state() == DraggingState) + { + topLeft = m_pressedPosition - offset(); + if ((topLeft - event->pos()).manhattanLength() > QApplication::startDragDistance()) + { + m_pressedIndex = QModelIndex(); + startDrag(model()->supportedDragActions()); + setState(NoState); + stopAutoScroll(); + } + return; + } + + if (selectionMode() != SingleSelection) + { + topLeft = m_pressedPosition - offset(); + } + else + { + topLeft = geometryPos; + } + + if (m_pressedIndex.isValid() && (state() != DragSelectingState) && + (event->buttons() != Qt::NoButton) && !selectedIndexes().isEmpty()) + { + setState(DraggingState); + return; + } + + if ((event->buttons() & Qt::LeftButton) && selectionModel()) + { + setState(DragSelectingState); + + setSelection(QRect(visualPos, visualPos), QItemSelectionModel::ClearAndSelect); + QModelIndex index = indexAt(visualPos); + + // set at the end because it might scroll the view + if (index.isValid() && (index != selectionModel()->currentIndex()) && + (index.flags() & Qt::ItemIsEnabled)) + { + selectionModel()->setCurrentIndex(index, QItemSelectionModel::NoUpdate); + } + } +} + +void GroupView::mouseReleaseEvent(QMouseEvent *event) +{ + QPoint visualPos = event->pos(); + QPoint geometryPos = event->pos() + offset(); + QPersistentModelIndex index = indexAt(visualPos); + + bool click = (index == m_pressedIndex && index.isValid()) || + (m_pressedCategory && m_pressedCategory == categoryAt(geometryPos)); + + if (click && m_pressedCategory) + { + if (state() == ExpandingState) + { + m_pressedCategory->collapsed = false; + updateGeometries(); + viewport()->update(); + event->accept(); + return; + } + else if (state() == CollapsingState) + { + m_pressedCategory->collapsed = true; + updateGeometries(); + viewport()->update(); + event->accept(); + return; + } + } + + m_ctrlDragSelectionFlag = QItemSelectionModel::NoUpdate; + + setState(NoState); + + if (click) + { + if (event->button() == Qt::LeftButton) + { + emit clicked(index); + } + QStyleOptionViewItem option = viewOptions(); + if (m_pressedAlreadySelected) + { + option.state |= QStyle::State_Selected; + } + if ((model()->flags(index) & Qt::ItemIsEnabled) && + style()->styleHint(QStyle::SH_ItemView_ActivateItemOnSingleClick, &option, this)) + { + emit activated(index); + } + } +} + +void GroupView::mouseDoubleClickEvent(QMouseEvent *event) +{ + QModelIndex index = indexAt(event->pos()); + if (!index.isValid() || !(index.flags() & Qt::ItemIsEnabled) || (m_pressedIndex != index)) + { + QMouseEvent me(QEvent::MouseButtonPress, event->localPos(), event->windowPos(), + event->screenPos(), event->button(), event->buttons(), + event->modifiers()); + mousePressEvent(&me); + return; + } + // signal handlers may change the model + QPersistentModelIndex persistent = index; + emit doubleClicked(persistent); +} + +void GroupView::paintEvent(QPaintEvent *event) +{ + executeDelayedItemsLayout(); + + QPainter painter(this->viewport()); + + QStyleOptionViewItemV4 option(viewOptions()); + option.widget = this; + + int wpWidth = viewport()->width(); + option.rect.setWidth(wpWidth); + for (int i = 0; i < m_groups.size(); ++i) + { + VisualGroup *category = m_groups.at(i); + int y = category->verticalPosition(); + y -= verticalOffset(); + QRect backup = option.rect; + int height = category->totalHeight(); + option.rect.setTop(y); + option.rect.setHeight(height); + option.rect.setLeft(m_leftMargin); + option.rect.setRight(wpWidth - m_rightMargin); + category->drawHeader(&painter, option); + y += category->totalHeight() + m_categoryMargin; + option.rect = backup; + } + + for (int i = 0; i < model()->rowCount(); ++i) + { + const QModelIndex index = model()->index(i, 0); + if (isIndexHidden(index)) + { + continue; + } + Qt::ItemFlags flags = index.flags(); + option.rect = visualRect(index); + option.features |= + QStyleOptionViewItemV2::WrapText; // FIXME: what is the meaning of this anyway? + if (flags & Qt::ItemIsSelectable && selectionModel()->isSelected(index)) + { + option.state |= selectionModel()->isSelected(index) ? QStyle::State_Selected + : QStyle::State_None; + } + else + { + option.state &= ~QStyle::State_Selected; + } + option.state |= (index == currentIndex()) ? QStyle::State_HasFocus : QStyle::State_None; + if (!(flags & Qt::ItemIsEnabled)) + { + option.state &= ~QStyle::State_Enabled; + } + itemDelegate()->paint(&painter, option, index); + } + + /* + * Drop indicators for manual reordering... + */ +#if 0 + if (!m_lastDragPosition.isNull()) + { + QPair pair = rowDropPos(m_lastDragPosition); + Group *category = pair.first; + int row = pair.second; + if (category) + { + int internalRow = row - category->firstItemIndex; + QLine line; + if (internalRow >= category->numItems()) + { + QRect toTheRightOfRect = visualRect(category->lastItem()); + line = QLine(toTheRightOfRect.topRight(), toTheRightOfRect.bottomRight()); + } + else + { + QRect toTheLeftOfRect = visualRect(model()->index(row, 0)); + line = QLine(toTheLeftOfRect.topLeft(), toTheLeftOfRect.bottomLeft()); + } + painter.save(); + painter.setPen(QPen(Qt::black, 3)); + painter.drawLine(line); + painter.restore(); + } + } +#endif +} + +void GroupView::resizeEvent(QResizeEvent *event) +{ + int newItemsPerRow = calculateItemsPerRow(); + if(newItemsPerRow != m_currentItemsPerRow) + { + m_currentCursorColumn = -1; + m_currentItemsPerRow = newItemsPerRow; + updateGeometries(); + } +} + +void GroupView::dragEnterEvent(QDragEnterEvent *event) +{ + if (!isDragEventAccepted(event)) + { + return; + } + m_lastDragPosition = event->pos() + offset(); + viewport()->update(); + event->accept(); +} + +void GroupView::dragMoveEvent(QDragMoveEvent *event) +{ + if (!isDragEventAccepted(event)) + { + return; + } + m_lastDragPosition = event->pos() + offset(); + viewport()->update(); + event->accept(); +} + +void GroupView::dragLeaveEvent(QDragLeaveEvent *event) +{ + m_lastDragPosition = QPoint(); + viewport()->update(); +} + +void GroupView::dropEvent(QDropEvent *event) +{ + m_lastDragPosition = QPoint(); + + stopAutoScroll(); + setState(NoState); + + if (event->source() != this || !(event->possibleActions() & Qt::MoveAction)) + { + return; + } + + QPair dropPos = rowDropPos(event->pos() + offset()); + const VisualGroup *category = dropPos.first; + const int row = dropPos.second; + + if (row == -1) + { + viewport()->update(); + return; + } + + const QString categoryText = category->text; + if (model()->dropMimeData(event->mimeData(), Qt::MoveAction, row, 0, QModelIndex())) + { + model()->setData(model()->index(row, 0), categoryText, + GroupViewRoles::GroupRole); + event->setDropAction(Qt::MoveAction); + event->accept(); + } + updateGeometries(); + viewport()->update(); +} + +void GroupView::startDrag(Qt::DropActions supportedActions) +{ + QModelIndexList indexes = selectionModel()->selectedIndexes(); + if(indexes.count() == 0) + return; + + QMimeData *data = model()->mimeData(indexes); + if (!data) + { + return; + } + QRect rect; + QPixmap pixmap = renderToPixmap(indexes, &rect); + //rect.translate(offset()); + // rect.adjust(horizontalOffset(), verticalOffset(), 0, 0); + QDrag *drag = new QDrag(this); + drag->setPixmap(pixmap); + drag->setMimeData(data); + Qt::DropAction defaultDropAction = Qt::IgnoreAction; + if (this->defaultDropAction() != Qt::IgnoreAction && + (supportedActions & this->defaultDropAction())) + { + defaultDropAction = this->defaultDropAction(); + } + if (drag->exec(supportedActions, defaultDropAction) == Qt::MoveAction) + { + const QItemSelection selection = selectionModel()->selection(); + + for (auto it = selection.constBegin(); it != selection.constEnd(); ++it) + { + QModelIndex parent = (*it).parent(); + if ((*it).left() != 0) + { + continue; + } + if ((*it).right() != (model()->columnCount(parent) - 1)) + { + continue; + } + int count = (*it).bottom() - (*it).top() + 1; + model()->removeRows((*it).top(), count, parent); + } + } +} + +QRect GroupView::visualRect(const QModelIndex &index) const +{ + return geometryRect(index).translated(-offset()); +} + +QRect GroupView::geometryRect(const QModelIndex &index) const +{ + if (!index.isValid() || isIndexHidden(index) || index.column() > 0) + { + return QRect(); + } + + int row = index.row(); + if(geometryCache.contains(row)) + { + return *geometryCache[row]; + } + + const VisualGroup *cat = category(index); + QPair pos = cat->positionOf(index); + int x = pos.first; + // int y = pos.second; + + QRect out; + out.setTop(cat->verticalPosition() + cat->headerHeight() + 5 + cat->rowTopOf(index)); + out.setLeft(m_spacing + x * (itemWidth() + m_spacing)); + out.setSize(itemDelegate()->sizeHint(viewOptions(), index)); + geometryCache.insert(row, new QRect(out)); + return out; +} + +QModelIndex GroupView::indexAt(const QPoint &point) const +{ + for (int i = 0; i < model()->rowCount(); ++i) + { + QModelIndex index = model()->index(i, 0); + if (visualRect(index).contains(point)) + { + return index; + } + } + return QModelIndex(); +} + +void GroupView::setSelection(const QRect &rect, + const QItemSelectionModel::SelectionFlags commands) +{ + for (int i = 0; i < model()->rowCount(); ++i) + { + QModelIndex index = model()->index(i, 0); + QRect itemRect = visualRect(index); + if (itemRect.intersects(rect)) + { + selectionModel()->select(index, commands); + update(itemRect.translated(-offset())); + } + } +} + +QPixmap GroupView::renderToPixmap(const QModelIndexList &indices, QRect *r) const +{ + Q_ASSERT(r); + auto paintPairs = draggablePaintPairs(indices, r); + if (paintPairs.isEmpty()) + { + return QPixmap(); + } + QPixmap pixmap(r->size()); + pixmap.fill(Qt::transparent); + QPainter painter(&pixmap); + QStyleOptionViewItem option = viewOptions(); + option.state |= QStyle::State_Selected; + for (int j = 0; j < paintPairs.count(); ++j) + { + option.rect = paintPairs.at(j).first.translated(-r->topLeft()); + const QModelIndex ¤t = paintPairs.at(j).second; + itemDelegate()->paint(&painter, option, current); + } + return pixmap; +} + +QList> GroupView::draggablePaintPairs(const QModelIndexList &indices, + QRect *r) const +{ + Q_ASSERT(r); + QRect &rect = *r; + QList> ret; + for (int i = 0; i < indices.count(); ++i) + { + const QModelIndex &index = indices.at(i); + const QRect current = geometryRect(index); + ret += qMakePair(current, index); + rect |= current; + } + return ret; +} + +bool GroupView::isDragEventAccepted(QDropEvent *event) +{ + return false; +} + +QPair GroupView::rowDropPos(const QPoint &pos) +{ + return qMakePair(nullptr, -1); + // FIXME: PIXIE DUST. + /* + // check that we aren't on a category header and calculate which category we're in + VisualGroup *category = 0; + { + int y = 0; + for (auto cat : m_groups) + { + if (pos.y() > y && pos.y() < (y + cat->headerHeight())) + { + return qMakePair(nullptr, -1); + } + y += cat->totalHeight() + m_categoryMargin; + if (pos.y() < y) + { + category = cat; + break; + } + } + if (category == 0) + { + return qMakePair(nullptr, -1); + } + } + + QList indices = category->items(); + + // calculate the internal column + int internalColumn = -1; + { + const int itemWidth = this->itemWidth(); + if (pos.x() >= (itemWidth * itemsPerRow())) + { + internalColumn = itemsPerRow(); + } + else + { + for (int i = 0, c = 0; i < contentWidth(); i += itemWidth + 10 , ++c) + { + if (pos.x() > (i - itemWidth / 2) && pos.x() <= (i + itemWidth / 2)) + { + internalColumn = c; + break; + } + } + } + if (internalColumn == -1) + { + return qMakePair(nullptr, -1); + } + } + + // calculate the internal row + int internalRow = -1; + { + // FIXME rework the drag and drop code + const int top = category->verticalPosition(); + for (int r = 0, h = top; r < category->numRows(); + h += itemHeightForCategoryRow(category, r), ++r) + { + if (pos.y() > h && pos.y() < (h + itemHeightForCategoryRow(category, r))) + { + internalRow = r; + break; + } + } + if (internalRow == -1) + { + return qMakePair(nullptr, -1); + } + // this happens if we're in the margin between a one category and another + // categories header + if (internalRow > (indices.size() / itemsPerRow())) + { + return qMakePair(nullptr, -1); + } + } + + // flaten the internalColumn/internalRow to one row + int categoryRow = internalRow * itemsPerRow() + internalColumn; + + // this is used if we're past the last item + if (categoryRow >= indices.size()) + { + return qMakePair(category, indices.last().row() + 1); + } + + return qMakePair(category, indices.at(categoryRow).row()); + */ +} + +QPoint GroupView::offset() const +{ + return QPoint(horizontalOffset(), verticalOffset()); +} + +QRegion GroupView::visualRegionForSelection(const QItemSelection &selection) const +{ + QRegion region; + for (auto &range : selection) + { + int start_row = range.top(); + int end_row = range.bottom(); + for (int row = start_row; row <= end_row; ++row) + { + int start_column = range.left(); + int end_column = range.right(); + for (int column = start_column; column <= end_column; ++column) + { + QModelIndex index = model()->index(row, column, rootIndex()); + region += visualRect(index); // OK + } + } + } + return region; +} + +QModelIndex GroupView::moveCursor(QAbstractItemView::CursorAction cursorAction, + Qt::KeyboardModifiers modifiers) +{ + auto current = currentIndex(); + if(!current.isValid()) + { + return current; + } + auto cat = category(current); + int group_index = m_groups.indexOf(cat); + if(group_index < 0) + return current; + + auto real_group = m_groups[group_index]; + int beginning_row = 0; + for(auto group: m_groups) + { + if(group == real_group) + break; + beginning_row += group->numRows(); + } + + QPair pos = cat->positionOf(current); + int column = pos.first; + int row = pos.second; + if(m_currentCursorColumn < 0) + { + m_currentCursorColumn = column; + } + switch(cursorAction) + { + case MoveUp: + { + if(row == 0) + { + int prevgroupindex = group_index-1; + while(prevgroupindex >= 0) + { + auto prevgroup = m_groups[prevgroupindex]; + if(prevgroup->collapsed) + { + prevgroupindex--; + continue; + } + int newRow = prevgroup->numRows() - 1; + int newRowSize = prevgroup->rows[newRow].size(); + int newColumn = m_currentCursorColumn; + if (m_currentCursorColumn >= newRowSize) + { + newColumn = newRowSize - 1; + } + return prevgroup->rows[newRow][newColumn]; + } + } + else + { + int newRow = row - 1; + int newRowSize = cat->rows[newRow].size(); + int newColumn = m_currentCursorColumn; + if (m_currentCursorColumn >= newRowSize) + { + newColumn = newRowSize - 1; + } + return cat->rows[newRow][newColumn]; + } + return current; + } + case MoveDown: + { + if(row == cat->rows.size() - 1) + { + int nextgroupindex = group_index+1; + while (nextgroupindex < m_groups.size()) + { + auto nextgroup = m_groups[nextgroupindex]; + if(nextgroup->collapsed) + { + nextgroupindex++; + continue; + } + int newRowSize = nextgroup->rows[0].size(); + int newColumn = m_currentCursorColumn; + if (m_currentCursorColumn >= newRowSize) + { + newColumn = newRowSize - 1; + } + return nextgroup->rows[0][newColumn]; + } + } + else + { + int newRow = row + 1; + int newRowSize = cat->rows[newRow].size(); + int newColumn = m_currentCursorColumn; + if (m_currentCursorColumn >= newRowSize) + { + newColumn = newRowSize - 1; + } + return cat->rows[newRow][newColumn]; + } + return current; + } + case MoveLeft: + { + if(column > 0) + { + m_currentCursorColumn = column - 1; + return cat->rows[row][column - 1]; + } + // TODO: moving to previous line + return current; + } + case MoveRight: + { + if(column < cat->rows[row].size() - 1) + { + m_currentCursorColumn = column + 1; + return cat->rows[row][column + 1]; + } + // TODO: moving to next line + return current; + } + case MoveHome: + { + m_currentCursorColumn = 0; + return cat->rows[row][0]; + } + case MoveEnd: + { + auto last = cat->rows[row].size() - 1; + m_currentCursorColumn = last; + return cat->rows[row][last]; + } + default: + break; + } + return current; +} + +int GroupView::horizontalOffset() const +{ + return horizontalScrollBar()->value(); +} + +int GroupView::verticalOffset() const +{ + return verticalScrollBar()->value(); +} + +void GroupView::scrollContentsBy(int dx, int dy) +{ + scrollDirtyRegion(dx, dy); + viewport()->scroll(dx, dy); +} + +void GroupView::scrollTo(const QModelIndex &index, ScrollHint hint) +{ + if (!index.isValid()) + return; + + const QRect rect = visualRect(index); + if (hint == EnsureVisible && viewport()->rect().contains(rect)) + { + viewport()->update(rect); + return; + } + + verticalScrollBar()->setValue(verticalScrollToValue(index, rect, hint)); +} + +int GroupView::verticalScrollToValue(const QModelIndex &index, const QRect &rect, + QListView::ScrollHint hint) const +{ + const QRect area = viewport()->rect(); + const bool above = (hint == QListView::EnsureVisible && rect.top() < area.top()); + const bool below = (hint == QListView::EnsureVisible && rect.bottom() > area.bottom()); + + int verticalValue = verticalScrollBar()->value(); + QRect adjusted = rect.adjusted(-spacing(), -spacing(), spacing(), spacing()); + if (hint == QListView::PositionAtTop || above) + verticalValue += adjusted.top(); + else if (hint == QListView::PositionAtBottom || below) + verticalValue += qMin(adjusted.top(), adjusted.bottom() - area.height() + 1); + else if (hint == QListView::PositionAtCenter) + verticalValue += adjusted.top() - ((area.height() - adjusted.height()) / 2); + return verticalValue; +} diff --git a/application/groupview/GroupView.h b/application/groupview/GroupView.h new file mode 100644 index 00000000..93e45ed7 --- /dev/null +++ b/application/groupview/GroupView.h @@ -0,0 +1,125 @@ +#pragma once + +#include +#include +#include +#include + +struct GroupViewRoles +{ + enum + { + GroupRole = Qt::UserRole, + ProgressValueRole, + ProgressMaximumRole + }; +}; + +struct VisualGroup; + +class GroupView : public QAbstractItemView +{ + Q_OBJECT + +public: + GroupView(QWidget *parent = 0); + ~GroupView(); + + void setModel(QAbstractItemModel *model) override; + + /// return geometry rectangle occupied by the specified model item + QRect geometryRect(const QModelIndex &index) const; + /// return visual rectangle occupied by the specified model item + virtual QRect visualRect(const QModelIndex &index) const override; + /// get the model index at the specified visual point + virtual QModelIndex indexAt(const QPoint &point) const override; + void setSelection(const QRect &rect, + const QItemSelectionModel::SelectionFlags commands) override; + + virtual int horizontalOffset() const override; + virtual int verticalOffset() const override; + virtual void scrollContentsBy(int dx, int dy) override; + virtual void scrollTo(const QModelIndex &index, ScrollHint hint = EnsureVisible) override; + + virtual QModelIndex moveCursor(CursorAction cursorAction, + Qt::KeyboardModifiers modifiers) override; + + virtual QRegion visualRegionForSelection(const QItemSelection &selection) const override; + + int spacing() const + { + return m_spacing; + }; +protected +slots: + virtual void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, + const QVector &roles) override; + virtual void rowsInserted(const QModelIndex &parent, int start, int end) override; + virtual void rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end) override; + virtual void updateGeometries() override; + void modelReset(); + +protected: + virtual bool isIndexHidden(const QModelIndex &index) const override; + void mousePressEvent(QMouseEvent *event) override; + void mouseMoveEvent(QMouseEvent *event) override; + void mouseReleaseEvent(QMouseEvent *event) override; + void mouseDoubleClickEvent(QMouseEvent *event) override; + void paintEvent(QPaintEvent *event) override; + void resizeEvent(QResizeEvent *event) override; + + void dragEnterEvent(QDragEnterEvent *event) override; + void dragMoveEvent(QDragMoveEvent *event) override; + void dragLeaveEvent(QDragLeaveEvent *event) override; + void dropEvent(QDropEvent *event) override; + + void startDrag(Qt::DropActions supportedActions) override; + +private: + friend struct VisualGroup; + QList m_groups; + + // geometry + int m_leftMargin = 5; + int m_rightMargin = 5; + int m_bottomMargin = 5; + int m_categoryMargin = 5; + int m_spacing = 5; + int m_itemWidth = 100; + int m_currentItemsPerRow = -1; + int m_currentCursorColumn= -1; + mutable QCache geometryCache; + + // point where the currently active mouse action started in geometry coordinates + QPoint m_pressedPosition; + QPersistentModelIndex m_pressedIndex; + bool m_pressedAlreadySelected; + VisualGroup *m_pressedCategory; + QItemSelectionModel::SelectionFlag m_ctrlDragSelectionFlag; + QPoint m_lastDragPosition; + + VisualGroup *category(const QModelIndex &index) const; + VisualGroup *category(const QString &cat) const; + VisualGroup *categoryAt(const QPoint &pos) const; + + int itemsPerRow() const + { + return m_currentItemsPerRow; + }; + int contentWidth() const; + +private: /* methods */ + int itemWidth() const; + int calculateItemsPerRow() const; + int verticalScrollToValue(const QModelIndex &index, const QRect &rect, + QListView::ScrollHint hint) const; + QPixmap renderToPixmap(const QModelIndexList &indices, QRect *r) const; + QList> draggablePaintPairs(const QModelIndexList &indices, + QRect *r) const; + + bool isDragEventAccepted(QDropEvent *event); + + QPair rowDropPos(const QPoint &pos); + + QPoint offset() const; +}; diff --git a/application/groupview/GroupedProxyModel.cpp b/application/groupview/GroupedProxyModel.cpp new file mode 100644 index 00000000..a45c5ae9 --- /dev/null +++ b/application/groupview/GroupedProxyModel.cpp @@ -0,0 +1,42 @@ +#include "GroupedProxyModel.h" + +#include "GroupView.h" +#include + +GroupedProxyModel::GroupedProxyModel(QObject *parent) : QSortFilterProxyModel(parent) +{ +} + +bool GroupedProxyModel::lessThan(const QModelIndex &left, const QModelIndex &right) const +{ + const QString leftCategory = left.data(GroupViewRoles::GroupRole).toString(); + const QString rightCategory = right.data(GroupViewRoles::GroupRole).toString(); + if (leftCategory == rightCategory) + { + return subSortLessThan(left, right); + } + else + { + // FIXME: real group sorting happens in GroupView::updateGeometries(), see LocaleString + auto result = leftCategory.localeAwareCompare(rightCategory); + if(result < 0) + { + qDebug() << leftCategory << "<" << rightCategory; + } + if(result == 0) + { + qDebug() << leftCategory << "=" << rightCategory; + return subSortLessThan(left, right); + } + if(result > 0) + { + qDebug() << leftCategory << ">" << rightCategory; + } + return result < 0; + } +} + +bool GroupedProxyModel::subSortLessThan(const QModelIndex &left, const QModelIndex &right) const +{ + return left.row() < right.row(); +} diff --git a/application/groupview/GroupedProxyModel.h b/application/groupview/GroupedProxyModel.h new file mode 100644 index 00000000..12edee0f --- /dev/null +++ b/application/groupview/GroupedProxyModel.h @@ -0,0 +1,15 @@ +#pragma once + +#include + +class GroupedProxyModel : public QSortFilterProxyModel +{ + Q_OBJECT + +public: + GroupedProxyModel(QObject *parent = 0); + +protected: + virtual bool lessThan(const QModelIndex &left, const QModelIndex &right) const override; + virtual bool subSortLessThan(const QModelIndex &left, const QModelIndex &right) const; +}; diff --git a/application/groupview/InstanceDelegate.cpp b/application/groupview/InstanceDelegate.cpp new file mode 100644 index 00000000..b9ad353c --- /dev/null +++ b/application/groupview/InstanceDelegate.cpp @@ -0,0 +1,362 @@ +/* Copyright 2013-2015 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "InstanceDelegate.h" +#include +#include +#include +#include +#include + +#include "GroupView.h" +#include "BaseInstance.h" +#include "InstanceList.h" + +QCache ListViewDelegate::m_pixmapCache; + +// Origin: Qt +static void viewItemTextLayout(QTextLayout &textLayout, int lineWidth, qreal &height, + qreal &widthUsed) +{ + height = 0; + widthUsed = 0; + textLayout.beginLayout(); + QString str = textLayout.text(); + while (true) + { + QTextLine line = textLayout.createLine(); + if (!line.isValid()) + break; + if (line.textLength() == 0) + break; + line.setLineWidth(lineWidth); + line.setPosition(QPointF(0, height)); + height += line.height(); + widthUsed = qMax(widthUsed, line.naturalTextWidth()); + } + textLayout.endLayout(); +} + +ListViewDelegate::ListViewDelegate(QObject *parent) : QStyledItemDelegate(parent) +{ +} + +void drawSelectionRect(QPainter *painter, const QStyleOptionViewItemV4 &option, + const QRect &rect) +{ + if ((option.state & QStyle::State_Selected)) + painter->fillRect(rect, option.palette.brush(QPalette::Highlight)); + else + { + QColor backgroundColor = option.palette.color(QPalette::Background); + backgroundColor.setAlpha(160); + painter->fillRect(rect, QBrush(backgroundColor)); + } +} + +void drawFocusRect(QPainter *painter, const QStyleOptionViewItemV4 &option, const QRect &rect) +{ + if (!(option.state & QStyle::State_HasFocus)) + return; + QStyleOptionFocusRect opt; + opt.direction = option.direction; + opt.fontMetrics = option.fontMetrics; + opt.palette = option.palette; + opt.rect = rect; + // opt.state = option.state | QStyle::State_KeyboardFocusChange | + // QStyle::State_Item; + auto col = option.state & QStyle::State_Selected ? QPalette::Highlight : QPalette::Base; + opt.backgroundColor = option.palette.color(col); + // Apparently some widget styles expect this hint to not be set + painter->setRenderHint(QPainter::Antialiasing, false); + + QStyle *style = option.widget ? option.widget->style() : QApplication::style(); + + style->drawPrimitive(QStyle::PE_FrameFocusRect, &opt, painter, option.widget); + + painter->setRenderHint(QPainter::Antialiasing); +} + +// TODO this can be made a lot prettier +void drawProgressOverlay(QPainter *painter, const QStyleOptionViewItemV4 &option, + const int value, const int maximum) +{ + if (maximum == 0 || value == maximum) + { + return; + } + + painter->save(); + + qreal percent = (qreal)value / (qreal)maximum; + QColor color = option.palette.color(QPalette::Dark); + color.setAlphaF(0.70f); + painter->setBrush(color); + painter->setPen(QPen(QBrush(), 0)); + painter->drawPie(option.rect, 90 * 16, -percent * 360 * 16); + + painter->restore(); +} + +void drawBadges(QPainter *painter, const QStyleOptionViewItemV4 &option, BaseInstance *instance) +{ + QList pixmaps; + const BaseInstance::InstanceFlags flags = instance->flags(); + if (flags & BaseInstance::VersionBrokenFlag) + { + pixmaps.append("broken"); + } + if (flags & BaseInstance::UpdateAvailable) + { + pixmaps.append("updateavailable"); + } + + // begin easter eggs + if (instance->name().contains("btw", Qt::CaseInsensitive) || + instance->name().contains("better then wolves", Qt::CaseInsensitive) || + instance->name().contains("better than wolves", Qt::CaseInsensitive)) + { + pixmaps.append("herobrine"); + } + if (instance->name().contains("direwolf", Qt::CaseInsensitive)) + { + pixmaps.append("enderman"); + } + if (instance->name().contains("kitten", Qt::CaseInsensitive)) + { + pixmaps.append("kitten"); + } + if (instance->name().contains("derp", Qt::CaseInsensitive)) + { + pixmaps.append("derp"); + } + // end easter eggs + + static const int itemSide = 24; + static const int spacing = 1; + const int itemsPerRow = qMax(1, qFloor(double(option.rect.width() + spacing) / double(itemSide + spacing))); + const int rows = qCeil((double)pixmaps.size() / (double)itemsPerRow); + QListIterator it(pixmaps); + painter->translate(option.rect.topLeft()); + for (int y = 0; y < rows; ++y) + { + for (int x = 0; x < itemsPerRow; ++x) + { + if (!it.hasNext()) + { + return; + } + const QPixmap pixmap = ListViewDelegate::requestBadgePixmap(it.next()).scaled( + itemSide, itemSide, Qt::KeepAspectRatio, Qt::FastTransformation); + painter->drawPixmap(option.rect.width() - x * itemSide + qMax(x - 1, 0) * spacing - itemSide, + y * itemSide + qMax(y - 1, 0) * spacing, itemSide, itemSide, + pixmap); + } + } + painter->translate(-option.rect.topLeft()); +} + +static QSize viewItemTextSize(const QStyleOptionViewItemV4 *option) +{ + QStyle *style = option->widget ? option->widget->style() : QApplication::style(); + QTextOption textOption; + textOption.setWrapMode(QTextOption::WrapAtWordBoundaryOrAnywhere); + QTextLayout textLayout; + textLayout.setTextOption(textOption); + textLayout.setFont(option->font); + textLayout.setText(option->text); + const int textMargin = + style->pixelMetric(QStyle::PM_FocusFrameHMargin, option, option->widget) + 1; + QRect bounds(0, 0, 100 - 2 * textMargin, 600); + qreal height = 0, widthUsed = 0; + viewItemTextLayout(textLayout, bounds.width(), height, widthUsed); + const QSize size(qCeil(widthUsed), qCeil(height)); + return QSize(size.width() + 2 * textMargin, size.height()); +} + +void ListViewDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, + const QModelIndex &index) const +{ + QStyleOptionViewItemV4 opt = option; + initStyleOption(&opt, index); + painter->save(); + painter->setClipRect(opt.rect); + + opt.features |= QStyleOptionViewItem::WrapText; + opt.text = index.data().toString(); + opt.textElideMode = Qt::ElideRight; + opt.displayAlignment = Qt::AlignTop | Qt::AlignHCenter; + + QStyle *style = opt.widget ? opt.widget->style() : QApplication::style(); + + // const int iconSize = style->pixelMetric(QStyle::PM_IconViewIconSize); + const int iconSize = 48; + QRect iconbox = opt.rect; + const int textMargin = style->pixelMetric(QStyle::PM_FocusFrameHMargin, 0, opt.widget) + 1; + QRect textRect = opt.rect; + QRect textHighlightRect = textRect; + // clip the decoration on top, remove width padding + textRect.adjust(textMargin, iconSize + textMargin + 5, -textMargin, 0); + + textHighlightRect.adjust(0, iconSize + 5, 0, 0); + + // draw background + { + // FIXME: unused + // QSize textSize = viewItemTextSize ( &opt ); + QPalette::ColorGroup cg; + QStyleOptionViewItemV4 opt2(opt); + + if ((opt.widget && opt.widget->isEnabled()) || (opt.state & QStyle::State_Enabled)) + { + if (!(opt.state & QStyle::State_Active)) + cg = QPalette::Inactive; + else + cg = QPalette::Normal; + } + else + { + cg = QPalette::Disabled; + } + opt2.palette.setCurrentColorGroup(cg); + + // fill in background, if any + + if (opt.backgroundBrush.style() != Qt::NoBrush) + { + QPointF oldBO = painter->brushOrigin(); + painter->setBrushOrigin(opt.rect.topLeft()); + painter->fillRect(opt.rect, opt.backgroundBrush); + painter->setBrushOrigin(oldBO); + } + + drawSelectionRect(painter, opt2, textHighlightRect); + + /* + if (opt.showDecorationSelected) + { + drawSelectionRect(painter, opt2, opt.rect); + drawFocusRect(painter, opt2, opt.rect); + // painter->fillRect ( opt.rect, opt.palette.brush ( cg, QPalette::Highlight ) ); + } + else + { + + // if ( opt.state & QStyle::State_Selected ) + { + // QRect textRect = subElementRect ( QStyle::SE_ItemViewItemText, opt, + // opt.widget ); + // painter->fillRect ( textHighlightRect, opt.palette.brush ( cg, + // QPalette::Highlight ) ); + drawSelectionRect(painter, opt2, textHighlightRect); + drawFocusRect(painter, opt2, textHighlightRect); + } + } + */ + } + + // draw the icon + { + QIcon::Mode mode = QIcon::Normal; + if (!(opt.state & QStyle::State_Enabled)) + mode = QIcon::Disabled; + else if (opt.state & QStyle::State_Selected) + mode = QIcon::Selected; + QIcon::State state = opt.state & QStyle::State_Open ? QIcon::On : QIcon::Off; + + iconbox.setHeight(iconSize); + opt.icon.paint(painter, iconbox, Qt::AlignCenter, mode, state); + } + // set the text colors + QPalette::ColorGroup cg = + opt.state & QStyle::State_Enabled ? QPalette::Normal : QPalette::Disabled; + if (cg == QPalette::Normal && !(opt.state & QStyle::State_Active)) + cg = QPalette::Inactive; + if (opt.state & QStyle::State_Selected) + { + painter->setPen(opt.palette.color(cg, QPalette::HighlightedText)); + } + else + { + painter->setPen(opt.palette.color(cg, QPalette::Text)); + } + + // draw the text + QTextOption textOption; + textOption.setWrapMode(QTextOption::WrapAtWordBoundaryOrAnywhere); + textOption.setTextDirection(opt.direction); + textOption.setAlignment(QStyle::visualAlignment(opt.direction, opt.displayAlignment)); + QTextLayout textLayout; + textLayout.setTextOption(textOption); + textLayout.setFont(opt.font); + textLayout.setText(opt.text); + + qreal width, height; + viewItemTextLayout(textLayout, textRect.width(), height, width); + + const int lineCount = textLayout.lineCount(); + + const QRect layoutRect = QStyle::alignedRect( + opt.direction, opt.displayAlignment, QSize(textRect.width(), int(height)), textRect); + const QPointF position = layoutRect.topLeft(); + for (int i = 0; i < lineCount; ++i) + { + const QTextLine line = textLayout.lineAt(i); + line.draw(painter, position); + } + + // FIXME: this really has no business of being here. Make generic. + auto instance = (BaseInstance*)index.data(InstanceList::InstancePointerRole) + .value(); + if (instance) + { + drawBadges(painter, opt, instance); + } + + drawProgressOverlay(painter, opt, index.data(GroupViewRoles::ProgressValueRole).toInt(), + index.data(GroupViewRoles::ProgressMaximumRole).toInt()); + + painter->restore(); +} + +QSize ListViewDelegate::sizeHint(const QStyleOptionViewItem &option, + const QModelIndex &index) const +{ + QStyleOptionViewItemV4 opt = option; + initStyleOption(&opt, index); + opt.features |= QStyleOptionViewItem::WrapText; + opt.text = index.data().toString(); + opt.textElideMode = Qt::ElideRight; + opt.displayAlignment = Qt::AlignTop | Qt::AlignHCenter; + + QStyle *style = opt.widget ? opt.widget->style() : QApplication::style(); + const int textMargin = + style->pixelMetric(QStyle::PM_FocusFrameHMargin, &option, opt.widget) + 1; + int height = 48 + textMargin * 2 + 5; // TODO: turn constants into variables + QSize szz = viewItemTextSize(&opt); + height += szz.height(); + // FIXME: maybe the icon items could scale and keep proportions? + QSize sz(100, height); + return sz; +} + +QPixmap ListViewDelegate::requestBadgePixmap(const QString &key) +{ + if (!m_pixmapCache.contains(key)) + { + m_pixmapCache.insert(key, new QPixmap(":/icons/badges/" + key + ".png")); + } + return *m_pixmapCache.object(key); +} diff --git a/application/groupview/InstanceDelegate.h b/application/groupview/InstanceDelegate.h new file mode 100644 index 00000000..2b5439cb --- /dev/null +++ b/application/groupview/InstanceDelegate.h @@ -0,0 +1,35 @@ +/* Copyright 2013-2015 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include + +class ListViewDelegate : public QStyledItemDelegate +{ +public: + explicit ListViewDelegate(QObject *parent = 0); + + static QPixmap requestBadgePixmap(const QString &key); + +protected: + void paint(QPainter *painter, const QStyleOptionViewItem &option, + const QModelIndex &index) const; + QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const; + +private: + static QCache m_pixmapCache; +}; diff --git a/application/groupview/VisualGroup.cpp b/application/groupview/VisualGroup.cpp new file mode 100644 index 00000000..560fc9ca --- /dev/null +++ b/application/groupview/VisualGroup.cpp @@ -0,0 +1,301 @@ +#include "VisualGroup.h" + +#include +#include +#include +#include + +#include "GroupView.h" + +VisualGroup::VisualGroup(const QString &text, GroupView *view) : view(view), text(text), collapsed(false) +{ +} + +VisualGroup::VisualGroup(const VisualGroup *other) + : view(other->view), text(other->text), collapsed(other->collapsed) +{ +} + +void VisualGroup::update() +{ + auto temp_items = items(); + auto itemsPerRow = view->itemsPerRow(); + + int numRows = qMax(1, qCeil((qreal)temp_items.size() / (qreal)itemsPerRow)); + rows = QVector(numRows); + + int maxRowHeight = 0; + int positionInRow = 0; + int currentRow = 0; + int offsetFromTop = 0; + for (auto item: temp_items) + { + if(positionInRow == itemsPerRow) + { + rows[currentRow].height = maxRowHeight; + rows[currentRow].top = offsetFromTop; + currentRow ++; + offsetFromTop += maxRowHeight + 5; + positionInRow = 0; + maxRowHeight = 0; + } + auto itemHeight = view->itemDelegate()->sizeHint(view->viewOptions(), item).height(); + if(itemHeight > maxRowHeight) + { + maxRowHeight = itemHeight; + } + rows[currentRow].items.append(item); + positionInRow++; + } + rows[currentRow].height = maxRowHeight; + rows[currentRow].top = offsetFromTop; +} + +QPair VisualGroup::positionOf(const QModelIndex &index) const +{ + int x = 0; + int y = 0; + for (auto & row: rows) + { + for(auto x = 0; x < row.items.size(); x++) + { + if(row.items[x] == index) + { + return qMakePair(x,y); + } + } + y++; + } + return qMakePair(x, y); +} + +int VisualGroup::rowTopOf(const QModelIndex &index) const +{ + auto position = positionOf(index); + return rows[position.second].top; +} + +int VisualGroup::rowHeightOf(const QModelIndex &index) const +{ + auto position = positionOf(index); + return rows[position.second].height; +} + +VisualGroup::HitResults VisualGroup::hitScan(const QPoint &pos) const +{ + VisualGroup::HitResults results = VisualGroup::NoHit; + int y_start = verticalPosition(); + int body_start = y_start + headerHeight(); + int body_end = body_start + contentHeight() + 5; // FIXME: wtf is this 5? + int y = pos.y(); + // int x = pos.x(); + if (y < y_start) + { + results = VisualGroup::NoHit; + } + else if (y < body_start) + { + results = VisualGroup::HeaderHit; + int collapseSize = headerHeight() - 4; + + // the icon + QRect iconRect = QRect(view->m_leftMargin + 2, 2 + y_start, collapseSize, collapseSize); + if (iconRect.contains(pos)) + { + results |= VisualGroup::CheckboxHit; + } + } + else if (y < body_end) + { + results |= VisualGroup::BodyHit; + } + return results; +} + +void VisualGroup::drawHeader(QPainter *painter, const QStyleOptionViewItem &option) +{ + painter->setRenderHint(QPainter::Antialiasing); + + const QRect optRect = option.rect; + QFont font(QApplication::font()); + font.setBold(true); + const QFontMetrics fontMetrics = QFontMetrics(font); + + QColor outlineColor = option.palette.text().color(); + outlineColor.setAlphaF(0.35); + + //BEGIN: top left corner + { + painter->save(); + painter->setPen(outlineColor); + const QPointF topLeft(optRect.topLeft()); + QRectF arc(topLeft, QSizeF(4, 4)); + arc.translate(0.5, 0.5); + painter->drawArc(arc, 1440, 1440); + painter->restore(); + } + //END: top left corner + + //BEGIN: left vertical line + { + QPoint start(optRect.topLeft()); + start.ry() += 3; + QPoint verticalGradBottom(optRect.topLeft()); + verticalGradBottom.ry() += fontMetrics.height() + 5; + QLinearGradient gradient(start, verticalGradBottom); + gradient.setColorAt(0, outlineColor); + gradient.setColorAt(1, Qt::transparent); + painter->fillRect(QRect(start, QSize(1, fontMetrics.height() + 5)), gradient); + } + //END: left vertical line + + //BEGIN: horizontal line + { + QPoint start(optRect.topLeft()); + start.rx() += 3; + QPoint horizontalGradTop(optRect.topLeft()); + horizontalGradTop.rx() += optRect.width() - 6; + painter->fillRect(QRect(start, QSize(optRect.width() - 6, 1)), outlineColor); + } + //END: horizontal line + + //BEGIN: top right corner + { + painter->save(); + painter->setPen(outlineColor); + QPointF topRight(optRect.topRight()); + topRight.rx() -= 4; + QRectF arc(topRight, QSizeF(4, 4)); + arc.translate(0.5, 0.5); + painter->drawArc(arc, 0, 1440); + painter->restore(); + } + //END: top right corner + + //BEGIN: right vertical line + { + QPoint start(optRect.topRight()); + start.ry() += 3; + QPoint verticalGradBottom(optRect.topRight()); + verticalGradBottom.ry() += fontMetrics.height() + 5; + QLinearGradient gradient(start, verticalGradBottom); + gradient.setColorAt(0, outlineColor); + gradient.setColorAt(1, Qt::transparent); + painter->fillRect(QRect(start, QSize(1, fontMetrics.height() + 5)), gradient); + } + //END: right vertical line + + //BEGIN: checkboxy thing + { + painter->save(); + painter->setRenderHint(QPainter::Antialiasing, false); + painter->setFont(font); + QColor penColor(option.palette.text().color()); + penColor.setAlphaF(0.6); + painter->setPen(penColor); + QRect iconSubRect(option.rect); + iconSubRect.setTop(iconSubRect.top() + 7); + iconSubRect.setLeft(iconSubRect.left() + 7); + + int sizing = fontMetrics.height(); + int even = ( (sizing - 1) % 2 ); + + iconSubRect.setHeight(sizing - even); + iconSubRect.setWidth(sizing - even); + painter->drawRect(iconSubRect); + + + /* + if(collapsed) + painter->drawText(iconSubRect, Qt::AlignHCenter | Qt::AlignVCenter, "+"); + else + painter->drawText(iconSubRect, Qt::AlignHCenter | Qt::AlignVCenter, "-"); + */ + painter->setBrush(option.palette.text()); + painter->fillRect(iconSubRect.x(), iconSubRect.y() + iconSubRect.height() / 2, + iconSubRect.width(), 2, penColor); + if (collapsed) + { + painter->fillRect(iconSubRect.x() + iconSubRect.width() / 2, iconSubRect.y(), 2, + iconSubRect.height(), penColor); + } + + painter->restore(); + } + //END: checkboxy thing + + //BEGIN: text + { + QRect textRect(option.rect); + textRect.setTop(textRect.top() + 7); + textRect.setLeft(textRect.left() + 7 + fontMetrics.height() + 7); + textRect.setHeight(fontMetrics.height()); + textRect.setRight(textRect.right() - 7); + + painter->save(); + painter->setFont(font); + QColor penColor(option.palette.text().color()); + penColor.setAlphaF(0.6); + painter->setPen(penColor); + painter->drawText(textRect, Qt::AlignLeft | Qt::AlignVCenter, text); + painter->restore(); + } + //END: text +} + +int VisualGroup::totalHeight() const +{ + return headerHeight() + 5 + contentHeight(); // FIXME: wtf is that '5'? +} + +int VisualGroup::headerHeight() const +{ + QFont font(QApplication::font()); + font.setBold(true); + QFontMetrics fontMetrics(font); + + const int height = fontMetrics.height() + 1 /* 1 pixel-width gradient */ + + 11 /* top and bottom separation */; + return height; + /* + int raw = view->viewport()->fontMetrics().height() + 4; + // add english. maybe. depends on font height. + if (raw % 2 == 0) + raw++; + return std::min(raw, 25); + */ +} + +int VisualGroup::contentHeight() const +{ + if (collapsed) + { + return 0; + } + auto last = rows[numRows() - 1]; + return last.top + last.height; +} + +int VisualGroup::numRows() const +{ + return rows.size(); +} + +int VisualGroup::verticalPosition() const +{ + return m_verticalPosition; +} + +QList VisualGroup::items() const +{ + QList indices; + for (int i = 0; i < view->model()->rowCount(); ++i) + { + const QModelIndex index = view->model()->index(i, 0); + if (index.data(GroupViewRoles::GroupRole).toString() == text) + { + indices.append(index); + } + } + return indices; +} diff --git a/application/groupview/VisualGroup.h b/application/groupview/VisualGroup.h new file mode 100644 index 00000000..d8d1f145 --- /dev/null +++ b/application/groupview/VisualGroup.h @@ -0,0 +1,91 @@ +#pragma once + +#include +#include +#include +#include + +class GroupView; +class QPainter; +class QModelIndex; + +struct VisualRow +{ + QList items; + int height = 0; + int top = 0; + inline int size() const + { + return items.size(); + } + inline QModelIndex &operator[](int i) + { + return items[i]; + } +}; + +struct VisualGroup +{ +/* constructors */ + VisualGroup(const QString &text, GroupView *view); + VisualGroup(const VisualGroup *other); + +/* data */ + GroupView *view = nullptr; + QString text; + bool collapsed = false; + QVector rows; + int firstItemIndex = 0; + int m_verticalPosition = 0; + +/* logic */ + /// update the internal list of items and flow them into the rows. + void update(); + + /// draw the header at y-position. + void drawHeader(QPainter *painter, const QStyleOptionViewItem &option); + + /// height of the group, in total. includes a small bit of padding. + int totalHeight() const; + + /// height of the group header, in pixels + int headerHeight() const; + + /// height of the group content, in pixels + int contentHeight() const; + + /// the number of visual rows this group has + int numRows() const; + + /// actually calculate the above value + int calculateNumRows() const; + + /// the height at which this group starts, in pixels + int verticalPosition() const; + + /// relative geometry - top of the row of the given item + int rowTopOf(const QModelIndex &index) const; + + /// height of the row of the given item + int rowHeightOf(const QModelIndex &index) const; + + /// x/y position of the given item inside the group (in items!) + QPair positionOf(const QModelIndex &index) const; + + enum HitResult + { + NoHit = 0x0, + TextHit = 0x1, + CheckboxHit = 0x2, + HeaderHit = 0x4, + BodyHit = 0x8 + }; + Q_DECLARE_FLAGS(HitResults, HitResult) + + /// shoot! BANG! what did we hit? + HitResults hitScan (const QPoint &pos) const; + + QList items() const; +}; + +Q_DECLARE_OPERATORS_FOR_FLAGS(VisualGroup::HitResults) diff --git a/application/install_prereqs.cmake.in b/application/install_prereqs.cmake.in new file mode 100644 index 00000000..b8fa3177 --- /dev/null +++ b/application/install_prereqs.cmake.in @@ -0,0 +1,24 @@ +set(CMAKE_MODULE_PATH "@CMAKE_MODULE_PATH@") + +file(GLOB_RECURSE QTPLUGINS "${CMAKE_INSTALL_PREFIX}/@PLUGIN_DEST_DIR@/*@CMAKE_SHARED_LIBRARY_SUFFIX@") +function(gp_resolved_file_type_override resolved_file type_var) + if(resolved_file MATCHES "^/usr/lib/libQt") + message("resolving ${resolved_file} as other") + set(${type_var} other PARENT_SCOPE) + elseif(resolved_file MATCHES "^/usr/lib(.+)?/libxcb") + message("resolving ${resolved_file} as other") + set(${type_var} other PARENT_SCOPE) + elseif(resolved_file MATCHES "^/usr/lib(.+)?/libicu") + message("resolving ${resolved_file} as other") + set(${type_var} other PARENT_SCOPE) + endif() +endfunction() + +set(gp_tool "@CMAKE_GP_TOOL@") +set(gp_cmd_paths ${gp_cmd_paths} + "@CMAKE_GP_CMD_PATHS@" +) + +include(BundleUtilities) +fixup_bundle("@APPS@" "${QTPLUGINS}" "@DIRS@") + diff --git a/application/main.cpp b/application/main.cpp new file mode 100644 index 00000000..111a61ac --- /dev/null +++ b/application/main.cpp @@ -0,0 +1,43 @@ +#include "MultiMC.h" +#include "MainWindow.h" + +int main_gui(MultiMC &app) +{ + // show main window + app.setIconTheme(MMC->settings()->get("IconTheme").toString()); + MainWindow mainWin; + mainWin.restoreState(QByteArray::fromBase64(MMC->settings()->get("MainWindowState").toByteArray())); + mainWin.restoreGeometry(QByteArray::fromBase64(MMC->settings()->get("MainWindowGeometry").toByteArray())); + mainWin.show(); + mainWin.checkSetDefaultJava(); + mainWin.checkInstancePathForProblems(); + return app.exec(); +} + +int main(int argc, char *argv[]) +{ + // initialize Qt + MultiMC app(argc, argv); + + Q_INIT_RESOURCE(instances); + Q_INIT_RESOURCE(multimc); + Q_INIT_RESOURCE(backgrounds); + Q_INIT_RESOURCE(versions); + + Q_INIT_RESOURCE(pe_dark); + Q_INIT_RESOURCE(pe_light); + Q_INIT_RESOURCE(pe_blue); + Q_INIT_RESOURCE(pe_colored); + Q_INIT_RESOURCE(OSX); + Q_INIT_RESOURCE(iOS); + + switch (app.status()) + { + case MultiMC::Initialized: + return main_gui(app); + case MultiMC::Failed: + return 1; + case MultiMC::Succeeded: + return 0; + } +} diff --git a/application/package/linux/MultiMC b/application/package/linux/MultiMC new file mode 100755 index 00000000..80225e53 --- /dev/null +++ b/application/package/linux/MultiMC @@ -0,0 +1,80 @@ +#!/bin/bash +# Basic start script for running MultiMC with the libs packaged with it. + +function printerror { + printf "$1" + if which zenity >/dev/null; then zenity --error --text="$1" &>/dev/null; + elif which kdialog >/dev/null; then kdialog --error "$1" &>/dev/null; + fi +} + +if [[ $EUID -eq 0 ]]; then + printerror "This program should not be run using sudo or as the root user!\n" + exit 1 +fi + + +MMC_DIR="$(dirname "$(readlink -f "$0")")" +echo "MultiMC Dir: ${MMC_DIR}" + +# Set up env +export LD_LIBRARY_PATH="${MMC_DIR}/bin":$LD_LIBRARY_PATH +export QT_PLUGIN_PATH="${MMC_DIR}/plugins" +export QT_FONTPATH="${MMC_DIR}/fonts" + +# Detect missing dependencies... +DEPS_LIST=`ldd "${MMC_DIR}"/plugins/*/*.so 2>/dev/null | grep "not found" | awk -vORS=", " '{ print $1 }'` +if [ "x$DEPS_LIST" = "x" ]; then + # We have all our dependencies. Run MultiMC. + echo "No missing dependencies found." + + # Just to be sure... + chmod +x "${MMC_DIR}/bin/MultiMC" + + # Run MultiMC + "${MMC_DIR}/bin/MultiMC" -d "${MMC_DIR}" $@ + + # Run MultiMC in valgrind + # valgrind --log-file="valgrind.log" --leak-check=full --track-origins=yes "${MMC_DIR}/bin/MultiMC" -d "${MMC_DIR}" $@ + + # Exit with MultiMC's exit code. + exit $? +else + # apt + if which apt-file &>/dev/null; then + LIBRARIES=`echo "$DEPS_LIST" | grep -oP "[^, ]*"` + COMMAND_LIBS=`for LIBRARY in $LIBRARIES; do apt-file -l search $LIBRARY; done` + COMMAND_LIBS=`echo "$COMMAND_LIBS" | awk -vORS=" " '{ print $1 }'` + INSTALL_CMD="sudo apt-get install $COMMAND_LIBS" + # pacman + elif which pkgfile &>/dev/null; then + LIBRARIES=`echo "$DEPS_LIST" | grep -oP "[^, ]*"` + COMMAND_LIBS=`for LIBRARY in $LIBRARIES; do pkgfile $LIBRARY; done` + COMMAND_LIBS=`echo "$COMMAND_LIBS" | awk -vORS=" " '{ print $1 }'` + INSTALL_CMD="sudo pacman -S $COMMAND_LIBS" + # yum + elif which yum &>/dev/null; then + LIBRARIES=`echo "$DEPS_LIST" | grep -oP "[^, ]*"` + COMMAND_LIBS=`for LIBRARY in $LIBRARIES; do yum whatprovides $LIBRARY; done` + COMMAND_LIBS=`echo "$COMMAND_LIBS" | awk -vORS=" " '{ print $1 }'` + INSTALL_CMD="sudo yum install $COMMAND_LIBS" + # zypper + elif which zypper &>/dev/null; then + LIBRARIES=`echo "$DEPS_LIST" | grep -oP "[^, ]*"` + COMMAND_LIBS=`for LIBRARY in $LIBRARIES; do zypper wp $LIBRARY; done` + COMMAND_LIBS=`echo "$COMMAND_LIBS" | awk -vORS=" " '{ print $1 }'` + INSTALL_CMD="sudo zypper install $COMMAND_LIBS" + # emerge + elif which pfl &>/dev/null; then + LIBRARIES=`echo "$DEPS_LIST" | grep -oP "[^, ]*"` + COMMAND_LIBS=`for LIBRARY in $LIBRARIES; do pfl $LIBRARY; done` + COMMAND_LIBS=`echo "$COMMAND_LIBS" | awk -vORS=" " '{ print $1 }'` + INSTALL_CMD="sudo emerge $COMMAND_LIBS" + fi + + MESSAGE="Error: MultiMC is missing the following libraries that it needs to work correctly:\n\t${DEPS_LIST}\nPlease install them from your distribution's package manager." + MESSAGE="$MESSAGE\n\nHint: $INSTALL_CMD\n" + + printerror "$MESSAGE" + exit 1 +fi diff --git a/application/pagedialog/PageDialog.cpp b/application/pagedialog/PageDialog.cpp new file mode 100644 index 00000000..a930789e --- /dev/null +++ b/application/pagedialog/PageDialog.cpp @@ -0,0 +1,62 @@ +/* Copyright 2013-2015 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "PageDialog.h" + +#include +#include +#include +#include + +#include "MultiMC.h" +#include "settings/SettingsObject.h" +#include "Platform.h" +#include "widgets/IconLabel.h" +#include "widgets/PageContainer.h" + +PageDialog::PageDialog(BasePageProviderPtr pageProvider, QString defaultId, QWidget *parent) + : QDialog(parent) +{ + MultiMCPlatform::fixWM_CLASS(this); + setWindowTitle(pageProvider->dialogTitle()); + m_container = new PageContainer(pageProvider, defaultId, this); + + QVBoxLayout *mainLayout = new QVBoxLayout; + mainLayout->addWidget(m_container); + mainLayout->setSpacing(0); + mainLayout->setContentsMargins(0, 0, 0, 0); + setLayout(mainLayout); + + QDialogButtonBox *buttons = + new QDialogButtonBox(QDialogButtonBox::Help | QDialogButtonBox::Close); + buttons->button(QDialogButtonBox::Close)->setDefault(true); + m_container->addButtons(buttons); + + connect(buttons->button(QDialogButtonBox::Close), SIGNAL(clicked()), this, SLOT(close())); + connect(buttons->button(QDialogButtonBox::Help), SIGNAL(clicked()), m_container, + SLOT(help())); + + restoreGeometry( + QByteArray::fromBase64(MMC->settings()->get("PagedGeometry").toByteArray())); +} + +void PageDialog::closeEvent(QCloseEvent *event) +{ + if (m_container->requestClose(event)) + { + MMC->settings()->set("PagedGeometry", saveGeometry().toBase64()); + QDialog::closeEvent(event); + } +} diff --git a/application/pagedialog/PageDialog.h b/application/pagedialog/PageDialog.h new file mode 100644 index 00000000..8a31cd0a --- /dev/null +++ b/application/pagedialog/PageDialog.h @@ -0,0 +1,36 @@ +/* Copyright 2013-2015 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include "pages/BasePageProvider.h" + +class PageContainer; +class PageDialog : public QDialog +{ + Q_OBJECT +public: + explicit PageDialog(BasePageProviderPtr pageProvider, QString defaultId = QString(), + QWidget *parent = 0); + virtual ~PageDialog() {} + +private +slots: + virtual void closeEvent(QCloseEvent *event); + +private: + PageContainer * m_container; +}; diff --git a/application/pages/BasePage.h b/application/pages/BasePage.h new file mode 100644 index 00000000..ecf0692c --- /dev/null +++ b/application/pages/BasePage.h @@ -0,0 +1,38 @@ +/* Copyright 2013-2015 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include +#include + +class BasePage +{ +public: + virtual ~BasePage() {} + virtual QString id() const = 0; + virtual QString displayName() const = 0; + virtual QIcon icon() const = 0; + virtual bool apply() { return true; } + virtual bool shouldDisplay() const { return true; } + virtual QString helpPage() const { return QString(); } + virtual void opened() {} + virtual void closed() {} + int stackIndex = -1; + int listIndex = -1; +}; + +typedef std::shared_ptr BasePagePtr; diff --git a/application/pages/BasePageProvider.h b/application/pages/BasePageProvider.h new file mode 100644 index 00000000..c55683e0 --- /dev/null +++ b/application/pages/BasePageProvider.h @@ -0,0 +1,69 @@ +/* Copyright 2013-2015 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include "BasePage.h" +#include +#include + +class BasePageProvider +{ +public: + virtual QList getPages() = 0; + virtual QString dialogTitle() = 0; +}; + +class GenericPageProvider : public BasePageProvider +{ + typedef std::function PageCreator; +public: + explicit GenericPageProvider(const QString &dialogTitle) + : m_dialogTitle(dialogTitle) + { + } + + QList getPages() override + { + QList pages; + for (PageCreator creator : m_creators) + { + pages.append(creator()); + } + return pages; + } + QString dialogTitle() override { return m_dialogTitle; } + + void setDialogTitle(const QString &title) + { + m_dialogTitle = title; + } + void addPageCreator(PageCreator page) + { + m_creators.append(page); + } + + template + void addPage() + { + addPageCreator([](){return new PageClass();}); + } + +private: + QList m_creators; + QString m_dialogTitle; +}; + +typedef std::shared_ptr BasePageProviderPtr; diff --git a/application/pages/InstanceSettingsPage.cpp b/application/pages/InstanceSettingsPage.cpp new file mode 100644 index 00000000..1e571eff --- /dev/null +++ b/application/pages/InstanceSettingsPage.cpp @@ -0,0 +1,216 @@ +#include "InstanceSettingsPage.h" +#include "ui_InstanceSettingsPage.h" + +#include +#include +#include + +#include "dialogs/VersionSelectDialog.h" +#include "NagUtils.h" +#include "java/JavaVersionList.h" +#include "MultiMC.h" + +InstanceSettingsPage::InstanceSettingsPage(BaseInstance *inst, QWidget *parent) + : QWidget(parent), ui(new Ui::InstanceSettingsPage), m_instance(inst) +{ + m_settings = &(inst->settings()); + ui->setupUi(this); + loadSettings(); +} + +bool InstanceSettingsPage::shouldDisplay() const +{ + return !m_instance->isRunning(); +} + +InstanceSettingsPage::~InstanceSettingsPage() +{ + delete ui; +} + +bool InstanceSettingsPage::apply() +{ + applySettings(); + return true; +} + +void InstanceSettingsPage::applySettings() +{ + // Console + bool console = ui->consoleSettingsBox->isChecked(); + m_settings->set("OverrideConsole", console); + if (console) + { + m_settings->set("ShowConsole", ui->showConsoleCheck->isChecked()); + m_settings->set("AutoCloseConsole", ui->autoCloseConsoleCheck->isChecked()); + } + else + { + m_settings->reset("ShowConsole"); + m_settings->reset("AutoCloseConsole"); + } + + // Window Size + bool window = ui->windowSizeGroupBox->isChecked(); + m_settings->set("OverrideWindow", window); + if (window) + { + m_settings->set("LaunchMaximized", ui->maximizedCheckBox->isChecked()); + m_settings->set("MinecraftWinWidth", ui->windowWidthSpinBox->value()); + m_settings->set("MinecraftWinHeight", ui->windowHeightSpinBox->value()); + } + else + { + m_settings->reset("LaunchMaximized"); + m_settings->reset("MinecraftWinWidth"); + m_settings->reset("MinecraftWinHeight"); + } + + // Memory + bool memory = ui->memoryGroupBox->isChecked(); + m_settings->set("OverrideMemory", memory); + if (memory) + { + m_settings->set("MinMemAlloc", ui->minMemSpinBox->value()); + m_settings->set("MaxMemAlloc", ui->maxMemSpinBox->value()); + m_settings->set("PermGen", ui->permGenSpinBox->value()); + } + else + { + m_settings->reset("MinMemAlloc"); + m_settings->reset("MaxMemAlloc"); + m_settings->reset("PermGen"); + } + + // Java Install Settings + bool javaInstall = ui->javaSettingsGroupBox->isChecked(); + m_settings->set("OverrideJavaLocation", javaInstall); + if (javaInstall) + { + m_settings->set("JavaPath", ui->javaPathTextBox->text()); + } + else + { + m_settings->reset("JavaPath"); + } + + // Java arguments + bool javaArgs = ui->javaArgumentsGroupBox->isChecked(); + m_settings->set("OverrideJavaArgs", javaArgs); + if(javaArgs) + { + m_settings->set("JvmArgs", ui->jvmArgsTextBox->toPlainText().replace("\n", " ")); + NagUtils::checkJVMArgs(m_settings->get("JvmArgs").toString(), this->parentWidget()); + } + else + { + m_settings->reset("JvmArgs"); + } + + // old generic 'override both' is removed. + m_settings->reset("OverrideJava"); + + // Custom Commands + bool custcmd = ui->customCommandsGroupBox->isChecked(); + m_settings->set("OverrideCommands", custcmd); + if (custcmd) + { + m_settings->set("PreLaunchCommand", ui->preLaunchCmdTextBox->text()); + m_settings->set("PostExitCommand", ui->postExitCmdTextBox->text()); + } + else + { + m_settings->reset("PreLaunchCommand"); + m_settings->reset("PostExitCommand"); + } +} + +void InstanceSettingsPage::loadSettings() +{ + // Console + ui->consoleSettingsBox->setChecked(m_settings->get("OverrideConsole").toBool()); + ui->showConsoleCheck->setChecked(m_settings->get("ShowConsole").toBool()); + ui->autoCloseConsoleCheck->setChecked(m_settings->get("AutoCloseConsole").toBool()); + + // Window Size + ui->windowSizeGroupBox->setChecked(m_settings->get("OverrideWindow").toBool()); + ui->maximizedCheckBox->setChecked(m_settings->get("LaunchMaximized").toBool()); + ui->windowWidthSpinBox->setValue(m_settings->get("MinecraftWinWidth").toInt()); + ui->windowHeightSpinBox->setValue(m_settings->get("MinecraftWinHeight").toInt()); + + // Memory + ui->memoryGroupBox->setChecked(m_settings->get("OverrideMemory").toBool()); + ui->minMemSpinBox->setValue(m_settings->get("MinMemAlloc").toInt()); + ui->maxMemSpinBox->setValue(m_settings->get("MaxMemAlloc").toInt()); + ui->permGenSpinBox->setValue(m_settings->get("PermGen").toInt()); + + // Java Settings + bool overrideJava = m_settings->get("OverrideJava").toBool(); + bool overrideLocation = m_settings->get("OverrideJavaLocation").toBool() || overrideJava; + bool overrideArgs = m_settings->get("OverrideJavaArgs").toBool() || overrideJava; + + ui->javaSettingsGroupBox->setChecked(overrideLocation); + ui->javaPathTextBox->setText(m_settings->get("JavaPath").toString()); + + ui->javaArgumentsGroupBox->setChecked(overrideArgs); + ui->jvmArgsTextBox->setPlainText(m_settings->get("JvmArgs").toString()); + + // Custom Commands + ui->customCommandsGroupBox->setChecked(m_settings->get("OverrideCommands").toBool()); + ui->preLaunchCmdTextBox->setText(m_settings->get("PreLaunchCommand").toString()); + ui->postExitCmdTextBox->setText(m_settings->get("PostExitCommand").toString()); +} + +void InstanceSettingsPage::on_javaDetectBtn_clicked() +{ + JavaVersionPtr java; + + VersionSelectDialog vselect(MMC->javalist().get(), tr("Select a Java version"), this, true); + vselect.setResizeOn(2); + vselect.exec(); + + if (vselect.result() == QDialog::Accepted && vselect.selectedVersion()) + { + java = std::dynamic_pointer_cast(vselect.selectedVersion()); + ui->javaPathTextBox->setText(java->path); + } +} + +void InstanceSettingsPage::on_javaBrowseBtn_clicked() +{ + QString dir = QFileDialog::getOpenFileName(this, tr("Find Java executable")); + if (!dir.isNull()) + { + ui->javaPathTextBox->setText(dir); + } +} + +void InstanceSettingsPage::on_javaTestBtn_clicked() +{ + checker.reset(new JavaChecker()); + connect(checker.get(), SIGNAL(checkFinished(JavaCheckResult)), this, + SLOT(checkFinished(JavaCheckResult))); + checker->path = ui->javaPathTextBox->text(); + checker->performCheck(); +} + +void InstanceSettingsPage::checkFinished(JavaCheckResult result) +{ + if (result.valid) + { + QString text; + text += "Java test succeeded!\n"; + if (result.is_64bit) + text += "Using 64bit java.\n"; + text += "\n"; + text += "Platform reported: " + result.realPlatform; + QMessageBox::information(this, tr("Java test success"), text); + } + else + { + QMessageBox::warning( + this, tr("Java test failure"), + tr("The specified java binary didn't work. You should use the auto-detect feature, " + "or set the path to the java executable.")); + } +} diff --git a/application/pages/InstanceSettingsPage.h b/application/pages/InstanceSettingsPage.h new file mode 100644 index 00000000..85df5880 --- /dev/null +++ b/application/pages/InstanceSettingsPage.h @@ -0,0 +1,74 @@ +/* Copyright 2013-2015 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#include "net/NetJob.h" +#include "java/JavaChecker.h" +#include "BaseInstance.h" +#include "BasePage.h" +#include "MultiMC.h" + +class JavaChecker; +namespace Ui +{ +class InstanceSettingsPage; +} + +class InstanceSettingsPage : public QWidget, public BasePage +{ + Q_OBJECT + +public: + explicit InstanceSettingsPage(BaseInstance *inst, QWidget *parent = 0); + virtual ~InstanceSettingsPage(); + virtual QString displayName() const override + { + return tr("Settings"); + } + virtual QIcon icon() const override + { + return MMC->getThemedIcon("instance-settings"); + } + virtual QString id() const override + { + return "settings"; + } + virtual bool apply(); + virtual QString helpPage() const override + { + return "Instance-settings"; + } + virtual bool shouldDisplay() const; +private slots: + void on_javaDetectBtn_clicked(); + + void on_javaTestBtn_clicked(); + + void on_javaBrowseBtn_clicked(); + + void checkFinished(JavaCheckResult result); + + void applySettings(); + void loadSettings(); + +private: + Ui::InstanceSettingsPage *ui; + BaseInstance *m_instance; + SettingsObject *m_settings; + std::shared_ptr checker; +}; diff --git a/application/pages/InstanceSettingsPage.ui b/application/pages/InstanceSettingsPage.ui new file mode 100644 index 00000000..64109378 --- /dev/null +++ b/application/pages/InstanceSettingsPage.ui @@ -0,0 +1,453 @@ + + + InstanceSettingsPage + + + + 0 + 0 + 458 + 426 + + + + Form + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + QTabWidget::Rounded + + + 0 + + + + Java + + + + + + true + + + Java installation + + + true + + + false + + + + + + + + + Auto-detect... + + + + + + + Browse... + + + + + + + Test + + + + + + + + + + true + + + Memory + + + true + + + false + + + + + + The maximum amount of memory Minecraft is allowed to use. + + + MB + + + 512 + + + 65536 + + + 128 + + + 1024 + + + + + + + Minimum memory allocation: + + + + + + + Maximum memory allocation: + + + + + + + The amount of memory Minecraft is started with. + + + MB + + + 256 + + + 65536 + + + 128 + + + 256 + + + + + + + The amount of memory available to store loaded Java classes. + + + MB + + + 64 + + + 999999999 + + + 8 + + + 64 + + + + + + + PermGen: + + + + + + + + + + true + + + Java arguments + + + true + + + false + + + + + + + + + + + + Qt::Vertical + + + + 0 + 0 + + + + + + + + + Game windows + + + + + + true + + + Game Window + + + true + + + false + + + + + + Start Minecraft maximized? + + + + + + + + + Window height: + + + + + + + Window width: + + + + + + + 1 + + + 65536 + + + 1 + + + 854 + + + + + + + 1 + + + 65536 + + + 480 + + + + + + + + + + + + true + + + Console Settings + + + true + + + false + + + + + + Show console while the game is running? + + + + + + + Automatically close console when the game quits? + + + + + + + + + + Qt::Vertical + + + + 88 + 125 + + + + + + + + + Custom commands + + + + + + true + + + Custom Commands + + + true + + + false + + + + + + + + + Post-exit command: + + + + + + + Pre-launch command: + + + + + + + + + + + + + <html><head/><body><p>Pre-launch command runs before the instance launches and post-exit command runs after it exits.</p><p>Both will be run in MultiMC's working directory with extra environment variables:</p><ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">INST_NAME - Name of the instance</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">INST_ID - ID of the instance</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">INST_DIR - absolute path of the instance</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">INST_MC_DIR - absolute path of minecraft</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">INST_JAVA - java binary used for launch</li><li style=" margin-top:0px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">INST_JAVA_ARGS - command-line parameters used for launch</li></ul></body></html> + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + true + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + + + + + + + Qt::Vertical + + + + 88 + 186 + + + + + + + + + + + + settingsTabs + javaSettingsGroupBox + javaPathTextBox + javaDetectBtn + javaBrowseBtn + javaTestBtn + memoryGroupBox + minMemSpinBox + maxMemSpinBox + permGenSpinBox + javaArgumentsGroupBox + jvmArgsTextBox + windowSizeGroupBox + maximizedCheckBox + windowWidthSpinBox + windowHeightSpinBox + consoleSettingsBox + showConsoleCheck + autoCloseConsoleCheck + customCommandsGroupBox + preLaunchCmdTextBox + postExitCmdTextBox + + + + diff --git a/application/pages/LogPage.cpp b/application/pages/LogPage.cpp new file mode 100644 index 00000000..8f9edb96 --- /dev/null +++ b/application/pages/LogPage.cpp @@ -0,0 +1,222 @@ +#include "LogPage.h" +#include "ui_LogPage.h" + +#include "MultiMC.h" + +#include +#include +#include + +#include "BaseProcess.h" +#include "GuiUtil.h" + +LogPage::LogPage(BaseProcess *proc, QWidget *parent) + : QWidget(parent), ui(new Ui::LogPage), m_process(proc) +{ + ui->setupUi(this); + ui->tabWidget->tabBar()->hide(); + connect(m_process, SIGNAL(log(QString, MessageLevel::Enum)), this, + SLOT(write(QString, MessageLevel::Enum))); + + // create the format and set its font + defaultFormat = new QTextCharFormat(ui->text->currentCharFormat()); + QString fontFamily = MMC->settings()->get("ConsoleFont").toString(); + bool conversionOk = false; + int fontSize = MMC->settings()->get("ConsoleFontSize").toInt(&conversionOk); + if(!conversionOk) + { + fontSize = 11; + } + defaultFormat->setFont(QFont(fontFamily, fontSize)); + + auto findShortcut = new QShortcut(QKeySequence(QKeySequence::Find), this); + connect(findShortcut, SIGNAL(activated()), SLOT(findActivated())); + auto findNextShortcut = new QShortcut(QKeySequence(QKeySequence::FindNext), this); + connect(findNextShortcut, SIGNAL(activated()), SLOT(findNextActivated())); + connect(ui->searchBar, SIGNAL(returnPressed()), SLOT(on_findButton_clicked())); + auto findPreviousShortcut = new QShortcut(QKeySequence(QKeySequence::FindPrevious), this); + connect(findPreviousShortcut, SIGNAL(activated()), SLOT(findPreviousActivated())); +} + +LogPage::~LogPage() +{ + delete ui; + delete defaultFormat; +} + +bool LogPage::apply() +{ + return true; +} + +bool LogPage::shouldDisplay() const +{ + return m_process->instance()->isRunning(); +} + +void LogPage::on_btnPaste_clicked() +{ + GuiUtil::uploadPaste(ui->text->toPlainText(), this); +} + +void LogPage::on_btnCopy_clicked() +{ + GuiUtil::setClipboardText(ui->text->toPlainText()); +} + +void LogPage::on_btnClear_clicked() +{ + ui->text->clear(); +} + +void LogPage::on_trackLogCheckbox_clicked(bool checked) +{ + m_write_active = checked; +} + +void LogPage::on_findButton_clicked() +{ + auto modifiers = QApplication::keyboardModifiers(); + if (modifiers & Qt::ShiftModifier) + { + findPreviousActivated(); + } + else + { + findNextActivated(); + } +} + +void LogPage::findActivated() +{ + // focus the search bar if it doesn't have focus + if (!ui->searchBar->hasFocus()) + { + auto searchForCursor = ui->text->textCursor(); + auto searchForString = searchForCursor.selectedText(); + if (searchForString.size()) + { + ui->searchBar->setText(searchForString); + } + ui->searchBar->setFocus(); + ui->searchBar->selectAll(); + } +} + +void LogPage::findNextActivated() +{ + auto toSearch = ui->searchBar->text(); + if (toSearch.size()) + { + ui->text->find(toSearch); + } +} + +void LogPage::findPreviousActivated() +{ + auto toSearch = ui->searchBar->text(); + if (toSearch.size()) + { + ui->text->find(toSearch, QTextDocument::FindBackward); + } +} + +void LogPage::write(QString data, MessageLevel::Enum mode) +{ + if (!m_write_active) + { + if (mode != MessageLevel::PrePost && mode != MessageLevel::MultiMC) + { + return; + } + } + + // save the cursor so it can be restored. + auto savedCursor = ui->text->cursor(); + + QScrollBar *bar = ui->text->verticalScrollBar(); + int max_bar = bar->maximum(); + int val_bar = bar->value(); + if (isVisible()) + { + if (m_scroll_active) + { + m_scroll_active = (max_bar - val_bar) <= 1; + } + else + { + m_scroll_active = val_bar == max_bar; + } + } + if (data.endsWith('\n')) + data = data.left(data.length() - 1); + QStringList paragraphs = data.split('\n'); + QStringList filtered; + for (QString ¶graph : paragraphs) + { + //TODO: implement filtering here. + filtered.append(paragraph); + } + QListIterator iter(filtered); + QTextCharFormat format(*defaultFormat); + + switch(mode) + { + case MessageLevel::MultiMC: + { + format.setForeground(QColor("blue")); + break; + } + case MessageLevel::Debug: + { + format.setForeground(QColor("green")); + break; + } + case MessageLevel::Warning: + { + format.setForeground(QColor("orange")); + break; + } + case MessageLevel::Error: + { + format.setForeground(QColor("red")); + break; + } + case MessageLevel::Fatal: + { + format.setForeground(QColor("red")); + format.setBackground(QColor("black")); + break; + } + case MessageLevel::PrePost: + { + format.setForeground(QColor("grey")); + break; + } + case MessageLevel::Info: + case MessageLevel::Message: + default: + { + // do nothing, keep original + } + } + + while (iter.hasNext()) + { + // append a paragraph/line + auto workCursor = ui->text->textCursor(); + workCursor.movePosition(QTextCursor::End); + workCursor.insertText(iter.next(), format); + workCursor.insertBlock(); + } + + if (isVisible()) + { + if (m_scroll_active) + { + bar->setValue(bar->maximum()); + } + m_last_scroll_value = bar->value(); + } + ui->text->setCursor(savedCursor); +} diff --git a/application/pages/LogPage.h b/application/pages/LogPage.h new file mode 100644 index 00000000..fe7bbecb --- /dev/null +++ b/application/pages/LogPage.h @@ -0,0 +1,86 @@ +/* Copyright 2013-2015 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#include "BaseInstance.h" +#include "net/NetJob.h" +#include "BaseProcess.h" +#include "BasePage.h" +#include + +namespace Ui +{ +class LogPage; +} +class QTextCharFormat; + +class LogPage : public QWidget, public BasePage +{ + Q_OBJECT + +public: + explicit LogPage(BaseProcess *proc, QWidget *parent = 0); + virtual ~LogPage(); + virtual QString displayName() const override + { + return tr("Minecraft Log"); + } + virtual QIcon icon() const override + { + return MMC->getThemedIcon("log"); + } + virtual QString id() const override + { + return "console"; + } + virtual bool apply(); + virtual QString helpPage() const override + { + return "Minecraft-Logs"; + } + virtual bool shouldDisplay() const; + +private slots: + /** + * @brief write a string + * @param data the string + * @param mode the WriteMode + * lines have to be put through this as a whole! + */ + void write(QString data, MessageLevel::Enum level = MessageLevel::MultiMC); + void on_btnPaste_clicked(); + void on_btnCopy_clicked(); + void on_btnClear_clicked(); + + void on_trackLogCheckbox_clicked(bool checked); + + void on_findButton_clicked(); + void findActivated(); + void findNextActivated(); + void findPreviousActivated(); + +private: + Ui::LogPage *ui; + BaseProcess *m_process; + int m_last_scroll_value = 0; + bool m_scroll_active = true; + int m_saved_offset = 0; + bool m_write_active = true; + + QTextCharFormat * defaultFormat; +}; diff --git a/application/pages/LogPage.ui b/application/pages/LogPage.ui new file mode 100644 index 00000000..089bc906 --- /dev/null +++ b/application/pages/LogPage.ui @@ -0,0 +1,140 @@ + + + LogPage + + + + 0 + 0 + 825 + 782 + + + + Log + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + + Tab 1 + + + + + + Search: + + + + + + + Find + + + + + + + false + + + true + + + + + + Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + + + false + + + + + + + + + Keep updating + + + true + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Copy the whole log into the clipboard + + + &Copy + + + + + + + Upload the log to paste.ee - it will stay online for a month + + + Upload + + + + + + + Clear the log + + + Clear + + + + + + + + + + + + + + + + + diff --git a/application/pages/ModFolderPage.cpp b/application/pages/ModFolderPage.cpp new file mode 100644 index 00000000..3c55aefc --- /dev/null +++ b/application/pages/ModFolderPage.cpp @@ -0,0 +1,160 @@ +/* Copyright 2013-2015 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "ModFolderPage.h" +#include "ui_ModFolderPage.h" + +#include +#include +#include +#include +#include +#include + +#include + +#include "MultiMC.h" +#include "dialogs/CustomMessageBox.h" +#include "dialogs/ModEditDialogCommon.h" +#include "minecraft/ModList.h" +#include "minecraft/Mod.h" +#include "minecraft/VersionFilterData.h" + +ModFolderPage::ModFolderPage(BaseInstance *inst, std::shared_ptr mods, QString id, + QString iconName, QString displayName, QString helpPage, + QWidget *parent) + : QWidget(parent), ui(new Ui::ModFolderPage) +{ + ui->setupUi(this); + ui->tabWidget->tabBar()->hide(); + m_inst = inst; + m_mods = mods; + m_id = id; + m_displayName = displayName; + m_iconName = iconName; + m_helpName = helpPage; + ui->modTreeView->setModel(m_mods.get()); + ui->modTreeView->installEventFilter(this); + m_mods->startWatching(); + auto smodel = ui->modTreeView->selectionModel(); + connect(smodel, SIGNAL(currentChanged(QModelIndex, QModelIndex)), + SLOT(modCurrent(QModelIndex, QModelIndex))); +} + +CoreModFolderPage::CoreModFolderPage(BaseInstance *inst, std::shared_ptr mods, + QString id, QString iconName, QString displayName, + QString helpPage, QWidget *parent) + : ModFolderPage(inst, mods, id, iconName, displayName, helpPage, parent) +{ +} + +ModFolderPage::~ModFolderPage() +{ + m_mods->stopWatching(); + delete ui; +} + +bool ModFolderPage::shouldDisplay() const +{ + if (m_inst) + return !m_inst->isRunning(); + return true; +} + +bool CoreModFolderPage::shouldDisplay() const +{ + if (ModFolderPage::shouldDisplay()) + { + auto inst = dynamic_cast(m_inst); + if (!inst) + return true; + auto version = inst->getMinecraftProfile(); + if (!version) + return true; + if (version->m_releaseTime < g_VersionFilterData.legacyCutoffDate) + { + return true; + } + } + return false; +} + +bool ModFolderPage::modListFilter(QKeyEvent *keyEvent) +{ + switch (keyEvent->key()) + { + case Qt::Key_Delete: + on_rmModBtn_clicked(); + return true; + case Qt::Key_Plus: + on_addModBtn_clicked(); + return true; + default: + break; + } + return QWidget::eventFilter(ui->modTreeView, keyEvent); +} + +bool ModFolderPage::eventFilter(QObject *obj, QEvent *ev) +{ + if (ev->type() != QEvent::KeyPress) + { + return QWidget::eventFilter(obj, ev); + } + QKeyEvent *keyEvent = static_cast(ev); + if (obj == ui->modTreeView) + return modListFilter(keyEvent); + return QWidget::eventFilter(obj, ev); +} + +void ModFolderPage::on_addModBtn_clicked() +{ + QStringList fileNames = QFileDialog::getOpenFileNames( + this, QApplication::translate("ModFolderPage", "Select Loader Mods")); + for (auto filename : fileNames) + { + m_mods->stopWatching(); + m_mods->installMod(QFileInfo(filename)); + m_mods->startWatching(); + } +} +void ModFolderPage::on_rmModBtn_clicked() +{ + int first, last; + auto list = ui->modTreeView->selectionModel()->selectedRows(); + + if (!lastfirst(list, first, last)) + return; + m_mods->stopWatching(); + m_mods->deleteMods(first, last); + m_mods->startWatching(); +} + +void ModFolderPage::on_viewModBtn_clicked() +{ + openDirInDefaultProgram(m_mods->dir().absolutePath(), true); +} + +void ModFolderPage::modCurrent(const QModelIndex ¤t, const QModelIndex &previous) +{ + if (!current.isValid()) + { + ui->frame->clear(); + return; + } + int row = current.row(); + Mod &m = m_mods->operator[](row); + ui->frame->updateWithMod(m); +} diff --git a/application/pages/ModFolderPage.h b/application/pages/ModFolderPage.h new file mode 100644 index 00000000..4e89f85f --- /dev/null +++ b/application/pages/ModFolderPage.h @@ -0,0 +1,94 @@ +/* Copyright 2013-2015 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#include "minecraft/OneSixInstance.h" +#include "net/NetJob.h" +#include "BasePage.h" +#include + +class ModList; +namespace Ui +{ +class ModFolderPage; +} + +class ModFolderPage : public QWidget, public BasePage +{ + Q_OBJECT + +public: + explicit ModFolderPage(BaseInstance *inst, std::shared_ptr mods, QString id, + QString iconName, QString displayName, QString helpPage = "", + QWidget *parent = 0); + virtual ~ModFolderPage(); + virtual QString displayName() const override + { + return m_displayName; + } + virtual QIcon icon() const override + { + return MMC->getThemedIcon(m_iconName); + } + virtual QString id() const override + { + return m_id; + } + virtual QString helpPage() const override + { + return m_helpName; + } + virtual bool shouldDisplay() const; + +protected: + bool eventFilter(QObject *obj, QEvent *ev); + bool modListFilter(QKeyEvent *ev); + +protected: + BaseInstance *m_inst; + +private: + Ui::ModFolderPage *ui; + std::shared_ptr m_mods; + QString m_iconName; + QString m_id; + QString m_displayName; + QString m_helpName; + +public +slots: + void modCurrent(const QModelIndex ¤t, const QModelIndex &previous); + +private +slots: + void on_addModBtn_clicked(); + void on_rmModBtn_clicked(); + void on_viewModBtn_clicked(); +}; + +class CoreModFolderPage : public ModFolderPage +{ +public: + explicit CoreModFolderPage(BaseInstance *inst, std::shared_ptr mods, QString id, + QString iconName, QString displayName, QString helpPage = "", + QWidget *parent = 0); + virtual ~CoreModFolderPage() + { + } + virtual bool shouldDisplay() const; +}; diff --git a/application/pages/ModFolderPage.ui b/application/pages/ModFolderPage.ui new file mode 100644 index 00000000..353b62c5 --- /dev/null +++ b/application/pages/ModFolderPage.ui @@ -0,0 +1,124 @@ + + + ModFolderPage + + + + 0 + 0 + 723 + 532 + + + + Mods + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + + Tab 1 + + + + + + + 0 + 0 + + + + true + + + QAbstractItemView::DropOnly + + + + + + + + + &Add + + + + + + + &Remove + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + &View Folder + + + + + + + + + + 0 + 0 + + + + + + + + + + + + + ModListView + QTreeView +
    widgets/ModListView.h
    +
    + + MCModInfoFrame + QFrame +
    widgets/MCModInfoFrame.h
    + 1 +
    +
    + + +
    diff --git a/application/pages/NotesPage.cpp b/application/pages/NotesPage.cpp new file mode 100644 index 00000000..48bb468c --- /dev/null +++ b/application/pages/NotesPage.cpp @@ -0,0 +1,21 @@ +#include "NotesPage.h" +#include "ui_NotesPage.h" + +NotesPage::NotesPage(BaseInstance *inst, QWidget *parent) + : QWidget(parent), ui(new Ui::NotesPage), m_inst(inst) +{ + ui->setupUi(this); + ui->tabWidget->tabBar()->hide(); + ui->noteEditor->setText(m_inst->notes()); +} + +NotesPage::~NotesPage() +{ + delete ui; +} + +bool NotesPage::apply() +{ + m_inst->setNotes(ui->noteEditor->toPlainText()); + return true; +} diff --git a/application/pages/NotesPage.h b/application/pages/NotesPage.h new file mode 100644 index 00000000..62e0c692 --- /dev/null +++ b/application/pages/NotesPage.h @@ -0,0 +1,61 @@ +/* Copyright 2013-2015 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#include "BaseInstance.h" +#include "net/NetJob.h" +#include "BasePage.h" +#include + +namespace Ui +{ +class NotesPage; +} + +class NotesPage : public QWidget, public BasePage +{ + Q_OBJECT + +public: + explicit NotesPage(BaseInstance *inst, QWidget *parent = 0); + virtual ~NotesPage(); + virtual QString displayName() const override + { + return tr("Notes"); + } + virtual QIcon icon() const override + { + auto icon = MMC->getThemedIcon("notes"); + if(icon.isNull()) + icon = MMC->getThemedIcon("news"); + return icon; + } + virtual QString id() const override + { + return "notes"; + } + virtual bool apply(); + virtual QString helpPage() const override + { + return "Notes"; + } + +private: + Ui::NotesPage *ui; + BaseInstance *m_inst; +}; diff --git a/application/pages/NotesPage.ui b/application/pages/NotesPage.ui new file mode 100644 index 00000000..8da01c8b --- /dev/null +++ b/application/pages/NotesPage.ui @@ -0,0 +1,60 @@ + + + NotesPage + + + + 0 + 0 + 731 + 538 + + + + Form + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + + Tab 1 + + + + + + Qt::ScrollBarAlwaysOn + + + false + + + Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextEditable|Qt::TextEditorInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + + + + + + + + + + + + diff --git a/application/pages/OtherLogsPage.cpp b/application/pages/OtherLogsPage.cpp new file mode 100644 index 00000000..b037a6c7 --- /dev/null +++ b/application/pages/OtherLogsPage.cpp @@ -0,0 +1,150 @@ +/* Copyright 2013-2015 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "OtherLogsPage.h" +#include "ui_OtherLogsPage.h" + +#include +#include + +#include "GuiUtil.h" +#include "RecursiveFileSystemWatcher.h" +#include + +OtherLogsPage::OtherLogsPage(QString path, QWidget *parent) + : QWidget(parent), ui(new Ui::OtherLogsPage), m_path(path), + m_watcher(new RecursiveFileSystemWatcher(this)) +{ + ui->setupUi(this); + ui->tabWidget->tabBar()->hide(); + + m_watcher->setFileExpression("(.*\\.log(\\.[0-9]*)?$)|(crash-.*\\.txt)"); + m_watcher->setRootDir(QDir::current().absoluteFilePath(m_path)); + + connect(m_watcher, &RecursiveFileSystemWatcher::filesChanged, this, + &OtherLogsPage::populateSelectLogBox); + populateSelectLogBox(); +} + +OtherLogsPage::~OtherLogsPage() +{ + delete ui; +} + +void OtherLogsPage::opened() +{ + m_watcher->enable(); +} +void OtherLogsPage::closed() +{ + m_watcher->disable(); +} + +void OtherLogsPage::populateSelectLogBox() +{ + ui->selectLogBox->clear(); + ui->selectLogBox->addItems(m_watcher->files()); + if (m_currentFile.isNull()) + { + ui->selectLogBox->setCurrentIndex(-1); + } + else + { + const int index = ui->selectLogBox->findText(m_currentFile); + if (index != -1) + ui->selectLogBox->setCurrentIndex(index); + } +} + +void OtherLogsPage::on_selectLogBox_currentIndexChanged(const int index) +{ + QString file; + if (index != -1) + { + file = ui->selectLogBox->itemText(index); + } + + if (file.isEmpty() || !QFile::exists(PathCombine(m_path, file))) + { + m_currentFile = QString(); + ui->text->clear(); + setControlsEnabled(false); + } + else + { + m_currentFile = file; + on_btnReload_clicked(); + setControlsEnabled(true); + } +} + +void OtherLogsPage::on_btnReload_clicked() +{ + QFile file(PathCombine(m_path, m_currentFile)); + if (!file.open(QFile::ReadOnly)) + { + setControlsEnabled(false); + ui->btnReload->setEnabled(true); // allow reload + m_currentFile = QString(); + QMessageBox::critical(this, tr("Error"), tr("Unable to open %1 for reading: %2") + .arg(m_currentFile, file.errorString())); + } + else + { + if (file.size() < 10000000ll) + { + ui->text->setPlainText(QString::fromUtf8(file.readAll())); + } + else + { + ui->text->setPlainText( + tr("The file (%1) is too big. You may want to open it in a viewer optimized " + "for large files.").arg(file.fileName())); + } + } +} + +void OtherLogsPage::on_btnPaste_clicked() +{ + GuiUtil::uploadPaste(ui->text->toPlainText(), this); +} +void OtherLogsPage::on_btnCopy_clicked() +{ + GuiUtil::setClipboardText(ui->text->toPlainText()); +} +void OtherLogsPage::on_btnDelete_clicked() +{ + if (QMessageBox::question(this, tr("Delete"), + tr("Do you really want to delete %1?").arg(m_currentFile), + QMessageBox::Yes, QMessageBox::No) == QMessageBox::No) + { + return; + } + QFile file(PathCombine(m_path, m_currentFile)); + if (!file.remove()) + { + QMessageBox::critical(this, tr("Error"), tr("Unable to delete %1: %2") + .arg(m_currentFile, file.errorString())); + } +} + +void OtherLogsPage::setControlsEnabled(const bool enabled) +{ + ui->btnReload->setEnabled(enabled); + ui->btnDelete->setEnabled(enabled); + ui->btnCopy->setEnabled(enabled); + ui->btnPaste->setEnabled(enabled); + ui->text->setEnabled(enabled); +} diff --git a/application/pages/OtherLogsPage.h b/application/pages/OtherLogsPage.h new file mode 100644 index 00000000..d6e4ec9f --- /dev/null +++ b/application/pages/OtherLogsPage.h @@ -0,0 +1,72 @@ +/* Copyright 2013-2015 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#include "BasePage.h" +#include + +namespace Ui +{ +class OtherLogsPage; +} + +class RecursiveFileSystemWatcher; + +class OtherLogsPage : public QWidget, public BasePage +{ + Q_OBJECT + +public: + explicit OtherLogsPage(QString path, QWidget *parent = 0); + ~OtherLogsPage(); + + QString id() const override + { + return "logs"; + } + QString displayName() const override + { + return tr("Other logs"); + } + QIcon icon() const override + { + return MMC->getThemedIcon("log"); + } + QString helpPage() const override + { + return "Minecraft-Logs"; + } + void opened() override; + void closed() override; + +private slots: + void populateSelectLogBox(); + void on_selectLogBox_currentIndexChanged(const int index); + void on_btnReload_clicked(); + void on_btnPaste_clicked(); + void on_btnCopy_clicked(); + void on_btnDelete_clicked(); + +private: + Ui::OtherLogsPage *ui; + QString m_path; + RecursiveFileSystemWatcher *m_watcher; + QString m_currentFile; + + void setControlsEnabled(const bool enabled); +}; diff --git a/application/pages/OtherLogsPage.ui b/application/pages/OtherLogsPage.ui new file mode 100644 index 00000000..08200684 --- /dev/null +++ b/application/pages/OtherLogsPage.ui @@ -0,0 +1,117 @@ + + + OtherLogsPage + + + + 0 + 0 + 657 + 538 + + + + Form + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + + Tab 1 + + + + + + + + + 0 + 0 + + + + + + + + Reload + + + + + + + Copy the whole log into the clipboard + + + &Copy + + + + + + + Upload the log to paste.ee - it will stay online for a month + + + Upload + + + + + + + Clear the log + + + Delete + + + + + + + + + false + + + Qt::ScrollBarAlwaysOn + + + true + + + Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + + + + + + + + + + + text + + + + diff --git a/application/pages/ResourcePackPage.h b/application/pages/ResourcePackPage.h new file mode 100644 index 00000000..d79590df --- /dev/null +++ b/application/pages/ResourcePackPage.h @@ -0,0 +1,19 @@ +#pragma once +#include "ModFolderPage.h" + +class ResourcePackPage : public ModFolderPage +{ +public: + explicit ResourcePackPage(MinecraftInstance *instance, QWidget *parent = 0) + : ModFolderPage(instance, instance->resourcePackList(), "resourcepacks", + "resourcepacks", tr("Resource packs"), "Resource-packs", parent) + { + } + + virtual ~ResourcePackPage() {} + virtual bool shouldDisplay() const override + { + return !m_inst->traits().contains("no-texturepacks") && + !m_inst->traits().contains("texturepacks"); + } +}; diff --git a/application/pages/ScreenshotsPage.cpp b/application/pages/ScreenshotsPage.cpp new file mode 100644 index 00000000..c81de407 --- /dev/null +++ b/application/pages/ScreenshotsPage.cpp @@ -0,0 +1,362 @@ +#include "ScreenshotsPage.h" +#include "ui_ScreenshotsPage.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "dialogs/ProgressDialog.h" +#include "dialogs/CustomMessageBox.h" +#include "net/NetJob.h" +#include "screenshots/ImgurUpload.h" +#include "screenshots/ImgurAlbumCreation.h" +#include "tasks/SequentialTask.h" + +#include "RWStorage.h" + +typedef RWStorage SharedIconCache; +typedef std::shared_ptr SharedIconCachePtr; + +class ThumbnailingResult : public QObject +{ + Q_OBJECT +public slots: + inline void emitResultsReady(const QString &path) { emit resultsReady(path); } + inline void emitResultsFailed(const QString &path) { emit resultsFailed(path); } +signals: + void resultsReady(const QString &path); + void resultsFailed(const QString &path); +}; + +class ThumbnailRunnable : public QRunnable +{ +public: + ThumbnailRunnable(QString path, SharedIconCachePtr cache) + { + m_path = path; + m_cache = cache; + } + void run() + { + QFileInfo info(m_path); + if (info.isDir()) + return; + if ((info.suffix().compare("png", Qt::CaseInsensitive) != 0)) + return; + int tries = 5; + while (tries) + { + if (!m_cache->stale(m_path)) + return; + QImage image(m_path); + if (image.isNull()) + { + QThread::msleep(500); + tries--; + continue; + } + QImage small; + if (image.width() > image.height()) + small = image.scaledToWidth(512).scaledToWidth(256, Qt::SmoothTransformation); + else + small = image.scaledToHeight(512).scaledToHeight(256, Qt::SmoothTransformation); + auto smallSize = small.size(); + QPoint offset((256 - small.width()) / 2, (256 - small.height()) / 2); + QImage square(QSize(256, 256), QImage::Format_ARGB32); + square.fill(Qt::transparent); + + QPainter painter(&square); + painter.drawImage(offset, small); + painter.end(); + + QIcon icon(QPixmap::fromImage(square)); + m_cache->add(m_path, icon); + m_resultEmitter.emitResultsReady(m_path); + return; + } + m_resultEmitter.emitResultsFailed(m_path); + } + QString m_path; + SharedIconCachePtr m_cache; + ThumbnailingResult m_resultEmitter; +}; + +// this is about as elegant and well written as a bag of bricks with scribbles done by insane +// asylum patients. +class FilterModel : public QIdentityProxyModel +{ + Q_OBJECT +public: + explicit FilterModel(QObject *parent = 0) : QIdentityProxyModel(parent) + { + m_thumbnailingPool.setMaxThreadCount(4); + m_thumbnailCache = std::make_shared(); + m_thumbnailCache->add("placeholder", MMC->getThemedIcon("screenshot-placeholder")); + connect(&watcher, SIGNAL(fileChanged(QString)), SLOT(fileChanged(QString))); + // FIXME: the watched file set is not updated when files are removed + } + virtual ~FilterModel() { m_thumbnailingPool.waitForDone(500); } + virtual QVariant data(const QModelIndex &proxyIndex, int role = Qt::DisplayRole) const + { + auto model = sourceModel(); + if (!model) + return QVariant(); + if (role == Qt::DisplayRole || role == Qt::EditRole) + { + QVariant result = sourceModel()->data(mapToSource(proxyIndex), role); + return result.toString().remove(QRegExp("\\.png$")); + } + if (role == Qt::DecorationRole) + { + QVariant result = + sourceModel()->data(mapToSource(proxyIndex), QFileSystemModel::FilePathRole); + QString filePath = result.toString(); + QIcon temp; + if (!watched.contains(filePath)) + { + ((QFileSystemWatcher &)watcher).addPath(filePath); + ((QSet &)watched).insert(filePath); + } + if (m_thumbnailCache->get(filePath, temp)) + { + return temp; + } + if (!m_failed.contains(filePath)) + { + ((FilterModel *)this)->thumbnailImage(filePath); + } + return (m_thumbnailCache->get("placeholder")); + } + return sourceModel()->data(mapToSource(proxyIndex), role); + } + virtual bool setData(const QModelIndex &index, const QVariant &value, + int role = Qt::EditRole) + { + auto model = sourceModel(); + if (!model) + return false; + if (role != Qt::EditRole) + return false; + // FIXME: this is a workaround for a bug in QFileSystemModel, where it doesn't + // sort after renames + { + ((QFileSystemModel *)model)->setNameFilterDisables(true); + ((QFileSystemModel *)model)->setNameFilterDisables(false); + } + return model->setData(mapToSource(index), value.toString() + ".png", role); + } + +private: + void thumbnailImage(QString path) + { + auto runnable = new ThumbnailRunnable(path, m_thumbnailCache); + connect(&(runnable->m_resultEmitter), SIGNAL(resultsReady(QString)), + SLOT(thumbnailReady(QString))); + connect(&(runnable->m_resultEmitter), SIGNAL(resultsFailed(QString)), + SLOT(thumbnailFailed(QString))); + ((QThreadPool &)m_thumbnailingPool).start(runnable); + } +private slots: + void thumbnailReady(QString path) { emit layoutChanged(); } + void thumbnailFailed(QString path) { m_failed.insert(path); } + void fileChanged(QString filepath) + { + m_thumbnailCache->setStale(filepath); + thumbnailImage(filepath); + // reinsert the path... + watcher.removePath(filepath); + watcher.addPath(filepath); + } + +private: + SharedIconCachePtr m_thumbnailCache; + QThreadPool m_thumbnailingPool; + QSet m_failed; + QSet watched; + QFileSystemWatcher watcher; +}; + +class CenteredEditingDelegate : public QStyledItemDelegate +{ +public: + explicit CenteredEditingDelegate(QObject *parent = 0) : QStyledItemDelegate(parent) {} + virtual ~CenteredEditingDelegate() {} + virtual QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, + const QModelIndex &index) const + { + auto widget = QStyledItemDelegate::createEditor(parent, option, index); + auto foo = dynamic_cast(widget); + if (foo) + { + foo->setAlignment(Qt::AlignHCenter); + foo->setFrame(true); + foo->setMaximumWidth(192); + } + return widget; + } +}; + +ScreenshotsPage::ScreenshotsPage(QString path, QWidget *parent) + : QWidget(parent), ui(new Ui::ScreenshotsPage) +{ + m_model.reset(new QFileSystemModel()); + m_filterModel.reset(new FilterModel()); + m_filterModel->setSourceModel(m_model.get()); + m_model->setFilter(QDir::Files | QDir::Writable | QDir::Readable); + m_model->setReadOnly(false); + m_model->setNameFilters({"*.png"}); + m_model->setNameFilterDisables(false); + m_folder = path; + m_valid = ensureFolderPathExists(m_folder); + + ui->setupUi(this); + ui->tabWidget->tabBar()->hide(); + ui->listView->setModel(m_filterModel.get()); + ui->listView->setIconSize(QSize(128, 128)); + ui->listView->setGridSize(QSize(192, 160)); + ui->listView->setSpacing(9); + // ui->listView->setUniformItemSizes(true); + ui->listView->setLayoutMode(QListView::Batched); + ui->listView->setViewMode(QListView::IconMode); + ui->listView->setResizeMode(QListView::Adjust); + ui->listView->installEventFilter(this); + ui->listView->setEditTriggers(0); + ui->listView->setItemDelegate(new CenteredEditingDelegate(this)); + connect(ui->listView, SIGNAL(activated(QModelIndex)), SLOT(onItemActivated(QModelIndex))); +} + +bool ScreenshotsPage::eventFilter(QObject *obj, QEvent *evt) +{ + if (obj != ui->listView) + return QWidget::eventFilter(obj, evt); + if (evt->type() != QEvent::KeyPress) + { + return QWidget::eventFilter(obj, evt); + } + QKeyEvent *keyEvent = static_cast(evt); + switch (keyEvent->key()) + { + case Qt::Key_Delete: + on_deleteBtn_clicked(); + return true; + case Qt::Key_F2: + on_renameBtn_clicked(); + return true; + default: + break; + } + return QWidget::eventFilter(obj, evt); +} + +ScreenshotsPage::~ScreenshotsPage() +{ + delete ui; +} + +void ScreenshotsPage::onItemActivated(QModelIndex index) +{ + if (!index.isValid()) + return; + auto info = m_model->fileInfo(index); + QString fileName = info.absoluteFilePath(); + openFileInDefaultProgram(info.absoluteFilePath()); +} + +void ScreenshotsPage::on_viewFolderBtn_clicked() +{ + openDirInDefaultProgram(m_folder, true); +} + +void ScreenshotsPage::on_uploadBtn_clicked() +{ + auto selection = ui->listView->selectionModel()->selectedIndexes(); + if (selection.isEmpty()) + return; + + QList uploaded; + auto job = std::make_shared("Screenshot Upload"); + for (auto item : selection) + { + auto info = m_model->fileInfo(item); + auto screenshot = std::make_shared(info); + uploaded.push_back(screenshot); + job->addNetAction(ImgurUpload::make(screenshot)); + } + SequentialTask task; + auto albumTask = std::make_shared("Imgur Album Creation"); + auto imgurAlbum = ImgurAlbumCreation::make(uploaded); + albumTask->addNetAction(imgurAlbum); + task.addTask(job); + task.addTask(albumTask); + ProgressDialog prog(this); + if (prog.exec(&task) != QDialog::Accepted) + { + CustomMessageBox::selectable(this, tr("Failed to upload screenshots!"), + tr("Unknown error"), QMessageBox::Warning)->exec(); + } + else + { + auto link = QString("https://imgur.com/a/%1").arg(imgurAlbum->id()); + QClipboard *clipboard = QApplication::clipboard(); + clipboard->setText(link); + QDesktopServices::openUrl(link); + CustomMessageBox::selectable( + this, tr("Upload finished"), + tr("The link to the uploaded album has been opened in the " + "default browser and placed in your clipboard.
    Delete hash: %2 (save " + "this if you want to be able to edit/delete the album)") + .arg(link, imgurAlbum->deleteHash()), + QMessageBox::Information)->exec(); + } +} + +void ScreenshotsPage::on_deleteBtn_clicked() +{ + auto mbox = CustomMessageBox::selectable( + this, tr("Are you sure?"), tr("This will delete all selected screenshots."), + QMessageBox::Warning, QMessageBox::Yes | QMessageBox::No); + std::unique_ptr box(mbox); + + if (box->exec() != QMessageBox::Yes) + return; + + auto selected = ui->listView->selectionModel()->selectedIndexes(); + for (auto item : selected) + { + m_model->remove(item); + } +} + +void ScreenshotsPage::on_renameBtn_clicked() +{ + auto selection = ui->listView->selectionModel()->selectedIndexes(); + if (selection.isEmpty()) + return; + ui->listView->edit(selection[0]); + // TODO: mass renaming +} + +void ScreenshotsPage::opened() +{ + if (m_valid) + { + QString path = QDir(m_folder).absolutePath(); + m_model->setRootPath(path); + ui->listView->setRootIndex(m_filterModel->mapFromSource(m_model->index(path))); + } +} + +#include "ScreenshotsPage.moc" diff --git a/application/pages/ScreenshotsPage.h b/application/pages/ScreenshotsPage.h new file mode 100644 index 00000000..f5700ba8 --- /dev/null +++ b/application/pages/ScreenshotsPage.h @@ -0,0 +1,79 @@ +/* Copyright 2013-2015 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#include "BasePage.h" +#include + +class QFileSystemModel; +class QIdentityProxyModel; +namespace Ui +{ +class ScreenshotsPage; +} + +struct ScreenShot; +class ScreenshotList; +class ImgurAlbumCreation; + +class ScreenshotsPage : public QWidget, public BasePage +{ + Q_OBJECT + +public: + explicit ScreenshotsPage(QString path, QWidget *parent = 0); + virtual ~ScreenshotsPage(); + + virtual void opened() override; + + enum + { + NothingDone = 0x42 + }; + + virtual bool eventFilter(QObject *, QEvent *); + virtual QString displayName() const override + { + return tr("Screenshots"); + } + virtual QIcon icon() const override + { + return MMC->getThemedIcon("screenshots"); + } + virtual QString id() const override + { + return "screenshots"; + } + virtual QString helpPage() const override + { + return "Screenshots-management"; + } +private slots: + void on_uploadBtn_clicked(); + void on_deleteBtn_clicked(); + void on_renameBtn_clicked(); + void on_viewFolderBtn_clicked(); + void onItemActivated(QModelIndex); + +private: + Ui::ScreenshotsPage *ui; + std::shared_ptr m_model; + std::shared_ptr m_filterModel; + QString m_folder; + bool m_valid = false; +}; diff --git a/application/pages/ScreenshotsPage.ui b/application/pages/ScreenshotsPage.ui new file mode 100644 index 00000000..30b55092 --- /dev/null +++ b/application/pages/ScreenshotsPage.ui @@ -0,0 +1,109 @@ + + + ScreenshotsPage + + + + 0 + 0 + 723 + 532 + + + + Mods + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + + Tab 1 + + + + + + QAbstractItemView::ExtendedSelection + + + QAbstractItemView::SelectItems + + + + + + + + + &Upload + + + + + + + &Delete + + + + + + + &Rename + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + &View Folder + + + + + + + + + + + + + listView + uploadBtn + deleteBtn + renameBtn + viewFolderBtn + + + + diff --git a/application/pages/TexturePackPage.h b/application/pages/TexturePackPage.h new file mode 100644 index 00000000..3c5c27d7 --- /dev/null +++ b/application/pages/TexturePackPage.h @@ -0,0 +1,17 @@ +#pragma once +#include "ModFolderPage.h" + +class TexturePackPage : public ModFolderPage +{ +public: + explicit TexturePackPage(MinecraftInstance *instance, QWidget *parent = 0) + : ModFolderPage(instance, instance->texturePackList(), "texturepacks", "resourcepacks", + tr("Texture packs"), "Texture-packs", parent) + { + } + virtual ~TexturePackPage() {} + virtual bool shouldDisplay() const override + { + return m_inst->traits().contains("texturepacks"); + } +}; diff --git a/application/pages/VersionPage.cpp b/application/pages/VersionPage.cpp new file mode 100644 index 00000000..9b656220 --- /dev/null +++ b/application/pages/VersionPage.cpp @@ -0,0 +1,321 @@ +/* Copyright 2013-2015 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "MultiMC.h" + +#include +#include +#include +#include +#include + +#include "VersionPage.h" +#include "ui_VersionPage.h" + +#include "Platform.h" +#include "dialogs/CustomMessageBox.h" +#include "dialogs/VersionSelectDialog.h" +#include "dialogs/ModEditDialogCommon.h" + +#include "dialogs/ProgressDialog.h" + +#include +#include +#include +#include +#include + +#include "minecraft/MinecraftProfile.h" +#include "forge/ForgeVersionList.h" +#include "forge/ForgeInstaller.h" +#include "liteloader/LiteLoaderVersionList.h" +#include "liteloader/LiteLoaderInstaller.h" +#include "minecraft/VersionBuilder.h" +#include "auth/MojangAccountList.h" +#include "minecraft/Mod.h" +#include "icons/IconList.h" + + +QIcon VersionPage::icon() const +{ + return ENV.icons()->getIcon(m_inst->iconKey()); +} +bool VersionPage::shouldDisplay() const +{ + return !m_inst->isRunning(); +} + +VersionPage::VersionPage(OneSixInstance *inst, QWidget *parent) + : QWidget(parent), ui(new Ui::VersionPage), m_inst(inst) +{ + ui->setupUi(this); + ui->tabWidget->tabBar()->hide(); + + m_version = m_inst->getMinecraftProfile(); + if (m_version) + { + ui->libraryTreeView->setModel(m_version.get()); + ui->libraryTreeView->installEventFilter(this); + ui->libraryTreeView->setSelectionMode(QAbstractItemView::SingleSelection); + connect(ui->libraryTreeView->selectionModel(), &QItemSelectionModel::currentChanged, + this, &VersionPage::versionCurrent); + updateVersionControls(); + // select first item. + auto index = ui->libraryTreeView->model()->index(0,0); + if(index.isValid()) + ui->libraryTreeView->setCurrentIndex(index); + } + else + { + disableVersionControls(); + } + connect(m_inst, &OneSixInstance::versionReloaded, this, + &VersionPage::updateVersionControls); +} + +VersionPage::~VersionPage() +{ + delete ui; +} + +void VersionPage::updateVersionControls() +{ + ui->forgeBtn->setEnabled(true); + ui->liteloaderBtn->setEnabled(true); +} + +void VersionPage::disableVersionControls() +{ + ui->forgeBtn->setEnabled(false); + ui->liteloaderBtn->setEnabled(false); + ui->reloadLibrariesBtn->setEnabled(false); + ui->removeLibraryBtn->setEnabled(false); +} + +bool VersionPage::reloadMinecraftProfile() +{ + try + { + m_inst->reloadProfile(); + return true; + } + catch (MMCError &e) + { + QMessageBox::critical(this, tr("Error"), e.cause()); + return false; + } + catch (...) + { + QMessageBox::critical( + this, tr("Error"), + tr("Failed to load the version description file for reasons unknown.")); + return false; + } +} + +void VersionPage::on_reloadLibrariesBtn_clicked() +{ + reloadMinecraftProfile(); +} + +void VersionPage::on_removeLibraryBtn_clicked() +{ + if (ui->libraryTreeView->currentIndex().isValid()) + { + // FIXME: use actual model, not reloading. + if (!m_version->remove(ui->libraryTreeView->currentIndex().row())) + { + QMessageBox::critical(this, tr("Error"), tr("Couldn't remove file")); + } + } +} + +void VersionPage::on_jarmodBtn_clicked() +{ + QFileDialog w; + QSet locations; + QString modsFolder = MMC->settings()->get("CentralModsDir").toString(); + auto f = [&](QStandardPaths::StandardLocation l) + { + QString location = QStandardPaths::writableLocation(l); + QFileInfo finfo(location); + if (!finfo.exists()) + return; + locations.insert(location); + }; + f(QStandardPaths::DesktopLocation); + f(QStandardPaths::DocumentsLocation); + f(QStandardPaths::DownloadLocation); + f(QStandardPaths::HomeLocation); + QList urls; + for (auto location : locations) + { + urls.append(QUrl::fromLocalFile(location)); + } + urls.append(QUrl::fromLocalFile(modsFolder)); + + w.setFileMode(QFileDialog::ExistingFiles); + w.setAcceptMode(QFileDialog::AcceptOpen); + w.setNameFilter(tr("Minecraft jar mods (*.zip *.jar)")); + w.setDirectory(modsFolder); + w.setSidebarUrls(urls); + + if (w.exec()) + m_version->installJarMods(w.selectedFiles()); +} + +void VersionPage::on_resetLibraryOrderBtn_clicked() +{ + try + { + m_version->resetOrder(); + } + catch (MMCError &e) + { + QMessageBox::critical(this, tr("Error"), e.cause()); + } +} + +void VersionPage::on_moveLibraryUpBtn_clicked() +{ + if (ui->libraryTreeView->selectionModel()->selectedRows().isEmpty()) + { + return; + } + try + { + const int row = ui->libraryTreeView->selectionModel()->selectedRows().first().row(); + m_version->move(row, MinecraftProfile::MoveUp); + } + catch (MMCError &e) + { + QMessageBox::critical(this, tr("Error"), e.cause()); + } +} + +void VersionPage::on_moveLibraryDownBtn_clicked() +{ + if (ui->libraryTreeView->selectionModel()->selectedRows().isEmpty()) + { + return; + } + try + { + const int row = ui->libraryTreeView->selectionModel()->selectedRows().first().row(); + m_version->move(row, MinecraftProfile::MoveDown); + } + catch (MMCError &e) + { + QMessageBox::critical(this, tr("Error"), e.cause()); + } +} + +void VersionPage::on_changeMCVersionBtn_clicked() +{ + VersionSelectDialog vselect(m_inst->versionList().get(), tr("Change Minecraft version"), + this); + if (!vselect.exec() || !vselect.selectedVersion()) + return; + + if (!MMC->accounts()->anyAccountIsValid()) + { + CustomMessageBox::selectable( + this, tr("Error"), + tr("MultiMC cannot download Minecraft or update instances unless you have at least " + "one account added.\nPlease add your Mojang or Minecraft account."), + QMessageBox::Warning)->show(); + return; + } + + if (!m_version->isVanilla()) + { + auto result = CustomMessageBox::selectable( + this, tr("Are you sure?"), + tr("This will remove any library/version customization you did previously. " + "This includes things like Forge install and similar."), + QMessageBox::Warning, QMessageBox::Ok | QMessageBox::Abort, + QMessageBox::Abort)->exec(); + + if (result != QMessageBox::Ok) + return; + m_version->revertToVanilla(); + reloadMinecraftProfile(); + } + m_inst->setIntendedVersionId(vselect.selectedVersion()->descriptor()); + + auto updateTask = m_inst->doUpdate(); + if (!updateTask) + { + return; + } + ProgressDialog tDialog(this); + connect(updateTask.get(), SIGNAL(failed(QString)), SLOT(onGameUpdateError(QString))); + tDialog.exec(updateTask.get()); +} + +void VersionPage::on_forgeBtn_clicked() +{ + VersionSelectDialog vselect(MMC->forgelist().get(), tr("Select Forge version"), this); + vselect.setExactFilter(1, m_inst->currentVersionId()); + vselect.setEmptyString(tr("No Forge versions are currently available for Minecraft ") + + m_inst->currentVersionId()); + if (vselect.exec() && vselect.selectedVersion()) + { + ProgressDialog dialog(this); + dialog.exec( + ForgeInstaller().createInstallTask(m_inst, vselect.selectedVersion(), this)); + } +} + +void VersionPage::on_liteloaderBtn_clicked() +{ + VersionSelectDialog vselect(MMC->liteloaderlist().get(), tr("Select LiteLoader version"), + this); + vselect.setExactFilter(1, m_inst->currentVersionId()); + vselect.setEmptyString(tr("No LiteLoader versions are currently available for Minecraft ") + + m_inst->currentVersionId()); + if (vselect.exec() && vselect.selectedVersion()) + { + ProgressDialog dialog(this); + dialog.exec( + LiteLoaderInstaller().createInstallTask(m_inst, vselect.selectedVersion(), this)); + } +} + +void VersionPage::versionCurrent(const QModelIndex ¤t, const QModelIndex &previous) +{ + if (!current.isValid()) + { + ui->removeLibraryBtn->setDisabled(true); + ui->moveLibraryDownBtn->setDisabled(true); + ui->moveLibraryUpBtn->setDisabled(true); + } + else + { + bool enabled = m_version->canRemove(current.row()); + ui->removeLibraryBtn->setEnabled(enabled); + ui->moveLibraryDownBtn->setEnabled(enabled); + ui->moveLibraryUpBtn->setEnabled(enabled); + } + QString selectedId = m_version->versionFileId(current.row()); + if (selectedId == "net.minecraft") + { + ui->changeMCVersionBtn->setEnabled(true); + } + else + { + ui->changeMCVersionBtn->setEnabled(false); + } +} diff --git a/application/pages/VersionPage.h b/application/pages/VersionPage.h new file mode 100644 index 00000000..587fcf07 --- /dev/null +++ b/application/pages/VersionPage.h @@ -0,0 +1,80 @@ +/* Copyright 2013-2015 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#include "minecraft/OneSixInstance.h" +#include "net/NetJob.h" +#include "BasePage.h" + +namespace Ui +{ +class VersionPage; +} + +class VersionPage : public QWidget, public BasePage +{ + Q_OBJECT + +public: + explicit VersionPage(OneSixInstance *inst, QWidget *parent = 0); + virtual ~VersionPage(); + virtual QString displayName() const override + { + return tr("Version"); + } + virtual QIcon icon() const override; + virtual QString id() const override + { + return "version"; + } + virtual QString helpPage() const override + { + return "Instance-version"; + } + virtual bool shouldDisplay() const; +private +slots: + + // version tab + void on_forgeBtn_clicked(); + void on_liteloaderBtn_clicked(); + void on_reloadLibrariesBtn_clicked(); + void on_removeLibraryBtn_clicked(); + void on_resetLibraryOrderBtn_clicked(); + void on_moveLibraryUpBtn_clicked(); + void on_moveLibraryDownBtn_clicked(); + void on_jarmodBtn_clicked(); + + void updateVersionControls(); + void disableVersionControls(); + void on_changeMCVersionBtn_clicked(); + +protected: + /// FIXME: this shouldn't be necessary! + bool reloadMinecraftProfile(); + +private: + Ui::VersionPage *ui; + std::shared_ptr m_version; + OneSixInstance *m_inst; + NetJobPtr forgeJob; + +public +slots: + void versionCurrent(const QModelIndex ¤t, const QModelIndex &previous); +}; diff --git a/application/pages/VersionPage.ui b/application/pages/VersionPage.ui new file mode 100644 index 00000000..67a556c8 --- /dev/null +++ b/application/pages/VersionPage.ui @@ -0,0 +1,204 @@ + + + VersionPage + + + + 0 + 0 + 693 + 575 + + + + Version + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + + Tab 1 + + + + + + Qt::ScrollBarAlwaysOn + + + Qt::ScrollBarAlwaysOff + + + false + + + true + + + + + + + + + Selection + + + Qt::AlignCenter + + + + + + + Change version + + + + + + + This isn't implemented yet. + + + Move up + + + + + + + This isn't implemented yet. + + + Move down + + + + + + + Remove + + + + + + + + + + Install + + + Qt::AlignCenter + + + + + + + Replace any current custom version with Minecraft Forge + + + Install Forge + + + + + + + Install LiteLoader + + + + + + + Add jar mod + + + + + + + + + + List + + + Qt::AlignCenter + + + + + + + This isn't implemented yet. + + + Reset order + + + + + + + Reload + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + + + + ModListView + QTreeView +
    widgets/ModListView.h
    +
    + + LineSeparator + QWidget +
    widgets/LineSeparator.h
    + 1 +
    +
    + + +
    diff --git a/application/pages/global/AccountListPage.cpp b/application/pages/global/AccountListPage.cpp new file mode 100644 index 00000000..7be72aaa --- /dev/null +++ b/application/pages/global/AccountListPage.cpp @@ -0,0 +1,142 @@ +/* Copyright 2013-2015 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "AccountListPage.h" +#include "ui_AccountListPage.h" + +#include + +#include + +#include "net/NetJob.h" +#include "net/URLConstants.h" +#include "Env.h" + +#include "dialogs/EditAccountDialog.h" +#include "dialogs/ProgressDialog.h" +#include "dialogs/AccountSelectDialog.h" +#include "dialogs/LoginDialog.h" +#include "dialogs/CustomMessageBox.h" +#include "tasks/Task.h" +#include "auth/YggdrasilTask.h" + +#include "MultiMC.h" + +AccountListPage::AccountListPage(QWidget *parent) + : QWidget(parent), ui(new Ui::AccountListPage) +{ + ui->setupUi(this); + ui->tabWidget->tabBar()->hide(); + + m_accounts = MMC->accounts(); + + ui->listView->setModel(m_accounts.get()); + ui->listView->header()->setSectionResizeMode(QHeaderView::ResizeToContents); + + // Expand the account column + ui->listView->header()->setSectionResizeMode(1, QHeaderView::Stretch); + + QItemSelectionModel *selectionModel = ui->listView->selectionModel(); + + connect(selectionModel, &QItemSelectionModel::selectionChanged, + [this](const QItemSelection &sel, const QItemSelection &dsel) + { updateButtonStates(); }); + + connect(m_accounts.get(), SIGNAL(listChanged()), SLOT(listChanged())); + connect(m_accounts.get(), SIGNAL(activeAccountChanged()), SLOT(listChanged())); + + updateButtonStates(); +} + +AccountListPage::~AccountListPage() +{ + delete ui; +} + +void AccountListPage::listChanged() +{ + updateButtonStates(); +} + +void AccountListPage::on_addAccountBtn_clicked() +{ + addAccount(tr("Please enter your Mojang or Minecraft account username and password to add " + "your account.")); +} + +void AccountListPage::on_rmAccountBtn_clicked() +{ + QModelIndexList selection = ui->listView->selectionModel()->selectedIndexes(); + if (selection.size() > 0) + { + QModelIndex selected = selection.first(); + m_accounts->removeAccount(selected); + } +} + +void AccountListPage::on_setDefaultBtn_clicked() +{ + QModelIndexList selection = ui->listView->selectionModel()->selectedIndexes(); + if (selection.size() > 0) + { + QModelIndex selected = selection.first(); + MojangAccountPtr account = + selected.data(MojangAccountList::PointerRole).value(); + m_accounts->setActiveAccount(account->username()); + } +} + +void AccountListPage::on_noDefaultBtn_clicked() +{ + m_accounts->setActiveAccount(""); +} + +void AccountListPage::updateButtonStates() +{ + // If there is no selection, disable buttons that require something selected. + QModelIndexList selection = ui->listView->selectionModel()->selectedIndexes(); + + ui->rmAccountBtn->setEnabled(selection.size() > 0); + ui->setDefaultBtn->setEnabled(selection.size() > 0); + + ui->noDefaultBtn->setDown(m_accounts->activeAccount().get() == nullptr); +} + +void AccountListPage::addAccount(const QString &errMsg) +{ + // TODO: The login dialog isn't quite done yet + MojangAccountPtr account = LoginDialog::newAccount(this, errMsg); + + if (account != nullptr) + { + m_accounts->addAccount(account); + if (m_accounts->count() == 1) + m_accounts->setActiveAccount(account->username()); + + // Grab associated player skins + auto job = new NetJob("Player skins: " + account->username()); + + for (AccountProfile profile : account->profiles()) + { + auto meta = Env::getInstance().metacache()->resolveEntry("skins", profile.name + ".png"); + auto action = CacheDownload::make( + QUrl("http://" + URLConstants::SKINS_BASE + profile.name + ".png"), meta); + job->addNetAction(action); + meta->stale = true; + } + + job->start(); + } +} diff --git a/application/pages/global/AccountListPage.h b/application/pages/global/AccountListPage.h new file mode 100644 index 00000000..dad68b0c --- /dev/null +++ b/application/pages/global/AccountListPage.h @@ -0,0 +1,86 @@ +/* Copyright 2013-2015 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include + +#include "pages/BasePage.h" + +#include "auth/MojangAccountList.h" +#include + +namespace Ui +{ +class AccountListPage; +} + +class AuthenticateTask; + +class AccountListPage : public QWidget, public BasePage +{ + Q_OBJECT +public: + explicit AccountListPage(QWidget *parent = 0); + ~AccountListPage(); + + QString displayName() const override + { + return tr("Accounts"); + } + QIcon icon() const override + { + auto icon = MMC->getThemedIcon("accounts"); + if(icon.isNull()) + { + icon = MMC->getThemedIcon("noaccount"); + } + return icon; + } + QString id() const override + { + return "accounts"; + } + QString helpPage() const override + { + return "Accounts"; + } + +public +slots: + void on_addAccountBtn_clicked(); + + void on_rmAccountBtn_clicked(); + + void on_setDefaultBtn_clicked(); + + void on_noDefaultBtn_clicked(); + + void listChanged(); + + //! Updates the states of the dialog's buttons. + void updateButtonStates(); + +protected: + std::shared_ptr m_accounts; + +protected +slots: + void addAccount(const QString& errMsg=""); + +private: + Ui::AccountListPage *ui; +}; diff --git a/application/pages/global/AccountListPage.ui b/application/pages/global/AccountListPage.ui new file mode 100644 index 00000000..8ad78cf4 --- /dev/null +++ b/application/pages/global/AccountListPage.ui @@ -0,0 +1,115 @@ + + + AccountListPage + + + + 0 + 0 + 694 + 609 + + + + Manage Accounts + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + + Tab 1 + + + + + + <html><head/><body><p>Welcome! If you're new here, you can click the &quot;Add&quot; button to add your Mojang or Minecraft account.</p></body></html> + + + true + + + + + + + + + + + + + + &Add + + + + + + + &Remove + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + <html><head/><body><p>Set the currently selected account as the active account. The active account is the account that is used to log in (unless it is overridden in an instance-specific setting).</p></body></html> + + + &Set Default + + + + + + + Set no default account. This will cause MultiMC to prompt you to select an account every time you launch an instance that doesn't have its own default set. + + + &No Default + + + + + + + + + + + + + + + + diff --git a/application/pages/global/ExternalToolsPage.cpp b/application/pages/global/ExternalToolsPage.cpp new file mode 100644 index 00000000..426432a0 --- /dev/null +++ b/application/pages/global/ExternalToolsPage.cpp @@ -0,0 +1,238 @@ +/* Copyright 2013-2015 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "ExternalToolsPage.h" +#include "ui_ExternalToolsPage.h" + +#include +#include +#include + +#include + +#include "settings/SettingsObject.h" +#include "tools/BaseProfiler.h" +#include "MultiMC.h" + +ExternalToolsPage::ExternalToolsPage(QWidget *parent) : + QWidget(parent), + ui(new Ui::ExternalToolsPage) +{ + ui->setupUi(this); + ui->tabWidget->tabBar()->hide(); + + #if QT_VERSION >= QT_VERSION_CHECK(5, 2, 0) + ui->jsonEditorTextBox->setClearButtonEnabled(true); + #endif + + ui->mceditLink->setOpenExternalLinks(true); + ui->jvisualvmLink->setOpenExternalLinks(true); + ui->jprofilerLink->setOpenExternalLinks(true); + loadSettings(); +} + +ExternalToolsPage::~ExternalToolsPage() +{ + delete ui; +} + +void ExternalToolsPage::loadSettings() +{ + auto s = MMC->settings(); + ui->jprofilerPathEdit->setText(s->get("JProfilerPath").toString()); + ui->jvisualvmPathEdit->setText(s->get("JVisualVMPath").toString()); + ui->mceditPathEdit->setText(s->get("MCEditPath").toString()); + + // Editors + ui->jsonEditorTextBox->setText(s->get("JsonEditor").toString()); +} +void ExternalToolsPage::applySettings() +{ + auto s = MMC->settings(); + s->set("JProfilerPath", ui->jprofilerPathEdit->text()); + s->set("JVisualVMPath", ui->jvisualvmPathEdit->text()); + s->set("MCEditPath", ui->mceditPathEdit->text()); + + // Editors + QString jsonEditor = ui->jsonEditorTextBox->text(); + if (!jsonEditor.isEmpty() && + (!QFileInfo(jsonEditor).exists() || !QFileInfo(jsonEditor).isExecutable())) + { + QString found = QStandardPaths::findExecutable(jsonEditor); + if (!found.isEmpty()) + { + jsonEditor = found; + } + } + s->set("JsonEditor", jsonEditor); +} + +void ExternalToolsPage::on_jprofilerPathBtn_clicked() +{ + QString raw_dir = ui->jprofilerPathEdit->text(); + QString error; + do + { + raw_dir = QFileDialog::getExistingDirectory(this, tr("JProfiler Directory"), raw_dir); + if (raw_dir.isEmpty()) + { + break; + } + QString cooked_dir = NormalizePath(raw_dir); + if (!MMC->profilers()["jprofiler"]->check(cooked_dir, &error)) + { + QMessageBox::critical(this, tr("Error"), + tr("Error while checking JProfiler install:\n%1").arg(error)); + continue; + } + else + { + ui->jprofilerPathEdit->setText(cooked_dir); + break; + } + } while (1); +} +void ExternalToolsPage::on_jprofilerCheckBtn_clicked() +{ + QString error; + if (!MMC->profilers()["jprofiler"]->check(ui->jprofilerPathEdit->text(), &error)) + { + QMessageBox::critical(this, tr("Error"), + tr("Error while checking JProfiler install:\n%1").arg(error)); + } + else + { + QMessageBox::information(this, tr("OK"), tr("JProfiler setup seems to be OK")); + } +} + +void ExternalToolsPage::on_jvisualvmPathBtn_clicked() +{ + QString raw_dir = ui->jvisualvmPathEdit->text(); + QString error; + do + { + raw_dir = QFileDialog::getOpenFileName(this, tr("JVisualVM Executable"), raw_dir); + if (raw_dir.isEmpty()) + { + break; + } + QString cooked_dir = NormalizePath(raw_dir); + if (!MMC->profilers()["jvisualvm"]->check(cooked_dir, &error)) + { + QMessageBox::critical(this, tr("Error"), + tr("Error while checking JVisualVM install:\n%1").arg(error)); + continue; + } + else + { + ui->jvisualvmPathEdit->setText(cooked_dir); + break; + } + } while (1); +} +void ExternalToolsPage::on_jvisualvmCheckBtn_clicked() +{ + QString error; + if (!MMC->profilers()["jvisualvm"]->check(ui->jvisualvmPathEdit->text(), &error)) + { + QMessageBox::critical(this, tr("Error"), + tr("Error while checking JVisualVM install:\n%1").arg(error)); + } + else + { + QMessageBox::information(this, tr("OK"), tr("JVisualVM setup seems to be OK")); + } +} + +void ExternalToolsPage::on_mceditPathBtn_clicked() +{ + QString raw_dir = ui->mceditPathEdit->text(); + QString error; + do + { +#ifdef Q_OS_OSX +#warning stuff + raw_dir = QFileDialog::getOpenFileName(this, tr("MCEdit Application"), raw_dir); +#else + raw_dir = QFileDialog::getExistingDirectory(this, tr("MCEdit Directory"), raw_dir); +#endif + if (raw_dir.isEmpty()) + { + break; + } + QString cooked_dir = NormalizePath(raw_dir); + if (!MMC->tools()["mcedit"]->check(cooked_dir, &error)) + { + QMessageBox::critical(this, tr("Error"), + tr("Error while checking MCEdit install:\n%1").arg(error)); + continue; + } + else + { + ui->mceditPathEdit->setText(cooked_dir); + break; + } + } while (1); +} +void ExternalToolsPage::on_mceditCheckBtn_clicked() +{ + QString error; + if (!MMC->tools()["mcedit"]->check(ui->mceditPathEdit->text(), &error)) + { + QMessageBox::critical(this, tr("Error"), + tr("Error while checking MCEdit install:\n%1").arg(error)); + } + else + { + QMessageBox::information(this, tr("OK"), tr("MCEdit setup seems to be OK")); + } +} + +void ExternalToolsPage::on_jsonEditorBrowseBtn_clicked() +{ + QString raw_file = QFileDialog::getOpenFileName( + this, tr("JSON Editor"), + ui->jsonEditorTextBox->text().isEmpty() +#if defined(Q_OS_LINUX) + ? QString("/usr/bin") +#else + ? QStandardPaths::standardLocations(QStandardPaths::ApplicationsLocation).first() +#endif + : ui->jsonEditorTextBox->text()); + QString cooked_file = NormalizePath(raw_file); + + if (cooked_file.isEmpty()) + { + return; + } + + // it has to exist and be an executable + if (QFileInfo(cooked_file).exists() && QFileInfo(cooked_file).isExecutable()) + { + ui->jsonEditorTextBox->setText(cooked_file); + } + else + { + QMessageBox::warning(this, tr("Invalid"), + tr("The file chosen does not seem to be an executable")); + } +} + +bool ExternalToolsPage::apply() +{ + applySettings(); + return true; +} diff --git a/application/pages/global/ExternalToolsPage.h b/application/pages/global/ExternalToolsPage.h new file mode 100644 index 00000000..43e72dcd --- /dev/null +++ b/application/pages/global/ExternalToolsPage.h @@ -0,0 +1,74 @@ +/* Copyright 2013-2015 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#include "pages/BasePage.h" +#include + +namespace Ui { +class ExternalToolsPage; +} + +class ExternalToolsPage : public QWidget, public BasePage +{ + Q_OBJECT + +public: + explicit ExternalToolsPage(QWidget *parent = 0); + ~ExternalToolsPage(); + + QString displayName() const override + { + return tr("External Tools"); + } + QIcon icon() const override + { + auto icon = MMC->getThemedIcon("externaltools"); + if(icon.isNull()) + { + icon = MMC->getThemedIcon("loadermods"); + } + return icon; + } + QString id() const override + { + return "external-tools"; + } + QString helpPage() const override + { + return "External-tools"; + } + virtual bool apply(); + +private: + void loadSettings(); + void applySettings(); + +private: + Ui::ExternalToolsPage *ui; + +private +slots: + void on_jprofilerPathBtn_clicked(); + void on_jprofilerCheckBtn_clicked(); + void on_jvisualvmPathBtn_clicked(); + void on_jvisualvmCheckBtn_clicked(); + void on_mceditPathBtn_clicked(); + void on_mceditCheckBtn_clicked(); + void on_jsonEditorBrowseBtn_clicked(); +}; diff --git a/application/pages/global/ExternalToolsPage.ui b/application/pages/global/ExternalToolsPage.ui new file mode 100644 index 00000000..ba1b6f01 --- /dev/null +++ b/application/pages/global/ExternalToolsPage.ui @@ -0,0 +1,197 @@ + + + ExternalToolsPage + + + + 0 + 0 + 673 + 751 + + + + Form + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + + Tab 1 + + + + + + JProfiler + + + + + + + + + + + ... + + + + + + + + + Check + + + + + + + <html><head/><body><p><a href="http://www.ej-technologies.com/products/jprofiler/overview.html"><span style=" text-decoration: underline; color:#0000ff;">http://www.ej-technologies.com/products/jprofiler/overview.html</span></a></p></body></html> + + + + + + + + + + JVisualVM + + + + + + + + + + + ... + + + + + + + + + Check + + + + + + + <html><head/><body><p><a href="http://visualvm.java.net/"><span style=" text-decoration: underline; color:#0000ff;">http://visualvm.java.net/</span></a></p></body></html> + + + + + + + + + + MCEdit + + + + + + + + + + + ... + + + + + + + + + Check + + + + + + + <html><head/><body><p><a href="http://www.mcedit.net/"><span style=" text-decoration: underline; color:#0000ff;">http://www.mcedit.net/</span></a></p></body></html> + + + + + + + + + + External Editors (leave empty for system default) + + + + + + + + + Text Editor: + + + + + + + ... + + + + + + + + + + Qt::Vertical + + + + 20 + 216 + + + + + + + + + + + + + diff --git a/application/pages/global/JavaPage.cpp b/application/pages/global/JavaPage.cpp new file mode 100644 index 00000000..ab02b3a3 --- /dev/null +++ b/application/pages/global/JavaPage.cpp @@ -0,0 +1,146 @@ +/* Copyright 2013-2015 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "JavaPage.h" +#include "ui_JavaPage.h" + +#include +#include +#include + +#include + +#include "NagUtils.h" + +#include "Platform.h" +#include "dialogs/VersionSelectDialog.h" +#include + +#include "java/JavaUtils.h" +#include "java/JavaVersionList.h" +#include "java/JavaChecker.h" + +#include "settings/SettingsObject.h" +#include "MultiMC.h" + +JavaPage::JavaPage(QWidget *parent) : QWidget(parent), ui(new Ui::JavaPage) +{ + ui->setupUi(this); + ui->tabWidget->tabBar()->hide(); + + auto resizer = new ColumnResizer(this); + resizer->addWidgetsFromLayout(ui->javaSettingsGroupBox->layout(), 0); + resizer->addWidgetsFromLayout(ui->customCommandsGroupBox->layout(), 0); + + loadSettings(); +} + +JavaPage::~JavaPage() +{ + delete ui; +} + +bool JavaPage::apply() +{ + applySettings(); + return true; +} + +void JavaPage::applySettings() +{ + auto s = MMC->settings(); + // Memory + s->set("MinMemAlloc", ui->minMemSpinBox->value()); + s->set("MaxMemAlloc", ui->maxMemSpinBox->value()); + s->set("PermGen", ui->permGenSpinBox->value()); + + // Java Settings + s->set("JavaPath", ui->javaPathTextBox->text()); + s->set("JvmArgs", ui->jvmArgsTextBox->text()); + NagUtils::checkJVMArgs(s->get("JvmArgs").toString(), this->parentWidget()); + + // Custom Commands + s->set("PreLaunchCommand", ui->preLaunchCmdTextBox->text()); + s->set("PostExitCommand", ui->postExitCmdTextBox->text()); +} +void JavaPage::loadSettings() +{ + auto s = MMC->settings(); + // Memory + ui->minMemSpinBox->setValue(s->get("MinMemAlloc").toInt()); + ui->maxMemSpinBox->setValue(s->get("MaxMemAlloc").toInt()); + ui->permGenSpinBox->setValue(s->get("PermGen").toInt()); + + // Java Settings + ui->javaPathTextBox->setText(s->get("JavaPath").toString()); + ui->jvmArgsTextBox->setText(s->get("JvmArgs").toString()); + + // Custom Commands + ui->preLaunchCmdTextBox->setText(s->get("PreLaunchCommand").toString()); + ui->postExitCmdTextBox->setText(s->get("PostExitCommand").toString()); +} + +void JavaPage::on_javaDetectBtn_clicked() +{ + JavaVersionPtr java; + + VersionSelectDialog vselect(MMC->javalist().get(), tr("Select a Java version"), this, true); + vselect.setResizeOn(2); + vselect.exec(); + + if (vselect.result() == QDialog::Accepted && vselect.selectedVersion()) + { + java = std::dynamic_pointer_cast(vselect.selectedVersion()); + ui->javaPathTextBox->setText(java->path); + } +} +void JavaPage::on_javaBrowseBtn_clicked() +{ + QString dir = QFileDialog::getOpenFileName(this, tr("Find Java executable")); + if (!dir.isNull()) + { + ui->javaPathTextBox->setText(dir); + } +} +void JavaPage::on_javaTestBtn_clicked() +{ + checker.reset(new JavaChecker()); + connect(checker.get(), SIGNAL(checkFinished(JavaCheckResult)), this, + SLOT(checkFinished(JavaCheckResult))); + checker->path = ui->javaPathTextBox->text(); + checker->performCheck(); +} + +void JavaPage::checkFinished(JavaCheckResult result) +{ + if (result.valid) + { + QString text; + text += "Java test succeeded!\n"; + if (result.is_64bit) + text += "Using 64bit java.\n"; + text += "\n"; + text += "Platform reported: " + result.realPlatform + "\n"; + text += "Java version reported: " + result.javaVersion; + QMessageBox::information(this, tr("Java test success"), text); + } + else + { + QMessageBox::warning( + this, tr("Java test failure"), + tr("The specified java binary didn't work. You should use the auto-detect feature, " + "or set the path to the java executable.")); + } +} diff --git a/application/pages/global/JavaPage.h b/application/pages/global/JavaPage.h new file mode 100644 index 00000000..2af85280 --- /dev/null +++ b/application/pages/global/JavaPage.h @@ -0,0 +1,73 @@ +/* Copyright 2013-2015 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include + +#include "java/JavaChecker.h" +#include "pages/BasePage.h" +#include + +class SettingsObject; + +namespace Ui +{ +class JavaPage; +} + +class JavaPage : public QWidget, public BasePage +{ + Q_OBJECT + +public: + explicit JavaPage(QWidget *parent = 0); + ~JavaPage(); + + QString displayName() const override + { + return tr("Java"); + } + QIcon icon() const override + { + return MMC->getThemedIcon("java"); + } + QString id() const override + { + return "java-settings"; + } + QString helpPage() const override + { + return "Java-settings"; + } + bool apply() override; + +private: + void applySettings(); + void loadSettings(); + +private +slots: + void on_javaDetectBtn_clicked(); + void on_javaTestBtn_clicked(); + void on_javaBrowseBtn_clicked(); + + void checkFinished(JavaCheckResult result); + +private: + Ui::JavaPage *ui; + std::shared_ptr checker; +}; diff --git a/application/pages/global/JavaPage.ui b/application/pages/global/JavaPage.ui new file mode 100644 index 00000000..6ae41a49 --- /dev/null +++ b/application/pages/global/JavaPage.ui @@ -0,0 +1,303 @@ + + + JavaPage + + + + 0 + 0 + 545 + 609 + + + + + 0 + 0 + + + + Settings + + + + :/icons/toolbar/settings:/icons/toolbar/settings + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + + Tab 1 + + + + + + Memory + + + + + + The maximum amount of memory Minecraft is allowed to use. + + + MB + + + 512 + + + 65536 + + + 128 + + + 1024 + + + + + + + Minimum memory allocation: + + + + + + + Maximum memory allocation: + + + + + + + The amount of memory Minecraft is started with. + + + MB + + + 256 + + + 65536 + + + 128 + + + 256 + + + + + + + PermGen: + + + + + + + The amount of memory available to store loaded Java classes. + + + MB + + + 64 + + + 999999999 + + + 8 + + + 64 + + + + + + + + + + Java Runtime + + + + + + + 0 + 0 + + + + Java path: + + + + + + + + 0 + 0 + + + + Auto-detect... + + + + + + + + 0 + 0 + + + + Test + + + + + + + + 0 + 0 + + + + JVM arguments: + + + + + + + + + + + + + 0 + 0 + + + + + 28 + 16777215 + + + + ... + + + + + + + + + + + + + + + Custom Commands + + + + + + Post-exit command: + + + + + + + Pre-launch command: + + + + + + + + + + + + + + + + + 0 + 0 + + + + Pre-launch command runs before the instance launches and post-exit command runs after it exits. Both will be run in MultiMC's working directory with INST_ID, INST_DIR, and INST_NAME as environment variables. + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + true + + + + + + + + + + + minMemSpinBox + maxMemSpinBox + permGenSpinBox + javaPathTextBox + javaBrowseBtn + javaDetectBtn + javaTestBtn + jvmArgsTextBox + preLaunchCmdTextBox + postExitCmdTextBox + + + + diff --git a/application/pages/global/MinecraftPage.cpp b/application/pages/global/MinecraftPage.cpp new file mode 100644 index 00000000..f5e7e57f --- /dev/null +++ b/application/pages/global/MinecraftPage.cpp @@ -0,0 +1,92 @@ +/* Copyright 2013-2015 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "MinecraftPage.h" +#include "ui_MinecraftPage.h" + +#include +#include +#include + +#include + +#include "Platform.h" +#include "dialogs/VersionSelectDialog.h" +#include "dialogs/CustomMessageBox.h" + +#include "NagUtils.h" + +#include "java/JavaUtils.h" +#include "java/JavaVersionList.h" +#include "java/JavaChecker.h" + +#include "updater/UpdateChecker.h" + +#include "tools/BaseProfiler.h" + +#include "settings/SettingsObject.h" +#include "MultiMC.h" + +MinecraftPage::MinecraftPage(QWidget *parent) : QWidget(parent), ui(new Ui::MinecraftPage) +{ + ui->setupUi(this); + ui->tabWidget->tabBar()->hide(); + loadSettings(); + updateCheckboxStuff(); +} + +MinecraftPage::~MinecraftPage() +{ + delete ui; +} + +bool MinecraftPage::apply() +{ + applySettings(); + return true; +} + +void MinecraftPage::updateCheckboxStuff() +{ + ui->windowWidthSpinBox->setEnabled(!ui->maximizedCheckBox->isChecked()); + ui->windowHeightSpinBox->setEnabled(!ui->maximizedCheckBox->isChecked()); +} + +void MinecraftPage::on_maximizedCheckBox_clicked(bool checked) +{ + Q_UNUSED(checked); + updateCheckboxStuff(); +} + + +void MinecraftPage::applySettings() +{ + auto s = MMC->settings(); + + // Window Size + s->set("LaunchMaximized", ui->maximizedCheckBox->isChecked()); + s->set("MinecraftWinWidth", ui->windowWidthSpinBox->value()); + s->set("MinecraftWinHeight", ui->windowHeightSpinBox->value()); +} + +void MinecraftPage::loadSettings() +{ + auto s = MMC->settings(); + + // Window Size + ui->maximizedCheckBox->setChecked(s->get("LaunchMaximized").toBool()); + ui->windowWidthSpinBox->setValue(s->get("MinecraftWinWidth").toInt()); + ui->windowHeightSpinBox->setValue(s->get("MinecraftWinHeight").toInt()); +} diff --git a/application/pages/global/MinecraftPage.h b/application/pages/global/MinecraftPage.h new file mode 100644 index 00000000..6355b507 --- /dev/null +++ b/application/pages/global/MinecraftPage.h @@ -0,0 +1,70 @@ +/* Copyright 2013-2015 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include + +#include "java/JavaChecker.h" +#include "pages/BasePage.h" +#include + +class SettingsObject; + +namespace Ui +{ +class MinecraftPage; +} + +class MinecraftPage : public QWidget, public BasePage +{ + Q_OBJECT + +public: + explicit MinecraftPage(QWidget *parent = 0); + ~MinecraftPage(); + + QString displayName() const override + { + return tr("Minecraft"); + } + QIcon icon() const override + { + return MMC->getThemedIcon("minecraft"); + } + QString id() const override + { + return "minecraft-settings"; + } + QString helpPage() const override + { + return "Minecraft-settings"; + } + bool apply() override; + +private: + void updateCheckboxStuff(); + void applySettings(); + void loadSettings(); + +private +slots: + void on_maximizedCheckBox_clicked(bool checked); + +private: + Ui::MinecraftPage *ui; + +}; diff --git a/application/pages/global/MinecraftPage.ui b/application/pages/global/MinecraftPage.ui new file mode 100644 index 00000000..825f6a56 --- /dev/null +++ b/application/pages/global/MinecraftPage.ui @@ -0,0 +1,148 @@ + + + MinecraftPage + + + + 0 + 0 + 545 + 195 + + + + + 0 + 0 + + + + Settings + + + + :/icons/toolbar/settings:/icons/toolbar/settings + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + QTabWidget::Rounded + + + 0 + + + + Minecraft + + + + + + Window Size + + + + + + Start Minecraft maximized? + + + + + + + + + Window hei&ght: + + + windowHeightSpinBox + + + + + + + W&indow width: + + + windowWidthSpinBox + + + + + + + 1 + + + 65536 + + + 1 + + + 854 + + + + + + + 1 + + + 65536 + + + 480 + + + + + + + + + + + + Qt::Vertical + + + + 0 + 0 + + + + + + + + + + + + tabWidget + maximizedCheckBox + windowWidthSpinBox + windowHeightSpinBox + + + + diff --git a/application/pages/global/MultiMCPage.cpp b/application/pages/global/MultiMCPage.cpp new file mode 100644 index 00000000..5f56fb89 --- /dev/null +++ b/application/pages/global/MultiMCPage.cpp @@ -0,0 +1,459 @@ +/* Copyright 2013-2015 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "MultiMCPage.h" +#include "ui_MultiMCPage.h" + +#include +#include +#include +#include + +#include + +#include "Platform.h" +#include "dialogs/VersionSelectDialog.h" +#include "dialogs/CustomMessageBox.h" +#include + +#include "NagUtils.h" + +#include "java/JavaUtils.h" +#include "java/JavaVersionList.h" +#include "java/JavaChecker.h" + +#include "updater/UpdateChecker.h" + +#include "tools/BaseProfiler.h" + +#include "settings/SettingsObject.h" +#include "MultiMC.h" + +// FIXME: possibly move elsewhere +enum InstSortMode +{ + // Sort alphabetically by name. + Sort_Name, + // Sort by which instance was launched most recently. + Sort_LastLaunch +}; + +MultiMCPage::MultiMCPage(QWidget *parent) : QWidget(parent), ui(new Ui::MultiMCPage) +{ + ui->setupUi(this); + ui->sortingModeGroup->setId(ui->sortByNameBtn, Sort_Name); + ui->sortingModeGroup->setId(ui->sortLastLaunchedBtn, Sort_LastLaunch); + + auto resizer = new ColumnResizer(this); + resizer->addWidgetsFromLayout(ui->groupBox->layout(), 1); + resizer->addWidgetsFromLayout(ui->foldersBox->layout(), 1); + + defaultFormat = new QTextCharFormat(ui->fontPreview->currentCharFormat()); + + loadSettings(); + + QObject::connect(MMC->updateChecker().get(), &UpdateChecker::channelListLoaded, this, + &MultiMCPage::refreshUpdateChannelList); + + if (MMC->updateChecker()->hasChannels()) + { + refreshUpdateChannelList(); + } + else + { + MMC->updateChecker()->updateChanList(false); + } + connect(ui->fontSizeBox, SIGNAL(valueChanged(int)), SLOT(refreshFontPreview())); + connect(ui->consoleFont, SIGNAL(currentFontChanged(QFont)), SLOT(refreshFontPreview())); +} + +MultiMCPage::~MultiMCPage() +{ + delete ui; +} + +bool MultiMCPage::apply() +{ + applySettings(); + return true; +} + +void MultiMCPage::on_ftbLauncherBrowseBtn_clicked() +{ + QString raw_dir = QFileDialog::getExistingDirectory(this, tr("FTB Launcher Directory"), + ui->ftbLauncherBox->text()); + QString cooked_dir = NormalizePath(raw_dir); + + // do not allow current dir - it's dirty. Do not allow dirs that don't exist + if (!cooked_dir.isEmpty() && QDir(cooked_dir).exists()) + { + ui->ftbLauncherBox->setText(cooked_dir); + } +} +void MultiMCPage::on_ftbBrowseBtn_clicked() +{ + QString raw_dir = + QFileDialog::getExistingDirectory(this, tr("FTB Directory"), ui->ftbBox->text()); + QString cooked_dir = NormalizePath(raw_dir); + + // do not allow current dir - it's dirty. Do not allow dirs that don't exist + if (!cooked_dir.isEmpty() && QDir(cooked_dir).exists()) + { + ui->ftbBox->setText(cooked_dir); + } +} + +void MultiMCPage::on_instDirBrowseBtn_clicked() +{ + QString raw_dir = QFileDialog::getExistingDirectory(this, tr("Instance Directory"), + ui->instDirTextBox->text()); + QString cooked_dir = NormalizePath(raw_dir); + + // do not allow current dir - it's dirty. Do not allow dirs that don't exist + if (!cooked_dir.isEmpty() && QDir(cooked_dir).exists()) + { + if (checkProblemticPathJava(QDir(cooked_dir))) + { + QMessageBox warning; + warning.setText(tr("You're trying to specify an instance folder which\'s path " + "contains at least one \'!\'. " + "Java is known to cause problems if that is the case, your " + "instances (probably) won't start!")); + warning.setInformativeText( + tr("Do you really want to use this path? " + "Selecting \"No\" will close this and not alter your instance path.")); + warning.setStandardButtons(QMessageBox::Yes | QMessageBox::No); + int result = warning.exec(); + if (result == QMessageBox::Yes) + { + ui->instDirTextBox->setText(cooked_dir); + } + } + else + { + ui->instDirTextBox->setText(cooked_dir); + } + } +} + +void MultiMCPage::on_iconsDirBrowseBtn_clicked() +{ + QString raw_dir = QFileDialog::getExistingDirectory(this, tr("Icons Directory"), + ui->iconsDirTextBox->text()); + QString cooked_dir = NormalizePath(raw_dir); + + // do not allow current dir - it's dirty. Do not allow dirs that don't exist + if (!cooked_dir.isEmpty() && QDir(cooked_dir).exists()) + { + ui->iconsDirTextBox->setText(cooked_dir); + } +} +void MultiMCPage::on_modsDirBrowseBtn_clicked() +{ + QString raw_dir = QFileDialog::getExistingDirectory(this, tr("Mods Directory"), + ui->modsDirTextBox->text()); + QString cooked_dir = NormalizePath(raw_dir); + + // do not allow current dir - it's dirty. Do not allow dirs that don't exist + if (!cooked_dir.isEmpty() && QDir(cooked_dir).exists()) + { + ui->modsDirTextBox->setText(cooked_dir); + } +} +void MultiMCPage::on_lwjglDirBrowseBtn_clicked() +{ + QString raw_dir = QFileDialog::getExistingDirectory(this, tr("LWJGL Directory"), + ui->lwjglDirTextBox->text()); + QString cooked_dir = NormalizePath(raw_dir); + + // do not allow current dir - it's dirty. Do not allow dirs that don't exist + if (!cooked_dir.isEmpty() && QDir(cooked_dir).exists()) + { + ui->lwjglDirTextBox->setText(cooked_dir); + } +} + +void MultiMCPage::refreshUpdateChannelList() +{ + // Stop listening for selection changes. It's going to change a lot while we update it and + // we don't need to update the + // description label constantly. + QObject::disconnect(ui->updateChannelComboBox, SIGNAL(currentIndexChanged(int)), this, + SLOT(updateChannelSelectionChanged(int))); + + QList channelList = MMC->updateChecker()->getChannelList(); + ui->updateChannelComboBox->clear(); + int selection = -1; + for (int i = 0; i < channelList.count(); i++) + { + UpdateChecker::ChannelListEntry entry = channelList.at(i); + + // When it comes to selection, we'll rely on the indexes of a channel entry being the + // same in the + // combo box as it is in the update checker's channel list. + // This probably isn't very safe, but the channel list doesn't change often enough (or + // at all) for + // this to be a big deal. Hope it doesn't break... + ui->updateChannelComboBox->addItem(entry.name); + + // If the update channel we just added was the selected one, set the current index in + // the combo box to it. + if (entry.id == m_currentUpdateChannel) + { + qDebug() << "Selected index" << i << "channel id" << m_currentUpdateChannel; + selection = i; + } + } + + ui->updateChannelComboBox->setCurrentIndex(selection); + + // Start listening for selection changes again and update the description label. + QObject::connect(ui->updateChannelComboBox, SIGNAL(currentIndexChanged(int)), this, + SLOT(updateChannelSelectionChanged(int))); + refreshUpdateChannelDesc(); + + // Now that we've updated the channel list, we can enable the combo box. + // It starts off disabled so that if the channel list hasn't been loaded, it will be + // disabled. + ui->updateChannelComboBox->setEnabled(true); +} + +void MultiMCPage::updateChannelSelectionChanged(int index) +{ + refreshUpdateChannelDesc(); +} + +void MultiMCPage::refreshUpdateChannelDesc() +{ + // Get the channel list. + QList channelList = MMC->updateChecker()->getChannelList(); + int selectedIndex = ui->updateChannelComboBox->currentIndex(); + if (selectedIndex < 0) + { + return; + } + if (selectedIndex < channelList.count()) + { + // Find the channel list entry with the given index. + UpdateChecker::ChannelListEntry selected = channelList.at(selectedIndex); + + // Set the description text. + ui->updateChannelDescLabel->setText(selected.description); + + // Set the currently selected channel ID. + m_currentUpdateChannel = selected.id; + } +} + +void MultiMCPage::applySettings() +{ + auto s = MMC->settings(); + // Language + s->set("Language", + ui->languageBox->itemData(ui->languageBox->currentIndex()).toLocale().bcp47Name()); + + if (ui->resetNotificationsBtn->isChecked()) + { + s->set("ShownNotifications", QString()); + } + + // Updates + s->set("AutoUpdate", ui->autoUpdateCheckBox->isChecked()); + s->set("UpdateChannel", m_currentUpdateChannel); + auto original = s->get("IconTheme").toString(); + //FIXME: make generic + switch (ui->themeComboBox->currentIndex()) + { + case 1: + s->set("IconTheme", "pe_dark"); + break; + case 2: + s->set("IconTheme", "pe_light"); + break; + case 3: + s->set("IconTheme", "pe_blue"); + break; + case 4: + s->set("IconTheme", "pe_colored"); + break; + case 5: + s->set("IconTheme", "OSX"); + break; + case 6: + s->set("IconTheme", "iOS"); + break; + case 0: + default: + s->set("IconTheme", "multimc"); + break; + } + + if(original != s->get("IconTheme")) + { + MMC->setIconTheme(s->get("IconTheme").toString()); + } + + // Console settings + s->set("ShowConsole", ui->showConsoleCheck->isChecked()); + s->set("AutoCloseConsole", ui->autoCloseConsoleCheck->isChecked()); + QString consoleFontFamily = ui->consoleFont->currentFont().family(); + s->set("ConsoleFont", consoleFontFamily); + s->set("ConsoleFontSize", ui->fontSizeBox->value()); + + // FTB + s->set("TrackFTBInstances", ui->trackFtbBox->isChecked()); + s->set("FTBLauncherRoot", ui->ftbLauncherBox->text()); + s->set("FTBRoot", ui->ftbBox->text()); + + // Folders + // TODO: Offer to move instances to new instance folder. + s->set("InstanceDir", ui->instDirTextBox->text()); + s->set("CentralModsDir", ui->modsDirTextBox->text()); + s->set("LWJGLDir", ui->lwjglDirTextBox->text()); + s->set("IconsDir", ui->iconsDirTextBox->text()); + + auto sortMode = (InstSortMode)ui->sortingModeGroup->checkedId(); + switch (sortMode) + { + case Sort_LastLaunch: + s->set("InstSortMode", "LastLaunch"); + break; + case Sort_Name: + default: + s->set("InstSortMode", "Name"); + break; + } +} +void MultiMCPage::loadSettings() +{ + auto s = MMC->settings(); + // Language + ui->languageBox->clear(); + ui->languageBox->addItem(tr("English"), QLocale(QLocale::English)); + foreach(const QString & lang, QDir(MMC->staticData() + "/translations") + .entryList(QStringList() << "*.qm", QDir::Files)) + { + QLocale locale(lang.section(QRegExp("[_\\.]"), 1)); + ui->languageBox->addItem(QLocale::languageToString(locale.language()), locale); + } + ui->languageBox->setCurrentIndex( + ui->languageBox->findData(QLocale(s->get("Language").toString()))); + + // Updates + ui->autoUpdateCheckBox->setChecked(s->get("AutoUpdate").toBool()); + m_currentUpdateChannel = s->get("UpdateChannel").toString(); + //FIXME: make generic + auto theme = s->get("IconTheme").toString(); + if (theme == "pe_dark") + { + ui->themeComboBox->setCurrentIndex(1); + } + else if (theme == "pe_light") + { + ui->themeComboBox->setCurrentIndex(2); + } + else if (theme == "pe_blue") + { + ui->themeComboBox->setCurrentIndex(3); + } + else if (theme == "pe_colored") + { + ui->themeComboBox->setCurrentIndex(4); + } + else if (theme == "OSX") + { + ui->themeComboBox->setCurrentIndex(5); + } + else if (theme == "iOS") + { + ui->themeComboBox->setCurrentIndex(6); + } + else + { + ui->themeComboBox->setCurrentIndex(0); + } + + // Console settings + ui->showConsoleCheck->setChecked(s->get("ShowConsole").toBool()); + ui->autoCloseConsoleCheck->setChecked(s->get("AutoCloseConsole").toBool()); + QString fontFamily = MMC->settings()->get("ConsoleFont").toString(); + QFont consoleFont(fontFamily); + ui->consoleFont->setCurrentFont(consoleFont); + + bool conversionOk = true; + int fontSize = MMC->settings()->get("ConsoleFontSize").toInt(&conversionOk); + if(!conversionOk) + { + fontSize = 11; + } + ui->fontSizeBox->setValue(fontSize); + refreshFontPreview(); + + // FTB + ui->trackFtbBox->setChecked(s->get("TrackFTBInstances").toBool()); + ui->ftbLauncherBox->setText(s->get("FTBLauncherRoot").toString()); + ui->ftbBox->setText(s->get("FTBRoot").toString()); + + // Folders + ui->instDirTextBox->setText(s->get("InstanceDir").toString()); + ui->modsDirTextBox->setText(s->get("CentralModsDir").toString()); + ui->lwjglDirTextBox->setText(s->get("LWJGLDir").toString()); + ui->iconsDirTextBox->setText(s->get("IconsDir").toString()); + + QString sortMode = s->get("InstSortMode").toString(); + + if (sortMode == "LastLaunch") + { + ui->sortLastLaunchedBtn->setChecked(true); + } + else + { + ui->sortByNameBtn->setChecked(true); + } +} + +void MultiMCPage::refreshFontPreview() +{ + int fontSize = ui->fontSizeBox->value(); + QString fontFamily = ui->consoleFont->currentFont().family(); + ui->fontPreview->clear(); + defaultFormat->setFont(QFont(fontFamily, fontSize)); + { + QTextCharFormat format(*defaultFormat); + format.setForeground(QColor("red")); + // append a paragraph/line + auto workCursor = ui->fontPreview->textCursor(); + workCursor.movePosition(QTextCursor::End); + workCursor.insertText(tr("[Something/ERROR] A spooky error!"), format); + workCursor.insertBlock(); + } + { + QTextCharFormat format(*defaultFormat); + // append a paragraph/line + auto workCursor = ui->fontPreview->textCursor(); + workCursor.movePosition(QTextCursor::End); + workCursor.insertText(tr("[Test/INFO] A harmless message..."), format); + workCursor.insertBlock(); + } + { + QTextCharFormat format(*defaultFormat); + format.setForeground(QColor("orange")); + // append a paragraph/line + auto workCursor = ui->fontPreview->textCursor(); + workCursor.movePosition(QTextCursor::End); + workCursor.insertText(tr("[Something/WARN] A not so spooky warning."), format); + workCursor.insertBlock(); + } +} \ No newline at end of file diff --git a/application/pages/global/MultiMCPage.h b/application/pages/global/MultiMCPage.h new file mode 100644 index 00000000..d90acc13 --- /dev/null +++ b/application/pages/global/MultiMCPage.h @@ -0,0 +1,100 @@ +/* Copyright 2013-2015 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include + +#include "java/JavaChecker.h" +#include "pages/BasePage.h" +#include + +class QTextCharFormat; +class SettingsObject; + +namespace Ui +{ +class MultiMCPage; +} + +class MultiMCPage : public QWidget, public BasePage +{ + Q_OBJECT + +public: + explicit MultiMCPage(QWidget *parent = 0); + ~MultiMCPage(); + + QString displayName() const override + { + return tr("MultiMC"); + } + QIcon icon() const override + { + return MMC->getThemedIcon("multimc"); + } + QString id() const override + { + return "multimc-settings"; + } + QString helpPage() const override + { + return "MultiMC-settings"; + } + bool apply() override; + +private: + void applySettings(); + void loadSettings(); + +private +slots: + void on_ftbLauncherBrowseBtn_clicked(); + void on_ftbBrowseBtn_clicked(); + + void on_instDirBrowseBtn_clicked(); + void on_modsDirBrowseBtn_clicked(); + void on_lwjglDirBrowseBtn_clicked(); + void on_iconsDirBrowseBtn_clicked(); + + /*! + * Updates the list of update channels in the combo box. + */ + void refreshUpdateChannelList(); + + /*! + * Updates the channel description label. + */ + void refreshUpdateChannelDesc(); + + /*! + * Updates the font preview + */ + void refreshFontPreview(); + + void updateChannelSelectionChanged(int index); + +private: + Ui::MultiMCPage *ui; + + /*! + * Stores the currently selected update channel. + */ + QString m_currentUpdateChannel; + + // default format for the font preview... + QTextCharFormat *defaultFormat; +}; diff --git a/application/pages/global/MultiMCPage.ui b/application/pages/global/MultiMCPage.ui new file mode 100644 index 00000000..38d1bb1d --- /dev/null +++ b/application/pages/global/MultiMCPage.ui @@ -0,0 +1,532 @@ + + + MultiMCPage + + + + 0 + 0 + 487 + 519 + + + + + 0 + 0 + + + + Settings + + + + :/icons/toolbar/settings:/icons/toolbar/settings + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + QTabWidget::Rounded + + + 0 + + + + Features + + + + + + Update Settings + + + + + + Check for updates when MultiMC starts? + + + + + + + Up&date Channel: + + + updateChannelComboBox + + + + + + + false + + + + + + + No channel selected. + + + true + + + + + + + + + + FTB + + + + + + &Launcher: + + + ftbLauncherBox + + + + + + + false + + + + + + + + + + Files: + + + ftbBox + + + + + + + true + + + ... + + + + + + + false + + + Qt::TabFocus + + + ... + + + + + + + Track FTB instances + + + + + + + + + + Folders + + + + + + I&nstances: + + + instDirTextBox + + + + + + + + + + ... + + + + + + + &Mods: + + + modsDirTextBox + + + + + + + + + + + + + ... + + + + + + + LW&JGL: + + + lwjglDirTextBox + + + + + + + ... + + + + + + + + + + &Icons: + + + iconsDirTextBox + + + + + + + ... + + + + + + + + + + Qt::Vertical + + + + 0 + 0 + + + + + + + + + User Interface + + + + + + MultiMC notifications + + + + + + Reset hidden notifications + + + true + + + + + + + + + + true + + + Instance view sorting mode + + + + + + By &last launched + + + sortingModeGroup + + + + + + + By &name + + + sortingModeGroup + + + + + + + + + + Language (needs restart): + + + + + + + + + + + + Icon Theme (needs restart, work in progress) + + + + + + + 0 + 0 + + + + Qt::StrongFocus + + + + Default + + + + + Simple (Dark Icons) + + + + + Simple (Light Icons) + + + + + Simple (Blue Icons) + + + + + Simple (Colored Icons) + + + + + OSX + + + + + iOS + + + + + + + + + + + Qt::Vertical + + + + 0 + 0 + + + + + + + + + Console + + + + + + Console Settings + + + + + + Show console while the game is running? + + + + + + + Automatically close console when the game quits? + + + + + + + + + + + 0 + 0 + + + + Console font + + + + + + + 0 + 0 + + + + Qt::ScrollBarAlwaysOff + + + false + + + Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + + + + + + + + 0 + 0 + + + + + + + + 5 + + + 16 + + + 11 + + + + + + + + + + + + + + tabWidget + autoUpdateCheckBox + updateChannelComboBox + trackFtbBox + ftbLauncherBox + ftbLauncherBrowseBtn + ftbBox + ftbBrowseBtn + instDirTextBox + instDirBrowseBtn + modsDirTextBox + modsDirBrowseBtn + lwjglDirTextBox + lwjglDirBrowseBtn + iconsDirTextBox + iconsDirBrowseBtn + resetNotificationsBtn + sortLastLaunchedBtn + sortByNameBtn + languageBox + themeComboBox + showConsoleCheck + autoCloseConsoleCheck + consoleFont + fontSizeBox + fontPreview + + + + + + + diff --git a/application/pages/global/ProxyPage.cpp b/application/pages/global/ProxyPage.cpp new file mode 100644 index 00000000..f18f7049 --- /dev/null +++ b/application/pages/global/ProxyPage.cpp @@ -0,0 +1,95 @@ +/* Copyright 2013-2015 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "ProxyPage.h" +#include "ui_ProxyPage.h" + +#include "settings/SettingsObject.h" +#include "MultiMC.h" + +ProxyPage::ProxyPage(QWidget *parent) : QWidget(parent), ui(new Ui::ProxyPage) +{ + ui->setupUi(this); + ui->tabWidget->tabBar()->hide(); + loadSettings(); + updateCheckboxStuff(); + + connect(ui->proxyGroup, SIGNAL(buttonClicked(int)), SLOT(proxyChanged(int))); +} + +ProxyPage::~ProxyPage() +{ + delete ui; +} + +bool ProxyPage::apply() +{ + applySettings(); + return true; +} + +void ProxyPage::updateCheckboxStuff() +{ + ui->proxyAddrBox->setEnabled(!ui->proxyNoneBtn->isChecked() && + !ui->proxyDefaultBtn->isChecked()); + ui->proxyAuthBox->setEnabled(!ui->proxyNoneBtn->isChecked() && + !ui->proxyDefaultBtn->isChecked()); +} + +void ProxyPage::proxyChanged(int) +{ + updateCheckboxStuff(); +} + +void ProxyPage::applySettings() +{ + auto s = MMC->settings(); + + // Proxy + QString proxyType = "None"; + if (ui->proxyDefaultBtn->isChecked()) + proxyType = "Default"; + else if (ui->proxyNoneBtn->isChecked()) + proxyType = "None"; + else if (ui->proxySOCKS5Btn->isChecked()) + proxyType = "SOCKS5"; + else if (ui->proxyHTTPBtn->isChecked()) + proxyType = "HTTP"; + + s->set("ProxyType", proxyType); + s->set("ProxyAddr", ui->proxyAddrEdit->text()); + s->set("ProxyPort", ui->proxyPortEdit->value()); + s->set("ProxyUser", ui->proxyUserEdit->text()); + s->set("ProxyPass", ui->proxyPassEdit->text()); +} +void ProxyPage::loadSettings() +{ + auto s = MMC->settings(); + // Proxy + QString proxyType = s->get("ProxyType").toString(); + if (proxyType == "Default") + ui->proxyDefaultBtn->setChecked(true); + else if (proxyType == "None") + ui->proxyNoneBtn->setChecked(true); + else if (proxyType == "SOCKS5") + ui->proxySOCKS5Btn->setChecked(true); + else if (proxyType == "HTTP") + ui->proxyHTTPBtn->setChecked(true); + + ui->proxyAddrEdit->setText(s->get("ProxyAddr").toString()); + ui->proxyPortEdit->setValue(s->get("ProxyPort").value()); + ui->proxyUserEdit->setText(s->get("ProxyUser").toString()); + ui->proxyPassEdit->setText(s->get("ProxyPass").toString()); +} diff --git a/application/pages/global/ProxyPage.h b/application/pages/global/ProxyPage.h new file mode 100644 index 00000000..362e67a0 --- /dev/null +++ b/application/pages/global/ProxyPage.h @@ -0,0 +1,66 @@ +/* Copyright 2013-2015 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include + +#include "pages/BasePage.h" +#include + +namespace Ui +{ +class ProxyPage; +} + +class ProxyPage : public QWidget, public BasePage +{ + Q_OBJECT + +public: + explicit ProxyPage(QWidget *parent = 0); + ~ProxyPage(); + + QString displayName() const override + { + return tr("Proxy"); + } + QIcon icon() const override + { + return MMC->getThemedIcon("proxy"); + } + QString id() const override + { + return "proxy-settings"; + } + QString helpPage() const override + { + return "Proxy-settings"; + } + bool apply() override; + +private: + void updateCheckboxStuff(); + void applySettings(); + void loadSettings(); + +private +slots: + void proxyChanged(int); + +private: + Ui::ProxyPage *ui; +}; diff --git a/application/pages/global/ProxyPage.ui b/application/pages/global/ProxyPage.ui new file mode 100644 index 00000000..7cddd66d --- /dev/null +++ b/application/pages/global/ProxyPage.ui @@ -0,0 +1,197 @@ + + + ProxyPage + + + + 0 + 0 + 607 + 632 + + + + + 0 + 0 + + + + Settings + + + + :/icons/toolbar/settings:/icons/toolbar/settings + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + + Type + + + + + + Uses your system's default proxy settings. + + + Default + + + proxyGroup + + + + + + + None + + + proxyGroup + + + + + + + SOCKS5 + + + proxyGroup + + + + + + + HTTP + + + proxyGroup + + + + + + + + + + Address and Port + + + + + + 127.0.0.1 + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + QAbstractSpinBox::PlusMinus + + + 65535 + + + 8080 + + + + + + + + + + Authentication + + + + + + + + + Username: + + + + + + + Password: + + + + + + + QLineEdit::Password + + + + + + + Note: Proxy username and password are stored in plain text inside MultiMC's configuration file! + + + true + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + + + + + diff --git a/application/resources/MultiMC.icns b/application/resources/MultiMC.icns new file mode 100644 index 00000000..05ce9207 Binary files /dev/null and b/application/resources/MultiMC.icns differ diff --git a/application/resources/MultiMC.ico b/application/resources/MultiMC.ico new file mode 100644 index 00000000..734af0fb Binary files /dev/null and b/application/resources/MultiMC.ico differ diff --git a/application/resources/MultiMC.manifest b/application/resources/MultiMC.manifest new file mode 100644 index 00000000..3acf8f7f --- /dev/null +++ b/application/resources/MultiMC.manifest @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + Custom Minecraft launcher for managing multiple installs. + + + + + + + + + + + \ No newline at end of file diff --git a/application/resources/OSX/OSX.qrc b/application/resources/OSX/OSX.qrc new file mode 100644 index 00000000..20c71eb8 --- /dev/null +++ b/application/resources/OSX/OSX.qrc @@ -0,0 +1,35 @@ + + + + index.theme + scalable/about.svg + scalable/accounts.svg + scalable/bug.svg + scalable/centralmods.svg + scalable/checkupdate.svg + scalable/copy.svg + scalable/coremods.svg + scalable/externaltools.svg + scalable/instance-settings.svg + scalable/jarmods.svg + scalable/java.svg + scalable/loadermods.svg + scalable/log.svg + scalable/minecraft.svg + scalable/multimc.svg + scalable/new.svg + scalable/news.svg + scalable/notes.svg + scalable/patreon.svg + scalable/proxy.svg + scalable/quickmods.svg + scalable/refresh.svg + scalable/resourcepacks.svg + scalable/screenshots.svg + scalable/settings.svg + scalable/status-bad.svg + scalable/status-good.svg + scalable/status-yellow.svg + scalable/viewfolder.svg + + diff --git a/application/resources/OSX/index.theme b/application/resources/OSX/index.theme new file mode 100644 index 00000000..7f90a32e --- /dev/null +++ b/application/resources/OSX/index.theme @@ -0,0 +1,11 @@ +[Icon Theme] +Name=OSX +Comment=OSX theme by pexner +Inherits=multimc +Directories=scalable + +[scalable] +Size=48 +Type=Scalable +MinSize=16 +MaxSize=256 diff --git a/application/resources/OSX/scalable/about.svg b/application/resources/OSX/scalable/about.svg new file mode 100644 index 00000000..eb87ccf1 --- /dev/null +++ b/application/resources/OSX/scalable/about.svg @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + diff --git a/application/resources/OSX/scalable/accounts.svg b/application/resources/OSX/scalable/accounts.svg new file mode 100644 index 00000000..163bcee0 --- /dev/null +++ b/application/resources/OSX/scalable/accounts.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + + diff --git a/application/resources/OSX/scalable/bug.svg b/application/resources/OSX/scalable/bug.svg new file mode 100644 index 00000000..00565bb6 --- /dev/null +++ b/application/resources/OSX/scalable/bug.svg @@ -0,0 +1,25 @@ + + + + + + + + + diff --git a/application/resources/OSX/scalable/centralmods.svg b/application/resources/OSX/scalable/centralmods.svg new file mode 100644 index 00000000..37b821e4 --- /dev/null +++ b/application/resources/OSX/scalable/centralmods.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + diff --git a/application/resources/OSX/scalable/checkupdate.svg b/application/resources/OSX/scalable/checkupdate.svg new file mode 100644 index 00000000..30cec51f --- /dev/null +++ b/application/resources/OSX/scalable/checkupdate.svg @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + diff --git a/application/resources/OSX/scalable/copy.svg b/application/resources/OSX/scalable/copy.svg new file mode 100644 index 00000000..7382d6e2 --- /dev/null +++ b/application/resources/OSX/scalable/copy.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + diff --git a/application/resources/OSX/scalable/coremods.svg b/application/resources/OSX/scalable/coremods.svg new file mode 100644 index 00000000..b0df6052 --- /dev/null +++ b/application/resources/OSX/scalable/coremods.svg @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + diff --git a/application/resources/OSX/scalable/externaltools.svg b/application/resources/OSX/scalable/externaltools.svg new file mode 100644 index 00000000..a2b7488e --- /dev/null +++ b/application/resources/OSX/scalable/externaltools.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + diff --git a/application/resources/OSX/scalable/instance-settings.svg b/application/resources/OSX/scalable/instance-settings.svg new file mode 100644 index 00000000..394877f8 --- /dev/null +++ b/application/resources/OSX/scalable/instance-settings.svg @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + diff --git a/application/resources/OSX/scalable/jarmods.svg b/application/resources/OSX/scalable/jarmods.svg new file mode 100644 index 00000000..213ec833 --- /dev/null +++ b/application/resources/OSX/scalable/jarmods.svg @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/OSX/scalable/java.svg b/application/resources/OSX/scalable/java.svg new file mode 100644 index 00000000..e1aee159 --- /dev/null +++ b/application/resources/OSX/scalable/java.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/OSX/scalable/loadermods.svg b/application/resources/OSX/scalable/loadermods.svg new file mode 100644 index 00000000..76951ebd --- /dev/null +++ b/application/resources/OSX/scalable/loadermods.svg @@ -0,0 +1,14 @@ + + + + + + + + + + diff --git a/application/resources/OSX/scalable/log.svg b/application/resources/OSX/scalable/log.svg new file mode 100644 index 00000000..0ac45d54 --- /dev/null +++ b/application/resources/OSX/scalable/log.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + diff --git a/application/resources/OSX/scalable/minecraft.svg b/application/resources/OSX/scalable/minecraft.svg new file mode 100644 index 00000000..86c915bc --- /dev/null +++ b/application/resources/OSX/scalable/minecraft.svg @@ -0,0 +1,12 @@ + + + + + + + + + + diff --git a/application/resources/OSX/scalable/multimc.svg b/application/resources/OSX/scalable/multimc.svg new file mode 100644 index 00000000..caad21b5 --- /dev/null +++ b/application/resources/OSX/scalable/multimc.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + diff --git a/application/resources/OSX/scalable/new.svg b/application/resources/OSX/scalable/new.svg new file mode 100644 index 00000000..79ee87ba --- /dev/null +++ b/application/resources/OSX/scalable/new.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + diff --git a/application/resources/OSX/scalable/news.svg b/application/resources/OSX/scalable/news.svg new file mode 100644 index 00000000..b8ce3cd1 --- /dev/null +++ b/application/resources/OSX/scalable/news.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + diff --git a/application/resources/OSX/scalable/notes.svg b/application/resources/OSX/scalable/notes.svg new file mode 100644 index 00000000..c2e95cfd --- /dev/null +++ b/application/resources/OSX/scalable/notes.svg @@ -0,0 +1,21 @@ + + + + + + + + + + + + + diff --git a/application/resources/OSX/scalable/patreon.svg b/application/resources/OSX/scalable/patreon.svg new file mode 100644 index 00000000..4f0da3e5 --- /dev/null +++ b/application/resources/OSX/scalable/patreon.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + diff --git a/application/resources/OSX/scalable/proxy.svg b/application/resources/OSX/scalable/proxy.svg new file mode 100644 index 00000000..99acaa2b --- /dev/null +++ b/application/resources/OSX/scalable/proxy.svg @@ -0,0 +1,16 @@ + + + + + + + + + + diff --git a/application/resources/OSX/scalable/quickmods.svg b/application/resources/OSX/scalable/quickmods.svg new file mode 100644 index 00000000..e0aaad87 --- /dev/null +++ b/application/resources/OSX/scalable/quickmods.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + diff --git a/application/resources/OSX/scalable/refresh.svg b/application/resources/OSX/scalable/refresh.svg new file mode 100644 index 00000000..c97489c1 --- /dev/null +++ b/application/resources/OSX/scalable/refresh.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + + diff --git a/application/resources/OSX/scalable/resourcepacks.svg b/application/resources/OSX/scalable/resourcepacks.svg new file mode 100644 index 00000000..c85d4e3c --- /dev/null +++ b/application/resources/OSX/scalable/resourcepacks.svg @@ -0,0 +1,17 @@ + + + + + + + + + + diff --git a/application/resources/OSX/scalable/screenshots.svg b/application/resources/OSX/scalable/screenshots.svg new file mode 100644 index 00000000..12df0c88 --- /dev/null +++ b/application/resources/OSX/scalable/screenshots.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + diff --git a/application/resources/OSX/scalable/settings.svg b/application/resources/OSX/scalable/settings.svg new file mode 100644 index 00000000..dcdd9f1c --- /dev/null +++ b/application/resources/OSX/scalable/settings.svg @@ -0,0 +1,25 @@ + + + + + + + + + + + + + diff --git a/application/resources/OSX/scalable/status-bad.svg b/application/resources/OSX/scalable/status-bad.svg new file mode 100644 index 00000000..add7a6f7 --- /dev/null +++ b/application/resources/OSX/scalable/status-bad.svg @@ -0,0 +1,11 @@ + + + + + + + diff --git a/application/resources/OSX/scalable/status-good.svg b/application/resources/OSX/scalable/status-good.svg new file mode 100644 index 00000000..f10da757 --- /dev/null +++ b/application/resources/OSX/scalable/status-good.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + diff --git a/application/resources/OSX/scalable/status-yellow.svg b/application/resources/OSX/scalable/status-yellow.svg new file mode 100644 index 00000000..fba697bc --- /dev/null +++ b/application/resources/OSX/scalable/status-yellow.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + + diff --git a/application/resources/OSX/scalable/viewfolder.svg b/application/resources/OSX/scalable/viewfolder.svg new file mode 100644 index 00000000..682c72c7 --- /dev/null +++ b/application/resources/OSX/scalable/viewfolder.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + + diff --git a/application/resources/backgrounds/backgrounds.qrc b/application/resources/backgrounds/backgrounds.qrc new file mode 100644 index 00000000..55de139e --- /dev/null +++ b/application/resources/backgrounds/backgrounds.qrc @@ -0,0 +1,6 @@ + + + + catbgrnd2.png + + diff --git a/application/resources/backgrounds/catbgrnd2.png b/application/resources/backgrounds/catbgrnd2.png new file mode 100644 index 00000000..2b949e0b Binary files /dev/null and b/application/resources/backgrounds/catbgrnd2.png differ diff --git a/application/resources/iOS/iOS.qrc b/application/resources/iOS/iOS.qrc new file mode 100644 index 00000000..eb625d0b --- /dev/null +++ b/application/resources/iOS/iOS.qrc @@ -0,0 +1,35 @@ + + + + index.theme + scalable/about.svg + scalable/accounts.svg + scalable/bug.svg + scalable/centralmods.svg + scalable/checkupdate.svg + scalable/copy.svg + scalable/coremods.svg + scalable/externaltools.svg + scalable/instance-settings.svg + scalable/jarmods.svg + scalable/java.svg + scalable/loadermods.svg + scalable/log.svg + scalable/minecraft.svg + scalable/multimc.svg + scalable/new.svg + scalable/news.svg + scalable/notes.svg + scalable/patreon.svg + scalable/proxy.svg + scalable/quickmods.svg + scalable/refresh.svg + scalable/resourcepacks.svg + scalable/screenshots.svg + scalable/settings.svg + scalable/status-bad.svg + scalable/status-good.svg + scalable/status-yellow.svg + scalable/viewfolder.svg + + diff --git a/application/resources/iOS/index.theme b/application/resources/iOS/index.theme new file mode 100644 index 00000000..b0f2f6ba --- /dev/null +++ b/application/resources/iOS/index.theme @@ -0,0 +1,11 @@ +[Icon Theme] +Name=iOS +Comment=iOS theme by pexner +Inherits=multimc +Directories=scalable + +[scalable] +Size=48 +Type=Scalable +MinSize=16 +MaxSize=256 diff --git a/application/resources/iOS/scalable/about.svg b/application/resources/iOS/scalable/about.svg new file mode 100644 index 00000000..c4d35471 --- /dev/null +++ b/application/resources/iOS/scalable/about.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + diff --git a/application/resources/iOS/scalable/accounts.svg b/application/resources/iOS/scalable/accounts.svg new file mode 100644 index 00000000..65f76c3f --- /dev/null +++ b/application/resources/iOS/scalable/accounts.svg @@ -0,0 +1,14 @@ + + + + + + + + + + diff --git a/application/resources/iOS/scalable/bug.svg b/application/resources/iOS/scalable/bug.svg new file mode 100644 index 00000000..fc4a3d69 --- /dev/null +++ b/application/resources/iOS/scalable/bug.svg @@ -0,0 +1,22 @@ + + + + + + diff --git a/application/resources/iOS/scalable/centralmods.svg b/application/resources/iOS/scalable/centralmods.svg new file mode 100644 index 00000000..1b4c4741 --- /dev/null +++ b/application/resources/iOS/scalable/centralmods.svg @@ -0,0 +1,13 @@ + + + + + + + + + diff --git a/application/resources/iOS/scalable/checkupdate.svg b/application/resources/iOS/scalable/checkupdate.svg new file mode 100644 index 00000000..9fc983d1 --- /dev/null +++ b/application/resources/iOS/scalable/checkupdate.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + diff --git a/application/resources/iOS/scalable/copy.svg b/application/resources/iOS/scalable/copy.svg new file mode 100644 index 00000000..3ccc2f06 --- /dev/null +++ b/application/resources/iOS/scalable/copy.svg @@ -0,0 +1,13 @@ + + + + + + + + + + diff --git a/application/resources/iOS/scalable/coremods.svg b/application/resources/iOS/scalable/coremods.svg new file mode 100644 index 00000000..ea47872c --- /dev/null +++ b/application/resources/iOS/scalable/coremods.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + diff --git a/application/resources/iOS/scalable/externaltools.svg b/application/resources/iOS/scalable/externaltools.svg new file mode 100644 index 00000000..16e9fa48 --- /dev/null +++ b/application/resources/iOS/scalable/externaltools.svg @@ -0,0 +1,13 @@ + + + + + + + + + + diff --git a/application/resources/iOS/scalable/instance-settings.svg b/application/resources/iOS/scalable/instance-settings.svg new file mode 100644 index 00000000..95b8a508 --- /dev/null +++ b/application/resources/iOS/scalable/instance-settings.svg @@ -0,0 +1,19 @@ + + + + + + + + + + diff --git a/application/resources/iOS/scalable/jarmods.svg b/application/resources/iOS/scalable/jarmods.svg new file mode 100644 index 00000000..c4c5ca8c --- /dev/null +++ b/application/resources/iOS/scalable/jarmods.svg @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/iOS/scalable/java.svg b/application/resources/iOS/scalable/java.svg new file mode 100644 index 00000000..8d7c2798 --- /dev/null +++ b/application/resources/iOS/scalable/java.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/iOS/scalable/loadermods.svg b/application/resources/iOS/scalable/loadermods.svg new file mode 100644 index 00000000..010efa11 --- /dev/null +++ b/application/resources/iOS/scalable/loadermods.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + diff --git a/application/resources/iOS/scalable/log.svg b/application/resources/iOS/scalable/log.svg new file mode 100644 index 00000000..5d1c7f06 --- /dev/null +++ b/application/resources/iOS/scalable/log.svg @@ -0,0 +1,13 @@ + + + + + + + + + + diff --git a/application/resources/iOS/scalable/minecraft.svg b/application/resources/iOS/scalable/minecraft.svg new file mode 100644 index 00000000..069b4e71 --- /dev/null +++ b/application/resources/iOS/scalable/minecraft.svg @@ -0,0 +1,8 @@ + + + + + + diff --git a/application/resources/iOS/scalable/multimc.svg b/application/resources/iOS/scalable/multimc.svg new file mode 100644 index 00000000..bc819433 --- /dev/null +++ b/application/resources/iOS/scalable/multimc.svg @@ -0,0 +1,13 @@ + + + + + + + + + diff --git a/application/resources/iOS/scalable/new.svg b/application/resources/iOS/scalable/new.svg new file mode 100644 index 00000000..9f221580 --- /dev/null +++ b/application/resources/iOS/scalable/new.svg @@ -0,0 +1,13 @@ + + + + + + + + + + diff --git a/application/resources/iOS/scalable/news.svg b/application/resources/iOS/scalable/news.svg new file mode 100644 index 00000000..d3c010bb --- /dev/null +++ b/application/resources/iOS/scalable/news.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + diff --git a/application/resources/iOS/scalable/notes.svg b/application/resources/iOS/scalable/notes.svg new file mode 100644 index 00000000..b42ebeef --- /dev/null +++ b/application/resources/iOS/scalable/notes.svg @@ -0,0 +1,15 @@ + + + + + + + + + + diff --git a/application/resources/iOS/scalable/patreon.svg b/application/resources/iOS/scalable/patreon.svg new file mode 100644 index 00000000..1bd06f4a --- /dev/null +++ b/application/resources/iOS/scalable/patreon.svg @@ -0,0 +1,12 @@ + + + + + + + + + diff --git a/application/resources/iOS/scalable/proxy.svg b/application/resources/iOS/scalable/proxy.svg new file mode 100644 index 00000000..f6552281 --- /dev/null +++ b/application/resources/iOS/scalable/proxy.svg @@ -0,0 +1,11 @@ + + + + + + diff --git a/application/resources/iOS/scalable/quickmods.svg b/application/resources/iOS/scalable/quickmods.svg new file mode 100644 index 00000000..cd63ba71 --- /dev/null +++ b/application/resources/iOS/scalable/quickmods.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + diff --git a/application/resources/iOS/scalable/refresh.svg b/application/resources/iOS/scalable/refresh.svg new file mode 100644 index 00000000..297b79c9 --- /dev/null +++ b/application/resources/iOS/scalable/refresh.svg @@ -0,0 +1,13 @@ + + + + + + + + + + diff --git a/application/resources/iOS/scalable/resourcepacks.svg b/application/resources/iOS/scalable/resourcepacks.svg new file mode 100644 index 00000000..5b359d63 --- /dev/null +++ b/application/resources/iOS/scalable/resourcepacks.svg @@ -0,0 +1,15 @@ + + + + + + + + + + diff --git a/application/resources/iOS/scalable/screenshots.svg b/application/resources/iOS/scalable/screenshots.svg new file mode 100644 index 00000000..39ce7b82 --- /dev/null +++ b/application/resources/iOS/scalable/screenshots.svg @@ -0,0 +1,14 @@ + + + + + + + + + + diff --git a/application/resources/iOS/scalable/settings.svg b/application/resources/iOS/scalable/settings.svg new file mode 100644 index 00000000..95b8a508 --- /dev/null +++ b/application/resources/iOS/scalable/settings.svg @@ -0,0 +1,19 @@ + + + + + + + + + + diff --git a/application/resources/iOS/scalable/status-bad.svg b/application/resources/iOS/scalable/status-bad.svg new file mode 100644 index 00000000..4019c8da --- /dev/null +++ b/application/resources/iOS/scalable/status-bad.svg @@ -0,0 +1,10 @@ + + + + + + diff --git a/application/resources/iOS/scalable/status-good.svg b/application/resources/iOS/scalable/status-good.svg new file mode 100644 index 00000000..e1859113 --- /dev/null +++ b/application/resources/iOS/scalable/status-good.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + diff --git a/application/resources/iOS/scalable/status-yellow.svg b/application/resources/iOS/scalable/status-yellow.svg new file mode 100644 index 00000000..d8a28e23 --- /dev/null +++ b/application/resources/iOS/scalable/status-yellow.svg @@ -0,0 +1,56 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/application/resources/iOS/scalable/viewfolder.svg b/application/resources/iOS/scalable/viewfolder.svg new file mode 100644 index 00000000..0ae0c0b5 --- /dev/null +++ b/application/resources/iOS/scalable/viewfolder.svg @@ -0,0 +1,12 @@ + + + + + + + + + + diff --git a/application/resources/instances/brick.png b/application/resources/instances/brick.png new file mode 100644 index 00000000..0b534366 Binary files /dev/null and b/application/resources/instances/brick.png differ diff --git a/application/resources/instances/broken.png b/application/resources/instances/broken.png new file mode 100644 index 00000000..7a80a76e Binary files /dev/null and b/application/resources/instances/broken.png differ diff --git a/application/resources/instances/chicken.png b/application/resources/instances/chicken.png new file mode 100644 index 00000000..f870467a Binary files /dev/null and b/application/resources/instances/chicken.png differ diff --git a/application/resources/instances/chicken128.png b/application/resources/instances/chicken128.png new file mode 100644 index 00000000..71f6dedc Binary files /dev/null and b/application/resources/instances/chicken128.png differ diff --git a/application/resources/instances/creeper.png b/application/resources/instances/creeper.png new file mode 100644 index 00000000..a67ecfc3 Binary files /dev/null and b/application/resources/instances/creeper.png differ diff --git a/application/resources/instances/creeper128.png b/application/resources/instances/creeper128.png new file mode 100644 index 00000000..41b7d07d Binary files /dev/null and b/application/resources/instances/creeper128.png differ diff --git a/application/resources/instances/derp.png b/application/resources/instances/derp.png new file mode 100644 index 00000000..4c361942 Binary files /dev/null and b/application/resources/instances/derp.png differ diff --git a/application/resources/instances/diamond.png b/application/resources/instances/diamond.png new file mode 100644 index 00000000..376ab901 Binary files /dev/null and b/application/resources/instances/diamond.png differ diff --git a/application/resources/instances/dirt.png b/application/resources/instances/dirt.png new file mode 100644 index 00000000..9e19eb8f Binary files /dev/null and b/application/resources/instances/dirt.png differ diff --git a/application/resources/instances/enderman.png b/application/resources/instances/enderman.png new file mode 100644 index 00000000..9f3a72b3 Binary files /dev/null and b/application/resources/instances/enderman.png differ diff --git a/application/resources/instances/enderpearl.png b/application/resources/instances/enderpearl.png new file mode 100644 index 00000000..a818eb8e Binary files /dev/null and b/application/resources/instances/enderpearl.png differ diff --git a/application/resources/instances/enderpearl128.png b/application/resources/instances/enderpearl128.png new file mode 100644 index 00000000..0a5bf91a Binary files /dev/null and b/application/resources/instances/enderpearl128.png differ diff --git a/application/resources/instances/ftb_glow.png b/application/resources/instances/ftb_glow.png new file mode 100644 index 00000000..c4e6fd5d Binary files /dev/null and b/application/resources/instances/ftb_glow.png differ diff --git a/application/resources/instances/ftb_glow128.png b/application/resources/instances/ftb_glow128.png new file mode 100644 index 00000000..86632b21 Binary files /dev/null and b/application/resources/instances/ftb_glow128.png differ diff --git a/application/resources/instances/ftb_logo.png b/application/resources/instances/ftb_logo.png new file mode 100644 index 00000000..20df7171 Binary files /dev/null and b/application/resources/instances/ftb_logo.png differ diff --git a/application/resources/instances/ftb_logo128.png b/application/resources/instances/ftb_logo128.png new file mode 100644 index 00000000..e725b7fe Binary files /dev/null and b/application/resources/instances/ftb_logo128.png differ diff --git a/application/resources/instances/gear.png b/application/resources/instances/gear.png new file mode 100644 index 00000000..da9ba2f9 Binary files /dev/null and b/application/resources/instances/gear.png differ diff --git a/application/resources/instances/gear128.png b/application/resources/instances/gear128.png new file mode 100644 index 00000000..75c68a66 Binary files /dev/null and b/application/resources/instances/gear128.png differ diff --git a/application/resources/instances/gold.png b/application/resources/instances/gold.png new file mode 100644 index 00000000..9bedda16 Binary files /dev/null and b/application/resources/instances/gold.png differ diff --git a/application/resources/instances/grass.png b/application/resources/instances/grass.png new file mode 100644 index 00000000..f1694547 Binary files /dev/null and b/application/resources/instances/grass.png differ diff --git a/application/resources/instances/herobrine.png b/application/resources/instances/herobrine.png new file mode 100644 index 00000000..e5460da3 Binary files /dev/null and b/application/resources/instances/herobrine.png differ diff --git a/application/resources/instances/herobrine128.png b/application/resources/instances/herobrine128.png new file mode 100644 index 00000000..13f1494c Binary files /dev/null and b/application/resources/instances/herobrine128.png differ diff --git a/application/resources/instances/infinity.png b/application/resources/instances/infinity.png new file mode 100644 index 00000000..bd94a3dc Binary files /dev/null and b/application/resources/instances/infinity.png differ diff --git a/application/resources/instances/infinity128.png b/application/resources/instances/infinity128.png new file mode 100644 index 00000000..226847fb Binary files /dev/null and b/application/resources/instances/infinity128.png differ diff --git a/application/resources/instances/instances.qrc b/application/resources/instances/instances.qrc new file mode 100644 index 00000000..09ae25d0 --- /dev/null +++ b/application/resources/instances/instances.qrc @@ -0,0 +1,49 @@ + + + + + brick.png + diamond.png + dirt.png + gold.png + grass.png + stone.png + tnt.png + iron.png + planks.png + + + derp.png + enderman.png + + + chicken128.png + creeper128.png + enderpearl128.png + ftb_glow128.png + ftb_logo128.png + gear128.png + herobrine128.png + infinity128.png + magitech128.png + meat128.png + netherstar128.png + skeleton128.png + squarecreeper128.png + steve128.png + + + + enderman.png + herobrine.png + derp.png + + + updateavailable.png + + + kitten.png + + broken.png + + diff --git a/application/resources/instances/iron.png b/application/resources/instances/iron.png new file mode 100644 index 00000000..28960782 Binary files /dev/null and b/application/resources/instances/iron.png differ diff --git a/application/resources/instances/kitten.png b/application/resources/instances/kitten.png new file mode 100644 index 00000000..d17661ce Binary files /dev/null and b/application/resources/instances/kitten.png differ diff --git a/application/resources/instances/magitech.png b/application/resources/instances/magitech.png new file mode 100644 index 00000000..6fd8ff60 Binary files /dev/null and b/application/resources/instances/magitech.png differ diff --git a/application/resources/instances/magitech128.png b/application/resources/instances/magitech128.png new file mode 100644 index 00000000..0f81a199 Binary files /dev/null and b/application/resources/instances/magitech128.png differ diff --git a/application/resources/instances/meat.png b/application/resources/instances/meat.png new file mode 100644 index 00000000..6694859d Binary files /dev/null and b/application/resources/instances/meat.png differ diff --git a/application/resources/instances/meat128.png b/application/resources/instances/meat128.png new file mode 100644 index 00000000..fefc9bf1 Binary files /dev/null and b/application/resources/instances/meat128.png differ diff --git a/application/resources/instances/netherstar.png b/application/resources/instances/netherstar.png new file mode 100644 index 00000000..43cb5113 Binary files /dev/null and b/application/resources/instances/netherstar.png differ diff --git a/application/resources/instances/netherstar128.png b/application/resources/instances/netherstar128.png new file mode 100644 index 00000000..132085f0 Binary files /dev/null and b/application/resources/instances/netherstar128.png differ diff --git a/application/resources/instances/planks.png b/application/resources/instances/planks.png new file mode 100644 index 00000000..7fcf8467 Binary files /dev/null and b/application/resources/instances/planks.png differ diff --git a/application/resources/instances/skeleton.png b/application/resources/instances/skeleton.png new file mode 100644 index 00000000..0c8d3505 Binary files /dev/null and b/application/resources/instances/skeleton.png differ diff --git a/application/resources/instances/skeleton128.png b/application/resources/instances/skeleton128.png new file mode 100644 index 00000000..55fcf5a9 Binary files /dev/null and b/application/resources/instances/skeleton128.png differ diff --git a/application/resources/instances/squarecreeper.png b/application/resources/instances/squarecreeper.png new file mode 100644 index 00000000..b78c4ae0 Binary files /dev/null and b/application/resources/instances/squarecreeper.png differ diff --git a/application/resources/instances/squarecreeper128.png b/application/resources/instances/squarecreeper128.png new file mode 100644 index 00000000..c82d8406 Binary files /dev/null and b/application/resources/instances/squarecreeper128.png differ diff --git a/application/resources/instances/steve.png b/application/resources/instances/steve.png new file mode 100644 index 00000000..07c6acde Binary files /dev/null and b/application/resources/instances/steve.png differ diff --git a/application/resources/instances/steve128.png b/application/resources/instances/steve128.png new file mode 100644 index 00000000..a07cbd2f Binary files /dev/null and b/application/resources/instances/steve128.png differ diff --git a/application/resources/instances/stone.png b/application/resources/instances/stone.png new file mode 100644 index 00000000..34f9a751 Binary files /dev/null and b/application/resources/instances/stone.png differ diff --git a/application/resources/instances/tnt.png b/application/resources/instances/tnt.png new file mode 100644 index 00000000..e40d404d Binary files /dev/null and b/application/resources/instances/tnt.png differ diff --git a/application/resources/instances/updateavailable.png b/application/resources/instances/updateavailable.png new file mode 100644 index 00000000..754005f9 Binary files /dev/null and b/application/resources/instances/updateavailable.png differ diff --git a/application/resources/multimc.rc b/application/resources/multimc.rc new file mode 100644 index 00000000..e7340f2a --- /dev/null +++ b/application/resources/multimc.rc @@ -0,0 +1,29 @@ +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN +#endif +#include + +IDI_ICON1 ICON DISCARDABLE "MultiMC.ico" +1 RT_MANIFEST "MultiMC.manifest" + +VS_VERSION_INFO VERSIONINFO +FILEVERSION 1,0,0,0 +FILEOS VOS_NT_WINDOWS32 +FILETYPE VFT_APP +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "000004b0" + BEGIN + VALUE "CompanyName", "MultiMC Contributors" + VALUE "FileDescription", "MultiMC Launcher" + VALUE "FileVersion", "1.0.0.0" + VALUE "ProductName", "MultiMC" + VALUE "ProductVersion", "5" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x0000, 0x04b0 // Unicode + END +END diff --git a/application/resources/multimc/16x16/about.png b/application/resources/multimc/16x16/about.png new file mode 100644 index 00000000..a6a986e1 Binary files /dev/null and b/application/resources/multimc/16x16/about.png differ diff --git a/application/resources/multimc/16x16/bug.png b/application/resources/multimc/16x16/bug.png new file mode 100644 index 00000000..0c5b78b4 Binary files /dev/null and b/application/resources/multimc/16x16/bug.png differ diff --git a/application/resources/multimc/16x16/cat.png b/application/resources/multimc/16x16/cat.png new file mode 100644 index 00000000..e6e31b44 Binary files /dev/null and b/application/resources/multimc/16x16/cat.png differ diff --git a/application/resources/multimc/16x16/centralmods.png b/application/resources/multimc/16x16/centralmods.png new file mode 100644 index 00000000..c1b91c76 Binary files /dev/null and b/application/resources/multimc/16x16/centralmods.png differ diff --git a/application/resources/multimc/16x16/checkupdate.png b/application/resources/multimc/16x16/checkupdate.png new file mode 100644 index 00000000..f3742058 Binary files /dev/null and b/application/resources/multimc/16x16/checkupdate.png differ diff --git a/application/resources/multimc/16x16/copy.png b/application/resources/multimc/16x16/copy.png new file mode 100644 index 00000000..ccaed9e1 Binary files /dev/null and b/application/resources/multimc/16x16/copy.png differ diff --git a/application/resources/multimc/16x16/coremods.png b/application/resources/multimc/16x16/coremods.png new file mode 100644 index 00000000..af0f1166 Binary files /dev/null and b/application/resources/multimc/16x16/coremods.png differ diff --git a/application/resources/multimc/16x16/help.png b/application/resources/multimc/16x16/help.png new file mode 100644 index 00000000..e6edf6ba Binary files /dev/null and b/application/resources/multimc/16x16/help.png differ diff --git a/application/resources/multimc/16x16/instance-settings.png b/application/resources/multimc/16x16/instance-settings.png new file mode 100644 index 00000000..b916cd24 Binary files /dev/null and b/application/resources/multimc/16x16/instance-settings.png differ diff --git a/application/resources/multimc/16x16/jarmods.png b/application/resources/multimc/16x16/jarmods.png new file mode 100644 index 00000000..1a97c9c0 Binary files /dev/null and b/application/resources/multimc/16x16/jarmods.png differ diff --git a/application/resources/multimc/16x16/loadermods.png b/application/resources/multimc/16x16/loadermods.png new file mode 100644 index 00000000..b5ab3fce Binary files /dev/null and b/application/resources/multimc/16x16/loadermods.png differ diff --git a/application/resources/multimc/16x16/log.png b/application/resources/multimc/16x16/log.png new file mode 100644 index 00000000..efa2a0b5 Binary files /dev/null and b/application/resources/multimc/16x16/log.png differ diff --git a/application/resources/multimc/16x16/minecraft.png b/application/resources/multimc/16x16/minecraft.png new file mode 100644 index 00000000..e9f2f2a5 Binary files /dev/null and b/application/resources/multimc/16x16/minecraft.png differ diff --git a/application/resources/multimc/16x16/new.png b/application/resources/multimc/16x16/new.png new file mode 100644 index 00000000..2e56f589 Binary files /dev/null and b/application/resources/multimc/16x16/new.png differ diff --git a/application/resources/multimc/16x16/news.png b/application/resources/multimc/16x16/news.png new file mode 100644 index 00000000..872e85db Binary files /dev/null and b/application/resources/multimc/16x16/news.png differ diff --git a/application/resources/multimc/16x16/noaccount.png b/application/resources/multimc/16x16/noaccount.png new file mode 100644 index 00000000..b49bcf36 Binary files /dev/null and b/application/resources/multimc/16x16/noaccount.png differ diff --git a/application/resources/multimc/16x16/patreon.png b/application/resources/multimc/16x16/patreon.png new file mode 100644 index 00000000..cde2b326 Binary files /dev/null and b/application/resources/multimc/16x16/patreon.png differ diff --git a/application/resources/multimc/16x16/refresh.png b/application/resources/multimc/16x16/refresh.png new file mode 100644 index 00000000..86b6f82c Binary files /dev/null and b/application/resources/multimc/16x16/refresh.png differ diff --git a/application/resources/multimc/16x16/resourcepacks.png b/application/resources/multimc/16x16/resourcepacks.png new file mode 100644 index 00000000..d862f5ca Binary files /dev/null and b/application/resources/multimc/16x16/resourcepacks.png differ diff --git a/application/resources/multimc/16x16/screenshots.png b/application/resources/multimc/16x16/screenshots.png new file mode 100644 index 00000000..460000d4 Binary files /dev/null and b/application/resources/multimc/16x16/screenshots.png differ diff --git a/application/resources/multimc/16x16/settings.png b/application/resources/multimc/16x16/settings.png new file mode 100644 index 00000000..b916cd24 Binary files /dev/null and b/application/resources/multimc/16x16/settings.png differ diff --git a/application/resources/multimc/16x16/status-bad.png b/application/resources/multimc/16x16/status-bad.png new file mode 100644 index 00000000..5b3f2051 Binary files /dev/null and b/application/resources/multimc/16x16/status-bad.png differ diff --git a/application/resources/multimc/16x16/status-good.png b/application/resources/multimc/16x16/status-good.png new file mode 100644 index 00000000..5cbdee81 Binary files /dev/null and b/application/resources/multimc/16x16/status-good.png differ diff --git a/application/resources/multimc/16x16/status-yellow.png b/application/resources/multimc/16x16/status-yellow.png new file mode 100644 index 00000000..b25375d1 Binary files /dev/null and b/application/resources/multimc/16x16/status-yellow.png differ diff --git a/application/resources/multimc/16x16/viewfolder.png b/application/resources/multimc/16x16/viewfolder.png new file mode 100644 index 00000000..98b8a944 Binary files /dev/null and b/application/resources/multimc/16x16/viewfolder.png differ diff --git a/application/resources/multimc/22x22/about.png b/application/resources/multimc/22x22/about.png new file mode 100644 index 00000000..57775e25 Binary files /dev/null and b/application/resources/multimc/22x22/about.png differ diff --git a/application/resources/multimc/22x22/bug.png b/application/resources/multimc/22x22/bug.png new file mode 100644 index 00000000..90481bba Binary files /dev/null and b/application/resources/multimc/22x22/bug.png differ diff --git a/application/resources/multimc/22x22/cat.png b/application/resources/multimc/22x22/cat.png new file mode 100644 index 00000000..3ea7ba69 Binary files /dev/null and b/application/resources/multimc/22x22/cat.png differ diff --git a/application/resources/multimc/22x22/centralmods.png b/application/resources/multimc/22x22/centralmods.png new file mode 100644 index 00000000..a10f9a2b Binary files /dev/null and b/application/resources/multimc/22x22/centralmods.png differ diff --git a/application/resources/multimc/22x22/checkupdate.png b/application/resources/multimc/22x22/checkupdate.png new file mode 100644 index 00000000..badb200c Binary files /dev/null and b/application/resources/multimc/22x22/checkupdate.png differ diff --git a/application/resources/multimc/22x22/copy.png b/application/resources/multimc/22x22/copy.png new file mode 100644 index 00000000..ea236a24 Binary files /dev/null and b/application/resources/multimc/22x22/copy.png differ diff --git a/application/resources/multimc/22x22/help.png b/application/resources/multimc/22x22/help.png new file mode 100644 index 00000000..da79b3e3 Binary files /dev/null and b/application/resources/multimc/22x22/help.png differ diff --git a/application/resources/multimc/22x22/instance-settings.png b/application/resources/multimc/22x22/instance-settings.png new file mode 100644 index 00000000..daf56aad Binary files /dev/null and b/application/resources/multimc/22x22/instance-settings.png differ diff --git a/application/resources/multimc/22x22/new.png b/application/resources/multimc/22x22/new.png new file mode 100644 index 00000000..c707fbbf Binary files /dev/null and b/application/resources/multimc/22x22/new.png differ diff --git a/application/resources/multimc/22x22/news.png b/application/resources/multimc/22x22/news.png new file mode 100644 index 00000000..1953bf7b Binary files /dev/null and b/application/resources/multimc/22x22/news.png differ diff --git a/application/resources/multimc/22x22/patreon.png b/application/resources/multimc/22x22/patreon.png new file mode 100644 index 00000000..b6235ad2 Binary files /dev/null and b/application/resources/multimc/22x22/patreon.png differ diff --git a/application/resources/multimc/22x22/refresh.png b/application/resources/multimc/22x22/refresh.png new file mode 100644 index 00000000..45b5535c Binary files /dev/null and b/application/resources/multimc/22x22/refresh.png differ diff --git a/application/resources/multimc/22x22/screenshots.png b/application/resources/multimc/22x22/screenshots.png new file mode 100644 index 00000000..6fb42bbd Binary files /dev/null and b/application/resources/multimc/22x22/screenshots.png differ diff --git a/application/resources/multimc/22x22/settings.png b/application/resources/multimc/22x22/settings.png new file mode 100644 index 00000000..daf56aad Binary files /dev/null and b/application/resources/multimc/22x22/settings.png differ diff --git a/application/resources/multimc/22x22/status-bad.png b/application/resources/multimc/22x22/status-bad.png new file mode 100644 index 00000000..2707539e Binary files /dev/null and b/application/resources/multimc/22x22/status-bad.png differ diff --git a/application/resources/multimc/22x22/status-good.png b/application/resources/multimc/22x22/status-good.png new file mode 100644 index 00000000..f55debc3 Binary files /dev/null and b/application/resources/multimc/22x22/status-good.png differ diff --git a/application/resources/multimc/22x22/status-yellow.png b/application/resources/multimc/22x22/status-yellow.png new file mode 100644 index 00000000..481eb7f3 Binary files /dev/null and b/application/resources/multimc/22x22/status-yellow.png differ diff --git a/application/resources/multimc/22x22/viewfolder.png b/application/resources/multimc/22x22/viewfolder.png new file mode 100644 index 00000000..b645167f Binary files /dev/null and b/application/resources/multimc/22x22/viewfolder.png differ diff --git a/application/resources/multimc/24x24/cat.png b/application/resources/multimc/24x24/cat.png new file mode 100644 index 00000000..c93245f6 Binary files /dev/null and b/application/resources/multimc/24x24/cat.png differ diff --git a/application/resources/multimc/24x24/coremods.png b/application/resources/multimc/24x24/coremods.png new file mode 100644 index 00000000..90603d24 Binary files /dev/null and b/application/resources/multimc/24x24/coremods.png differ diff --git a/application/resources/multimc/24x24/jarmods.png b/application/resources/multimc/24x24/jarmods.png new file mode 100644 index 00000000..68cb8e9d Binary files /dev/null and b/application/resources/multimc/24x24/jarmods.png differ diff --git a/application/resources/multimc/24x24/loadermods.png b/application/resources/multimc/24x24/loadermods.png new file mode 100644 index 00000000..250a6260 Binary files /dev/null and b/application/resources/multimc/24x24/loadermods.png differ diff --git a/application/resources/multimc/24x24/log.png b/application/resources/multimc/24x24/log.png new file mode 100644 index 00000000..fe302053 Binary files /dev/null and b/application/resources/multimc/24x24/log.png differ diff --git a/application/resources/multimc/24x24/minecraft.png b/application/resources/multimc/24x24/minecraft.png new file mode 100644 index 00000000..b31177c9 Binary files /dev/null and b/application/resources/multimc/24x24/minecraft.png differ diff --git a/application/resources/multimc/24x24/noaccount.png b/application/resources/multimc/24x24/noaccount.png new file mode 100644 index 00000000..ac12437c Binary files /dev/null and b/application/resources/multimc/24x24/noaccount.png differ diff --git a/application/resources/multimc/24x24/patreon.png b/application/resources/multimc/24x24/patreon.png new file mode 100644 index 00000000..c1da080f Binary files /dev/null and b/application/resources/multimc/24x24/patreon.png differ diff --git a/application/resources/multimc/24x24/resourcepacks.png b/application/resources/multimc/24x24/resourcepacks.png new file mode 100644 index 00000000..68359d39 Binary files /dev/null and b/application/resources/multimc/24x24/resourcepacks.png differ diff --git a/application/resources/multimc/24x24/status-bad.png b/application/resources/multimc/24x24/status-bad.png new file mode 100644 index 00000000..d1547a47 Binary files /dev/null and b/application/resources/multimc/24x24/status-bad.png differ diff --git a/application/resources/multimc/24x24/status-good.png b/application/resources/multimc/24x24/status-good.png new file mode 100644 index 00000000..3545bc4c Binary files /dev/null and b/application/resources/multimc/24x24/status-good.png differ diff --git a/application/resources/multimc/24x24/status-yellow.png b/application/resources/multimc/24x24/status-yellow.png new file mode 100644 index 00000000..dd5fde67 Binary files /dev/null and b/application/resources/multimc/24x24/status-yellow.png differ diff --git a/application/resources/multimc/256x256/minecraft.png b/application/resources/multimc/256x256/minecraft.png new file mode 100644 index 00000000..77e3f03e Binary files /dev/null and b/application/resources/multimc/256x256/minecraft.png differ diff --git a/application/resources/multimc/32x32/about.png b/application/resources/multimc/32x32/about.png new file mode 100644 index 00000000..5174c4f1 Binary files /dev/null and b/application/resources/multimc/32x32/about.png differ diff --git a/application/resources/multimc/32x32/bug.png b/application/resources/multimc/32x32/bug.png new file mode 100644 index 00000000..ada46653 Binary files /dev/null and b/application/resources/multimc/32x32/bug.png differ diff --git a/application/resources/multimc/32x32/cat.png b/application/resources/multimc/32x32/cat.png new file mode 100644 index 00000000..78ff98e9 Binary files /dev/null and b/application/resources/multimc/32x32/cat.png differ diff --git a/application/resources/multimc/32x32/centralmods.png b/application/resources/multimc/32x32/centralmods.png new file mode 100644 index 00000000..cd2b8208 Binary files /dev/null and b/application/resources/multimc/32x32/centralmods.png differ diff --git a/application/resources/multimc/32x32/checkupdate.png b/application/resources/multimc/32x32/checkupdate.png new file mode 100644 index 00000000..754005f9 Binary files /dev/null and b/application/resources/multimc/32x32/checkupdate.png differ diff --git a/application/resources/multimc/32x32/copy.png b/application/resources/multimc/32x32/copy.png new file mode 100644 index 00000000..c137b0f1 Binary files /dev/null and b/application/resources/multimc/32x32/copy.png differ diff --git a/application/resources/multimc/32x32/coremods.png b/application/resources/multimc/32x32/coremods.png new file mode 100644 index 00000000..770d695e Binary files /dev/null and b/application/resources/multimc/32x32/coremods.png differ diff --git a/application/resources/multimc/32x32/help.png b/application/resources/multimc/32x32/help.png new file mode 100644 index 00000000..b3854278 Binary files /dev/null and b/application/resources/multimc/32x32/help.png differ diff --git a/application/resources/multimc/32x32/instance-settings.png b/application/resources/multimc/32x32/instance-settings.png new file mode 100644 index 00000000..a9c0817c Binary files /dev/null and b/application/resources/multimc/32x32/instance-settings.png differ diff --git a/application/resources/multimc/32x32/jarmods.png b/application/resources/multimc/32x32/jarmods.png new file mode 100644 index 00000000..5cda173a Binary files /dev/null and b/application/resources/multimc/32x32/jarmods.png differ diff --git a/application/resources/multimc/32x32/loadermods.png b/application/resources/multimc/32x32/loadermods.png new file mode 100644 index 00000000..c4ca12e2 Binary files /dev/null and b/application/resources/multimc/32x32/loadermods.png differ diff --git a/application/resources/multimc/32x32/log.png b/application/resources/multimc/32x32/log.png new file mode 100644 index 00000000..d620da12 Binary files /dev/null and b/application/resources/multimc/32x32/log.png differ diff --git a/application/resources/multimc/32x32/minecraft.png b/application/resources/multimc/32x32/minecraft.png new file mode 100644 index 00000000..816bec98 Binary files /dev/null and b/application/resources/multimc/32x32/minecraft.png differ diff --git a/application/resources/multimc/32x32/new.png b/application/resources/multimc/32x32/new.png new file mode 100644 index 00000000..a3555ba4 Binary files /dev/null and b/application/resources/multimc/32x32/new.png differ diff --git a/application/resources/multimc/32x32/news.png b/application/resources/multimc/32x32/news.png new file mode 100644 index 00000000..c579fd44 Binary files /dev/null and b/application/resources/multimc/32x32/news.png differ diff --git a/application/resources/multimc/32x32/noaccount.png b/application/resources/multimc/32x32/noaccount.png new file mode 100644 index 00000000..a73afc94 Binary files /dev/null and b/application/resources/multimc/32x32/noaccount.png differ diff --git a/application/resources/multimc/32x32/patreon.png b/application/resources/multimc/32x32/patreon.png new file mode 100644 index 00000000..f5ae8a5e Binary files /dev/null and b/application/resources/multimc/32x32/patreon.png differ diff --git a/application/resources/multimc/32x32/refresh.png b/application/resources/multimc/32x32/refresh.png new file mode 100644 index 00000000..afa2a9d7 Binary files /dev/null and b/application/resources/multimc/32x32/refresh.png differ diff --git a/application/resources/multimc/32x32/resourcepacks.png b/application/resources/multimc/32x32/resourcepacks.png new file mode 100644 index 00000000..c14759ef Binary files /dev/null and b/application/resources/multimc/32x32/resourcepacks.png differ diff --git a/application/resources/multimc/32x32/screenshots.png b/application/resources/multimc/32x32/screenshots.png new file mode 100644 index 00000000..4fcd6224 Binary files /dev/null and b/application/resources/multimc/32x32/screenshots.png differ diff --git a/application/resources/multimc/32x32/settings.png b/application/resources/multimc/32x32/settings.png new file mode 100644 index 00000000..a9c0817c Binary files /dev/null and b/application/resources/multimc/32x32/settings.png differ diff --git a/application/resources/multimc/32x32/status-bad.png b/application/resources/multimc/32x32/status-bad.png new file mode 100644 index 00000000..8c2c9d4f Binary files /dev/null and b/application/resources/multimc/32x32/status-bad.png differ diff --git a/application/resources/multimc/32x32/status-good.png b/application/resources/multimc/32x32/status-good.png new file mode 100644 index 00000000..1a805e68 Binary files /dev/null and b/application/resources/multimc/32x32/status-good.png differ diff --git a/application/resources/multimc/32x32/status-yellow.png b/application/resources/multimc/32x32/status-yellow.png new file mode 100644 index 00000000..42c68552 Binary files /dev/null and b/application/resources/multimc/32x32/status-yellow.png differ diff --git a/application/resources/multimc/32x32/viewfolder.png b/application/resources/multimc/32x32/viewfolder.png new file mode 100644 index 00000000..74ab8fa6 Binary files /dev/null and b/application/resources/multimc/32x32/viewfolder.png differ diff --git a/application/resources/multimc/48x48/about.png b/application/resources/multimc/48x48/about.png new file mode 100644 index 00000000..b4ac71b8 Binary files /dev/null and b/application/resources/multimc/48x48/about.png differ diff --git a/application/resources/multimc/48x48/bug.png b/application/resources/multimc/48x48/bug.png new file mode 100644 index 00000000..298f9397 Binary files /dev/null and b/application/resources/multimc/48x48/bug.png differ diff --git a/application/resources/multimc/48x48/cat.png b/application/resources/multimc/48x48/cat.png new file mode 100644 index 00000000..25912a3c Binary files /dev/null and b/application/resources/multimc/48x48/cat.png differ diff --git a/application/resources/multimc/48x48/centralmods.png b/application/resources/multimc/48x48/centralmods.png new file mode 100644 index 00000000..d927e39b Binary files /dev/null and b/application/resources/multimc/48x48/centralmods.png differ diff --git a/application/resources/multimc/48x48/checkupdate.png b/application/resources/multimc/48x48/checkupdate.png new file mode 100644 index 00000000..2e2c7d6b Binary files /dev/null and b/application/resources/multimc/48x48/checkupdate.png differ diff --git a/application/resources/multimc/48x48/copy.png b/application/resources/multimc/48x48/copy.png new file mode 100644 index 00000000..ea40e34b Binary files /dev/null and b/application/resources/multimc/48x48/copy.png differ diff --git a/application/resources/multimc/48x48/help.png b/application/resources/multimc/48x48/help.png new file mode 100644 index 00000000..82d828fa Binary files /dev/null and b/application/resources/multimc/48x48/help.png differ diff --git a/application/resources/multimc/48x48/instance-settings.png b/application/resources/multimc/48x48/instance-settings.png new file mode 100644 index 00000000..6674eb23 Binary files /dev/null and b/application/resources/multimc/48x48/instance-settings.png differ diff --git a/application/resources/multimc/48x48/log.png b/application/resources/multimc/48x48/log.png new file mode 100644 index 00000000..45f60e6b Binary files /dev/null and b/application/resources/multimc/48x48/log.png differ diff --git a/application/resources/multimc/48x48/minecraft.png b/application/resources/multimc/48x48/minecraft.png new file mode 100644 index 00000000..38fc9f6c Binary files /dev/null and b/application/resources/multimc/48x48/minecraft.png differ diff --git a/application/resources/multimc/48x48/new.png b/application/resources/multimc/48x48/new.png new file mode 100644 index 00000000..a81753b3 Binary files /dev/null and b/application/resources/multimc/48x48/new.png differ diff --git a/application/resources/multimc/48x48/news.png b/application/resources/multimc/48x48/news.png new file mode 100644 index 00000000..0f82d857 Binary files /dev/null and b/application/resources/multimc/48x48/news.png differ diff --git a/application/resources/multimc/48x48/noaccount.png b/application/resources/multimc/48x48/noaccount.png new file mode 100644 index 00000000..4703796c Binary files /dev/null and b/application/resources/multimc/48x48/noaccount.png differ diff --git a/application/resources/multimc/48x48/patreon.png b/application/resources/multimc/48x48/patreon.png new file mode 100644 index 00000000..2708a85a Binary files /dev/null and b/application/resources/multimc/48x48/patreon.png differ diff --git a/application/resources/multimc/48x48/refresh.png b/application/resources/multimc/48x48/refresh.png new file mode 100644 index 00000000..0b08b238 Binary files /dev/null and b/application/resources/multimc/48x48/refresh.png differ diff --git a/application/resources/multimc/48x48/screenshots.png b/application/resources/multimc/48x48/screenshots.png new file mode 100644 index 00000000..03c0059f Binary files /dev/null and b/application/resources/multimc/48x48/screenshots.png differ diff --git a/application/resources/multimc/48x48/settings.png b/application/resources/multimc/48x48/settings.png new file mode 100644 index 00000000..6674eb23 Binary files /dev/null and b/application/resources/multimc/48x48/settings.png differ diff --git a/application/resources/multimc/48x48/status-bad.png b/application/resources/multimc/48x48/status-bad.png new file mode 100644 index 00000000..41c9cf22 Binary files /dev/null and b/application/resources/multimc/48x48/status-bad.png differ diff --git a/application/resources/multimc/48x48/status-good.png b/application/resources/multimc/48x48/status-good.png new file mode 100644 index 00000000..df7cb59b Binary files /dev/null and b/application/resources/multimc/48x48/status-good.png differ diff --git a/application/resources/multimc/48x48/status-yellow.png b/application/resources/multimc/48x48/status-yellow.png new file mode 100644 index 00000000..4f3b11d6 Binary files /dev/null and b/application/resources/multimc/48x48/status-yellow.png differ diff --git a/application/resources/multimc/48x48/viewfolder.png b/application/resources/multimc/48x48/viewfolder.png new file mode 100644 index 00000000..0492a736 Binary files /dev/null and b/application/resources/multimc/48x48/viewfolder.png differ diff --git a/application/resources/multimc/64x64/about.png b/application/resources/multimc/64x64/about.png new file mode 100644 index 00000000..b83e9269 Binary files /dev/null and b/application/resources/multimc/64x64/about.png differ diff --git a/application/resources/multimc/64x64/bug.png b/application/resources/multimc/64x64/bug.png new file mode 100644 index 00000000..156b0315 Binary files /dev/null and b/application/resources/multimc/64x64/bug.png differ diff --git a/application/resources/multimc/64x64/cat.png b/application/resources/multimc/64x64/cat.png new file mode 100644 index 00000000..2cc21f80 Binary files /dev/null and b/application/resources/multimc/64x64/cat.png differ diff --git a/application/resources/multimc/64x64/centralmods.png b/application/resources/multimc/64x64/centralmods.png new file mode 100644 index 00000000..8831f437 Binary files /dev/null and b/application/resources/multimc/64x64/centralmods.png differ diff --git a/application/resources/multimc/64x64/checkupdate.png b/application/resources/multimc/64x64/checkupdate.png new file mode 100644 index 00000000..dd1e29ac Binary files /dev/null and b/application/resources/multimc/64x64/checkupdate.png differ diff --git a/application/resources/multimc/64x64/copy.png b/application/resources/multimc/64x64/copy.png new file mode 100644 index 00000000..d12cf9c8 Binary files /dev/null and b/application/resources/multimc/64x64/copy.png differ diff --git a/application/resources/multimc/64x64/coremods.png b/application/resources/multimc/64x64/coremods.png new file mode 100644 index 00000000..668be334 Binary files /dev/null and b/application/resources/multimc/64x64/coremods.png differ diff --git a/application/resources/multimc/64x64/help.png b/application/resources/multimc/64x64/help.png new file mode 100644 index 00000000..0f3948c2 Binary files /dev/null and b/application/resources/multimc/64x64/help.png differ diff --git a/application/resources/multimc/64x64/instance-settings.png b/application/resources/multimc/64x64/instance-settings.png new file mode 100644 index 00000000..e3ff58fa Binary files /dev/null and b/application/resources/multimc/64x64/instance-settings.png differ diff --git a/application/resources/multimc/64x64/jarmods.png b/application/resources/multimc/64x64/jarmods.png new file mode 100644 index 00000000..55d1a42a Binary files /dev/null and b/application/resources/multimc/64x64/jarmods.png differ diff --git a/application/resources/multimc/64x64/loadermods.png b/application/resources/multimc/64x64/loadermods.png new file mode 100644 index 00000000..24618fd0 Binary files /dev/null and b/application/resources/multimc/64x64/loadermods.png differ diff --git a/application/resources/multimc/64x64/log.png b/application/resources/multimc/64x64/log.png new file mode 100644 index 00000000..0f531cdf Binary files /dev/null and b/application/resources/multimc/64x64/log.png differ diff --git a/application/resources/multimc/64x64/new.png b/application/resources/multimc/64x64/new.png new file mode 100644 index 00000000..c3c6796c Binary files /dev/null and b/application/resources/multimc/64x64/new.png differ diff --git a/application/resources/multimc/64x64/news.png b/application/resources/multimc/64x64/news.png new file mode 100644 index 00000000..e306eed3 Binary files /dev/null and b/application/resources/multimc/64x64/news.png differ diff --git a/application/resources/multimc/64x64/patreon.png b/application/resources/multimc/64x64/patreon.png new file mode 100644 index 00000000..7b4814ec Binary files /dev/null and b/application/resources/multimc/64x64/patreon.png differ diff --git a/application/resources/multimc/64x64/refresh.png b/application/resources/multimc/64x64/refresh.png new file mode 100644 index 00000000..8373d819 Binary files /dev/null and b/application/resources/multimc/64x64/refresh.png differ diff --git a/application/resources/multimc/64x64/resourcepacks.png b/application/resources/multimc/64x64/resourcepacks.png new file mode 100644 index 00000000..fb874e7d Binary files /dev/null and b/application/resources/multimc/64x64/resourcepacks.png differ diff --git a/application/resources/multimc/64x64/screenshots.png b/application/resources/multimc/64x64/screenshots.png new file mode 100644 index 00000000..af18e39c Binary files /dev/null and b/application/resources/multimc/64x64/screenshots.png differ diff --git a/application/resources/multimc/64x64/settings.png b/application/resources/multimc/64x64/settings.png new file mode 100644 index 00000000..e3ff58fa Binary files /dev/null and b/application/resources/multimc/64x64/settings.png differ diff --git a/application/resources/multimc/64x64/status-bad.png b/application/resources/multimc/64x64/status-bad.png new file mode 100644 index 00000000..64060ba0 Binary files /dev/null and b/application/resources/multimc/64x64/status-bad.png differ diff --git a/application/resources/multimc/64x64/status-good.png b/application/resources/multimc/64x64/status-good.png new file mode 100644 index 00000000..e862ddcd Binary files /dev/null and b/application/resources/multimc/64x64/status-good.png differ diff --git a/application/resources/multimc/64x64/status-yellow.png b/application/resources/multimc/64x64/status-yellow.png new file mode 100644 index 00000000..3d54d320 Binary files /dev/null and b/application/resources/multimc/64x64/status-yellow.png differ diff --git a/application/resources/multimc/64x64/viewfolder.png b/application/resources/multimc/64x64/viewfolder.png new file mode 100644 index 00000000..7d531f9c Binary files /dev/null and b/application/resources/multimc/64x64/viewfolder.png differ diff --git a/application/resources/multimc/8x8/noaccount.png b/application/resources/multimc/8x8/noaccount.png new file mode 100644 index 00000000..466e4c07 Binary files /dev/null and b/application/resources/multimc/8x8/noaccount.png differ diff --git a/application/resources/multimc/index.theme b/application/resources/multimc/index.theme new file mode 100644 index 00000000..5f7d3f3f --- /dev/null +++ b/application/resources/multimc/index.theme @@ -0,0 +1,42 @@ +[Icon Theme] +Name=multimc +Comment=MultiMC Default Icons +Inherits=default +Directories=scalable/apps,8x8,16x16,22x22,24x24,32x32,48x48,scalable + +[scalable/apps] +Size=48 +Type=scalable +MinSize=1 +MaxSize=512 +Context=Applications + +[8x8] +Size=8 + +[16x16] +Size=16 + +[22x22] +Size=22 + +[24x24] +Size=24 + +[32x32] +Size=32 + +[48x48] +Size=48 + +[64x64] +Size=64 + +[256x256] +Size=256 + +[scalable] +Size=48 +Type=Scalable +MinSize=16 +MaxSize=256 diff --git a/application/resources/multimc/multimc.qrc b/application/resources/multimc/multimc.qrc new file mode 100644 index 00000000..d02d0e0e --- /dev/null +++ b/application/resources/multimc/multimc.qrc @@ -0,0 +1,206 @@ + + + + index.theme + + scalable/multimc.svg + + + scalable/console.svg + + + scalable/console_error.svg + + + scalable/proxy.svg + + + scalable/java.svg + + + 16x16/minecraft.png + 24x24/minecraft.png + 32x32/minecraft.png + 48x48/minecraft.png + 256x256/minecraft.png + + + 16x16/about.png + 22x22/about.png + 32x32/about.png + 48x48/about.png + 64x64/about.png + + + scalable/bug.svg + 16x16/bug.png + 22x22/bug.png + 32x32/bug.png + 48x48/bug.png + 64x64/bug.png + + + + 16x16/screenshots.png + 22x22/screenshots.png + 32x32/screenshots.png + 48x48/screenshots.png + 64x64/screenshots.png + scalable/screenshots.svg + + + 16x16/patreon.png + 22x22/patreon.png + 24x24/patreon.png + 32x32/patreon.png + 48x48/patreon.png + 64x64/patreon.png + + + 16x16/cat.png + 22x22/cat.png + 24x24/cat.png + 32x32/cat.png + 48x48/cat.png + 64x64/cat.png + + + scalable/centralmods.svg + 16x16/centralmods.png + 22x22/centralmods.png + 32x32/centralmods.png + 48x48/centralmods.png + 64x64/centralmods.png + + + scalable/checkupdate.svg + 16x16/checkupdate.png + 22x22/checkupdate.png + 32x32/checkupdate.png + 48x48/checkupdate.png + 64x64/checkupdate.png + + + 16x16/copy.png + 22x22/copy.png + 32x32/copy.png + 48x48/copy.png + 64x64/copy.png + + + 16x16/help.png + 22x22/help.png + 32x32/help.png + 48x48/help.png + 64x64/help.png + + + 16x16/new.png + 22x22/new.png + 32x32/new.png + 48x48/new.png + 64x64/new.png + + + scalable/news.svg + 16x16/news.png + 22x22/news.png + 32x32/news.png + 48x48/news.png + 64x64/news.png + + + 16x16/status-bad.png + 24x24/status-bad.png + 22x22/status-bad.png + 32x32/status-bad.png + 48x48/status-bad.png + 64x64/status-bad.png + + + 16x16/status-good.png + 24x24/status-good.png + 22x22/status-good.png + 32x32/status-good.png + 48x48/status-good.png + 64x64/status-good.png + + + 16x16/status-yellow.png + 24x24/status-yellow.png + 22x22/status-yellow.png + 32x32/status-yellow.png + 48x48/status-yellow.png + 64x64/status-yellow.png + + + 16x16/loadermods.png + 24x24/loadermods.png + 32x32/loadermods.png + 64x64/loadermods.png + + + 16x16/jarmods.png + 24x24/jarmods.png + 32x32/jarmods.png + 64x64/jarmods.png + + + 16x16/coremods.png + 24x24/coremods.png + 32x32/coremods.png + 64x64/coremods.png + + + 16x16/resourcepacks.png + 24x24/resourcepacks.png + 32x32/resourcepacks.png + 64x64/resourcepacks.png + + + 16x16/refresh.png + 22x22/refresh.png + 32x32/refresh.png + 48x48/refresh.png + 64x64/refresh.png + + + 16x16/settings.png + 22x22/settings.png + 32x32/settings.png + 48x48/settings.png + 64x64/settings.png + + + 16x16/instance-settings.png + 22x22/instance-settings.png + 32x32/instance-settings.png + 48x48/instance-settings.png + 64x64/instance-settings.png + + + scalable/viewfolder.svg + 16x16/viewfolder.png + 22x22/viewfolder.png + 32x32/viewfolder.png + 48x48/viewfolder.png + 64x64/viewfolder.png + + + 8x8/noaccount.png + 16x16/noaccount.png + 24x24/noaccount.png + 32x32/noaccount.png + 48x48/noaccount.png + + + 16x16/log.png + 24x24/log.png + 32x32/log.png + 48x48/log.png + 64x64/log.png + + + scalable/screenshot-placeholder.svg + + diff --git a/application/resources/multimc/scalable/bug.svg b/application/resources/multimc/scalable/bug.svg new file mode 100644 index 00000000..178e3c23 --- /dev/null +++ b/application/resources/multimc/scalable/bug.svg @@ -0,0 +1,387 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/multimc/scalable/centralmods.svg b/application/resources/multimc/scalable/centralmods.svg new file mode 100644 index 00000000..a8b123d0 --- /dev/null +++ b/application/resources/multimc/scalable/centralmods.svg @@ -0,0 +1,346 @@ + + + + + + + + + + unsorted + + + + + Open Clip Art Library, Source: Oxygen Icons, Source: Oxygen Icons, Source: Oxygen Icons, Source: Oxygen Icons + + + + + + + + + + + + + + image/svg+xml + + + en + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/multimc/scalable/checkupdate.svg b/application/resources/multimc/scalable/checkupdate.svg new file mode 100644 index 00000000..fc09cb4c --- /dev/null +++ b/application/resources/multimc/scalable/checkupdate.svg @@ -0,0 +1,167 @@ + + + + + + + + + + unsorted + + + + + Open Clip Art Library, Source: GNOME-Colors, Source: GNOME-Colors, Source: GNOME-Colors, Source: GNOME-Colors, Source: GNOME-Colors + + + + + + + + + + + + + + image/svg+xml + + + en + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/multimc/scalable/console.svg b/application/resources/multimc/scalable/console.svg new file mode 100644 index 00000000..ec14ab68 --- /dev/null +++ b/application/resources/multimc/scalable/console.svg @@ -0,0 +1,228 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + MC + + + diff --git a/application/resources/multimc/scalable/console_error.svg b/application/resources/multimc/scalable/console_error.svg new file mode 100644 index 00000000..a71c6b35 --- /dev/null +++ b/application/resources/multimc/scalable/console_error.svg @@ -0,0 +1,247 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/multimc/scalable/java.svg b/application/resources/multimc/scalable/java.svg new file mode 100644 index 00000000..fd15e5c6 --- /dev/null +++ b/application/resources/multimc/scalable/java.svg @@ -0,0 +1,773 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/multimc/scalable/multimc.svg b/application/resources/multimc/scalable/multimc.svg new file mode 100644 index 00000000..178509ac --- /dev/null +++ b/application/resources/multimc/scalable/multimc.svg @@ -0,0 +1,1993 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/multimc/scalable/new.svg b/application/resources/multimc/scalable/new.svg new file mode 100644 index 00000000..c9cff358 --- /dev/null +++ b/application/resources/multimc/scalable/new.svg @@ -0,0 +1,127 @@ + + + + + + New Document + + + + regular + plaintext + text + document + + + + + Source: GNOME Icon Theme, Source: GNOME Icon Theme, Source: GNOME Icon Theme, Source: GNOME Icon Theme, Source: GNOME Icon Theme + + + + + Jakub Steiner + + + + + Jakub Steiner + + + + image/svg+xml + + + en + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/multimc/scalable/news.svg b/application/resources/multimc/scalable/news.svg new file mode 100644 index 00000000..67a370df --- /dev/null +++ b/application/resources/multimc/scalable/news.svg @@ -0,0 +1,296 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce convallis mauris ullamcorper mauris viverra molestie. Donec ultricies faucibus laoreet. Donec convallis congue neque consequat vehicula. Morbi condimentum tempor nulla et rhoncus. Etiam auctor, augue eu pharetra congue, elit justo lacinia risus, non lacinia est justo sed erat. Ut risus urna, viverra id interdum in, molestie non sem. Morbi leo orci, gravida auctor tempor vel, varius et enim. Nulla sem enim, ultricies vel laoreet ac, semper vel mauris. Ut adipiscing sapien sed leo pretium id vulputate erat gravida. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Cras tempor leo sit amet velit molestie commodo eget tincidunt leo. Cras dictum metus non ante pulvinar pellentesque. Morbi id elit ullamcorper mi vulputate lobortis. Cras ac vehicula felis. Phasellus dictum, tellus at molestie pellentesque, purus purus. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce convallis mauris ullamcorper mauris viverra molestie. Donec ultricies faucibus laoreet. Donec convallis congue neque consequat vehicula. Morbi condimentum tempor nulla et rhoncus. Etiam auctor, augue eu pharetra congue, elit justo lacinia risus, non lacinia est justo sed erat. Ut risus urna, + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/multimc/scalable/proxy.svg b/application/resources/multimc/scalable/proxy.svg new file mode 100644 index 00000000..55ee6f93 --- /dev/null +++ b/application/resources/multimc/scalable/proxy.svg @@ -0,0 +1,260 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/multimc/scalable/screenshot-placeholder.svg b/application/resources/multimc/scalable/screenshot-placeholder.svg new file mode 100644 index 00000000..a7a2a3d6 --- /dev/null +++ b/application/resources/multimc/scalable/screenshot-placeholder.svg @@ -0,0 +1,86 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + diff --git a/application/resources/multimc/scalable/screenshots.svg b/application/resources/multimc/scalable/screenshots.svg new file mode 100644 index 00000000..a3d4d8e2 --- /dev/null +++ b/application/resources/multimc/scalable/screenshots.svg @@ -0,0 +1,1231 @@ + + + + + Golden Picture Frame + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + Open Clip Art Library + + + Golden Picture Frame + 2012-05-24T10:08:07 + Golden picture frame, Landscape + http://openclipart.org/detail/170182/golden-picture-frame-by-tasper + + + tasper + + + + + clip art + clipart + frame + golden + landscape + photo + picture + + + + + edited by Paul Sherman + + + + + + + + + + + diff --git a/application/resources/multimc/scalable/status-bad.svg b/application/resources/multimc/scalable/status-bad.svg new file mode 100644 index 00000000..9f47307e --- /dev/null +++ b/application/resources/multimc/scalable/status-bad.svg @@ -0,0 +1,142 @@ + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + diff --git a/application/resources/multimc/scalable/status-good.svg b/application/resources/multimc/scalable/status-good.svg new file mode 100644 index 00000000..0a35c80f --- /dev/null +++ b/application/resources/multimc/scalable/status-good.svg @@ -0,0 +1,201 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + diff --git a/application/resources/multimc/scalable/status-yellow.svg b/application/resources/multimc/scalable/status-yellow.svg new file mode 100644 index 00000000..140e6082 --- /dev/null +++ b/application/resources/multimc/scalable/status-yellow.svg @@ -0,0 +1,155 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/multimc/scalable/viewfolder.svg b/application/resources/multimc/scalable/viewfolder.svg new file mode 100644 index 00000000..4ba0ed0a --- /dev/null +++ b/application/resources/multimc/scalable/viewfolder.svg @@ -0,0 +1,122 @@ + + + + + + + + + + unsorted + + + + + Open Clip Art Library, Source: Oxygen Icons, Source: Oxygen Icons, Source: Oxygen Icons, Source: Oxygen Icons + + + + + + + + + + + + + + image/svg+xml + + + en + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/pe_blue/index.theme b/application/resources/pe_blue/index.theme new file mode 100644 index 00000000..c9e0d93a --- /dev/null +++ b/application/resources/pe_blue/index.theme @@ -0,0 +1,11 @@ +[Icon Theme] +Name=pe_blue +Comment=Icons by pexner (blue) +Inherits=multimc +Directories=scalable + +[scalable] +Size=48 +Type=Scalable +MinSize=16 +MaxSize=256 diff --git a/application/resources/pe_blue/pe_blue.qrc b/application/resources/pe_blue/pe_blue.qrc new file mode 100644 index 00000000..a4525d2e --- /dev/null +++ b/application/resources/pe_blue/pe_blue.qrc @@ -0,0 +1,35 @@ + + + + index.theme + scalable/about.svg + scalable/accounts.svg + scalable/bug.svg + scalable/centralmods.svg + scalable/checkupdate.svg + scalable/copy.svg + scalable/coremods.svg + scalable/externaltools.svg + scalable/instance-settings.svg + scalable/jarmods.svg + scalable/java.svg + scalable/loadermods.svg + scalable/log.svg + scalable/minecraft.svg + scalable/multimc.svg + scalable/new.svg + scalable/news.svg + scalable/notes.svg + scalable/patreon.svg + scalable/proxy.svg + scalable/quickmods.svg + scalable/refresh.svg + scalable/resourcepacks.svg + scalable/screenshots.svg + scalable/settings.svg + scalable/status-bad.svg + scalable/status-good.svg + scalable/status-yellow.svg + scalable/viewfolder.svg + + diff --git a/application/resources/pe_blue/scalable/about.svg b/application/resources/pe_blue/scalable/about.svg new file mode 100644 index 00000000..56e7fc9b --- /dev/null +++ b/application/resources/pe_blue/scalable/about.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + + diff --git a/application/resources/pe_blue/scalable/accounts.svg b/application/resources/pe_blue/scalable/accounts.svg new file mode 100644 index 00000000..77e3f45a --- /dev/null +++ b/application/resources/pe_blue/scalable/accounts.svg @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/pe_blue/scalable/bug.svg b/application/resources/pe_blue/scalable/bug.svg new file mode 100644 index 00000000..75a19e29 --- /dev/null +++ b/application/resources/pe_blue/scalable/bug.svg @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/pe_blue/scalable/centralmods.svg b/application/resources/pe_blue/scalable/centralmods.svg new file mode 100644 index 00000000..cda39b1f --- /dev/null +++ b/application/resources/pe_blue/scalable/centralmods.svg @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/pe_blue/scalable/checkupdate.svg b/application/resources/pe_blue/scalable/checkupdate.svg new file mode 100644 index 00000000..a7d9ee81 --- /dev/null +++ b/application/resources/pe_blue/scalable/checkupdate.svg @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/pe_blue/scalable/copy.svg b/application/resources/pe_blue/scalable/copy.svg new file mode 100644 index 00000000..7ce014ed --- /dev/null +++ b/application/resources/pe_blue/scalable/copy.svg @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/pe_blue/scalable/coremods.svg b/application/resources/pe_blue/scalable/coremods.svg new file mode 100644 index 00000000..4cc030d0 --- /dev/null +++ b/application/resources/pe_blue/scalable/coremods.svg @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/pe_blue/scalable/externaltools.svg b/application/resources/pe_blue/scalable/externaltools.svg new file mode 100644 index 00000000..45b73496 --- /dev/null +++ b/application/resources/pe_blue/scalable/externaltools.svg @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/pe_blue/scalable/instance-settings.svg b/application/resources/pe_blue/scalable/instance-settings.svg new file mode 100644 index 00000000..43f0b2f2 --- /dev/null +++ b/application/resources/pe_blue/scalable/instance-settings.svg @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/pe_blue/scalable/jarmods.svg b/application/resources/pe_blue/scalable/jarmods.svg new file mode 100644 index 00000000..bb75f4b1 --- /dev/null +++ b/application/resources/pe_blue/scalable/jarmods.svg @@ -0,0 +1,22 @@ + + + + + + + + + + + + + diff --git a/application/resources/pe_blue/scalable/java.svg b/application/resources/pe_blue/scalable/java.svg new file mode 100644 index 00000000..5e369203 --- /dev/null +++ b/application/resources/pe_blue/scalable/java.svg @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/pe_blue/scalable/loadermods.svg b/application/resources/pe_blue/scalable/loadermods.svg new file mode 100644 index 00000000..a54dc211 --- /dev/null +++ b/application/resources/pe_blue/scalable/loadermods.svg @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/pe_blue/scalable/log.svg b/application/resources/pe_blue/scalable/log.svg new file mode 100644 index 00000000..89d373f4 --- /dev/null +++ b/application/resources/pe_blue/scalable/log.svg @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/pe_blue/scalable/minecraft.svg b/application/resources/pe_blue/scalable/minecraft.svg new file mode 100644 index 00000000..2fe6a028 --- /dev/null +++ b/application/resources/pe_blue/scalable/minecraft.svg @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/pe_blue/scalable/multimc.svg b/application/resources/pe_blue/scalable/multimc.svg new file mode 100644 index 00000000..820c0b53 --- /dev/null +++ b/application/resources/pe_blue/scalable/multimc.svg @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/pe_blue/scalable/new.svg b/application/resources/pe_blue/scalable/new.svg new file mode 100644 index 00000000..dcc8579e --- /dev/null +++ b/application/resources/pe_blue/scalable/new.svg @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/pe_blue/scalable/news.svg b/application/resources/pe_blue/scalable/news.svg new file mode 100644 index 00000000..3ca3be37 --- /dev/null +++ b/application/resources/pe_blue/scalable/news.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + diff --git a/application/resources/pe_blue/scalable/notes.svg b/application/resources/pe_blue/scalable/notes.svg new file mode 100644 index 00000000..d0991259 --- /dev/null +++ b/application/resources/pe_blue/scalable/notes.svg @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/pe_blue/scalable/patreon.svg b/application/resources/pe_blue/scalable/patreon.svg new file mode 100644 index 00000000..644b9b41 --- /dev/null +++ b/application/resources/pe_blue/scalable/patreon.svg @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/pe_blue/scalable/proxy.svg b/application/resources/pe_blue/scalable/proxy.svg new file mode 100644 index 00000000..8266f9b8 --- /dev/null +++ b/application/resources/pe_blue/scalable/proxy.svg @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/pe_blue/scalable/quickmods.svg b/application/resources/pe_blue/scalable/quickmods.svg new file mode 100644 index 00000000..8b577376 --- /dev/null +++ b/application/resources/pe_blue/scalable/quickmods.svg @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/pe_blue/scalable/refresh.svg b/application/resources/pe_blue/scalable/refresh.svg new file mode 100644 index 00000000..a3d2281d --- /dev/null +++ b/application/resources/pe_blue/scalable/refresh.svg @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/pe_blue/scalable/resourcepacks.svg b/application/resources/pe_blue/scalable/resourcepacks.svg new file mode 100644 index 00000000..a17e7e82 --- /dev/null +++ b/application/resources/pe_blue/scalable/resourcepacks.svg @@ -0,0 +1,13 @@ + + + + + + + diff --git a/application/resources/pe_blue/scalable/screenshots.svg b/application/resources/pe_blue/scalable/screenshots.svg new file mode 100644 index 00000000..1aa4e559 --- /dev/null +++ b/application/resources/pe_blue/scalable/screenshots.svg @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/pe_blue/scalable/settings.svg b/application/resources/pe_blue/scalable/settings.svg new file mode 100644 index 00000000..43f0b2f2 --- /dev/null +++ b/application/resources/pe_blue/scalable/settings.svg @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/pe_blue/scalable/status-bad.svg b/application/resources/pe_blue/scalable/status-bad.svg new file mode 100644 index 00000000..4a48b5d8 --- /dev/null +++ b/application/resources/pe_blue/scalable/status-bad.svg @@ -0,0 +1,10 @@ + + + + + + + diff --git a/application/resources/pe_blue/scalable/status-good.svg b/application/resources/pe_blue/scalable/status-good.svg new file mode 100644 index 00000000..4cfa56f0 --- /dev/null +++ b/application/resources/pe_blue/scalable/status-good.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + diff --git a/application/resources/pe_blue/scalable/status-yellow.svg b/application/resources/pe_blue/scalable/status-yellow.svg new file mode 100644 index 00000000..0551fed2 --- /dev/null +++ b/application/resources/pe_blue/scalable/status-yellow.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + + diff --git a/application/resources/pe_blue/scalable/viewfolder.svg b/application/resources/pe_blue/scalable/viewfolder.svg new file mode 100644 index 00000000..2634f8ff --- /dev/null +++ b/application/resources/pe_blue/scalable/viewfolder.svg @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/pe_colored/index.theme b/application/resources/pe_colored/index.theme new file mode 100644 index 00000000..b757bbd7 --- /dev/null +++ b/application/resources/pe_colored/index.theme @@ -0,0 +1,11 @@ +[Icon Theme] +Name=pe_colored +Comment=Icons by pexner (colored) +Inherits=multimc +Directories=scalable + +[scalable] +Size=48 +Type=Scalable +MinSize=16 +MaxSize=256 diff --git a/application/resources/pe_colored/pe_colored.qrc b/application/resources/pe_colored/pe_colored.qrc new file mode 100644 index 00000000..7de8d5ab --- /dev/null +++ b/application/resources/pe_colored/pe_colored.qrc @@ -0,0 +1,35 @@ + + + + index.theme + scalable/about.svg + scalable/accounts.svg + scalable/bug.svg + scalable/centralmods.svg + scalable/checkupdate.svg + scalable/copy.svg + scalable/coremods.svg + scalable/externaltools.svg + scalable/instance-settings.svg + scalable/jarmods.svg + scalable/java.svg + scalable/loadermods.svg + scalable/log.svg + scalable/minecraft.svg + scalable/multimc.svg + scalable/new.svg + scalable/news.svg + scalable/notes.svg + scalable/patreon.svg + scalable/proxy.svg + scalable/quickmods.svg + scalable/refresh.svg + scalable/resourcepacks.svg + scalable/screenshots.svg + scalable/settings.svg + scalable/status-bad.svg + scalable/status-good.svg + scalable/status-yellow.svg + scalable/viewfolder.svg + + diff --git a/application/resources/pe_colored/scalable/about.svg b/application/resources/pe_colored/scalable/about.svg new file mode 100644 index 00000000..95e99689 --- /dev/null +++ b/application/resources/pe_colored/scalable/about.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + diff --git a/application/resources/pe_colored/scalable/accounts.svg b/application/resources/pe_colored/scalable/accounts.svg new file mode 100644 index 00000000..301eb368 --- /dev/null +++ b/application/resources/pe_colored/scalable/accounts.svg @@ -0,0 +1,20 @@ + + + + + + + + + + + + + diff --git a/application/resources/pe_colored/scalable/bug.svg b/application/resources/pe_colored/scalable/bug.svg new file mode 100644 index 00000000..8c92df0a --- /dev/null +++ b/application/resources/pe_colored/scalable/bug.svg @@ -0,0 +1,17 @@ + + + + + + + + + + diff --git a/application/resources/pe_colored/scalable/centralmods.svg b/application/resources/pe_colored/scalable/centralmods.svg new file mode 100644 index 00000000..57a97259 --- /dev/null +++ b/application/resources/pe_colored/scalable/centralmods.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + diff --git a/application/resources/pe_colored/scalable/checkupdate.svg b/application/resources/pe_colored/scalable/checkupdate.svg new file mode 100644 index 00000000..0adc8eeb --- /dev/null +++ b/application/resources/pe_colored/scalable/checkupdate.svg @@ -0,0 +1,13 @@ + + + + + + + + diff --git a/application/resources/pe_colored/scalable/copy.svg b/application/resources/pe_colored/scalable/copy.svg new file mode 100644 index 00000000..b9b0f1b1 --- /dev/null +++ b/application/resources/pe_colored/scalable/copy.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + diff --git a/application/resources/pe_colored/scalable/coremods.svg b/application/resources/pe_colored/scalable/coremods.svg new file mode 100644 index 00000000..ca7a22f0 --- /dev/null +++ b/application/resources/pe_colored/scalable/coremods.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + diff --git a/application/resources/pe_colored/scalable/externaltools.svg b/application/resources/pe_colored/scalable/externaltools.svg new file mode 100644 index 00000000..1469674f --- /dev/null +++ b/application/resources/pe_colored/scalable/externaltools.svg @@ -0,0 +1,13 @@ + + + + + + + + + + diff --git a/application/resources/pe_colored/scalable/instance-settings.svg b/application/resources/pe_colored/scalable/instance-settings.svg new file mode 100644 index 00000000..72032f8a --- /dev/null +++ b/application/resources/pe_colored/scalable/instance-settings.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + diff --git a/application/resources/pe_colored/scalable/jarmods.svg b/application/resources/pe_colored/scalable/jarmods.svg new file mode 100644 index 00000000..bb75f4b1 --- /dev/null +++ b/application/resources/pe_colored/scalable/jarmods.svg @@ -0,0 +1,22 @@ + + + + + + + + + + + + + diff --git a/application/resources/pe_colored/scalable/java.svg b/application/resources/pe_colored/scalable/java.svg new file mode 100644 index 00000000..32c0225b --- /dev/null +++ b/application/resources/pe_colored/scalable/java.svg @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/pe_colored/scalable/loadermods.svg b/application/resources/pe_colored/scalable/loadermods.svg new file mode 100644 index 00000000..2d80c7f3 --- /dev/null +++ b/application/resources/pe_colored/scalable/loadermods.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + diff --git a/application/resources/pe_colored/scalable/log.svg b/application/resources/pe_colored/scalable/log.svg new file mode 100644 index 00000000..42659b53 --- /dev/null +++ b/application/resources/pe_colored/scalable/log.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + + diff --git a/application/resources/pe_colored/scalable/minecraft.svg b/application/resources/pe_colored/scalable/minecraft.svg new file mode 100644 index 00000000..52815487 --- /dev/null +++ b/application/resources/pe_colored/scalable/minecraft.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + diff --git a/application/resources/pe_colored/scalable/multimc.svg b/application/resources/pe_colored/scalable/multimc.svg new file mode 100644 index 00000000..a146c52e --- /dev/null +++ b/application/resources/pe_colored/scalable/multimc.svg @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + diff --git a/application/resources/pe_colored/scalable/new.svg b/application/resources/pe_colored/scalable/new.svg new file mode 100644 index 00000000..f18ed28a --- /dev/null +++ b/application/resources/pe_colored/scalable/new.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + + diff --git a/application/resources/pe_colored/scalable/news.svg b/application/resources/pe_colored/scalable/news.svg new file mode 100644 index 00000000..4f924cd8 --- /dev/null +++ b/application/resources/pe_colored/scalable/news.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + diff --git a/application/resources/pe_colored/scalable/notes.svg b/application/resources/pe_colored/scalable/notes.svg new file mode 100644 index 00000000..55ece163 --- /dev/null +++ b/application/resources/pe_colored/scalable/notes.svg @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/pe_colored/scalable/patreon.svg b/application/resources/pe_colored/scalable/patreon.svg new file mode 100644 index 00000000..d3c6d2d5 --- /dev/null +++ b/application/resources/pe_colored/scalable/patreon.svg @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/application/resources/pe_colored/scalable/proxy.svg b/application/resources/pe_colored/scalable/proxy.svg new file mode 100644 index 00000000..0aee69b7 --- /dev/null +++ b/application/resources/pe_colored/scalable/proxy.svg @@ -0,0 +1,15 @@ + + + + + + + + + + diff --git a/application/resources/pe_colored/scalable/quickmods.svg b/application/resources/pe_colored/scalable/quickmods.svg new file mode 100644 index 00000000..199b2dae --- /dev/null +++ b/application/resources/pe_colored/scalable/quickmods.svg @@ -0,0 +1,14 @@ + + + + + + + + + + diff --git a/application/resources/pe_colored/scalable/refresh.svg b/application/resources/pe_colored/scalable/refresh.svg new file mode 100644 index 00000000..c2e7e91f --- /dev/null +++ b/application/resources/pe_colored/scalable/refresh.svg @@ -0,0 +1,11 @@ + + + + + + + diff --git a/application/resources/pe_colored/scalable/resourcepacks.svg b/application/resources/pe_colored/scalable/resourcepacks.svg new file mode 100644 index 00000000..0318354c --- /dev/null +++ b/application/resources/pe_colored/scalable/resourcepacks.svg @@ -0,0 +1,15 @@ + + + + + + + + diff --git a/application/resources/pe_colored/scalable/screenshots.svg b/application/resources/pe_colored/scalable/screenshots.svg new file mode 100644 index 00000000..844fcbaa --- /dev/null +++ b/application/resources/pe_colored/scalable/screenshots.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + diff --git a/application/resources/pe_colored/scalable/settings.svg b/application/resources/pe_colored/scalable/settings.svg new file mode 100644 index 00000000..72032f8a --- /dev/null +++ b/application/resources/pe_colored/scalable/settings.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + diff --git a/application/resources/pe_colored/scalable/status-bad.svg b/application/resources/pe_colored/scalable/status-bad.svg new file mode 100644 index 00000000..bc42c248 --- /dev/null +++ b/application/resources/pe_colored/scalable/status-bad.svg @@ -0,0 +1,10 @@ + + + + + + + diff --git a/application/resources/pe_colored/scalable/status-good.svg b/application/resources/pe_colored/scalable/status-good.svg new file mode 100644 index 00000000..4cfa56f0 --- /dev/null +++ b/application/resources/pe_colored/scalable/status-good.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + diff --git a/application/resources/pe_colored/scalable/status-yellow.svg b/application/resources/pe_colored/scalable/status-yellow.svg new file mode 100644 index 00000000..0551fed2 --- /dev/null +++ b/application/resources/pe_colored/scalable/status-yellow.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + + diff --git a/application/resources/pe_colored/scalable/viewfolder.svg b/application/resources/pe_colored/scalable/viewfolder.svg new file mode 100644 index 00000000..91832577 --- /dev/null +++ b/application/resources/pe_colored/scalable/viewfolder.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + diff --git a/application/resources/pe_dark/index.theme b/application/resources/pe_dark/index.theme new file mode 100644 index 00000000..b7d1ad01 --- /dev/null +++ b/application/resources/pe_dark/index.theme @@ -0,0 +1,11 @@ +[Icon Theme] +Name=pe_dark +Comment=Icons by pexner (dark) +Inherits=multimc +Directories=scalable + +[scalable] +Size=48 +Type=Scalable +MinSize=16 +MaxSize=256 diff --git a/application/resources/pe_dark/pe_dark.qrc b/application/resources/pe_dark/pe_dark.qrc new file mode 100644 index 00000000..cafc2559 --- /dev/null +++ b/application/resources/pe_dark/pe_dark.qrc @@ -0,0 +1,35 @@ + + + + index.theme + scalable/about.svg + scalable/accounts.svg + scalable/bug.svg + scalable/centralmods.svg + scalable/checkupdate.svg + scalable/copy.svg + scalable/coremods.svg + scalable/externaltools.svg + scalable/instance-settings.svg + scalable/jarmods.svg + scalable/java.svg + scalable/loadermods.svg + scalable/log.svg + scalable/minecraft.svg + scalable/multimc.svg + scalable/new.svg + scalable/news.svg + scalable/notes.svg + scalable/patreon.svg + scalable/proxy.svg + scalable/quickmods.svg + scalable/refresh.svg + scalable/resourcepacks.svg + scalable/screenshots.svg + scalable/settings.svg + scalable/status-bad.svg + scalable/status-good.svg + scalable/status-yellow.svg + scalable/viewfolder.svg + + diff --git a/application/resources/pe_dark/scalable/about.svg b/application/resources/pe_dark/scalable/about.svg new file mode 100644 index 00000000..e75ea6ca --- /dev/null +++ b/application/resources/pe_dark/scalable/about.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + diff --git a/application/resources/pe_dark/scalable/accounts.svg b/application/resources/pe_dark/scalable/accounts.svg new file mode 100644 index 00000000..6d46b2df --- /dev/null +++ b/application/resources/pe_dark/scalable/accounts.svg @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/pe_dark/scalable/bug.svg b/application/resources/pe_dark/scalable/bug.svg new file mode 100644 index 00000000..9da71adb --- /dev/null +++ b/application/resources/pe_dark/scalable/bug.svg @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/pe_dark/scalable/centralmods.svg b/application/resources/pe_dark/scalable/centralmods.svg new file mode 100644 index 00000000..f3b0c0e4 --- /dev/null +++ b/application/resources/pe_dark/scalable/centralmods.svg @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/pe_dark/scalable/checkupdate.svg b/application/resources/pe_dark/scalable/checkupdate.svg new file mode 100644 index 00000000..97585447 --- /dev/null +++ b/application/resources/pe_dark/scalable/checkupdate.svg @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/application/resources/pe_dark/scalable/copy.svg b/application/resources/pe_dark/scalable/copy.svg new file mode 100644 index 00000000..8c30ac0b --- /dev/null +++ b/application/resources/pe_dark/scalable/copy.svg @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/pe_dark/scalable/coremods.svg b/application/resources/pe_dark/scalable/coremods.svg new file mode 100644 index 00000000..1e2eb227 --- /dev/null +++ b/application/resources/pe_dark/scalable/coremods.svg @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/pe_dark/scalable/externaltools.svg b/application/resources/pe_dark/scalable/externaltools.svg new file mode 100644 index 00000000..29b45f26 --- /dev/null +++ b/application/resources/pe_dark/scalable/externaltools.svg @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/pe_dark/scalable/instance-settings.svg b/application/resources/pe_dark/scalable/instance-settings.svg new file mode 100644 index 00000000..c9f701e7 --- /dev/null +++ b/application/resources/pe_dark/scalable/instance-settings.svg @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/pe_dark/scalable/jarmods.svg b/application/resources/pe_dark/scalable/jarmods.svg new file mode 100644 index 00000000..cb9a97ba --- /dev/null +++ b/application/resources/pe_dark/scalable/jarmods.svg @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/pe_dark/scalable/java.svg b/application/resources/pe_dark/scalable/java.svg new file mode 100644 index 00000000..9e1091fa --- /dev/null +++ b/application/resources/pe_dark/scalable/java.svg @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/pe_dark/scalable/loadermods.svg b/application/resources/pe_dark/scalable/loadermods.svg new file mode 100644 index 00000000..24226a09 --- /dev/null +++ b/application/resources/pe_dark/scalable/loadermods.svg @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/pe_dark/scalable/log.svg b/application/resources/pe_dark/scalable/log.svg new file mode 100644 index 00000000..68686a7d --- /dev/null +++ b/application/resources/pe_dark/scalable/log.svg @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/pe_dark/scalable/minecraft.svg b/application/resources/pe_dark/scalable/minecraft.svg new file mode 100644 index 00000000..01baf575 --- /dev/null +++ b/application/resources/pe_dark/scalable/minecraft.svg @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/pe_dark/scalable/multimc.svg b/application/resources/pe_dark/scalable/multimc.svg new file mode 100644 index 00000000..e4cf7b7f --- /dev/null +++ b/application/resources/pe_dark/scalable/multimc.svg @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/pe_dark/scalable/new.svg b/application/resources/pe_dark/scalable/new.svg new file mode 100644 index 00000000..0377aceb --- /dev/null +++ b/application/resources/pe_dark/scalable/new.svg @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/pe_dark/scalable/news.svg b/application/resources/pe_dark/scalable/news.svg new file mode 100644 index 00000000..84979dcb --- /dev/null +++ b/application/resources/pe_dark/scalable/news.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + diff --git a/application/resources/pe_dark/scalable/notes.svg b/application/resources/pe_dark/scalable/notes.svg new file mode 100644 index 00000000..72649721 --- /dev/null +++ b/application/resources/pe_dark/scalable/notes.svg @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/pe_dark/scalable/patreon.svg b/application/resources/pe_dark/scalable/patreon.svg new file mode 100644 index 00000000..01cb279a --- /dev/null +++ b/application/resources/pe_dark/scalable/patreon.svg @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/pe_dark/scalable/proxy.svg b/application/resources/pe_dark/scalable/proxy.svg new file mode 100644 index 00000000..98bcfac1 --- /dev/null +++ b/application/resources/pe_dark/scalable/proxy.svg @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/pe_dark/scalable/quickmods.svg b/application/resources/pe_dark/scalable/quickmods.svg new file mode 100644 index 00000000..346729f1 --- /dev/null +++ b/application/resources/pe_dark/scalable/quickmods.svg @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/pe_dark/scalable/refresh.svg b/application/resources/pe_dark/scalable/refresh.svg new file mode 100644 index 00000000..c227cd6c --- /dev/null +++ b/application/resources/pe_dark/scalable/refresh.svg @@ -0,0 +1,11 @@ + + + + + + + diff --git a/application/resources/pe_dark/scalable/resourcepacks.svg b/application/resources/pe_dark/scalable/resourcepacks.svg new file mode 100644 index 00000000..0db2beb1 --- /dev/null +++ b/application/resources/pe_dark/scalable/resourcepacks.svg @@ -0,0 +1,13 @@ + + + + + + + diff --git a/application/resources/pe_dark/scalable/screenshots.svg b/application/resources/pe_dark/scalable/screenshots.svg new file mode 100644 index 00000000..2803b9aa --- /dev/null +++ b/application/resources/pe_dark/scalable/screenshots.svg @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/pe_dark/scalable/settings.svg b/application/resources/pe_dark/scalable/settings.svg new file mode 100644 index 00000000..c9f701e7 --- /dev/null +++ b/application/resources/pe_dark/scalable/settings.svg @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/pe_dark/scalable/status-bad.svg b/application/resources/pe_dark/scalable/status-bad.svg new file mode 100644 index 00000000..f455965a --- /dev/null +++ b/application/resources/pe_dark/scalable/status-bad.svg @@ -0,0 +1,10 @@ + + + + + + + diff --git a/application/resources/pe_dark/scalable/status-good.svg b/application/resources/pe_dark/scalable/status-good.svg new file mode 100644 index 00000000..4ba91f2d --- /dev/null +++ b/application/resources/pe_dark/scalable/status-good.svg @@ -0,0 +1,12 @@ + + + + + + + + + diff --git a/application/resources/pe_dark/scalable/status-yellow.svg b/application/resources/pe_dark/scalable/status-yellow.svg new file mode 100644 index 00000000..69133817 --- /dev/null +++ b/application/resources/pe_dark/scalable/status-yellow.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + + diff --git a/application/resources/pe_dark/scalable/viewfolder.svg b/application/resources/pe_dark/scalable/viewfolder.svg new file mode 100644 index 00000000..3af36240 --- /dev/null +++ b/application/resources/pe_dark/scalable/viewfolder.svg @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/pe_light/index.theme b/application/resources/pe_light/index.theme new file mode 100644 index 00000000..c106acc8 --- /dev/null +++ b/application/resources/pe_light/index.theme @@ -0,0 +1,11 @@ +[Icon Theme] +Name=pe_light +Comment=Icons by pexner (light) +Inherits=multimc +Directories=scalable + +[scalable] +Size=48 +Type=Scalable +MinSize=16 +MaxSize=256 diff --git a/application/resources/pe_light/pe_light.qrc b/application/resources/pe_light/pe_light.qrc new file mode 100644 index 00000000..53d0890b --- /dev/null +++ b/application/resources/pe_light/pe_light.qrc @@ -0,0 +1,36 @@ + + + + index.theme + scalable/about.svg + scalable/accounts.svg + scalable/bug.svg + scalable/centralmods.svg + scalable/checkupdate.svg + scalable/copy.svg + scalable/coremods.svg + scalable/externaltools.svg + scalable/instance-settings.svg + scalable/jarmods.svg + scalable/java.svg + scalable/loadermods.svg + scalable/log.svg + scalable/minecraft.svg + scalable/multimc.svg + scalable/new.svg + scalable/news.svg + scalable/notes.svg + scalable/patreon.svg + scalable/proxy.svg + scalable/quickmods.svg + scalable/refresh.svg + scalable/resourcepacks.svg + scalable/screenshots.svg + scalable/settings.svg + scalable/status-bad.svg + scalable/status-good.svg + scalable/status-yellow.svg + scalable/viewfolder.svg + + + diff --git a/application/resources/pe_light/scalable/about.svg b/application/resources/pe_light/scalable/about.svg new file mode 100644 index 00000000..8d00c32e --- /dev/null +++ b/application/resources/pe_light/scalable/about.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + diff --git a/application/resources/pe_light/scalable/accounts.svg b/application/resources/pe_light/scalable/accounts.svg new file mode 100644 index 00000000..3a092d03 --- /dev/null +++ b/application/resources/pe_light/scalable/accounts.svg @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/pe_light/scalable/bug.svg b/application/resources/pe_light/scalable/bug.svg new file mode 100644 index 00000000..ccb64bc5 --- /dev/null +++ b/application/resources/pe_light/scalable/bug.svg @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/pe_light/scalable/centralmods.svg b/application/resources/pe_light/scalable/centralmods.svg new file mode 100644 index 00000000..050fdc58 --- /dev/null +++ b/application/resources/pe_light/scalable/centralmods.svg @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/pe_light/scalable/checkupdate.svg b/application/resources/pe_light/scalable/checkupdate.svg new file mode 100644 index 00000000..08b8dcd5 --- /dev/null +++ b/application/resources/pe_light/scalable/checkupdate.svg @@ -0,0 +1,13 @@ + + + + + + + + diff --git a/application/resources/pe_light/scalable/copy.svg b/application/resources/pe_light/scalable/copy.svg new file mode 100644 index 00000000..abdcce09 --- /dev/null +++ b/application/resources/pe_light/scalable/copy.svg @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/pe_light/scalable/coremods.svg b/application/resources/pe_light/scalable/coremods.svg new file mode 100644 index 00000000..c8fb0eb9 --- /dev/null +++ b/application/resources/pe_light/scalable/coremods.svg @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/pe_light/scalable/externaltools.svg b/application/resources/pe_light/scalable/externaltools.svg new file mode 100644 index 00000000..4d232bcf --- /dev/null +++ b/application/resources/pe_light/scalable/externaltools.svg @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/pe_light/scalable/instance-settings.svg b/application/resources/pe_light/scalable/instance-settings.svg new file mode 100644 index 00000000..83b92a52 --- /dev/null +++ b/application/resources/pe_light/scalable/instance-settings.svg @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/pe_light/scalable/jarmods.svg b/application/resources/pe_light/scalable/jarmods.svg new file mode 100644 index 00000000..9852c805 --- /dev/null +++ b/application/resources/pe_light/scalable/jarmods.svg @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/pe_light/scalable/java.svg b/application/resources/pe_light/scalable/java.svg new file mode 100644 index 00000000..0584058a --- /dev/null +++ b/application/resources/pe_light/scalable/java.svg @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/pe_light/scalable/loadermods.svg b/application/resources/pe_light/scalable/loadermods.svg new file mode 100644 index 00000000..913c1968 --- /dev/null +++ b/application/resources/pe_light/scalable/loadermods.svg @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/pe_light/scalable/log.svg b/application/resources/pe_light/scalable/log.svg new file mode 100644 index 00000000..82282ca4 --- /dev/null +++ b/application/resources/pe_light/scalable/log.svg @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/pe_light/scalable/minecraft.svg b/application/resources/pe_light/scalable/minecraft.svg new file mode 100644 index 00000000..d772111f --- /dev/null +++ b/application/resources/pe_light/scalable/minecraft.svg @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/pe_light/scalable/multimc.svg b/application/resources/pe_light/scalable/multimc.svg new file mode 100644 index 00000000..8b2cb631 --- /dev/null +++ b/application/resources/pe_light/scalable/multimc.svg @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/pe_light/scalable/new.svg b/application/resources/pe_light/scalable/new.svg new file mode 100644 index 00000000..96fd1f5b --- /dev/null +++ b/application/resources/pe_light/scalable/new.svg @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/pe_light/scalable/news.svg b/application/resources/pe_light/scalable/news.svg new file mode 100644 index 00000000..6f184afc --- /dev/null +++ b/application/resources/pe_light/scalable/news.svg @@ -0,0 +1,12 @@ + + + + + + + + + + diff --git a/application/resources/pe_light/scalable/notes.svg b/application/resources/pe_light/scalable/notes.svg new file mode 100644 index 00000000..02dc11ec --- /dev/null +++ b/application/resources/pe_light/scalable/notes.svg @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/pe_light/scalable/patreon.svg b/application/resources/pe_light/scalable/patreon.svg new file mode 100644 index 00000000..0bd08826 --- /dev/null +++ b/application/resources/pe_light/scalable/patreon.svg @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/pe_light/scalable/proxy.svg b/application/resources/pe_light/scalable/proxy.svg new file mode 100644 index 00000000..9de8d6d1 --- /dev/null +++ b/application/resources/pe_light/scalable/proxy.svg @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/pe_light/scalable/quickmods.svg b/application/resources/pe_light/scalable/quickmods.svg new file mode 100644 index 00000000..6dbeab52 --- /dev/null +++ b/application/resources/pe_light/scalable/quickmods.svg @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/pe_light/scalable/refresh.svg b/application/resources/pe_light/scalable/refresh.svg new file mode 100644 index 00000000..9a724d91 --- /dev/null +++ b/application/resources/pe_light/scalable/refresh.svg @@ -0,0 +1,11 @@ + + + + + + + diff --git a/application/resources/pe_light/scalable/resourcepacks.svg b/application/resources/pe_light/scalable/resourcepacks.svg new file mode 100644 index 00000000..7d6323f2 --- /dev/null +++ b/application/resources/pe_light/scalable/resourcepacks.svg @@ -0,0 +1,13 @@ + + + + + + + diff --git a/application/resources/pe_light/scalable/screenshots.svg b/application/resources/pe_light/scalable/screenshots.svg new file mode 100644 index 00000000..f2887be6 --- /dev/null +++ b/application/resources/pe_light/scalable/screenshots.svg @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/pe_light/scalable/settings.svg b/application/resources/pe_light/scalable/settings.svg new file mode 100644 index 00000000..83b92a52 --- /dev/null +++ b/application/resources/pe_light/scalable/settings.svg @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/pe_light/scalable/status-bad.svg b/application/resources/pe_light/scalable/status-bad.svg new file mode 100644 index 00000000..2c24970c --- /dev/null +++ b/application/resources/pe_light/scalable/status-bad.svg @@ -0,0 +1,10 @@ + + + + + + + diff --git a/application/resources/pe_light/scalable/status-good.svg b/application/resources/pe_light/scalable/status-good.svg new file mode 100644 index 00000000..bf9a4174 --- /dev/null +++ b/application/resources/pe_light/scalable/status-good.svg @@ -0,0 +1,12 @@ + + + + + + + + + diff --git a/application/resources/pe_light/scalable/status-yellow.svg b/application/resources/pe_light/scalable/status-yellow.svg new file mode 100644 index 00000000..f7d2236b --- /dev/null +++ b/application/resources/pe_light/scalable/status-yellow.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + + diff --git a/application/resources/pe_light/scalable/viewfolder.svg b/application/resources/pe_light/scalable/viewfolder.svg new file mode 100644 index 00000000..b36343fe --- /dev/null +++ b/application/resources/pe_light/scalable/viewfolder.svg @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/sources/clucker.svg b/application/resources/sources/clucker.svg new file mode 100644 index 00000000..0c1727eb --- /dev/null +++ b/application/resources/sources/clucker.svg @@ -0,0 +1,404 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/sources/creeper.svg b/application/resources/sources/creeper.svg new file mode 100644 index 00000000..2a2e39b6 --- /dev/null +++ b/application/resources/sources/creeper.svg @@ -0,0 +1,775 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/sources/enderpearl.svg b/application/resources/sources/enderpearl.svg new file mode 100644 index 00000000..ac9378f5 --- /dev/null +++ b/application/resources/sources/enderpearl.svg @@ -0,0 +1,271 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + diff --git a/application/resources/sources/ftb-glow.svg b/application/resources/sources/ftb-glow.svg new file mode 100644 index 00000000..be78c78e --- /dev/null +++ b/application/resources/sources/ftb-glow.svg @@ -0,0 +1,606 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/sources/ftb-logo.svg b/application/resources/sources/ftb-logo.svg new file mode 100644 index 00000000..8cf73567 --- /dev/null +++ b/application/resources/sources/ftb-logo.svg @@ -0,0 +1,257 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/sources/gear.svg b/application/resources/sources/gear.svg new file mode 100644 index 00000000..c0169aec --- /dev/null +++ b/application/resources/sources/gear.svg @@ -0,0 +1,434 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + diff --git a/application/resources/sources/herobrine.svg b/application/resources/sources/herobrine.svg new file mode 100644 index 00000000..7392ba36 --- /dev/null +++ b/application/resources/sources/herobrine.svg @@ -0,0 +1,583 @@ + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/sources/magitech.svg b/application/resources/sources/magitech.svg new file mode 100644 index 00000000..c6dd6bc0 --- /dev/null +++ b/application/resources/sources/magitech.svg @@ -0,0 +1,886 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/sources/meat.svg b/application/resources/sources/meat.svg new file mode 100644 index 00000000..69a20073 --- /dev/null +++ b/application/resources/sources/meat.svg @@ -0,0 +1,371 @@ + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/sources/netherstar.svg b/application/resources/sources/netherstar.svg new file mode 100644 index 00000000..4046e4ec --- /dev/null +++ b/application/resources/sources/netherstar.svg @@ -0,0 +1,342 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/sources/pskeleton.svg b/application/resources/sources/pskeleton.svg new file mode 100644 index 00000000..c2783df8 --- /dev/null +++ b/application/resources/sources/pskeleton.svg @@ -0,0 +1,581 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/sources/skeleton.svg b/application/resources/sources/skeleton.svg new file mode 100644 index 00000000..5d55f272 --- /dev/null +++ b/application/resources/sources/skeleton.svg @@ -0,0 +1,610 @@ + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/sources/squarecreeper.svg b/application/resources/sources/squarecreeper.svg new file mode 100644 index 00000000..a1b0f4d1 --- /dev/null +++ b/application/resources/sources/squarecreeper.svg @@ -0,0 +1,828 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/sources/steve.svg b/application/resources/sources/steve.svg new file mode 100644 index 00000000..2233272c --- /dev/null +++ b/application/resources/sources/steve.svg @@ -0,0 +1,534 @@ + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/resources/versions/LWJGL/2.9.0.json b/application/resources/versions/LWJGL/2.9.0.json new file mode 100644 index 00000000..5dbd624e --- /dev/null +++ b/application/resources/versions/LWJGL/2.9.0.json @@ -0,0 +1,45 @@ + { + "fileId": "org.lwjgl", + "name": "LWJGL", + "version": "2.9.0", + "+libraries": [ + { + "name": "net.java.jinput:jinput:2.0.5" + }, + { + "name": "net.java.jinput:jinput-platform:2.0.5", + "natives": { + "linux": "natives-linux", + "windows": "natives-windows", + "osx": "natives-osx" + }, + "extract": { + "exclude": [ + "META-INF/" + ] + } + }, + { + "name": "net.java.jutils:jutils:1.0.0" + }, + { + "name": "org.lwjgl.lwjgl:lwjgl:2.9.0" + }, + { + "name": "org.lwjgl.lwjgl:lwjgl_util:2.9.0" + }, + { + "name": "org.lwjgl.lwjgl:lwjgl-platform:2.9.0", + "natives": { + "linux": "natives-linux", + "windows": "natives-windows", + "osx": "natives-osx" + }, + "extract": { + "exclude": [ + "META-INF/" + ] + } + } + ] +} diff --git a/application/resources/versions/LWJGL/2.9.1-nightly-20130708-debug3.json b/application/resources/versions/LWJGL/2.9.1-nightly-20130708-debug3.json new file mode 100644 index 00000000..7265b3b0 --- /dev/null +++ b/application/resources/versions/LWJGL/2.9.1-nightly-20130708-debug3.json @@ -0,0 +1,45 @@ +{ + "fileId": "org.lwjgl", + "name": "LWJGL", + "version": "2.9.1-nightly-20130708-debug3", + "+libraries": [ + { + "name": "net.java.jinput:jinput:2.0.5" + }, + { + "name": "net.java.jinput:jinput-platform:2.0.5", + "natives": { + "linux": "natives-linux", + "windows": "natives-windows", + "osx": "natives-osx" + }, + "extract": { + "exclude": [ + "META-INF/" + ] + } + }, + { + "name": "net.java.jutils:jutils:1.0.0" + }, + { + "name": "org.lwjgl.lwjgl:lwjgl:2.9.1-nightly-20130708-debug3" + }, + { + "name": "org.lwjgl.lwjgl:lwjgl_util:2.9.1-nightly-20130708-debug3" + }, + { + "name": "org.lwjgl.lwjgl:lwjgl-platform:2.9.1-nightly-20130708-debug3", + "natives": { + "linux": "natives-linux", + "windows": "natives-windows", + "osx": "natives-osx" + }, + "extract": { + "exclude": [ + "META-INF/" + ] + } + } + ] +} diff --git a/application/resources/versions/LWJGL/2.9.1.json b/application/resources/versions/LWJGL/2.9.1.json new file mode 100644 index 00000000..e7f5e947 --- /dev/null +++ b/application/resources/versions/LWJGL/2.9.1.json @@ -0,0 +1,45 @@ + { + "fileId": "org.lwjgl", + "name": "LWJGL", + "version": "2.9.1", + "+libraries": [ + { + "name": "net.java.jinput:jinput:2.0.5" + }, + { + "name": "net.java.jinput:jinput-platform:2.0.5", + "natives": { + "linux": "natives-linux", + "windows": "natives-windows", + "osx": "natives-osx" + }, + "extract": { + "exclude": [ + "META-INF/" + ] + } + }, + { + "name": "net.java.jutils:jutils:1.0.0" + }, + { + "name": "org.lwjgl.lwjgl:lwjgl:2.9.1" + }, + { + "name": "org.lwjgl.lwjgl:lwjgl_util:2.9.1" + }, + { + "name": "org.lwjgl.lwjgl:lwjgl-platform:2.9.1", + "natives": { + "linux": "natives-linux", + "windows": "natives-windows", + "osx": "natives-osx" + }, + "extract": { + "exclude": [ + "META-INF/" + ] + } + } + ] +} diff --git a/application/resources/versions/LWJGL/2.9.2-nightly-20140822.json b/application/resources/versions/LWJGL/2.9.2-nightly-20140822.json new file mode 100644 index 00000000..25b22eb9 --- /dev/null +++ b/application/resources/versions/LWJGL/2.9.2-nightly-20140822.json @@ -0,0 +1,45 @@ +{ + "fileId": "org.lwjgl", + "name": "LWJGL", + "version": "2.9.2-nightly-20140822", + "+libraries": [ + { + "name": "net.java.jinput:jinput:2.0.5" + }, + { + "name": "net.java.jinput:jinput-platform:2.0.5", + "natives": { + "linux": "natives-linux", + "windows": "natives-windows", + "osx": "natives-osx" + }, + "extract": { + "exclude": [ + "META-INF/" + ] + } + }, + { + "name": "net.java.jutils:jutils:1.0.0" + }, + { + "name": "org.lwjgl.lwjgl:lwjgl:2.9.2-nightly-20140822" + }, + { + "name": "org.lwjgl.lwjgl:lwjgl_util:2.9.2-nightly-20140822" + }, + { + "name": "org.lwjgl.lwjgl:lwjgl-platform:2.9.2-nightly-20140822", + "natives": { + "linux": "natives-linux", + "windows": "natives-windows", + "osx": "natives-osx" + }, + "extract": { + "exclude": [ + "META-INF/" + ] + } + } + ] +} diff --git a/application/resources/versions/minecraft.json b/application/resources/versions/minecraft.json new file mode 100644 index 00000000..58b153c2 --- /dev/null +++ b/application/resources/versions/minecraft.json @@ -0,0 +1,668 @@ +{ +"versions": [ + { + "id": "1.5.2", + "checksum": "6897c3287fb971c9f362eb3ab20f5ddd", + "releaseTime": "2013-04-25T17:45:00+02:00", + "type": "release", + "processArguments": "legacy", + "+traits": ["legacyLaunch", "texturepacks"] + }, + { + "id": "1.5.1", + "checksum": "5c1219d869b87d233de3033688ec7567", + "releaseTime": "2013-03-20T12:00:00+02:00", + "type": "release", + "processArguments": "legacy", + "+traits": ["legacyLaunch", "texturepacks"] + }, + { + "id": "1.5", + "checksum": "fd11cbc5b01aae1d62cff0145171f3d9", + "releaseTime": "2013-03-07T00:00:00+02:00", + "type": "snapshot", + "processArguments": "legacy", + "+traits": ["legacyLaunch", "texturepacks"] + }, + { + "id": "1.4.7", + "checksum": "8e80fb01b321c6b3c7efca397a3eea35", + "releaseTime": "2012-12-28T00:00:00+02:00", + "type": "release", + "processArguments": "legacy", + "+traits": ["legacyLaunch", "texturepacks"] + }, + { + "id": "1.4.6", + "checksum": "48677dc4c2b98c29918722b5ab27b4fd", + "releaseTime": "2012-12-20T00:00:00+02:00", + "type": "release", + "processArguments": "legacy", + "+traits": ["legacyLaunch", "texturepacks"] + }, + { + "id": "1.4.5", + "checksum": "b15e2b2b6b4629f0d99a95b6b44412a0", + "releaseTime": "2012-11-20T00:00:00+02:00", + "type": "release", + "processArguments": "legacy", + "+traits": ["legacyLaunch", "texturepacks"] + }, + { + "id": "1.4.4", + "checksum": "7aa46c8058cba2f38e9d2ddddcc77c72", + "releaseTime": "2012-11-14T00:00:00+02:00", + "type": "release", + "processArguments": "legacy", + "+traits": ["legacyLaunch", "texturepacks"] + }, + { + "id": "1.4.3", + "checksum": "9cc3295931edb6339f22989fe1b612a6", + "releaseTime": "2012-11-01T00:00:00+02:00", + "type": "snapshot", + "processArguments": "legacy", + "+traits": ["legacyLaunch", "texturepacks"] + }, + { + "id": "1.4.2", + "checksum": "771175c01778ea67395bc6919a5a9dc5", + "releaseTime": "2012-10-25T00:00:00+02:00", + "type": "release", + "processArguments": "legacy", + "+traits": ["legacyLaunch", "texturepacks"] + }, + { + "id": "1.4.1", + "checksum": "542621a5298659dc65f383f35170fc4c", + "releaseTime": "2012-10-23T00:00:00+02:00", + "type": "snapshot", + "processArguments": "legacy", + "+traits": ["legacyLaunch", "texturepacks"] + }, + { + "id": "1.4", + "checksum": "32a654388b54d3e4bb29c1a46e7d6a12", + "releaseTime": "2012-10-19T00:00:00+02:00", + "type": "snapshot", + "processArguments": "legacy", + "+traits": ["legacyLaunch", "texturepacks"] + }, + { + "id": "1.3.2", + "checksum": "969699f13e5bbe7f12e40ac4f32b7d9a", + "releaseTime": "2012-08-16T00:00:00+02:00", + "type": "release", + "processArguments": "legacy", + "+traits": ["legacyLaunch", "texturepacks"] + }, + { + "id": "1.3.1", + "checksum": "266ccbc9798afd2eadf3d6c01b4c562a", + "releaseTime": "2012-08-01T00:00:00+02:00", + "type": "release", + "processArguments": "legacy", + "+traits": ["legacyLaunch", "texturepacks"] + }, + { + "id": "1.3", + "checksum": "a6effac1eaccf5d429aae340cf95ed5d", + "releaseTime": "2012-07-26T00:00:00+02:00", + "type": "snapshot", + "processArguments": "legacy", + "+traits": ["legacyLaunch", "texturepacks"] + }, + { + "id": "1.2.5", + "checksum": "8e8778078a175a33603a585257f28563", + "releaseTime": "2012-03-30T00:00:00+02:00", + "type": "release", + "processArguments": "legacy", + "+traits": ["legacyLaunch", "texturepacks"] + }, + { + "id": "1.2.4", + "checksum": "25423eab6d8707f96cc6ad8a21a7250a", + "releaseTime": "2012-03-22T00:00:00+02:00", + "type": "release", + "processArguments": "legacy", + "+traits": ["legacyLaunch", "texturepacks"] + }, + { + "id": "1.2.3", + "checksum": "12f6c4b1bdcc63f029e3c088a364b8e4", + "releaseTime": "2012-03-02T00:00:00+02:00", + "type": "release", + "processArguments": "legacy", + "+traits": ["legacyLaunch", "texturepacks"] + }, + { + "id": "1.2.2", + "checksum": "6189e96efaea11e5164b4a4755574324", + "releaseTime": "2012-03-01T00:00:01+02:00", + "type": "release", + "processArguments": "legacy", + "+traits": ["legacyLaunch", "texturepacks"] + }, + { + "id": "1.2.1", + "checksum": "97067a603eba2b6eb75d3194f81f6bcd", + "releaseTime": "2012-03-01T00:00:00+02:00", + "type": "release", + "processArguments": "legacy", + "+traits": ["legacyLaunch", "texturepacks"] + }, + { + "id": "1.1", + "checksum": "e92302d2acdba7c97e0d8df1e10d2006", + "releaseTime": "2012-01-12T00:00:00+02:00", + "type": "release", + "processArguments": "legacy", + "+traits": ["legacyLaunch", "texturepacks"] + }, + { + "id": "1.0", + "checksum": "3820d222b95d0b8c520d9596a756a6e6", + "releaseTime": "2011-11-18T00:00:00+02:00", + "type": "release", + "processArguments": "legacy", + "+traits": ["legacyLaunch", "texturepacks"] + }, + { + "id": "b1.8.1", + "checksum": "f8c5a2ccd3bc996792bbe436d8cc08bc", + "releaseTime": "2011-09-19T00:00:00+02:00", + "type": "old_beta", + "processArguments": "legacy", + "+traits": ["legacyLaunch", "texturepacks"] + }, + { + "id": "b1.8", + "checksum": "a59a9fd4c726a573b0a2bdd10d857f59", + "releaseTime": "2011-09-15T00:00:00+02:00", + "type": "old_beta", + "processArguments": "legacy", + "+traits": ["legacyLaunch", "texturepacks"] + }, + { + "id": "b1.7.3", + "checksum": "eae3353fdaa7e10a59b4cb5b45bfa10d", + "releaseTime": "2011-07-08T00:00:00+02:00", + "type": "old_beta", + "processArguments": "legacy", + "+traits": ["legacyLaunch", "texturepacks"] + }, + { + "id": "b1.7.2", + "checksum": "dd9215ab1141170d4871f42bff4ab302", + "releaseTime": "2011-07-01T00:00:00+02:00", + "type": "old_beta", + "processArguments": "legacy", + "+traits": ["legacyLaunch", "texturepacks"] + }, + { + "id": "b1.7", + "checksum": "682419e9ed1a236c3067822d53cda1e4", + "releaseTime": "2011-06-30T00:00:00+02:00", + "type": "old_beta", + "processArguments": "legacy", + "+traits": ["legacyLaunch", "texturepacks"] + }, + { + "id": "b1.6.6", + "checksum": "ce80072464433cd5b05d505aa8ff29d1", + "releaseTime": "2011-05-31T00:00:00+02:00", + "type": "old_beta", + "processArguments": "legacy", + "+traits": ["legacyLaunch", "texturepacks"] + }, + { + "id": "b1.6.5", + "checksum": "2aba888864b32038c8d22ee5df71b7c8", + "releaseTime": "2011-05-28T00:00:00+02:00", + "type": "old_beta", + "processArguments": "legacy", + "+traits": ["legacyLaunch", "texturepacks"] + }, + { + "id": "b1.6.4", + "checksum": "5c4df6f120336f113180698613853dba", + "releaseTime": "2011-05-26T00:00:04+02:00", + "type": "old_beta", + "processArguments": "legacy", + "+traits": ["legacyLaunch", "texturepacks"] + }, + { + "id": "b1.6.3", + "checksum": "efc2becca965e4f8feb5b4210c6a4fd1", + "releaseTime": "2011-05-26T00:00:03+02:00", + "type": "old_beta", + "processArguments": "legacy", + "+traits": ["legacyLaunch", "texturepacks"] + }, + { + "id": "b1.6.2", + "checksum": "01330b1c930102a683a4dd8d792e632e", + "releaseTime": "2011-05-26T00:00:02+02:00", + "type": "old_beta", + "processArguments": "legacy", + "+traits": ["legacyLaunch", "texturepacks"] + }, + { + "id": "b1.6.1", + "checksum": "a7e82c441a57ef4068c533f4d777336a", + "releaseTime": "2011-05-26T00:00:01+02:00", + "type": "old_beta", + "processArguments": "legacy", + "+traits": ["legacyLaunch", "texturepacks"] + }, + { + "id": "b1.6", + "checksum": "d531e221227a65392259d3141893280d", + "releaseTime": "2011-05-26T00:00:00+02:00", + "type": "old_beta", + "processArguments": "legacy", + "+traits": ["legacyLaunch", "texturepacks"] + }, + { + "id": "b1.5_01", + "checksum": "d02fa9998e30693d8d989d5f88cf0040", + "releaseTime": "2011-04-20T00:00:00+02:00", + "type": "old_beta", + "processArguments": "legacy", + "+traits": ["legacyLaunch", "texturepacks"] + }, + { + "id": "b1.5", + "checksum": "24289130902822d73f8722b52bc07cdb", + "releaseTime": "2011-04-19T00:00:00+02:00", + "type": "old_beta", + "processArguments": "legacy", + "+traits": ["legacyLaunch", "texturepacks"] + }, + { + "id": "b1.4_01", + "checksum": "9379e54b581ba4ef3acc3e326e87db91", + "releaseTime": "2011-04-05T00:00:00+02:00", + "type": "old_beta", + "processArguments": "legacy", + "+traits": ["legacyLaunch", "texturepacks"] + }, + { + "id": "b1.4", + "checksum": "71e64b61175b371ed148b385f2d14ebf", + "releaseTime": "2011-03-31T00:00:00+02:00", + "type": "old_beta", + "processArguments": "legacy", + "+traits": ["legacyLaunch", "texturepacks"] + }, + { + "id": "b1.3_01", + "checksum": "4203826f35e1036f089919032c3d19d1", + "releaseTime": "2011-02-23T00:00:00+02:00", + "type": "old_beta", + "processArguments": "legacy", + "+traits": ["legacyLaunch", "texturepacks"] + }, + { + "id": "b1.3b", + "checksum": "de2164df461d028229ed2e101181bbd4", + "releaseTime": "2011-02-22T00:00:00+02:00", + "type": "old_beta", + "processArguments": "legacy", + "+traits": ["legacyLaunch", "texturepacks"] + }, + { + "id": "b1.2_02", + "checksum": "1736c5ba4f63a981220c2a18a4120180", + "releaseTime": "2011-01-21T00:00:00+02:00", + "type": "old_beta", + "processArguments": "legacy", + "+traits": ["legacyLaunch", "texturepacks"] + }, + { + "id": "b1.2_01", + "checksum": "486d83ec00554b45ffa21af2faa0116a", + "releaseTime": "2011-01-14T00:00:00+02:00", + "type": "old_beta", + "processArguments": "legacy", + "+traits": ["legacyLaunch", "texturepacks"] + }, + { + "id": "b1.2", + "checksum": "6426223efe23c3931a4ef89685be3349", + "releaseTime": "2011-01-13T00:00:00+02:00", + "type": "old_beta", + "processArguments": "legacy", + "+traits": ["legacyLaunch", "texturepacks"] + }, + { + "id": "b1.1_02", + "checksum": "7d547e495a770c62054ef136add43034", + "releaseTime": "2010-12-22T00:00:01+02:00", + "type": "old_beta", + "processArguments": "legacy", + "+traits": ["legacyLaunch", "texturepacks"] + }, + { + "id": "b1.1_01", + "checksum": "1f9331f2bfca81b6ce2acdfc1f105837", + "releaseTime": "2010-12-22T00:00:00+02:00", + "type": "old_beta", + "processArguments": "legacy", + "+traits": ["legacyLaunch", "texturepacks"] + }, + { + "id": "b1.0.2", + "checksum": "d200c465b8c167cc8df6537531fc9a48", + "releaseTime": "2010-12-21T00:00:00+02:00", + "type": "old_beta", + "processArguments": "legacy", + "+traits": ["legacyLaunch", "texturepacks"] + }, + { + "id": "b1.0_01", + "checksum": "03bd20b870dbbd121de5dca98af4e1ce", + "releaseTime": "2010-12-20T00:00:01+02:00", + "type": "old_beta", + "processArguments": "legacy", + "+traits": ["legacyLaunch", "texturepacks"] + }, + { + "id": "b1.0", + "checksum": "5f8733dbbf09b4e7c874661a3c29c239", + "releaseTime": "2010-12-20T00:00:00+02:00", + "type": "old_beta", + "processArguments": "legacy", + "+traits": ["legacyLaunch", "texturepacks"] + }, + { + "id": "a1.2.6", + "checksum": "ddd5e39467f28d1ea1a03b4d9e790867", + "releaseTime": "2010-12-03T00:00:00+02:00", + "type": "old_alpha", + "processArguments": "legacy", + "+traits": ["legacyLaunch", "texturepacks"] + }, + { + "id": "a1.2.5", + "checksum": "7d3a43037190970ff2e11153b5718b74", + "releaseTime": "2010-12-01T00:00:00+02:00", + "type": "old_alpha", + "processArguments": "legacy", + "+traits": ["legacyLaunch", "texturepacks"] + }, + { + "id": "a1.2.4_01", + "checksum": "0a1cc8c668faa6dc93fc418e8b4b097a", + "releaseTime": "2010-11-30T00:00:00+02:00", + "type": "old_alpha", + "processArguments": "legacy", + "+traits": ["legacyLaunch", "texturepacks"] + }, + { + "id": "a1.2.3_04", + "checksum": "b2c25a753c82a1cd228ce71469829dc1", + "releaseTime": "2010-11-26T00:00:00+02:00", + "type": "old_alpha", + "processArguments": "legacy", + "+traits": ["legacyLaunch", "texturepacks"] + }, + { + "id": "a1.2.3_02", + "checksum": "3ad4808ef2ac3b65d10305315260da03", + "releaseTime": "2010-11-25T00:00:00+02:00", + "type": "old_alpha", + "processArguments": "legacy", + "+traits": ["legacyLaunch", "texturepacks"] + }, + { + "id": "a1.2.3_01", + "checksum": "70cbab762b17c5b11fefea9b12564119", + "releaseTime": "2010-11-24T00:00:01+02:00", + "type": "old_alpha", + "processArguments": "legacy", + "+traits": ["legacyLaunch", "texturepacks"] + }, + { + "id": "a1.2.3", + "checksum": "25f053114e34b915e675f82d58f08711", + "releaseTime": "2010-11-24T00:00:00+02:00", + "type": "old_alpha", + "processArguments": "legacy", + "+traits": ["legacyLaunch", "texturepacks"] + }, + { + "id": "a1.2.2b", + "checksum": "6250fb17f8898c4d970d6bd03c229177", + "releaseTime": "2010-11-10T00:00:01+02:00", + "type": "old_alpha", + "processArguments": "legacy", + "+traits": ["legacyLaunch", "texturepacks"] + }, + { + "id": "a1.2.2a", + "checksum": "0f9fe018b344fd9dd849005f9bdca803", + "releaseTime": "2010-11-10T00:00:00+02:00", + "type": "old_alpha", + "processArguments": "legacy", + "+traits": ["legacyLaunch", "texturepacks"] + }, + { + "id": "a1.2.1_01", + "checksum": "0a496e44a7b4e2f493b5893d8e5845bd", + "releaseTime": "2010-11-05T00:00:01+02:00", + "type": "old_alpha", + "processArguments": "legacy", + "+traits": ["legacyLaunch", "no-texturepacks"] + }, + { + "id": "a1.2.1", + "checksum": "0a496e44a7b4e2f493b5893d8e5845bd", + "releaseTime": "2010-11-05T00:00:00+02:00", + "type": "old_alpha", + "processArguments": "legacy", + "+traits": ["legacyLaunch", "no-texturepacks"] + }, + { + "id": "a1.2.0_02", + "checksum": "f5bcb4d0c0e78bc220f164b89ae9bd60", + "releaseTime": "2010-11-04T00:00:00+02:00", + "type": "old_alpha", + "processArguments": "legacy", + "+traits": ["legacyLaunch", "no-texturepacks"] + }, + { + "id": "a1.2.0_01", + "checksum": "b2e9333e967cb89488884c2e5c715d4f", + "releaseTime": "2010-10-31T00:00:00+02:00", + "type": "old_alpha", + "processArguments": "legacy", + "+traits": ["legacyLaunch", "no-texturepacks"] + }, + { + "id": "a1.2.0", + "checksum": "44c384dae02390f700458b95d82c3e2a", + "releaseTime": "2010-10-30T00:00:00+02:00", + "type": "old_alpha", + "processArguments": "legacy", + "+traits": ["legacyLaunch", "no-texturepacks"] + }, + { + "id": "a1.1.2_01", + "checksum": "94346e1b8f6ad0e4a284314f0e29207b", + "releaseTime": "2010-09-23T00:00:00+02:00", + "type": "old_alpha", + "processArguments": "legacy", + "+traits": ["legacyLaunch", "no-texturepacks"] + }, + { + "id": "a1.1.2", + "checksum": "72ba1f834327805cb44164a42b331522", + "releaseTime": "2010-09-20T00:00:00+02:00", + "type": "old_alpha", + "processArguments": "legacy", + "+traits": ["legacyLaunch", "no-texturepacks"] + }, + { + "id": "a1.1.0", + "checksum": "891fd93e04f5daaf35d73c58e45c01b1", + "releaseTime": "2010-09-13T00:00:00+02:00", + "type": "old_alpha", + "processArguments": "legacy", + "+traits": ["legacyLaunch", "no-texturepacks"] + }, + { + "id": "a1.0.17_04", + "checksum": "16ed7dc58244772847991e504afcf02f", + "releaseTime": "2010-08-23T00:00:00+02:00", + "type": "old_alpha", + "processArguments": "legacy", + "+traits": ["legacyLaunch", "no-texturepacks"] + }, + { + "id": "a1.0.17_02", + "checksum": "d89760b0871ef61a55c9f336c0439d58", + "releaseTime": "2010-08-20T00:00:00+02:00", + "type": "old_alpha", + "processArguments": "legacy", + "+traits": ["legacyLaunch", "no-texturepacks"] + }, + { + "id": "a1.0.16", + "checksum": "6bbde02c13aed5766275f4398ede6aae", + "releaseTime": "2010-08-12T00:00:00+02:00", + "type": "old_alpha", + "processArguments": "legacy", + "+traits": ["legacyLaunch", "no-texturepacks"] + }, + { + "id": "a1.0.15", + "checksum": "ade257d2080d56fa983763f9c701fa14", + "releaseTime": "2010-08-04T00:00:00+02:00", + "type": "old_alpha", + "processArguments": "legacy", + "+traits": ["legacyLaunch", "no-texturepacks"] + }, + { + "id": "a1.0.14", + "checksum": "227d0c6fa896a231de6269a074c9a458", + "releaseTime": "2010-07-30T00:00:00+02:00", + "type": "old_alpha", + "processArguments": "legacy", + "+traits": ["legacyLaunch", "no-texturepacks"] + }, + { + "id": "a1.0.11", + "checksum": "6f1b1dd157fa0df39760f5be3eab01b0", + "releaseTime": "2010-07-23T00:00:00+02:00", + "type": "old_alpha", + "processArguments": "legacy", + "+traits": ["legacyLaunch", "no-texturepacks"] + }, + { + "id": "a1.0.5_01", + "checksum": "ae5f606caa18222e7568819c910ee423", + "releaseTime": "2010-07-13T00:00:00+02:00", + "type": "old_alpha", + "processArguments": "legacy", + "mainClass": "y", + "+traits": ["legacyLaunch", "no-texturepacks"] + }, + { + "id": "a1.0.4", + "checksum": "13ce7935c3670e7494e26b2704bfa3e9", + "releaseTime": "2010-07-09T00:00:00+02:00", + "type": "old_alpha", + "processArguments": "legacy", + "mainClass": "ax", + "+traits": ["legacyLaunch", "no-texturepacks"] + }, + { + "id": "inf-20100618", + "checksum": "f5f5aa34760facc10486e906a7c60196", + "releaseTime": "2010-06-16T00:00:00+02:00", + "type": "old_alpha", + "processArguments": "legacy", + "mainClass": "net.minecraft.client.d", + "appletClass": "net.minecraft.client.MinecraftApplet", + "+traits": ["legacyLaunch", "no-texturepacks"] + }, + { + "id": "c0.30_01c", + "checksum": "fcfd7f83a6b27503cf48202381a5adf2", + "releaseTime": "2009-12-22T00:00:00+02:00", + "type": "old_alpha", + "processArguments": "legacy", + "mainClass": "com.mojang.minecraft.l", + "appletClass": "com.mojang.minecraft.MinecraftApplet", + "+traits": ["legacyLaunch", "no-texturepacks"] + }, + { + "id": "c0.0.13a_03", + "checksum": "a9527cb5aef198e0f53e235ebe13dc75", + "releaseTime": "2009-05-22T00:00:00+02:00", + "type": "old_alpha", + "processArguments": "legacy", + "mainClass": "com.mojang.minecraft.c", + "appletClass": "com.mojang.minecraft.MinecraftApplet", + "+traits": ["legacyLaunch", "no-texturepacks"] + }, + { + "id": "c0.0.13a", + "checksum": "3617fbf5fbfd2b837ebf5ceb63584908", + "releaseTime": "2009-05-31T00:00:00+02:00", + "type": "old_alpha", + "processArguments": "legacy", + "mainClass": "com.mojang.minecraft.Minecraft", + "appletClass": "com.mojang.minecraft.MinecraftApplet", + "+traits": ["legacyLaunch", "no-texturepacks"] + }, + { + "id": "c0.0.11a", + "checksum": "a6e03c2eaf74709facc0d2477648e999", + "releaseTime": "2009-05-17T00:00:00+02:00", + "type": "old_alpha", + "processArguments": "legacy", + "mainClass": "com.mojang.minecraft.Minecraft", + "appletClass": "com.mojang.minecraft.MinecraftApplet", + "+traits": ["legacyLaunch", "no-texturepacks"] + }, + { + "id": "rd-161348", + "checksum": "80882b8936a5c8d91500838a6660b504", + "releaseTime": "2009-05-16T13:48:00+02:00", + "type": "old_alpha", + "processArguments": "legacy", + "mainClass": "com.mojang.minecraft.RubyDung", + "+traits": ["no-texturepacks"] + }, + { + "id": "rd-160052", + "checksum": "24c5cc99a2a612697ed2f7d5d04242fe", + "releaseTime": "2009-05-16T00:52:00+02:00", + "type": "old_alpha", + "processArguments": "legacy", + "mainClass": "com.mojang.rubydung.RubyDung", + "+traits": ["no-texturepacks"] + }, + { + "id": "rd-132328", + "checksum": "70e33a81c541b13a477e68c1207124eb", + "releaseTime": "2009-05-13T23:28:00+02:00", + "type": "old_alpha", + "processArguments": "legacy", + "mainClass": "com.mojang.rubydung.RubyDung", + "+traits": ["no-texturepacks"] + }, + { + "id": "rd-132211", + "checksum": "99fdaea10c494b9c3c3254636b98b799", + "releaseTime": "2009-05-13T22:11:00+02:00", + "type": "old_alpha", + "processArguments": "legacy", + "mainClass": "com.mojang.rubydung.RubyDung", + "+traits": ["no-texturepacks"] + } +] +} diff --git a/application/resources/versions/versions.qrc b/application/resources/versions/versions.qrc new file mode 100644 index 00000000..e9621e97 --- /dev/null +++ b/application/resources/versions/versions.qrc @@ -0,0 +1,12 @@ + + + + + minecraft.json + + LWJGL/2.9.0.json + LWJGL/2.9.1-nightly-20130708-debug3.json + LWJGL/2.9.1.json + LWJGL/2.9.2-nightly-20140822.json + + diff --git a/application/widgets/Common.cpp b/application/widgets/Common.cpp new file mode 100644 index 00000000..9b730d6c --- /dev/null +++ b/application/widgets/Common.cpp @@ -0,0 +1,27 @@ +#include "Common.h" + +// Origin: Qt +QStringList viewItemTextLayout(QTextLayout &textLayout, int lineWidth, qreal &height, + qreal &widthUsed) +{ + QStringList lines; + height = 0; + widthUsed = 0; + textLayout.beginLayout(); + QString str = textLayout.text(); + while (true) + { + QTextLine line = textLayout.createLine(); + if (!line.isValid()) + break; + if (line.textLength() == 0) + break; + line.setLineWidth(lineWidth); + line.setPosition(QPointF(0, height)); + height += line.height(); + lines.append(str.mid(line.textStart(), line.textLength())); + widthUsed = qMax(widthUsed, line.naturalTextWidth()); + } + textLayout.endLayout(); + return lines; +} diff --git a/application/widgets/Common.h b/application/widgets/Common.h new file mode 100644 index 00000000..fc46e08f --- /dev/null +++ b/application/widgets/Common.h @@ -0,0 +1,6 @@ +#pragma once +#include +#include + +QStringList viewItemTextLayout(QTextLayout &textLayout, int lineWidth, qreal &height, + qreal &widthUsed); \ No newline at end of file diff --git a/application/widgets/IconLabel.cpp b/application/widgets/IconLabel.cpp new file mode 100644 index 00000000..86c8a431 --- /dev/null +++ b/application/widgets/IconLabel.cpp @@ -0,0 +1,43 @@ +#include "IconLabel.h" + +#include +#include +#include +#include +#include + +IconLabel::IconLabel(QWidget *parent, QIcon icon, QSize size) + : QWidget(parent), m_size(size), m_icon(icon) +{ + setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); +} + +QSize IconLabel::sizeHint() const +{ + return m_size; +} + +void IconLabel::setIcon(QIcon icon) +{ + m_icon = icon; + update(); +} + +void IconLabel::paintEvent(QPaintEvent *) +{ + QPainter p(this); + QRect rect = contentsRect(); + int width = rect.width(); + int height = rect.height(); + if(width < height) + { + rect.setHeight(width); + rect.translate(0, (height - width) / 2); + } + else if (width > height) + { + rect.setWidth(height); + rect.translate((width - height) / 2, 0); + } + m_icon.paint(&p, rect); +} diff --git a/application/widgets/IconLabel.h b/application/widgets/IconLabel.h new file mode 100644 index 00000000..a2f1eef3 --- /dev/null +++ b/application/widgets/IconLabel.h @@ -0,0 +1,26 @@ +#pragma once +#include +#include + +class QStyleOption; + +/** + * This is a trivial widget that paints a QIcon of the specified size. + */ +class IconLabel : public QWidget +{ + Q_OBJECT + +public: + /// Create a line separator. orientation is the orientation of the line. + explicit IconLabel(QWidget *parent, QIcon icon, QSize size); + + virtual QSize sizeHint() const; + virtual void paintEvent(QPaintEvent *); + + void setIcon(QIcon icon); + +private: + QSize m_size; + QIcon m_icon; +}; diff --git a/application/widgets/LabeledToolButton.cpp b/application/widgets/LabeledToolButton.cpp new file mode 100644 index 00000000..dfdde1bc --- /dev/null +++ b/application/widgets/LabeledToolButton.cpp @@ -0,0 +1,86 @@ +/* Copyright 2013-2015 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include +#include +#include "LabeledToolButton.h" +#include + +/* + * + * Tool Button with a label on it, instead of the normal text rendering + * + */ + +LabeledToolButton::LabeledToolButton(QWidget * parent) + : QToolButton(parent) + , m_label(new QLabel(this)) +{ + //QToolButton::setText(" "); + m_label->setWordWrap(true); + m_label->setMouseTracking(false); + m_label->setAlignment(Qt::AlignCenter); + m_label->setTextInteractionFlags(Qt::NoTextInteraction); + // somehow, this makes word wrap work in the QLabel. yay. + m_label->setMinimumWidth(100); +} + +QString LabeledToolButton::text() const +{ + return m_label->text(); +} + +void LabeledToolButton::setText(const QString & text) +{ + m_label->setText(text); +} + +/*! + \reimp +*/ +QSize LabeledToolButton::sizeHint() const +{ + /* + Q_D(const QToolButton); + if (d->sizeHint.isValid()) + return d->sizeHint; + */ + ensurePolished(); + + int w = 0, h = 0; + QStyleOptionToolButton opt; + initStyleOption(&opt); + QSize sz =m_label->sizeHint(); + w = sz.width(); + h = sz.height(); + + opt.rect.setSize(QSize(w, h)); // PM_MenuButtonIndicator depends on the height + if (popupMode() == MenuButtonPopup) + w += style()->pixelMetric(QStyle::PM_MenuButtonIndicator, &opt, this); + + QSize rawSize = style()->sizeFromContents(QStyle::CT_ToolButton, &opt, QSize(w, h), this); + QSize sizeHint = rawSize.expandedTo(QApplication::globalStrut()); + return sizeHint; +} + + + +void LabeledToolButton::resizeEvent(QResizeEvent * event) +{ + m_label->setGeometry(QRect(4, 4, width()-8, height()-8)); + QWidget::resizeEvent(event); +} diff --git a/application/widgets/LabeledToolButton.h b/application/widgets/LabeledToolButton.h new file mode 100644 index 00000000..1b74c4ee --- /dev/null +++ b/application/widgets/LabeledToolButton.h @@ -0,0 +1,37 @@ +/* Copyright 2013-2015 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include + +class QLabel; + +class LabeledToolButton : public QToolButton +{ + Q_OBJECT + + QLabel * m_label; + +public: + LabeledToolButton(QWidget * parent = 0); + + QString text() const; + void setText(const QString & text); + virtual QSize sizeHint() const; +protected: + void resizeEvent(QResizeEvent * event); +}; diff --git a/application/widgets/LineSeparator.cpp b/application/widgets/LineSeparator.cpp new file mode 100644 index 00000000..f4ee173d --- /dev/null +++ b/application/widgets/LineSeparator.cpp @@ -0,0 +1,37 @@ +#include "LineSeparator.h" + +#include +#include +#include +#include + +void LineSeparator::initStyleOption(QStyleOption *option) const +{ + option->initFrom(this); + // in a horizontal layout, the line is vertical (and vice versa) + if (m_orientation == Qt::Vertical) + option->state |= QStyle::State_Horizontal; +} + +LineSeparator::LineSeparator(QWidget *parent, Qt::Orientation orientation) + : QWidget(parent), m_orientation(orientation) +{ + setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); +} + +QSize LineSeparator::sizeHint() const +{ + QStyleOption opt; + initStyleOption(&opt); + const int extent = + style()->pixelMetric(QStyle::PM_ToolBarSeparatorExtent, &opt, parentWidget()); + return QSize(extent, extent); +} + +void LineSeparator::paintEvent(QPaintEvent *) +{ + QPainter p(this); + QStyleOption opt; + initStyleOption(&opt); + style()->drawPrimitive(QStyle::PE_IndicatorToolBarSeparator, &opt, &p, parentWidget()); +} diff --git a/application/widgets/LineSeparator.h b/application/widgets/LineSeparator.h new file mode 100644 index 00000000..9546e747 --- /dev/null +++ b/application/widgets/LineSeparator.h @@ -0,0 +1,18 @@ +#pragma once +#include + +class QStyleOption; + +class LineSeparator : public QWidget +{ + Q_OBJECT + +public: + /// Create a line separator. orientation is the orientation of the line. + explicit LineSeparator(QWidget *parent, Qt::Orientation orientation = Qt::Horizontal); + QSize sizeHint() const; + void paintEvent(QPaintEvent *); + void initStyleOption(QStyleOption *option) const; +private: + Qt::Orientation m_orientation = Qt::Horizontal; +}; diff --git a/application/widgets/MCModInfoFrame.cpp b/application/widgets/MCModInfoFrame.cpp new file mode 100644 index 00000000..2f859ed3 --- /dev/null +++ b/application/widgets/MCModInfoFrame.cpp @@ -0,0 +1,111 @@ +/* Copyright 2013-2015 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +#include "MCModInfoFrame.h" +#include "ui_MCModInfoFrame.h" +#include "dialogs/CustomMessageBox.h" + +void MCModInfoFrame::updateWithMod(Mod &m) +{ + if(m.type() == m.MOD_FOLDER) + { + clear(); + return; + } + + QString text = ""; + QString name = ""; + if(m.name().isEmpty()) name = m.mmc_id(); + else name = m.name(); + + if(m.homeurl().isEmpty()) text = name; + else text = "" + name + ""; + if(!m.authors().isEmpty()) text += " by " + m.authors(); + + setModText(text); + + if(m.description().isEmpty()) + { + setModDescription(tr("No description provided in mcmod.info")); + } + else + { + setModDescription(m.description()); + } +} + +void MCModInfoFrame::clear() +{ + setModText(tr("Select a mod to view title and authors...")); + setModDescription(tr("Select a mod to view description...")); +} + +MCModInfoFrame::MCModInfoFrame(QWidget *parent) : + QFrame(parent), + ui(new Ui::MCModInfoFrame) +{ + ui->setupUi(this); +} + +MCModInfoFrame::~MCModInfoFrame() +{ + delete ui; +} + +void MCModInfoFrame::setModText(QString text) +{ + ui->label_ModText->setText(text); +} + +void MCModInfoFrame::setModDescription(QString text) +{ + ui->label_ModDescription->setToolTip(""); + QString intermediatetext = text.trimmed(); + bool prev(false); + QChar rem('\n'); + QString finaltext; + finaltext.reserve(intermediatetext.size()); + foreach(const QChar& c, intermediatetext) + { + if(c == rem && prev){ + continue; + } + prev = c == rem; + finaltext += c; + } + QString labeltext; + labeltext.reserve(300); + if(finaltext.length() > 290) + { + ui->label_ModDescription->setOpenExternalLinks(false); + ui->label_ModDescription->setTextFormat(Qt::TextFormat::RichText); + desc = text; + labeltext.append("" + finaltext.left(287) + "..."); + QObject::connect(ui->label_ModDescription, &QLabel::linkActivated, this, &MCModInfoFrame::modDescEllipsisHandler); + } + else + { + ui->label_ModDescription->setTextFormat(Qt::TextFormat::PlainText); + labeltext.append(finaltext); + } + ui->label_ModDescription->setText(labeltext); +} +void MCModInfoFrame::modDescEllipsisHandler(const QString &link) +{ + CustomMessageBox::selectable(this, tr(""), desc)->show(); +} diff --git a/application/widgets/MCModInfoFrame.h b/application/widgets/MCModInfoFrame.h new file mode 100644 index 00000000..3f75279c --- /dev/null +++ b/application/widgets/MCModInfoFrame.h @@ -0,0 +1,46 @@ +/* Copyright 2013-2015 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include "minecraft/Mod.h" + +namespace Ui +{ +class MCModInfoFrame; +} + +class MCModInfoFrame : public QFrame +{ + Q_OBJECT + +public: + explicit MCModInfoFrame(QWidget *parent = 0); + ~MCModInfoFrame(); + + void setModText(QString text); + void setModDescription(QString text); + + void updateWithMod(Mod &m); + void clear(); + +public slots: + void modDescEllipsisHandler(const QString& link ); + +private: + Ui::MCModInfoFrame *ui; + QString desc; +}; diff --git a/application/widgets/MCModInfoFrame.ui b/application/widgets/MCModInfoFrame.ui new file mode 100644 index 00000000..60e0a65c --- /dev/null +++ b/application/widgets/MCModInfoFrame.ui @@ -0,0 +1,68 @@ + + + MCModInfoFrame + + + + 0 + 0 + 527 + 113 + + + + + 0 + 0 + + + + + 16777215 + 120 + + + + Frame + + + + + + Select a mod to view title and authors... + + + Qt::RichText + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + true + + + true + + + + + + + Select a mod to view description... + + + Qt::PlainText + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + true + + + + + + + + diff --git a/application/widgets/ModListView.cpp b/application/widgets/ModListView.cpp new file mode 100644 index 00000000..aa16ad05 --- /dev/null +++ b/application/widgets/ModListView.cpp @@ -0,0 +1,62 @@ +/* Copyright 2013-2015 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "ModListView.h" +#include +#include +#include +#include +#include + +ModListView::ModListView ( QWidget* parent ) + :QTreeView ( parent ) +{ + setAllColumnsShowFocus ( true ); + setExpandsOnDoubleClick ( false ); + setRootIsDecorated ( false ); + setSortingEnabled ( false ); + setAlternatingRowColors ( true ); + setSelectionMode ( QAbstractItemView::ContiguousSelection ); + setHeaderHidden ( false ); + setSelectionBehavior(QAbstractItemView::SelectRows); + setVerticalScrollBarPolicy ( Qt::ScrollBarAlwaysOn ); + setHorizontalScrollBarPolicy ( Qt::ScrollBarAsNeeded ); + setDropIndicatorShown(true); + setDragEnabled(true); + setDragDropMode(QAbstractItemView::DropOnly); + viewport()->setAcceptDrops(true); +} + +void ModListView::setModel ( QAbstractItemModel* model ) +{ + QTreeView::setModel ( model ); + auto head = header(); + head->setStretchLastSection(false); + // HACK: this is true for the checkbox column of mod lists + auto string = model->headerData(0,head->orientation()).toString(); + if(!string.size()) + { + head->setSectionResizeMode(0, QHeaderView::ResizeToContents); + head->setSectionResizeMode(1, QHeaderView::Stretch); + for(int i = 2; i < head->count(); i++) + head->setSectionResizeMode(i, QHeaderView::ResizeToContents); + } + else + { + head->setSectionResizeMode(0, QHeaderView::Stretch); + for(int i = 1; i < head->count(); i++) + head->setSectionResizeMode(i, QHeaderView::ResizeToContents); + } +} diff --git a/application/widgets/ModListView.h b/application/widgets/ModListView.h new file mode 100644 index 00000000..43de9811 --- /dev/null +++ b/application/widgets/ModListView.h @@ -0,0 +1,27 @@ +/* Copyright 2013-2015 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once +#include + +class Mod; + +class ModListView: public QTreeView +{ + Q_OBJECT +public: + explicit ModListView ( QWidget* parent = 0 ); + virtual void setModel ( QAbstractItemModel* model ); +}; diff --git a/application/widgets/PageContainer.cpp b/application/widgets/PageContainer.cpp new file mode 100644 index 00000000..679039a7 --- /dev/null +++ b/application/widgets/PageContainer.cpp @@ -0,0 +1,210 @@ +/* Copyright 2013-2015 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "PageContainer.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "MultiMC.h" +#include "settings/SettingsObject.h" +#include "widgets/IconLabel.h" +#include "Platform.h" +#include "PageContainer_p.h" +#include + +class PageEntryFilterModel : public QSortFilterProxyModel +{ +public: + explicit PageEntryFilterModel(QObject *parent = 0) : QSortFilterProxyModel(parent) + { + } + +protected: + bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const + { + const QString pattern = filterRegExp().pattern(); + const auto model = static_cast(sourceModel()); + const auto page = model->pages().at(sourceRow); + if (!page->shouldDisplay()) + return false; + // Regular contents check, then check page-filter. + return QSortFilterProxyModel::filterAcceptsRow(sourceRow, sourceParent); + } +}; + +PageContainer::PageContainer(BasePageProviderPtr pageProvider, QString defaultId, + QWidget *parent) + : QWidget(parent) +{ + createUI(); + m_model = new PageModel(this); + m_proxyModel = new PageEntryFilterModel(this); + int firstIndex = -1; + int counter = 0; + auto pages = pageProvider->getPages(); + for (auto page : pages) + { + page->stackIndex = m_pageStack->addWidget(dynamic_cast(page)); + page->listIndex = counter; + counter++; + if (firstIndex == -1) + { + firstIndex = page->stackIndex; + } + } + m_model->setPages(pages); + + m_proxyModel->setSourceModel(m_model); + m_proxyModel->setFilterCaseSensitivity(Qt::CaseInsensitive); + + m_pageList->setIconSize(QSize(pageIconSize, pageIconSize)); + m_pageList->setSelectionMode(QAbstractItemView::SingleSelection); + m_pageList->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel); + m_pageList->setModel(m_proxyModel); + connect(m_pageList->selectionModel(), SIGNAL(currentRowChanged(QModelIndex, QModelIndex)), + this, SLOT(currentChanged(QModelIndex))); + m_pageStack->setStackingMode(QStackedLayout::StackOne); + m_pageList->setFocus(); + // now find what we want to have selected... + auto page = m_model->findPageEntryById(defaultId); + QModelIndex index; + if (page) + { + index = m_proxyModel->mapFromSource(m_model->index(page->listIndex)); + } + else + { + index = m_proxyModel->index(0, 0); + } + if (index.isValid()) + m_pageList->setCurrentIndex(index); +} + +void PageContainer::createUI() +{ + m_pageStack = new QStackedLayout; + m_filter = new QLineEdit; + m_pageList = new PageView; + m_header = new QLabel(); + m_iconHeader = new IconLabel(this, QIcon(), QSize(24, 24)); + + QFont headerLabelFont = m_header->font(); + headerLabelFont.setBold(true); + const int pointSize = headerLabelFont.pointSize(); + if (pointSize > 0) + headerLabelFont.setPointSize(pointSize + 2); + m_header->setFont(headerLabelFont); + + QHBoxLayout *headerHLayout = new QHBoxLayout; + const int leftMargin = MMC->style()->pixelMetric(QStyle::PM_LayoutLeftMargin); + headerHLayout->addSpacerItem( + new QSpacerItem(leftMargin, 0, QSizePolicy::Fixed, QSizePolicy::Ignored)); + headerHLayout->addWidget(m_header); + headerHLayout->addSpacerItem( + new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Ignored)); + headerHLayout->addWidget(m_iconHeader); + const int rightMargin = MMC->style()->pixelMetric(QStyle::PM_LayoutRightMargin); + headerHLayout->addSpacerItem( + new QSpacerItem(rightMargin, 0, QSizePolicy::Fixed, QSizePolicy::Ignored)); + + m_pageStack->setMargin(0); + m_pageStack->addWidget(new QWidget(this)); + + m_layout = new QGridLayout; + m_layout->addLayout(headerHLayout, 0, 1, 1, 1); + m_layout->addWidget(m_pageList, 0, 0, 2, 1); + m_layout->addLayout(m_pageStack, 1, 1, 1, 1); + m_layout->setColumnStretch(1, 4); + setLayout(m_layout); +} + +void PageContainer::addButtons(QWidget *buttons) +{ + m_layout->addWidget(buttons, 2, 0, 1, 2); +} + +void PageContainer::addButtons(QLayout *buttons) +{ + m_layout->addLayout(buttons, 2, 0, 1, 2); +} + +void PageContainer::showPage(int row) +{ + if (m_currentPage) + { + m_currentPage->closed(); + } + if (row != -1) + { + m_currentPage = m_model->pages().at(row); + } + else + { + m_currentPage = nullptr; + } + if (m_currentPage) + { + m_pageStack->setCurrentIndex(m_currentPage->stackIndex); + m_header->setText(m_currentPage->displayName()); + m_iconHeader->setIcon(m_currentPage->icon()); + m_currentPage->opened(); + } + else + { + m_pageStack->setCurrentIndex(0); + m_header->setText(QString()); + m_iconHeader->setIcon(MMC->getThemedIcon("bug")); + } +} + +void PageContainer::help() +{ + if (m_currentPage) + { + QString pageId = m_currentPage->helpPage(); + if (pageId.isEmpty()) + return; + QDesktopServices::openUrl(QUrl("https://github.com/MultiMC/MultiMC5/wiki/" + pageId)); + } +} + +void PageContainer::currentChanged(const QModelIndex ¤t) +{ + showPage(current.isValid() ? m_proxyModel->mapToSource(current).row() : -1); +} + +bool PageContainer::requestClose(QCloseEvent *event) +{ + for (auto page : m_model->pages()) + { + if (!page->apply()) + return false; + } + if (m_currentPage) + { + m_currentPage->closed(); + } + return true; +} diff --git a/application/widgets/PageContainer.h b/application/widgets/PageContainer.h new file mode 100644 index 00000000..3027af36 --- /dev/null +++ b/application/widgets/PageContainer.h @@ -0,0 +1,63 @@ +/* Copyright 2013-2015 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include + +#include "pages/BasePageProvider.h" + +class QLayout; +class IconLabel; +class QSortFilterProxyModel; +class PageModel; +class QLabel; +class QListView; +class QLineEdit; +class QStackedLayout; +class QGridLayout; + +class PageContainer : public QWidget +{ + Q_OBJECT +public: + explicit PageContainer(BasePageProviderPtr pageProvider, QString defaultId = QString(), + QWidget *parent = 0); + virtual ~PageContainer() {} + + void addButtons(QWidget * buttons); + void addButtons(QLayout * buttons); + bool requestClose(QCloseEvent *event); + +private: + void createUI(); +private +slots: + void currentChanged(const QModelIndex ¤t); + void showPage(int row); + void help(); + +private: + BasePage * m_currentPage = 0; + QSortFilterProxyModel *m_proxyModel; + PageModel *m_model; + QStackedLayout *m_pageStack; + QLineEdit *m_filter; + QListView *m_pageList; + QLabel *m_header; + IconLabel *m_iconHeader; + QGridLayout *m_layout; +}; diff --git a/application/widgets/PageContainer_p.h b/application/widgets/PageContainer_p.h new file mode 100644 index 00000000..4c720e4c --- /dev/null +++ b/application/widgets/PageContainer_p.h @@ -0,0 +1,123 @@ +/* Copyright 2013-2015 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include +#include +#include + +class BasePage; +const int pageIconSize = 24; + +class PageViewDelegate : public QStyledItemDelegate +{ +public: + PageViewDelegate(QObject *parent) : QStyledItemDelegate(parent) + { + } + QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const + { + QSize size = QStyledItemDelegate::sizeHint(option, index); + size.setHeight(qMax(size.height(), 32)); + return size; + } +}; + +class PageModel : public QAbstractListModel +{ +public: + PageModel(QObject *parent = 0) : QAbstractListModel(parent) + { + QPixmap empty(pageIconSize, pageIconSize); + empty.fill(Qt::transparent); + m_emptyIcon = QIcon(empty); + } + virtual ~PageModel() {} + + int rowCount(const QModelIndex &parent = QModelIndex()) const + { + return parent.isValid() ? 0 : m_pages.size(); + } + QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const + { + switch (role) + { + case Qt::DisplayRole: + return m_pages.at(index.row())->displayName(); + case Qt::DecorationRole: + { + QIcon icon = m_pages.at(index.row())->icon(); + if (icon.isNull()) + icon = m_emptyIcon; + // HACK: fixes icon stretching on windows. TODO: report Qt bug for this + return QIcon(icon.pixmap(QSize(48,48))); + } + } + return QVariant(); + } + + void setPages(const QList &pages) + { + beginResetModel(); + m_pages = pages; + endResetModel(); + } + const QList &pages() const + { + return m_pages; + } + + BasePage * findPageEntryById(QString id) + { + for(auto page: m_pages) + { + if (page->id() == id) + return page; + } + return nullptr; + } + + QList m_pages; + QIcon m_emptyIcon; +}; + +class PageView : public QListView +{ +public: + PageView(QWidget *parent = 0) : QListView(parent) + { + setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Expanding); + setItemDelegate(new PageViewDelegate(this)); + setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + } + + virtual QSize sizeHint() const + { + int width = sizeHintForColumn(0) + frameWidth() * 2 + 5; + if (verticalScrollBar()->isVisible()) + width += verticalScrollBar()->width(); + return QSize(width, 100); + } + + virtual bool eventFilter(QObject *obj, QEvent *event) + { + if (obj == verticalScrollBar() && + (event->type() == QEvent::Show || event->type() == QEvent::Hide)) + updateGeometry(); + return QListView::eventFilter(obj, event); + } +}; diff --git a/application/widgets/ServerStatus.cpp b/application/widgets/ServerStatus.cpp new file mode 100644 index 00000000..0c11b9bf --- /dev/null +++ b/application/widgets/ServerStatus.cpp @@ -0,0 +1,129 @@ +#include "ServerStatus.h" +#include "LineSeparator.h" +#include "IconLabel.h" +#include "status/StatusChecker.h" + +#include "MultiMC.h" + +#include +#include +#include +#include +#include +#include + +ServerStatus::ServerStatus(QWidget *parent, Qt::WindowFlags f) : QWidget(parent, f) +{ + layout = new QHBoxLayout(this); + layout->setContentsMargins(0, 0, 0, 0); + goodIcon = MMC->getThemedIcon("status-good"); + yellowIcon = MMC->getThemedIcon("status-yellow"); + badIcon = MMC->getThemedIcon("status-bad"); + + addStatus("minecraft.net", tr("Web")); + addLine(); + addStatus("account.mojang.com", tr("Account")); + addLine(); + addStatus("skins.minecraft.net", tr("Skins")); + addLine(); + addStatus("authserver.mojang.com", tr("Auth")); + addLine(); + addStatus("sessionserver.mojang.com", tr("Session")); + + m_statusRefresh = new QToolButton(this); + m_statusRefresh->setCheckable(true); + m_statusRefresh->setToolButtonStyle(Qt::ToolButtonIconOnly); + m_statusRefresh->setIcon(MMC->getThemedIcon("refresh")); + layout->addWidget(m_statusRefresh); + + setLayout(layout); + + // Start status checker + m_statusChecker.reset(new StatusChecker()); + { + auto reloader = m_statusChecker.get(); + connect(reloader, &StatusChecker::statusChanged, this, &ServerStatus::StatusChanged); + connect(reloader, &StatusChecker::statusLoading, this, &ServerStatus::StatusReloading); + connect(m_statusRefresh, &QAbstractButton::clicked, this, &ServerStatus::reloadStatus); + m_statusChecker->startTimer(60000); + reloadStatus(); + } +} + +ServerStatus::~ServerStatus() +{ +} + +void ServerStatus::reloadStatus() +{ + m_statusChecker->reloadStatus(); +} + +void ServerStatus::addLine() +{ + layout->addWidget(new LineSeparator(this, Qt::Vertical)); +} + +void ServerStatus::addStatus(QString key, QString name) +{ + { + auto label = new IconLabel(this, badIcon, QSize(16, 16)); + label->setToolTip(key); + serverLabels[key] = label; + layout->addWidget(label); + } + { + auto label = new QLabel(this); + label->setText(name); + label->setToolTip(key); + layout->addWidget(label); + } +} + +void ServerStatus::setStatus(QString key, int value) +{ + if (!serverLabels.contains(key)) + return; + IconLabel *label = serverLabels[key]; + switch(value) + { + case 0: + label->setIcon(goodIcon); + break; + case 1: + label->setIcon(yellowIcon); + break; + default: + case 2: + label->setIcon(badIcon); + break; + } +} + +void ServerStatus::StatusChanged(const QMap statusEntries) +{ + auto convertStatus = [&](QString status)->int + { + if (status == "green") + return 0; + else if (status == "yellow") + return 1; + else if (status == "red") + return 2; + return 2; + } + ; + auto iter = statusEntries.begin(); + while (iter != statusEntries.end()) + { + QString key = iter.key(); + auto value = convertStatus(iter.value()); + setStatus(key, value); + iter++; + } +} + +void ServerStatus::StatusReloading(bool is_reloading) +{ + m_statusRefresh->setChecked(is_reloading); +} diff --git a/application/widgets/ServerStatus.h b/application/widgets/ServerStatus.h new file mode 100644 index 00000000..fdd43677 --- /dev/null +++ b/application/widgets/ServerStatus.h @@ -0,0 +1,37 @@ +#pragma once +#include +#include +#include +#include +#include + +class IconLabel; +class QToolButton; +class QHBoxLayout; +class StatusChecker; + +class ServerStatus: public QWidget +{ + Q_OBJECT +public: + explicit ServerStatus(QWidget *parent = nullptr, Qt::WindowFlags f = 0); + virtual ~ServerStatus(); + ; +public slots: + void reloadStatus(); + void StatusChanged(const QMap statuses); + void StatusReloading(bool is_reloading); + +private: /* methods */ + void addLine(); + void addStatus(QString key, QString name); + void setStatus(QString key, int value); +private: /* data */ + QHBoxLayout * layout = nullptr; + QToolButton *m_statusRefresh = nullptr; + QMap serverLabels; + QIcon goodIcon; + QIcon yellowIcon; + QIcon badIcon; + std::shared_ptr m_statusChecker; +}; diff --git a/application/widgets/VersionListView.cpp b/application/widgets/VersionListView.cpp new file mode 100644 index 00000000..fc0bcd0a --- /dev/null +++ b/application/widgets/VersionListView.cpp @@ -0,0 +1,147 @@ +/* Copyright 2013-2015 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include +#include +#include +#include "VersionListView.h" +#include "Common.h" + +VersionListView::VersionListView(QWidget *parent) + :QTreeView ( parent ) +{ + m_emptyString = tr("No versions are currently available."); +} + +void VersionListView::rowsInserted(const QModelIndex &parent, int start, int end) +{ + if(!m_itemCount) + viewport()->update(); + m_itemCount += end-start+1; + QTreeView::rowsInserted(parent, start, end); +} + + +void VersionListView::rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end) +{ + m_itemCount -= end-start+1; + if(!m_itemCount) + viewport()->update(); + QTreeView::rowsInserted(parent, start, end); +} + +void VersionListView::setModel(QAbstractItemModel *model) +{ + m_itemCount = model->rowCount(); + if(!m_itemCount) + viewport()->update(); + QTreeView::setModel(model); +} + +void VersionListView::reset() +{ + if(model()) + { + m_itemCount = model()->rowCount(); + } + viewport()->update(); + QTreeView::reset(); +} + +void VersionListView::setEmptyString(QString emptyString) +{ + m_emptyString = emptyString; + if(!m_itemCount) + { + viewport()->update(); + } +} + +void VersionListView::paintEvent(QPaintEvent *event) +{ + if(m_itemCount) + { + QTreeView::paintEvent(event); + } + else + { + paintInfoLabel(event); + } +} + +void VersionListView::paintInfoLabel(QPaintEvent *event) +{ + //calculate the rect for the overlay + QPainter painter(viewport()); + painter.setRenderHint(QPainter::Antialiasing, true); + QFont font("sans", 20); + font.setBold(true); + + QRect bounds = viewport()->geometry(); + bounds.moveTop(0); + QTextLayout layout(m_emptyString, font); + qreal height = 0.0; + qreal widthUsed = 0.0; + QStringList lines = viewItemTextLayout(layout, bounds.width() - 20, height, widthUsed); + QRect rect (0,0, widthUsed, height); + rect.setWidth(rect.width()+20); + rect.setHeight(rect.height()+20); + rect.moveCenter(bounds.center()); + //check if we are allowed to draw in our area + if (!event->rect().intersects(rect)) { + return; + } + //draw the letter of the topmost item semitransparent in the middle + QColor background = QApplication::palette().color(QPalette::Foreground); + QColor foreground = QApplication::palette().color(QPalette::Base); + /* + background.setAlpha(128 - scrollFade); + foreground.setAlpha(128 - scrollFade); + */ + painter.setBrush(QBrush(background)); + painter.setPen(foreground); + painter.drawRoundedRect(rect, 5.0, 5.0); + foreground.setAlpha(190); + painter.setPen(foreground); + painter.setFont(font); + painter.drawText(rect, Qt::AlignCenter, lines.join("\n")); + +} + +/* +void ModListView::setModel ( QAbstractItemModel* model ) +{ + QTreeView::setModel ( model ); + auto head = header(); + head->setStretchLastSection(false); + // HACK: this is true for the checkbox column of mod lists + auto string = model->headerData(0,head->orientation()).toString(); + if(!string.size()) + { + head->setSectionResizeMode(0, QHeaderView::ResizeToContents); + head->setSectionResizeMode(1, QHeaderView::Stretch); + for(int i = 2; i < head->count(); i++) + head->setSectionResizeMode(i, QHeaderView::ResizeToContents); + } + else + { + head->setSectionResizeMode(0, QHeaderView::Stretch); + for(int i = 1; i < head->count(); i++) + head->setSectionResizeMode(i, QHeaderView::ResizeToContents); + } +} +*/ diff --git a/application/widgets/VersionListView.h b/application/widgets/VersionListView.h new file mode 100644 index 00000000..f33a6fdb --- /dev/null +++ b/application/widgets/VersionListView.h @@ -0,0 +1,43 @@ +/* Copyright 2013-2015 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once +#include + +class Mod; + +class VersionListView : public QTreeView +{ + Q_OBJECT +public: + explicit VersionListView(QWidget *parent = 0); + virtual void paintEvent(QPaintEvent *event) override; + void setEmptyString(QString emptyString); + virtual void setModel ( QAbstractItemModel* model ); + +public slots: + virtual void reset() override; + +protected slots: + virtual void rowsAboutToBeRemoved(const QModelIndex & parent, int start, int end) override; + virtual void rowsInserted(const QModelIndex &parent, int start, int end) override; + +private: /* methods */ + void paintInfoLabel(QPaintEvent *event); + +private: /* variables */ + int m_itemCount = 0; + QString m_emptyString; +}; diff --git a/depends/javacheck/CMakeLists.txt b/depends/javacheck/CMakeLists.txt index ac8009ff..d4f29ff7 100644 --- a/depends/javacheck/CMakeLists.txt +++ b/depends/javacheck/CMakeLists.txt @@ -11,5 +11,3 @@ set(SRC ) add_jar(JavaCheck ${SRC}) - -install_jar(JavaCheck "${BINARY_DEST_DIR}/jars") diff --git a/depends/launcher/CMakeLists.txt b/depends/launcher/CMakeLists.txt index 42c77a89..7564161d 100644 --- a/depends/launcher/CMakeLists.txt +++ b/depends/launcher/CMakeLists.txt @@ -32,4 +32,3 @@ set(SRC ) add_jar(NewLaunch ${SRC}) -install_jar(NewLaunch "${BINARY_DEST_DIR}/jars") diff --git a/gui/ColumnResizer.cpp b/gui/ColumnResizer.cpp deleted file mode 100644 index 1c5597aa..00000000 --- a/gui/ColumnResizer.cpp +++ /dev/null @@ -1,202 +0,0 @@ -/* - * Copyright 2011 Aurélien Gâteau - * License: LGPL v2.1 or later (see COPYING) - */ -#include "ColumnResizer.h" - -#include -#include -#include -#include -#include -#include - -class FormLayoutWidgetItem : public QWidgetItem -{ -public: - FormLayoutWidgetItem(QWidget* widget, QFormLayout* formLayout, QFormLayout::ItemRole itemRole) - : QWidgetItem(widget) - , m_width(-1) - , m_formLayout(formLayout) - , m_itemRole(itemRole) - {} - - QSize sizeHint() const - { - QSize size = QWidgetItem::sizeHint(); - if (m_width != -1) { - size.setWidth(m_width); - } - return size; - } - - QSize minimumSize() const - { - QSize size = QWidgetItem::minimumSize(); - if (m_width != -1) { - size.setWidth(m_width); - } - return size; - } - - QSize maximumSize() const - { - QSize size = QWidgetItem::maximumSize(); - if (m_width != -1) { - size.setWidth(m_width); - } - return size; - } - - void setWidth(int width) - { - if (width != m_width) { - m_width = width; - invalidate(); - } - } - - void setGeometry(const QRect& _rect) - { - QRect rect = _rect; - int width = widget()->sizeHint().width(); - if (m_itemRole == QFormLayout::LabelRole && m_formLayout->labelAlignment() & Qt::AlignRight) { - rect.setLeft(rect.right() - width); - } - QWidgetItem::setGeometry(rect); - } - - QFormLayout* formLayout() const - { - return m_formLayout; - } - -private: - int m_width; - QFormLayout* m_formLayout; - QFormLayout::ItemRole m_itemRole; -}; - -typedef QPair GridColumnInfo; - -class ColumnResizerPrivate -{ -public: - ColumnResizerPrivate(ColumnResizer* q_ptr) - : q(q_ptr) - , m_updateTimer(new QTimer(q)) - { - m_updateTimer->setSingleShot(true); - m_updateTimer->setInterval(0); - QObject::connect(m_updateTimer, SIGNAL(timeout()), q, SLOT(updateWidth())); - } - - void scheduleWidthUpdate() - { - m_updateTimer->start(); - } - - ColumnResizer* q; - QTimer* m_updateTimer; - QList m_widgets; - QList m_wrWidgetItemList; - QList m_gridColumnInfoList; -}; - -ColumnResizer::ColumnResizer(QObject* parent) -: QObject(parent) -, d(new ColumnResizerPrivate(this)) -{} - -ColumnResizer::~ColumnResizer() -{ - delete d; -} - -void ColumnResizer::addWidget(QWidget* widget) -{ - d->m_widgets.append(widget); - widget->installEventFilter(this); - d->scheduleWidthUpdate(); -} - -void ColumnResizer::updateWidth() -{ - int width = 0; - Q_FOREACH(QWidget* widget, d->m_widgets) { - width = qMax(widget->sizeHint().width(), width); - } - Q_FOREACH(FormLayoutWidgetItem* item, d->m_wrWidgetItemList) { - item->setWidth(width); - item->formLayout()->update(); - } - Q_FOREACH(GridColumnInfo info, d->m_gridColumnInfoList) { - info.first->setColumnMinimumWidth(info.second, width); - } -} - -bool ColumnResizer::eventFilter(QObject*, QEvent* event) -{ - if (event->type() == QEvent::Resize) { - d->scheduleWidthUpdate(); - } - return false; -} - -void ColumnResizer::addWidgetsFromLayout(QLayout* layout, int column) -{ - Q_ASSERT(column >= 0); - QGridLayout* gridLayout = qobject_cast(layout); - QFormLayout* formLayout = qobject_cast(layout); - if (gridLayout) { - addWidgetsFromGridLayout(gridLayout, column); - } else if (formLayout) { - if (column > QFormLayout::SpanningRole) { - qCritical() << "column should not be more than" << QFormLayout::SpanningRole << "for QFormLayout"; - return; - } - QFormLayout::ItemRole role = static_cast(column); - addWidgetsFromFormLayout(formLayout, role); - } else { - qCritical() << "Don't know how to handle layout" << layout; - } -} - -void ColumnResizer::addWidgetsFromGridLayout(QGridLayout* layout, int column) -{ - for (int row = 0; row < layout->rowCount(); ++row) { - QLayoutItem* item = layout->itemAtPosition(row, column); - if (!item) { - continue; - } - QWidget* widget = item->widget(); - if (!widget) { - continue; - } - addWidget(widget); - } - d->m_gridColumnInfoList << GridColumnInfo(layout, column); -} - -void ColumnResizer::addWidgetsFromFormLayout(QFormLayout* layout, QFormLayout::ItemRole role) -{ - for (int row = 0; row < layout->rowCount(); ++row) { - QLayoutItem* item = layout->itemAt(row, role); - if (!item) { - continue; - } - QWidget* widget = item->widget(); - if (!widget) { - continue; - } - layout->removeItem(item); - delete item; - FormLayoutWidgetItem* newItem = new FormLayoutWidgetItem(widget, layout, role); - layout->setItem(row, role, newItem); - addWidget(widget); - d->m_wrWidgetItemList << newItem; - } -} - -#include -// vi: ts=4 sw=4 et diff --git a/gui/ColumnResizer.h b/gui/ColumnResizer.h deleted file mode 100644 index 4bbac383..00000000 --- a/gui/ColumnResizer.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2011 Aurélien Gâteau - * License: LGPL v2.1 or later (see COPYING) - */ -#pragma once - -#include - -#include -#include - -class QEvent; -class QGridLayout; -class QLayout; -class QWidget; - -class ColumnResizerPrivate; -class ColumnResizer : public QObject -{ - Q_OBJECT -public: - ColumnResizer(QObject* parent = 0); - ~ColumnResizer(); - - void addWidget(QWidget* widget); - void addWidgetsFromLayout(QLayout*, int column); - void addWidgetsFromGridLayout(QGridLayout*, int column); - void addWidgetsFromFormLayout(QFormLayout*, QFormLayout::ItemRole role); - -private Q_SLOTS: - void updateWidth(); - -protected: - bool eventFilter(QObject*, QEvent* event); - -private: - ColumnResizerPrivate* const d; -}; diff --git a/gui/ConsoleWindow.cpp b/gui/ConsoleWindow.cpp deleted file mode 100644 index a9c1f455..00000000 --- a/gui/ConsoleWindow.cpp +++ /dev/null @@ -1,260 +0,0 @@ -/* Copyright 2013-2015 MultiMC Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "ConsoleWindow.h" -#include "MultiMC.h" - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include "widgets/PageContainer.h" -#include "pages/LogPage.h" -#include "InstancePageProvider.h" - -#include "logic/icons/IconList.h" - -class LogPageProvider : public BasePageProvider -{ -public: - LogPageProvider(BasePageProviderPtr parent, BasePage * log_page) - { - m_parent = parent; - m_log_page = log_page; - } - virtual QString dialogTitle() {return "Fake";}; - virtual QList getPages() - { - auto pages = m_parent->getPages(); - pages.prepend(m_log_page); - return pages; - } -private: - BasePageProviderPtr m_parent; - BasePage * m_log_page; -}; - -ConsoleWindow::ConsoleWindow(BaseProcess *process, QWidget *parent) - : QMainWindow(parent), m_proc(process) -{ - MultiMCPlatform::fixWM_CLASS(this); - setAttribute(Qt::WA_DeleteOnClose); - - auto instance = m_proc->instance(); - auto icon = ENV.icons()->getIcon(instance->iconKey()); - QString windowTitle = tr("Console window for ") + instance->name(); - - // Set window properties - { - setWindowIcon(icon); - setWindowTitle(windowTitle); - } - - // Add page container - { - auto mainLayout = new QVBoxLayout; - auto provider = std::make_shared(m_proc->instance()); - auto baseprovider = std::dynamic_pointer_cast(provider); - auto proxy_provider = std::make_shared(baseprovider, new LogPage(m_proc)); - m_container = new PageContainer(proxy_provider, "console", this); - mainLayout->addWidget(m_container); - mainLayout->setSpacing(0); - mainLayout->setContentsMargins(0,0,0,0); - setLayout(mainLayout); - setCentralWidget(m_container); - } - - // Add custom buttons to the page container layout. - { - auto horizontalLayout = new QHBoxLayout(); - horizontalLayout->setObjectName(QStringLiteral("horizontalLayout")); - horizontalLayout->setContentsMargins(6, -1, 6, -1); - - auto btnHelp = new QPushButton(); - btnHelp->setText(tr("Help")); - horizontalLayout->addWidget(btnHelp); - connect(btnHelp, SIGNAL(clicked(bool)), m_container, SLOT(help())); - - auto spacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - horizontalLayout->addSpacerItem(spacer); - - m_killButton = new QPushButton(); - m_killButton->setText(tr("Kill Minecraft")); - horizontalLayout->addWidget(m_killButton); - connect(m_killButton, SIGNAL(clicked(bool)), SLOT(on_btnKillMinecraft_clicked())); - - m_closeButton = new QPushButton(); - m_closeButton->setText(tr("Close")); - horizontalLayout->addWidget(m_closeButton); - connect(m_closeButton, SIGNAL(clicked(bool)), SLOT(on_closeButton_clicked())); - - m_container->addButtons(horizontalLayout); - } - - // restore window state - { - auto base64State = MMC->settings()->get("ConsoleWindowState").toByteArray(); - restoreState(QByteArray::fromBase64(base64State)); - auto base64Geometry = MMC->settings()->get("ConsoleWindowGeometry").toByteArray(); - restoreGeometry(QByteArray::fromBase64(base64Geometry)); - } - - // Set up tray icon - { - m_trayIcon = new QSystemTrayIcon(icon, this); - m_trayIcon->setToolTip(windowTitle); - - connect(m_trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), - SLOT(iconActivated(QSystemTrayIcon::ActivationReason))); - m_trayIcon->show(); - } - - // Set up signal connections - connect(m_proc, SIGNAL(ended(InstancePtr, int, QProcess::ExitStatus)), this, - SLOT(onEnded(InstancePtr, int, QProcess::ExitStatus))); - connect(m_proc, SIGNAL(prelaunch_failed(InstancePtr, int, QProcess::ExitStatus)), this, - SLOT(onEnded(InstancePtr, int, QProcess::ExitStatus))); - connect(m_proc, SIGNAL(launch_failed(InstancePtr)), this, - SLOT(onLaunchFailed(InstancePtr))); - - setMayClose(false); - - if (m_proc->instance()->settings().get("ShowConsole").toBool()) - { - show(); - } -} - -void ConsoleWindow::iconActivated(QSystemTrayIcon::ActivationReason reason) -{ - switch (reason) - { - case QSystemTrayIcon::Trigger: - { - toggleConsole(); - } - default: - return; - } -} - -void ConsoleWindow::on_closeButton_clicked() -{ - close(); -} - -void ConsoleWindow::setMayClose(bool mayclose) -{ - if(mayclose) - m_closeButton->setText(tr("Close")); - else - m_closeButton->setText(tr("Hide")); - m_mayclose = mayclose; -} - -void ConsoleWindow::toggleConsole() -{ - if (isVisible()) - { - if(!isActiveWindow()) - { - activateWindow(); - return; - } - hide(); - } - else - { - show(); - } -} - -void ConsoleWindow::closeEvent(QCloseEvent *event) -{ - if (!m_mayclose) - { - toggleConsole(); - event->ignore(); - } - else if(m_container->requestClose(event)) - { - MMC->settings()->set("ConsoleWindowState", saveState().toBase64()); - MMC->settings()->set("ConsoleWindowGeometry", saveGeometry().toBase64()); - - emit isClosing(); - m_trayIcon->hide(); - event->accept(); - } -} - -void ConsoleWindow::on_btnKillMinecraft_clicked() -{ - m_killButton->setEnabled(false); - auto response = CustomMessageBox::selectable( - this, tr("Kill Minecraft?"), - tr("This can cause the instance to get corrupted and should only be used if Minecraft " - "is frozen for some reason"), - QMessageBox::Question, QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes)->exec(); - if (response == QMessageBox::Yes) - m_proc->killProcess(); - else - m_killButton->setEnabled(true); -} - -void ConsoleWindow::onEnded(InstancePtr instance, int code, QProcess::ExitStatus status) -{ - bool peacefulExit = code == 0 && status != QProcess::CrashExit; - m_killButton->setEnabled(false); - setMayClose(true); - if (instance->settings().get("AutoCloseConsole").toBool()) - { - if (peacefulExit) - { - this->close(); - return; - } - } - if (!isVisible()) - { - show(); - } - // Raise Window - if (MMC->settings()->get("RaiseConsole").toBool()) - { - raise(); - activateWindow(); - } -} - -void ConsoleWindow::onLaunchFailed(InstancePtr instance) -{ - m_killButton->setEnabled(false); - - setMayClose(true); - - if (!isVisible()) - show(); -} -ConsoleWindow::~ConsoleWindow() -{ - -} diff --git a/gui/ConsoleWindow.h b/gui/ConsoleWindow.h deleted file mode 100644 index a14cd2fc..00000000 --- a/gui/ConsoleWindow.h +++ /dev/null @@ -1,65 +0,0 @@ -/* Copyright 2013-2015 MultiMC Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include -#include -#include "logic/BaseProcess.h" - -class QPushButton; -class PageContainer; -class ConsoleWindow : public QMainWindow -{ - Q_OBJECT - -public: - explicit ConsoleWindow(BaseProcess *proc, QWidget *parent = 0); - virtual ~ConsoleWindow(); - - /** - * @brief specify if the window is allowed to close - * @param mayclose - * used to keep it alive while MC runs - */ - void setMayClose(bool mayclose); - -signals: - void isClosing(); - -private -slots: - void on_closeButton_clicked(); - void on_btnKillMinecraft_clicked(); - - void onEnded(InstancePtr instance, int code, QProcess::ExitStatus status); - void onLaunchFailed(InstancePtr instance); - - // FIXME: add handlers for the other MinecraftProcess signals (pre/post launch command - // failures) - - void iconActivated(QSystemTrayIcon::ActivationReason); - void toggleConsole(); -protected: - void closeEvent(QCloseEvent *); - -private: - BaseProcess *m_proc = nullptr; - bool m_mayclose = true; - QSystemTrayIcon *m_trayIcon = nullptr; - PageContainer *m_container = nullptr; - QPushButton *m_closeButton = nullptr; - QPushButton *m_killButton = nullptr; -}; diff --git a/gui/GuiUtil.cpp b/gui/GuiUtil.cpp deleted file mode 100644 index fcbc8acd..00000000 --- a/gui/GuiUtil.cpp +++ /dev/null @@ -1,48 +0,0 @@ -#include "GuiUtil.h" - -#include -#include -#include - -#include "dialogs/ProgressDialog.h" -#include "logic/net/PasteUpload.h" -#include "dialogs/CustomMessageBox.h" - -void GuiUtil::uploadPaste(const QString &text, QWidget *parentWidget) -{ - ProgressDialog dialog(parentWidget); - std::unique_ptr paste(new PasteUpload(parentWidget, text)); - - if (!paste->validateText()) - { - CustomMessageBox::selectable( - parentWidget, QObject::tr("Upload failed"), - QObject::tr("The log file is too big. You'll have to upload it manually."), - QMessageBox::Warning)->exec(); - return; - } - - dialog.exec(paste.get()); - if (!paste->successful()) - { - CustomMessageBox::selectable(parentWidget, QObject::tr("Upload failed"), - paste->failReason(), QMessageBox::Critical)->exec(); - } - else - { - const QString link = paste->pasteLink(); - setClipboardText(link); - QDesktopServices::openUrl(link); - CustomMessageBox::selectable( - parentWidget, QObject::tr("Upload finished"), - QObject::tr("The link to the uploaded log has been opened in " - "the default " - "browser and placed in your clipboard.").arg(link), - QMessageBox::Information)->exec(); - } -} - -void GuiUtil::setClipboardText(const QString &text) -{ - QApplication::clipboard()->setText(text); -} diff --git a/gui/GuiUtil.h b/gui/GuiUtil.h deleted file mode 100644 index 9f872f75..00000000 --- a/gui/GuiUtil.h +++ /dev/null @@ -1,9 +0,0 @@ -#pragma once - -#include - -namespace GuiUtil -{ -void uploadPaste(const QString &text, QWidget *parentWidget); -void setClipboardText(const QString &text); -} diff --git a/gui/InstancePageProvider.cpp b/gui/InstancePageProvider.cpp deleted file mode 100644 index e69de29b..00000000 diff --git a/gui/InstancePageProvider.h b/gui/InstancePageProvider.h deleted file mode 100644 index d4f7cb91..00000000 --- a/gui/InstancePageProvider.h +++ /dev/null @@ -1,52 +0,0 @@ -#pragma once -#include "logic/minecraft/OneSixInstance.h" -#include "pages/BasePage.h" -#include "pages/VersionPage.h" -#include "pages/ModFolderPage.h" -#include "pages/ResourcePackPage.h" -#include "pages/TexturePackPage.h" -#include "pages/NotesPage.h" -#include "pages/ScreenshotsPage.h" -#include "pages/InstanceSettingsPage.h" -#include "pages/OtherLogsPage.h" -#include "pages/BasePageProvider.h" -#include - -class InstancePageProvider : public QObject, public BasePageProvider -{ - Q_OBJECT -public: - explicit InstancePageProvider(InstancePtr parent) - { - inst = parent; - } - - virtual ~InstancePageProvider() {}; - virtual QList getPages() override - { - QList values; - std::shared_ptr onesix = std::dynamic_pointer_cast(inst); - if(onesix) - { - values.append(new VersionPage(onesix.get())); - values.append(new ModFolderPage(onesix.get(), onesix->loaderModList(), "mods", "loadermods", - tr("Loader mods"), "Loader-mods")); - values.append(new CoreModFolderPage(onesix.get(), onesix->coreModList(), "coremods", "coremods", - tr("Core mods"), "Core-mods")); - values.append(new ResourcePackPage(onesix.get())); - values.append(new TexturePackPage(onesix.get())); - values.append(new NotesPage(onesix.get())); - values.append(new ScreenshotsPage(PathCombine(onesix->minecraftRoot(), "screenshots"))); - values.append(new InstanceSettingsPage(onesix.get())); - values.append(new OtherLogsPage(onesix->minecraftRoot())); - } - return values; - } - - virtual QString dialogTitle() override - { - return tr("Edit Instance (%1)").arg(inst->name()); - } -protected: - InstancePtr inst; -}; diff --git a/gui/InstanceProxyModel.cpp b/gui/InstanceProxyModel.cpp deleted file mode 100644 index 09d6fd85..00000000 --- a/gui/InstanceProxyModel.cpp +++ /dev/null @@ -1,23 +0,0 @@ -#include "InstanceProxyModel.h" -#include "MultiMC.h" -#include - -InstanceProxyModel::InstanceProxyModel(QObject *parent) : GroupedProxyModel(parent) -{ -} - -bool InstanceProxyModel::subSortLessThan(const QModelIndex &left, - const QModelIndex &right) const -{ - BaseInstance *pdataLeft = static_cast(left.internalPointer()); - BaseInstance *pdataRight = static_cast(right.internalPointer()); - QString sortMode = MMC->settings()->get("InstSortMode").toString(); - if (sortMode == "LastLaunch") - { - return pdataLeft->lastLaunch() > pdataRight->lastLaunch(); - } - else - { - return QString::localeAwareCompare(pdataLeft->name(), pdataRight->name()) < 0; - } -} diff --git a/gui/InstanceProxyModel.h b/gui/InstanceProxyModel.h deleted file mode 100644 index e558efc4..00000000 --- a/gui/InstanceProxyModel.h +++ /dev/null @@ -1,13 +0,0 @@ -#include "groupview/GroupedProxyModel.h" - -/** - * A proxy model that is responsible for sorting instances into groups - */ -class InstanceProxyModel : public GroupedProxyModel -{ -public: - explicit InstanceProxyModel(QObject *parent = 0); - -protected: - virtual bool subSortLessThan(const QModelIndex &left, const QModelIndex &right) const; -}; diff --git a/gui/MainWindow.cpp b/gui/MainWindow.cpp deleted file mode 100644 index 0b0af7f4..00000000 --- a/gui/MainWindow.cpp +++ /dev/null @@ -1,2069 +0,0 @@ -/* Copyright 2013-2015 MultiMC Contributors - * - * Authors: Andrew Okin - * Peterix - * Orochimarufan - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "MultiMC.h" -#include "BuildConfig.h" - -#include "MainWindow.h" - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -class Ui_MainWindow -{ -public: - QAction *actionAddInstance; - QAction *actionViewInstanceFolder; - QAction *actionRefresh; - QAction *actionViewCentralModsFolder; - QAction *actionCheckUpdate; - QAction *actionSettings; - QAction *actionReportBug; - QAction *actionPatreon; - QAction *actionMoreNews; - QAction *actionAbout; - QAction *actionLaunchInstance; - QAction *actionRenameInstance; - QAction *actionChangeInstGroup; - QAction *actionChangeInstIcon; - QAction *actionEditInstNotes; - QAction *actionEditInstance; - QAction *actionViewSelectedInstFolder; - QAction *actionDeleteInstance; - QAction *actionConfig_Folder; - QAction *actionCAT; - QAction *actionCopyInstance; - QAction *actionManageAccounts; - QAction *actionLaunchInstanceOffline; - QAction *actionScreenshots; - QAction *actionInstanceSettings; - QAction *actionExportInstance; - QWidget *centralWidget; - QHBoxLayout *horizontalLayout; - QToolBar *mainToolBar; - QStatusBar *statusBar; - QToolBar *instanceToolBar; - QToolBar *newsToolBar; - - void setupUi(QMainWindow *MainWindow) - { - if (MainWindow->objectName().isEmpty()) - { - MainWindow->setObjectName(QStringLiteral("MainWindow")); - } - MainWindow->resize(694, 563); - MainWindow->setWindowIcon(MMC->getThemedIcon("multimc")); - actionAddInstance = new QAction(MainWindow); - actionAddInstance->setObjectName(QStringLiteral("actionAddInstance")); - actionAddInstance->setIcon(MMC->getThemedIcon("new")); - actionViewInstanceFolder = new QAction(MainWindow); - actionViewInstanceFolder->setObjectName(QStringLiteral("actionViewInstanceFolder")); - actionViewInstanceFolder->setIcon(MMC->getThemedIcon("viewfolder")); - actionRefresh = new QAction(MainWindow); - actionRefresh->setObjectName(QStringLiteral("actionRefresh")); - actionRefresh->setIcon(MMC->getThemedIcon("refresh")); - actionViewCentralModsFolder = new QAction(MainWindow); - actionViewCentralModsFolder->setObjectName(QStringLiteral("actionViewCentralModsFolder")); - actionViewCentralModsFolder->setIcon(MMC->getThemedIcon("centralmods")); - actionCheckUpdate = new QAction(MainWindow); - actionCheckUpdate->setObjectName(QStringLiteral("actionCheckUpdate")); - actionCheckUpdate->setIcon(MMC->getThemedIcon("checkupdate")); - actionSettings = new QAction(MainWindow); - actionSettings->setObjectName(QStringLiteral("actionSettings")); - actionSettings->setIcon(MMC->getThemedIcon("settings")); - actionSettings->setMenuRole(QAction::PreferencesRole); - actionReportBug = new QAction(MainWindow); - actionReportBug->setObjectName(QStringLiteral("actionReportBug")); - actionReportBug->setIcon(MMC->getThemedIcon("bug")); - actionPatreon = new QAction(MainWindow); - actionPatreon->setObjectName(QStringLiteral("actionPatreon")); - actionPatreon->setIcon(MMC->getThemedIcon("patreon")); - actionMoreNews = new QAction(MainWindow); - actionMoreNews->setObjectName(QStringLiteral("actionMoreNews")); - actionMoreNews->setIcon(MMC->getThemedIcon("news")); - actionAbout = new QAction(MainWindow); - actionAbout->setObjectName(QStringLiteral("actionAbout")); - actionAbout->setIcon(MMC->getThemedIcon("about")); - actionAbout->setMenuRole(QAction::AboutRole); - actionLaunchInstance = new QAction(MainWindow); - actionLaunchInstance->setObjectName(QStringLiteral("actionLaunchInstance")); - actionRenameInstance = new QAction(MainWindow); - actionRenameInstance->setObjectName(QStringLiteral("actionRenameInstance")); - actionChangeInstGroup = new QAction(MainWindow); - actionChangeInstGroup->setObjectName(QStringLiteral("actionChangeInstGroup")); - actionChangeInstIcon = new QAction(MainWindow); - actionChangeInstIcon->setObjectName(QStringLiteral("actionChangeInstIcon")); - actionChangeInstIcon->setEnabled(true); - actionChangeInstIcon->setIcon(QIcon(":/icons/instances/infinity")); - actionChangeInstIcon->setIconVisibleInMenu(true); - actionEditInstNotes = new QAction(MainWindow); - actionEditInstNotes->setObjectName(QStringLiteral("actionEditInstNotes")); - actionEditInstance = new QAction(MainWindow); - actionEditInstance->setObjectName(QStringLiteral("actionEditInstance")); - actionViewSelectedInstFolder = new QAction(MainWindow); - actionViewSelectedInstFolder->setObjectName(QStringLiteral("actionViewSelectedInstFolder")); - actionDeleteInstance = new QAction(MainWindow); - actionDeleteInstance->setObjectName(QStringLiteral("actionDeleteInstance")); - actionConfig_Folder = new QAction(MainWindow); - actionConfig_Folder->setObjectName(QStringLiteral("actionConfig_Folder")); - actionCAT = new QAction(MainWindow); - actionCAT->setObjectName(QStringLiteral("actionCAT")); - actionCAT->setCheckable(true); - actionCAT->setIcon(MMC->getThemedIcon("cat")); - actionCopyInstance = new QAction(MainWindow); - actionCopyInstance->setObjectName(QStringLiteral("actionCopyInstance")); - actionCopyInstance->setIcon(MMC->getThemedIcon("copy")); - actionManageAccounts = new QAction(MainWindow); - actionManageAccounts->setObjectName(QStringLiteral("actionManageAccounts")); - actionLaunchInstanceOffline = new QAction(MainWindow); - actionLaunchInstanceOffline->setObjectName(QStringLiteral("actionLaunchInstanceOffline")); - actionScreenshots = new QAction(MainWindow); - actionScreenshots->setObjectName(QStringLiteral("actionScreenshots")); - actionInstanceSettings = new QAction(MainWindow); - actionInstanceSettings->setObjectName(QStringLiteral("actionInstanceSettings")); - actionExportInstance = new QAction(MainWindow); - actionExportInstance->setObjectName(QStringLiteral("actionExportInstance")); - centralWidget = new QWidget(MainWindow); - centralWidget->setObjectName(QStringLiteral("centralWidget")); - horizontalLayout = new QHBoxLayout(centralWidget); - horizontalLayout->setSpacing(0); - horizontalLayout->setContentsMargins(11, 11, 11, 11); - horizontalLayout->setObjectName(QStringLiteral("horizontalLayout")); - horizontalLayout->setSizeConstraint(QLayout::SetDefaultConstraint); - horizontalLayout->setContentsMargins(0, 0, 0, 0); - MainWindow->setCentralWidget(centralWidget); - mainToolBar = new QToolBar(MainWindow); - mainToolBar->setObjectName(QStringLiteral("mainToolBar")); - mainToolBar->setMovable(false); - mainToolBar->setAllowedAreas(Qt::TopToolBarArea); - mainToolBar->setToolButtonStyle(Qt::ToolButtonIconOnly); - mainToolBar->setFloatable(false); - MainWindow->addToolBar(Qt::TopToolBarArea, mainToolBar); - statusBar = new QStatusBar(MainWindow); - statusBar->setObjectName(QStringLiteral("statusBar")); - MainWindow->setStatusBar(statusBar); - instanceToolBar = new QToolBar(MainWindow); - instanceToolBar->setObjectName(QStringLiteral("instanceToolBar")); - instanceToolBar->setEnabled(true); - instanceToolBar->setAllowedAreas(Qt::LeftToolBarArea|Qt::RightToolBarArea); - instanceToolBar->setIconSize(QSize(80, 80)); - instanceToolBar->setToolButtonStyle(Qt::ToolButtonIconOnly); - instanceToolBar->setFloatable(false); - MainWindow->addToolBar(Qt::RightToolBarArea, instanceToolBar); - newsToolBar = new QToolBar(MainWindow); - newsToolBar->setObjectName(QStringLiteral("newsToolBar")); - newsToolBar->setMovable(false); - newsToolBar->setAllowedAreas(Qt::BottomToolBarArea); - newsToolBar->setIconSize(QSize(16, 16)); - newsToolBar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); - newsToolBar->setFloatable(false); - MainWindow->addToolBar(Qt::BottomToolBarArea, newsToolBar); - - mainToolBar->addAction(actionAddInstance); - mainToolBar->addAction(actionCopyInstance); - mainToolBar->addSeparator(); - mainToolBar->addAction(actionViewInstanceFolder); - mainToolBar->addAction(actionViewCentralModsFolder); - mainToolBar->addAction(actionRefresh); - mainToolBar->addSeparator(); - mainToolBar->addAction(actionCheckUpdate); - mainToolBar->addAction(actionSettings); - mainToolBar->addSeparator(); - mainToolBar->addAction(actionReportBug); - mainToolBar->addAction(actionAbout); - mainToolBar->addSeparator(); - mainToolBar->addAction(actionPatreon); - mainToolBar->addAction(actionCAT); - instanceToolBar->addAction(actionChangeInstIcon); - instanceToolBar->addAction(actionLaunchInstance); - instanceToolBar->addAction(actionLaunchInstanceOffline); - instanceToolBar->addAction(actionChangeInstGroup); - instanceToolBar->addSeparator(); - instanceToolBar->addAction(actionEditInstance); - instanceToolBar->addAction(actionInstanceSettings); - instanceToolBar->addAction(actionEditInstNotes); - instanceToolBar->addAction(actionScreenshots); - instanceToolBar->addSeparator(); - instanceToolBar->addAction(actionViewSelectedInstFolder); - instanceToolBar->addAction(actionConfig_Folder); - instanceToolBar->addSeparator(); - instanceToolBar->addAction(actionExportInstance); - instanceToolBar->addAction(actionDeleteInstance); - newsToolBar->addAction(actionMoreNews); - - retranslateUi(MainWindow); - - QMetaObject::connectSlotsByName(MainWindow); - } // setupUi - - void retranslateUi(QMainWindow *MainWindow) - { - MainWindow->setWindowTitle(QApplication::translate("MainWindow", "MultiMC 5", 0)); - actionAddInstance->setText(QApplication::translate("MainWindow", "Add Instance", 0)); - actionAddInstance->setToolTip(QApplication::translate("MainWindow", "Add a new instance.", 0)); - actionAddInstance->setStatusTip(QApplication::translate("MainWindow", "Add a new instance.", 0)); - actionViewInstanceFolder->setText(QApplication::translate("MainWindow", "View Instance Folder", 0)); - actionViewInstanceFolder->setToolTip(QApplication::translate("MainWindow", "Open the instance folder in a file browser.", 0)); - actionViewInstanceFolder->setStatusTip(QApplication::translate("MainWindow", "Open the instance folder in a file browser.", 0)); - actionRefresh->setText(QApplication::translate("MainWindow", "Refresh", 0)); - actionRefresh->setToolTip(QApplication::translate("MainWindow", "Reload the instance list.", 0)); - actionRefresh->setStatusTip(QApplication::translate("MainWindow", "Reload the instance list.", 0)); - actionViewCentralModsFolder->setText(QApplication::translate("MainWindow", "View Central Mods Folder", 0)); - actionViewCentralModsFolder->setToolTip(QApplication::translate("MainWindow", "Open the central mods folder in a file browser.", 0)); - actionViewCentralModsFolder->setStatusTip(QApplication::translate("MainWindow", "Open the central mods folder in a file browser.", 0)); - actionCheckUpdate->setText(QApplication::translate("MainWindow", "Check for Updates", 0)); - actionCheckUpdate->setToolTip(QApplication::translate("MainWindow", "Check for new updates for MultiMC", 0)); - actionCheckUpdate->setStatusTip(QApplication::translate("MainWindow", "Check for new updates for MultiMC", 0)); - actionSettings->setText(QApplication::translate("MainWindow", "Settings", 0)); - actionSettings->setToolTip(QApplication::translate("MainWindow", "Change settings.", 0)); - actionSettings->setStatusTip(QApplication::translate("MainWindow", "Change settings.", 0)); - actionReportBug->setText(QApplication::translate("MainWindow", "Report a Bug", 0)); - actionReportBug->setToolTip(QApplication::translate("MainWindow", "Open the bug tracker to report a bug with MultiMC.", 0)); - actionReportBug->setStatusTip(QApplication::translate("MainWindow", "Open the bug tracker to report a bug with MultiMC.", 0)); - actionPatreon->setText(QApplication::translate("MainWindow", "Support us on Patreon!", 0)); - actionPatreon->setToolTip(QApplication::translate("MainWindow", "Open the MultiMC Patreon page.", 0)); - actionPatreon->setStatusTip(QApplication::translate("MainWindow", "Open the MultiMC Patreon page.", 0)); - actionMoreNews->setText(QApplication::translate("MainWindow", "More News", 0)); - actionMoreNews->setIconText(QApplication::translate("MainWindow", "More news...", 0)); - actionMoreNews->setToolTip(QApplication::translate("MainWindow", "Open the MultiMC development blog to read more news about MultiMC.", 0)); - actionMoreNews->setStatusTip(QApplication::translate("MainWindow", "Open the MultiMC development blog to read more news about MultiMC.", 0)); - actionAbout->setText(QApplication::translate("MainWindow", "About MultiMC", 0)); - actionAbout->setToolTip(QApplication::translate("MainWindow", "View information about MultiMC.", 0)); - actionAbout->setStatusTip(QApplication::translate("MainWindow", "About MultiMC", 0)); - actionLaunchInstance->setText(QApplication::translate("MainWindow", "Play", 0)); - actionLaunchInstance->setToolTip(QApplication::translate("MainWindow", "Launch the selected instance.", 0)); - actionLaunchInstance->setStatusTip(QApplication::translate("MainWindow", "Launch the selected instance.", 0)); - actionRenameInstance->setText(QApplication::translate("MainWindow", "Instance Name", 0)); - actionRenameInstance->setToolTip(QApplication::translate("MainWindow", "Rename the selected instance.", 0)); - actionRenameInstance->setStatusTip(QApplication::translate("MainWindow", "Rename the selected instance.", 0)); - actionChangeInstGroup->setText(QApplication::translate("MainWindow", "Change Group", 0)); - actionChangeInstGroup->setToolTip(QApplication::translate("MainWindow", "Change the selected instance's group.", 0)); - actionChangeInstGroup->setStatusTip(QApplication::translate("MainWindow", "Change the selected instance's group.", 0)); - actionChangeInstIcon->setText(QApplication::translate("MainWindow", "Change Icon", 0)); - actionChangeInstIcon->setToolTip(QApplication::translate("MainWindow", "Change the selected instance's icon.", 0)); - actionChangeInstIcon->setStatusTip(QApplication::translate("MainWindow", "Change the selected instance's icon.", 0)); - actionEditInstNotes->setText(QApplication::translate("MainWindow", "Edit Notes", 0)); - actionEditInstNotes->setToolTip(QApplication::translate("MainWindow", "Edit the notes for the selected instance.", 0)); - actionEditInstNotes->setStatusTip(QApplication::translate("MainWindow", "Edit the notes for the selected instance.", 0)); - actionEditInstance->setText(QApplication::translate("MainWindow", "Edit Instance", 0)); - actionEditInstance->setIconText(QApplication::translate("MainWindow", "Edit Instance", 0)); - actionEditInstance->setToolTip(QApplication::translate("MainWindow", "Change the instance settings, mods and versions.", 0)); - actionEditInstance->setStatusTip(QApplication::translate("MainWindow", "Change the instance settings, mods and versions.", 0)); - actionViewSelectedInstFolder->setText(QApplication::translate("MainWindow", "Instance Folder", 0)); - actionViewSelectedInstFolder->setToolTip(QApplication::translate("MainWindow", "Open the selected instance's root folder in a file browser.", 0)); - actionViewSelectedInstFolder->setStatusTip(QApplication::translate("MainWindow", "Open the selected instance's root folder in a file browser.", 0)); - actionDeleteInstance->setText(QApplication::translate("MainWindow", "Delete", 0)); - actionDeleteInstance->setToolTip(QApplication::translate("MainWindow", "Delete the selected instance.", 0)); - actionDeleteInstance->setStatusTip(QApplication::translate("MainWindow", "Delete the selected instance.", 0)); - actionConfig_Folder->setText(QApplication::translate("MainWindow", "Config Folder", 0)); - actionConfig_Folder->setToolTip(QApplication::translate("MainWindow", "Open the instance's config folder", 0)); - actionCAT->setText(QApplication::translate("MainWindow", "Meow", 0)); - actionCAT->setToolTip(QApplication::translate("MainWindow", "

    It's a fluffy kitty :3

    ", 0)); - actionCopyInstance->setText(QApplication::translate("MainWindow", "Copy Instance", 0)); - actionCopyInstance->setToolTip(QApplication::translate("MainWindow", "Copy the selected instance.", 0)); - actionCopyInstance->setStatusTip(QApplication::translate("MainWindow", "Add a new instance.", 0)); - actionManageAccounts->setText(QApplication::translate("MainWindow", "Manage Accounts", 0)); - actionManageAccounts->setToolTip(QApplication::translate("MainWindow", "Manage your Mojang or Minecraft accounts.", 0)); - actionLaunchInstanceOffline->setText(QApplication::translate("MainWindow", "Play Offline", 0)); - actionLaunchInstanceOffline->setToolTip(QApplication::translate("MainWindow", "Launch the selected instance in offline mode.", 0)); - actionLaunchInstanceOffline->setStatusTip(QApplication::translate("MainWindow", "Launch the selected instance.", 0)); - actionScreenshots->setText(QApplication::translate("MainWindow", "Manage Screenshots", 0)); - actionScreenshots->setToolTip(QApplication::translate("MainWindow", "

    View and upload screenshots for this instance

    ", 0)); - actionInstanceSettings->setText(QApplication::translate("MainWindow", "Instance Settings", 0)); - actionInstanceSettings->setToolTip(QApplication::translate("MainWindow", "Change the settings specific to the instance", 0)); - actionExportInstance->setText(QApplication::translate("MainWindow", "Export Instance", 0)); - mainToolBar->setWindowTitle(QApplication::translate("MainWindow", "Main Toolbar", 0)); - instanceToolBar->setWindowTitle(QApplication::translate("MainWindow", "Instance Toolbar", 0)); - newsToolBar->setWindowTitle(QApplication::translate("MainWindow", "News Toolbar", 0)); - } // retranslateUi - -}; - -namespace Ui { - class MainWindow: public Ui_MainWindow {}; -} // namespace Ui - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include "osutils.h" -#include "userutils.h" -#include "pathutils.h" - -#include "gui/groupview/GroupView.h" -#include "gui/groupview/InstanceDelegate.h" -#include "gui/InstanceProxyModel.h" - -#include "gui/Platform.h" - -#include "gui/widgets/LabeledToolButton.h" -#include "widgets/ServerStatus.h" - -#include "gui/dialogs/NewInstanceDialog.h" -#include "gui/dialogs/ProgressDialog.h" -#include "gui/dialogs/AboutDialog.h" -#include "gui/dialogs/VersionSelectDialog.h" -#include "gui/dialogs/CustomMessageBox.h" -#include "gui/dialogs/IconPickerDialog.h" -#include "gui/dialogs/CopyInstanceDialog.h" -#include "gui/dialogs/AccountSelectDialog.h" -#include "gui/dialogs/UpdateDialog.h" -#include "gui/dialogs/EditAccountDialog.h" -#include "gui/dialogs/NotificationDialog.h" - -#include "gui/pages/global/MultiMCPage.h" -#include "gui/pages/global/ExternalToolsPage.h" -#include "gui/pages/global/AccountListPage.h" -#include "gui/pages/global/ProxyPage.h" -#include "gui/pages/global/JavaPage.h" -#include "gui/pages/global/MinecraftPage.h" - -#include "gui/ConsoleWindow.h" -#include "pagedialog/PageDialog.h" - -#include "logic/InstanceList.h" -#include "logic/minecraft/MinecraftVersionList.h" -#include "logic/minecraft/LwjglVersionList.h" -#include "logic/icons/IconList.h" -#include "logic/java/JavaVersionList.h" - -#include "logic/auth/flows/AuthenticateTask.h" -#include "logic/auth/flows/RefreshTask.h" - -#include "logic/updater/DownloadTask.h" - -#include "logic/news/NewsChecker.h" - -#include "logic/net/URLConstants.h" -#include "logic/net/NetJob.h" -#include "logic/Env.h" - -#include "logic/BaseInstance.h" -#include "logic/BaseProcess.h" -#include "logic/java/JavaUtils.h" -#include "gui/NagUtils.h" -#include "InstancePageProvider.h" -#include "logic/minecraft/SkinUtils.h" - -//#include "logic/minecraft/LegacyInstance.h" - -#include -#include -#include -#include "logic/net/CacheDownload.h" - -#include "logic/tools/BaseProfiler.h" - -MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) -{ - MultiMCPlatform::fixWM_CLASS(this); - ui->setupUi(this); - - // initialize the news checker - m_newsChecker.reset(new NewsChecker(BuildConfig.NEWS_RSS_URL)); - - QString winTitle = - QString("MultiMC 5 - Version %1").arg(BuildConfig.printableVersionString()); - if (!BuildConfig.BUILD_PLATFORM.isEmpty()) - winTitle += " on " + BuildConfig.BUILD_PLATFORM; - setWindowTitle(winTitle); - - // OSX magic. - setUnifiedTitleAndToolBarOnMac(true); - - // Global shortcuts - { - // FIXME: This is kinda weird. and bad. We need some kind of managed shutdown. - auto q = new QShortcut(QKeySequence::Quit, this); - connect(q, SIGNAL(activated()), qApp, SLOT(quit())); - } - - // The instance action toolbar customizations - { - // disabled until we have an instance selected - ui->instanceToolBar->setEnabled(false); - - // the rename label is inside the rename tool button - renameButton = new LabeledToolButton(); - renameButton->setText("Instance Name"); - renameButton->setToolTip(ui->actionRenameInstance->toolTip()); - connect(renameButton, SIGNAL(clicked(bool)), SLOT(on_actionRenameInstance_triggered())); - ui->instanceToolBar->insertWidget(ui->actionLaunchInstance, renameButton); - ui->instanceToolBar->insertSeparator(ui->actionLaunchInstance); - renameButton->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); - } - - // Add the news label to the news toolbar. - { - newsLabel = new QToolButton(); - newsLabel->setIcon(MMC->getThemedIcon("news")); - newsLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); - newsLabel->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); - ui->newsToolBar->insertWidget(ui->actionMoreNews, newsLabel); - QObject::connect(newsLabel, &QAbstractButton::clicked, this, - &MainWindow::newsButtonClicked); - QObject::connect(m_newsChecker.get(), &NewsChecker::newsLoaded, this, - &MainWindow::updateNewsLabel); - updateNewsLabel(); - } - - // Create the instance list widget - { - view = new GroupView(ui->centralWidget); - - view->setSelectionMode(QAbstractItemView::SingleSelection); - // view->setCategoryDrawer(drawer); - // view->setCollapsibleBlocks(true); - // view->setViewMode(QListView::IconMode); - // view->setFlow(QListView::LeftToRight); - // view->setWordWrap(true); - // view->setMouseTracking(true); - // view->viewport()->setAttribute(Qt::WA_Hover); - auto delegate = new ListViewDelegate(); - view->setItemDelegate(delegate); - // view->setSpacing(10); - // view->setUniformItemWidths(true); - - // do not show ugly blue border on the mac - view->setAttribute(Qt::WA_MacShowFocusRect, false); - - view->installEventFilter(this); - - proxymodel = new InstanceProxyModel(this); - // proxymodel->setSortRole(KCategorizedSortFilterProxyModel::CategorySortRole); - // proxymodel->setFilterRole(KCategorizedSortFilterProxyModel::CategorySortRole); - // proxymodel->setDynamicSortFilter ( true ); - - // FIXME: instList should be global-ish, or at least not tied to the main window... - // maybe the application itself? - proxymodel->setSourceModel(MMC->instances().get()); - proxymodel->sort(0); - view->setFrameShape(QFrame::NoFrame); - view->setModel(proxymodel); - - view->setContextMenuPolicy(Qt::CustomContextMenu); - connect(view, SIGNAL(customContextMenuRequested(const QPoint &)), this, - SLOT(showInstanceContextMenu(const QPoint &))); - - ui->horizontalLayout->addWidget(view); - } - // The cat background - { - bool cat_enable = MMC->settings()->get("TheCat").toBool(); - ui->actionCAT->setChecked(cat_enable); - connect(ui->actionCAT, SIGNAL(toggled(bool)), SLOT(onCatToggled(bool))); - setCatBackground(cat_enable); - } - // start instance when double-clicked - connect(view, SIGNAL(doubleClicked(const QModelIndex &)), this, - SLOT(instanceActivated(const QModelIndex &))); - // track the selection -- update the instance toolbar - connect(view->selectionModel(), - SIGNAL(currentChanged(const QModelIndex &, const QModelIndex &)), this, - SLOT(instanceChanged(const QModelIndex &, const QModelIndex &))); - - // track icon changes and update the toolbar! - connect(ENV.icons().get(), SIGNAL(iconUpdated(QString)), SLOT(iconUpdated(QString))); - - // model reset -> selection is invalid. All the instance pointers are wrong. - // FIXME: stop using POINTERS everywhere - connect(MMC->instances().get(), SIGNAL(dataIsInvalid()), SLOT(selectionBad())); - - m_statusLeft = new QLabel(tr("No instance selected"), this); - m_statusRight = new ServerStatus(this); - statusBar()->addPermanentWidget(m_statusLeft, 1); - statusBar()->addPermanentWidget(m_statusRight, 0); - - // Add "manage accounts" button, right align - QWidget *spacer = new QWidget(); - spacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); - ui->mainToolBar->addWidget(spacer); - - accountMenu = new QMenu(this); - manageAccountsAction = new QAction(tr("Manage Accounts"), this); - manageAccountsAction->setCheckable(false); - connect(manageAccountsAction, SIGNAL(triggered(bool)), this, - SLOT(on_actionManageAccounts_triggered())); - - repopulateAccountsMenu(); - - accountMenuButton = new QToolButton(this); - accountMenuButton->setText(tr("Accounts")); - accountMenuButton->setMenu(accountMenu); - accountMenuButton->setPopupMode(QToolButton::InstantPopup); - accountMenuButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); - accountMenuButton->setIcon(MMC->getThemedIcon("noaccount")); - - QWidgetAction *accountMenuButtonAction = new QWidgetAction(this); - accountMenuButtonAction->setDefaultWidget(accountMenuButton); - - ui->mainToolBar->addAction(accountMenuButtonAction); - - // set up global pages dialog - { - m_globalSettingsProvider = std::make_shared(tr("Settings")); - m_globalSettingsProvider->addPage(); - m_globalSettingsProvider->addPage(); - m_globalSettingsProvider->addPage(); - m_globalSettingsProvider->addPage(); - m_globalSettingsProvider->addPage(); - m_globalSettingsProvider->addPage(); - } - - // Update the menu when the active account changes. - // Shouldn't have to use lambdas here like this, but if I don't, the compiler throws a fit. - // Template hell sucks... - connect(MMC->accounts().get(), &MojangAccountList::activeAccountChanged, [this] - { activeAccountChanged(); }); - connect(MMC->accounts().get(), &MojangAccountList::listChanged, [this] - { repopulateAccountsMenu(); }); - - // Show initial account - activeAccountChanged(); - - auto accounts = MMC->accounts(); - - QList skin_dls; - for (int i = 0; i < accounts->count(); i++) - { - auto account = accounts->at(i); - if (account != nullptr) - { - for (auto profile : account->profiles()) - { - auto meta = Env::getInstance().metacache()->resolveEntry("skins", profile.name + ".png"); - auto action = CacheDownload::make( - QUrl("http://" + URLConstants::SKINS_BASE + profile.name + ".png"), meta); - skin_dls.append(action); - meta->stale = true; - } - } - } - if (!skin_dls.isEmpty()) - { - auto job = new NetJob("Startup player skins download"); - connect(job, SIGNAL(succeeded()), SLOT(skinJobFinished())); - connect(job, SIGNAL(failed()), SLOT(skinJobFinished())); - for (auto action : skin_dls) - { - job->addNetAction(action); - } - skin_download_job.reset(job); - job->start(); - } - - // run the things that load and download other things... FIXME: this is NOT the place - // FIXME: invisible actions in the background = NOPE. - { - if (!MMC->minecraftlist()->isLoaded()) - { - m_versionLoadTask = MMC->minecraftlist()->getLoadTask(); - startTask(m_versionLoadTask); - } - if (!MMC->lwjgllist()->isLoaded()) - { - MMC->lwjgllist()->loadList(); - } - - m_newsChecker->reloadNews(); - updateNewsLabel(); - - // set up the updater object. - auto updater = MMC->updateChecker(); - connect(updater.get(), &UpdateChecker::updateAvailable, this, - &MainWindow::updateAvailable); - connect(updater.get(), &UpdateChecker::noUpdateFound, this, - &MainWindow::updateNotAvailable); - // if automatic update checks are allowed, start one. - if (MMC->settings()->get("AutoUpdate").toBool()) - { - auto updater = MMC->updateChecker(); - updater->checkForUpdate(MMC->settings()->get("UpdateChannel").toString(), false); - } - auto checker = new NotificationChecker(); - checker->setNotificationsUrl(QUrl(BuildConfig.NOTIFICATION_URL)); - checker->setApplicationChannel(BuildConfig.VERSION_CHANNEL); - checker->setApplicationPlatform(BuildConfig.BUILD_PLATFORM); - checker->setApplicationFullVersion(BuildConfig.FULL_VERSION_STR); - m_notificationChecker.reset(checker); - connect(m_notificationChecker.get(), - &NotificationChecker::notificationCheckFinished, this, - &MainWindow::notificationsChanged); - checker->checkForNotifications(); - } - - setSelectedInstanceById(MMC->settings()->get("SelectedInstance").toString()); - - // removing this looks stupid - view->setFocus(); -} - -MainWindow::~MainWindow() -{ - delete ui; - delete proxymodel; -} - -void MainWindow::skinJobFinished() -{ - activeAccountChanged(); - skin_download_job.reset(); -} - -void MainWindow::showInstanceContextMenu(const QPoint &pos) -{ - QList actions; - - QAction *actionSep = new QAction("", this); - actionSep->setSeparator(true); - - bool onInstance = view->indexAt(pos).isValid(); - if (onInstance) - { - actions = ui->instanceToolBar->actions(); - - QAction *actionVoid = new QAction(m_selectedInstance->name(), this); - actionVoid->setEnabled(false); - - QAction *actionRename = new QAction(tr("Rename"), this); - actionRename->setToolTip(ui->actionRenameInstance->toolTip()); - - QAction *actionCopyInstance = new QAction(tr("Copy instance"), this); - actionCopyInstance->setToolTip(ui->actionCopyInstance->toolTip()); - - connect(actionRename, SIGNAL(triggered(bool)), - SLOT(on_actionRenameInstance_triggered())); - connect(actionCopyInstance, SIGNAL(triggered(bool)), - SLOT(on_actionCopyInstance_triggered())); - - actions.replace(1, actionRename); - actions.prepend(actionSep); - actions.prepend(actionVoid); - actions.append(actionCopyInstance); - } - else - { - QAction *actionVoid = new QAction(tr("MultiMC"), this); - actionVoid->setEnabled(false); - - QAction *actionCreateInstance = new QAction(tr("Create instance"), this); - actionCreateInstance->setToolTip(ui->actionAddInstance->toolTip()); - - connect(actionCreateInstance, SIGNAL(triggered(bool)), - SLOT(on_actionAddInstance_triggered())); - - actions.prepend(actionSep); - actions.prepend(actionVoid); - actions.append(actionCreateInstance); - } - QMenu myMenu; - myMenu.addActions(actions); - if (onInstance) - myMenu.setEnabled(m_selectedInstance->canLaunch()); - myMenu.exec(view->mapToGlobal(pos)); -} - -void MainWindow::updateToolsMenu() -{ - if (ui->actionLaunchInstance->menu()) - { - ui->actionLaunchInstance->menu()->deleteLater(); - } - QMenu *launchMenu = new QMenu(this); - QAction *normalLaunch = launchMenu->addAction(tr("Launch")); - connect(normalLaunch, &QAction::triggered, [this]() - { doLaunch(); }); - launchMenu->addSeparator()->setText(tr("Profilers")); - for (auto profiler : MMC->profilers().values()) - { - QAction *profilerAction = launchMenu->addAction(profiler->name()); - QString error; - if (!profiler->check(&error)) - { - profilerAction->setDisabled(true); - profilerAction->setToolTip( - tr("Profiler not setup correctly. Go into settings, \"External Tools\".")); - } - else - { - connect(profilerAction, &QAction::triggered, [this, profiler]() - { doLaunch(true, profiler.get()); }); - } - } - launchMenu->addSeparator()->setText(tr("Tools")); - for (auto tool : MMC->tools().values()) - { - QAction *toolAction = launchMenu->addAction(tool->name()); - QString error; - if (!tool->check(&error)) - { - toolAction->setDisabled(true); - toolAction->setToolTip( - tr("Tool not setup correctly. Go into settings, \"External Tools\".")); - } - else - { - connect(toolAction, &QAction::triggered, [this, tool]() - { tool->createDetachedTool(m_selectedInstance, this)->run(); }); - } - } - ui->actionLaunchInstance->setMenu(launchMenu); -} - -void MainWindow::repopulateAccountsMenu() -{ - accountMenu->clear(); - - std::shared_ptr accounts = MMC->accounts(); - MojangAccountPtr active_account = accounts->activeAccount(); - - QString active_username = ""; - if (active_account != nullptr) - { - active_username = accounts->activeAccount()->username(); - } - - if (accounts->count() <= 0) - { - QAction *action = new QAction(tr("No accounts added!"), this); - action->setEnabled(false); - accountMenu->addAction(action); - - accountMenu->addSeparator(); - } - else - { - // TODO: Nicer way to iterate? - for (int i = 0; i < accounts->count(); i++) - { - MojangAccountPtr account = accounts->at(i); - - // Styling hack - QAction *section = new QAction(account->username(), this); - section->setEnabled(false); - accountMenu->addAction(section); - - for (auto profile : account->profiles()) - { - QAction *action = new QAction(profile.name, this); - action->setData(account->username()); - action->setCheckable(true); - if (active_username == account->username()) - { - action->setChecked(true); - } - - action->setIcon(SkinUtils::getFaceFromCache(profile.name)); - accountMenu->addAction(action); - connect(action, SIGNAL(triggered(bool)), SLOT(changeActiveAccount())); - } - - accountMenu->addSeparator(); - } - } - - QAction *action = new QAction(tr("No Default Account"), this); - action->setCheckable(true); - action->setIcon(MMC->getThemedIcon("noaccount")); - action->setData(""); - if (active_username.isEmpty()) - { - action->setChecked(true); - } - - accountMenu->addAction(action); - connect(action, SIGNAL(triggered(bool)), SLOT(changeActiveAccount())); - - accountMenu->addSeparator(); - accountMenu->addAction(manageAccountsAction); -} - -/* - * Assumes the sender is a QAction - */ -void MainWindow::changeActiveAccount() -{ - QAction *sAction = (QAction *)sender(); - // Profile's associated Mojang username - // Will need to change when profiles are properly implemented - if (sAction->data().type() != QVariant::Type::String) - return; - - QVariant data = sAction->data(); - QString id = ""; - if (!data.isNull()) - { - id = data.toString(); - } - - MMC->accounts()->setActiveAccount(id); - - activeAccountChanged(); -} - -void MainWindow::activeAccountChanged() -{ - repopulateAccountsMenu(); - - MojangAccountPtr account = MMC->accounts()->activeAccount(); - - if (account != nullptr && account->username() != "") - { - const AccountProfile *profile = account->currentProfile(); - if (profile != nullptr) - { - accountMenuButton->setIcon(SkinUtils::getFaceFromCache(profile->name)); - return; - } - } - - // Set the icon to the "no account" icon. - accountMenuButton->setIcon(MMC->getThemedIcon("noaccount")); -} - -bool MainWindow::eventFilter(QObject *obj, QEvent *ev) -{ - if (obj == view) - { - if (ev->type() == QEvent::KeyPress) - { - QKeyEvent *keyEvent = static_cast(ev); - switch (keyEvent->key()) - { - case Qt::Key_Enter: - case Qt::Key_Return: - on_actionLaunchInstance_triggered(); - return true; - case Qt::Key_Delete: - on_actionDeleteInstance_triggered(); - return true; - case Qt::Key_F5: - on_actionRefresh_triggered(); - return true; - case Qt::Key_F2: - on_actionRenameInstance_triggered(); - return true; - default: - break; - } - } - } - return QMainWindow::eventFilter(obj, ev); -} - -void MainWindow::updateNewsLabel() -{ - if (m_newsChecker->isLoadingNews()) - { - newsLabel->setText(tr("Loading news...")); - newsLabel->setEnabled(false); - } - else - { - QList entries = m_newsChecker->getNewsEntries(); - if (entries.length() > 0) - { - newsLabel->setText(entries[0]->title); - newsLabel->setEnabled(true); - } - else - { - newsLabel->setText(tr("No news available.")); - newsLabel->setEnabled(false); - } - } -} - -void MainWindow::updateAvailable(GoUpdate::Status status) -{ - UpdateDialog dlg; - UpdateAction action = (UpdateAction)dlg.exec(); - switch (action) - { - case UPDATE_LATER: - qDebug() << "Update will be installed later."; - break; - case UPDATE_NOW: - downloadUpdates(status); - break; - case UPDATE_ONEXIT: - downloadUpdates(status, true); - break; - } -} - -void MainWindow::updateNotAvailable() -{ - UpdateDialog dlg(false); - dlg.exec(); -} - -QList stringToIntList(const QString &string) -{ - QStringList split = string.split(',', QString::SkipEmptyParts); - QList out; - for (int i = 0; i < split.size(); ++i) - { - out.append(split.at(i).toInt()); - } - return out; -} -QString intListToString(const QList &list) -{ - QStringList slist; - for (int i = 0; i < list.size(); ++i) - { - slist.append(QString::number(list.at(i))); - } - return slist.join(','); -} -void MainWindow::notificationsChanged() -{ - QList entries = - m_notificationChecker->notificationEntries(); - QList shownNotifications = - stringToIntList(MMC->settings()->get("ShownNotifications").toString()); - for (auto it = entries.begin(); it != entries.end(); ++it) - { - NotificationChecker::NotificationEntry entry = *it; - if (!shownNotifications.contains(entry.id)) - { - NotificationDialog dialog(entry, this); - if (dialog.exec() == NotificationDialog::DontShowAgain) - { - shownNotifications.append(entry.id); - } - } - } - MMC->settings()->set("ShownNotifications", intListToString(shownNotifications)); -} - -void MainWindow::downloadUpdates(GoUpdate::Status status, bool installOnExit) -{ - qDebug() << "Downloading updates."; - // TODO: If the user chooses to update on exit, we should download updates in the - // background. - // Doing so is a bit complicated, because we'd have to make sure it finished downloading - // before actually exiting MultiMC. - ProgressDialog updateDlg(this); - status.rootPath = MMC->rootPath; - - GoUpdate::DownloadTask updateTask(status, &updateDlg); - // If the task succeeds, install the updates. - if (updateDlg.exec(&updateTask)) - { - UpdateFlags baseFlags = None; - if (BuildConfig.UPDATER_DRY_RUN) - baseFlags |= DryRun; - if (installOnExit) - MMC->installUpdates(updateTask.updateFilesDir(), baseFlags | OnExit); - else - MMC->installUpdates(updateTask.updateFilesDir(), baseFlags | RestartOnFinish); - } -} - -void MainWindow::onCatToggled(bool state) -{ - setCatBackground(state); - MMC->settings()->set("TheCat", state); -} - -void MainWindow::setCatBackground(bool enabled) -{ - if (enabled) - { - view->setStyleSheet("GroupView" - "{" - "background-image: url(:/backgrounds/kitteh);" - "background-attachment: fixed;" - "background-clip: padding;" - "background-position: top right;" - "background-repeat: none;" - "background-color:palette(base);" - "}"); - } - else - { - view->setStyleSheet(QString()); - } -} - -static QFileInfo findRecursive(const QString &dir, const QString &name) -{ - for (const auto info : QDir(dir).entryInfoList(QDir::NoDotAndDotDot | QDir::Dirs | QDir::Files, QDir::DirsLast)) - { - if (info.isFile() && info.fileName() == name) - { - return info; - } - else if (info.isDir()) - { - const QFileInfo res = findRecursive(info.absoluteFilePath(), name); - if (res.isFile() && res.exists()) - { - return res; - } - } - } - return QFileInfo(); -} - -// FIXME: eliminate, should not be needed -void MainWindow::waitForMinecraftVersions() -{ - if (!MMC->minecraftlist()->isLoaded() && m_versionLoadTask && - m_versionLoadTask->isRunning()) - { - QEventLoop waitLoop; - waitLoop.connect(m_versionLoadTask, SIGNAL(failed(QString)), SLOT(quit())); - waitLoop.connect(m_versionLoadTask, SIGNAL(succeeded()), SLOT(quit())); - waitLoop.exec(); - } -} - -void MainWindow::instanceFromZipPack(QString instName, QString instGroup, QString instIcon, QUrl url) -{ - InstancePtr newInstance; - - QString instancesDir = MMC->settings()->get("InstanceDir").toString(); - QString instDirName = DirNameFromString(instName, instancesDir); - QString instDir = PathCombine(instancesDir, instDirName); - - QString archivePath; - if (url.isLocalFile()) - { - archivePath = url.toLocalFile(); - } - else - { - const QString path = url.host() + '/' + url.path(); - auto entry = ENV.metacache()->resolveEntry("general", path); - CacheDownloadPtr dl = CacheDownload::make(url, entry); - NetJob job(tr("Modpack download")); - job.addNetAction(dl); - - // FIXME: possibly causes endless loop problems - ProgressDialog dlDialog(this); - if (dlDialog.exec(&job) != QDialog::Accepted) - { - return; - } - archivePath = entry->getFullPath(); - } - - QTemporaryDir extractTmpDir; - QDir extractDir(extractTmpDir.path()); - qDebug() << "Attempting to create instance from" << archivePath; - if (JlCompress::extractDir(archivePath, extractDir.absolutePath()).isEmpty()) - { - CustomMessageBox::selectable(this, tr("Error"), - tr("Failed to extract modpack"), QMessageBox::Warning)->show(); - return; - } - const QFileInfo instanceCfgFile = findRecursive(extractDir.absolutePath(), "instance.cfg"); - if (!instanceCfgFile.isFile() || !instanceCfgFile.exists()) - { - CustomMessageBox::selectable(this, tr("Error"), tr("Archive does not contain instance.cfg"))->show(); - return; - } - if (!copyPath(instanceCfgFile.absoluteDir().absolutePath(), instDir)) - { - CustomMessageBox::selectable(this, tr("Error"), tr("Unable to copy instance"))->show(); - return; - } - - auto error = MMC->instances()->loadInstance(newInstance, instDir); - QString errorMsg = tr("Failed to load instance %1: ").arg(instDirName); - switch (error) - { - case InstanceList::UnknownLoadError: - errorMsg += tr("Unkown error"); - CustomMessageBox::selectable(this, tr("Error"), errorMsg, QMessageBox::Warning)->show(); - return; - case InstanceList::NotAnInstance: - errorMsg += tr("Not an instance"); - CustomMessageBox::selectable(this, tr("Error"), errorMsg, QMessageBox::Warning)->show(); - return; - } - - newInstance->setName(instName); - newInstance->setIconKey(instIcon); - newInstance->setGroupInitial(instGroup); - MMC->instances()->add(InstancePtr(newInstance)); - MMC->instances()->saveGroupList(); - - finalizeInstance(newInstance); -} - -void MainWindow::instanceFromVersion(QString instName, QString instGroup, QString instIcon, BaseVersionPtr version) -{ - InstancePtr newInstance; - - QString instancesDir = MMC->settings()->get("InstanceDir").toString(); - QString instDirName = DirNameFromString(instName, instancesDir); - QString instDir = PathCombine(instancesDir, instDirName); - auto error = MMC->instances()->createInstance(newInstance, version, instDir); - QString errorMsg = tr("Failed to create instance %1: ").arg(instDirName); - switch (error) - { - case InstanceList::NoCreateError: - break; - - case InstanceList::InstExists: - { - errorMsg += tr("An instance with the given directory name already exists."); - CustomMessageBox::selectable(this, tr("Error"), errorMsg, QMessageBox::Warning)->show(); - return; - } - - case InstanceList::CantCreateDir: - { - errorMsg += tr("Failed to create the instance directory."); - CustomMessageBox::selectable(this, tr("Error"), errorMsg, QMessageBox::Warning)->show(); - return; - } - - default: - { - errorMsg += tr("Unknown instance loader error %1").arg(error); - CustomMessageBox::selectable(this, tr("Error"), errorMsg, QMessageBox::Warning)->show(); - return; - } - } - newInstance->setName(instName); - newInstance->setIconKey(instIcon); - newInstance->setGroupInitial(instGroup); - MMC->instances()->add(InstancePtr(newInstance)); - MMC->instances()->saveGroupList(); - finalizeInstance(newInstance); -} - -void MainWindow::finalizeInstance(InstancePtr inst) -{ - if (MMC->accounts()->anyAccountIsValid()) - { - ProgressDialog loadDialog(this); - auto update = inst->doUpdate(); - connect(update.get(), &Task::failed, [this](QString reason) - { - QString error = QString("Instance load failed: %1").arg(reason); - CustomMessageBox::selectable(this, tr("Error"), error, QMessageBox::Warning) - ->show(); - }); - loadDialog.exec(update.get()); - } - else - { - CustomMessageBox::selectable( - this, tr("Error"), - tr("MultiMC cannot download Minecraft or update instances unless you have at least " - "one account added.\nPlease add your Mojang or Minecraft account."), - QMessageBox::Warning)->show(); - } -} - - -void MainWindow::on_actionAddInstance_triggered() -{ - waitForMinecraftVersions(); - - NewInstanceDialog newInstDlg(this); - if (!newInstDlg.exec()) - return; - - MMC->settings()->set("LastUsedGroupForNewInstance", newInstDlg.instGroup()); - - const QUrl modpackUrl = newInstDlg.modpackUrl(); - - - if (modpackUrl.isValid()) - { - instanceFromZipPack(newInstDlg.instName(), newInstDlg.instGroup(), newInstDlg.iconKey(), modpackUrl); - } - else - { - instanceFromVersion(newInstDlg.instName(), newInstDlg.instGroup(), newInstDlg.iconKey(), newInstDlg.selectedVersion()); - } -} - -void MainWindow::on_actionCopyInstance_triggered() -{ - if (!m_selectedInstance) - return; - - CopyInstanceDialog copyInstDlg(m_selectedInstance, this); - if (!copyInstDlg.exec()) - return; - - QString instancesDir = MMC->settings()->get("InstanceDir").toString(); - QString instDirName = DirNameFromString(copyInstDlg.instName(), instancesDir); - QString instDir = PathCombine(instancesDir, instDirName); - - InstancePtr newInstance; - auto error = MMC->instances()->copyInstance(newInstance, m_selectedInstance, instDir); - - QString errorMsg = tr("Failed to create instance %1: ").arg(instDirName); - switch (error) - { - case InstanceList::NoCreateError: - newInstance->setName(copyInstDlg.instName()); - newInstance->setGroupInitial(copyInstDlg.instGroup()); - newInstance->setIconKey(copyInstDlg.iconKey()); - MMC->instances()->add(newInstance); - return; - - case InstanceList::InstExists: - { - errorMsg += tr("An instance with the given directory name already exists."); - CustomMessageBox::selectable(this, tr("Error"), errorMsg, QMessageBox::Warning)->show(); - break; - } - - case InstanceList::CantCreateDir: - { - errorMsg += tr("Failed to create the instance directory."); - CustomMessageBox::selectable(this, tr("Error"), errorMsg, QMessageBox::Warning)->show(); - break; - } - - default: - { - errorMsg += tr("Unknown instance loader error %1").arg(error); - CustomMessageBox::selectable(this, tr("Error"), errorMsg, QMessageBox::Warning)->show(); - break; - } - } -} - -void MainWindow::on_actionChangeInstIcon_triggered() -{ - if (!m_selectedInstance) - return; - - IconPickerDialog dlg(this); - dlg.exec(m_selectedInstance->iconKey()); - if (dlg.result() == QDialog::Accepted) - { - m_selectedInstance->setIconKey(dlg.selectedIconKey); - auto ico = ENV.icons()->getBigIcon(dlg.selectedIconKey); - ui->actionChangeInstIcon->setIcon(ico); - } -} - -void MainWindow::iconUpdated(QString icon) -{ - if (icon == m_currentInstIcon) - { - ui->actionChangeInstIcon->setIcon(ENV.icons()->getBigIcon(m_currentInstIcon)); - } -} - -void MainWindow::updateInstanceToolIcon(QString new_icon) -{ - m_currentInstIcon = new_icon; - ui->actionChangeInstIcon->setIcon(ENV.icons()->getBigIcon(m_currentInstIcon)); -} - -void MainWindow::setSelectedInstanceById(const QString &id) -{ - if (id.isNull()) - return; - const QModelIndex index = MMC->instances()->getInstanceIndexById(id); - if (index.isValid()) - { - QModelIndex selectionIndex = proxymodel->mapFromSource(index); - view->selectionModel()->setCurrentIndex(selectionIndex, QItemSelectionModel::ClearAndSelect); - } -} - -void MainWindow::on_actionChangeInstGroup_triggered() -{ - if (!m_selectedInstance) - return; - - bool ok = false; - QString name(m_selectedInstance->group()); - auto groups = MMC->instances()->getGroups(); - groups.insert(0, ""); - groups.sort(Qt::CaseInsensitive); - int foo = groups.indexOf(name); - - name = QInputDialog::getItem(this, tr("Group name"), tr("Enter a new group name."), groups, - foo, true, &ok); - name = name.simplified(); - if (ok) - m_selectedInstance->setGroupPost(name); -} - -void MainWindow::on_actionViewInstanceFolder_triggered() -{ - QString str = MMC->settings()->get("InstanceDir").toString(); - openDirInDefaultProgram(str); -} - -void MainWindow::on_actionRefresh_triggered() -{ - MMC->instances()->loadList(); -} - -void MainWindow::on_actionViewCentralModsFolder_triggered() -{ - openDirInDefaultProgram(MMC->settings()->get("CentralModsDir").toString(), true); -} - -void MainWindow::on_actionConfig_Folder_triggered() -{ - if (m_selectedInstance) - { - QString str = m_selectedInstance->instanceConfigFolder(); - openDirInDefaultProgram(QDir(str).absolutePath()); - } -} - -void MainWindow::on_actionCheckUpdate_triggered() -{ - auto updater = MMC->updateChecker(); - updater->checkForUpdate(MMC->settings()->get("UpdateChannel").toString(), true); -} - -template -void ShowPageDialog(T raw_provider, QWidget * parent, QString open_page = QString()) -{ - auto provider = std::dynamic_pointer_cast(raw_provider); - if(!provider) - return; - PageDialog dlg(provider, open_page, parent); - dlg.exec(); -} - -void ShowInstancePageDialog(InstancePtr instance, QWidget * parent, QString open_page = QString()) -{ - auto provider = std::make_shared(instance); - ShowPageDialog(provider, parent, open_page); -} - -void MainWindow::on_actionSettings_triggered() -{ - ShowPageDialog(m_globalSettingsProvider, this, "global-settings"); - // FIXME: quick HACK to make this work. improve, optimize. - proxymodel->invalidate(); - proxymodel->sort(0); - updateToolsMenu(); - update(); -} - -void MainWindow::on_actionInstanceSettings_triggered() -{ - ShowInstancePageDialog(m_selectedInstance, this, "settings"); -} - -void MainWindow::on_actionEditInstNotes_triggered() -{ - ShowInstancePageDialog(m_selectedInstance, this, "notes"); -} - -void MainWindow::on_actionEditInstance_triggered() -{ - ShowInstancePageDialog(m_selectedInstance, this); -} - -void MainWindow::on_actionScreenshots_triggered() -{ - ShowInstancePageDialog(m_selectedInstance, this, "screenshots"); -} - - -void MainWindow::on_actionManageAccounts_triggered() -{ - ShowPageDialog(m_globalSettingsProvider, this, "accounts"); -} - -void MainWindow::on_actionReportBug_triggered() -{ - openWebPage(QUrl("https://github.com/MultiMC/MultiMC5/issues")); -} - -void MainWindow::on_actionPatreon_triggered() -{ - openWebPage(QUrl("http://www.patreon.com/multimc")); -} - -void MainWindow::on_actionMoreNews_triggered() -{ - openWebPage(QUrl("http://multimc.org/posts.html")); -} - -void MainWindow::newsButtonClicked() -{ - QList entries = m_newsChecker->getNewsEntries(); - if (entries.count() > 0) - openWebPage(QUrl(entries[0]->link)); - else - openWebPage(QUrl("http://multimc.org/posts.html")); -} - -void MainWindow::on_actionAbout_triggered() -{ - AboutDialog dialog(this); - dialog.exec(); -} - -void MainWindow::on_mainToolBar_visibilityChanged(bool) -{ - // Don't allow hiding the main toolbar. - // This is the only way I could find to prevent it... :/ - ui->mainToolBar->setVisible(true); -} - -void MainWindow::on_actionDeleteInstance_triggered() -{ - if (m_selectedInstance) - { - auto response = CustomMessageBox::selectable( - this, tr("CAREFUL"), tr("This is permanent! Are you sure?\nAbout to delete: ") + - m_selectedInstance->name(), - QMessageBox::Question, QMessageBox::Yes | QMessageBox::No)->exec(); - if (response == QMessageBox::Yes) - { - m_selectedInstance->nuke(); - } - } -} - -#include - -bool compressSubDir(QuaZip* zip, QString dir, QString origDir, QString prefix) -{ - if (!zip) return false; - if (zip->getMode()!=QuaZip::mdCreate && zip->getMode()!=QuaZip::mdAppend && zip->getMode()!=QuaZip::mdAdd) - { - return false; - } - - QDir directory(dir); - if (!directory.exists()) return false; - - QDir origDirectory(origDir); - if (dir != origDir) - { - QuaZipFile dirZipFile(zip); - auto dirPrefix = PathCombine(prefix, origDirectory.relativeFilePath(dir)) + "/"; - if (!dirZipFile.open(QIODevice::WriteOnly, QuaZipNewInfo(dirPrefix, dir), 0, 0, 0)) - { - return false; - } - dirZipFile.close(); - } - - QFileInfoList files = directory.entryInfoList(QDir::AllDirs | QDir::NoDotAndDotDot | QDir::Hidden); - for (auto file: files) - { - if(!compressSubDir(zip,file.absoluteFilePath(),origDir, prefix)) - { - return false; - } - } - - files = directory.entryInfoList(QDir::Files); - for (auto file: files) - { - if(!file.isFile()) - { - continue; - } - - if(file.absoluteFilePath()==zip->getZipName()) - { - continue; - } - - QString filename = origDirectory.relativeFilePath(file.absoluteFilePath()); - if(prefix.size()) - { - filename = PathCombine(prefix, filename); - } - if (!JlCompress::compressFile(zip,file.absoluteFilePath(),filename)) - { - return false; - } - } - - return true; -} - -bool compressDir(QString zipFile, QString dir, QString prefix = QString()) -{ - QuaZip zip(zipFile); - QDir().mkpath(QFileInfo(zipFile).absolutePath()); - if(!zip.open(QuaZip::mdCreate)) - { - QFile::remove(zipFile); - return false; - } - - QSet added; - if (!compressSubDir(&zip,dir,dir,prefix)) - { - QFile::remove(zipFile); - return false; - } - zip.close(); - if(zip.getZipError()!=0) - { - QFile::remove(zipFile); - return false; - } - return true; -} - -void MainWindow::on_actionExportInstance_triggered() -{ - if (m_selectedInstance) - { - auto name = RemoveInvalidFilenameChars(m_selectedInstance->name()); - - const QString output = QFileDialog::getSaveFileName(this, tr("Export %1") - .arg(m_selectedInstance->name()), - PathCombine(QDir::homePath(), name + ".zip") , "Zip (*.zip)"); - if (output.isNull()) - { - return; - } - if (QFile::exists(output)) - { - int ret = QMessageBox::question(this, tr("Overwrite?"), tr("This file already exists. Do you want to overwrite it?"), - QMessageBox::No, QMessageBox::Yes); - if (ret == QMessageBox::No) - { - return; - } - } - - if (!compressDir(output, m_selectedInstance->instanceRoot(), name)) - { - QMessageBox::warning(this, tr("Error"), tr("Unable to export instance")); - } - } -} - -void MainWindow::on_actionRenameInstance_triggered() -{ - if (m_selectedInstance) - { - bool ok = false; - QString name(m_selectedInstance->name()); - name = - QInputDialog::getText(this, tr("Instance name"), tr("Enter a new instance name."), - QLineEdit::Normal, name, &ok); - - if (name.length() > 0) - { - if (ok && name.length()) - { - m_selectedInstance->setName(name); - renameButton->setText(name); - } - } - } -} - -void MainWindow::on_actionViewSelectedInstFolder_triggered() -{ - if (m_selectedInstance) - { - QString str = m_selectedInstance->instanceRoot(); - openDirInDefaultProgram(QDir(str).absolutePath()); - } -} - -void MainWindow::closeEvent(QCloseEvent *event) -{ - // Save the window state and geometry. - - MMC->settings()->set("MainWindowState", saveState().toBase64()); - MMC->settings()->set("MainWindowGeometry", saveGeometry().toBase64()); - - QMainWindow::closeEvent(event); - QApplication::exit(); -} -/* -void MainWindow::on_instanceView_customContextMenuRequested(const QPoint &pos) -{ - QMenu *instContextMenu = new QMenu("Instance", this); - - // Add the actions from the toolbar to the context menu. - instContextMenu->addActions(ui->instanceToolBar->actions()); - - instContextMenu->exec(view->mapToGlobal(pos)); -} -*/ -void MainWindow::instanceActivated(QModelIndex index) -{ - if (!index.isValid()) - return; - QString id = index.data(InstanceList::InstanceIDRole).toString(); - InstancePtr inst = MMC->instances()->getInstanceById(id); - if (!inst) - return; - - NagUtils::checkJVMArgs(inst->settings().get("JvmArgs").toString(), this); - - doLaunch(); -} - -void MainWindow::on_actionLaunchInstance_triggered() -{ - if (m_selectedInstance) - { - NagUtils::checkJVMArgs(m_selectedInstance->settings().get("JvmArgs").toString(), this); - doLaunch(); - } -} - -void MainWindow::on_actionLaunchInstanceOffline_triggered() -{ - if (m_selectedInstance) - { - NagUtils::checkJVMArgs(m_selectedInstance->settings().get("JvmArgs").toString(), this); - doLaunch(false); - } -} - -void MainWindow::doLaunch(bool online, BaseProfilerFactory *profiler) -{ - if (!m_selectedInstance) - return; - - // Find an account to use. - std::shared_ptr accounts = MMC->accounts(); - MojangAccountPtr account = accounts->activeAccount(); - if (accounts->count() <= 0) - { - // Tell the user they need to log in at least one account in order to play. - auto reply = CustomMessageBox::selectable( - this, tr("No Accounts"), - tr("In order to play Minecraft, you must have at least one Mojang or Minecraft " - "account logged in to MultiMC." - "Would you like to open the account manager to add an account now?"), - QMessageBox::Information, QMessageBox::Yes | QMessageBox::No)->exec(); - - if (reply == QMessageBox::Yes) - { - // Open the account manager. - on_actionManageAccounts_triggered(); - } - } - else if (account.get() == nullptr) - { - // If no default account is set, ask the user which one to use. - AccountSelectDialog selectDialog(tr("Which account would you like to use?"), - AccountSelectDialog::GlobalDefaultCheckbox, this); - - selectDialog.exec(); - - // Launch the instance with the selected account. - account = selectDialog.selectedAccount(); - - // If the user said to use the account as default, do that. - if (selectDialog.useAsGlobalDefault() && account.get() != nullptr) - accounts->setActiveAccount(account->username()); - } - - // if no account is selected, we bail - if (!account.get()) - return; - - // we try empty password first :) - QString password; - // we loop until the user succeeds in logging in or gives up - bool tryagain = true; - // the failure. the default failure. - QString failReason = tr("Your account is currently not logged in. Please enter " - "your password to log in again."); - - while (tryagain) - { - AuthSessionPtr session(new AuthSession()); - session->wants_online = online; - auto task = account->login(session, password); - if (task) - { - // We'll need to validate the access token to make sure the account - // is still logged in. - ProgressDialog progDialog(this); - if (online) - progDialog.setSkipButton(true, tr("Play Offline")); - progDialog.exec(task.get()); - if (!task->successful()) - { - failReason = task->failReason(); - } - } - switch (session->status) - { - case AuthSession::Undetermined: - { - qCritical() << "Received undetermined session status during login. Bye."; - tryagain = false; - break; - } - case AuthSession::RequiresPassword: - { - EditAccountDialog passDialog(failReason, this, EditAccountDialog::PasswordField); - if (passDialog.exec() == QDialog::Accepted) - { - password = passDialog.password(); - } - else - { - tryagain = false; - } - break; - } - case AuthSession::PlayableOffline: - { - // we ask the user for a player name - bool ok = false; - QString usedname = session->player_name; - QString name = QInputDialog::getText(this, tr("Player name"), - tr("Choose your offline mode player name."), - QLineEdit::Normal, session->player_name, &ok); - if (!ok) - { - tryagain = false; - break; - } - if (name.length()) - { - usedname = name; - } - session->MakeOffline(usedname); - // offline flavored game from here :3 - } - case AuthSession::PlayableOnline: - { - // update first if the server actually responded - if (session->auth_server_online) - { - updateInstance(m_selectedInstance, session, profiler); - } - else - { - launchInstance(m_selectedInstance, session, profiler); - } - tryagain = false; - } - } - } -} - -void MainWindow::updateInstance(InstancePtr instance, AuthSessionPtr session, - BaseProfilerFactory *profiler) -{ - auto updateTask = instance->doUpdate(); - if (!updateTask) - { - launchInstance(instance, session, profiler); - return; - } - ProgressDialog tDialog(this); - connect(updateTask.get(), &Task::succeeded, [this, instance, session, profiler] - { launchInstance(instance, session, profiler); }); - connect(updateTask.get(), SIGNAL(failed(QString)), SLOT(onGameUpdateError(QString))); - tDialog.exec(updateTask.get()); -} - -void MainWindow::launchInstance(InstancePtr instance, AuthSessionPtr session, - BaseProfilerFactory *profiler) -{ - Q_ASSERT_X(instance != NULL, "launchInstance", "instance is NULL"); - Q_ASSERT_X(session.get() != nullptr, "launchInstance", "session is NULL"); - - QString launchScript; - - BaseProcess *proc = instance->prepareForLaunch(session); - if (!proc) - return; - - this->hide(); - - console = new ConsoleWindow(proc); - connect(console, SIGNAL(isClosing()), this, SLOT(instanceEnded())); - - proc->setHeader("MultiMC version: " + BuildConfig.printableVersionString() + "\n\n"); - proc->arm(); - - if (profiler) - { - QString error; - if (!profiler->check(&error)) - { - QMessageBox::critical(this, tr("Error"), - tr("Couldn't start profiler: %1").arg(error)); - proc->abort(); - return; - } - BaseProfiler *profilerInstance = profiler->createProfiler(instance, this); - QProgressDialog dialog; - dialog.setMinimum(0); - dialog.setMaximum(0); - dialog.setValue(0); - dialog.setLabelText(tr("Waiting for profiler...")); - connect(&dialog, &QProgressDialog::canceled, profilerInstance, - &BaseProfiler::abortProfiling); - dialog.show(); - connect(profilerInstance, &BaseProfiler::readyToLaunch, - [&dialog, this, proc](const QString & message) - { - dialog.accept(); - QMessageBox msg; - msg.setText(tr("The game launch is delayed until you press the " - "button. This is the right time to setup the profiler, as the " - "profiler server is running now.\n\n%1").arg(message)); - msg.setWindowTitle(tr("Waiting")); - msg.setIcon(QMessageBox::Information); - msg.addButton(tr("Launch"), QMessageBox::AcceptRole); - msg.exec(); - proc->launch(); - }); - connect(profilerInstance, &BaseProfiler::abortLaunch, - [&dialog, this, proc](const QString & message) - { - dialog.accept(); - QMessageBox msg; - msg.setText(tr("Couldn't start the profiler: %1").arg(message)); - msg.setWindowTitle(tr("Error")); - msg.setIcon(QMessageBox::Critical); - msg.addButton(QMessageBox::Ok); - msg.exec(); - proc->abort(); - }); - profilerInstance->beginProfiling(proc); - dialog.exec(); - } - else - { - proc->launch(); - } -} - -void MainWindow::onGameUpdateError(QString error) -{ - CustomMessageBox::selectable(this, tr("Error updating instance"), error, - QMessageBox::Warning)->show(); -} - -void MainWindow::taskStart() -{ - // Nothing to do here yet. -} - -void MainWindow::taskEnd() -{ - QObject *sender = QObject::sender(); - if (sender == m_versionLoadTask) - m_versionLoadTask = NULL; - - sender->deleteLater(); -} - -void MainWindow::startTask(Task *task) -{ - connect(task, SIGNAL(started()), SLOT(taskStart())); - connect(task, SIGNAL(succeeded()), SLOT(taskEnd())); - connect(task, SIGNAL(failed(QString)), SLOT(taskEnd())); - task->start(); -} - -// BrowserDialog -void MainWindow::openWebPage(QUrl url) -{ - QDesktopServices::openUrl(url); -} - -void MainWindow::instanceChanged(const QModelIndex ¤t, const QModelIndex &previous) -{ - if(!current.isValid()) - { - MMC->settings()->set("SelectedInstance", QString()); - selectionBad(); - return; - } - QString id = current.data(InstanceList::InstanceIDRole).toString(); - m_selectedInstance = MMC->instances()->getInstanceById(id); - if ( m_selectedInstance ) - { - ui->instanceToolBar->setEnabled(m_selectedInstance->canLaunch()); - renameButton->setText(m_selectedInstance->name()); - m_statusLeft->setText(m_selectedInstance->getStatusbarDescription()); - updateInstanceToolIcon(m_selectedInstance->iconKey()); - - updateToolsMenu(); - - MMC->settings()->set("SelectedInstance", m_selectedInstance->id()); - } - else - { - MMC->settings()->set("SelectedInstance", QString()); - selectionBad(); - return; - } -} - -void MainWindow::selectionBad() -{ - // start by reseting everything... - m_selectedInstance = nullptr; - - statusBar()->clearMessage(); - ui->instanceToolBar->setEnabled(false); - renameButton->setText(tr("Rename Instance")); - updateInstanceToolIcon("infinity"); - - // ...and then see if we can enable the previously selected instance - setSelectedInstanceById(MMC->settings()->get("SelectedInstance").toString()); -} - -void MainWindow::instanceEnded() -{ - this->show(); -} - -void MainWindow::checkSetDefaultJava() -{ - const QString javaHack = "IntelHack"; - bool askForJava = false; - do - { - QString currentHostName = QHostInfo::localHostName(); - QString oldHostName = MMC->settings()->get("LastHostname").toString(); - if (currentHostName != oldHostName) - { - MMC->settings()->set("LastHostname", currentHostName); - askForJava = true; - break; - } - QString currentJavaPath = MMC->settings()->get("JavaPath").toString(); - if (currentJavaPath.isEmpty()) - { - askForJava = true; - break; - } - if(!currentJavaPath.contains('/')) - { - currentJavaPath = QStandardPaths::findExecutable(currentJavaPath); - } - QFile currentJavaBin(currentJavaPath); - if(!currentJavaBin.exists()) - { - askForJava = true; - break; - } - #if defined Q_OS_WIN32 - QString currentHack = MMC->settings()->get("JavaDetectionHack").toString(); - if (currentHack != javaHack) - { - CustomMessageBox::selectable( - this, tr("Java detection forced"), - tr("Because of graphics performance issues caused by Intel drivers on Windows, " - "MultiMC java detection was forced. Please select a Java " - "version.

    If you have custom java versions set for your instances, " - "make sure you use the 'javaw.exe' executable."), - QMessageBox::Warning)->exec(); - askForJava = true; - break; - } - #endif - } while (0); - - if (askForJava) - { - qDebug() << "Java path needs resetting, showing Java selection dialog..."; - - JavaVersionPtr java; - - VersionSelectDialog vselect(MMC->javalist().get(), tr("Select a Java version"), this, - false); - vselect.setResizeOn(2); - vselect.exec(); - - if (vselect.selectedVersion()) - java = std::dynamic_pointer_cast(vselect.selectedVersion()); - else - { - CustomMessageBox::selectable( - this, tr("Invalid version selected"), - tr("You didn't select a valid Java version, so MultiMC will " - "select the default. " - "You can change this in the settings dialog."), - QMessageBox::Warning)->show(); - - JavaUtils ju; - java = ju.GetDefaultJava(); - } - if (java) - { - MMC->settings()->set("JavaPath", java->path); - MMC->settings()->set("JavaDetectionHack", javaHack); - } - else - MMC->settings()->set("JavaPath", QString("java")); - } -} - -void MainWindow::checkInstancePathForProblems() -{ - QString instanceFolder = MMC->settings()->get("InstanceDir").toString(); - if (checkProblemticPathJava(QDir(instanceFolder))) - { - QMessageBox warning; - warning.setText(tr( - "Your instance folder contains \'!\' and this is known to cause Java problems!")); - warning.setInformativeText( - tr("You have now three options:
    " - " - ignore this warning
    " - " - change the instance dir in the settings
    " - " - move this installation of MultiMC5 to a different folder")); - warning.setDefaultButton(QMessageBox::Ok); - warning.exec(); - } -} diff --git a/gui/MainWindow.h b/gui/MainWindow.h deleted file mode 100644 index 13edce81..00000000 --- a/gui/MainWindow.h +++ /dev/null @@ -1,218 +0,0 @@ -/* Copyright 2013-2015 MultiMC Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include -#include -#include - -#include "logic/BaseInstance.h" -#include "logic/auth/MojangAccount.h" -#include "logic/net/NetJob.h" -#include "logic/updater/GoUpdate.h" - -class NewsChecker; -class NotificationChecker; -class QToolButton; -class InstanceProxyModel; -class LabeledToolButton; -class QLabel; -class MinecraftProcess; -class ConsoleWindow; -class BaseProfilerFactory; -class GenericPageProvider; - -namespace Ui -{ -class MainWindow; -} - -class MainWindow : public QMainWindow -{ - Q_OBJECT - -public: - explicit MainWindow(QWidget *parent = 0); - ~MainWindow(); - - void closeEvent(QCloseEvent *event); - - // Browser Dialog - void openWebPage(QUrl url); - - void checkSetDefaultJava(); - void checkInstancePathForProblems(); - -private -slots: - void onCatToggled(bool); - - void on_actionAbout_triggered(); - - void on_actionAddInstance_triggered(); - - void on_actionCopyInstance_triggered(); - - void on_actionChangeInstGroup_triggered(); - - void on_actionChangeInstIcon_triggered(); - - void on_actionViewInstanceFolder_triggered(); - - void on_actionConfig_Folder_triggered(); - - void on_actionViewSelectedInstFolder_triggered(); - - void on_actionRefresh_triggered(); - - void on_actionViewCentralModsFolder_triggered(); - - void on_actionCheckUpdate_triggered(); - - void on_actionSettings_triggered(); - - void on_actionInstanceSettings_triggered(); - - void on_actionManageAccounts_triggered(); - - void on_actionReportBug_triggered(); - - void on_actionPatreon_triggered(); - - void on_actionMoreNews_triggered(); - - void newsButtonClicked(); - - void on_mainToolBar_visibilityChanged(bool); - - // void on_instanceView_customContextMenuRequested(const QPoint &pos); - - void on_actionLaunchInstance_triggered(); - - void on_actionLaunchInstanceOffline_triggered(); - - void on_actionDeleteInstance_triggered(); - - void on_actionExportInstance_triggered(); - - void on_actionRenameInstance_triggered(); - - void on_actionEditInstance_triggered(); - - void on_actionEditInstNotes_triggered(); - - void on_actionScreenshots_triggered(); - - /*! - * Launches the currently selected instance with the default account. - * If no default account is selected, prompts the user to pick an account. - */ - void doLaunch(bool online = true, BaseProfilerFactory *profiler = 0); - - /*! - * Launches the given instance with the given account. - * This function assumes that the given account has a valid, usable access token. - */ - void launchInstance(InstancePtr instance, AuthSessionPtr session, BaseProfilerFactory *profiler = 0); - - /*! - * Prepares the given instance for launch with the given account. - */ - void updateInstance(InstancePtr instance, AuthSessionPtr account, BaseProfilerFactory *profiler = 0); - - void onGameUpdateError(QString error); - - void taskStart(); - void taskEnd(); - - void instanceEnded(); - - // called when an icon is changed in the icon model. - void iconUpdated(QString); - - void showInstanceContextMenu(const QPoint &); - - void updateToolsMenu(); - - void skinJobFinished(); -public -slots: - void instanceActivated(QModelIndex); - - void instanceChanged(const QModelIndex ¤t, const QModelIndex &previous); - - void selectionBad(); - - void startTask(Task *task); - - void updateAvailable(GoUpdate::Status status); - - void updateNotAvailable(); - - void notificationsChanged(); - - void activeAccountChanged(); - - void changeActiveAccount(); - - void repopulateAccountsMenu(); - - void updateNewsLabel(); - - /*! - * Runs the DownloadTask and installs updates. - */ - void downloadUpdates(GoUpdate::Status status, bool installOnExit = false); - -protected: - bool eventFilter(QObject *obj, QEvent *ev); - void setCatBackground(bool enabled); - void updateInstanceToolIcon(QString new_icon); - - void setSelectedInstanceById(const QString &id); - - void waitForMinecraftVersions(); - void instanceFromVersion(QString instName, QString instGroup, QString instIcon, BaseVersionPtr version); - void instanceFromZipPack(QString instName, QString instGroup, QString instIcon, QUrl url); - void finalizeInstance(InstancePtr inst); - -private: - Ui::MainWindow *ui; - class GroupView *view; - InstanceProxyModel *proxymodel; - NetJobPtr skin_download_job; - MinecraftProcess *proc; - ConsoleWindow *console; - LabeledToolButton *renameButton; - QToolButton *changeIconButton; - QToolButton *newsLabel; - - std::shared_ptr m_globalSettingsProvider; - std::shared_ptr m_newsChecker; - std::shared_ptr m_notificationChecker; - - InstancePtr m_selectedInstance; - QString m_currentInstIcon; - - Task *m_versionLoadTask; - - QLabel *m_statusLeft; - class ServerStatus *m_statusRight; - - QMenu *accountMenu; - QToolButton *accountMenuButton; - QAction *manageAccountsAction; -}; diff --git a/gui/NagUtils.cpp b/gui/NagUtils.cpp deleted file mode 100644 index 429bdfcf..00000000 --- a/gui/NagUtils.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/* Copyright 2013-2015 MultiMC Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "gui/NagUtils.h" -#include "gui/dialogs/CustomMessageBox.h" - -namespace NagUtils -{ -void checkJVMArgs(QString jvmargs, QWidget *parent) -{ - if (jvmargs.contains("-XX:PermSize=") || jvmargs.contains(QRegExp("-Xm[sx]"))) - { - CustomMessageBox::selectable( - parent, QObject::tr("JVM arguments warning"), - QObject::tr("You tried to manually set a JVM memory option (using " - " \"-XX:PermSize\", \"-Xmx\" or \"-Xms\") - there" - " are dedicated boxes for these in the settings (Java" - " tab, in the Memory group at the top).\n" - "Your manual settings will be overridden by the" - " dedicated options.\n" - "This message will be displayed until you remove them" - " from the JVM arguments."), - QMessageBox::Warning)->exec(); - } -} -} diff --git a/gui/NagUtils.h b/gui/NagUtils.h deleted file mode 100644 index d757703a..00000000 --- a/gui/NagUtils.h +++ /dev/null @@ -1,23 +0,0 @@ -/* Copyright 2013-2015 MultiMC Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include - -namespace NagUtils -{ -void checkJVMArgs(QString args, QWidget *parent); -} diff --git a/gui/Platform.h b/gui/Platform.h deleted file mode 100644 index 349e5ecc..00000000 --- a/gui/Platform.h +++ /dev/null @@ -1,32 +0,0 @@ -/* Copyright 2013-2015 MultiMC Contributors - * - * Authors: Orochimarufan - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -/** - * @file Platform.h - * This file contains platform-specific functions, tweaks and fixes. - */ - -#include - -class MultiMCPlatform -{ -public: - // X11 WM_CLASS - static void fixWM_CLASS(QWidget *widget); -}; diff --git a/gui/Platform_Other.cpp b/gui/Platform_Other.cpp deleted file mode 100644 index 197af55e..00000000 --- a/gui/Platform_Other.cpp +++ /dev/null @@ -1,27 +0,0 @@ -/* Copyright 2013-2015 MultiMC Contributors - * - * Authors: Orochimarufan - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -/** - * Stub for non-X11 platforms - * @brief MultiMCPlatform::fixWM_CLASS - * @param widget - */ -void MultiMCPlatform::fixWM_CLASS(QWidget *widget) -{ - Q_UNUSED(widget); -} diff --git a/gui/Platform_X11.cpp b/gui/Platform_X11.cpp deleted file mode 100644 index b6a6cbce..00000000 --- a/gui/Platform_X11.cpp +++ /dev/null @@ -1,62 +0,0 @@ -/* Copyright 2013-2015 MultiMC Contributors - * - * Authors: Orochimarufan - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include -#include - -static QByteArray WM_CLASS = "MultiMC5\0MultiMC5"; - -template -static inline unsigned int XcbCallVoid(xcb_void_cookie_t (*func)(xcb_connection_t *, ArgTypes...), ArgTypes2... args...) -{ - return func(QX11Info::connection(), args...).sequence; -} - -static void getAtoms(size_t n, xcb_atom_t *atoms, const char *const names[], bool create) -{ - xcb_connection_t *conn = QX11Info::connection(); - xcb_intern_atom_cookie_t *cookies = (xcb_intern_atom_cookie_t *)malloc(sizeof(xcb_intern_atom_cookie_t) * 2); - for (size_t i = 0; i < n; ++i) - cookies[i] = xcb_intern_atom(conn, create, strlen(names[i]), names[i]); - memset(atoms, 0, sizeof(xcb_atom_t) * n); - for (size_t i = 0; i < n; ++i) - { - xcb_intern_atom_reply_t *r = xcb_intern_atom_reply(conn, cookies[i], 0); - if (r) - { - atoms[i] = r->atom; - free(r); - } - } - free(cookies); -} - -static inline xcb_atom_t getAtom(const char *name, bool create=false) -{ - xcb_atom_t atom; - getAtoms(1, &atom, &name, create); - return atom; -} - -void MultiMCPlatform::fixWM_CLASS(QWidget *widget) -{ - static const xcb_atom_t atom = getAtom("WM_CLASS"); - XcbCallVoid(xcb_change_property, XCB_PROP_MODE_REPLACE, - widget->winId(), atom, XCB_ATOM_STRING, 8, WM_CLASS.count(), - WM_CLASS.constData()); -} diff --git a/gui/dialogs/AboutDialog.cpp b/gui/dialogs/AboutDialog.cpp deleted file mode 100644 index ee08beea..00000000 --- a/gui/dialogs/AboutDialog.cpp +++ /dev/null @@ -1,127 +0,0 @@ -/* Copyright 2013-2015 MultiMC Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "AboutDialog.h" -#include "ui_AboutDialog.h" -#include -#include "MultiMC.h" -#include "gui/Platform.h" -#include "BuildConfig.h" - -#include - -// Credits -// This is a hack, but I can't think of a better way to do this easily without screwing with QTextDocument... -QString getCreditsHtml(QStringList patrons) -{ - QString creditsHtml = QObject::tr( - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "

    MultiMC Developers

    " - "

    Andrew Okin <forkk@forkk.net>

    " - "

    Petr Mrázek <peterix@gmail.com>

    " - "

    Sky Welch <multimc@bunnies.io>

    " - "

    Jan (02JanDal) <02jandal@gmail.com>

    " - "" - "

    With thanks to

    " - "

    Orochimarufan <orochimarufan.x3@gmail.com>

    " - "

    TakSuyu <taksuyu@gmail.com>

    " - "

    Kilobyte <stiepen22@gmx.de>

    " - "

    Robotbrain <@skylordelros>

    " - "

    Rootbear75 <@rootbear75> (build server)

    " - "" - "

    Patreon Patrons

    " - "%1" - "" - "" - ""); - if (patrons.isEmpty()) - return creditsHtml.arg(QObject::tr("

    Loading...

    ")); - else - { - QString patronsStr; - for (QString patron : patrons) - { - patronsStr.append(QString("

    %1

    ").arg(patron)); - } - - return creditsHtml.arg(patronsStr); - } -} - -AboutDialog::AboutDialog(QWidget *parent) : QDialog(parent), ui(new Ui::AboutDialog) -{ - MultiMCPlatform::fixWM_CLASS(this); - ui->setupUi(this); - - QString chtml = getCreditsHtml(QStringList()); - ui->creditsText->setHtml(chtml); - - ui->urlLabel->setOpenExternalLinks(true); - - ui->icon->setPixmap(MMC->getThemedIcon("multimc").pixmap(64)); - ui->title->setText("MultiMC 5"); - - ui->versionLabel->setText(tr("Version") +": " + BuildConfig.printableVersionString()); - ui->platformLabel->setText(tr("Platform") +": " + BuildConfig.BUILD_PLATFORM); - - if (BuildConfig.VERSION_BUILD >= 0) - ui->buildNumLabel->setText(tr("Build Number") +": " + QString::number(BuildConfig.VERSION_BUILD)); - else - ui->buildNumLabel->setVisible(false); - - if (!BuildConfig.VERSION_CHANNEL.isEmpty()) - ui->channelLabel->setText(tr("Channel") +": " + BuildConfig.VERSION_CHANNEL); - else - ui->channelLabel->setVisible(false); - - connect(ui->closeButton, SIGNAL(clicked()), SLOT(close())); - - connect(ui->aboutQt, &QPushButton::clicked, &QApplication::aboutQt); - - loadPatronList(); -} - -AboutDialog::~AboutDialog() -{ - delete ui; -} - -void AboutDialog::loadPatronList() -{ - NetJob* job = new NetJob("Patreon Patron List"); - patronListDownload = ByteArrayDownload::make(QUrl("http://files.multimc.org/patrons.txt")); - job->addNetAction(patronListDownload); - connect(job, &NetJob::succeeded, this, &AboutDialog::patronListLoaded); - job->start(); -} - -void AboutDialog::patronListLoaded() -{ - QString patronListStr(patronListDownload->m_data); - QString html = getCreditsHtml(patronListStr.split("\n", QString::SkipEmptyParts)); - ui->creditsText->setHtml(html); -} - diff --git a/gui/dialogs/AboutDialog.h b/gui/dialogs/AboutDialog.h deleted file mode 100644 index 2022e9a3..00000000 --- a/gui/dialogs/AboutDialog.h +++ /dev/null @@ -1,47 +0,0 @@ -/* Copyright 2013-2015 MultiMC Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include - -#include - -namespace Ui -{ -class AboutDialog; -} - -class AboutDialog : public QDialog -{ - Q_OBJECT - -public: - explicit AboutDialog(QWidget *parent = 0); - ~AboutDialog(); - -public -slots: - /// Starts loading a list of Patreon patrons. - void loadPatronList(); - - /// Slot for when the patron list loads successfully. - void patronListLoaded(); - -private: - Ui::AboutDialog *ui; - - ByteArrayDownloadPtr patronListDownload; -}; diff --git a/gui/dialogs/AboutDialog.ui b/gui/dialogs/AboutDialog.ui deleted file mode 100644 index 2b5f8b78..00000000 --- a/gui/dialogs/AboutDialog.ui +++ /dev/null @@ -1,544 +0,0 @@ - - - AboutDialog - - - - 0 - 0 - 707 - 593 - - - - - 450 - 400 - - - - About MultiMC - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 0 - - - - - 64 - 64 - - - - - 64 - 64 - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 15 - - - - MultiMC 5 - - - Qt::AlignCenter - - - - - - - 0 - - - - - 0 - 0 - 695 - 297 - - - - About - - - - - - Version: - - - Qt::AlignCenter - - - - - - - Platform: - - - Qt::AlignCenter - - - - - - - Build Number: - - - Qt::AlignCenter - - - - - - - Channel: - - - Qt::AlignCenter - - - - - - - true - - - <html><head/><body><p>MultiMC is a custom launcher that makes managing Minecraft easier by allowing you to have multiple instances of Minecraft at once.</p></body></html> - - - Qt::AlignCenter - - - true - - - - - - - - 8 - true - - - - © 2013-2015 MultiMC Contributors - - - Qt::AlignCenter - - - - - - - - 10 - - - - <html><head/><body><p><a href="http://github.com/MultiMC/MultiMC5"><span style=" text-decoration: underline; color:#0000ff;">http://github.com/MultiMC/MultiMC5</span></a></p></body></html> - - - Qt::AlignCenter - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - 0 - 0 - 695 - 297 - - - - Credits - - - - - - true - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Oxygen-Sans'; font-size:11pt; font-weight:400; font-style:normal;"> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif'; font-size:9pt;"><br /></p></body></html> - - - Qt::TextBrowserInteraction - - - - - - - No Language file loaded. - - - true - - - - - - - - - 0 - 0 - 695 - 297 - - - - License - - - - - - - 0 - 0 - - - - - DejaVu Sans Mono - - - - true - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'DejaVu Sans Mono'; font-size:11pt; font-weight:400; font-style:normal;"> -<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Bitstream Vera Sans'; font-size:18pt; font-weight:600;">MultiMC</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">Copyright 2012-2014 MultiMC Contributors</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">you may not use this file except in compliance with the License.</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">You may obtain a copy of the License at</span></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10pt;"><br /></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;"> http://www.apache.org/licenses/LICENSE-2.0</span></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10pt;"><br /></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">Unless required by applicable law or agreed to in writing, software</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">See the License for the specific language governing permissions and</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">limitations under the License.</span></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10pt;"><br /></p> -<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Bitstream Vera Sans'; font-size:18pt; font-weight:600;">QSLog</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">Copyright (c) 2010, Razvan Petru</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">All rights reserved.</span></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"><br /></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">Redistribution and use in source and binary forms, with or without modification,</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">are permitted provided that the following conditions are met:</span></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"><br /></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">* Redistributions of source code must retain the above copyright notice, this</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> list of conditions and the following disclaimer.</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">* Redistributions in binary form must reproduce the above copyright notice, this</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> list of conditions and the following disclaimer in the documentation and/or other</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> materials provided with the distribution.</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">* The name of the contributors may not be used to endorse or promote products</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> derived from this software without specific prior written permission.</span></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"><br /></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &quot;AS IS&quot; AND</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">OF THE POSSIBILITY OF SUCH DAMAGE.</span></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"><br /></p> -<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Bitstream Vera Sans'; font-size:18pt; font-weight:600;">Group View (instance view)</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> /*</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> * Copyright (C) 2007 Rafael Fernández López &lt;ereslibre@kde.org&gt;</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> * Copyright (C) 2007 John Tapsell &lt;tapsell@kde.org&gt;</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> *</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> * This library is free software; you can redistribute it and/or</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> * modify it under the terms of the GNU Library General Public</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> * License as published by the Free Software Foundation; either</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> * version 2 of the License, or (at your option) any later version.</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> *</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> * This library is distributed in the hope that it will be useful,</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> * Library General Public License for more details.</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> *</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> * You should have received a copy of the GNU Library General Public License</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> * along with this library; see the file COPYING.LIB. If not, write to</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> * Boston, MA 02110-1301, USA.</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> */</span></p> -<p align="center" style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"><br /></p> -<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Bitstream Vera Sans'; font-size:18pt; font-weight:600;">Batch icon set</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">You are free to use Batch (the &quot;icon set&quot;) or any part thereof (the &quot;icons&quot;)</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">in any personal, open-source or commercial work without obligation of payment</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">(monetary or otherwise) or attribution. Do not sell the icon set, host</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">the icon set or rent the icon set (either in existing or modified form).</span></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"><br /></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">While attribution is optional, it is always appreciated.</span></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"><br /></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">Intellectual property rights are not transferred with the download of the icons.</span></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"><br /></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL ADAM WHITCROFT</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL,</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THE USE OF THE ICONS,</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.</span></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10pt;"><br /></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://adamwhitcroft.com/batch/"><span style=" text-decoration: underline; color:#68a0df;">http://adamwhitcroft.com/batch/</span></a></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10pt;"><br /></p> -<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Bitstream Vera Sans'; font-size:18pt; font-weight:600;">Pack200</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">The GNU General Public License (GPL)</span></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"><br /></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">Version 2, June 1991</span></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"><br /></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">+ &quot;CLASSPATH&quot; EXCEPTION TO THE GPL</span></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"><br /></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">Certain source files distributed by Oracle America and/or its affiliates are</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">subject to the following clarification and special exception to the GPL, but</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">only where Oracle has expressly included in the particular source file's header</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">the words &quot;Oracle designates this particular file as subject to the &quot;Classpath&quot;</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">exception as provided by Oracle in the LICENSE file that accompanied this code.&quot;</span></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"><br /></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> Linking this library statically or dynamically with other modules is making</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> a combined work based on this library. Thus, the terms and conditions of</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> the GNU General Public License cover the whole combination.</span></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"><br /></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> As a special exception, the copyright holders of this library give you</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> permission to link this library with independent modules to produce an</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> executable, regardless of the license terms of these independent modules,</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> and to copy and distribute the resulting executable under terms of your</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> choice, provided that you also meet, for each linked independent module,</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> the terms and conditions of the license of that module. An independent</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> module is a module which is not derived from or based on this library. If</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> you modify this library, you may extend this exception to your version of</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> the library, but you are not obligated to do so. If you do not wish to do</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> so, delete this exception statement from your version.</span></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"><br /></p> -<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Bitstream Vera Sans'; font-size:18pt; font-weight:600;">Quazip</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">Copyright (C) 2005-2011 Sergey A. Tachenov</span></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"><br /></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">This program is free software; you can redistribute it and/or modify it</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">under the terms of the GNU Lesser General Public License as published by</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">the Free Software Foundation; either version 2 of the License, or (at</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">your option) any later version.</span></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"><br /></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">This program is distributed in the hope that it will be useful, but</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">WITHOUT ANY WARRANTY; without even the implied warranty of</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">General Public License for more details.</span></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"><br /></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">You should have received a copy of the GNU Lesser General Public License</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">along with this program; if not, write to the Free Software Foundation,</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA</span></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"><br /></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">See COPYING file for the full LGPL text.</span></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"><br /></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">Original ZIP package is copyrighted by Gilles Vollant, see</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">quazip/(un)zip.h files for details, basically it's zlib license.</span></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"><br /></p> -<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Bitstream Vera Sans'; font-size:18pt; font-weight:600;">xz-minidec</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">/*</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> * XZ decompressor</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> *</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> * Authors: Lasse Collin &lt;lasse.collin@tukaani.org&gt;</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> * Igor Pavlov &lt;http://7-zip.org/&gt;</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> *</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> * This file has been put into the public domain.</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> * You can do whatever you want with this file.</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> */</span></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"><br /></p> -<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Bitstream Vera Sans'; font-size:18pt; font-weight:600;">Java IconLoader class</span></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">Copyright (c) 2011, Chris Molini</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">All rights reserved.</span></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"><br /></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">Redistribution and use in source and binary forms, with or without</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">modification, are permitted provided that the following conditions are met:</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> * Redistributions of source code must retain the above copyright</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> notice, this list of conditions and the following disclaimer.</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> * Redistributions in binary form must reproduce the above copyright</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> notice, this list of conditions and the following disclaimer in the</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> documentation and/or other materials provided with the distribution.</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> * Neither the name of the &lt;organization&gt; nor the</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> names of its contributors may be used to endorse or promote products</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> derived from this software without specific prior written permission.</span></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"><br /></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &quot;AS IS&quot; AND</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">DISCLAIMED. IN NO EVENT SHALL &lt;COPYRIGHT HOLDER&gt; BE LIABLE FOR ANY</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</span></p> -<p align="center" style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"><br /></p> -<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Bitstream Vera Sans'; font-size:18pt; font-weight:600;">ColumnResizer</span></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"><br /></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">/*</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> * Copyright 2011 Aurélien Gâteau &lt;agateau@kde.org&gt;</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> * License: LGPL v2.1 or later (see COPYING)</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> */</span></p></body></html> - - - Qt::TextBrowserInteraction - - - - - - - - - 0 - 0 - 695 - 297 - - - - Forking/Redistribution - - - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Oxygen-Sans'; font-size:11pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Bitstream Vera Sans';">We keep MultiMC open source because we think it's important to be able to see the source code for a project like this, and we do so using the Apache license.</span></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Bitstream Vera Sans';"><br /></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Bitstream Vera Sans';">Part of the reason for using the Apache license is we don't want people using the &quot;MultiMC&quot; name when redistributing the project. This means people must take the time to go through the source code and remove all references to &quot;MultiMC&quot;, including but not limited to the project icon and the title of windows, (no *MultiMC-fork* in the title).</span></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Bitstream Vera Sans';"><br /></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Bitstream Vera Sans';">The Apache license covers reasonable use for the name - a mention of the project's origins in the About dialog and the license is acceptable. However, it should be abundantly clear that the project is a fork </span><span style=" font-family:'Bitstream Vera Sans'; font-weight:600;">without</span><span style=" font-family:'Bitstream Vera Sans';"> implying that you have our blessing.</span></p></body></html> - - - Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - - - - - - - - - - - - false - - - About Qt - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Close - - - - - - - - - - - - diff --git a/gui/dialogs/AccountSelectDialog.cpp b/gui/dialogs/AccountSelectDialog.cpp deleted file mode 100644 index 6ae60738..00000000 --- a/gui/dialogs/AccountSelectDialog.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/* Copyright 2013-2015 MultiMC Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "AccountSelectDialog.h" -#include "ui_AccountSelectDialog.h" - -#include - -#include - -#include - -#include - -AccountSelectDialog::AccountSelectDialog(const QString &message, int flags, QWidget *parent) - : QDialog(parent), ui(new Ui::AccountSelectDialog) -{ - ui->setupUi(this); - - m_accounts = MMC->accounts(); - ui->listView->setModel(m_accounts.get()); - ui->listView->hideColumn(MojangAccountList::ActiveColumn); - - // Set the message label. - ui->msgLabel->setVisible(!message.isEmpty()); - ui->msgLabel->setText(message); - - // Flags... - ui->globalDefaultCheck->setVisible(flags & GlobalDefaultCheckbox); - ui->instDefaultCheck->setVisible(flags & InstanceDefaultCheckbox); - qDebug() << flags; - - // Select the first entry in the list. - ui->listView->setCurrentIndex(ui->listView->model()->index(0, 0)); - - connect(ui->listView, SIGNAL(doubleClicked(QModelIndex)), SLOT(on_buttonBox_accepted())); -} - -AccountSelectDialog::~AccountSelectDialog() -{ - delete ui; -} - -MojangAccountPtr AccountSelectDialog::selectedAccount() const -{ - return m_selected; -} - -bool AccountSelectDialog::useAsGlobalDefault() const -{ - return ui->globalDefaultCheck->isChecked(); -} - -bool AccountSelectDialog::useAsInstDefaullt() const -{ - return ui->instDefaultCheck->isChecked(); -} - -void AccountSelectDialog::on_buttonBox_accepted() -{ - QModelIndexList selection = ui->listView->selectionModel()->selectedIndexes(); - if (selection.size() > 0) - { - QModelIndex selected = selection.first(); - m_selected = selected.data(MojangAccountList::PointerRole).value(); - } - close(); -} - -void AccountSelectDialog::on_buttonBox_rejected() -{ - close(); -} diff --git a/gui/dialogs/AccountSelectDialog.h b/gui/dialogs/AccountSelectDialog.h deleted file mode 100644 index 0bf9b403..00000000 --- a/gui/dialogs/AccountSelectDialog.h +++ /dev/null @@ -1,90 +0,0 @@ -/* Copyright 2013-2015 MultiMC Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include - -#include - -#include "logic/auth/MojangAccountList.h" - -namespace Ui -{ -class AccountSelectDialog; -} - -class AccountSelectDialog : public QDialog -{ - Q_OBJECT -public: - enum Flags - { - NoFlags = 0, - - /*! - * Shows a check box on the dialog that allows the user to specify that the account - * they've selected should be used as the global default for all instances. - */ - GlobalDefaultCheckbox, - - /*! - * Shows a check box on the dialog that allows the user to specify that the account - * they've selected should be used as the default for the instance they are currently launching. - * This is not currently implemented. - */ - InstanceDefaultCheckbox, - }; - - /*! - * Constructs a new account select dialog with the given parent and message. - * The message will be shown at the top of the dialog. It is an empty string by default. - */ - explicit AccountSelectDialog(const QString& message="", int flags=0, QWidget *parent = 0); - ~AccountSelectDialog(); - - /*! - * Gets a pointer to the account that the user selected. - * This is null if the user clicked cancel or hasn't clicked OK yet. - */ - MojangAccountPtr selectedAccount() const; - - /*! - * Returns true if the user checked the "use as global default" checkbox. - * If the checkbox wasn't shown, this function returns false. - */ - bool useAsGlobalDefault() const; - - /*! - * Returns true if the user checked the "use as instance default" checkbox. - * If the checkbox wasn't shown, this function returns false. - */ - bool useAsInstDefaullt() const; - -public -slots: - void on_buttonBox_accepted(); - - void on_buttonBox_rejected(); - -protected: - std::shared_ptr m_accounts; - - //! The account that was selected when the user clicked OK. - MojangAccountPtr m_selected; - -private: - Ui::AccountSelectDialog *ui; -}; diff --git a/gui/dialogs/AccountSelectDialog.ui b/gui/dialogs/AccountSelectDialog.ui deleted file mode 100644 index 7af1512a..00000000 --- a/gui/dialogs/AccountSelectDialog.ui +++ /dev/null @@ -1,56 +0,0 @@ - - - AccountSelectDialog - - - - 0 - 0 - 413 - 300 - - - - Select an Account - - - - - - Select an account. - - - - - - - - - - - - Use as default? - - - - - - - Use as default for this instance only? - - - - - - - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - - - - - diff --git a/gui/dialogs/CopyInstanceDialog.cpp b/gui/dialogs/CopyInstanceDialog.cpp deleted file mode 100644 index 038fb896..00000000 --- a/gui/dialogs/CopyInstanceDialog.cpp +++ /dev/null @@ -1,101 +0,0 @@ -/* Copyright 2013-2015 MultiMC Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include - -#include "MultiMC.h" -#include "CopyInstanceDialog.h" -#include "ui_CopyInstanceDialog.h" - -#include "gui/Platform.h" -#include "gui/dialogs/VersionSelectDialog.h" -#include "gui/dialogs/ProgressDialog.h" -#include "gui/dialogs/IconPickerDialog.h" - -#include "logic/BaseVersion.h" -#include "logic/icons/IconList.h" -#include "logic/tasks/Task.h" -#include "logic/BaseInstance.h" -#include "logic/InstanceList.h" - -CopyInstanceDialog::CopyInstanceDialog(InstancePtr original, QWidget *parent) - :QDialog(parent), ui(new Ui::CopyInstanceDialog), m_original(original) -{ - MultiMCPlatform::fixWM_CLASS(this); - ui->setupUi(this); - resize(minimumSizeHint()); - layout()->setSizeConstraint(QLayout::SetFixedSize); - - InstIconKey = original->iconKey(); - ui->iconButton->setIcon(ENV.icons()->getIcon(InstIconKey)); - ui->instNameTextBox->setText(original->name()); - ui->instNameTextBox->setFocus(); - auto groups = MMC->instances()->getGroups().toSet(); - auto groupList = QStringList(groups.toList()); - groupList.sort(Qt::CaseInsensitive); - groupList.removeOne(""); - groupList.push_front(""); - ui->groupBox->addItems(groupList); - int index = groupList.indexOf(m_original->group()); - if(index == -1) - { - index = 0; - } - ui->groupBox->setCurrentIndex(index); - ui->groupBox->lineEdit()->setPlaceholderText(tr("No group")); -} - -CopyInstanceDialog::~CopyInstanceDialog() -{ - delete ui; -} - -void CopyInstanceDialog::updateDialogState() -{ - ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(!instName().isEmpty()); -} - -QString CopyInstanceDialog::instName() const -{ - return ui->instNameTextBox->text(); -} - -QString CopyInstanceDialog::iconKey() const -{ - return InstIconKey; -} - -QString CopyInstanceDialog::instGroup() const -{ - return ui->groupBox->currentText(); -} - -void CopyInstanceDialog::on_iconButton_clicked() -{ - IconPickerDialog dlg(this); - dlg.exec(InstIconKey); - - if (dlg.result() == QDialog::Accepted) - { - InstIconKey = dlg.selectedIconKey; - ui->iconButton->setIcon(ENV.icons()->getIcon(InstIconKey)); - } -} - -void CopyInstanceDialog::on_instNameTextBox_textChanged(const QString &arg1) -{ - updateDialogState(); -} diff --git a/gui/dialogs/CopyInstanceDialog.h b/gui/dialogs/CopyInstanceDialog.h deleted file mode 100644 index 9e27d4ea..00000000 --- a/gui/dialogs/CopyInstanceDialog.h +++ /dev/null @@ -1,52 +0,0 @@ -/* Copyright 2013-2015 MultiMC Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include -#include "logic/BaseVersion.h" -#include - -class BaseInstance; - -namespace Ui -{ -class CopyInstanceDialog; -} - -class CopyInstanceDialog : public QDialog -{ - Q_OBJECT - -public: - explicit CopyInstanceDialog(InstancePtr original, QWidget *parent = 0); - ~CopyInstanceDialog(); - - void updateDialogState(); - - QString instName() const; - QString instGroup() const; - QString iconKey() const; - -private -slots: - void on_iconButton_clicked(); - void on_instNameTextBox_textChanged(const QString &arg1); - -private: - Ui::CopyInstanceDialog *ui; - QString InstIconKey; - InstancePtr m_original; -}; diff --git a/gui/dialogs/CopyInstanceDialog.ui b/gui/dialogs/CopyInstanceDialog.ui deleted file mode 100644 index 2615168c..00000000 --- a/gui/dialogs/CopyInstanceDialog.ui +++ /dev/null @@ -1,161 +0,0 @@ - - - CopyInstanceDialog - - - Qt::ApplicationModal - - - - 0 - 0 - 345 - 205 - - - - Copy Instance - - - - :/icons/toolbar/copy:/icons/toolbar/copy - - - true - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - :/icons/instances/infinity:/icons/instances/infinity - - - - 80 - 80 - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - Name - - - - - - - Qt::Horizontal - - - - - - - - - Group - - - groupBox - - - - - - - - 0 - 0 - - - - true - - - - - - - - - Qt::Horizontal - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - - - - - - - - buttonBox - accepted() - CopyInstanceDialog - accept() - - - 248 - 254 - - - 157 - 274 - - - - - buttonBox - rejected() - CopyInstanceDialog - reject() - - - 316 - 260 - - - 286 - 274 - - - - - diff --git a/gui/dialogs/CustomMessageBox.cpp b/gui/dialogs/CustomMessageBox.cpp deleted file mode 100644 index 0fb5bd19..00000000 --- a/gui/dialogs/CustomMessageBox.cpp +++ /dev/null @@ -1,35 +0,0 @@ -/* Copyright 2013-2015 MultiMC Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "CustomMessageBox.h" - -namespace CustomMessageBox -{ -QMessageBox *selectable(QWidget *parent, const QString &title, const QString &text, - QMessageBox::Icon icon, QMessageBox::StandardButtons buttons, - QMessageBox::StandardButton defaultButton) -{ - QMessageBox *messageBox = new QMessageBox(parent); - messageBox->setWindowTitle(title); - messageBox->setText(text); - messageBox->setStandardButtons(buttons); - messageBox->setDefaultButton(defaultButton); - messageBox->setTextInteractionFlags(Qt::TextSelectableByMouse); - messageBox->setIcon(icon); - messageBox->setTextInteractionFlags(Qt::TextBrowserInteraction); - - return messageBox; -} -} diff --git a/gui/dialogs/CustomMessageBox.h b/gui/dialogs/CustomMessageBox.h deleted file mode 100644 index 0a7202d7..00000000 --- a/gui/dialogs/CustomMessageBox.h +++ /dev/null @@ -1,26 +0,0 @@ -/* Copyright 2013-2015 MultiMC Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include - -namespace CustomMessageBox -{ -QMessageBox *selectable(QWidget *parent, const QString &title, const QString &text, - QMessageBox::Icon icon = QMessageBox::NoIcon, - QMessageBox::StandardButtons buttons = QMessageBox::Ok, - QMessageBox::StandardButton defaultButton = QMessageBox::NoButton); -} diff --git a/gui/dialogs/EditAccountDialog.cpp b/gui/dialogs/EditAccountDialog.cpp deleted file mode 100644 index b78cebee..00000000 --- a/gui/dialogs/EditAccountDialog.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/* Copyright 2013-2015 MultiMC Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "EditAccountDialog.h" -#include "ui_EditAccountDialog.h" -#include -#include - -EditAccountDialog::EditAccountDialog(const QString &text, QWidget *parent, int flags) - : QDialog(parent), ui(new Ui::EditAccountDialog) -{ - ui->setupUi(this); - - ui->label->setText(text); - ui->label->setVisible(!text.isEmpty()); - - ui->userTextBox->setVisible(flags & UsernameField); - ui->passTextBox->setVisible(flags & PasswordField); -} - -EditAccountDialog::~EditAccountDialog() -{ - delete ui; -} - -void EditAccountDialog::on_label_linkActivated(const QString &link) -{ - QDesktopServices::openUrl(QUrl(link)); -} - -QString EditAccountDialog::username() const -{ - return ui->userTextBox->text(); -} - -QString EditAccountDialog::password() const -{ - return ui->passTextBox->text(); -} diff --git a/gui/dialogs/EditAccountDialog.h b/gui/dialogs/EditAccountDialog.h deleted file mode 100644 index df8b21bf..00000000 --- a/gui/dialogs/EditAccountDialog.h +++ /dev/null @@ -1,60 +0,0 @@ -/* Copyright 2013-2015 MultiMC Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include - -namespace Ui -{ -class EditAccountDialog; -} - -class EditAccountDialog : public QDialog -{ - Q_OBJECT - -public: - explicit EditAccountDialog(const QString &text = "", QWidget *parent = 0, - int flags = UsernameField | PasswordField); - ~EditAccountDialog(); - - /*! - * Gets the text entered in the dialog's username field. - */ - QString username() const; - - /*! - * Gets the text entered in the dialog's password field. - */ - QString password() const; - - enum Flags - { - NoFlags = 0, - - //! Specifies that the dialog should have a username field. - UsernameField, - - //! Specifies that the dialog should have a password field. - PasswordField, - }; - -private slots: - void on_label_linkActivated(const QString &link); - -private: - Ui::EditAccountDialog *ui; -}; diff --git a/gui/dialogs/EditAccountDialog.ui b/gui/dialogs/EditAccountDialog.ui deleted file mode 100644 index 5f727bd4..00000000 --- a/gui/dialogs/EditAccountDialog.ui +++ /dev/null @@ -1,94 +0,0 @@ - - - EditAccountDialog - - - - 0 - 0 - 400 - 148 - - - - Edit Account - - - - - - Message label placeholder. - - - Qt::RichText - - - Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - - - - - - Email / Username - - - - - - - QLineEdit::Password - - - Password - - - - - - - Qt::Horizontal - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - - - - - - buttonBox - accepted() - EditAccountDialog - accept() - - - 248 - 254 - - - 157 - 274 - - - - - buttonBox - rejected() - EditAccountDialog - reject() - - - 316 - 260 - - - 286 - 274 - - - - - diff --git a/gui/dialogs/IconPickerDialog.cpp b/gui/dialogs/IconPickerDialog.cpp deleted file mode 100644 index 90bf2ef4..00000000 --- a/gui/dialogs/IconPickerDialog.cpp +++ /dev/null @@ -1,156 +0,0 @@ -/* Copyright 2013-2015 MultiMC Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include -#include - -#include "MultiMC.h" - -#include "IconPickerDialog.h" -#include "ui_IconPickerDialog.h" - -#include "gui/Platform.h" -#include "gui/groupview/InstanceDelegate.h" - -#include "logic/icons/IconList.h" - -IconPickerDialog::IconPickerDialog(QWidget *parent) - : QDialog(parent), ui(new Ui::IconPickerDialog) -{ - MultiMCPlatform::fixWM_CLASS(this); - ui->setupUi(this); - setWindowModality(Qt::WindowModal); - - auto contentsWidget = ui->iconView; - contentsWidget->setViewMode(QListView::IconMode); - contentsWidget->setFlow(QListView::LeftToRight); - contentsWidget->setIconSize(QSize(48, 48)); - contentsWidget->setMovement(QListView::Static); - contentsWidget->setResizeMode(QListView::Adjust); - contentsWidget->setSelectionMode(QAbstractItemView::SingleSelection); - contentsWidget->setSpacing(5); - contentsWidget->setWordWrap(false); - contentsWidget->setWrapping(true); - contentsWidget->setUniformItemSizes(true); - contentsWidget->setTextElideMode(Qt::ElideRight); - contentsWidget->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel); - contentsWidget->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn); - contentsWidget->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); - contentsWidget->setItemDelegate(new ListViewDelegate()); - - // contentsWidget->setAcceptDrops(true); - contentsWidget->setDropIndicatorShown(true); - contentsWidget->viewport()->setAcceptDrops(true); - contentsWidget->setDragDropMode(QAbstractItemView::DropOnly); - contentsWidget->setDefaultDropAction(Qt::CopyAction); - - contentsWidget->installEventFilter(this); - - contentsWidget->setModel(ENV.icons().get()); - - auto buttonAdd = ui->buttonBox->addButton(tr("Add Icon"), QDialogButtonBox::ResetRole); - auto buttonRemove = - ui->buttonBox->addButton(tr("Remove Icon"), QDialogButtonBox::ResetRole); - - connect(buttonAdd, SIGNAL(clicked(bool)), SLOT(addNewIcon())); - connect(buttonRemove, SIGNAL(clicked(bool)), SLOT(removeSelectedIcon())); - - connect(contentsWidget, SIGNAL(doubleClicked(QModelIndex)), SLOT(activated(QModelIndex))); - - connect(contentsWidget->selectionModel(), - SIGNAL(selectionChanged(QItemSelection, QItemSelection)), - SLOT(selectionChanged(QItemSelection, QItemSelection))); -} -bool IconPickerDialog::eventFilter(QObject *obj, QEvent *evt) -{ - if (obj != ui->iconView) - return QDialog::eventFilter(obj, evt); - if (evt->type() != QEvent::KeyPress) - { - return QDialog::eventFilter(obj, evt); - } - QKeyEvent *keyEvent = static_cast(evt); - switch (keyEvent->key()) - { - case Qt::Key_Delete: - removeSelectedIcon(); - return true; - case Qt::Key_Plus: - addNewIcon(); - return true; - default: - break; - } - return QDialog::eventFilter(obj, evt); -} - -void IconPickerDialog::addNewIcon() -{ - //: The title of the select icons open file dialog - QString selectIcons = tr("Select Icons"); - //: The type of icon files - QStringList fileNames = QFileDialog::getOpenFileNames(this, selectIcons, QString(), - tr("Icons") + "(*.png *.jpg *.jpeg *.ico)"); - ENV.icons()->installIcons(fileNames); -} - -void IconPickerDialog::removeSelectedIcon() -{ - ENV.icons()->deleteIcon(selectedIconKey); -} - -void IconPickerDialog::activated(QModelIndex index) -{ - selectedIconKey = index.data(Qt::UserRole).toString(); - accept(); -} - -void IconPickerDialog::selectionChanged(QItemSelection selected, QItemSelection deselected) -{ - if (selected.empty()) - return; - - QString key = selected.first().indexes().first().data(Qt::UserRole).toString(); - if (!key.isEmpty()) - selectedIconKey = key; -} - -int IconPickerDialog::exec(QString selection) -{ - auto list = ENV.icons(); - auto contentsWidget = ui->iconView; - selectedIconKey = selection; - - int index_nr = list->getIconIndex(selection); - auto model_index = list->index(index_nr); - contentsWidget->selectionModel()->select( - model_index, QItemSelectionModel::Current | QItemSelectionModel::Select); - - QMetaObject::invokeMethod(this, "delayed_scroll", Qt::QueuedConnection, - Q_ARG(QModelIndex, model_index)); - return QDialog::exec(); -} - -void IconPickerDialog::delayed_scroll(QModelIndex model_index) -{ - auto contentsWidget = ui->iconView; - contentsWidget->scrollTo(model_index); -} - -IconPickerDialog::~IconPickerDialog() -{ - delete ui; -} diff --git a/gui/dialogs/IconPickerDialog.h b/gui/dialogs/IconPickerDialog.h deleted file mode 100644 index 610d9306..00000000 --- a/gui/dialogs/IconPickerDialog.h +++ /dev/null @@ -1,48 +0,0 @@ -/* Copyright 2013-2015 MultiMC Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once -#include -#include - -namespace Ui -{ -class IconPickerDialog; -} - -class IconPickerDialog : public QDialog -{ - Q_OBJECT - -public: - explicit IconPickerDialog(QWidget *parent = 0); - ~IconPickerDialog(); - int exec(QString selection); - QString selectedIconKey; - -protected: - virtual bool eventFilter(QObject *, QEvent *); - -private: - Ui::IconPickerDialog *ui; - -private -slots: - void selectionChanged(QItemSelection, QItemSelection); - void activated(QModelIndex); - void delayed_scroll(QModelIndex); - void addNewIcon(); - void removeSelectedIcon(); -}; diff --git a/gui/dialogs/IconPickerDialog.ui b/gui/dialogs/IconPickerDialog.ui deleted file mode 100644 index c548edfb..00000000 --- a/gui/dialogs/IconPickerDialog.ui +++ /dev/null @@ -1,67 +0,0 @@ - - - IconPickerDialog - - - - 0 - 0 - 676 - 555 - - - - Pick icon - - - - - - - - - Qt::Horizontal - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - - - - - - buttonBox - accepted() - IconPickerDialog - accept() - - - 248 - 254 - - - 157 - 274 - - - - - buttonBox - rejected() - IconPickerDialog - reject() - - - 316 - 260 - - - 286 - 274 - - - - - diff --git a/gui/dialogs/LoginDialog.cpp b/gui/dialogs/LoginDialog.cpp deleted file mode 100644 index 75fdd502..00000000 --- a/gui/dialogs/LoginDialog.cpp +++ /dev/null @@ -1,110 +0,0 @@ -/* Copyright 2013-2015 MultiMC Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "LoginDialog.h" -#include "ui_LoginDialog.h" - -#include "logic/auth/YggdrasilTask.h" - -#include - -LoginDialog::LoginDialog(QWidget *parent) : QDialog(parent), ui(new Ui::LoginDialog) -{ - ui->setupUi(this); - ui->progressBar->setVisible(false); - ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false); - - connect(ui->buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept); - connect(ui->buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject); -} - -LoginDialog::~LoginDialog() -{ - delete ui; -} - -// Stage 1: User interaction -void LoginDialog::accept() -{ - setUserInputsEnabled(false); - ui->progressBar->setVisible(true); - - // Setup the login task and start it - m_account = MojangAccount::createFromUsername(ui->userTextBox->text()); - m_loginTask = m_account->login(nullptr, ui->passTextBox->text()); - connect(m_loginTask.get(), &ProgressProvider::failed, this, &LoginDialog::onTaskFailed); - connect(m_loginTask.get(), &ProgressProvider::succeeded, this, - &LoginDialog::onTaskSucceeded); - connect(m_loginTask.get(), &ProgressProvider::status, this, &LoginDialog::onTaskStatus); - connect(m_loginTask.get(), &ProgressProvider::progress, this, &LoginDialog::onTaskProgress); - m_loginTask->start(); -} - -void LoginDialog::setUserInputsEnabled(bool enable) -{ - ui->userTextBox->setEnabled(enable); - ui->passTextBox->setEnabled(enable); - ui->buttonBox->setEnabled(enable); -} - -// Enable the OK button only when both textboxes contain something. -void LoginDialog::on_userTextBox_textEdited(const QString &newText) -{ - ui->buttonBox->button(QDialogButtonBox::Ok) - ->setEnabled(!newText.isEmpty() && !ui->passTextBox->text().isEmpty()); -} -void LoginDialog::on_passTextBox_textEdited(const QString &newText) -{ - ui->buttonBox->button(QDialogButtonBox::Ok) - ->setEnabled(!newText.isEmpty() && !ui->userTextBox->text().isEmpty()); -} - -void LoginDialog::onTaskFailed(const QString &reason) -{ - // Set message - ui->label->setText("" + reason + ""); - - // Re-enable user-interaction - setUserInputsEnabled(true); - ui->progressBar->setVisible(false); -} - -void LoginDialog::onTaskSucceeded() -{ - QDialog::accept(); -} - -void LoginDialog::onTaskStatus(const QString &status) -{ - ui->label->setText(status); -} - -void LoginDialog::onTaskProgress(qint64 current, qint64 total) -{ - ui->progressBar->setMaximum(total); - ui->progressBar->setValue(current); -} - -// Public interface -MojangAccountPtr LoginDialog::newAccount(QWidget *parent, QString msg) -{ - LoginDialog dlg(parent); - dlg.ui->label->setText(msg); - if (dlg.exec() == QDialog::Accepted) - { - return dlg.m_account; - } - return 0; -} diff --git a/gui/dialogs/LoginDialog.h b/gui/dialogs/LoginDialog.h deleted file mode 100644 index 79bad76a..00000000 --- a/gui/dialogs/LoginDialog.h +++ /dev/null @@ -1,58 +0,0 @@ -/* Copyright 2013-2015 MultiMC Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include -#include - -#include "logic/auth/MojangAccount.h" - -namespace Ui -{ -class LoginDialog; -} - -class LoginDialog : public QDialog -{ - Q_OBJECT - -public: - ~LoginDialog(); - - static MojangAccountPtr newAccount(QWidget *parent, QString message); - -private: - explicit LoginDialog(QWidget *parent = 0); - - void setUserInputsEnabled(bool enable); - -protected -slots: - void accept(); - - void onTaskFailed(const QString &reason); - void onTaskSucceeded(); - void onTaskStatus(const QString &status); - void onTaskProgress(qint64 current, qint64 total); - - void on_userTextBox_textEdited(const QString &newText); - void on_passTextBox_textEdited(const QString &newText); - -private: - Ui::LoginDialog *ui; - MojangAccountPtr m_account; - std::shared_ptr m_loginTask; -}; diff --git a/gui/dialogs/LoginDialog.ui b/gui/dialogs/LoginDialog.ui deleted file mode 100644 index b24b1c0c..00000000 --- a/gui/dialogs/LoginDialog.ui +++ /dev/null @@ -1,77 +0,0 @@ - - - LoginDialog - - - - 0 - 0 - 400 - 162 - - - - - 0 - 0 - - - - Add Account - - - - - - Message label placeholder. - - - Qt::RichText - - - Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - - - - - - Email / Username - - - - - - - QLineEdit::Password - - - Password - - - - - - - 24 - - - false - - - - - - - Qt::Horizontal - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - - - - - diff --git a/gui/dialogs/ModEditDialogCommon.cpp b/gui/dialogs/ModEditDialogCommon.cpp deleted file mode 100644 index 4a2115d8..00000000 --- a/gui/dialogs/ModEditDialogCommon.cpp +++ /dev/null @@ -1,40 +0,0 @@ -#include "ModEditDialogCommon.h" -#include "CustomMessageBox.h" -#include - -bool lastfirst(QModelIndexList &list, int &first, int &last) -{ - if (list.isEmpty()) - return false; - first = last = list[0].row(); - for (auto item : list) - { - int row = item.row(); - if (row < first) - first = row; - if (row > last) - last = row; - } - return true; -} - -void showWebsiteForMod(QWidget *parentDlg, Mod &m) -{ - QString url = m.homeurl(); - if (url.size()) - { - // catch the cases where the protocol is missing - if (!url.startsWith("http")) - { - url = "http://" + url; - } - QDesktopServices::openUrl(url); - } - else - { - CustomMessageBox::selectable( - parentDlg, QObject::tr("How sad!"), - QObject::tr("The mod author didn't provide a website link for this mod."), - QMessageBox::Warning); - } -} diff --git a/gui/dialogs/ModEditDialogCommon.h b/gui/dialogs/ModEditDialogCommon.h deleted file mode 100644 index 227e638c..00000000 --- a/gui/dialogs/ModEditDialogCommon.h +++ /dev/null @@ -1,9 +0,0 @@ -#pragma once -#include -#include -#include -#include - -bool lastfirst(QModelIndexList &list, int &first, int &last); - -void showWebsiteForMod(QWidget *parentDlg, Mod &m); diff --git a/gui/dialogs/NewInstanceDialog.cpp b/gui/dialogs/NewInstanceDialog.cpp deleted file mode 100644 index 86ffc5b8..00000000 --- a/gui/dialogs/NewInstanceDialog.cpp +++ /dev/null @@ -1,207 +0,0 @@ -/* Copyright 2013-2015 MultiMC Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "MultiMC.h" -#include "NewInstanceDialog.h" -#include "ui_NewInstanceDialog.h" - -#include "logic/BaseVersion.h" -#include "logic/icons/IconList.h" -#include "logic/minecraft/MinecraftVersionList.h" -#include "logic/tasks/Task.h" -#include "logic/InstanceList.h" - -#include "gui/Platform.h" -#include "VersionSelectDialog.h" -#include "ProgressDialog.h" -#include "IconPickerDialog.h" - -#include -#include -#include -#include - -class UrlValidator : public QValidator -{ -public: - using QValidator::QValidator; - - State validate(QString &in, int &pos) const - { - const QUrl url(in); - if (url.isValid() && !url.isRelative() && !url.isEmpty()) - { - return Acceptable; - } - else if (QFile::exists(in)) - { - return Acceptable; - } - else - { - return Intermediate; - } - } -}; - -NewInstanceDialog::NewInstanceDialog(QWidget *parent) - : QDialog(parent), ui(new Ui::NewInstanceDialog) -{ - MultiMCPlatform::fixWM_CLASS(this); - ui->setupUi(this); - resize(minimumSizeHint()); - layout()->setSizeConstraint(QLayout::SetFixedSize); - - setSelectedVersion(MMC->minecraftlist()->getLatestStable(), true); - InstIconKey = "infinity"; - ui->iconButton->setIcon(ENV.icons()->getIcon(InstIconKey)); - - ui->modpackEdit->setValidator(new UrlValidator(ui->modpackEdit)); - connect(ui->modpackEdit, &QLineEdit::textChanged, this, &NewInstanceDialog::updateDialogState); - connect(ui->modpackBox, &QRadioButton::clicked, this, &NewInstanceDialog::updateDialogState); - connect(ui->versionBox, &QRadioButton::clicked, this, &NewInstanceDialog::updateDialogState); - - auto groups = MMC->instances()->getGroups().toSet(); - auto groupList = QStringList(groups.toList()); - groupList.sort(Qt::CaseInsensitive); - groupList.removeOne(""); - QString oldValue = MMC->settings()->get("LastUsedGroupForNewInstance").toString(); - groupList.push_front(oldValue); - groupList.push_front(""); - ui->groupBox->addItems(groupList); - int index = groupList.indexOf(oldValue); - if(index == -1) - { - index = 0; - } - ui->groupBox->setCurrentIndex(index); - ui->groupBox->lineEdit()->setPlaceholderText(tr("No group")); -} - -NewInstanceDialog::~NewInstanceDialog() -{ - delete ui; -} - -void NewInstanceDialog::updateDialogState() -{ - bool allowOK = !instName().isEmpty() && - (ui->versionBox->isChecked() && m_selectedVersion || - (ui->modpackBox->isChecked() && ui->modpackEdit->hasAcceptableInput())); - ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(allowOK); -} - -void NewInstanceDialog::setSelectedVersion(BaseVersionPtr version, bool initial) -{ - m_selectedVersion = version; - - if (m_selectedVersion) - { - ui->versionTextBox->setText(version->name()); - if(ui->instNameTextBox->text().isEmpty() && !initial) - { - ui->instNameTextBox->setText(version->name()); - } - } - else - { - ui->versionTextBox->setText(""); - } - - updateDialogState(); -} - -QString NewInstanceDialog::instName() const -{ - return ui->instNameTextBox->text(); -} -QString NewInstanceDialog::instGroup() const -{ - return ui->groupBox->currentText(); -} -QString NewInstanceDialog::iconKey() const -{ - return InstIconKey; -} -QUrl NewInstanceDialog::modpackUrl() const -{ - if (ui->modpackBox->isChecked()) - { - const QUrl url(ui->modpackEdit->text()); - if (url.isValid() && !url.isRelative() && !url.host().isEmpty()) - { - return url; - } - else - { - return QUrl::fromLocalFile(ui->modpackEdit->text()); - } - } - else - { - return QUrl(); - } -} - -BaseVersionPtr NewInstanceDialog::selectedVersion() const -{ - return m_selectedVersion; -} - -void NewInstanceDialog::on_btnChangeVersion_clicked() -{ - VersionSelectDialog vselect(MMC->minecraftlist().get(), tr("Change Minecraft version"), - this); - vselect.exec(); - if (vselect.result() == QDialog::Accepted) - { - BaseVersionPtr version = vselect.selectedVersion(); - if (version) - setSelectedVersion(version); - } -} - -void NewInstanceDialog::on_iconButton_clicked() -{ - IconPickerDialog dlg(this); - dlg.exec(InstIconKey); - - if (dlg.result() == QDialog::Accepted) - { - InstIconKey = dlg.selectedIconKey; - ui->iconButton->setIcon(ENV.icons()->getIcon(InstIconKey)); - } -} - -void NewInstanceDialog::on_instNameTextBox_textChanged(const QString &arg1) -{ - updateDialogState(); -} - -void NewInstanceDialog::on_modpackBtn_clicked() -{ - const QUrl url = QFileDialog::getOpenFileUrl(this, tr("Choose modpack"), modpackUrl(), tr("Zip (*.zip)")); - if (url.isValid()) - { - if (url.isLocalFile()) - { - ui->modpackEdit->setText(url.toLocalFile()); - } - else - { - ui->modpackEdit->setText(url.toString()); - } - } -} diff --git a/gui/dialogs/NewInstanceDialog.h b/gui/dialogs/NewInstanceDialog.h deleted file mode 100644 index 1e1b0bea..00000000 --- a/gui/dialogs/NewInstanceDialog.h +++ /dev/null @@ -1,59 +0,0 @@ -/* Copyright 2013-2015 MultiMC Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include - -#include "logic/BaseVersion.h" - -namespace Ui -{ -class NewInstanceDialog; -} - -class NewInstanceDialog : public QDialog -{ - Q_OBJECT - -public: - explicit NewInstanceDialog(QWidget *parent = 0); - ~NewInstanceDialog(); - - void updateDialogState(); - - void setSelectedVersion(BaseVersionPtr version, bool initial = false); - - void loadVersionList(); - - QString instName() const; - QString instGroup() const; - QString iconKey() const; - QUrl modpackUrl() const; - BaseVersionPtr selectedVersion() const; - -private -slots: - void on_btnChangeVersion_clicked(); - void on_iconButton_clicked(); - void on_modpackBtn_clicked(); - void on_instNameTextBox_textChanged(const QString &arg1); - -private: - Ui::NewInstanceDialog *ui; - - BaseVersionPtr m_selectedVersion; - QString InstIconKey; -}; diff --git a/gui/dialogs/NewInstanceDialog.ui b/gui/dialogs/NewInstanceDialog.ui deleted file mode 100644 index 6cb0c97c..00000000 --- a/gui/dialogs/NewInstanceDialog.ui +++ /dev/null @@ -1,309 +0,0 @@ - - - NewInstanceDialog - - - Qt::ApplicationModal - - - - 0 - 0 - 277 - 404 - - - - New Instance - - - - :/icons/toolbar/new:/icons/toolbar/new - - - true - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - :/icons/instances/infinity:/icons/instances/infinity - - - - 80 - 80 - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - Name - - - - - - - Qt::Horizontal - - - - - - - - - &Group: - - - groupBox - - - - - - - - 0 - 0 - - - - true - - - - - - - - - - - false - - - ... - - - - - - - false - - - http:// - - - - - - - true - - - - - - - ... - - - - - - - Impor&t Modpack (local file or link): - - - - - - - Vani&lla Minecraft (select version): - - - true - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - Qt::Horizontal - - - - - - - Qt::Horizontal - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - - - - instNameTextBox - groupBox - versionBox - versionTextBox - btnChangeVersion - modpackBox - modpackEdit - modpackBtn - iconButton - - - - - buttonBox - accepted() - NewInstanceDialog - accept() - - - 257 - 333 - - - 157 - 274 - - - - - buttonBox - rejected() - NewInstanceDialog - reject() - - - 325 - 333 - - - 286 - 274 - - - - - modpackBox - toggled(bool) - modpackEdit - setEnabled(bool) - - - 81 - 229 - - - 236 - 221 - - - - - modpackBox - toggled(bool) - modpackBtn - setEnabled(bool) - - - 129 - 225 - - - 328 - 229 - - - - - versionBox - toggled(bool) - versionTextBox - setEnabled(bool) - - - 93 - 195 - - - 213 - 191 - - - - - versionBox - toggled(bool) - btnChangeVersion - setEnabled(bool) - - - 104 - 198 - - - 322 - 192 - - - - - diff --git a/gui/dialogs/NotificationDialog.cpp b/gui/dialogs/NotificationDialog.cpp deleted file mode 100644 index 8f920371..00000000 --- a/gui/dialogs/NotificationDialog.cpp +++ /dev/null @@ -1,84 +0,0 @@ -#include "NotificationDialog.h" -#include "ui_NotificationDialog.h" - -#include - -NotificationDialog::NotificationDialog(const NotificationChecker::NotificationEntry &entry, QWidget *parent) : - QDialog(parent, Qt::MSWindowsFixedSizeDialogHint | Qt::WindowTitleHint | Qt::CustomizeWindowHint), - ui(new Ui::NotificationDialog) -{ - ui->setupUi(this); - - QStyle::StandardPixmap icon; - switch (entry.type) - { - case NotificationChecker::NotificationEntry::Critical: - icon = QStyle::SP_MessageBoxCritical; - break; - case NotificationChecker::NotificationEntry::Warning: - icon = QStyle::SP_MessageBoxWarning; - break; - case NotificationChecker::NotificationEntry::Information: - icon = QStyle::SP_MessageBoxInformation; - break; - } - ui->iconLabel->setPixmap(style()->standardPixmap(icon, 0, this)); - ui->messageLabel->setText(entry.message); - - m_dontShowAgainText = tr("Don't show again"); - m_closeText = tr("Close"); - - ui->dontShowAgainBtn->setText(m_dontShowAgainText + QString(" (%1)").arg(m_dontShowAgainTime)); - ui->closeBtn->setText(m_closeText + QString(" (%1)").arg(m_closeTime)); - - startTimer(1000); -} - -NotificationDialog::~NotificationDialog() -{ - delete ui; -} - -void NotificationDialog::timerEvent(QTimerEvent *event) -{ - if (m_dontShowAgainTime > 0) - { - m_dontShowAgainTime--; - if (m_dontShowAgainTime == 0) - { - ui->dontShowAgainBtn->setText(m_dontShowAgainText); - ui->dontShowAgainBtn->setEnabled(true); - } - else - { - ui->dontShowAgainBtn->setText(m_dontShowAgainText + QString(" (%1)").arg(m_dontShowAgainTime)); - } - } - if (m_closeTime > 0) - { - m_closeTime--; - if (m_closeTime == 0) - { - ui->closeBtn->setText(m_closeText); - ui->closeBtn->setEnabled(true); - } - else - { - ui->closeBtn->setText(m_closeText + QString(" (%1)").arg(m_closeTime)); - } - } - - if (m_closeTime == 0 && m_dontShowAgainTime == 0) - { - killTimer(event->timerId()); - } -} - -void NotificationDialog::on_dontShowAgainBtn_clicked() -{ - done(DontShowAgain); -} -void NotificationDialog::on_closeBtn_clicked() -{ - done(Normal); -} diff --git a/gui/dialogs/NotificationDialog.h b/gui/dialogs/NotificationDialog.h deleted file mode 100644 index 4717abd8..00000000 --- a/gui/dialogs/NotificationDialog.h +++ /dev/null @@ -1,44 +0,0 @@ -#ifndef NOTIFICATIONDIALOG_H -#define NOTIFICATIONDIALOG_H - -#include - -#include "logic/notifications/NotificationChecker.h" - -namespace Ui { -class NotificationDialog; -} - -class NotificationDialog : public QDialog -{ - Q_OBJECT - -public: - explicit NotificationDialog(const NotificationChecker::NotificationEntry &entry, QWidget *parent = 0); - ~NotificationDialog(); - - enum ExitCode - { - Normal, - DontShowAgain - }; - -protected: - void timerEvent(QTimerEvent *event); - -private: - Ui::NotificationDialog *ui; - - int m_dontShowAgainTime = 10; - int m_closeTime = 5; - - QString m_dontShowAgainText; - QString m_closeText; - -private -slots: - void on_dontShowAgainBtn_clicked(); - void on_closeBtn_clicked(); -}; - -#endif // NOTIFICATIONDIALOG_H diff --git a/gui/dialogs/NotificationDialog.ui b/gui/dialogs/NotificationDialog.ui deleted file mode 100644 index a2a276e9..00000000 --- a/gui/dialogs/NotificationDialog.ui +++ /dev/null @@ -1,85 +0,0 @@ - - - NotificationDialog - - - - 0 - 0 - 320 - 240 - - - - Dialog - - - - - - - - TextLabel - - - - - - - TextLabel - - - true - - - true - - - Qt::TextBrowserInteraction - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - false - - - Don't show again - - - - - - - false - - - Close - - - - - - - - - - diff --git a/gui/dialogs/ProgressDialog.cpp b/gui/dialogs/ProgressDialog.cpp deleted file mode 100644 index db483a73..00000000 --- a/gui/dialogs/ProgressDialog.cpp +++ /dev/null @@ -1,125 +0,0 @@ -/* Copyright 2013-2015 MultiMC Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "ProgressDialog.h" -#include "ui_ProgressDialog.h" - -#include - -#include "logic/tasks/Task.h" -#include "gui/Platform.h" - -ProgressDialog::ProgressDialog(QWidget *parent) : QDialog(parent), ui(new Ui::ProgressDialog) -{ - MultiMCPlatform::fixWM_CLASS(this); - ui->setupUi(this); - this->setWindowFlags(this->windowFlags() & ~Qt::WindowContextHelpButtonHint); - setSkipButton(false); - changeProgress(0, 100); -} - -void ProgressDialog::setSkipButton(bool present, QString label) -{ - ui->skipButton->setEnabled(present); - ui->skipButton->setVisible(present); - ui->skipButton->setText(label); - updateSize(); -} - -void ProgressDialog::on_skipButton_clicked(bool checked) -{ - Q_UNUSED(checked); - task->abort(); -} - -ProgressDialog::~ProgressDialog() -{ - delete ui; -} - -void ProgressDialog::updateSize() -{ - resize(QSize(480, minimumSizeHint().height())); -} - -int ProgressDialog::exec(ProgressProvider *task) -{ - this->task = task; - - // Connect signals. - connect(task, SIGNAL(started()), SLOT(onTaskStarted())); - connect(task, SIGNAL(failed(QString)), SLOT(onTaskFailed(QString))); - connect(task, SIGNAL(succeeded()), SLOT(onTaskSucceeded())); - connect(task, SIGNAL(status(QString)), SLOT(changeStatus(const QString &))); - connect(task, SIGNAL(progress(qint64, qint64)), SLOT(changeProgress(qint64, qint64))); - - // if this didn't connect to an already running task, invoke start - if(!task->isRunning()) - task->start(); - if(task->isRunning()) - return QDialog::exec(); - else - return QDialog::Accepted; -} - -ProgressProvider *ProgressDialog::getTask() -{ - return task; -} - -void ProgressDialog::onTaskStarted() -{ -} - -void ProgressDialog::onTaskFailed(QString failure) -{ - reject(); -} - -void ProgressDialog::onTaskSucceeded() -{ - accept(); -} - -void ProgressDialog::changeStatus(const QString &status) -{ - ui->statusLabel->setText(status); - updateSize(); -} - -void ProgressDialog::changeProgress(qint64 current, qint64 total) -{ - ui->taskProgressBar->setMaximum(total); - ui->taskProgressBar->setValue(current); -} - -void ProgressDialog::keyPressEvent(QKeyEvent *e) -{ - if (e->key() == Qt::Key_Escape) - return; - QDialog::keyPressEvent(e); -} - -void ProgressDialog::closeEvent(QCloseEvent *e) -{ - if (task && task->isRunning()) - { - e->ignore(); - } - else - { - QDialog::closeEvent(e); - } -} diff --git a/gui/dialogs/ProgressDialog.h b/gui/dialogs/ProgressDialog.h deleted file mode 100644 index d5153680..00000000 --- a/gui/dialogs/ProgressDialog.h +++ /dev/null @@ -1,65 +0,0 @@ -/* Copyright 2013-2015 MultiMC Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include - -class ProgressProvider; - -namespace Ui -{ -class ProgressDialog; -} - -class ProgressDialog : public QDialog -{ - Q_OBJECT - -public: - explicit ProgressDialog(QWidget *parent = 0); - ~ProgressDialog(); - - void updateSize(); - - int exec(ProgressProvider *task); - - void setSkipButton(bool present, QString label = QString()); - - ProgressProvider *getTask(); - -public -slots: - void onTaskStarted(); - void onTaskFailed(QString failure); - void onTaskSucceeded(); - - void changeStatus(const QString &status); - void changeProgress(qint64 current, qint64 total); - - -private -slots: - void on_skipButton_clicked(bool checked); - -protected: - virtual void keyPressEvent(QKeyEvent *e); - virtual void closeEvent(QCloseEvent *e); - -private: - Ui::ProgressDialog *ui; - - ProgressProvider *task; -}; diff --git a/gui/dialogs/ProgressDialog.ui b/gui/dialogs/ProgressDialog.ui deleted file mode 100644 index 04b8fef3..00000000 --- a/gui/dialogs/ProgressDialog.ui +++ /dev/null @@ -1,66 +0,0 @@ - - - ProgressDialog - - - - 0 - 0 - 400 - 100 - - - - - 400 - 0 - - - - - 600 - 16777215 - - - - Please wait... - - - - - - Task Status... - - - true - - - - - - - 24 - - - false - - - - - - - - 0 - 0 - - - - Skip - - - - - - - - diff --git a/gui/dialogs/UpdateDialog.cpp b/gui/dialogs/UpdateDialog.cpp deleted file mode 100644 index 1fcc156a..00000000 --- a/gui/dialogs/UpdateDialog.cpp +++ /dev/null @@ -1,186 +0,0 @@ -#include "UpdateDialog.h" -#include "ui_UpdateDialog.h" -#include "gui/Platform.h" -#include -#include "MultiMC.h" -#include - -UpdateDialog::UpdateDialog(bool hasUpdate, QWidget *parent) : QDialog(parent), ui(new Ui::UpdateDialog) -{ - MultiMCPlatform::fixWM_CLASS(this); - ui->setupUi(this); - auto channel = MMC->settings()->get("UpdateChannel").toString(); - if(hasUpdate) - { - ui->label->setText(tr("A new %1 update is available!").arg(channel)); - } - else - { - ui->label->setText(tr("No %1 updates found. You are running the latest version.").arg(channel)); - ui->btnUpdateNow->setDisabled(true); - ui->btnUpdateOnExit->setDisabled(true); - } - loadChangelog(); -} - -UpdateDialog::~UpdateDialog() -{ -} - -void UpdateDialog::loadChangelog() -{ - auto channel = MMC->settings()->get("UpdateChannel").toString(); - dljob.reset(new NetJob("Changelog")); - auto url = QString("https://raw.githubusercontent.com/MultiMC/MultiMC5/%1/changelog.md").arg(channel); - changelogDownload = ByteArrayDownload::make(QUrl(url)); - dljob->addNetAction(changelogDownload); - connect(dljob.get(), &NetJob::succeeded, this, &UpdateDialog::changelogLoaded); - connect(dljob.get(), &NetJob::failed, this, &UpdateDialog::changelogFailed); - dljob->start(); -} - -// TODO: this will be replaced. -QString reprocessMarkdown(QString markdown) -{ - QString htmlData; - QTextStream html(&htmlData); - auto lines = markdown.split(QRegExp("[\r]?[\n]"),QString::KeepEmptyParts); - enum - { - BASE, - LIST1, - LIST2 - }state = BASE; - html << ""; - int i = 0; - auto procLine = [&](QString line) -> QString - { - // [GitHub issues](https://github.com/MultiMC/MultiMC5/issues) - line.replace(QRegExp("\\[([^\\]]+)\\]\\(([^\\)]+)\\)"), "\\1"); - return line; - }; - for(auto line: lines) - { - if(line.isEmpty()) - { - // html << "
    \n"; - } - else switch (state) - { - case BASE: - if(line.startsWith("##")) - { - html << "

    " << procLine(line.mid(2)) << "

    \n"; - } - else if(line.startsWith("#")) - { - html << "

    " << procLine(line.mid(1)) << "

    \n"; - } - else if(line.startsWith("- ")) - { - state = LIST1; - html << "
      \n"; - html << "
    • " << procLine(line.mid(2)) << "
    • \n"; - } - else qCritical() << "Invalid input on line " << i << ": " << line; - break; - case LIST1: - if(line.startsWith("##")) - { - state = BASE; - html << "
    \n"; - html << "

    " << procLine(line.mid(2)) << "

    \n"; - } - else if(line.startsWith("#")) - { - state = BASE; - html << "\n"; - html << "

    " << procLine(line.mid(1)) << "

    \n"; - } - else if(line.startsWith("- ")) - { - html << "
  • " << procLine(line.mid(2)) << "
  • \n"; - } - else if(line.startsWith(" - ")) - { - state = LIST2; - html << "
      \n"; - html << "
    • " << procLine(line.mid(4)) << "
    • \n"; - } - else qCritical() << "Invalid input on line " << i << ": " << line; - break; - case LIST2: - if(line.startsWith("##")) - { - state = BASE; - html << "
    \n"; - html << "\n"; - html << "

    " << procLine(line.mid(2)) << "

    \n"; - } - else if(line.startsWith("#")) - { - state = BASE; - html << "\n"; - html << "\n"; - html << "

    " << procLine(line.mid(1)) << "

    \n"; - } - else if(line.startsWith("- ")) - { - state = LIST1; - html << "\n"; - html << "
  • " << procLine(line.mid(2)) << "
  • \n"; - } - else if(line.startsWith(" - ")) - { - html << "
  • " << procLine(line.mid(4)) << "
  • \n"; - } - else qCritical() << "Invalid input on line " << i << ": " << line; - break; - } - i++; - } - if(state == LIST2) - { - html << "\n"; - state = LIST1; - } - if(state == LIST1) - { - html << "\n"; - state = BASE; - } - if (state != BASE) - { - qCritical() << "Reprocessing markdown didn't end in a final state!"; - } - html << "\n"; - qDebug() << htmlData; - return htmlData; -} - -void UpdateDialog::changelogLoaded() -{ - auto rawMarkdown = QString::fromUtf8(changelogDownload->m_data); - auto html = reprocessMarkdown(rawMarkdown); - ui->changelogBrowser->setHtml(html); -} - -void UpdateDialog::changelogFailed() -{ - ui->changelogBrowser->setHtml(tr("

    Failed to fetch changelog...

    ")); -} - -void UpdateDialog::on_btnUpdateLater_clicked() -{ - reject(); -} - -void UpdateDialog::on_btnUpdateNow_clicked() -{ - done(UPDATE_NOW); -} - -void UpdateDialog::on_btnUpdateOnExit_clicked() -{ - done(UPDATE_ONEXIT); -} diff --git a/gui/dialogs/UpdateDialog.h b/gui/dialogs/UpdateDialog.h deleted file mode 100644 index bfbc0f27..00000000 --- a/gui/dialogs/UpdateDialog.h +++ /dev/null @@ -1,61 +0,0 @@ -/* Copyright 2013-2015 MultiMC Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include -#include "logic/net/ByteArrayDownload.h" -#include "logic/net/NetJob.h" - -namespace Ui -{ -class UpdateDialog; -} - -enum UpdateAction -{ - UPDATE_LATER = QDialog::Rejected, - UPDATE_NOW = QDialog::Accepted, - UPDATE_ONEXIT = 2 -}; - -class UpdateDialog : public QDialog -{ - Q_OBJECT - -public: - explicit UpdateDialog(bool hasUpdate = true, QWidget *parent = 0); - ~UpdateDialog(); - -private: - Ui::UpdateDialog *ui; -public slots: - void on_btnUpdateNow_clicked(); - void on_btnUpdateOnExit_clicked(); - void on_btnUpdateLater_clicked(); - - /// Starts loading the changelog - void loadChangelog(); - - /// Slot for when the chengelog loads successfully. - void changelogLoaded(); - - /// Slot for when the chengelog fails to load... - void changelogFailed(); - -private: - ByteArrayDownloadPtr changelogDownload; - NetJobPtr dljob; -}; diff --git a/gui/dialogs/UpdateDialog.ui b/gui/dialogs/UpdateDialog.ui deleted file mode 100644 index 06f4f086..00000000 --- a/gui/dialogs/UpdateDialog.ui +++ /dev/null @@ -1,106 +0,0 @@ - - - UpdateDialog - - - - 0 - 0 - 657 - 673 - - - - MultiMC Update - - - - :/icons/toolbar/checkupdate:/icons/toolbar/checkupdate - - - - - - - - - 14 - - - - - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - changelogBrowser - - - - - - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Bitstream Vera Sans'; font-size:11pt; font-weight:400; font-style:normal;"> -<p align="center" style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:22pt;">Loading changelog...</span></p></body></html> - - - true - - - - - - - - - - 0 - 0 - - - - Update now - - - - - - - Update after MultiMC closes - - - - - - - - 0 - 0 - - - - Don't update yet - - - - - - - - - changelogBrowser - btnUpdateNow - btnUpdateOnExit - btnUpdateLater - - - - - - diff --git a/gui/dialogs/VersionSelectDialog.cpp b/gui/dialogs/VersionSelectDialog.cpp deleted file mode 100644 index a0a58699..00000000 --- a/gui/dialogs/VersionSelectDialog.cpp +++ /dev/null @@ -1,177 +0,0 @@ -/* Copyright 2013-2015 MultiMC Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "VersionSelectDialog.h" -#include "ui_VersionSelectDialog.h" - -#include - -#include -#include "gui/Platform.h" - -#include -#include -#include -#include -#include - -class VersionSelectProxyModel : public QSortFilterProxyModel -{ - Q_OBJECT -public: - VersionSelectProxyModel(QObject *parent = 0) : QSortFilterProxyModel(parent) - { - } - - struct Filter - { - QString string; - bool exact = false; - }; - - QHash filters() const - { - return m_filters; - } - void setFilter(const int column, const QString &filter, const bool exact) - { - Filter f; - f.string = filter; - f.exact = exact; - m_filters[column] = f; - invalidateFilter(); - } - void clearFilters() - { - m_filters.clear(); - invalidateFilter(); - } - -protected: - bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const - { - for (auto it = m_filters.begin(); it != m_filters.end(); ++it) - { - const QString version = - sourceModel()->index(source_row, it.key()).data().toString(); - - if (it.value().exact) - { - if (version != it.value().string) - { - return false; - } - continue; - } - - if (!Util::versionIsInInterval(version, it.value().string)) - { - return false; - } - } - return true; - } - - QHash m_filters; -}; - -VersionSelectDialog::VersionSelectDialog(BaseVersionList *vlist, QString title, QWidget *parent, - bool cancelable) - : QDialog(parent), ui(new Ui::VersionSelectDialog) -{ - MultiMCPlatform::fixWM_CLASS(this); - ui->setupUi(this); - setWindowModality(Qt::WindowModal); - setWindowTitle(title); - - m_vlist = vlist; - - m_proxyModel = new VersionSelectProxyModel(this); - m_proxyModel->setSourceModel(vlist); - - ui->listView->setModel(m_proxyModel); - ui->listView->header()->setSectionResizeMode(QHeaderView::ResizeToContents); - ui->listView->header()->setSectionResizeMode(resizeOnColumn, QHeaderView::Stretch); - - if (!cancelable) - { - ui->buttonBox->button(QDialogButtonBox::Cancel)->setEnabled(false); - } -} - -void VersionSelectDialog::setEmptyString(QString emptyString) -{ - ui->listView->setEmptyString(emptyString); -} - -VersionSelectDialog::~VersionSelectDialog() -{ - delete ui; -} - -void VersionSelectDialog::setResizeOn(int column) -{ - ui->listView->header()->setSectionResizeMode(resizeOnColumn, QHeaderView::ResizeToContents); - resizeOnColumn = column; - ui->listView->header()->setSectionResizeMode(resizeOnColumn, QHeaderView::Stretch); -} - -int VersionSelectDialog::exec() -{ - QDialog::open(); - if (!m_vlist->isLoaded()) - { - loadList(); - } - m_proxyModel->invalidate(); - return QDialog::exec(); -} - -void VersionSelectDialog::loadList() -{ - Task *loadTask = m_vlist->getLoadTask(); - if (!loadTask) - { - return; - } - ProgressDialog *taskDlg = new ProgressDialog(this); - loadTask->setParent(taskDlg); - taskDlg->exec(loadTask); - delete taskDlg; -} - -BaseVersionPtr VersionSelectDialog::selectedVersion() const -{ - auto currentIndex = ui->listView->selectionModel()->currentIndex(); - auto variant = m_proxyModel->data(currentIndex, BaseVersionList::VersionPointerRole); - return variant.value(); -} - -void VersionSelectDialog::on_refreshButton_clicked() -{ - loadList(); -} - -void VersionSelectDialog::setExactFilter(int column, QString filter) -{ - m_proxyModel->setFilter(column, filter, true); -} - -void VersionSelectDialog::setFuzzyFilter(int column, QString filter) -{ - m_proxyModel->setFilter(column, filter, false); -} - -#include "VersionSelectDialog.moc" diff --git a/gui/dialogs/VersionSelectDialog.h b/gui/dialogs/VersionSelectDialog.h deleted file mode 100644 index 3bb28b83..00000000 --- a/gui/dialogs/VersionSelectDialog.h +++ /dev/null @@ -1,66 +0,0 @@ -/* Copyright 2013-2015 MultiMC Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include -#include - -#include "logic/BaseVersion.h" - -class BaseVersionList; - -namespace Ui -{ -class VersionSelectDialog; -} - -class VersionSelectProxyModel; - -class VersionSelectDialog : public QDialog -{ - Q_OBJECT - -public: - explicit VersionSelectDialog(BaseVersionList *vlist, QString title, QWidget *parent = 0, - bool cancelable = true); - ~VersionSelectDialog(); - - virtual int exec(); - - //! Starts a task that loads the list. - void loadList(); - - BaseVersionPtr selectedVersion() const; - - void setFuzzyFilter(int column, QString filter); - void setExactFilter(int column, QString filter); - void setEmptyString(QString emptyString); - void setResizeOn(int column); - void setUseLatest(const bool useLatest); - -private -slots: - void on_refreshButton_clicked(); - -private: - Ui::VersionSelectDialog *ui; - - BaseVersionList *m_vlist; - - VersionSelectProxyModel *m_proxyModel; - - int resizeOnColumn = 0; -}; diff --git a/gui/dialogs/VersionSelectDialog.ui b/gui/dialogs/VersionSelectDialog.ui deleted file mode 100644 index 07e9e73e..00000000 --- a/gui/dialogs/VersionSelectDialog.ui +++ /dev/null @@ -1,110 +0,0 @@ - - - VersionSelectDialog - - - - 0 - 0 - 400 - 347 - - - - Choose Version - - - - - - Qt::ScrollBarAlwaysOff - - - true - - - false - - - false - - - true - - - true - - - false - - - - - - - - - Reloads the version list. - - - &Refresh - - - - - - - Qt::Horizontal - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - - - - - - - VersionListView - QTreeView -
    gui/widgets/VersionListView.h
    -
    -
    - - - - buttonBox - accepted() - VersionSelectDialog - accept() - - - 257 - 290 - - - 157 - 274 - - - - - buttonBox - rejected() - VersionSelectDialog - reject() - - - 325 - 290 - - - 286 - 274 - - - - -
    diff --git a/gui/groupview/GroupView.cpp b/gui/groupview/GroupView.cpp deleted file mode 100644 index 89694b87..00000000 --- a/gui/groupview/GroupView.cpp +++ /dev/null @@ -1,1003 +0,0 @@ -#include "GroupView.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "VisualGroup.h" -#include - -template bool listsIntersect(const QList &l1, const QList t2) -{ - for (auto &item : l1) - { - if (t2.contains(item)) - { - return true; - } - } - return false; -} - -GroupView::GroupView(QWidget *parent) - : QAbstractItemView(parent) -{ - setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); - setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); - setAcceptDrops(true); - setAutoScroll(true); -} - -GroupView::~GroupView() -{ - qDeleteAll(m_groups); - m_groups.clear(); -} - -void GroupView::setModel(QAbstractItemModel *model) -{ - QAbstractItemView::setModel(model); - connect(model, &QAbstractItemModel::modelReset, this, &GroupView::modelReset); -} - -void GroupView::dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, - const QVector &roles) -{ - scheduleDelayedItemsLayout(); -} -void GroupView::rowsInserted(const QModelIndex &parent, int start, int end) -{ - scheduleDelayedItemsLayout(); -} - -void GroupView::rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end) -{ - scheduleDelayedItemsLayout(); -} - -class LocaleString : public QString -{ -public: - LocaleString(const char *s) : QString(s) - { - } - LocaleString(const QString &s) : QString(s) - { - } -}; - -inline bool operator<(const LocaleString &lhs, const LocaleString &rhs) -{ - return (QString::localeAwareCompare(lhs, rhs) < 0); -} - -void GroupView::updateGeometries() -{ - geometryCache.clear(); - int previousScroll = verticalScrollBar()->value(); - - QMap cats; - - for (int i = 0; i < model()->rowCount(); ++i) - { - const QString groupName = - model()->index(i, 0).data(GroupViewRoles::GroupRole).toString(); - if (!cats.contains(groupName)) - { - VisualGroup *old = this->category(groupName); - if (old) - { - cats.insert(groupName, new VisualGroup(old)); - } - else - { - cats.insert(groupName, new VisualGroup(groupName, this)); - } - } - } - - /*if (m_editedCategory) - { - m_editedCategory = cats[m_editedCategory->text]; - }*/ - - qDeleteAll(m_groups); - m_groups = cats.values(); - - for (auto cat : m_groups) - { - cat->update(); - } - - if (m_groups.isEmpty()) - { - verticalScrollBar()->setRange(0, 0); - } - else - { - int totalHeight = 0; - // top margin - totalHeight += m_categoryMargin; - int itemScroll = 0; - for (auto category : m_groups) - { - category->m_verticalPosition = totalHeight; - totalHeight += category->totalHeight() + m_categoryMargin; - if(!itemScroll && category->totalHeight() != 0) - { - itemScroll = category->contentHeight() / category->numRows(); - } - } - // do not divide by zero - if(itemScroll == 0) - itemScroll = 64; - - totalHeight += m_bottomMargin; - verticalScrollBar()->setSingleStep ( itemScroll ); - const int rowsPerPage = qMax ( viewport()->height() / itemScroll, 1 ); - verticalScrollBar()->setPageStep ( rowsPerPage * itemScroll ); - - verticalScrollBar()->setRange(0, totalHeight - height()); - } - - verticalScrollBar()->setValue(qMin(previousScroll, verticalScrollBar()->maximum())); - - viewport()->update(); -} - -void GroupView::modelReset() -{ - scheduleDelayedItemsLayout(); - executeDelayedItemsLayout(); -} - -bool GroupView::isIndexHidden(const QModelIndex &index) const -{ - VisualGroup *cat = category(index); - if (cat) - { - return cat->collapsed; - } - else - { - return false; - } -} - -VisualGroup *GroupView::category(const QModelIndex &index) const -{ - return category(index.data(GroupViewRoles::GroupRole).toString()); -} - -VisualGroup *GroupView::category(const QString &cat) const -{ - for (auto group : m_groups) - { - if (group->text == cat) - { - return group; - } - } - return nullptr; -} - -VisualGroup *GroupView::categoryAt(const QPoint &pos) const -{ - for (auto group : m_groups) - { - if(group->hitScan(pos) & VisualGroup::CheckboxHit) - { - return group; - } - } - return nullptr; -} - -int GroupView::calculateItemsPerRow() const -{ - return qFloor((qreal)(contentWidth()) / (qreal)(itemWidth() + m_spacing)); -} - -int GroupView::contentWidth() const -{ - return width() - m_leftMargin - m_rightMargin; -} - -int GroupView::itemWidth() const -{ - return m_itemWidth; -} - -void GroupView::mousePressEvent(QMouseEvent *event) -{ - // endCategoryEditor(); - - QPoint visualPos = event->pos(); - QPoint geometryPos = event->pos() + offset(); - - QPersistentModelIndex index = indexAt(visualPos); - - m_pressedIndex = index; - m_pressedAlreadySelected = selectionModel()->isSelected(m_pressedIndex); - m_pressedPosition = geometryPos; - - m_pressedCategory = categoryAt(geometryPos); - if (m_pressedCategory) - { - setState(m_pressedCategory->collapsed ? ExpandingState : CollapsingState); - event->accept(); - return; - } - - if (index.isValid() && (index.flags() & Qt::ItemIsEnabled)) - { - if(index != currentIndex()) - { - // FIXME: better! - m_currentCursorColumn = -1; - } - // we disable scrollTo for mouse press so the item doesn't change position - // when the user is interacting with it (ie. clicking on it) - bool autoScroll = hasAutoScroll(); - setAutoScroll(false); - selectionModel()->setCurrentIndex(index, QItemSelectionModel::NoUpdate); - - setAutoScroll(autoScroll); - QRect rect(visualPos, visualPos); - setSelection(rect, QItemSelectionModel::ClearAndSelect); - - // signal handlers may change the model - emit pressed(index); - } - else - { - // Forces a finalize() even if mouse is pressed, but not on a item - selectionModel()->select(QModelIndex(), QItemSelectionModel::Select); - } -} - -void GroupView::mouseMoveEvent(QMouseEvent *event) -{ - QPoint topLeft; - QPoint visualPos = event->pos(); - QPoint geometryPos = event->pos() + offset(); - - if (state() == ExpandingState || state() == CollapsingState) - { - return; - } - - if (state() == DraggingState) - { - topLeft = m_pressedPosition - offset(); - if ((topLeft - event->pos()).manhattanLength() > QApplication::startDragDistance()) - { - m_pressedIndex = QModelIndex(); - startDrag(model()->supportedDragActions()); - setState(NoState); - stopAutoScroll(); - } - return; - } - - if (selectionMode() != SingleSelection) - { - topLeft = m_pressedPosition - offset(); - } - else - { - topLeft = geometryPos; - } - - if (m_pressedIndex.isValid() && (state() != DragSelectingState) && - (event->buttons() != Qt::NoButton) && !selectedIndexes().isEmpty()) - { - setState(DraggingState); - return; - } - - if ((event->buttons() & Qt::LeftButton) && selectionModel()) - { - setState(DragSelectingState); - - setSelection(QRect(visualPos, visualPos), QItemSelectionModel::ClearAndSelect); - QModelIndex index = indexAt(visualPos); - - // set at the end because it might scroll the view - if (index.isValid() && (index != selectionModel()->currentIndex()) && - (index.flags() & Qt::ItemIsEnabled)) - { - selectionModel()->setCurrentIndex(index, QItemSelectionModel::NoUpdate); - } - } -} - -void GroupView::mouseReleaseEvent(QMouseEvent *event) -{ - QPoint visualPos = event->pos(); - QPoint geometryPos = event->pos() + offset(); - QPersistentModelIndex index = indexAt(visualPos); - - bool click = (index == m_pressedIndex && index.isValid()) || - (m_pressedCategory && m_pressedCategory == categoryAt(geometryPos)); - - if (click && m_pressedCategory) - { - if (state() == ExpandingState) - { - m_pressedCategory->collapsed = false; - updateGeometries(); - viewport()->update(); - event->accept(); - return; - } - else if (state() == CollapsingState) - { - m_pressedCategory->collapsed = true; - updateGeometries(); - viewport()->update(); - event->accept(); - return; - } - } - - m_ctrlDragSelectionFlag = QItemSelectionModel::NoUpdate; - - setState(NoState); - - if (click) - { - if (event->button() == Qt::LeftButton) - { - emit clicked(index); - } - QStyleOptionViewItem option = viewOptions(); - if (m_pressedAlreadySelected) - { - option.state |= QStyle::State_Selected; - } - if ((model()->flags(index) & Qt::ItemIsEnabled) && - style()->styleHint(QStyle::SH_ItemView_ActivateItemOnSingleClick, &option, this)) - { - emit activated(index); - } - } -} - -void GroupView::mouseDoubleClickEvent(QMouseEvent *event) -{ - QModelIndex index = indexAt(event->pos()); - if (!index.isValid() || !(index.flags() & Qt::ItemIsEnabled) || (m_pressedIndex != index)) - { - QMouseEvent me(QEvent::MouseButtonPress, event->localPos(), event->windowPos(), - event->screenPos(), event->button(), event->buttons(), - event->modifiers()); - mousePressEvent(&me); - return; - } - // signal handlers may change the model - QPersistentModelIndex persistent = index; - emit doubleClicked(persistent); -} - -void GroupView::paintEvent(QPaintEvent *event) -{ - executeDelayedItemsLayout(); - - QPainter painter(this->viewport()); - - QStyleOptionViewItemV4 option(viewOptions()); - option.widget = this; - - int wpWidth = viewport()->width(); - option.rect.setWidth(wpWidth); - for (int i = 0; i < m_groups.size(); ++i) - { - VisualGroup *category = m_groups.at(i); - int y = category->verticalPosition(); - y -= verticalOffset(); - QRect backup = option.rect; - int height = category->totalHeight(); - option.rect.setTop(y); - option.rect.setHeight(height); - option.rect.setLeft(m_leftMargin); - option.rect.setRight(wpWidth - m_rightMargin); - category->drawHeader(&painter, option); - y += category->totalHeight() + m_categoryMargin; - option.rect = backup; - } - - for (int i = 0; i < model()->rowCount(); ++i) - { - const QModelIndex index = model()->index(i, 0); - if (isIndexHidden(index)) - { - continue; - } - Qt::ItemFlags flags = index.flags(); - option.rect = visualRect(index); - option.features |= - QStyleOptionViewItemV2::WrapText; // FIXME: what is the meaning of this anyway? - if (flags & Qt::ItemIsSelectable && selectionModel()->isSelected(index)) - { - option.state |= selectionModel()->isSelected(index) ? QStyle::State_Selected - : QStyle::State_None; - } - else - { - option.state &= ~QStyle::State_Selected; - } - option.state |= (index == currentIndex()) ? QStyle::State_HasFocus : QStyle::State_None; - if (!(flags & Qt::ItemIsEnabled)) - { - option.state &= ~QStyle::State_Enabled; - } - itemDelegate()->paint(&painter, option, index); - } - - /* - * Drop indicators for manual reordering... - */ -#if 0 - if (!m_lastDragPosition.isNull()) - { - QPair pair = rowDropPos(m_lastDragPosition); - Group *category = pair.first; - int row = pair.second; - if (category) - { - int internalRow = row - category->firstItemIndex; - QLine line; - if (internalRow >= category->numItems()) - { - QRect toTheRightOfRect = visualRect(category->lastItem()); - line = QLine(toTheRightOfRect.topRight(), toTheRightOfRect.bottomRight()); - } - else - { - QRect toTheLeftOfRect = visualRect(model()->index(row, 0)); - line = QLine(toTheLeftOfRect.topLeft(), toTheLeftOfRect.bottomLeft()); - } - painter.save(); - painter.setPen(QPen(Qt::black, 3)); - painter.drawLine(line); - painter.restore(); - } - } -#endif -} - -void GroupView::resizeEvent(QResizeEvent *event) -{ - int newItemsPerRow = calculateItemsPerRow(); - if(newItemsPerRow != m_currentItemsPerRow) - { - m_currentCursorColumn = -1; - m_currentItemsPerRow = newItemsPerRow; - updateGeometries(); - } -} - -void GroupView::dragEnterEvent(QDragEnterEvent *event) -{ - if (!isDragEventAccepted(event)) - { - return; - } - m_lastDragPosition = event->pos() + offset(); - viewport()->update(); - event->accept(); -} - -void GroupView::dragMoveEvent(QDragMoveEvent *event) -{ - if (!isDragEventAccepted(event)) - { - return; - } - m_lastDragPosition = event->pos() + offset(); - viewport()->update(); - event->accept(); -} - -void GroupView::dragLeaveEvent(QDragLeaveEvent *event) -{ - m_lastDragPosition = QPoint(); - viewport()->update(); -} - -void GroupView::dropEvent(QDropEvent *event) -{ - m_lastDragPosition = QPoint(); - - stopAutoScroll(); - setState(NoState); - - if (event->source() != this || !(event->possibleActions() & Qt::MoveAction)) - { - return; - } - - QPair dropPos = rowDropPos(event->pos() + offset()); - const VisualGroup *category = dropPos.first; - const int row = dropPos.second; - - if (row == -1) - { - viewport()->update(); - return; - } - - const QString categoryText = category->text; - if (model()->dropMimeData(event->mimeData(), Qt::MoveAction, row, 0, QModelIndex())) - { - model()->setData(model()->index(row, 0), categoryText, - GroupViewRoles::GroupRole); - event->setDropAction(Qt::MoveAction); - event->accept(); - } - updateGeometries(); - viewport()->update(); -} - -void GroupView::startDrag(Qt::DropActions supportedActions) -{ - QModelIndexList indexes = selectionModel()->selectedIndexes(); - if(indexes.count() == 0) - return; - - QMimeData *data = model()->mimeData(indexes); - if (!data) - { - return; - } - QRect rect; - QPixmap pixmap = renderToPixmap(indexes, &rect); - //rect.translate(offset()); - // rect.adjust(horizontalOffset(), verticalOffset(), 0, 0); - QDrag *drag = new QDrag(this); - drag->setPixmap(pixmap); - drag->setMimeData(data); - Qt::DropAction defaultDropAction = Qt::IgnoreAction; - if (this->defaultDropAction() != Qt::IgnoreAction && - (supportedActions & this->defaultDropAction())) - { - defaultDropAction = this->defaultDropAction(); - } - if (drag->exec(supportedActions, defaultDropAction) == Qt::MoveAction) - { - const QItemSelection selection = selectionModel()->selection(); - - for (auto it = selection.constBegin(); it != selection.constEnd(); ++it) - { - QModelIndex parent = (*it).parent(); - if ((*it).left() != 0) - { - continue; - } - if ((*it).right() != (model()->columnCount(parent) - 1)) - { - continue; - } - int count = (*it).bottom() - (*it).top() + 1; - model()->removeRows((*it).top(), count, parent); - } - } -} - -QRect GroupView::visualRect(const QModelIndex &index) const -{ - return geometryRect(index).translated(-offset()); -} - -QRect GroupView::geometryRect(const QModelIndex &index) const -{ - if (!index.isValid() || isIndexHidden(index) || index.column() > 0) - { - return QRect(); - } - - int row = index.row(); - if(geometryCache.contains(row)) - { - return *geometryCache[row]; - } - - const VisualGroup *cat = category(index); - QPair pos = cat->positionOf(index); - int x = pos.first; - // int y = pos.second; - - QRect out; - out.setTop(cat->verticalPosition() + cat->headerHeight() + 5 + cat->rowTopOf(index)); - out.setLeft(m_spacing + x * (itemWidth() + m_spacing)); - out.setSize(itemDelegate()->sizeHint(viewOptions(), index)); - geometryCache.insert(row, new QRect(out)); - return out; -} - -QModelIndex GroupView::indexAt(const QPoint &point) const -{ - for (int i = 0; i < model()->rowCount(); ++i) - { - QModelIndex index = model()->index(i, 0); - if (visualRect(index).contains(point)) - { - return index; - } - } - return QModelIndex(); -} - -void GroupView::setSelection(const QRect &rect, - const QItemSelectionModel::SelectionFlags commands) -{ - for (int i = 0; i < model()->rowCount(); ++i) - { - QModelIndex index = model()->index(i, 0); - QRect itemRect = visualRect(index); - if (itemRect.intersects(rect)) - { - selectionModel()->select(index, commands); - update(itemRect.translated(-offset())); - } - } -} - -QPixmap GroupView::renderToPixmap(const QModelIndexList &indices, QRect *r) const -{ - Q_ASSERT(r); - auto paintPairs = draggablePaintPairs(indices, r); - if (paintPairs.isEmpty()) - { - return QPixmap(); - } - QPixmap pixmap(r->size()); - pixmap.fill(Qt::transparent); - QPainter painter(&pixmap); - QStyleOptionViewItem option = viewOptions(); - option.state |= QStyle::State_Selected; - for (int j = 0; j < paintPairs.count(); ++j) - { - option.rect = paintPairs.at(j).first.translated(-r->topLeft()); - const QModelIndex ¤t = paintPairs.at(j).second; - itemDelegate()->paint(&painter, option, current); - } - return pixmap; -} - -QList> GroupView::draggablePaintPairs(const QModelIndexList &indices, - QRect *r) const -{ - Q_ASSERT(r); - QRect &rect = *r; - QList> ret; - for (int i = 0; i < indices.count(); ++i) - { - const QModelIndex &index = indices.at(i); - const QRect current = geometryRect(index); - ret += qMakePair(current, index); - rect |= current; - } - return ret; -} - -bool GroupView::isDragEventAccepted(QDropEvent *event) -{ - return false; -} - -QPair GroupView::rowDropPos(const QPoint &pos) -{ - return qMakePair(nullptr, -1); - // FIXME: PIXIE DUST. - /* - // check that we aren't on a category header and calculate which category we're in - VisualGroup *category = 0; - { - int y = 0; - for (auto cat : m_groups) - { - if (pos.y() > y && pos.y() < (y + cat->headerHeight())) - { - return qMakePair(nullptr, -1); - } - y += cat->totalHeight() + m_categoryMargin; - if (pos.y() < y) - { - category = cat; - break; - } - } - if (category == 0) - { - return qMakePair(nullptr, -1); - } - } - - QList indices = category->items(); - - // calculate the internal column - int internalColumn = -1; - { - const int itemWidth = this->itemWidth(); - if (pos.x() >= (itemWidth * itemsPerRow())) - { - internalColumn = itemsPerRow(); - } - else - { - for (int i = 0, c = 0; i < contentWidth(); i += itemWidth + 10 , ++c) - { - if (pos.x() > (i - itemWidth / 2) && pos.x() <= (i + itemWidth / 2)) - { - internalColumn = c; - break; - } - } - } - if (internalColumn == -1) - { - return qMakePair(nullptr, -1); - } - } - - // calculate the internal row - int internalRow = -1; - { - // FIXME rework the drag and drop code - const int top = category->verticalPosition(); - for (int r = 0, h = top; r < category->numRows(); - h += itemHeightForCategoryRow(category, r), ++r) - { - if (pos.y() > h && pos.y() < (h + itemHeightForCategoryRow(category, r))) - { - internalRow = r; - break; - } - } - if (internalRow == -1) - { - return qMakePair(nullptr, -1); - } - // this happens if we're in the margin between a one category and another - // categories header - if (internalRow > (indices.size() / itemsPerRow())) - { - return qMakePair(nullptr, -1); - } - } - - // flaten the internalColumn/internalRow to one row - int categoryRow = internalRow * itemsPerRow() + internalColumn; - - // this is used if we're past the last item - if (categoryRow >= indices.size()) - { - return qMakePair(category, indices.last().row() + 1); - } - - return qMakePair(category, indices.at(categoryRow).row()); - */ -} - -QPoint GroupView::offset() const -{ - return QPoint(horizontalOffset(), verticalOffset()); -} - -QRegion GroupView::visualRegionForSelection(const QItemSelection &selection) const -{ - QRegion region; - for (auto &range : selection) - { - int start_row = range.top(); - int end_row = range.bottom(); - for (int row = start_row; row <= end_row; ++row) - { - int start_column = range.left(); - int end_column = range.right(); - for (int column = start_column; column <= end_column; ++column) - { - QModelIndex index = model()->index(row, column, rootIndex()); - region += visualRect(index); // OK - } - } - } - return region; -} - -QModelIndex GroupView::moveCursor(QAbstractItemView::CursorAction cursorAction, - Qt::KeyboardModifiers modifiers) -{ - auto current = currentIndex(); - if(!current.isValid()) - { - return current; - } - auto cat = category(current); - int group_index = m_groups.indexOf(cat); - if(group_index < 0) - return current; - - auto real_group = m_groups[group_index]; - int beginning_row = 0; - for(auto group: m_groups) - { - if(group == real_group) - break; - beginning_row += group->numRows(); - } - - QPair pos = cat->positionOf(current); - int column = pos.first; - int row = pos.second; - if(m_currentCursorColumn < 0) - { - m_currentCursorColumn = column; - } - switch(cursorAction) - { - case MoveUp: - { - if(row == 0) - { - int prevgroupindex = group_index-1; - while(prevgroupindex >= 0) - { - auto prevgroup = m_groups[prevgroupindex]; - if(prevgroup->collapsed) - { - prevgroupindex--; - continue; - } - int newRow = prevgroup->numRows() - 1; - int newRowSize = prevgroup->rows[newRow].size(); - int newColumn = m_currentCursorColumn; - if (m_currentCursorColumn >= newRowSize) - { - newColumn = newRowSize - 1; - } - return prevgroup->rows[newRow][newColumn]; - } - } - else - { - int newRow = row - 1; - int newRowSize = cat->rows[newRow].size(); - int newColumn = m_currentCursorColumn; - if (m_currentCursorColumn >= newRowSize) - { - newColumn = newRowSize - 1; - } - return cat->rows[newRow][newColumn]; - } - return current; - } - case MoveDown: - { - if(row == cat->rows.size() - 1) - { - int nextgroupindex = group_index+1; - while (nextgroupindex < m_groups.size()) - { - auto nextgroup = m_groups[nextgroupindex]; - if(nextgroup->collapsed) - { - nextgroupindex++; - continue; - } - int newRowSize = nextgroup->rows[0].size(); - int newColumn = m_currentCursorColumn; - if (m_currentCursorColumn >= newRowSize) - { - newColumn = newRowSize - 1; - } - return nextgroup->rows[0][newColumn]; - } - } - else - { - int newRow = row + 1; - int newRowSize = cat->rows[newRow].size(); - int newColumn = m_currentCursorColumn; - if (m_currentCursorColumn >= newRowSize) - { - newColumn = newRowSize - 1; - } - return cat->rows[newRow][newColumn]; - } - return current; - } - case MoveLeft: - { - if(column > 0) - { - m_currentCursorColumn = column - 1; - return cat->rows[row][column - 1]; - } - // TODO: moving to previous line - return current; - } - case MoveRight: - { - if(column < cat->rows[row].size() - 1) - { - m_currentCursorColumn = column + 1; - return cat->rows[row][column + 1]; - } - // TODO: moving to next line - return current; - } - case MoveHome: - { - m_currentCursorColumn = 0; - return cat->rows[row][0]; - } - case MoveEnd: - { - auto last = cat->rows[row].size() - 1; - m_currentCursorColumn = last; - return cat->rows[row][last]; - } - default: - break; - } - return current; -} - -int GroupView::horizontalOffset() const -{ - return horizontalScrollBar()->value(); -} - -int GroupView::verticalOffset() const -{ - return verticalScrollBar()->value(); -} - -void GroupView::scrollContentsBy(int dx, int dy) -{ - scrollDirtyRegion(dx, dy); - viewport()->scroll(dx, dy); -} - -void GroupView::scrollTo(const QModelIndex &index, ScrollHint hint) -{ - if (!index.isValid()) - return; - - const QRect rect = visualRect(index); - if (hint == EnsureVisible && viewport()->rect().contains(rect)) - { - viewport()->update(rect); - return; - } - - verticalScrollBar()->setValue(verticalScrollToValue(index, rect, hint)); -} - -int GroupView::verticalScrollToValue(const QModelIndex &index, const QRect &rect, - QListView::ScrollHint hint) const -{ - const QRect area = viewport()->rect(); - const bool above = (hint == QListView::EnsureVisible && rect.top() < area.top()); - const bool below = (hint == QListView::EnsureVisible && rect.bottom() > area.bottom()); - - int verticalValue = verticalScrollBar()->value(); - QRect adjusted = rect.adjusted(-spacing(), -spacing(), spacing(), spacing()); - if (hint == QListView::PositionAtTop || above) - verticalValue += adjusted.top(); - else if (hint == QListView::PositionAtBottom || below) - verticalValue += qMin(adjusted.top(), adjusted.bottom() - area.height() + 1); - else if (hint == QListView::PositionAtCenter) - verticalValue += adjusted.top() - ((area.height() - adjusted.height()) / 2); - return verticalValue; -} diff --git a/gui/groupview/GroupView.h b/gui/groupview/GroupView.h deleted file mode 100644 index 93e45ed7..00000000 --- a/gui/groupview/GroupView.h +++ /dev/null @@ -1,125 +0,0 @@ -#pragma once - -#include -#include -#include -#include - -struct GroupViewRoles -{ - enum - { - GroupRole = Qt::UserRole, - ProgressValueRole, - ProgressMaximumRole - }; -}; - -struct VisualGroup; - -class GroupView : public QAbstractItemView -{ - Q_OBJECT - -public: - GroupView(QWidget *parent = 0); - ~GroupView(); - - void setModel(QAbstractItemModel *model) override; - - /// return geometry rectangle occupied by the specified model item - QRect geometryRect(const QModelIndex &index) const; - /// return visual rectangle occupied by the specified model item - virtual QRect visualRect(const QModelIndex &index) const override; - /// get the model index at the specified visual point - virtual QModelIndex indexAt(const QPoint &point) const override; - void setSelection(const QRect &rect, - const QItemSelectionModel::SelectionFlags commands) override; - - virtual int horizontalOffset() const override; - virtual int verticalOffset() const override; - virtual void scrollContentsBy(int dx, int dy) override; - virtual void scrollTo(const QModelIndex &index, ScrollHint hint = EnsureVisible) override; - - virtual QModelIndex moveCursor(CursorAction cursorAction, - Qt::KeyboardModifiers modifiers) override; - - virtual QRegion visualRegionForSelection(const QItemSelection &selection) const override; - - int spacing() const - { - return m_spacing; - }; -protected -slots: - virtual void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, - const QVector &roles) override; - virtual void rowsInserted(const QModelIndex &parent, int start, int end) override; - virtual void rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end) override; - virtual void updateGeometries() override; - void modelReset(); - -protected: - virtual bool isIndexHidden(const QModelIndex &index) const override; - void mousePressEvent(QMouseEvent *event) override; - void mouseMoveEvent(QMouseEvent *event) override; - void mouseReleaseEvent(QMouseEvent *event) override; - void mouseDoubleClickEvent(QMouseEvent *event) override; - void paintEvent(QPaintEvent *event) override; - void resizeEvent(QResizeEvent *event) override; - - void dragEnterEvent(QDragEnterEvent *event) override; - void dragMoveEvent(QDragMoveEvent *event) override; - void dragLeaveEvent(QDragLeaveEvent *event) override; - void dropEvent(QDropEvent *event) override; - - void startDrag(Qt::DropActions supportedActions) override; - -private: - friend struct VisualGroup; - QList m_groups; - - // geometry - int m_leftMargin = 5; - int m_rightMargin = 5; - int m_bottomMargin = 5; - int m_categoryMargin = 5; - int m_spacing = 5; - int m_itemWidth = 100; - int m_currentItemsPerRow = -1; - int m_currentCursorColumn= -1; - mutable QCache geometryCache; - - // point where the currently active mouse action started in geometry coordinates - QPoint m_pressedPosition; - QPersistentModelIndex m_pressedIndex; - bool m_pressedAlreadySelected; - VisualGroup *m_pressedCategory; - QItemSelectionModel::SelectionFlag m_ctrlDragSelectionFlag; - QPoint m_lastDragPosition; - - VisualGroup *category(const QModelIndex &index) const; - VisualGroup *category(const QString &cat) const; - VisualGroup *categoryAt(const QPoint &pos) const; - - int itemsPerRow() const - { - return m_currentItemsPerRow; - }; - int contentWidth() const; - -private: /* methods */ - int itemWidth() const; - int calculateItemsPerRow() const; - int verticalScrollToValue(const QModelIndex &index, const QRect &rect, - QListView::ScrollHint hint) const; - QPixmap renderToPixmap(const QModelIndexList &indices, QRect *r) const; - QList> draggablePaintPairs(const QModelIndexList &indices, - QRect *r) const; - - bool isDragEventAccepted(QDropEvent *event); - - QPair rowDropPos(const QPoint &pos); - - QPoint offset() const; -}; diff --git a/gui/groupview/GroupedProxyModel.cpp b/gui/groupview/GroupedProxyModel.cpp deleted file mode 100644 index a45c5ae9..00000000 --- a/gui/groupview/GroupedProxyModel.cpp +++ /dev/null @@ -1,42 +0,0 @@ -#include "GroupedProxyModel.h" - -#include "GroupView.h" -#include - -GroupedProxyModel::GroupedProxyModel(QObject *parent) : QSortFilterProxyModel(parent) -{ -} - -bool GroupedProxyModel::lessThan(const QModelIndex &left, const QModelIndex &right) const -{ - const QString leftCategory = left.data(GroupViewRoles::GroupRole).toString(); - const QString rightCategory = right.data(GroupViewRoles::GroupRole).toString(); - if (leftCategory == rightCategory) - { - return subSortLessThan(left, right); - } - else - { - // FIXME: real group sorting happens in GroupView::updateGeometries(), see LocaleString - auto result = leftCategory.localeAwareCompare(rightCategory); - if(result < 0) - { - qDebug() << leftCategory << "<" << rightCategory; - } - if(result == 0) - { - qDebug() << leftCategory << "=" << rightCategory; - return subSortLessThan(left, right); - } - if(result > 0) - { - qDebug() << leftCategory << ">" << rightCategory; - } - return result < 0; - } -} - -bool GroupedProxyModel::subSortLessThan(const QModelIndex &left, const QModelIndex &right) const -{ - return left.row() < right.row(); -} diff --git a/gui/groupview/GroupedProxyModel.h b/gui/groupview/GroupedProxyModel.h deleted file mode 100644 index 12edee0f..00000000 --- a/gui/groupview/GroupedProxyModel.h +++ /dev/null @@ -1,15 +0,0 @@ -#pragma once - -#include - -class GroupedProxyModel : public QSortFilterProxyModel -{ - Q_OBJECT - -public: - GroupedProxyModel(QObject *parent = 0); - -protected: - virtual bool lessThan(const QModelIndex &left, const QModelIndex &right) const override; - virtual bool subSortLessThan(const QModelIndex &left, const QModelIndex &right) const; -}; diff --git a/gui/groupview/InstanceDelegate.cpp b/gui/groupview/InstanceDelegate.cpp deleted file mode 100644 index a195baf6..00000000 --- a/gui/groupview/InstanceDelegate.cpp +++ /dev/null @@ -1,362 +0,0 @@ -/* Copyright 2013-2015 MultiMC Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "InstanceDelegate.h" -#include -#include -#include -#include -#include - -#include "GroupView.h" -#include "logic/BaseInstance.h" -#include "logic/InstanceList.h" - -QCache ListViewDelegate::m_pixmapCache; - -// Origin: Qt -static void viewItemTextLayout(QTextLayout &textLayout, int lineWidth, qreal &height, - qreal &widthUsed) -{ - height = 0; - widthUsed = 0; - textLayout.beginLayout(); - QString str = textLayout.text(); - while (true) - { - QTextLine line = textLayout.createLine(); - if (!line.isValid()) - break; - if (line.textLength() == 0) - break; - line.setLineWidth(lineWidth); - line.setPosition(QPointF(0, height)); - height += line.height(); - widthUsed = qMax(widthUsed, line.naturalTextWidth()); - } - textLayout.endLayout(); -} - -ListViewDelegate::ListViewDelegate(QObject *parent) : QStyledItemDelegate(parent) -{ -} - -void drawSelectionRect(QPainter *painter, const QStyleOptionViewItemV4 &option, - const QRect &rect) -{ - if ((option.state & QStyle::State_Selected)) - painter->fillRect(rect, option.palette.brush(QPalette::Highlight)); - else - { - QColor backgroundColor = option.palette.color(QPalette::Background); - backgroundColor.setAlpha(160); - painter->fillRect(rect, QBrush(backgroundColor)); - } -} - -void drawFocusRect(QPainter *painter, const QStyleOptionViewItemV4 &option, const QRect &rect) -{ - if (!(option.state & QStyle::State_HasFocus)) - return; - QStyleOptionFocusRect opt; - opt.direction = option.direction; - opt.fontMetrics = option.fontMetrics; - opt.palette = option.palette; - opt.rect = rect; - // opt.state = option.state | QStyle::State_KeyboardFocusChange | - // QStyle::State_Item; - auto col = option.state & QStyle::State_Selected ? QPalette::Highlight : QPalette::Base; - opt.backgroundColor = option.palette.color(col); - // Apparently some widget styles expect this hint to not be set - painter->setRenderHint(QPainter::Antialiasing, false); - - QStyle *style = option.widget ? option.widget->style() : QApplication::style(); - - style->drawPrimitive(QStyle::PE_FrameFocusRect, &opt, painter, option.widget); - - painter->setRenderHint(QPainter::Antialiasing); -} - -// TODO this can be made a lot prettier -void drawProgressOverlay(QPainter *painter, const QStyleOptionViewItemV4 &option, - const int value, const int maximum) -{ - if (maximum == 0 || value == maximum) - { - return; - } - - painter->save(); - - qreal percent = (qreal)value / (qreal)maximum; - QColor color = option.palette.color(QPalette::Dark); - color.setAlphaF(0.70f); - painter->setBrush(color); - painter->setPen(QPen(QBrush(), 0)); - painter->drawPie(option.rect, 90 * 16, -percent * 360 * 16); - - painter->restore(); -} - -void drawBadges(QPainter *painter, const QStyleOptionViewItemV4 &option, BaseInstance *instance) -{ - QList pixmaps; - const BaseInstance::InstanceFlags flags = instance->flags(); - if (flags & BaseInstance::VersionBrokenFlag) - { - pixmaps.append("broken"); - } - if (flags & BaseInstance::UpdateAvailable) - { - pixmaps.append("updateavailable"); - } - - // begin easter eggs - if (instance->name().contains("btw", Qt::CaseInsensitive) || - instance->name().contains("better then wolves", Qt::CaseInsensitive) || - instance->name().contains("better than wolves", Qt::CaseInsensitive)) - { - pixmaps.append("herobrine"); - } - if (instance->name().contains("direwolf", Qt::CaseInsensitive)) - { - pixmaps.append("enderman"); - } - if (instance->name().contains("kitten", Qt::CaseInsensitive)) - { - pixmaps.append("kitten"); - } - if (instance->name().contains("derp", Qt::CaseInsensitive)) - { - pixmaps.append("derp"); - } - // end easter eggs - - static const int itemSide = 24; - static const int spacing = 1; - const int itemsPerRow = qMax(1, qFloor(double(option.rect.width() + spacing) / double(itemSide + spacing))); - const int rows = qCeil((double)pixmaps.size() / (double)itemsPerRow); - QListIterator it(pixmaps); - painter->translate(option.rect.topLeft()); - for (int y = 0; y < rows; ++y) - { - for (int x = 0; x < itemsPerRow; ++x) - { - if (!it.hasNext()) - { - return; - } - const QPixmap pixmap = ListViewDelegate::requestBadgePixmap(it.next()).scaled( - itemSide, itemSide, Qt::KeepAspectRatio, Qt::FastTransformation); - painter->drawPixmap(option.rect.width() - x * itemSide + qMax(x - 1, 0) * spacing - itemSide, - y * itemSide + qMax(y - 1, 0) * spacing, itemSide, itemSide, - pixmap); - } - } - painter->translate(-option.rect.topLeft()); -} - -static QSize viewItemTextSize(const QStyleOptionViewItemV4 *option) -{ - QStyle *style = option->widget ? option->widget->style() : QApplication::style(); - QTextOption textOption; - textOption.setWrapMode(QTextOption::WrapAtWordBoundaryOrAnywhere); - QTextLayout textLayout; - textLayout.setTextOption(textOption); - textLayout.setFont(option->font); - textLayout.setText(option->text); - const int textMargin = - style->pixelMetric(QStyle::PM_FocusFrameHMargin, option, option->widget) + 1; - QRect bounds(0, 0, 100 - 2 * textMargin, 600); - qreal height = 0, widthUsed = 0; - viewItemTextLayout(textLayout, bounds.width(), height, widthUsed); - const QSize size(qCeil(widthUsed), qCeil(height)); - return QSize(size.width() + 2 * textMargin, size.height()); -} - -void ListViewDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, - const QModelIndex &index) const -{ - QStyleOptionViewItemV4 opt = option; - initStyleOption(&opt, index); - painter->save(); - painter->setClipRect(opt.rect); - - opt.features |= QStyleOptionViewItem::WrapText; - opt.text = index.data().toString(); - opt.textElideMode = Qt::ElideRight; - opt.displayAlignment = Qt::AlignTop | Qt::AlignHCenter; - - QStyle *style = opt.widget ? opt.widget->style() : QApplication::style(); - - // const int iconSize = style->pixelMetric(QStyle::PM_IconViewIconSize); - const int iconSize = 48; - QRect iconbox = opt.rect; - const int textMargin = style->pixelMetric(QStyle::PM_FocusFrameHMargin, 0, opt.widget) + 1; - QRect textRect = opt.rect; - QRect textHighlightRect = textRect; - // clip the decoration on top, remove width padding - textRect.adjust(textMargin, iconSize + textMargin + 5, -textMargin, 0); - - textHighlightRect.adjust(0, iconSize + 5, 0, 0); - - // draw background - { - // FIXME: unused - // QSize textSize = viewItemTextSize ( &opt ); - QPalette::ColorGroup cg; - QStyleOptionViewItemV4 opt2(opt); - - if ((opt.widget && opt.widget->isEnabled()) || (opt.state & QStyle::State_Enabled)) - { - if (!(opt.state & QStyle::State_Active)) - cg = QPalette::Inactive; - else - cg = QPalette::Normal; - } - else - { - cg = QPalette::Disabled; - } - opt2.palette.setCurrentColorGroup(cg); - - // fill in background, if any - - if (opt.backgroundBrush.style() != Qt::NoBrush) - { - QPointF oldBO = painter->brushOrigin(); - painter->setBrushOrigin(opt.rect.topLeft()); - painter->fillRect(opt.rect, opt.backgroundBrush); - painter->setBrushOrigin(oldBO); - } - - drawSelectionRect(painter, opt2, textHighlightRect); - - /* - if (opt.showDecorationSelected) - { - drawSelectionRect(painter, opt2, opt.rect); - drawFocusRect(painter, opt2, opt.rect); - // painter->fillRect ( opt.rect, opt.palette.brush ( cg, QPalette::Highlight ) ); - } - else - { - - // if ( opt.state & QStyle::State_Selected ) - { - // QRect textRect = subElementRect ( QStyle::SE_ItemViewItemText, opt, - // opt.widget ); - // painter->fillRect ( textHighlightRect, opt.palette.brush ( cg, - // QPalette::Highlight ) ); - drawSelectionRect(painter, opt2, textHighlightRect); - drawFocusRect(painter, opt2, textHighlightRect); - } - } - */ - } - - // draw the icon - { - QIcon::Mode mode = QIcon::Normal; - if (!(opt.state & QStyle::State_Enabled)) - mode = QIcon::Disabled; - else if (opt.state & QStyle::State_Selected) - mode = QIcon::Selected; - QIcon::State state = opt.state & QStyle::State_Open ? QIcon::On : QIcon::Off; - - iconbox.setHeight(iconSize); - opt.icon.paint(painter, iconbox, Qt::AlignCenter, mode, state); - } - // set the text colors - QPalette::ColorGroup cg = - opt.state & QStyle::State_Enabled ? QPalette::Normal : QPalette::Disabled; - if (cg == QPalette::Normal && !(opt.state & QStyle::State_Active)) - cg = QPalette::Inactive; - if (opt.state & QStyle::State_Selected) - { - painter->setPen(opt.palette.color(cg, QPalette::HighlightedText)); - } - else - { - painter->setPen(opt.palette.color(cg, QPalette::Text)); - } - - // draw the text - QTextOption textOption; - textOption.setWrapMode(QTextOption::WrapAtWordBoundaryOrAnywhere); - textOption.setTextDirection(opt.direction); - textOption.setAlignment(QStyle::visualAlignment(opt.direction, opt.displayAlignment)); - QTextLayout textLayout; - textLayout.setTextOption(textOption); - textLayout.setFont(opt.font); - textLayout.setText(opt.text); - - qreal width, height; - viewItemTextLayout(textLayout, textRect.width(), height, width); - - const int lineCount = textLayout.lineCount(); - - const QRect layoutRect = QStyle::alignedRect( - opt.direction, opt.displayAlignment, QSize(textRect.width(), int(height)), textRect); - const QPointF position = layoutRect.topLeft(); - for (int i = 0; i < lineCount; ++i) - { - const QTextLine line = textLayout.lineAt(i); - line.draw(painter, position); - } - - // FIXME: this really has no business of being here. Make generic. - auto instance = (BaseInstance*)index.data(InstanceList::InstancePointerRole) - .value(); - if (instance) - { - drawBadges(painter, opt, instance); - } - - drawProgressOverlay(painter, opt, index.data(GroupViewRoles::ProgressValueRole).toInt(), - index.data(GroupViewRoles::ProgressMaximumRole).toInt()); - - painter->restore(); -} - -QSize ListViewDelegate::sizeHint(const QStyleOptionViewItem &option, - const QModelIndex &index) const -{ - QStyleOptionViewItemV4 opt = option; - initStyleOption(&opt, index); - opt.features |= QStyleOptionViewItem::WrapText; - opt.text = index.data().toString(); - opt.textElideMode = Qt::ElideRight; - opt.displayAlignment = Qt::AlignTop | Qt::AlignHCenter; - - QStyle *style = opt.widget ? opt.widget->style() : QApplication::style(); - const int textMargin = - style->pixelMetric(QStyle::PM_FocusFrameHMargin, &option, opt.widget) + 1; - int height = 48 + textMargin * 2 + 5; // TODO: turn constants into variables - QSize szz = viewItemTextSize(&opt); - height += szz.height(); - // FIXME: maybe the icon items could scale and keep proportions? - QSize sz(100, height); - return sz; -} - -QPixmap ListViewDelegate::requestBadgePixmap(const QString &key) -{ - if (!m_pixmapCache.contains(key)) - { - m_pixmapCache.insert(key, new QPixmap(":/icons/badges/" + key + ".png")); - } - return *m_pixmapCache.object(key); -} diff --git a/gui/groupview/InstanceDelegate.h b/gui/groupview/InstanceDelegate.h deleted file mode 100644 index 2b5439cb..00000000 --- a/gui/groupview/InstanceDelegate.h +++ /dev/null @@ -1,35 +0,0 @@ -/* Copyright 2013-2015 MultiMC Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include -#include - -class ListViewDelegate : public QStyledItemDelegate -{ -public: - explicit ListViewDelegate(QObject *parent = 0); - - static QPixmap requestBadgePixmap(const QString &key); - -protected: - void paint(QPainter *painter, const QStyleOptionViewItem &option, - const QModelIndex &index) const; - QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const; - -private: - static QCache m_pixmapCache; -}; diff --git a/gui/groupview/VisualGroup.cpp b/gui/groupview/VisualGroup.cpp deleted file mode 100644 index 560fc9ca..00000000 --- a/gui/groupview/VisualGroup.cpp +++ /dev/null @@ -1,301 +0,0 @@ -#include "VisualGroup.h" - -#include -#include -#include -#include - -#include "GroupView.h" - -VisualGroup::VisualGroup(const QString &text, GroupView *view) : view(view), text(text), collapsed(false) -{ -} - -VisualGroup::VisualGroup(const VisualGroup *other) - : view(other->view), text(other->text), collapsed(other->collapsed) -{ -} - -void VisualGroup::update() -{ - auto temp_items = items(); - auto itemsPerRow = view->itemsPerRow(); - - int numRows = qMax(1, qCeil((qreal)temp_items.size() / (qreal)itemsPerRow)); - rows = QVector(numRows); - - int maxRowHeight = 0; - int positionInRow = 0; - int currentRow = 0; - int offsetFromTop = 0; - for (auto item: temp_items) - { - if(positionInRow == itemsPerRow) - { - rows[currentRow].height = maxRowHeight; - rows[currentRow].top = offsetFromTop; - currentRow ++; - offsetFromTop += maxRowHeight + 5; - positionInRow = 0; - maxRowHeight = 0; - } - auto itemHeight = view->itemDelegate()->sizeHint(view->viewOptions(), item).height(); - if(itemHeight > maxRowHeight) - { - maxRowHeight = itemHeight; - } - rows[currentRow].items.append(item); - positionInRow++; - } - rows[currentRow].height = maxRowHeight; - rows[currentRow].top = offsetFromTop; -} - -QPair VisualGroup::positionOf(const QModelIndex &index) const -{ - int x = 0; - int y = 0; - for (auto & row: rows) - { - for(auto x = 0; x < row.items.size(); x++) - { - if(row.items[x] == index) - { - return qMakePair(x,y); - } - } - y++; - } - return qMakePair(x, y); -} - -int VisualGroup::rowTopOf(const QModelIndex &index) const -{ - auto position = positionOf(index); - return rows[position.second].top; -} - -int VisualGroup::rowHeightOf(const QModelIndex &index) const -{ - auto position = positionOf(index); - return rows[position.second].height; -} - -VisualGroup::HitResults VisualGroup::hitScan(const QPoint &pos) const -{ - VisualGroup::HitResults results = VisualGroup::NoHit; - int y_start = verticalPosition(); - int body_start = y_start + headerHeight(); - int body_end = body_start + contentHeight() + 5; // FIXME: wtf is this 5? - int y = pos.y(); - // int x = pos.x(); - if (y < y_start) - { - results = VisualGroup::NoHit; - } - else if (y < body_start) - { - results = VisualGroup::HeaderHit; - int collapseSize = headerHeight() - 4; - - // the icon - QRect iconRect = QRect(view->m_leftMargin + 2, 2 + y_start, collapseSize, collapseSize); - if (iconRect.contains(pos)) - { - results |= VisualGroup::CheckboxHit; - } - } - else if (y < body_end) - { - results |= VisualGroup::BodyHit; - } - return results; -} - -void VisualGroup::drawHeader(QPainter *painter, const QStyleOptionViewItem &option) -{ - painter->setRenderHint(QPainter::Antialiasing); - - const QRect optRect = option.rect; - QFont font(QApplication::font()); - font.setBold(true); - const QFontMetrics fontMetrics = QFontMetrics(font); - - QColor outlineColor = option.palette.text().color(); - outlineColor.setAlphaF(0.35); - - //BEGIN: top left corner - { - painter->save(); - painter->setPen(outlineColor); - const QPointF topLeft(optRect.topLeft()); - QRectF arc(topLeft, QSizeF(4, 4)); - arc.translate(0.5, 0.5); - painter->drawArc(arc, 1440, 1440); - painter->restore(); - } - //END: top left corner - - //BEGIN: left vertical line - { - QPoint start(optRect.topLeft()); - start.ry() += 3; - QPoint verticalGradBottom(optRect.topLeft()); - verticalGradBottom.ry() += fontMetrics.height() + 5; - QLinearGradient gradient(start, verticalGradBottom); - gradient.setColorAt(0, outlineColor); - gradient.setColorAt(1, Qt::transparent); - painter->fillRect(QRect(start, QSize(1, fontMetrics.height() + 5)), gradient); - } - //END: left vertical line - - //BEGIN: horizontal line - { - QPoint start(optRect.topLeft()); - start.rx() += 3; - QPoint horizontalGradTop(optRect.topLeft()); - horizontalGradTop.rx() += optRect.width() - 6; - painter->fillRect(QRect(start, QSize(optRect.width() - 6, 1)), outlineColor); - } - //END: horizontal line - - //BEGIN: top right corner - { - painter->save(); - painter->setPen(outlineColor); - QPointF topRight(optRect.topRight()); - topRight.rx() -= 4; - QRectF arc(topRight, QSizeF(4, 4)); - arc.translate(0.5, 0.5); - painter->drawArc(arc, 0, 1440); - painter->restore(); - } - //END: top right corner - - //BEGIN: right vertical line - { - QPoint start(optRect.topRight()); - start.ry() += 3; - QPoint verticalGradBottom(optRect.topRight()); - verticalGradBottom.ry() += fontMetrics.height() + 5; - QLinearGradient gradient(start, verticalGradBottom); - gradient.setColorAt(0, outlineColor); - gradient.setColorAt(1, Qt::transparent); - painter->fillRect(QRect(start, QSize(1, fontMetrics.height() + 5)), gradient); - } - //END: right vertical line - - //BEGIN: checkboxy thing - { - painter->save(); - painter->setRenderHint(QPainter::Antialiasing, false); - painter->setFont(font); - QColor penColor(option.palette.text().color()); - penColor.setAlphaF(0.6); - painter->setPen(penColor); - QRect iconSubRect(option.rect); - iconSubRect.setTop(iconSubRect.top() + 7); - iconSubRect.setLeft(iconSubRect.left() + 7); - - int sizing = fontMetrics.height(); - int even = ( (sizing - 1) % 2 ); - - iconSubRect.setHeight(sizing - even); - iconSubRect.setWidth(sizing - even); - painter->drawRect(iconSubRect); - - - /* - if(collapsed) - painter->drawText(iconSubRect, Qt::AlignHCenter | Qt::AlignVCenter, "+"); - else - painter->drawText(iconSubRect, Qt::AlignHCenter | Qt::AlignVCenter, "-"); - */ - painter->setBrush(option.palette.text()); - painter->fillRect(iconSubRect.x(), iconSubRect.y() + iconSubRect.height() / 2, - iconSubRect.width(), 2, penColor); - if (collapsed) - { - painter->fillRect(iconSubRect.x() + iconSubRect.width() / 2, iconSubRect.y(), 2, - iconSubRect.height(), penColor); - } - - painter->restore(); - } - //END: checkboxy thing - - //BEGIN: text - { - QRect textRect(option.rect); - textRect.setTop(textRect.top() + 7); - textRect.setLeft(textRect.left() + 7 + fontMetrics.height() + 7); - textRect.setHeight(fontMetrics.height()); - textRect.setRight(textRect.right() - 7); - - painter->save(); - painter->setFont(font); - QColor penColor(option.palette.text().color()); - penColor.setAlphaF(0.6); - painter->setPen(penColor); - painter->drawText(textRect, Qt::AlignLeft | Qt::AlignVCenter, text); - painter->restore(); - } - //END: text -} - -int VisualGroup::totalHeight() const -{ - return headerHeight() + 5 + contentHeight(); // FIXME: wtf is that '5'? -} - -int VisualGroup::headerHeight() const -{ - QFont font(QApplication::font()); - font.setBold(true); - QFontMetrics fontMetrics(font); - - const int height = fontMetrics.height() + 1 /* 1 pixel-width gradient */ - + 11 /* top and bottom separation */; - return height; - /* - int raw = view->viewport()->fontMetrics().height() + 4; - // add english. maybe. depends on font height. - if (raw % 2 == 0) - raw++; - return std::min(raw, 25); - */ -} - -int VisualGroup::contentHeight() const -{ - if (collapsed) - { - return 0; - } - auto last = rows[numRows() - 1]; - return last.top + last.height; -} - -int VisualGroup::numRows() const -{ - return rows.size(); -} - -int VisualGroup::verticalPosition() const -{ - return m_verticalPosition; -} - -QList VisualGroup::items() const -{ - QList indices; - for (int i = 0; i < view->model()->rowCount(); ++i) - { - const QModelIndex index = view->model()->index(i, 0); - if (index.data(GroupViewRoles::GroupRole).toString() == text) - { - indices.append(index); - } - } - return indices; -} diff --git a/gui/groupview/VisualGroup.h b/gui/groupview/VisualGroup.h deleted file mode 100644 index d8d1f145..00000000 --- a/gui/groupview/VisualGroup.h +++ /dev/null @@ -1,91 +0,0 @@ -#pragma once - -#include -#include -#include -#include - -class GroupView; -class QPainter; -class QModelIndex; - -struct VisualRow -{ - QList items; - int height = 0; - int top = 0; - inline int size() const - { - return items.size(); - } - inline QModelIndex &operator[](int i) - { - return items[i]; - } -}; - -struct VisualGroup -{ -/* constructors */ - VisualGroup(const QString &text, GroupView *view); - VisualGroup(const VisualGroup *other); - -/* data */ - GroupView *view = nullptr; - QString text; - bool collapsed = false; - QVector rows; - int firstItemIndex = 0; - int m_verticalPosition = 0; - -/* logic */ - /// update the internal list of items and flow them into the rows. - void update(); - - /// draw the header at y-position. - void drawHeader(QPainter *painter, const QStyleOptionViewItem &option); - - /// height of the group, in total. includes a small bit of padding. - int totalHeight() const; - - /// height of the group header, in pixels - int headerHeight() const; - - /// height of the group content, in pixels - int contentHeight() const; - - /// the number of visual rows this group has - int numRows() const; - - /// actually calculate the above value - int calculateNumRows() const; - - /// the height at which this group starts, in pixels - int verticalPosition() const; - - /// relative geometry - top of the row of the given item - int rowTopOf(const QModelIndex &index) const; - - /// height of the row of the given item - int rowHeightOf(const QModelIndex &index) const; - - /// x/y position of the given item inside the group (in items!) - QPair positionOf(const QModelIndex &index) const; - - enum HitResult - { - NoHit = 0x0, - TextHit = 0x1, - CheckboxHit = 0x2, - HeaderHit = 0x4, - BodyHit = 0x8 - }; - Q_DECLARE_FLAGS(HitResults, HitResult) - - /// shoot! BANG! what did we hit? - HitResults hitScan (const QPoint &pos) const; - - QList items() const; -}; - -Q_DECLARE_OPERATORS_FOR_FLAGS(VisualGroup::HitResults) diff --git a/gui/pagedialog/PageDialog.cpp b/gui/pagedialog/PageDialog.cpp deleted file mode 100644 index 5399294c..00000000 --- a/gui/pagedialog/PageDialog.cpp +++ /dev/null @@ -1,62 +0,0 @@ -/* Copyright 2013-2015 MultiMC Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "PageDialog.h" - -#include -#include -#include -#include - -#include "MultiMC.h" -#include "logic/settings/SettingsObject.h" -#include "gui/Platform.h" -#include "gui/widgets/IconLabel.h" -#include "gui/widgets/PageContainer.h" - -PageDialog::PageDialog(BasePageProviderPtr pageProvider, QString defaultId, QWidget *parent) - : QDialog(parent) -{ - MultiMCPlatform::fixWM_CLASS(this); - setWindowTitle(pageProvider->dialogTitle()); - m_container = new PageContainer(pageProvider, defaultId, this); - - QVBoxLayout *mainLayout = new QVBoxLayout; - mainLayout->addWidget(m_container); - mainLayout->setSpacing(0); - mainLayout->setContentsMargins(0, 0, 0, 0); - setLayout(mainLayout); - - QDialogButtonBox *buttons = - new QDialogButtonBox(QDialogButtonBox::Help | QDialogButtonBox::Close); - buttons->button(QDialogButtonBox::Close)->setDefault(true); - m_container->addButtons(buttons); - - connect(buttons->button(QDialogButtonBox::Close), SIGNAL(clicked()), this, SLOT(close())); - connect(buttons->button(QDialogButtonBox::Help), SIGNAL(clicked()), m_container, - SLOT(help())); - - restoreGeometry( - QByteArray::fromBase64(MMC->settings()->get("PagedGeometry").toByteArray())); -} - -void PageDialog::closeEvent(QCloseEvent *event) -{ - if (m_container->requestClose(event)) - { - MMC->settings()->set("PagedGeometry", saveGeometry().toBase64()); - QDialog::closeEvent(event); - } -} diff --git a/gui/pagedialog/PageDialog.h b/gui/pagedialog/PageDialog.h deleted file mode 100644 index 9248c942..00000000 --- a/gui/pagedialog/PageDialog.h +++ /dev/null @@ -1,36 +0,0 @@ -/* Copyright 2013-2015 MultiMC Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include -#include "gui/pages/BasePageProvider.h" - -class PageContainer; -class PageDialog : public QDialog -{ - Q_OBJECT -public: - explicit PageDialog(BasePageProviderPtr pageProvider, QString defaultId = QString(), - QWidget *parent = 0); - virtual ~PageDialog() {} - -private -slots: - virtual void closeEvent(QCloseEvent *event); - -private: - PageContainer * m_container; -}; diff --git a/gui/pages/BasePage.h b/gui/pages/BasePage.h deleted file mode 100644 index ecf0692c..00000000 --- a/gui/pages/BasePage.h +++ /dev/null @@ -1,38 +0,0 @@ -/* Copyright 2013-2015 MultiMC Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include -#include -#include - -class BasePage -{ -public: - virtual ~BasePage() {} - virtual QString id() const = 0; - virtual QString displayName() const = 0; - virtual QIcon icon() const = 0; - virtual bool apply() { return true; } - virtual bool shouldDisplay() const { return true; } - virtual QString helpPage() const { return QString(); } - virtual void opened() {} - virtual void closed() {} - int stackIndex = -1; - int listIndex = -1; -}; - -typedef std::shared_ptr BasePagePtr; diff --git a/gui/pages/BasePageProvider.h b/gui/pages/BasePageProvider.h deleted file mode 100644 index c55683e0..00000000 --- a/gui/pages/BasePageProvider.h +++ /dev/null @@ -1,69 +0,0 @@ -/* Copyright 2013-2015 MultiMC Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include "BasePage.h" -#include -#include - -class BasePageProvider -{ -public: - virtual QList getPages() = 0; - virtual QString dialogTitle() = 0; -}; - -class GenericPageProvider : public BasePageProvider -{ - typedef std::function PageCreator; -public: - explicit GenericPageProvider(const QString &dialogTitle) - : m_dialogTitle(dialogTitle) - { - } - - QList getPages() override - { - QList pages; - for (PageCreator creator : m_creators) - { - pages.append(creator()); - } - return pages; - } - QString dialogTitle() override { return m_dialogTitle; } - - void setDialogTitle(const QString &title) - { - m_dialogTitle = title; - } - void addPageCreator(PageCreator page) - { - m_creators.append(page); - } - - template - void addPage() - { - addPageCreator([](){return new PageClass();}); - } - -private: - QList m_creators; - QString m_dialogTitle; -}; - -typedef std::shared_ptr BasePageProviderPtr; diff --git a/gui/pages/InstanceSettingsPage.cpp b/gui/pages/InstanceSettingsPage.cpp deleted file mode 100644 index e1a9c666..00000000 --- a/gui/pages/InstanceSettingsPage.cpp +++ /dev/null @@ -1,216 +0,0 @@ -#include "InstanceSettingsPage.h" -#include "ui_InstanceSettingsPage.h" - -#include -#include -#include - -#include "gui/dialogs/VersionSelectDialog.h" -#include "gui/NagUtils.h" -#include "logic/java/JavaVersionList.h" -#include "MultiMC.h" - -InstanceSettingsPage::InstanceSettingsPage(BaseInstance *inst, QWidget *parent) - : QWidget(parent), ui(new Ui::InstanceSettingsPage), m_instance(inst) -{ - m_settings = &(inst->settings()); - ui->setupUi(this); - loadSettings(); -} - -bool InstanceSettingsPage::shouldDisplay() const -{ - return !m_instance->isRunning(); -} - -InstanceSettingsPage::~InstanceSettingsPage() -{ - delete ui; -} - -bool InstanceSettingsPage::apply() -{ - applySettings(); - return true; -} - -void InstanceSettingsPage::applySettings() -{ - // Console - bool console = ui->consoleSettingsBox->isChecked(); - m_settings->set("OverrideConsole", console); - if (console) - { - m_settings->set("ShowConsole", ui->showConsoleCheck->isChecked()); - m_settings->set("AutoCloseConsole", ui->autoCloseConsoleCheck->isChecked()); - } - else - { - m_settings->reset("ShowConsole"); - m_settings->reset("AutoCloseConsole"); - } - - // Window Size - bool window = ui->windowSizeGroupBox->isChecked(); - m_settings->set("OverrideWindow", window); - if (window) - { - m_settings->set("LaunchMaximized", ui->maximizedCheckBox->isChecked()); - m_settings->set("MinecraftWinWidth", ui->windowWidthSpinBox->value()); - m_settings->set("MinecraftWinHeight", ui->windowHeightSpinBox->value()); - } - else - { - m_settings->reset("LaunchMaximized"); - m_settings->reset("MinecraftWinWidth"); - m_settings->reset("MinecraftWinHeight"); - } - - // Memory - bool memory = ui->memoryGroupBox->isChecked(); - m_settings->set("OverrideMemory", memory); - if (memory) - { - m_settings->set("MinMemAlloc", ui->minMemSpinBox->value()); - m_settings->set("MaxMemAlloc", ui->maxMemSpinBox->value()); - m_settings->set("PermGen", ui->permGenSpinBox->value()); - } - else - { - m_settings->reset("MinMemAlloc"); - m_settings->reset("MaxMemAlloc"); - m_settings->reset("PermGen"); - } - - // Java Install Settings - bool javaInstall = ui->javaSettingsGroupBox->isChecked(); - m_settings->set("OverrideJavaLocation", javaInstall); - if (javaInstall) - { - m_settings->set("JavaPath", ui->javaPathTextBox->text()); - } - else - { - m_settings->reset("JavaPath"); - } - - // Java arguments - bool javaArgs = ui->javaArgumentsGroupBox->isChecked(); - m_settings->set("OverrideJavaArgs", javaArgs); - if(javaArgs) - { - m_settings->set("JvmArgs", ui->jvmArgsTextBox->toPlainText().replace("\n", " ")); - NagUtils::checkJVMArgs(m_settings->get("JvmArgs").toString(), this->parentWidget()); - } - else - { - m_settings->reset("JvmArgs"); - } - - // old generic 'override both' is removed. - m_settings->reset("OverrideJava"); - - // Custom Commands - bool custcmd = ui->customCommandsGroupBox->isChecked(); - m_settings->set("OverrideCommands", custcmd); - if (custcmd) - { - m_settings->set("PreLaunchCommand", ui->preLaunchCmdTextBox->text()); - m_settings->set("PostExitCommand", ui->postExitCmdTextBox->text()); - } - else - { - m_settings->reset("PreLaunchCommand"); - m_settings->reset("PostExitCommand"); - } -} - -void InstanceSettingsPage::loadSettings() -{ - // Console - ui->consoleSettingsBox->setChecked(m_settings->get("OverrideConsole").toBool()); - ui->showConsoleCheck->setChecked(m_settings->get("ShowConsole").toBool()); - ui->autoCloseConsoleCheck->setChecked(m_settings->get("AutoCloseConsole").toBool()); - - // Window Size - ui->windowSizeGroupBox->setChecked(m_settings->get("OverrideWindow").toBool()); - ui->maximizedCheckBox->setChecked(m_settings->get("LaunchMaximized").toBool()); - ui->windowWidthSpinBox->setValue(m_settings->get("MinecraftWinWidth").toInt()); - ui->windowHeightSpinBox->setValue(m_settings->get("MinecraftWinHeight").toInt()); - - // Memory - ui->memoryGroupBox->setChecked(m_settings->get("OverrideMemory").toBool()); - ui->minMemSpinBox->setValue(m_settings->get("MinMemAlloc").toInt()); - ui->maxMemSpinBox->setValue(m_settings->get("MaxMemAlloc").toInt()); - ui->permGenSpinBox->setValue(m_settings->get("PermGen").toInt()); - - // Java Settings - bool overrideJava = m_settings->get("OverrideJava").toBool(); - bool overrideLocation = m_settings->get("OverrideJavaLocation").toBool() || overrideJava; - bool overrideArgs = m_settings->get("OverrideJavaArgs").toBool() || overrideJava; - - ui->javaSettingsGroupBox->setChecked(overrideLocation); - ui->javaPathTextBox->setText(m_settings->get("JavaPath").toString()); - - ui->javaArgumentsGroupBox->setChecked(overrideArgs); - ui->jvmArgsTextBox->setPlainText(m_settings->get("JvmArgs").toString()); - - // Custom Commands - ui->customCommandsGroupBox->setChecked(m_settings->get("OverrideCommands").toBool()); - ui->preLaunchCmdTextBox->setText(m_settings->get("PreLaunchCommand").toString()); - ui->postExitCmdTextBox->setText(m_settings->get("PostExitCommand").toString()); -} - -void InstanceSettingsPage::on_javaDetectBtn_clicked() -{ - JavaVersionPtr java; - - VersionSelectDialog vselect(MMC->javalist().get(), tr("Select a Java version"), this, true); - vselect.setResizeOn(2); - vselect.exec(); - - if (vselect.result() == QDialog::Accepted && vselect.selectedVersion()) - { - java = std::dynamic_pointer_cast(vselect.selectedVersion()); - ui->javaPathTextBox->setText(java->path); - } -} - -void InstanceSettingsPage::on_javaBrowseBtn_clicked() -{ - QString dir = QFileDialog::getOpenFileName(this, tr("Find Java executable")); - if (!dir.isNull()) - { - ui->javaPathTextBox->setText(dir); - } -} - -void InstanceSettingsPage::on_javaTestBtn_clicked() -{ - checker.reset(new JavaChecker()); - connect(checker.get(), SIGNAL(checkFinished(JavaCheckResult)), this, - SLOT(checkFinished(JavaCheckResult))); - checker->path = ui->javaPathTextBox->text(); - checker->performCheck(); -} - -void InstanceSettingsPage::checkFinished(JavaCheckResult result) -{ - if (result.valid) - { - QString text; - text += "Java test succeeded!\n"; - if (result.is_64bit) - text += "Using 64bit java.\n"; - text += "\n"; - text += "Platform reported: " + result.realPlatform; - QMessageBox::information(this, tr("Java test success"), text); - } - else - { - QMessageBox::warning( - this, tr("Java test failure"), - tr("The specified java binary didn't work. You should use the auto-detect feature, " - "or set the path to the java executable.")); - } -} diff --git a/gui/pages/InstanceSettingsPage.h b/gui/pages/InstanceSettingsPage.h deleted file mode 100644 index 8835d02e..00000000 --- a/gui/pages/InstanceSettingsPage.h +++ /dev/null @@ -1,74 +0,0 @@ -/* Copyright 2013-2015 MultiMC Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include - -#include "logic/net/NetJob.h" -#include "logic/java/JavaChecker.h" -#include "logic/BaseInstance.h" -#include "BasePage.h" -#include "MultiMC.h" - -class JavaChecker; -namespace Ui -{ -class InstanceSettingsPage; -} - -class InstanceSettingsPage : public QWidget, public BasePage -{ - Q_OBJECT - -public: - explicit InstanceSettingsPage(BaseInstance *inst, QWidget *parent = 0); - virtual ~InstanceSettingsPage(); - virtual QString displayName() const override - { - return tr("Settings"); - } - virtual QIcon icon() const override - { - return MMC->getThemedIcon("instance-settings"); - } - virtual QString id() const override - { - return "settings"; - } - virtual bool apply(); - virtual QString helpPage() const override - { - return "Instance-settings"; - } - virtual bool shouldDisplay() const; -private slots: - void on_javaDetectBtn_clicked(); - - void on_javaTestBtn_clicked(); - - void on_javaBrowseBtn_clicked(); - - void checkFinished(JavaCheckResult result); - - void applySettings(); - void loadSettings(); - -private: - Ui::InstanceSettingsPage *ui; - BaseInstance *m_instance; - SettingsObject *m_settings; - std::shared_ptr checker; -}; diff --git a/gui/pages/InstanceSettingsPage.ui b/gui/pages/InstanceSettingsPage.ui deleted file mode 100644 index 64109378..00000000 --- a/gui/pages/InstanceSettingsPage.ui +++ /dev/null @@ -1,453 +0,0 @@ - - - InstanceSettingsPage - - - - 0 - 0 - 458 - 426 - - - - Form - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - QTabWidget::Rounded - - - 0 - - - - Java - - - - - - true - - - Java installation - - - true - - - false - - - - - - - - - Auto-detect... - - - - - - - Browse... - - - - - - - Test - - - - - - - - - - true - - - Memory - - - true - - - false - - - - - - The maximum amount of memory Minecraft is allowed to use. - - - MB - - - 512 - - - 65536 - - - 128 - - - 1024 - - - - - - - Minimum memory allocation: - - - - - - - Maximum memory allocation: - - - - - - - The amount of memory Minecraft is started with. - - - MB - - - 256 - - - 65536 - - - 128 - - - 256 - - - - - - - The amount of memory available to store loaded Java classes. - - - MB - - - 64 - - - 999999999 - - - 8 - - - 64 - - - - - - - PermGen: - - - - - - - - - - true - - - Java arguments - - - true - - - false - - - - - - - - - - - - Qt::Vertical - - - - 0 - 0 - - - - - - - - - Game windows - - - - - - true - - - Game Window - - - true - - - false - - - - - - Start Minecraft maximized? - - - - - - - - - Window height: - - - - - - - Window width: - - - - - - - 1 - - - 65536 - - - 1 - - - 854 - - - - - - - 1 - - - 65536 - - - 480 - - - - - - - - - - - - true - - - Console Settings - - - true - - - false - - - - - - Show console while the game is running? - - - - - - - Automatically close console when the game quits? - - - - - - - - - - Qt::Vertical - - - - 88 - 125 - - - - - - - - - Custom commands - - - - - - true - - - Custom Commands - - - true - - - false - - - - - - - - - Post-exit command: - - - - - - - Pre-launch command: - - - - - - - - - - - - - <html><head/><body><p>Pre-launch command runs before the instance launches and post-exit command runs after it exits.</p><p>Both will be run in MultiMC's working directory with extra environment variables:</p><ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">INST_NAME - Name of the instance</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">INST_ID - ID of the instance</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">INST_DIR - absolute path of the instance</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">INST_MC_DIR - absolute path of minecraft</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">INST_JAVA - java binary used for launch</li><li style=" margin-top:0px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">INST_JAVA_ARGS - command-line parameters used for launch</li></ul></body></html> - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - true - - - Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse - - - - - - - Qt::Vertical - - - - 88 - 186 - - - - - - - - - - - - settingsTabs - javaSettingsGroupBox - javaPathTextBox - javaDetectBtn - javaBrowseBtn - javaTestBtn - memoryGroupBox - minMemSpinBox - maxMemSpinBox - permGenSpinBox - javaArgumentsGroupBox - jvmArgsTextBox - windowSizeGroupBox - maximizedCheckBox - windowWidthSpinBox - windowHeightSpinBox - consoleSettingsBox - showConsoleCheck - autoCloseConsoleCheck - customCommandsGroupBox - preLaunchCmdTextBox - postExitCmdTextBox - - - - diff --git a/gui/pages/LogPage.cpp b/gui/pages/LogPage.cpp deleted file mode 100644 index 4e9e4f52..00000000 --- a/gui/pages/LogPage.cpp +++ /dev/null @@ -1,222 +0,0 @@ -#include "LogPage.h" -#include "ui_LogPage.h" - -#include "MultiMC.h" - -#include -#include -#include - -#include "logic/BaseProcess.h" -#include "gui/GuiUtil.h" - -LogPage::LogPage(BaseProcess *proc, QWidget *parent) - : QWidget(parent), ui(new Ui::LogPage), m_process(proc) -{ - ui->setupUi(this); - ui->tabWidget->tabBar()->hide(); - connect(m_process, SIGNAL(log(QString, MessageLevel::Enum)), this, - SLOT(write(QString, MessageLevel::Enum))); - - // create the format and set its font - defaultFormat = new QTextCharFormat(ui->text->currentCharFormat()); - QString fontFamily = MMC->settings()->get("ConsoleFont").toString(); - bool conversionOk = false; - int fontSize = MMC->settings()->get("ConsoleFontSize").toInt(&conversionOk); - if(!conversionOk) - { - fontSize = 11; - } - defaultFormat->setFont(QFont(fontFamily, fontSize)); - - auto findShortcut = new QShortcut(QKeySequence(QKeySequence::Find), this); - connect(findShortcut, SIGNAL(activated()), SLOT(findActivated())); - auto findNextShortcut = new QShortcut(QKeySequence(QKeySequence::FindNext), this); - connect(findNextShortcut, SIGNAL(activated()), SLOT(findNextActivated())); - connect(ui->searchBar, SIGNAL(returnPressed()), SLOT(on_findButton_clicked())); - auto findPreviousShortcut = new QShortcut(QKeySequence(QKeySequence::FindPrevious), this); - connect(findPreviousShortcut, SIGNAL(activated()), SLOT(findPreviousActivated())); -} - -LogPage::~LogPage() -{ - delete ui; - delete defaultFormat; -} - -bool LogPage::apply() -{ - return true; -} - -bool LogPage::shouldDisplay() const -{ - return m_process->instance()->isRunning(); -} - -void LogPage::on_btnPaste_clicked() -{ - GuiUtil::uploadPaste(ui->text->toPlainText(), this); -} - -void LogPage::on_btnCopy_clicked() -{ - GuiUtil::setClipboardText(ui->text->toPlainText()); -} - -void LogPage::on_btnClear_clicked() -{ - ui->text->clear(); -} - -void LogPage::on_trackLogCheckbox_clicked(bool checked) -{ - m_write_active = checked; -} - -void LogPage::on_findButton_clicked() -{ - auto modifiers = QApplication::keyboardModifiers(); - if (modifiers & Qt::ShiftModifier) - { - findPreviousActivated(); - } - else - { - findNextActivated(); - } -} - -void LogPage::findActivated() -{ - // focus the search bar if it doesn't have focus - if (!ui->searchBar->hasFocus()) - { - auto searchForCursor = ui->text->textCursor(); - auto searchForString = searchForCursor.selectedText(); - if (searchForString.size()) - { - ui->searchBar->setText(searchForString); - } - ui->searchBar->setFocus(); - ui->searchBar->selectAll(); - } -} - -void LogPage::findNextActivated() -{ - auto toSearch = ui->searchBar->text(); - if (toSearch.size()) - { - ui->text->find(toSearch); - } -} - -void LogPage::findPreviousActivated() -{ - auto toSearch = ui->searchBar->text(); - if (toSearch.size()) - { - ui->text->find(toSearch, QTextDocument::FindBackward); - } -} - -void LogPage::write(QString data, MessageLevel::Enum mode) -{ - if (!m_write_active) - { - if (mode != MessageLevel::PrePost && mode != MessageLevel::MultiMC) - { - return; - } - } - - // save the cursor so it can be restored. - auto savedCursor = ui->text->cursor(); - - QScrollBar *bar = ui->text->verticalScrollBar(); - int max_bar = bar->maximum(); - int val_bar = bar->value(); - if (isVisible()) - { - if (m_scroll_active) - { - m_scroll_active = (max_bar - val_bar) <= 1; - } - else - { - m_scroll_active = val_bar == max_bar; - } - } - if (data.endsWith('\n')) - data = data.left(data.length() - 1); - QStringList paragraphs = data.split('\n'); - QStringList filtered; - for (QString ¶graph : paragraphs) - { - //TODO: implement filtering here. - filtered.append(paragraph); - } - QListIterator iter(filtered); - QTextCharFormat format(*defaultFormat); - - switch(mode) - { - case MessageLevel::MultiMC: - { - format.setForeground(QColor("blue")); - break; - } - case MessageLevel::Debug: - { - format.setForeground(QColor("green")); - break; - } - case MessageLevel::Warning: - { - format.setForeground(QColor("orange")); - break; - } - case MessageLevel::Error: - { - format.setForeground(QColor("red")); - break; - } - case MessageLevel::Fatal: - { - format.setForeground(QColor("red")); - format.setBackground(QColor("black")); - break; - } - case MessageLevel::PrePost: - { - format.setForeground(QColor("grey")); - break; - } - case MessageLevel::Info: - case MessageLevel::Message: - default: - { - // do nothing, keep original - } - } - - while (iter.hasNext()) - { - // append a paragraph/line - auto workCursor = ui->text->textCursor(); - workCursor.movePosition(QTextCursor::End); - workCursor.insertText(iter.next(), format); - workCursor.insertBlock(); - } - - if (isVisible()) - { - if (m_scroll_active) - { - bar->setValue(bar->maximum()); - } - m_last_scroll_value = bar->value(); - } - ui->text->setCursor(savedCursor); -} diff --git a/gui/pages/LogPage.h b/gui/pages/LogPage.h deleted file mode 100644 index fea438c0..00000000 --- a/gui/pages/LogPage.h +++ /dev/null @@ -1,86 +0,0 @@ -/* Copyright 2013-2015 MultiMC Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include - -#include "logic/BaseInstance.h" -#include "logic/net/NetJob.h" -#include "logic/BaseProcess.h" -#include "BasePage.h" -#include - -namespace Ui -{ -class LogPage; -} -class QTextCharFormat; - -class LogPage : public QWidget, public BasePage -{ - Q_OBJECT - -public: - explicit LogPage(BaseProcess *proc, QWidget *parent = 0); - virtual ~LogPage(); - virtual QString displayName() const override - { - return tr("Minecraft Log"); - } - virtual QIcon icon() const override - { - return MMC->getThemedIcon("log"); - } - virtual QString id() const override - { - return "console"; - } - virtual bool apply(); - virtual QString helpPage() const override - { - return "Minecraft-Logs"; - } - virtual bool shouldDisplay() const; - -private slots: - /** - * @brief write a string - * @param data the string - * @param mode the WriteMode - * lines have to be put through this as a whole! - */ - void write(QString data, MessageLevel::Enum level = MessageLevel::MultiMC); - void on_btnPaste_clicked(); - void on_btnCopy_clicked(); - void on_btnClear_clicked(); - - void on_trackLogCheckbox_clicked(bool checked); - - void on_findButton_clicked(); - void findActivated(); - void findNextActivated(); - void findPreviousActivated(); - -private: - Ui::LogPage *ui; - BaseProcess *m_process; - int m_last_scroll_value = 0; - bool m_scroll_active = true; - int m_saved_offset = 0; - bool m_write_active = true; - - QTextCharFormat * defaultFormat; -}; diff --git a/gui/pages/LogPage.ui b/gui/pages/LogPage.ui deleted file mode 100644 index 089bc906..00000000 --- a/gui/pages/LogPage.ui +++ /dev/null @@ -1,140 +0,0 @@ - - - LogPage - - - - 0 - 0 - 825 - 782 - - - - Log - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - - Tab 1 - - - - - - Search: - - - - - - - Find - - - - - - - false - - - true - - - - - - Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - - false - - - - - - - - - Keep updating - - - true - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Copy the whole log into the clipboard - - - &Copy - - - - - - - Upload the log to paste.ee - it will stay online for a month - - - Upload - - - - - - - Clear the log - - - Clear - - - - - - - - - - - - - - - - - diff --git a/gui/pages/ModFolderPage.cpp b/gui/pages/ModFolderPage.cpp deleted file mode 100644 index 167ba471..00000000 --- a/gui/pages/ModFolderPage.cpp +++ /dev/null @@ -1,160 +0,0 @@ -/* Copyright 2013-2015 MultiMC Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "ModFolderPage.h" -#include "ui_ModFolderPage.h" - -#include -#include -#include -#include -#include -#include - -#include - -#include "MultiMC.h" -#include "gui/dialogs/CustomMessageBox.h" -#include "gui/dialogs/ModEditDialogCommon.h" -#include "logic/minecraft/ModList.h" -#include "logic/minecraft/Mod.h" -#include "logic/minecraft/VersionFilterData.h" - -ModFolderPage::ModFolderPage(BaseInstance *inst, std::shared_ptr mods, QString id, - QString iconName, QString displayName, QString helpPage, - QWidget *parent) - : QWidget(parent), ui(new Ui::ModFolderPage) -{ - ui->setupUi(this); - ui->tabWidget->tabBar()->hide(); - m_inst = inst; - m_mods = mods; - m_id = id; - m_displayName = displayName; - m_iconName = iconName; - m_helpName = helpPage; - ui->modTreeView->setModel(m_mods.get()); - ui->modTreeView->installEventFilter(this); - m_mods->startWatching(); - auto smodel = ui->modTreeView->selectionModel(); - connect(smodel, SIGNAL(currentChanged(QModelIndex, QModelIndex)), - SLOT(modCurrent(QModelIndex, QModelIndex))); -} - -CoreModFolderPage::CoreModFolderPage(BaseInstance *inst, std::shared_ptr mods, - QString id, QString iconName, QString displayName, - QString helpPage, QWidget *parent) - : ModFolderPage(inst, mods, id, iconName, displayName, helpPage, parent) -{ -} - -ModFolderPage::~ModFolderPage() -{ - m_mods->stopWatching(); - delete ui; -} - -bool ModFolderPage::shouldDisplay() const -{ - if (m_inst) - return !m_inst->isRunning(); - return true; -} - -bool CoreModFolderPage::shouldDisplay() const -{ - if (ModFolderPage::shouldDisplay()) - { - auto inst = dynamic_cast(m_inst); - if (!inst) - return true; - auto version = inst->getMinecraftProfile(); - if (!version) - return true; - if (version->m_releaseTime < g_VersionFilterData.legacyCutoffDate) - { - return true; - } - } - return false; -} - -bool ModFolderPage::modListFilter(QKeyEvent *keyEvent) -{ - switch (keyEvent->key()) - { - case Qt::Key_Delete: - on_rmModBtn_clicked(); - return true; - case Qt::Key_Plus: - on_addModBtn_clicked(); - return true; - default: - break; - } - return QWidget::eventFilter(ui->modTreeView, keyEvent); -} - -bool ModFolderPage::eventFilter(QObject *obj, QEvent *ev) -{ - if (ev->type() != QEvent::KeyPress) - { - return QWidget::eventFilter(obj, ev); - } - QKeyEvent *keyEvent = static_cast(ev); - if (obj == ui->modTreeView) - return modListFilter(keyEvent); - return QWidget::eventFilter(obj, ev); -} - -void ModFolderPage::on_addModBtn_clicked() -{ - QStringList fileNames = QFileDialog::getOpenFileNames( - this, QApplication::translate("ModFolderPage", "Select Loader Mods")); - for (auto filename : fileNames) - { - m_mods->stopWatching(); - m_mods->installMod(QFileInfo(filename)); - m_mods->startWatching(); - } -} -void ModFolderPage::on_rmModBtn_clicked() -{ - int first, last; - auto list = ui->modTreeView->selectionModel()->selectedRows(); - - if (!lastfirst(list, first, last)) - return; - m_mods->stopWatching(); - m_mods->deleteMods(first, last); - m_mods->startWatching(); -} - -void ModFolderPage::on_viewModBtn_clicked() -{ - openDirInDefaultProgram(m_mods->dir().absolutePath(), true); -} - -void ModFolderPage::modCurrent(const QModelIndex ¤t, const QModelIndex &previous) -{ - if (!current.isValid()) - { - ui->frame->clear(); - return; - } - int row = current.row(); - Mod &m = m_mods->operator[](row); - ui->frame->updateWithMod(m); -} diff --git a/gui/pages/ModFolderPage.h b/gui/pages/ModFolderPage.h deleted file mode 100644 index bd5156d4..00000000 --- a/gui/pages/ModFolderPage.h +++ /dev/null @@ -1,94 +0,0 @@ -/* Copyright 2013-2015 MultiMC Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include - -#include "logic/minecraft/OneSixInstance.h" -#include "logic/net/NetJob.h" -#include "BasePage.h" -#include - -class ModList; -namespace Ui -{ -class ModFolderPage; -} - -class ModFolderPage : public QWidget, public BasePage -{ - Q_OBJECT - -public: - explicit ModFolderPage(BaseInstance *inst, std::shared_ptr mods, QString id, - QString iconName, QString displayName, QString helpPage = "", - QWidget *parent = 0); - virtual ~ModFolderPage(); - virtual QString displayName() const override - { - return m_displayName; - } - virtual QIcon icon() const override - { - return MMC->getThemedIcon(m_iconName); - } - virtual QString id() const override - { - return m_id; - } - virtual QString helpPage() const override - { - return m_helpName; - } - virtual bool shouldDisplay() const; - -protected: - bool eventFilter(QObject *obj, QEvent *ev); - bool modListFilter(QKeyEvent *ev); - -protected: - BaseInstance *m_inst; - -private: - Ui::ModFolderPage *ui; - std::shared_ptr m_mods; - QString m_iconName; - QString m_id; - QString m_displayName; - QString m_helpName; - -public -slots: - void modCurrent(const QModelIndex ¤t, const QModelIndex &previous); - -private -slots: - void on_addModBtn_clicked(); - void on_rmModBtn_clicked(); - void on_viewModBtn_clicked(); -}; - -class CoreModFolderPage : public ModFolderPage -{ -public: - explicit CoreModFolderPage(BaseInstance *inst, std::shared_ptr mods, QString id, - QString iconName, QString displayName, QString helpPage = "", - QWidget *parent = 0); - virtual ~CoreModFolderPage() - { - } - virtual bool shouldDisplay() const; -}; diff --git a/gui/pages/ModFolderPage.ui b/gui/pages/ModFolderPage.ui deleted file mode 100644 index 019b8faf..00000000 --- a/gui/pages/ModFolderPage.ui +++ /dev/null @@ -1,124 +0,0 @@ - - - ModFolderPage - - - - 0 - 0 - 723 - 532 - - - - Mods - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - - Tab 1 - - - - - - - 0 - 0 - - - - true - - - QAbstractItemView::DropOnly - - - - - - - - - &Add - - - - - - - &Remove - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - &View Folder - - - - - - - - - - 0 - 0 - - - - - - - - - - - - - ModListView - QTreeView -
    gui/widgets/ModListView.h
    -
    - - MCModInfoFrame - QFrame -
    gui/widgets/MCModInfoFrame.h
    - 1 -
    -
    - - -
    diff --git a/gui/pages/NotesPage.cpp b/gui/pages/NotesPage.cpp deleted file mode 100644 index 48bb468c..00000000 --- a/gui/pages/NotesPage.cpp +++ /dev/null @@ -1,21 +0,0 @@ -#include "NotesPage.h" -#include "ui_NotesPage.h" - -NotesPage::NotesPage(BaseInstance *inst, QWidget *parent) - : QWidget(parent), ui(new Ui::NotesPage), m_inst(inst) -{ - ui->setupUi(this); - ui->tabWidget->tabBar()->hide(); - ui->noteEditor->setText(m_inst->notes()); -} - -NotesPage::~NotesPage() -{ - delete ui; -} - -bool NotesPage::apply() -{ - m_inst->setNotes(ui->noteEditor->toPlainText()); - return true; -} diff --git a/gui/pages/NotesPage.h b/gui/pages/NotesPage.h deleted file mode 100644 index 6dcdce32..00000000 --- a/gui/pages/NotesPage.h +++ /dev/null @@ -1,61 +0,0 @@ -/* Copyright 2013-2015 MultiMC Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include - -#include "logic/BaseInstance.h" -#include "logic/net/NetJob.h" -#include "BasePage.h" -#include - -namespace Ui -{ -class NotesPage; -} - -class NotesPage : public QWidget, public BasePage -{ - Q_OBJECT - -public: - explicit NotesPage(BaseInstance *inst, QWidget *parent = 0); - virtual ~NotesPage(); - virtual QString displayName() const override - { - return tr("Notes"); - } - virtual QIcon icon() const override - { - auto icon = MMC->getThemedIcon("notes"); - if(icon.isNull()) - icon = MMC->getThemedIcon("news"); - return icon; - } - virtual QString id() const override - { - return "notes"; - } - virtual bool apply(); - virtual QString helpPage() const override - { - return "Notes"; - } - -private: - Ui::NotesPage *ui; - BaseInstance *m_inst; -}; diff --git a/gui/pages/NotesPage.ui b/gui/pages/NotesPage.ui deleted file mode 100644 index 8da01c8b..00000000 --- a/gui/pages/NotesPage.ui +++ /dev/null @@ -1,60 +0,0 @@ - - - NotesPage - - - - 0 - 0 - 731 - 538 - - - - Form - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - - Tab 1 - - - - - - Qt::ScrollBarAlwaysOn - - - false - - - Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextEditable|Qt::TextEditorInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - - - - - - - - - - - diff --git a/gui/pages/OtherLogsPage.cpp b/gui/pages/OtherLogsPage.cpp deleted file mode 100644 index c9b0aa51..00000000 --- a/gui/pages/OtherLogsPage.cpp +++ /dev/null @@ -1,150 +0,0 @@ -/* Copyright 2013-2015 MultiMC Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "OtherLogsPage.h" -#include "ui_OtherLogsPage.h" - -#include -#include - -#include "gui/GuiUtil.h" -#include "logic/RecursiveFileSystemWatcher.h" -#include - -OtherLogsPage::OtherLogsPage(QString path, QWidget *parent) - : QWidget(parent), ui(new Ui::OtherLogsPage), m_path(path), - m_watcher(new RecursiveFileSystemWatcher(this)) -{ - ui->setupUi(this); - ui->tabWidget->tabBar()->hide(); - - m_watcher->setFileExpression("(.*\\.log(\\.[0-9]*)?$)|(crash-.*\\.txt)"); - m_watcher->setRootDir(QDir::current().absoluteFilePath(m_path)); - - connect(m_watcher, &RecursiveFileSystemWatcher::filesChanged, this, - &OtherLogsPage::populateSelectLogBox); - populateSelectLogBox(); -} - -OtherLogsPage::~OtherLogsPage() -{ - delete ui; -} - -void OtherLogsPage::opened() -{ - m_watcher->enable(); -} -void OtherLogsPage::closed() -{ - m_watcher->disable(); -} - -void OtherLogsPage::populateSelectLogBox() -{ - ui->selectLogBox->clear(); - ui->selectLogBox->addItems(m_watcher->files()); - if (m_currentFile.isNull()) - { - ui->selectLogBox->setCurrentIndex(-1); - } - else - { - const int index = ui->selectLogBox->findText(m_currentFile); - if (index != -1) - ui->selectLogBox->setCurrentIndex(index); - } -} - -void OtherLogsPage::on_selectLogBox_currentIndexChanged(const int index) -{ - QString file; - if (index != -1) - { - file = ui->selectLogBox->itemText(index); - } - - if (file.isEmpty() || !QFile::exists(PathCombine(m_path, file))) - { - m_currentFile = QString(); - ui->text->clear(); - setControlsEnabled(false); - } - else - { - m_currentFile = file; - on_btnReload_clicked(); - setControlsEnabled(true); - } -} - -void OtherLogsPage::on_btnReload_clicked() -{ - QFile file(PathCombine(m_path, m_currentFile)); - if (!file.open(QFile::ReadOnly)) - { - setControlsEnabled(false); - ui->btnReload->setEnabled(true); // allow reload - m_currentFile = QString(); - QMessageBox::critical(this, tr("Error"), tr("Unable to open %1 for reading: %2") - .arg(m_currentFile, file.errorString())); - } - else - { - if (file.size() < 10000000ll) - { - ui->text->setPlainText(QString::fromUtf8(file.readAll())); - } - else - { - ui->text->setPlainText( - tr("The file (%1) is too big. You may want to open it in a viewer optimized " - "for large files.").arg(file.fileName())); - } - } -} - -void OtherLogsPage::on_btnPaste_clicked() -{ - GuiUtil::uploadPaste(ui->text->toPlainText(), this); -} -void OtherLogsPage::on_btnCopy_clicked() -{ - GuiUtil::setClipboardText(ui->text->toPlainText()); -} -void OtherLogsPage::on_btnDelete_clicked() -{ - if (QMessageBox::question(this, tr("Delete"), - tr("Do you really want to delete %1?").arg(m_currentFile), - QMessageBox::Yes, QMessageBox::No) == QMessageBox::No) - { - return; - } - QFile file(PathCombine(m_path, m_currentFile)); - if (!file.remove()) - { - QMessageBox::critical(this, tr("Error"), tr("Unable to delete %1: %2") - .arg(m_currentFile, file.errorString())); - } -} - -void OtherLogsPage::setControlsEnabled(const bool enabled) -{ - ui->btnReload->setEnabled(enabled); - ui->btnDelete->setEnabled(enabled); - ui->btnCopy->setEnabled(enabled); - ui->btnPaste->setEnabled(enabled); - ui->text->setEnabled(enabled); -} diff --git a/gui/pages/OtherLogsPage.h b/gui/pages/OtherLogsPage.h deleted file mode 100644 index d6e4ec9f..00000000 --- a/gui/pages/OtherLogsPage.h +++ /dev/null @@ -1,72 +0,0 @@ -/* Copyright 2013-2015 MultiMC Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include - -#include "BasePage.h" -#include - -namespace Ui -{ -class OtherLogsPage; -} - -class RecursiveFileSystemWatcher; - -class OtherLogsPage : public QWidget, public BasePage -{ - Q_OBJECT - -public: - explicit OtherLogsPage(QString path, QWidget *parent = 0); - ~OtherLogsPage(); - - QString id() const override - { - return "logs"; - } - QString displayName() const override - { - return tr("Other logs"); - } - QIcon icon() const override - { - return MMC->getThemedIcon("log"); - } - QString helpPage() const override - { - return "Minecraft-Logs"; - } - void opened() override; - void closed() override; - -private slots: - void populateSelectLogBox(); - void on_selectLogBox_currentIndexChanged(const int index); - void on_btnReload_clicked(); - void on_btnPaste_clicked(); - void on_btnCopy_clicked(); - void on_btnDelete_clicked(); - -private: - Ui::OtherLogsPage *ui; - QString m_path; - RecursiveFileSystemWatcher *m_watcher; - QString m_currentFile; - - void setControlsEnabled(const bool enabled); -}; diff --git a/gui/pages/OtherLogsPage.ui b/gui/pages/OtherLogsPage.ui deleted file mode 100644 index 08200684..00000000 --- a/gui/pages/OtherLogsPage.ui +++ /dev/null @@ -1,117 +0,0 @@ - - - OtherLogsPage - - - - 0 - 0 - 657 - 538 - - - - Form - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - - Tab 1 - - - - - - - - - 0 - 0 - - - - - - - - Reload - - - - - - - Copy the whole log into the clipboard - - - &Copy - - - - - - - Upload the log to paste.ee - it will stay online for a month - - - Upload - - - - - - - Clear the log - - - Delete - - - - - - - - - false - - - Qt::ScrollBarAlwaysOn - - - true - - - Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - - - - - - - - - - text - - - - diff --git a/gui/pages/ResourcePackPage.h b/gui/pages/ResourcePackPage.h deleted file mode 100644 index d79590df..00000000 --- a/gui/pages/ResourcePackPage.h +++ /dev/null @@ -1,19 +0,0 @@ -#pragma once -#include "ModFolderPage.h" - -class ResourcePackPage : public ModFolderPage -{ -public: - explicit ResourcePackPage(MinecraftInstance *instance, QWidget *parent = 0) - : ModFolderPage(instance, instance->resourcePackList(), "resourcepacks", - "resourcepacks", tr("Resource packs"), "Resource-packs", parent) - { - } - - virtual ~ResourcePackPage() {} - virtual bool shouldDisplay() const override - { - return !m_inst->traits().contains("no-texturepacks") && - !m_inst->traits().contains("texturepacks"); - } -}; diff --git a/gui/pages/ScreenshotsPage.cpp b/gui/pages/ScreenshotsPage.cpp deleted file mode 100644 index 219a47ae..00000000 --- a/gui/pages/ScreenshotsPage.cpp +++ /dev/null @@ -1,362 +0,0 @@ -#include "ScreenshotsPage.h" -#include "ui_ScreenshotsPage.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include "gui/dialogs/ProgressDialog.h" -#include "gui/dialogs/CustomMessageBox.h" -#include "logic/net/NetJob.h" -#include "logic/screenshots/ImgurUpload.h" -#include "logic/screenshots/ImgurAlbumCreation.h" -#include "logic/tasks/SequentialTask.h" - -#include "logic/RWStorage.h" - -typedef RWStorage SharedIconCache; -typedef std::shared_ptr SharedIconCachePtr; - -class ThumbnailingResult : public QObject -{ - Q_OBJECT -public slots: - inline void emitResultsReady(const QString &path) { emit resultsReady(path); } - inline void emitResultsFailed(const QString &path) { emit resultsFailed(path); } -signals: - void resultsReady(const QString &path); - void resultsFailed(const QString &path); -}; - -class ThumbnailRunnable : public QRunnable -{ -public: - ThumbnailRunnable(QString path, SharedIconCachePtr cache) - { - m_path = path; - m_cache = cache; - } - void run() - { - QFileInfo info(m_path); - if (info.isDir()) - return; - if ((info.suffix().compare("png", Qt::CaseInsensitive) != 0)) - return; - int tries = 5; - while (tries) - { - if (!m_cache->stale(m_path)) - return; - QImage image(m_path); - if (image.isNull()) - { - QThread::msleep(500); - tries--; - continue; - } - QImage small; - if (image.width() > image.height()) - small = image.scaledToWidth(512).scaledToWidth(256, Qt::SmoothTransformation); - else - small = image.scaledToHeight(512).scaledToHeight(256, Qt::SmoothTransformation); - auto smallSize = small.size(); - QPoint offset((256 - small.width()) / 2, (256 - small.height()) / 2); - QImage square(QSize(256, 256), QImage::Format_ARGB32); - square.fill(Qt::transparent); - - QPainter painter(&square); - painter.drawImage(offset, small); - painter.end(); - - QIcon icon(QPixmap::fromImage(square)); - m_cache->add(m_path, icon); - m_resultEmitter.emitResultsReady(m_path); - return; - } - m_resultEmitter.emitResultsFailed(m_path); - } - QString m_path; - SharedIconCachePtr m_cache; - ThumbnailingResult m_resultEmitter; -}; - -// this is about as elegant and well written as a bag of bricks with scribbles done by insane -// asylum patients. -class FilterModel : public QIdentityProxyModel -{ - Q_OBJECT -public: - explicit FilterModel(QObject *parent = 0) : QIdentityProxyModel(parent) - { - m_thumbnailingPool.setMaxThreadCount(4); - m_thumbnailCache = std::make_shared(); - m_thumbnailCache->add("placeholder", MMC->getThemedIcon("screenshot-placeholder")); - connect(&watcher, SIGNAL(fileChanged(QString)), SLOT(fileChanged(QString))); - // FIXME: the watched file set is not updated when files are removed - } - virtual ~FilterModel() { m_thumbnailingPool.waitForDone(500); } - virtual QVariant data(const QModelIndex &proxyIndex, int role = Qt::DisplayRole) const - { - auto model = sourceModel(); - if (!model) - return QVariant(); - if (role == Qt::DisplayRole || role == Qt::EditRole) - { - QVariant result = sourceModel()->data(mapToSource(proxyIndex), role); - return result.toString().remove(QRegExp("\\.png$")); - } - if (role == Qt::DecorationRole) - { - QVariant result = - sourceModel()->data(mapToSource(proxyIndex), QFileSystemModel::FilePathRole); - QString filePath = result.toString(); - QIcon temp; - if (!watched.contains(filePath)) - { - ((QFileSystemWatcher &)watcher).addPath(filePath); - ((QSet &)watched).insert(filePath); - } - if (m_thumbnailCache->get(filePath, temp)) - { - return temp; - } - if (!m_failed.contains(filePath)) - { - ((FilterModel *)this)->thumbnailImage(filePath); - } - return (m_thumbnailCache->get("placeholder")); - } - return sourceModel()->data(mapToSource(proxyIndex), role); - } - virtual bool setData(const QModelIndex &index, const QVariant &value, - int role = Qt::EditRole) - { - auto model = sourceModel(); - if (!model) - return false; - if (role != Qt::EditRole) - return false; - // FIXME: this is a workaround for a bug in QFileSystemModel, where it doesn't - // sort after renames - { - ((QFileSystemModel *)model)->setNameFilterDisables(true); - ((QFileSystemModel *)model)->setNameFilterDisables(false); - } - return model->setData(mapToSource(index), value.toString() + ".png", role); - } - -private: - void thumbnailImage(QString path) - { - auto runnable = new ThumbnailRunnable(path, m_thumbnailCache); - connect(&(runnable->m_resultEmitter), SIGNAL(resultsReady(QString)), - SLOT(thumbnailReady(QString))); - connect(&(runnable->m_resultEmitter), SIGNAL(resultsFailed(QString)), - SLOT(thumbnailFailed(QString))); - ((QThreadPool &)m_thumbnailingPool).start(runnable); - } -private slots: - void thumbnailReady(QString path) { emit layoutChanged(); } - void thumbnailFailed(QString path) { m_failed.insert(path); } - void fileChanged(QString filepath) - { - m_thumbnailCache->setStale(filepath); - thumbnailImage(filepath); - // reinsert the path... - watcher.removePath(filepath); - watcher.addPath(filepath); - } - -private: - SharedIconCachePtr m_thumbnailCache; - QThreadPool m_thumbnailingPool; - QSet m_failed; - QSet watched; - QFileSystemWatcher watcher; -}; - -class CenteredEditingDelegate : public QStyledItemDelegate -{ -public: - explicit CenteredEditingDelegate(QObject *parent = 0) : QStyledItemDelegate(parent) {} - virtual ~CenteredEditingDelegate() {} - virtual QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, - const QModelIndex &index) const - { - auto widget = QStyledItemDelegate::createEditor(parent, option, index); - auto foo = dynamic_cast(widget); - if (foo) - { - foo->setAlignment(Qt::AlignHCenter); - foo->setFrame(true); - foo->setMaximumWidth(192); - } - return widget; - } -}; - -ScreenshotsPage::ScreenshotsPage(QString path, QWidget *parent) - : QWidget(parent), ui(new Ui::ScreenshotsPage) -{ - m_model.reset(new QFileSystemModel()); - m_filterModel.reset(new FilterModel()); - m_filterModel->setSourceModel(m_model.get()); - m_model->setFilter(QDir::Files | QDir::Writable | QDir::Readable); - m_model->setReadOnly(false); - m_model->setNameFilters({"*.png"}); - m_model->setNameFilterDisables(false); - m_folder = path; - m_valid = ensureFolderPathExists(m_folder); - - ui->setupUi(this); - ui->tabWidget->tabBar()->hide(); - ui->listView->setModel(m_filterModel.get()); - ui->listView->setIconSize(QSize(128, 128)); - ui->listView->setGridSize(QSize(192, 160)); - ui->listView->setSpacing(9); - // ui->listView->setUniformItemSizes(true); - ui->listView->setLayoutMode(QListView::Batched); - ui->listView->setViewMode(QListView::IconMode); - ui->listView->setResizeMode(QListView::Adjust); - ui->listView->installEventFilter(this); - ui->listView->setEditTriggers(0); - ui->listView->setItemDelegate(new CenteredEditingDelegate(this)); - connect(ui->listView, SIGNAL(activated(QModelIndex)), SLOT(onItemActivated(QModelIndex))); -} - -bool ScreenshotsPage::eventFilter(QObject *obj, QEvent *evt) -{ - if (obj != ui->listView) - return QWidget::eventFilter(obj, evt); - if (evt->type() != QEvent::KeyPress) - { - return QWidget::eventFilter(obj, evt); - } - QKeyEvent *keyEvent = static_cast(evt); - switch (keyEvent->key()) - { - case Qt::Key_Delete: - on_deleteBtn_clicked(); - return true; - case Qt::Key_F2: - on_renameBtn_clicked(); - return true; - default: - break; - } - return QWidget::eventFilter(obj, evt); -} - -ScreenshotsPage::~ScreenshotsPage() -{ - delete ui; -} - -void ScreenshotsPage::onItemActivated(QModelIndex index) -{ - if (!index.isValid()) - return; - auto info = m_model->fileInfo(index); - QString fileName = info.absoluteFilePath(); - openFileInDefaultProgram(info.absoluteFilePath()); -} - -void ScreenshotsPage::on_viewFolderBtn_clicked() -{ - openDirInDefaultProgram(m_folder, true); -} - -void ScreenshotsPage::on_uploadBtn_clicked() -{ - auto selection = ui->listView->selectionModel()->selectedIndexes(); - if (selection.isEmpty()) - return; - - QList uploaded; - auto job = std::make_shared("Screenshot Upload"); - for (auto item : selection) - { - auto info = m_model->fileInfo(item); - auto screenshot = std::make_shared(info); - uploaded.push_back(screenshot); - job->addNetAction(ImgurUpload::make(screenshot)); - } - SequentialTask task; - auto albumTask = std::make_shared("Imgur Album Creation"); - auto imgurAlbum = ImgurAlbumCreation::make(uploaded); - albumTask->addNetAction(imgurAlbum); - task.addTask(job); - task.addTask(albumTask); - ProgressDialog prog(this); - if (prog.exec(&task) != QDialog::Accepted) - { - CustomMessageBox::selectable(this, tr("Failed to upload screenshots!"), - tr("Unknown error"), QMessageBox::Warning)->exec(); - } - else - { - auto link = QString("https://imgur.com/a/%1").arg(imgurAlbum->id()); - QClipboard *clipboard = QApplication::clipboard(); - clipboard->setText(link); - QDesktopServices::openUrl(link); - CustomMessageBox::selectable( - this, tr("Upload finished"), - tr("The link to the uploaded album has been opened in the " - "default browser and placed in your clipboard.
    Delete hash: %2 (save " - "this if you want to be able to edit/delete the album)") - .arg(link, imgurAlbum->deleteHash()), - QMessageBox::Information)->exec(); - } -} - -void ScreenshotsPage::on_deleteBtn_clicked() -{ - auto mbox = CustomMessageBox::selectable( - this, tr("Are you sure?"), tr("This will delete all selected screenshots."), - QMessageBox::Warning, QMessageBox::Yes | QMessageBox::No); - std::unique_ptr box(mbox); - - if (box->exec() != QMessageBox::Yes) - return; - - auto selected = ui->listView->selectionModel()->selectedIndexes(); - for (auto item : selected) - { - m_model->remove(item); - } -} - -void ScreenshotsPage::on_renameBtn_clicked() -{ - auto selection = ui->listView->selectionModel()->selectedIndexes(); - if (selection.isEmpty()) - return; - ui->listView->edit(selection[0]); - // TODO: mass renaming -} - -void ScreenshotsPage::opened() -{ - if (m_valid) - { - QString path = QDir(m_folder).absolutePath(); - m_model->setRootPath(path); - ui->listView->setRootIndex(m_filterModel->mapFromSource(m_model->index(path))); - } -} - -#include "ScreenshotsPage.moc" diff --git a/gui/pages/ScreenshotsPage.h b/gui/pages/ScreenshotsPage.h deleted file mode 100644 index f5700ba8..00000000 --- a/gui/pages/ScreenshotsPage.h +++ /dev/null @@ -1,79 +0,0 @@ -/* Copyright 2013-2015 MultiMC Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include - -#include "BasePage.h" -#include - -class QFileSystemModel; -class QIdentityProxyModel; -namespace Ui -{ -class ScreenshotsPage; -} - -struct ScreenShot; -class ScreenshotList; -class ImgurAlbumCreation; - -class ScreenshotsPage : public QWidget, public BasePage -{ - Q_OBJECT - -public: - explicit ScreenshotsPage(QString path, QWidget *parent = 0); - virtual ~ScreenshotsPage(); - - virtual void opened() override; - - enum - { - NothingDone = 0x42 - }; - - virtual bool eventFilter(QObject *, QEvent *); - virtual QString displayName() const override - { - return tr("Screenshots"); - } - virtual QIcon icon() const override - { - return MMC->getThemedIcon("screenshots"); - } - virtual QString id() const override - { - return "screenshots"; - } - virtual QString helpPage() const override - { - return "Screenshots-management"; - } -private slots: - void on_uploadBtn_clicked(); - void on_deleteBtn_clicked(); - void on_renameBtn_clicked(); - void on_viewFolderBtn_clicked(); - void onItemActivated(QModelIndex); - -private: - Ui::ScreenshotsPage *ui; - std::shared_ptr m_model; - std::shared_ptr m_filterModel; - QString m_folder; - bool m_valid = false; -}; diff --git a/gui/pages/ScreenshotsPage.ui b/gui/pages/ScreenshotsPage.ui deleted file mode 100644 index 30b55092..00000000 --- a/gui/pages/ScreenshotsPage.ui +++ /dev/null @@ -1,109 +0,0 @@ - - - ScreenshotsPage - - - - 0 - 0 - 723 - 532 - - - - Mods - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - - Tab 1 - - - - - - QAbstractItemView::ExtendedSelection - - - QAbstractItemView::SelectItems - - - - - - - - - &Upload - - - - - - - &Delete - - - - - - - &Rename - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - &View Folder - - - - - - - - - - - - - listView - uploadBtn - deleteBtn - renameBtn - viewFolderBtn - - - - diff --git a/gui/pages/TexturePackPage.h b/gui/pages/TexturePackPage.h deleted file mode 100644 index 3c5c27d7..00000000 --- a/gui/pages/TexturePackPage.h +++ /dev/null @@ -1,17 +0,0 @@ -#pragma once -#include "ModFolderPage.h" - -class TexturePackPage : public ModFolderPage -{ -public: - explicit TexturePackPage(MinecraftInstance *instance, QWidget *parent = 0) - : ModFolderPage(instance, instance->texturePackList(), "texturepacks", "resourcepacks", - tr("Texture packs"), "Texture-packs", parent) - { - } - virtual ~TexturePackPage() {} - virtual bool shouldDisplay() const override - { - return m_inst->traits().contains("texturepacks"); - } -}; diff --git a/gui/pages/VersionPage.cpp b/gui/pages/VersionPage.cpp deleted file mode 100644 index 712b496f..00000000 --- a/gui/pages/VersionPage.cpp +++ /dev/null @@ -1,321 +0,0 @@ -/* Copyright 2013-2015 MultiMC Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "MultiMC.h" - -#include -#include -#include -#include -#include - -#include "VersionPage.h" -#include "ui_VersionPage.h" - -#include "gui/Platform.h" -#include "gui/dialogs/CustomMessageBox.h" -#include "gui/dialogs/VersionSelectDialog.h" -#include "gui/dialogs/ModEditDialogCommon.h" - -#include "gui/dialogs/ProgressDialog.h" - -#include -#include -#include -#include -#include - -#include "logic/minecraft/MinecraftProfile.h" -#include "logic/forge/ForgeVersionList.h" -#include "logic/forge/ForgeInstaller.h" -#include "logic/liteloader/LiteLoaderVersionList.h" -#include "logic/liteloader/LiteLoaderInstaller.h" -#include "logic/minecraft/VersionBuilder.h" -#include "logic/auth/MojangAccountList.h" -#include "logic/minecraft/Mod.h" -#include "logic/icons/IconList.h" - - -QIcon VersionPage::icon() const -{ - return ENV.icons()->getIcon(m_inst->iconKey()); -} -bool VersionPage::shouldDisplay() const -{ - return !m_inst->isRunning(); -} - -VersionPage::VersionPage(OneSixInstance *inst, QWidget *parent) - : QWidget(parent), ui(new Ui::VersionPage), m_inst(inst) -{ - ui->setupUi(this); - ui->tabWidget->tabBar()->hide(); - - m_version = m_inst->getMinecraftProfile(); - if (m_version) - { - ui->libraryTreeView->setModel(m_version.get()); - ui->libraryTreeView->installEventFilter(this); - ui->libraryTreeView->setSelectionMode(QAbstractItemView::SingleSelection); - connect(ui->libraryTreeView->selectionModel(), &QItemSelectionModel::currentChanged, - this, &VersionPage::versionCurrent); - updateVersionControls(); - // select first item. - auto index = ui->libraryTreeView->model()->index(0,0); - if(index.isValid()) - ui->libraryTreeView->setCurrentIndex(index); - } - else - { - disableVersionControls(); - } - connect(m_inst, &OneSixInstance::versionReloaded, this, - &VersionPage::updateVersionControls); -} - -VersionPage::~VersionPage() -{ - delete ui; -} - -void VersionPage::updateVersionControls() -{ - ui->forgeBtn->setEnabled(true); - ui->liteloaderBtn->setEnabled(true); -} - -void VersionPage::disableVersionControls() -{ - ui->forgeBtn->setEnabled(false); - ui->liteloaderBtn->setEnabled(false); - ui->reloadLibrariesBtn->setEnabled(false); - ui->removeLibraryBtn->setEnabled(false); -} - -bool VersionPage::reloadMinecraftProfile() -{ - try - { - m_inst->reloadProfile(); - return true; - } - catch (MMCError &e) - { - QMessageBox::critical(this, tr("Error"), e.cause()); - return false; - } - catch (...) - { - QMessageBox::critical( - this, tr("Error"), - tr("Failed to load the version description file for reasons unknown.")); - return false; - } -} - -void VersionPage::on_reloadLibrariesBtn_clicked() -{ - reloadMinecraftProfile(); -} - -void VersionPage::on_removeLibraryBtn_clicked() -{ - if (ui->libraryTreeView->currentIndex().isValid()) - { - // FIXME: use actual model, not reloading. - if (!m_version->remove(ui->libraryTreeView->currentIndex().row())) - { - QMessageBox::critical(this, tr("Error"), tr("Couldn't remove file")); - } - } -} - -void VersionPage::on_jarmodBtn_clicked() -{ - QFileDialog w; - QSet locations; - QString modsFolder = MMC->settings()->get("CentralModsDir").toString(); - auto f = [&](QStandardPaths::StandardLocation l) - { - QString location = QStandardPaths::writableLocation(l); - QFileInfo finfo(location); - if (!finfo.exists()) - return; - locations.insert(location); - }; - f(QStandardPaths::DesktopLocation); - f(QStandardPaths::DocumentsLocation); - f(QStandardPaths::DownloadLocation); - f(QStandardPaths::HomeLocation); - QList urls; - for (auto location : locations) - { - urls.append(QUrl::fromLocalFile(location)); - } - urls.append(QUrl::fromLocalFile(modsFolder)); - - w.setFileMode(QFileDialog::ExistingFiles); - w.setAcceptMode(QFileDialog::AcceptOpen); - w.setNameFilter(tr("Minecraft jar mods (*.zip *.jar)")); - w.setDirectory(modsFolder); - w.setSidebarUrls(urls); - - if (w.exec()) - m_version->installJarMods(w.selectedFiles()); -} - -void VersionPage::on_resetLibraryOrderBtn_clicked() -{ - try - { - m_version->resetOrder(); - } - catch (MMCError &e) - { - QMessageBox::critical(this, tr("Error"), e.cause()); - } -} - -void VersionPage::on_moveLibraryUpBtn_clicked() -{ - if (ui->libraryTreeView->selectionModel()->selectedRows().isEmpty()) - { - return; - } - try - { - const int row = ui->libraryTreeView->selectionModel()->selectedRows().first().row(); - m_version->move(row, MinecraftProfile::MoveUp); - } - catch (MMCError &e) - { - QMessageBox::critical(this, tr("Error"), e.cause()); - } -} - -void VersionPage::on_moveLibraryDownBtn_clicked() -{ - if (ui->libraryTreeView->selectionModel()->selectedRows().isEmpty()) - { - return; - } - try - { - const int row = ui->libraryTreeView->selectionModel()->selectedRows().first().row(); - m_version->move(row, MinecraftProfile::MoveDown); - } - catch (MMCError &e) - { - QMessageBox::critical(this, tr("Error"), e.cause()); - } -} - -void VersionPage::on_changeMCVersionBtn_clicked() -{ - VersionSelectDialog vselect(m_inst->versionList().get(), tr("Change Minecraft version"), - this); - if (!vselect.exec() || !vselect.selectedVersion()) - return; - - if (!MMC->accounts()->anyAccountIsValid()) - { - CustomMessageBox::selectable( - this, tr("Error"), - tr("MultiMC cannot download Minecraft or update instances unless you have at least " - "one account added.\nPlease add your Mojang or Minecraft account."), - QMessageBox::Warning)->show(); - return; - } - - if (!m_version->isVanilla()) - { - auto result = CustomMessageBox::selectable( - this, tr("Are you sure?"), - tr("This will remove any library/version customization you did previously. " - "This includes things like Forge install and similar."), - QMessageBox::Warning, QMessageBox::Ok | QMessageBox::Abort, - QMessageBox::Abort)->exec(); - - if (result != QMessageBox::Ok) - return; - m_version->revertToVanilla(); - reloadMinecraftProfile(); - } - m_inst->setIntendedVersionId(vselect.selectedVersion()->descriptor()); - - auto updateTask = m_inst->doUpdate(); - if (!updateTask) - { - return; - } - ProgressDialog tDialog(this); - connect(updateTask.get(), SIGNAL(failed(QString)), SLOT(onGameUpdateError(QString))); - tDialog.exec(updateTask.get()); -} - -void VersionPage::on_forgeBtn_clicked() -{ - VersionSelectDialog vselect(MMC->forgelist().get(), tr("Select Forge version"), this); - vselect.setExactFilter(1, m_inst->currentVersionId()); - vselect.setEmptyString(tr("No Forge versions are currently available for Minecraft ") + - m_inst->currentVersionId()); - if (vselect.exec() && vselect.selectedVersion()) - { - ProgressDialog dialog(this); - dialog.exec( - ForgeInstaller().createInstallTask(m_inst, vselect.selectedVersion(), this)); - } -} - -void VersionPage::on_liteloaderBtn_clicked() -{ - VersionSelectDialog vselect(MMC->liteloaderlist().get(), tr("Select LiteLoader version"), - this); - vselect.setExactFilter(1, m_inst->currentVersionId()); - vselect.setEmptyString(tr("No LiteLoader versions are currently available for Minecraft ") + - m_inst->currentVersionId()); - if (vselect.exec() && vselect.selectedVersion()) - { - ProgressDialog dialog(this); - dialog.exec( - LiteLoaderInstaller().createInstallTask(m_inst, vselect.selectedVersion(), this)); - } -} - -void VersionPage::versionCurrent(const QModelIndex ¤t, const QModelIndex &previous) -{ - if (!current.isValid()) - { - ui->removeLibraryBtn->setDisabled(true); - ui->moveLibraryDownBtn->setDisabled(true); - ui->moveLibraryUpBtn->setDisabled(true); - } - else - { - bool enabled = m_version->canRemove(current.row()); - ui->removeLibraryBtn->setEnabled(enabled); - ui->moveLibraryDownBtn->setEnabled(enabled); - ui->moveLibraryUpBtn->setEnabled(enabled); - } - QString selectedId = m_version->versionFileId(current.row()); - if (selectedId == "net.minecraft") - { - ui->changeMCVersionBtn->setEnabled(true); - } - else - { - ui->changeMCVersionBtn->setEnabled(false); - } -} diff --git a/gui/pages/VersionPage.h b/gui/pages/VersionPage.h deleted file mode 100644 index 3b90d0c6..00000000 --- a/gui/pages/VersionPage.h +++ /dev/null @@ -1,80 +0,0 @@ -/* Copyright 2013-2015 MultiMC Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include - -#include "logic/minecraft/OneSixInstance.h" -#include "logic/net/NetJob.h" -#include "BasePage.h" - -namespace Ui -{ -class VersionPage; -} - -class VersionPage : public QWidget, public BasePage -{ - Q_OBJECT - -public: - explicit VersionPage(OneSixInstance *inst, QWidget *parent = 0); - virtual ~VersionPage(); - virtual QString displayName() const override - { - return tr("Version"); - } - virtual QIcon icon() const override; - virtual QString id() const override - { - return "version"; - } - virtual QString helpPage() const override - { - return "Instance-version"; - } - virtual bool shouldDisplay() const; -private -slots: - - // version tab - void on_forgeBtn_clicked(); - void on_liteloaderBtn_clicked(); - void on_reloadLibrariesBtn_clicked(); - void on_removeLibraryBtn_clicked(); - void on_resetLibraryOrderBtn_clicked(); - void on_moveLibraryUpBtn_clicked(); - void on_moveLibraryDownBtn_clicked(); - void on_jarmodBtn_clicked(); - - void updateVersionControls(); - void disableVersionControls(); - void on_changeMCVersionBtn_clicked(); - -protected: - /// FIXME: this shouldn't be necessary! - bool reloadMinecraftProfile(); - -private: - Ui::VersionPage *ui; - std::shared_ptr m_version; - OneSixInstance *m_inst; - NetJobPtr forgeJob; - -public -slots: - void versionCurrent(const QModelIndex ¤t, const QModelIndex &previous); -}; diff --git a/gui/pages/VersionPage.ui b/gui/pages/VersionPage.ui deleted file mode 100644 index 9b270d01..00000000 --- a/gui/pages/VersionPage.ui +++ /dev/null @@ -1,204 +0,0 @@ - - - VersionPage - - - - 0 - 0 - 693 - 575 - - - - Version - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - - Tab 1 - - - - - - Qt::ScrollBarAlwaysOn - - - Qt::ScrollBarAlwaysOff - - - false - - - true - - - - - - - - - Selection - - - Qt::AlignCenter - - - - - - - Change version - - - - - - - This isn't implemented yet. - - - Move up - - - - - - - This isn't implemented yet. - - - Move down - - - - - - - Remove - - - - - - - - - - Install - - - Qt::AlignCenter - - - - - - - Replace any current custom version with Minecraft Forge - - - Install Forge - - - - - - - Install LiteLoader - - - - - - - Add jar mod - - - - - - - - - - List - - - Qt::AlignCenter - - - - - - - This isn't implemented yet. - - - Reset order - - - - - - - Reload - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - - - - - ModListView - QTreeView -
    gui/widgets/ModListView.h
    -
    - - LineSeparator - QWidget -
    gui/widgets/LineSeparator.h
    - 1 -
    -
    - - -
    diff --git a/gui/pages/global/AccountListPage.cpp b/gui/pages/global/AccountListPage.cpp deleted file mode 100644 index 72e18405..00000000 --- a/gui/pages/global/AccountListPage.cpp +++ /dev/null @@ -1,142 +0,0 @@ -/* Copyright 2013-2015 MultiMC Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "AccountListPage.h" -#include "ui_AccountListPage.h" - -#include - -#include - -#include "logic/net/NetJob.h" -#include "logic/net/URLConstants.h" -#include "logic/Env.h" - -#include "gui/dialogs/EditAccountDialog.h" -#include "gui/dialogs/ProgressDialog.h" -#include "gui/dialogs/AccountSelectDialog.h" -#include "gui/dialogs/LoginDialog.h" -#include "gui/dialogs/CustomMessageBox.h" -#include "logic/tasks/Task.h" -#include "logic/auth/YggdrasilTask.h" - -#include - -AccountListPage::AccountListPage(QWidget *parent) - : QWidget(parent), ui(new Ui::AccountListPage) -{ - ui->setupUi(this); - ui->tabWidget->tabBar()->hide(); - - m_accounts = MMC->accounts(); - - ui->listView->setModel(m_accounts.get()); - ui->listView->header()->setSectionResizeMode(QHeaderView::ResizeToContents); - - // Expand the account column - ui->listView->header()->setSectionResizeMode(1, QHeaderView::Stretch); - - QItemSelectionModel *selectionModel = ui->listView->selectionModel(); - - connect(selectionModel, &QItemSelectionModel::selectionChanged, - [this](const QItemSelection &sel, const QItemSelection &dsel) - { updateButtonStates(); }); - - connect(m_accounts.get(), SIGNAL(listChanged()), SLOT(listChanged())); - connect(m_accounts.get(), SIGNAL(activeAccountChanged()), SLOT(listChanged())); - - updateButtonStates(); -} - -AccountListPage::~AccountListPage() -{ - delete ui; -} - -void AccountListPage::listChanged() -{ - updateButtonStates(); -} - -void AccountListPage::on_addAccountBtn_clicked() -{ - addAccount(tr("Please enter your Mojang or Minecraft account username and password to add " - "your account.")); -} - -void AccountListPage::on_rmAccountBtn_clicked() -{ - QModelIndexList selection = ui->listView->selectionModel()->selectedIndexes(); - if (selection.size() > 0) - { - QModelIndex selected = selection.first(); - m_accounts->removeAccount(selected); - } -} - -void AccountListPage::on_setDefaultBtn_clicked() -{ - QModelIndexList selection = ui->listView->selectionModel()->selectedIndexes(); - if (selection.size() > 0) - { - QModelIndex selected = selection.first(); - MojangAccountPtr account = - selected.data(MojangAccountList::PointerRole).value(); - m_accounts->setActiveAccount(account->username()); - } -} - -void AccountListPage::on_noDefaultBtn_clicked() -{ - m_accounts->setActiveAccount(""); -} - -void AccountListPage::updateButtonStates() -{ - // If there is no selection, disable buttons that require something selected. - QModelIndexList selection = ui->listView->selectionModel()->selectedIndexes(); - - ui->rmAccountBtn->setEnabled(selection.size() > 0); - ui->setDefaultBtn->setEnabled(selection.size() > 0); - - ui->noDefaultBtn->setDown(m_accounts->activeAccount().get() == nullptr); -} - -void AccountListPage::addAccount(const QString &errMsg) -{ - // TODO: The login dialog isn't quite done yet - MojangAccountPtr account = LoginDialog::newAccount(this, errMsg); - - if (account != nullptr) - { - m_accounts->addAccount(account); - if (m_accounts->count() == 1) - m_accounts->setActiveAccount(account->username()); - - // Grab associated player skins - auto job = new NetJob("Player skins: " + account->username()); - - for (AccountProfile profile : account->profiles()) - { - auto meta = Env::getInstance().metacache()->resolveEntry("skins", profile.name + ".png"); - auto action = CacheDownload::make( - QUrl("http://" + URLConstants::SKINS_BASE + profile.name + ".png"), meta); - job->addNetAction(action); - meta->stale = true; - } - - job->start(); - } -} diff --git a/gui/pages/global/AccountListPage.h b/gui/pages/global/AccountListPage.h deleted file mode 100644 index 9fd894b8..00000000 --- a/gui/pages/global/AccountListPage.h +++ /dev/null @@ -1,86 +0,0 @@ -/* Copyright 2013-2015 MultiMC Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include -#include - -#include "gui/pages/BasePage.h" - -#include "logic/auth/MojangAccountList.h" -#include - -namespace Ui -{ -class AccountListPage; -} - -class AuthenticateTask; - -class AccountListPage : public QWidget, public BasePage -{ - Q_OBJECT -public: - explicit AccountListPage(QWidget *parent = 0); - ~AccountListPage(); - - QString displayName() const override - { - return tr("Accounts"); - } - QIcon icon() const override - { - auto icon = MMC->getThemedIcon("accounts"); - if(icon.isNull()) - { - icon = MMC->getThemedIcon("noaccount"); - } - return icon; - } - QString id() const override - { - return "accounts"; - } - QString helpPage() const override - { - return "Accounts"; - } - -public -slots: - void on_addAccountBtn_clicked(); - - void on_rmAccountBtn_clicked(); - - void on_setDefaultBtn_clicked(); - - void on_noDefaultBtn_clicked(); - - void listChanged(); - - //! Updates the states of the dialog's buttons. - void updateButtonStates(); - -protected: - std::shared_ptr m_accounts; - -protected -slots: - void addAccount(const QString& errMsg=""); - -private: - Ui::AccountListPage *ui; -}; diff --git a/gui/pages/global/AccountListPage.ui b/gui/pages/global/AccountListPage.ui deleted file mode 100644 index 8ad78cf4..00000000 --- a/gui/pages/global/AccountListPage.ui +++ /dev/null @@ -1,115 +0,0 @@ - - - AccountListPage - - - - 0 - 0 - 694 - 609 - - - - Manage Accounts - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - - Tab 1 - - - - - - <html><head/><body><p>Welcome! If you're new here, you can click the &quot;Add&quot; button to add your Mojang or Minecraft account.</p></body></html> - - - true - - - - - - - - - - - - - - &Add - - - - - - - &Remove - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - <html><head/><body><p>Set the currently selected account as the active account. The active account is the account that is used to log in (unless it is overridden in an instance-specific setting).</p></body></html> - - - &Set Default - - - - - - - Set no default account. This will cause MultiMC to prompt you to select an account every time you launch an instance that doesn't have its own default set. - - - &No Default - - - - - - - - - - - - - - - - diff --git a/gui/pages/global/ExternalToolsPage.cpp b/gui/pages/global/ExternalToolsPage.cpp deleted file mode 100644 index e2dd70dd..00000000 --- a/gui/pages/global/ExternalToolsPage.cpp +++ /dev/null @@ -1,238 +0,0 @@ -/* Copyright 2013-2015 MultiMC Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "ExternalToolsPage.h" -#include "ui_ExternalToolsPage.h" - -#include -#include -#include - -#include - -#include "logic/settings/SettingsObject.h" -#include "logic/tools/BaseProfiler.h" -#include "MultiMC.h" - -ExternalToolsPage::ExternalToolsPage(QWidget *parent) : - QWidget(parent), - ui(new Ui::ExternalToolsPage) -{ - ui->setupUi(this); - ui->tabWidget->tabBar()->hide(); - - #if QT_VERSION >= QT_VERSION_CHECK(5, 2, 0) - ui->jsonEditorTextBox->setClearButtonEnabled(true); - #endif - - ui->mceditLink->setOpenExternalLinks(true); - ui->jvisualvmLink->setOpenExternalLinks(true); - ui->jprofilerLink->setOpenExternalLinks(true); - loadSettings(); -} - -ExternalToolsPage::~ExternalToolsPage() -{ - delete ui; -} - -void ExternalToolsPage::loadSettings() -{ - auto s = MMC->settings(); - ui->jprofilerPathEdit->setText(s->get("JProfilerPath").toString()); - ui->jvisualvmPathEdit->setText(s->get("JVisualVMPath").toString()); - ui->mceditPathEdit->setText(s->get("MCEditPath").toString()); - - // Editors - ui->jsonEditorTextBox->setText(s->get("JsonEditor").toString()); -} -void ExternalToolsPage::applySettings() -{ - auto s = MMC->settings(); - s->set("JProfilerPath", ui->jprofilerPathEdit->text()); - s->set("JVisualVMPath", ui->jvisualvmPathEdit->text()); - s->set("MCEditPath", ui->mceditPathEdit->text()); - - // Editors - QString jsonEditor = ui->jsonEditorTextBox->text(); - if (!jsonEditor.isEmpty() && - (!QFileInfo(jsonEditor).exists() || !QFileInfo(jsonEditor).isExecutable())) - { - QString found = QStandardPaths::findExecutable(jsonEditor); - if (!found.isEmpty()) - { - jsonEditor = found; - } - } - s->set("JsonEditor", jsonEditor); -} - -void ExternalToolsPage::on_jprofilerPathBtn_clicked() -{ - QString raw_dir = ui->jprofilerPathEdit->text(); - QString error; - do - { - raw_dir = QFileDialog::getExistingDirectory(this, tr("JProfiler Directory"), raw_dir); - if (raw_dir.isEmpty()) - { - break; - } - QString cooked_dir = NormalizePath(raw_dir); - if (!MMC->profilers()["jprofiler"]->check(cooked_dir, &error)) - { - QMessageBox::critical(this, tr("Error"), - tr("Error while checking JProfiler install:\n%1").arg(error)); - continue; - } - else - { - ui->jprofilerPathEdit->setText(cooked_dir); - break; - } - } while (1); -} -void ExternalToolsPage::on_jprofilerCheckBtn_clicked() -{ - QString error; - if (!MMC->profilers()["jprofiler"]->check(ui->jprofilerPathEdit->text(), &error)) - { - QMessageBox::critical(this, tr("Error"), - tr("Error while checking JProfiler install:\n%1").arg(error)); - } - else - { - QMessageBox::information(this, tr("OK"), tr("JProfiler setup seems to be OK")); - } -} - -void ExternalToolsPage::on_jvisualvmPathBtn_clicked() -{ - QString raw_dir = ui->jvisualvmPathEdit->text(); - QString error; - do - { - raw_dir = QFileDialog::getOpenFileName(this, tr("JVisualVM Executable"), raw_dir); - if (raw_dir.isEmpty()) - { - break; - } - QString cooked_dir = NormalizePath(raw_dir); - if (!MMC->profilers()["jvisualvm"]->check(cooked_dir, &error)) - { - QMessageBox::critical(this, tr("Error"), - tr("Error while checking JVisualVM install:\n%1").arg(error)); - continue; - } - else - { - ui->jvisualvmPathEdit->setText(cooked_dir); - break; - } - } while (1); -} -void ExternalToolsPage::on_jvisualvmCheckBtn_clicked() -{ - QString error; - if (!MMC->profilers()["jvisualvm"]->check(ui->jvisualvmPathEdit->text(), &error)) - { - QMessageBox::critical(this, tr("Error"), - tr("Error while checking JVisualVM install:\n%1").arg(error)); - } - else - { - QMessageBox::information(this, tr("OK"), tr("JVisualVM setup seems to be OK")); - } -} - -void ExternalToolsPage::on_mceditPathBtn_clicked() -{ - QString raw_dir = ui->mceditPathEdit->text(); - QString error; - do - { -#ifdef Q_OS_OSX -#warning stuff - raw_dir = QFileDialog::getOpenFileName(this, tr("MCEdit Application"), raw_dir); -#else - raw_dir = QFileDialog::getExistingDirectory(this, tr("MCEdit Directory"), raw_dir); -#endif - if (raw_dir.isEmpty()) - { - break; - } - QString cooked_dir = NormalizePath(raw_dir); - if (!MMC->tools()["mcedit"]->check(cooked_dir, &error)) - { - QMessageBox::critical(this, tr("Error"), - tr("Error while checking MCEdit install:\n%1").arg(error)); - continue; - } - else - { - ui->mceditPathEdit->setText(cooked_dir); - break; - } - } while (1); -} -void ExternalToolsPage::on_mceditCheckBtn_clicked() -{ - QString error; - if (!MMC->tools()["mcedit"]->check(ui->mceditPathEdit->text(), &error)) - { - QMessageBox::critical(this, tr("Error"), - tr("Error while checking MCEdit install:\n%1").arg(error)); - } - else - { - QMessageBox::information(this, tr("OK"), tr("MCEdit setup seems to be OK")); - } -} - -void ExternalToolsPage::on_jsonEditorBrowseBtn_clicked() -{ - QString raw_file = QFileDialog::getOpenFileName( - this, tr("JSON Editor"), - ui->jsonEditorTextBox->text().isEmpty() -#if defined(Q_OS_LINUX) - ? QString("/usr/bin") -#else - ? QStandardPaths::standardLocations(QStandardPaths::ApplicationsLocation).first() -#endif - : ui->jsonEditorTextBox->text()); - QString cooked_file = NormalizePath(raw_file); - - if (cooked_file.isEmpty()) - { - return; - } - - // it has to exist and be an executable - if (QFileInfo(cooked_file).exists() && QFileInfo(cooked_file).isExecutable()) - { - ui->jsonEditorTextBox->setText(cooked_file); - } - else - { - QMessageBox::warning(this, tr("Invalid"), - tr("The file chosen does not seem to be an executable")); - } -} - -bool ExternalToolsPage::apply() -{ - applySettings(); - return true; -} diff --git a/gui/pages/global/ExternalToolsPage.h b/gui/pages/global/ExternalToolsPage.h deleted file mode 100644 index 7c5efad6..00000000 --- a/gui/pages/global/ExternalToolsPage.h +++ /dev/null @@ -1,74 +0,0 @@ -/* Copyright 2013-2015 MultiMC Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include - -#include "gui/pages/BasePage.h" -#include - -namespace Ui { -class ExternalToolsPage; -} - -class ExternalToolsPage : public QWidget, public BasePage -{ - Q_OBJECT - -public: - explicit ExternalToolsPage(QWidget *parent = 0); - ~ExternalToolsPage(); - - QString displayName() const override - { - return tr("External Tools"); - } - QIcon icon() const override - { - auto icon = MMC->getThemedIcon("externaltools"); - if(icon.isNull()) - { - icon = MMC->getThemedIcon("loadermods"); - } - return icon; - } - QString id() const override - { - return "external-tools"; - } - QString helpPage() const override - { - return "External-tools"; - } - virtual bool apply(); - -private: - void loadSettings(); - void applySettings(); - -private: - Ui::ExternalToolsPage *ui; - -private -slots: - void on_jprofilerPathBtn_clicked(); - void on_jprofilerCheckBtn_clicked(); - void on_jvisualvmPathBtn_clicked(); - void on_jvisualvmCheckBtn_clicked(); - void on_mceditPathBtn_clicked(); - void on_mceditCheckBtn_clicked(); - void on_jsonEditorBrowseBtn_clicked(); -}; diff --git a/gui/pages/global/ExternalToolsPage.ui b/gui/pages/global/ExternalToolsPage.ui deleted file mode 100644 index ba1b6f01..00000000 --- a/gui/pages/global/ExternalToolsPage.ui +++ /dev/null @@ -1,197 +0,0 @@ - - - ExternalToolsPage - - - - 0 - 0 - 673 - 751 - - - - Form - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - - Tab 1 - - - - - - JProfiler - - - - - - - - - - - ... - - - - - - - - - Check - - - - - - - <html><head/><body><p><a href="http://www.ej-technologies.com/products/jprofiler/overview.html"><span style=" text-decoration: underline; color:#0000ff;">http://www.ej-technologies.com/products/jprofiler/overview.html</span></a></p></body></html> - - - - - - - - - - JVisualVM - - - - - - - - - - - ... - - - - - - - - - Check - - - - - - - <html><head/><body><p><a href="http://visualvm.java.net/"><span style=" text-decoration: underline; color:#0000ff;">http://visualvm.java.net/</span></a></p></body></html> - - - - - - - - - - MCEdit - - - - - - - - - - - ... - - - - - - - - - Check - - - - - - - <html><head/><body><p><a href="http://www.mcedit.net/"><span style=" text-decoration: underline; color:#0000ff;">http://www.mcedit.net/</span></a></p></body></html> - - - - - - - - - - External Editors (leave empty for system default) - - - - - - - - - Text Editor: - - - - - - - ... - - - - - - - - - - Qt::Vertical - - - - 20 - 216 - - - - - - - - - - - - - diff --git a/gui/pages/global/JavaPage.cpp b/gui/pages/global/JavaPage.cpp deleted file mode 100644 index b0ed23ea..00000000 --- a/gui/pages/global/JavaPage.cpp +++ /dev/null @@ -1,146 +0,0 @@ -/* Copyright 2013-2015 MultiMC Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "JavaPage.h" -#include "ui_JavaPage.h" - -#include -#include -#include - -#include - -#include "gui/NagUtils.h" - -#include "gui/Platform.h" -#include "gui/dialogs/VersionSelectDialog.h" -#include - -#include "logic/java/JavaUtils.h" -#include "logic/java/JavaVersionList.h" -#include "logic/java/JavaChecker.h" - -#include "logic/settings/SettingsObject.h" -#include "MultiMC.h" - -JavaPage::JavaPage(QWidget *parent) : QWidget(parent), ui(new Ui::JavaPage) -{ - ui->setupUi(this); - ui->tabWidget->tabBar()->hide(); - - auto resizer = new ColumnResizer(this); - resizer->addWidgetsFromLayout(ui->javaSettingsGroupBox->layout(), 0); - resizer->addWidgetsFromLayout(ui->customCommandsGroupBox->layout(), 0); - - loadSettings(); -} - -JavaPage::~JavaPage() -{ - delete ui; -} - -bool JavaPage::apply() -{ - applySettings(); - return true; -} - -void JavaPage::applySettings() -{ - auto s = MMC->settings(); - // Memory - s->set("MinMemAlloc", ui->minMemSpinBox->value()); - s->set("MaxMemAlloc", ui->maxMemSpinBox->value()); - s->set("PermGen", ui->permGenSpinBox->value()); - - // Java Settings - s->set("JavaPath", ui->javaPathTextBox->text()); - s->set("JvmArgs", ui->jvmArgsTextBox->text()); - NagUtils::checkJVMArgs(s->get("JvmArgs").toString(), this->parentWidget()); - - // Custom Commands - s->set("PreLaunchCommand", ui->preLaunchCmdTextBox->text()); - s->set("PostExitCommand", ui->postExitCmdTextBox->text()); -} -void JavaPage::loadSettings() -{ - auto s = MMC->settings(); - // Memory - ui->minMemSpinBox->setValue(s->get("MinMemAlloc").toInt()); - ui->maxMemSpinBox->setValue(s->get("MaxMemAlloc").toInt()); - ui->permGenSpinBox->setValue(s->get("PermGen").toInt()); - - // Java Settings - ui->javaPathTextBox->setText(s->get("JavaPath").toString()); - ui->jvmArgsTextBox->setText(s->get("JvmArgs").toString()); - - // Custom Commands - ui->preLaunchCmdTextBox->setText(s->get("PreLaunchCommand").toString()); - ui->postExitCmdTextBox->setText(s->get("PostExitCommand").toString()); -} - -void JavaPage::on_javaDetectBtn_clicked() -{ - JavaVersionPtr java; - - VersionSelectDialog vselect(MMC->javalist().get(), tr("Select a Java version"), this, true); - vselect.setResizeOn(2); - vselect.exec(); - - if (vselect.result() == QDialog::Accepted && vselect.selectedVersion()) - { - java = std::dynamic_pointer_cast(vselect.selectedVersion()); - ui->javaPathTextBox->setText(java->path); - } -} -void JavaPage::on_javaBrowseBtn_clicked() -{ - QString dir = QFileDialog::getOpenFileName(this, tr("Find Java executable")); - if (!dir.isNull()) - { - ui->javaPathTextBox->setText(dir); - } -} -void JavaPage::on_javaTestBtn_clicked() -{ - checker.reset(new JavaChecker()); - connect(checker.get(), SIGNAL(checkFinished(JavaCheckResult)), this, - SLOT(checkFinished(JavaCheckResult))); - checker->path = ui->javaPathTextBox->text(); - checker->performCheck(); -} - -void JavaPage::checkFinished(JavaCheckResult result) -{ - if (result.valid) - { - QString text; - text += "Java test succeeded!\n"; - if (result.is_64bit) - text += "Using 64bit java.\n"; - text += "\n"; - text += "Platform reported: " + result.realPlatform + "\n"; - text += "Java version reported: " + result.javaVersion; - QMessageBox::information(this, tr("Java test success"), text); - } - else - { - QMessageBox::warning( - this, tr("Java test failure"), - tr("The specified java binary didn't work. You should use the auto-detect feature, " - "or set the path to the java executable.")); - } -} diff --git a/gui/pages/global/JavaPage.h b/gui/pages/global/JavaPage.h deleted file mode 100644 index f70d9dbd..00000000 --- a/gui/pages/global/JavaPage.h +++ /dev/null @@ -1,73 +0,0 @@ -/* Copyright 2013-2015 MultiMC Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include -#include - -#include "logic/java/JavaChecker.h" -#include "gui/pages/BasePage.h" -#include - -class SettingsObject; - -namespace Ui -{ -class JavaPage; -} - -class JavaPage : public QWidget, public BasePage -{ - Q_OBJECT - -public: - explicit JavaPage(QWidget *parent = 0); - ~JavaPage(); - - QString displayName() const override - { - return tr("Java"); - } - QIcon icon() const override - { - return MMC->getThemedIcon("java"); - } - QString id() const override - { - return "java-settings"; - } - QString helpPage() const override - { - return "Java-settings"; - } - bool apply() override; - -private: - void applySettings(); - void loadSettings(); - -private -slots: - void on_javaDetectBtn_clicked(); - void on_javaTestBtn_clicked(); - void on_javaBrowseBtn_clicked(); - - void checkFinished(JavaCheckResult result); - -private: - Ui::JavaPage *ui; - std::shared_ptr checker; -}; diff --git a/gui/pages/global/JavaPage.ui b/gui/pages/global/JavaPage.ui deleted file mode 100644 index 6ae41a49..00000000 --- a/gui/pages/global/JavaPage.ui +++ /dev/null @@ -1,303 +0,0 @@ - - - JavaPage - - - - 0 - 0 - 545 - 609 - - - - - 0 - 0 - - - - Settings - - - - :/icons/toolbar/settings:/icons/toolbar/settings - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - - Tab 1 - - - - - - Memory - - - - - - The maximum amount of memory Minecraft is allowed to use. - - - MB - - - 512 - - - 65536 - - - 128 - - - 1024 - - - - - - - Minimum memory allocation: - - - - - - - Maximum memory allocation: - - - - - - - The amount of memory Minecraft is started with. - - - MB - - - 256 - - - 65536 - - - 128 - - - 256 - - - - - - - PermGen: - - - - - - - The amount of memory available to store loaded Java classes. - - - MB - - - 64 - - - 999999999 - - - 8 - - - 64 - - - - - - - - - - Java Runtime - - - - - - - 0 - 0 - - - - Java path: - - - - - - - - 0 - 0 - - - - Auto-detect... - - - - - - - - 0 - 0 - - - - Test - - - - - - - - 0 - 0 - - - - JVM arguments: - - - - - - - - - - - - - 0 - 0 - - - - - 28 - 16777215 - - - - ... - - - - - - - - - - - - - - - Custom Commands - - - - - - Post-exit command: - - - - - - - Pre-launch command: - - - - - - - - - - - - - - - - - 0 - 0 - - - - Pre-launch command runs before the instance launches and post-exit command runs after it exits. Both will be run in MultiMC's working directory with INST_ID, INST_DIR, and INST_NAME as environment variables. - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - true - - - - - - - - - - - minMemSpinBox - maxMemSpinBox - permGenSpinBox - javaPathTextBox - javaBrowseBtn - javaDetectBtn - javaTestBtn - jvmArgsTextBox - preLaunchCmdTextBox - postExitCmdTextBox - - - - diff --git a/gui/pages/global/MinecraftPage.cpp b/gui/pages/global/MinecraftPage.cpp deleted file mode 100644 index 5f752206..00000000 --- a/gui/pages/global/MinecraftPage.cpp +++ /dev/null @@ -1,92 +0,0 @@ -/* Copyright 2013-2015 MultiMC Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "MinecraftPage.h" -#include "ui_MinecraftPage.h" - -#include -#include -#include - -#include - -#include "gui/Platform.h" -#include "gui/dialogs/VersionSelectDialog.h" -#include "gui/dialogs/CustomMessageBox.h" - -#include "gui/NagUtils.h" - -#include "logic/java/JavaUtils.h" -#include "logic/java/JavaVersionList.h" -#include "logic/java/JavaChecker.h" - -#include "logic/updater/UpdateChecker.h" - -#include "logic/tools/BaseProfiler.h" - -#include "logic/settings/SettingsObject.h" -#include "MultiMC.h" - -MinecraftPage::MinecraftPage(QWidget *parent) : QWidget(parent), ui(new Ui::MinecraftPage) -{ - ui->setupUi(this); - ui->tabWidget->tabBar()->hide(); - loadSettings(); - updateCheckboxStuff(); -} - -MinecraftPage::~MinecraftPage() -{ - delete ui; -} - -bool MinecraftPage::apply() -{ - applySettings(); - return true; -} - -void MinecraftPage::updateCheckboxStuff() -{ - ui->windowWidthSpinBox->setEnabled(!ui->maximizedCheckBox->isChecked()); - ui->windowHeightSpinBox->setEnabled(!ui->maximizedCheckBox->isChecked()); -} - -void MinecraftPage::on_maximizedCheckBox_clicked(bool checked) -{ - Q_UNUSED(checked); - updateCheckboxStuff(); -} - - -void MinecraftPage::applySettings() -{ - auto s = MMC->settings(); - - // Window Size - s->set("LaunchMaximized", ui->maximizedCheckBox->isChecked()); - s->set("MinecraftWinWidth", ui->windowWidthSpinBox->value()); - s->set("MinecraftWinHeight", ui->windowHeightSpinBox->value()); -} - -void MinecraftPage::loadSettings() -{ - auto s = MMC->settings(); - - // Window Size - ui->maximizedCheckBox->setChecked(s->get("LaunchMaximized").toBool()); - ui->windowWidthSpinBox->setValue(s->get("MinecraftWinWidth").toInt()); - ui->windowHeightSpinBox->setValue(s->get("MinecraftWinHeight").toInt()); -} diff --git a/gui/pages/global/MinecraftPage.h b/gui/pages/global/MinecraftPage.h deleted file mode 100644 index 6dd86338..00000000 --- a/gui/pages/global/MinecraftPage.h +++ /dev/null @@ -1,70 +0,0 @@ -/* Copyright 2013-2015 MultiMC Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include -#include - -#include "logic/java/JavaChecker.h" -#include "gui/pages/BasePage.h" -#include - -class SettingsObject; - -namespace Ui -{ -class MinecraftPage; -} - -class MinecraftPage : public QWidget, public BasePage -{ - Q_OBJECT - -public: - explicit MinecraftPage(QWidget *parent = 0); - ~MinecraftPage(); - - QString displayName() const override - { - return tr("Minecraft"); - } - QIcon icon() const override - { - return MMC->getThemedIcon("minecraft"); - } - QString id() const override - { - return "minecraft-settings"; - } - QString helpPage() const override - { - return "Minecraft-settings"; - } - bool apply() override; - -private: - void updateCheckboxStuff(); - void applySettings(); - void loadSettings(); - -private -slots: - void on_maximizedCheckBox_clicked(bool checked); - -private: - Ui::MinecraftPage *ui; - -}; diff --git a/gui/pages/global/MinecraftPage.ui b/gui/pages/global/MinecraftPage.ui deleted file mode 100644 index 825f6a56..00000000 --- a/gui/pages/global/MinecraftPage.ui +++ /dev/null @@ -1,148 +0,0 @@ - - - MinecraftPage - - - - 0 - 0 - 545 - 195 - - - - - 0 - 0 - - - - Settings - - - - :/icons/toolbar/settings:/icons/toolbar/settings - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - QTabWidget::Rounded - - - 0 - - - - Minecraft - - - - - - Window Size - - - - - - Start Minecraft maximized? - - - - - - - - - Window hei&ght: - - - windowHeightSpinBox - - - - - - - W&indow width: - - - windowWidthSpinBox - - - - - - - 1 - - - 65536 - - - 1 - - - 854 - - - - - - - 1 - - - 65536 - - - 480 - - - - - - - - - - - - Qt::Vertical - - - - 0 - 0 - - - - - - - - - - - - tabWidget - maximizedCheckBox - windowWidthSpinBox - windowHeightSpinBox - - - - diff --git a/gui/pages/global/MultiMCPage.cpp b/gui/pages/global/MultiMCPage.cpp deleted file mode 100644 index d2934666..00000000 --- a/gui/pages/global/MultiMCPage.cpp +++ /dev/null @@ -1,459 +0,0 @@ -/* Copyright 2013-2015 MultiMC Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "MultiMCPage.h" -#include "ui_MultiMCPage.h" - -#include -#include -#include -#include - -#include - -#include "gui/Platform.h" -#include "gui/dialogs/VersionSelectDialog.h" -#include "gui/dialogs/CustomMessageBox.h" -#include - -#include "gui/NagUtils.h" - -#include "logic/java/JavaUtils.h" -#include "logic/java/JavaVersionList.h" -#include "logic/java/JavaChecker.h" - -#include "logic/updater/UpdateChecker.h" - -#include "logic/tools/BaseProfiler.h" - -#include "logic/settings/SettingsObject.h" -#include "MultiMC.h" - -// FIXME: possibly move elsewhere -enum InstSortMode -{ - // Sort alphabetically by name. - Sort_Name, - // Sort by which instance was launched most recently. - Sort_LastLaunch -}; - -MultiMCPage::MultiMCPage(QWidget *parent) : QWidget(parent), ui(new Ui::MultiMCPage) -{ - ui->setupUi(this); - ui->sortingModeGroup->setId(ui->sortByNameBtn, Sort_Name); - ui->sortingModeGroup->setId(ui->sortLastLaunchedBtn, Sort_LastLaunch); - - auto resizer = new ColumnResizer(this); - resizer->addWidgetsFromLayout(ui->groupBox->layout(), 1); - resizer->addWidgetsFromLayout(ui->foldersBox->layout(), 1); - - defaultFormat = new QTextCharFormat(ui->fontPreview->currentCharFormat()); - - loadSettings(); - - QObject::connect(MMC->updateChecker().get(), &UpdateChecker::channelListLoaded, this, - &MultiMCPage::refreshUpdateChannelList); - - if (MMC->updateChecker()->hasChannels()) - { - refreshUpdateChannelList(); - } - else - { - MMC->updateChecker()->updateChanList(false); - } - connect(ui->fontSizeBox, SIGNAL(valueChanged(int)), SLOT(refreshFontPreview())); - connect(ui->consoleFont, SIGNAL(currentFontChanged(QFont)), SLOT(refreshFontPreview())); -} - -MultiMCPage::~MultiMCPage() -{ - delete ui; -} - -bool MultiMCPage::apply() -{ - applySettings(); - return true; -} - -void MultiMCPage::on_ftbLauncherBrowseBtn_clicked() -{ - QString raw_dir = QFileDialog::getExistingDirectory(this, tr("FTB Launcher Directory"), - ui->ftbLauncherBox->text()); - QString cooked_dir = NormalizePath(raw_dir); - - // do not allow current dir - it's dirty. Do not allow dirs that don't exist - if (!cooked_dir.isEmpty() && QDir(cooked_dir).exists()) - { - ui->ftbLauncherBox->setText(cooked_dir); - } -} -void MultiMCPage::on_ftbBrowseBtn_clicked() -{ - QString raw_dir = - QFileDialog::getExistingDirectory(this, tr("FTB Directory"), ui->ftbBox->text()); - QString cooked_dir = NormalizePath(raw_dir); - - // do not allow current dir - it's dirty. Do not allow dirs that don't exist - if (!cooked_dir.isEmpty() && QDir(cooked_dir).exists()) - { - ui->ftbBox->setText(cooked_dir); - } -} - -void MultiMCPage::on_instDirBrowseBtn_clicked() -{ - QString raw_dir = QFileDialog::getExistingDirectory(this, tr("Instance Directory"), - ui->instDirTextBox->text()); - QString cooked_dir = NormalizePath(raw_dir); - - // do not allow current dir - it's dirty. Do not allow dirs that don't exist - if (!cooked_dir.isEmpty() && QDir(cooked_dir).exists()) - { - if (checkProblemticPathJava(QDir(cooked_dir))) - { - QMessageBox warning; - warning.setText(tr("You're trying to specify an instance folder which\'s path " - "contains at least one \'!\'. " - "Java is known to cause problems if that is the case, your " - "instances (probably) won't start!")); - warning.setInformativeText( - tr("Do you really want to use this path? " - "Selecting \"No\" will close this and not alter your instance path.")); - warning.setStandardButtons(QMessageBox::Yes | QMessageBox::No); - int result = warning.exec(); - if (result == QMessageBox::Yes) - { - ui->instDirTextBox->setText(cooked_dir); - } - } - else - { - ui->instDirTextBox->setText(cooked_dir); - } - } -} - -void MultiMCPage::on_iconsDirBrowseBtn_clicked() -{ - QString raw_dir = QFileDialog::getExistingDirectory(this, tr("Icons Directory"), - ui->iconsDirTextBox->text()); - QString cooked_dir = NormalizePath(raw_dir); - - // do not allow current dir - it's dirty. Do not allow dirs that don't exist - if (!cooked_dir.isEmpty() && QDir(cooked_dir).exists()) - { - ui->iconsDirTextBox->setText(cooked_dir); - } -} -void MultiMCPage::on_modsDirBrowseBtn_clicked() -{ - QString raw_dir = QFileDialog::getExistingDirectory(this, tr("Mods Directory"), - ui->modsDirTextBox->text()); - QString cooked_dir = NormalizePath(raw_dir); - - // do not allow current dir - it's dirty. Do not allow dirs that don't exist - if (!cooked_dir.isEmpty() && QDir(cooked_dir).exists()) - { - ui->modsDirTextBox->setText(cooked_dir); - } -} -void MultiMCPage::on_lwjglDirBrowseBtn_clicked() -{ - QString raw_dir = QFileDialog::getExistingDirectory(this, tr("LWJGL Directory"), - ui->lwjglDirTextBox->text()); - QString cooked_dir = NormalizePath(raw_dir); - - // do not allow current dir - it's dirty. Do not allow dirs that don't exist - if (!cooked_dir.isEmpty() && QDir(cooked_dir).exists()) - { - ui->lwjglDirTextBox->setText(cooked_dir); - } -} - -void MultiMCPage::refreshUpdateChannelList() -{ - // Stop listening for selection changes. It's going to change a lot while we update it and - // we don't need to update the - // description label constantly. - QObject::disconnect(ui->updateChannelComboBox, SIGNAL(currentIndexChanged(int)), this, - SLOT(updateChannelSelectionChanged(int))); - - QList channelList = MMC->updateChecker()->getChannelList(); - ui->updateChannelComboBox->clear(); - int selection = -1; - for (int i = 0; i < channelList.count(); i++) - { - UpdateChecker::ChannelListEntry entry = channelList.at(i); - - // When it comes to selection, we'll rely on the indexes of a channel entry being the - // same in the - // combo box as it is in the update checker's channel list. - // This probably isn't very safe, but the channel list doesn't change often enough (or - // at all) for - // this to be a big deal. Hope it doesn't break... - ui->updateChannelComboBox->addItem(entry.name); - - // If the update channel we just added was the selected one, set the current index in - // the combo box to it. - if (entry.id == m_currentUpdateChannel) - { - qDebug() << "Selected index" << i << "channel id" << m_currentUpdateChannel; - selection = i; - } - } - - ui->updateChannelComboBox->setCurrentIndex(selection); - - // Start listening for selection changes again and update the description label. - QObject::connect(ui->updateChannelComboBox, SIGNAL(currentIndexChanged(int)), this, - SLOT(updateChannelSelectionChanged(int))); - refreshUpdateChannelDesc(); - - // Now that we've updated the channel list, we can enable the combo box. - // It starts off disabled so that if the channel list hasn't been loaded, it will be - // disabled. - ui->updateChannelComboBox->setEnabled(true); -} - -void MultiMCPage::updateChannelSelectionChanged(int index) -{ - refreshUpdateChannelDesc(); -} - -void MultiMCPage::refreshUpdateChannelDesc() -{ - // Get the channel list. - QList channelList = MMC->updateChecker()->getChannelList(); - int selectedIndex = ui->updateChannelComboBox->currentIndex(); - if (selectedIndex < 0) - { - return; - } - if (selectedIndex < channelList.count()) - { - // Find the channel list entry with the given index. - UpdateChecker::ChannelListEntry selected = channelList.at(selectedIndex); - - // Set the description text. - ui->updateChannelDescLabel->setText(selected.description); - - // Set the currently selected channel ID. - m_currentUpdateChannel = selected.id; - } -} - -void MultiMCPage::applySettings() -{ - auto s = MMC->settings(); - // Language - s->set("Language", - ui->languageBox->itemData(ui->languageBox->currentIndex()).toLocale().bcp47Name()); - - if (ui->resetNotificationsBtn->isChecked()) - { - s->set("ShownNotifications", QString()); - } - - // Updates - s->set("AutoUpdate", ui->autoUpdateCheckBox->isChecked()); - s->set("UpdateChannel", m_currentUpdateChannel); - auto original = s->get("IconTheme").toString(); - //FIXME: make generic - switch (ui->themeComboBox->currentIndex()) - { - case 1: - s->set("IconTheme", "pe_dark"); - break; - case 2: - s->set("IconTheme", "pe_light"); - break; - case 3: - s->set("IconTheme", "pe_blue"); - break; - case 4: - s->set("IconTheme", "pe_colored"); - break; - case 5: - s->set("IconTheme", "OSX"); - break; - case 6: - s->set("IconTheme", "iOS"); - break; - case 0: - default: - s->set("IconTheme", "multimc"); - break; - } - - if(original != s->get("IconTheme")) - { - MMC->setIconTheme(s->get("IconTheme").toString()); - } - - // Console settings - s->set("ShowConsole", ui->showConsoleCheck->isChecked()); - s->set("AutoCloseConsole", ui->autoCloseConsoleCheck->isChecked()); - QString consoleFontFamily = ui->consoleFont->currentFont().family(); - s->set("ConsoleFont", consoleFontFamily); - s->set("ConsoleFontSize", ui->fontSizeBox->value()); - - // FTB - s->set("TrackFTBInstances", ui->trackFtbBox->isChecked()); - s->set("FTBLauncherRoot", ui->ftbLauncherBox->text()); - s->set("FTBRoot", ui->ftbBox->text()); - - // Folders - // TODO: Offer to move instances to new instance folder. - s->set("InstanceDir", ui->instDirTextBox->text()); - s->set("CentralModsDir", ui->modsDirTextBox->text()); - s->set("LWJGLDir", ui->lwjglDirTextBox->text()); - s->set("IconsDir", ui->iconsDirTextBox->text()); - - auto sortMode = (InstSortMode)ui->sortingModeGroup->checkedId(); - switch (sortMode) - { - case Sort_LastLaunch: - s->set("InstSortMode", "LastLaunch"); - break; - case Sort_Name: - default: - s->set("InstSortMode", "Name"); - break; - } -} -void MultiMCPage::loadSettings() -{ - auto s = MMC->settings(); - // Language - ui->languageBox->clear(); - ui->languageBox->addItem(tr("English"), QLocale(QLocale::English)); - foreach(const QString & lang, QDir(MMC->staticData() + "/translations") - .entryList(QStringList() << "*.qm", QDir::Files)) - { - QLocale locale(lang.section(QRegExp("[_\\.]"), 1)); - ui->languageBox->addItem(QLocale::languageToString(locale.language()), locale); - } - ui->languageBox->setCurrentIndex( - ui->languageBox->findData(QLocale(s->get("Language").toString()))); - - // Updates - ui->autoUpdateCheckBox->setChecked(s->get("AutoUpdate").toBool()); - m_currentUpdateChannel = s->get("UpdateChannel").toString(); - //FIXME: make generic - auto theme = s->get("IconTheme").toString(); - if (theme == "pe_dark") - { - ui->themeComboBox->setCurrentIndex(1); - } - else if (theme == "pe_light") - { - ui->themeComboBox->setCurrentIndex(2); - } - else if (theme == "pe_blue") - { - ui->themeComboBox->setCurrentIndex(3); - } - else if (theme == "pe_colored") - { - ui->themeComboBox->setCurrentIndex(4); - } - else if (theme == "OSX") - { - ui->themeComboBox->setCurrentIndex(5); - } - else if (theme == "iOS") - { - ui->themeComboBox->setCurrentIndex(6); - } - else - { - ui->themeComboBox->setCurrentIndex(0); - } - - // Console settings - ui->showConsoleCheck->setChecked(s->get("ShowConsole").toBool()); - ui->autoCloseConsoleCheck->setChecked(s->get("AutoCloseConsole").toBool()); - QString fontFamily = MMC->settings()->get("ConsoleFont").toString(); - QFont consoleFont(fontFamily); - ui->consoleFont->setCurrentFont(consoleFont); - - bool conversionOk = true; - int fontSize = MMC->settings()->get("ConsoleFontSize").toInt(&conversionOk); - if(!conversionOk) - { - fontSize = 11; - } - ui->fontSizeBox->setValue(fontSize); - refreshFontPreview(); - - // FTB - ui->trackFtbBox->setChecked(s->get("TrackFTBInstances").toBool()); - ui->ftbLauncherBox->setText(s->get("FTBLauncherRoot").toString()); - ui->ftbBox->setText(s->get("FTBRoot").toString()); - - // Folders - ui->instDirTextBox->setText(s->get("InstanceDir").toString()); - ui->modsDirTextBox->setText(s->get("CentralModsDir").toString()); - ui->lwjglDirTextBox->setText(s->get("LWJGLDir").toString()); - ui->iconsDirTextBox->setText(s->get("IconsDir").toString()); - - QString sortMode = s->get("InstSortMode").toString(); - - if (sortMode == "LastLaunch") - { - ui->sortLastLaunchedBtn->setChecked(true); - } - else - { - ui->sortByNameBtn->setChecked(true); - } -} - -void MultiMCPage::refreshFontPreview() -{ - int fontSize = ui->fontSizeBox->value(); - QString fontFamily = ui->consoleFont->currentFont().family(); - ui->fontPreview->clear(); - defaultFormat->setFont(QFont(fontFamily, fontSize)); - { - QTextCharFormat format(*defaultFormat); - format.setForeground(QColor("red")); - // append a paragraph/line - auto workCursor = ui->fontPreview->textCursor(); - workCursor.movePosition(QTextCursor::End); - workCursor.insertText(tr("[Something/ERROR] A spooky error!"), format); - workCursor.insertBlock(); - } - { - QTextCharFormat format(*defaultFormat); - // append a paragraph/line - auto workCursor = ui->fontPreview->textCursor(); - workCursor.movePosition(QTextCursor::End); - workCursor.insertText(tr("[Test/INFO] A harmless message..."), format); - workCursor.insertBlock(); - } - { - QTextCharFormat format(*defaultFormat); - format.setForeground(QColor("orange")); - // append a paragraph/line - auto workCursor = ui->fontPreview->textCursor(); - workCursor.movePosition(QTextCursor::End); - workCursor.insertText(tr("[Something/WARN] A not so spooky warning."), format); - workCursor.insertBlock(); - } -} \ No newline at end of file diff --git a/gui/pages/global/MultiMCPage.h b/gui/pages/global/MultiMCPage.h deleted file mode 100644 index 96e56f47..00000000 --- a/gui/pages/global/MultiMCPage.h +++ /dev/null @@ -1,100 +0,0 @@ -/* Copyright 2013-2015 MultiMC Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include -#include - -#include "logic/java/JavaChecker.h" -#include "gui/pages/BasePage.h" -#include - -class QTextCharFormat; -class SettingsObject; - -namespace Ui -{ -class MultiMCPage; -} - -class MultiMCPage : public QWidget, public BasePage -{ - Q_OBJECT - -public: - explicit MultiMCPage(QWidget *parent = 0); - ~MultiMCPage(); - - QString displayName() const override - { - return tr("MultiMC"); - } - QIcon icon() const override - { - return MMC->getThemedIcon("multimc"); - } - QString id() const override - { - return "multimc-settings"; - } - QString helpPage() const override - { - return "MultiMC-settings"; - } - bool apply() override; - -private: - void applySettings(); - void loadSettings(); - -private -slots: - void on_ftbLauncherBrowseBtn_clicked(); - void on_ftbBrowseBtn_clicked(); - - void on_instDirBrowseBtn_clicked(); - void on_modsDirBrowseBtn_clicked(); - void on_lwjglDirBrowseBtn_clicked(); - void on_iconsDirBrowseBtn_clicked(); - - /*! - * Updates the list of update channels in the combo box. - */ - void refreshUpdateChannelList(); - - /*! - * Updates the channel description label. - */ - void refreshUpdateChannelDesc(); - - /*! - * Updates the font preview - */ - void refreshFontPreview(); - - void updateChannelSelectionChanged(int index); - -private: - Ui::MultiMCPage *ui; - - /*! - * Stores the currently selected update channel. - */ - QString m_currentUpdateChannel; - - // default format for the font preview... - QTextCharFormat *defaultFormat; -}; diff --git a/gui/pages/global/MultiMCPage.ui b/gui/pages/global/MultiMCPage.ui deleted file mode 100644 index 38d1bb1d..00000000 --- a/gui/pages/global/MultiMCPage.ui +++ /dev/null @@ -1,532 +0,0 @@ - - - MultiMCPage - - - - 0 - 0 - 487 - 519 - - - - - 0 - 0 - - - - Settings - - - - :/icons/toolbar/settings:/icons/toolbar/settings - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - QTabWidget::Rounded - - - 0 - - - - Features - - - - - - Update Settings - - - - - - Check for updates when MultiMC starts? - - - - - - - Up&date Channel: - - - updateChannelComboBox - - - - - - - false - - - - - - - No channel selected. - - - true - - - - - - - - - - FTB - - - - - - &Launcher: - - - ftbLauncherBox - - - - - - - false - - - - - - - - - - Files: - - - ftbBox - - - - - - - true - - - ... - - - - - - - false - - - Qt::TabFocus - - - ... - - - - - - - Track FTB instances - - - - - - - - - - Folders - - - - - - I&nstances: - - - instDirTextBox - - - - - - - - - - ... - - - - - - - &Mods: - - - modsDirTextBox - - - - - - - - - - - - - ... - - - - - - - LW&JGL: - - - lwjglDirTextBox - - - - - - - ... - - - - - - - - - - &Icons: - - - iconsDirTextBox - - - - - - - ... - - - - - - - - - - Qt::Vertical - - - - 0 - 0 - - - - - - - - - User Interface - - - - - - MultiMC notifications - - - - - - Reset hidden notifications - - - true - - - - - - - - - - true - - - Instance view sorting mode - - - - - - By &last launched - - - sortingModeGroup - - - - - - - By &name - - - sortingModeGroup - - - - - - - - - - Language (needs restart): - - - - - - - - - - - - Icon Theme (needs restart, work in progress) - - - - - - - 0 - 0 - - - - Qt::StrongFocus - - - - Default - - - - - Simple (Dark Icons) - - - - - Simple (Light Icons) - - - - - Simple (Blue Icons) - - - - - Simple (Colored Icons) - - - - - OSX - - - - - iOS - - - - - - - - - - - Qt::Vertical - - - - 0 - 0 - - - - - - - - - Console - - - - - - Console Settings - - - - - - Show console while the game is running? - - - - - - - Automatically close console when the game quits? - - - - - - - - - - - 0 - 0 - - - - Console font - - - - - - - 0 - 0 - - - - Qt::ScrollBarAlwaysOff - - - false - - - Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - - - - - - - 0 - 0 - - - - - - - - 5 - - - 16 - - - 11 - - - - - - - - - - - - - - tabWidget - autoUpdateCheckBox - updateChannelComboBox - trackFtbBox - ftbLauncherBox - ftbLauncherBrowseBtn - ftbBox - ftbBrowseBtn - instDirTextBox - instDirBrowseBtn - modsDirTextBox - modsDirBrowseBtn - lwjglDirTextBox - lwjglDirBrowseBtn - iconsDirTextBox - iconsDirBrowseBtn - resetNotificationsBtn - sortLastLaunchedBtn - sortByNameBtn - languageBox - themeComboBox - showConsoleCheck - autoCloseConsoleCheck - consoleFont - fontSizeBox - fontPreview - - - - - - - diff --git a/gui/pages/global/ProxyPage.cpp b/gui/pages/global/ProxyPage.cpp deleted file mode 100644 index 02a5beb4..00000000 --- a/gui/pages/global/ProxyPage.cpp +++ /dev/null @@ -1,95 +0,0 @@ -/* Copyright 2013-2015 MultiMC Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "ProxyPage.h" -#include "ui_ProxyPage.h" - -#include "logic/settings/SettingsObject.h" -#include "MultiMC.h" - -ProxyPage::ProxyPage(QWidget *parent) : QWidget(parent), ui(new Ui::ProxyPage) -{ - ui->setupUi(this); - ui->tabWidget->tabBar()->hide(); - loadSettings(); - updateCheckboxStuff(); - - connect(ui->proxyGroup, SIGNAL(buttonClicked(int)), SLOT(proxyChanged(int))); -} - -ProxyPage::~ProxyPage() -{ - delete ui; -} - -bool ProxyPage::apply() -{ - applySettings(); - return true; -} - -void ProxyPage::updateCheckboxStuff() -{ - ui->proxyAddrBox->setEnabled(!ui->proxyNoneBtn->isChecked() && - !ui->proxyDefaultBtn->isChecked()); - ui->proxyAuthBox->setEnabled(!ui->proxyNoneBtn->isChecked() && - !ui->proxyDefaultBtn->isChecked()); -} - -void ProxyPage::proxyChanged(int) -{ - updateCheckboxStuff(); -} - -void ProxyPage::applySettings() -{ - auto s = MMC->settings(); - - // Proxy - QString proxyType = "None"; - if (ui->proxyDefaultBtn->isChecked()) - proxyType = "Default"; - else if (ui->proxyNoneBtn->isChecked()) - proxyType = "None"; - else if (ui->proxySOCKS5Btn->isChecked()) - proxyType = "SOCKS5"; - else if (ui->proxyHTTPBtn->isChecked()) - proxyType = "HTTP"; - - s->set("ProxyType", proxyType); - s->set("ProxyAddr", ui->proxyAddrEdit->text()); - s->set("ProxyPort", ui->proxyPortEdit->value()); - s->set("ProxyUser", ui->proxyUserEdit->text()); - s->set("ProxyPass", ui->proxyPassEdit->text()); -} -void ProxyPage::loadSettings() -{ - auto s = MMC->settings(); - // Proxy - QString proxyType = s->get("ProxyType").toString(); - if (proxyType == "Default") - ui->proxyDefaultBtn->setChecked(true); - else if (proxyType == "None") - ui->proxyNoneBtn->setChecked(true); - else if (proxyType == "SOCKS5") - ui->proxySOCKS5Btn->setChecked(true); - else if (proxyType == "HTTP") - ui->proxyHTTPBtn->setChecked(true); - - ui->proxyAddrEdit->setText(s->get("ProxyAddr").toString()); - ui->proxyPortEdit->setValue(s->get("ProxyPort").value()); - ui->proxyUserEdit->setText(s->get("ProxyUser").toString()); - ui->proxyPassEdit->setText(s->get("ProxyPass").toString()); -} diff --git a/gui/pages/global/ProxyPage.h b/gui/pages/global/ProxyPage.h deleted file mode 100644 index edb7587a..00000000 --- a/gui/pages/global/ProxyPage.h +++ /dev/null @@ -1,67 +0,0 @@ -/* Copyright 2013-2015 MultiMC Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include -#include - -#include "logic/java/JavaChecker.h" -#include "gui/pages/BasePage.h" -#include - -namespace Ui -{ -class ProxyPage; -} - -class ProxyPage : public QWidget, public BasePage -{ - Q_OBJECT - -public: - explicit ProxyPage(QWidget *parent = 0); - ~ProxyPage(); - - QString displayName() const override - { - return tr("Proxy"); - } - QIcon icon() const override - { - return MMC->getThemedIcon("proxy"); - } - QString id() const override - { - return "proxy-settings"; - } - QString helpPage() const override - { - return "Proxy-settings"; - } - bool apply() override; - -private: - void updateCheckboxStuff(); - void applySettings(); - void loadSettings(); - -private -slots: - void proxyChanged(int); - -private: - Ui::ProxyPage *ui; -}; diff --git a/gui/pages/global/ProxyPage.ui b/gui/pages/global/ProxyPage.ui deleted file mode 100644 index 7cddd66d..00000000 --- a/gui/pages/global/ProxyPage.ui +++ /dev/null @@ -1,197 +0,0 @@ - - - ProxyPage - - - - 0 - 0 - 607 - 632 - - - - - 0 - 0 - - - - Settings - - - - :/icons/toolbar/settings:/icons/toolbar/settings - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - - - - - - Type - - - - - - Uses your system's default proxy settings. - - - Default - - - proxyGroup - - - - - - - None - - - proxyGroup - - - - - - - SOCKS5 - - - proxyGroup - - - - - - - HTTP - - - proxyGroup - - - - - - - - - - Address and Port - - - - - - 127.0.0.1 - - - - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - QAbstractSpinBox::PlusMinus - - - 65535 - - - 8080 - - - - - - - - - - Authentication - - - - - - - - - Username: - - - - - - - Password: - - - - - - - QLineEdit::Password - - - - - - - Note: Proxy username and password are stored in plain text inside MultiMC's configuration file! - - - true - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - - - - - - diff --git a/gui/widgets/Common.cpp b/gui/widgets/Common.cpp deleted file mode 100644 index 9b730d6c..00000000 --- a/gui/widgets/Common.cpp +++ /dev/null @@ -1,27 +0,0 @@ -#include "Common.h" - -// Origin: Qt -QStringList viewItemTextLayout(QTextLayout &textLayout, int lineWidth, qreal &height, - qreal &widthUsed) -{ - QStringList lines; - height = 0; - widthUsed = 0; - textLayout.beginLayout(); - QString str = textLayout.text(); - while (true) - { - QTextLine line = textLayout.createLine(); - if (!line.isValid()) - break; - if (line.textLength() == 0) - break; - line.setLineWidth(lineWidth); - line.setPosition(QPointF(0, height)); - height += line.height(); - lines.append(str.mid(line.textStart(), line.textLength())); - widthUsed = qMax(widthUsed, line.naturalTextWidth()); - } - textLayout.endLayout(); - return lines; -} diff --git a/gui/widgets/Common.h b/gui/widgets/Common.h deleted file mode 100644 index fc46e08f..00000000 --- a/gui/widgets/Common.h +++ /dev/null @@ -1,6 +0,0 @@ -#pragma once -#include -#include - -QStringList viewItemTextLayout(QTextLayout &textLayout, int lineWidth, qreal &height, - qreal &widthUsed); \ No newline at end of file diff --git a/gui/widgets/IconLabel.cpp b/gui/widgets/IconLabel.cpp deleted file mode 100644 index 86c8a431..00000000 --- a/gui/widgets/IconLabel.cpp +++ /dev/null @@ -1,43 +0,0 @@ -#include "IconLabel.h" - -#include -#include -#include -#include -#include - -IconLabel::IconLabel(QWidget *parent, QIcon icon, QSize size) - : QWidget(parent), m_size(size), m_icon(icon) -{ - setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); -} - -QSize IconLabel::sizeHint() const -{ - return m_size; -} - -void IconLabel::setIcon(QIcon icon) -{ - m_icon = icon; - update(); -} - -void IconLabel::paintEvent(QPaintEvent *) -{ - QPainter p(this); - QRect rect = contentsRect(); - int width = rect.width(); - int height = rect.height(); - if(width < height) - { - rect.setHeight(width); - rect.translate(0, (height - width) / 2); - } - else if (width > height) - { - rect.setWidth(height); - rect.translate((width - height) / 2, 0); - } - m_icon.paint(&p, rect); -} diff --git a/gui/widgets/IconLabel.h b/gui/widgets/IconLabel.h deleted file mode 100644 index a2f1eef3..00000000 --- a/gui/widgets/IconLabel.h +++ /dev/null @@ -1,26 +0,0 @@ -#pragma once -#include -#include - -class QStyleOption; - -/** - * This is a trivial widget that paints a QIcon of the specified size. - */ -class IconLabel : public QWidget -{ - Q_OBJECT - -public: - /// Create a line separator. orientation is the orientation of the line. - explicit IconLabel(QWidget *parent, QIcon icon, QSize size); - - virtual QSize sizeHint() const; - virtual void paintEvent(QPaintEvent *); - - void setIcon(QIcon icon); - -private: - QSize m_size; - QIcon m_icon; -}; diff --git a/gui/widgets/LabeledToolButton.cpp b/gui/widgets/LabeledToolButton.cpp deleted file mode 100644 index dfdde1bc..00000000 --- a/gui/widgets/LabeledToolButton.cpp +++ /dev/null @@ -1,86 +0,0 @@ -/* Copyright 2013-2015 MultiMC Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include -#include -#include -#include "LabeledToolButton.h" -#include - -/* - * - * Tool Button with a label on it, instead of the normal text rendering - * - */ - -LabeledToolButton::LabeledToolButton(QWidget * parent) - : QToolButton(parent) - , m_label(new QLabel(this)) -{ - //QToolButton::setText(" "); - m_label->setWordWrap(true); - m_label->setMouseTracking(false); - m_label->setAlignment(Qt::AlignCenter); - m_label->setTextInteractionFlags(Qt::NoTextInteraction); - // somehow, this makes word wrap work in the QLabel. yay. - m_label->setMinimumWidth(100); -} - -QString LabeledToolButton::text() const -{ - return m_label->text(); -} - -void LabeledToolButton::setText(const QString & text) -{ - m_label->setText(text); -} - -/*! - \reimp -*/ -QSize LabeledToolButton::sizeHint() const -{ - /* - Q_D(const QToolButton); - if (d->sizeHint.isValid()) - return d->sizeHint; - */ - ensurePolished(); - - int w = 0, h = 0; - QStyleOptionToolButton opt; - initStyleOption(&opt); - QSize sz =m_label->sizeHint(); - w = sz.width(); - h = sz.height(); - - opt.rect.setSize(QSize(w, h)); // PM_MenuButtonIndicator depends on the height - if (popupMode() == MenuButtonPopup) - w += style()->pixelMetric(QStyle::PM_MenuButtonIndicator, &opt, this); - - QSize rawSize = style()->sizeFromContents(QStyle::CT_ToolButton, &opt, QSize(w, h), this); - QSize sizeHint = rawSize.expandedTo(QApplication::globalStrut()); - return sizeHint; -} - - - -void LabeledToolButton::resizeEvent(QResizeEvent * event) -{ - m_label->setGeometry(QRect(4, 4, width()-8, height()-8)); - QWidget::resizeEvent(event); -} diff --git a/gui/widgets/LabeledToolButton.h b/gui/widgets/LabeledToolButton.h deleted file mode 100644 index 1b74c4ee..00000000 --- a/gui/widgets/LabeledToolButton.h +++ /dev/null @@ -1,37 +0,0 @@ -/* Copyright 2013-2015 MultiMC Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include -#include - -class QLabel; - -class LabeledToolButton : public QToolButton -{ - Q_OBJECT - - QLabel * m_label; - -public: - LabeledToolButton(QWidget * parent = 0); - - QString text() const; - void setText(const QString & text); - virtual QSize sizeHint() const; -protected: - void resizeEvent(QResizeEvent * event); -}; diff --git a/gui/widgets/LineSeparator.cpp b/gui/widgets/LineSeparator.cpp deleted file mode 100644 index f4ee173d..00000000 --- a/gui/widgets/LineSeparator.cpp +++ /dev/null @@ -1,37 +0,0 @@ -#include "LineSeparator.h" - -#include -#include -#include -#include - -void LineSeparator::initStyleOption(QStyleOption *option) const -{ - option->initFrom(this); - // in a horizontal layout, the line is vertical (and vice versa) - if (m_orientation == Qt::Vertical) - option->state |= QStyle::State_Horizontal; -} - -LineSeparator::LineSeparator(QWidget *parent, Qt::Orientation orientation) - : QWidget(parent), m_orientation(orientation) -{ - setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); -} - -QSize LineSeparator::sizeHint() const -{ - QStyleOption opt; - initStyleOption(&opt); - const int extent = - style()->pixelMetric(QStyle::PM_ToolBarSeparatorExtent, &opt, parentWidget()); - return QSize(extent, extent); -} - -void LineSeparator::paintEvent(QPaintEvent *) -{ - QPainter p(this); - QStyleOption opt; - initStyleOption(&opt); - style()->drawPrimitive(QStyle::PE_IndicatorToolBarSeparator, &opt, &p, parentWidget()); -} diff --git a/gui/widgets/LineSeparator.h b/gui/widgets/LineSeparator.h deleted file mode 100644 index 9546e747..00000000 --- a/gui/widgets/LineSeparator.h +++ /dev/null @@ -1,18 +0,0 @@ -#pragma once -#include - -class QStyleOption; - -class LineSeparator : public QWidget -{ - Q_OBJECT - -public: - /// Create a line separator. orientation is the orientation of the line. - explicit LineSeparator(QWidget *parent, Qt::Orientation orientation = Qt::Horizontal); - QSize sizeHint() const; - void paintEvent(QPaintEvent *); - void initStyleOption(QStyleOption *option) const; -private: - Qt::Orientation m_orientation = Qt::Horizontal; -}; diff --git a/gui/widgets/MCModInfoFrame.cpp b/gui/widgets/MCModInfoFrame.cpp deleted file mode 100644 index b87147aa..00000000 --- a/gui/widgets/MCModInfoFrame.cpp +++ /dev/null @@ -1,111 +0,0 @@ -/* Copyright 2013-2015 MultiMC Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include - -#include "MCModInfoFrame.h" -#include "ui_MCModInfoFrame.h" -#include "gui/dialogs/CustomMessageBox.h" - -void MCModInfoFrame::updateWithMod(Mod &m) -{ - if(m.type() == m.MOD_FOLDER) - { - clear(); - return; - } - - QString text = ""; - QString name = ""; - if(m.name().isEmpty()) name = m.mmc_id(); - else name = m.name(); - - if(m.homeurl().isEmpty()) text = name; - else text = "" + name + ""; - if(!m.authors().isEmpty()) text += " by " + m.authors(); - - setModText(text); - - if(m.description().isEmpty()) - { - setModDescription(tr("No description provided in mcmod.info")); - } - else - { - setModDescription(m.description()); - } -} - -void MCModInfoFrame::clear() -{ - setModText(tr("Select a mod to view title and authors...")); - setModDescription(tr("Select a mod to view description...")); -} - -MCModInfoFrame::MCModInfoFrame(QWidget *parent) : - QFrame(parent), - ui(new Ui::MCModInfoFrame) -{ - ui->setupUi(this); -} - -MCModInfoFrame::~MCModInfoFrame() -{ - delete ui; -} - -void MCModInfoFrame::setModText(QString text) -{ - ui->label_ModText->setText(text); -} - -void MCModInfoFrame::setModDescription(QString text) -{ - ui->label_ModDescription->setToolTip(""); - QString intermediatetext = text.trimmed(); - bool prev(false); - QChar rem('\n'); - QString finaltext; - finaltext.reserve(intermediatetext.size()); - foreach(const QChar& c, intermediatetext) - { - if(c == rem && prev){ - continue; - } - prev = c == rem; - finaltext += c; - } - QString labeltext; - labeltext.reserve(300); - if(finaltext.length() > 290) - { - ui->label_ModDescription->setOpenExternalLinks(false); - ui->label_ModDescription->setTextFormat(Qt::TextFormat::RichText); - desc = text; - labeltext.append("" + finaltext.left(287) + "..."); - QObject::connect(ui->label_ModDescription, &QLabel::linkActivated, this, &MCModInfoFrame::modDescEllipsisHandler); - } - else - { - ui->label_ModDescription->setTextFormat(Qt::TextFormat::PlainText); - labeltext.append(finaltext); - } - ui->label_ModDescription->setText(labeltext); -} -void MCModInfoFrame::modDescEllipsisHandler(const QString &link) -{ - CustomMessageBox::selectable(this, tr(""), desc)->show(); -} diff --git a/gui/widgets/MCModInfoFrame.h b/gui/widgets/MCModInfoFrame.h deleted file mode 100644 index 9e63d29a..00000000 --- a/gui/widgets/MCModInfoFrame.h +++ /dev/null @@ -1,46 +0,0 @@ -/* Copyright 2013-2015 MultiMC Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include -#include "logic/minecraft/Mod.h" - -namespace Ui -{ -class MCModInfoFrame; -} - -class MCModInfoFrame : public QFrame -{ - Q_OBJECT - -public: - explicit MCModInfoFrame(QWidget *parent = 0); - ~MCModInfoFrame(); - - void setModText(QString text); - void setModDescription(QString text); - - void updateWithMod(Mod &m); - void clear(); - -public slots: - void modDescEllipsisHandler(const QString& link ); - -private: - Ui::MCModInfoFrame *ui; - QString desc; -}; diff --git a/gui/widgets/MCModInfoFrame.ui b/gui/widgets/MCModInfoFrame.ui deleted file mode 100644 index 60e0a65c..00000000 --- a/gui/widgets/MCModInfoFrame.ui +++ /dev/null @@ -1,68 +0,0 @@ - - - MCModInfoFrame - - - - 0 - 0 - 527 - 113 - - - - - 0 - 0 - - - - - 16777215 - 120 - - - - Frame - - - - - - Select a mod to view title and authors... - - - Qt::RichText - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - true - - - true - - - - - - - Select a mod to view description... - - - Qt::PlainText - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - true - - - - - - - - diff --git a/gui/widgets/ModListView.cpp b/gui/widgets/ModListView.cpp deleted file mode 100644 index aa16ad05..00000000 --- a/gui/widgets/ModListView.cpp +++ /dev/null @@ -1,62 +0,0 @@ -/* Copyright 2013-2015 MultiMC Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "ModListView.h" -#include -#include -#include -#include -#include - -ModListView::ModListView ( QWidget* parent ) - :QTreeView ( parent ) -{ - setAllColumnsShowFocus ( true ); - setExpandsOnDoubleClick ( false ); - setRootIsDecorated ( false ); - setSortingEnabled ( false ); - setAlternatingRowColors ( true ); - setSelectionMode ( QAbstractItemView::ContiguousSelection ); - setHeaderHidden ( false ); - setSelectionBehavior(QAbstractItemView::SelectRows); - setVerticalScrollBarPolicy ( Qt::ScrollBarAlwaysOn ); - setHorizontalScrollBarPolicy ( Qt::ScrollBarAsNeeded ); - setDropIndicatorShown(true); - setDragEnabled(true); - setDragDropMode(QAbstractItemView::DropOnly); - viewport()->setAcceptDrops(true); -} - -void ModListView::setModel ( QAbstractItemModel* model ) -{ - QTreeView::setModel ( model ); - auto head = header(); - head->setStretchLastSection(false); - // HACK: this is true for the checkbox column of mod lists - auto string = model->headerData(0,head->orientation()).toString(); - if(!string.size()) - { - head->setSectionResizeMode(0, QHeaderView::ResizeToContents); - head->setSectionResizeMode(1, QHeaderView::Stretch); - for(int i = 2; i < head->count(); i++) - head->setSectionResizeMode(i, QHeaderView::ResizeToContents); - } - else - { - head->setSectionResizeMode(0, QHeaderView::Stretch); - for(int i = 1; i < head->count(); i++) - head->setSectionResizeMode(i, QHeaderView::ResizeToContents); - } -} diff --git a/gui/widgets/ModListView.h b/gui/widgets/ModListView.h deleted file mode 100644 index 43de9811..00000000 --- a/gui/widgets/ModListView.h +++ /dev/null @@ -1,27 +0,0 @@ -/* Copyright 2013-2015 MultiMC Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once -#include - -class Mod; - -class ModListView: public QTreeView -{ - Q_OBJECT -public: - explicit ModListView ( QWidget* parent = 0 ); - virtual void setModel ( QAbstractItemModel* model ); -}; diff --git a/gui/widgets/PageContainer.cpp b/gui/widgets/PageContainer.cpp deleted file mode 100644 index 59b800cc..00000000 --- a/gui/widgets/PageContainer.cpp +++ /dev/null @@ -1,210 +0,0 @@ -/* Copyright 2013-2015 MultiMC Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "PageContainer.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "MultiMC.h" -#include "logic/settings/SettingsObject.h" -#include "gui/widgets/IconLabel.h" -#include "gui/Platform.h" -#include "PageContainer_p.h" -#include - -class PageEntryFilterModel : public QSortFilterProxyModel -{ -public: - explicit PageEntryFilterModel(QObject *parent = 0) : QSortFilterProxyModel(parent) - { - } - -protected: - bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const - { - const QString pattern = filterRegExp().pattern(); - const auto model = static_cast(sourceModel()); - const auto page = model->pages().at(sourceRow); - if (!page->shouldDisplay()) - return false; - // Regular contents check, then check page-filter. - return QSortFilterProxyModel::filterAcceptsRow(sourceRow, sourceParent); - } -}; - -PageContainer::PageContainer(BasePageProviderPtr pageProvider, QString defaultId, - QWidget *parent) - : QWidget(parent) -{ - createUI(); - m_model = new PageModel(this); - m_proxyModel = new PageEntryFilterModel(this); - int firstIndex = -1; - int counter = 0; - auto pages = pageProvider->getPages(); - for (auto page : pages) - { - page->stackIndex = m_pageStack->addWidget(dynamic_cast(page)); - page->listIndex = counter; - counter++; - if (firstIndex == -1) - { - firstIndex = page->stackIndex; - } - } - m_model->setPages(pages); - - m_proxyModel->setSourceModel(m_model); - m_proxyModel->setFilterCaseSensitivity(Qt::CaseInsensitive); - - m_pageList->setIconSize(QSize(pageIconSize, pageIconSize)); - m_pageList->setSelectionMode(QAbstractItemView::SingleSelection); - m_pageList->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel); - m_pageList->setModel(m_proxyModel); - connect(m_pageList->selectionModel(), SIGNAL(currentRowChanged(QModelIndex, QModelIndex)), - this, SLOT(currentChanged(QModelIndex))); - m_pageStack->setStackingMode(QStackedLayout::StackOne); - m_pageList->setFocus(); - // now find what we want to have selected... - auto page = m_model->findPageEntryById(defaultId); - QModelIndex index; - if (page) - { - index = m_proxyModel->mapFromSource(m_model->index(page->listIndex)); - } - else - { - index = m_proxyModel->index(0, 0); - } - if (index.isValid()) - m_pageList->setCurrentIndex(index); -} - -void PageContainer::createUI() -{ - m_pageStack = new QStackedLayout; - m_filter = new QLineEdit; - m_pageList = new PageView; - m_header = new QLabel(); - m_iconHeader = new IconLabel(this, QIcon(), QSize(24, 24)); - - QFont headerLabelFont = m_header->font(); - headerLabelFont.setBold(true); - const int pointSize = headerLabelFont.pointSize(); - if (pointSize > 0) - headerLabelFont.setPointSize(pointSize + 2); - m_header->setFont(headerLabelFont); - - QHBoxLayout *headerHLayout = new QHBoxLayout; - const int leftMargin = MMC->style()->pixelMetric(QStyle::PM_LayoutLeftMargin); - headerHLayout->addSpacerItem( - new QSpacerItem(leftMargin, 0, QSizePolicy::Fixed, QSizePolicy::Ignored)); - headerHLayout->addWidget(m_header); - headerHLayout->addSpacerItem( - new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Ignored)); - headerHLayout->addWidget(m_iconHeader); - const int rightMargin = MMC->style()->pixelMetric(QStyle::PM_LayoutRightMargin); - headerHLayout->addSpacerItem( - new QSpacerItem(rightMargin, 0, QSizePolicy::Fixed, QSizePolicy::Ignored)); - - m_pageStack->setMargin(0); - m_pageStack->addWidget(new QWidget(this)); - - m_layout = new QGridLayout; - m_layout->addLayout(headerHLayout, 0, 1, 1, 1); - m_layout->addWidget(m_pageList, 0, 0, 2, 1); - m_layout->addLayout(m_pageStack, 1, 1, 1, 1); - m_layout->setColumnStretch(1, 4); - setLayout(m_layout); -} - -void PageContainer::addButtons(QWidget *buttons) -{ - m_layout->addWidget(buttons, 2, 0, 1, 2); -} - -void PageContainer::addButtons(QLayout *buttons) -{ - m_layout->addLayout(buttons, 2, 0, 1, 2); -} - -void PageContainer::showPage(int row) -{ - if (m_currentPage) - { - m_currentPage->closed(); - } - if (row != -1) - { - m_currentPage = m_model->pages().at(row); - } - else - { - m_currentPage = nullptr; - } - if (m_currentPage) - { - m_pageStack->setCurrentIndex(m_currentPage->stackIndex); - m_header->setText(m_currentPage->displayName()); - m_iconHeader->setIcon(m_currentPage->icon()); - m_currentPage->opened(); - } - else - { - m_pageStack->setCurrentIndex(0); - m_header->setText(QString()); - m_iconHeader->setIcon(MMC->getThemedIcon("bug")); - } -} - -void PageContainer::help() -{ - if (m_currentPage) - { - QString pageId = m_currentPage->helpPage(); - if (pageId.isEmpty()) - return; - QDesktopServices::openUrl(QUrl("https://github.com/MultiMC/MultiMC5/wiki/" + pageId)); - } -} - -void PageContainer::currentChanged(const QModelIndex ¤t) -{ - showPage(current.isValid() ? m_proxyModel->mapToSource(current).row() : -1); -} - -bool PageContainer::requestClose(QCloseEvent *event) -{ - for (auto page : m_model->pages()) - { - if (!page->apply()) - return false; - } - if (m_currentPage) - { - m_currentPage->closed(); - } - return true; -} diff --git a/gui/widgets/PageContainer.h b/gui/widgets/PageContainer.h deleted file mode 100644 index 9795625b..00000000 --- a/gui/widgets/PageContainer.h +++ /dev/null @@ -1,63 +0,0 @@ -/* Copyright 2013-2015 MultiMC Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include -#include - -#include "gui/pages/BasePageProvider.h" - -class QLayout; -class IconLabel; -class QSortFilterProxyModel; -class PageModel; -class QLabel; -class QListView; -class QLineEdit; -class QStackedLayout; -class QGridLayout; - -class PageContainer : public QWidget -{ - Q_OBJECT -public: - explicit PageContainer(BasePageProviderPtr pageProvider, QString defaultId = QString(), - QWidget *parent = 0); - virtual ~PageContainer() {} - - void addButtons(QWidget * buttons); - void addButtons(QLayout * buttons); - bool requestClose(QCloseEvent *event); - -private: - void createUI(); -private -slots: - void currentChanged(const QModelIndex ¤t); - void showPage(int row); - void help(); - -private: - BasePage * m_currentPage = 0; - QSortFilterProxyModel *m_proxyModel; - PageModel *m_model; - QStackedLayout *m_pageStack; - QLineEdit *m_filter; - QListView *m_pageList; - QLabel *m_header; - IconLabel *m_iconHeader; - QGridLayout *m_layout; -}; diff --git a/gui/widgets/PageContainer_p.h b/gui/widgets/PageContainer_p.h deleted file mode 100644 index 4c720e4c..00000000 --- a/gui/widgets/PageContainer_p.h +++ /dev/null @@ -1,123 +0,0 @@ -/* Copyright 2013-2015 MultiMC Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include -#include -#include -#include - -class BasePage; -const int pageIconSize = 24; - -class PageViewDelegate : public QStyledItemDelegate -{ -public: - PageViewDelegate(QObject *parent) : QStyledItemDelegate(parent) - { - } - QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const - { - QSize size = QStyledItemDelegate::sizeHint(option, index); - size.setHeight(qMax(size.height(), 32)); - return size; - } -}; - -class PageModel : public QAbstractListModel -{ -public: - PageModel(QObject *parent = 0) : QAbstractListModel(parent) - { - QPixmap empty(pageIconSize, pageIconSize); - empty.fill(Qt::transparent); - m_emptyIcon = QIcon(empty); - } - virtual ~PageModel() {} - - int rowCount(const QModelIndex &parent = QModelIndex()) const - { - return parent.isValid() ? 0 : m_pages.size(); - } - QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const - { - switch (role) - { - case Qt::DisplayRole: - return m_pages.at(index.row())->displayName(); - case Qt::DecorationRole: - { - QIcon icon = m_pages.at(index.row())->icon(); - if (icon.isNull()) - icon = m_emptyIcon; - // HACK: fixes icon stretching on windows. TODO: report Qt bug for this - return QIcon(icon.pixmap(QSize(48,48))); - } - } - return QVariant(); - } - - void setPages(const QList &pages) - { - beginResetModel(); - m_pages = pages; - endResetModel(); - } - const QList &pages() const - { - return m_pages; - } - - BasePage * findPageEntryById(QString id) - { - for(auto page: m_pages) - { - if (page->id() == id) - return page; - } - return nullptr; - } - - QList m_pages; - QIcon m_emptyIcon; -}; - -class PageView : public QListView -{ -public: - PageView(QWidget *parent = 0) : QListView(parent) - { - setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Expanding); - setItemDelegate(new PageViewDelegate(this)); - setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); - } - - virtual QSize sizeHint() const - { - int width = sizeHintForColumn(0) + frameWidth() * 2 + 5; - if (verticalScrollBar()->isVisible()) - width += verticalScrollBar()->width(); - return QSize(width, 100); - } - - virtual bool eventFilter(QObject *obj, QEvent *event) - { - if (obj == verticalScrollBar() && - (event->type() == QEvent::Show || event->type() == QEvent::Hide)) - updateGeometry(); - return QListView::eventFilter(obj, event); - } -}; diff --git a/gui/widgets/ServerStatus.cpp b/gui/widgets/ServerStatus.cpp deleted file mode 100644 index a73f499e..00000000 --- a/gui/widgets/ServerStatus.cpp +++ /dev/null @@ -1,129 +0,0 @@ -#include "ServerStatus.h" -#include "LineSeparator.h" -#include "IconLabel.h" -#include "logic/status/StatusChecker.h" - -#include "MultiMC.h" - -#include -#include -#include -#include -#include -#include - -ServerStatus::ServerStatus(QWidget *parent, Qt::WindowFlags f) : QWidget(parent, f) -{ - layout = new QHBoxLayout(this); - layout->setContentsMargins(0, 0, 0, 0); - goodIcon = MMC->getThemedIcon("status-good"); - yellowIcon = MMC->getThemedIcon("status-yellow"); - badIcon = MMC->getThemedIcon("status-bad"); - - addStatus("minecraft.net", tr("Web")); - addLine(); - addStatus("account.mojang.com", tr("Account")); - addLine(); - addStatus("skins.minecraft.net", tr("Skins")); - addLine(); - addStatus("authserver.mojang.com", tr("Auth")); - addLine(); - addStatus("sessionserver.mojang.com", tr("Session")); - - m_statusRefresh = new QToolButton(this); - m_statusRefresh->setCheckable(true); - m_statusRefresh->setToolButtonStyle(Qt::ToolButtonIconOnly); - m_statusRefresh->setIcon(MMC->getThemedIcon("refresh")); - layout->addWidget(m_statusRefresh); - - setLayout(layout); - - // Start status checker - m_statusChecker.reset(new StatusChecker()); - { - auto reloader = m_statusChecker.get(); - connect(reloader, &StatusChecker::statusChanged, this, &ServerStatus::StatusChanged); - connect(reloader, &StatusChecker::statusLoading, this, &ServerStatus::StatusReloading); - connect(m_statusRefresh, &QAbstractButton::clicked, this, &ServerStatus::reloadStatus); - m_statusChecker->startTimer(60000); - reloadStatus(); - } -} - -ServerStatus::~ServerStatus() -{ -} - -void ServerStatus::reloadStatus() -{ - m_statusChecker->reloadStatus(); -} - -void ServerStatus::addLine() -{ - layout->addWidget(new LineSeparator(this, Qt::Vertical)); -} - -void ServerStatus::addStatus(QString key, QString name) -{ - { - auto label = new IconLabel(this, badIcon, QSize(16, 16)); - label->setToolTip(key); - serverLabels[key] = label; - layout->addWidget(label); - } - { - auto label = new QLabel(this); - label->setText(name); - label->setToolTip(key); - layout->addWidget(label); - } -} - -void ServerStatus::setStatus(QString key, int value) -{ - if (!serverLabels.contains(key)) - return; - IconLabel *label = serverLabels[key]; - switch(value) - { - case 0: - label->setIcon(goodIcon); - break; - case 1: - label->setIcon(yellowIcon); - break; - default: - case 2: - label->setIcon(badIcon); - break; - } -} - -void ServerStatus::StatusChanged(const QMap statusEntries) -{ - auto convertStatus = [&](QString status)->int - { - if (status == "green") - return 0; - else if (status == "yellow") - return 1; - else if (status == "red") - return 2; - return 2; - } - ; - auto iter = statusEntries.begin(); - while (iter != statusEntries.end()) - { - QString key = iter.key(); - auto value = convertStatus(iter.value()); - setStatus(key, value); - iter++; - } -} - -void ServerStatus::StatusReloading(bool is_reloading) -{ - m_statusRefresh->setChecked(is_reloading); -} diff --git a/gui/widgets/ServerStatus.h b/gui/widgets/ServerStatus.h deleted file mode 100644 index fdd43677..00000000 --- a/gui/widgets/ServerStatus.h +++ /dev/null @@ -1,37 +0,0 @@ -#pragma once -#include -#include -#include -#include -#include - -class IconLabel; -class QToolButton; -class QHBoxLayout; -class StatusChecker; - -class ServerStatus: public QWidget -{ - Q_OBJECT -public: - explicit ServerStatus(QWidget *parent = nullptr, Qt::WindowFlags f = 0); - virtual ~ServerStatus(); - ; -public slots: - void reloadStatus(); - void StatusChanged(const QMap statuses); - void StatusReloading(bool is_reloading); - -private: /* methods */ - void addLine(); - void addStatus(QString key, QString name); - void setStatus(QString key, int value); -private: /* data */ - QHBoxLayout * layout = nullptr; - QToolButton *m_statusRefresh = nullptr; - QMap serverLabels; - QIcon goodIcon; - QIcon yellowIcon; - QIcon badIcon; - std::shared_ptr m_statusChecker; -}; diff --git a/gui/widgets/VersionListView.cpp b/gui/widgets/VersionListView.cpp deleted file mode 100644 index fc0bcd0a..00000000 --- a/gui/widgets/VersionListView.cpp +++ /dev/null @@ -1,147 +0,0 @@ -/* Copyright 2013-2015 MultiMC Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include -#include -#include -#include -#include "VersionListView.h" -#include "Common.h" - -VersionListView::VersionListView(QWidget *parent) - :QTreeView ( parent ) -{ - m_emptyString = tr("No versions are currently available."); -} - -void VersionListView::rowsInserted(const QModelIndex &parent, int start, int end) -{ - if(!m_itemCount) - viewport()->update(); - m_itemCount += end-start+1; - QTreeView::rowsInserted(parent, start, end); -} - - -void VersionListView::rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end) -{ - m_itemCount -= end-start+1; - if(!m_itemCount) - viewport()->update(); - QTreeView::rowsInserted(parent, start, end); -} - -void VersionListView::setModel(QAbstractItemModel *model) -{ - m_itemCount = model->rowCount(); - if(!m_itemCount) - viewport()->update(); - QTreeView::setModel(model); -} - -void VersionListView::reset() -{ - if(model()) - { - m_itemCount = model()->rowCount(); - } - viewport()->update(); - QTreeView::reset(); -} - -void VersionListView::setEmptyString(QString emptyString) -{ - m_emptyString = emptyString; - if(!m_itemCount) - { - viewport()->update(); - } -} - -void VersionListView::paintEvent(QPaintEvent *event) -{ - if(m_itemCount) - { - QTreeView::paintEvent(event); - } - else - { - paintInfoLabel(event); - } -} - -void VersionListView::paintInfoLabel(QPaintEvent *event) -{ - //calculate the rect for the overlay - QPainter painter(viewport()); - painter.setRenderHint(QPainter::Antialiasing, true); - QFont font("sans", 20); - font.setBold(true); - - QRect bounds = viewport()->geometry(); - bounds.moveTop(0); - QTextLayout layout(m_emptyString, font); - qreal height = 0.0; - qreal widthUsed = 0.0; - QStringList lines = viewItemTextLayout(layout, bounds.width() - 20, height, widthUsed); - QRect rect (0,0, widthUsed, height); - rect.setWidth(rect.width()+20); - rect.setHeight(rect.height()+20); - rect.moveCenter(bounds.center()); - //check if we are allowed to draw in our area - if (!event->rect().intersects(rect)) { - return; - } - //draw the letter of the topmost item semitransparent in the middle - QColor background = QApplication::palette().color(QPalette::Foreground); - QColor foreground = QApplication::palette().color(QPalette::Base); - /* - background.setAlpha(128 - scrollFade); - foreground.setAlpha(128 - scrollFade); - */ - painter.setBrush(QBrush(background)); - painter.setPen(foreground); - painter.drawRoundedRect(rect, 5.0, 5.0); - foreground.setAlpha(190); - painter.setPen(foreground); - painter.setFont(font); - painter.drawText(rect, Qt::AlignCenter, lines.join("\n")); - -} - -/* -void ModListView::setModel ( QAbstractItemModel* model ) -{ - QTreeView::setModel ( model ); - auto head = header(); - head->setStretchLastSection(false); - // HACK: this is true for the checkbox column of mod lists - auto string = model->headerData(0,head->orientation()).toString(); - if(!string.size()) - { - head->setSectionResizeMode(0, QHeaderView::ResizeToContents); - head->setSectionResizeMode(1, QHeaderView::Stretch); - for(int i = 2; i < head->count(); i++) - head->setSectionResizeMode(i, QHeaderView::ResizeToContents); - } - else - { - head->setSectionResizeMode(0, QHeaderView::Stretch); - for(int i = 1; i < head->count(); i++) - head->setSectionResizeMode(i, QHeaderView::ResizeToContents); - } -} -*/ diff --git a/gui/widgets/VersionListView.h b/gui/widgets/VersionListView.h deleted file mode 100644 index f33a6fdb..00000000 --- a/gui/widgets/VersionListView.h +++ /dev/null @@ -1,43 +0,0 @@ -/* Copyright 2013-2015 MultiMC Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once -#include - -class Mod; - -class VersionListView : public QTreeView -{ - Q_OBJECT -public: - explicit VersionListView(QWidget *parent = 0); - virtual void paintEvent(QPaintEvent *event) override; - void setEmptyString(QString emptyString); - virtual void setModel ( QAbstractItemModel* model ); - -public slots: - virtual void reset() override; - -protected slots: - virtual void rowsAboutToBeRemoved(const QModelIndex & parent, int start, int end) override; - virtual void rowsInserted(const QModelIndex &parent, int start, int end) override; - -private: /* methods */ - void paintInfoLabel(QPaintEvent *event); - -private: /* variables */ - int m_itemCount = 0; - QString m_emptyString; -}; diff --git a/install_prereqs.cmake.in b/install_prereqs.cmake.in deleted file mode 100644 index b8fa3177..00000000 --- a/install_prereqs.cmake.in +++ /dev/null @@ -1,24 +0,0 @@ -set(CMAKE_MODULE_PATH "@CMAKE_MODULE_PATH@") - -file(GLOB_RECURSE QTPLUGINS "${CMAKE_INSTALL_PREFIX}/@PLUGIN_DEST_DIR@/*@CMAKE_SHARED_LIBRARY_SUFFIX@") -function(gp_resolved_file_type_override resolved_file type_var) - if(resolved_file MATCHES "^/usr/lib/libQt") - message("resolving ${resolved_file} as other") - set(${type_var} other PARENT_SCOPE) - elseif(resolved_file MATCHES "^/usr/lib(.+)?/libxcb") - message("resolving ${resolved_file} as other") - set(${type_var} other PARENT_SCOPE) - elseif(resolved_file MATCHES "^/usr/lib(.+)?/libicu") - message("resolving ${resolved_file} as other") - set(${type_var} other PARENT_SCOPE) - endif() -endfunction() - -set(gp_tool "@CMAKE_GP_TOOL@") -set(gp_cmd_paths ${gp_cmd_paths} - "@CMAKE_GP_CMD_PATHS@" -) - -include(BundleUtilities) -fixup_bundle("@APPS@" "${QTPLUGINS}" "@DIRS@") - diff --git a/logic/BaseInstaller.cpp b/logic/BaseInstaller.cpp index b2cdefbc..d8e83bb2 100644 --- a/logic/BaseInstaller.cpp +++ b/logic/BaseInstaller.cpp @@ -15,8 +15,8 @@ #include -#include "logic/BaseInstaller.h" -#include "logic/minecraft/OneSixInstance.h" +#include "BaseInstaller.h" +#include "minecraft/OneSixInstance.h" BaseInstaller::BaseInstaller() { diff --git a/logic/BaseInstance.cpp b/logic/BaseInstance.cpp index 902c9e7e..69bc7597 100644 --- a/logic/BaseInstance.cpp +++ b/logic/BaseInstance.cpp @@ -18,14 +18,14 @@ #include #include -#include "logic/settings/INISettingsObject.h" -#include "logic/settings/Setting.h" -#include "logic/settings/OverrideSetting.h" +#include "settings/INISettingsObject.h" +#include "settings/Setting.h" +#include "settings/OverrideSetting.h" #include "pathutils.h" #include -#include "logic/minecraft/MinecraftVersionList.h" -#include "logic/icons/IconList.h" +#include "minecraft/MinecraftVersionList.h" +#include "icons/IconList.h" BaseInstance::BaseInstance(SettingsObjectPtr globalSettings, SettingsObjectPtr settings, const QString &rootDir) : QObject() diff --git a/logic/BaseInstance.h b/logic/BaseInstance.h index 3a4fa4a6..6a8ba11c 100644 --- a/logic/BaseInstance.h +++ b/logic/BaseInstance.h @@ -19,11 +19,11 @@ #include #include -#include "logic/settings/SettingsObject.h" +#include "settings/SettingsObject.h" -#include "logic/settings/INIFile.h" -#include "logic/BaseVersionList.h" -#include "logic/auth/MojangAccount.h" +#include "settings/INIFile.h" +#include "BaseVersionList.h" +#include "auth/MojangAccount.h" class QDir; class Task; @@ -186,7 +186,7 @@ protected slots: protected: QString m_rootDir; QString m_group; - std::shared_ptr m_settings; + SettingsObjectPtr m_settings; InstanceFlags m_flags; bool m_isRunning = false; }; diff --git a/logic/BaseProcess.cpp b/logic/BaseProcess.cpp index b0509d46..749efe0a 100644 --- a/logic/BaseProcess.cpp +++ b/logic/BaseProcess.cpp @@ -14,7 +14,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "logic/BaseProcess.h" + +#include "BaseProcess.h" #include #include #include diff --git a/logic/BaseVersionList.cpp b/logic/BaseVersionList.cpp index fe8af278..7752b14c 100644 --- a/logic/BaseVersionList.cpp +++ b/logic/BaseVersionList.cpp @@ -13,8 +13,8 @@ * limitations under the License. */ -#include "logic/BaseVersionList.h" -#include "logic/BaseVersion.h" +#include "BaseVersionList.h" +#include "BaseVersion.h" BaseVersionList::BaseVersionList(QObject *parent) : QAbstractListModel(parent) { diff --git a/logic/BaseVersionList.h b/logic/BaseVersionList.h index f8737b32..584d6ca7 100644 --- a/logic/BaseVersionList.h +++ b/logic/BaseVersionList.h @@ -19,7 +19,7 @@ #include #include -#include "logic/BaseVersion.h" +#include "BaseVersion.h" class Task; diff --git a/logic/CMakeLists.txt b/logic/CMakeLists.txt new file mode 100644 index 00000000..cf55695d --- /dev/null +++ b/logic/CMakeLists.txt @@ -0,0 +1,258 @@ +project(MultiMC-Logic) + +SET(LOGIC_SOURCES + # LOGIC - Base classes and infrastructure + BaseInstaller.h + BaseInstaller.cpp + BaseVersionList.h + BaseVersionList.cpp + InstanceList.h + InstanceList.cpp + BaseVersion.h + BaseProcess.h + BaseProcess.cpp + BaseInstance.h + BaseInstance.cpp + MMCError.h + + # WARNING: globals live here + Env.h + Env.cpp + + # JSON parsing helpers + MMCJson.h + MMCJson.cpp + + # RW lock protected map + RWStorage.h + + # A variable that has an implicit default value and keeps track of changes + DefaultVariable.h + + # a smart pointer wrapper intended for safer use with Qt signal/slot mechanisms + QObjectPtr.h + + # network stuffs + net/NetAction.h + net/MD5EtagDownload.h + net/MD5EtagDownload.cpp + net/ByteArrayDownload.h + net/ByteArrayDownload.cpp + net/CacheDownload.h + net/CacheDownload.cpp + net/NetJob.h + net/NetJob.cpp + net/HttpMetaCache.h + net/HttpMetaCache.cpp + net/PasteUpload.h + net/PasteUpload.cpp + net/URLConstants.h + net/URLConstants.cpp + + # Yggdrasil login stuff + auth/AuthSession.h + auth/AuthSession.cpp + auth/MojangAccountList.h + auth/MojangAccountList.cpp + auth/MojangAccount.h + auth/MojangAccount.cpp + auth/YggdrasilTask.h + auth/YggdrasilTask.cpp + auth/flows/AuthenticateTask.h + auth/flows/AuthenticateTask.cpp + auth/flows/RefreshTask.cpp + auth/flows/RefreshTask.cpp + auth/flows/ValidateTask.h + auth/flows/ValidateTask.cpp + + # Update system + updater/GoUpdate.h + updater/GoUpdate.cpp + updater/UpdateChecker.h + updater/UpdateChecker.cpp + updater/DownloadTask.h + updater/DownloadTask.cpp + + # Notifications - short warning messages + notifications/NotificationChecker.h + notifications/NotificationChecker.cpp + + # News System + news/NewsChecker.h + news/NewsChecker.cpp + news/NewsEntry.h + news/NewsEntry.cpp + + # Status system + status/StatusChecker.h + status/StatusChecker.cpp + + # Minecraft support + minecraft/OneSixUpdate.h + minecraft/OneSixUpdate.cpp + minecraft/OneSixInstance.h + minecraft/OneSixInstance.cpp + minecraft/LegacyUpdate.h + minecraft/LegacyUpdate.cpp + minecraft/LegacyInstance.h + minecraft/LegacyInstance.cpp + minecraft/LwjglVersionList.h + minecraft/LwjglVersionList.cpp + minecraft/SkinUtils.h + minecraft/SkinUtils.cpp + minecraft/JarUtils.h + minecraft/JarUtils.cpp + minecraft/GradleSpecifier.h + minecraft/MinecraftProfile.cpp + minecraft/MinecraftProfile.h + minecraft/JarMod.cpp + minecraft/JarMod.h + minecraft/MinecraftInstance.cpp + minecraft/MinecraftInstance.h + minecraft/MinecraftProcess.cpp + minecraft/MinecraftProcess.h + minecraft/MinecraftVersion.cpp + minecraft/MinecraftVersion.h + minecraft/MinecraftVersionList.cpp + minecraft/MinecraftVersionList.h + minecraft/NullProfileStrategy.h + minecraft/OneSixLibrary.cpp + minecraft/OneSixLibrary.h + minecraft/OneSixProfileStrategy.cpp + minecraft/OneSixProfileStrategy.h + minecraft/OneSixRule.cpp + minecraft/OneSixRule.h + minecraft/OpSys.cpp + minecraft/OpSys.h + minecraft/ParseUtils.cpp + minecraft/ParseUtils.h + minecraft/ProfileUtils.cpp + minecraft/ProfileUtils.h + minecraft/ProfileStrategy.h + minecraft/RawLibrary.cpp + minecraft/RawLibrary.h + minecraft/VersionBuilder.cpp + minecraft/VersionBuilder.h + minecraft/VersionBuildError.h + minecraft/VersionFile.cpp + minecraft/VersionFile.h + minecraft/ProfilePatch.h + minecraft/VersionSource.h + minecraft/VersionFilterData.h + minecraft/VersionFilterData.cpp + minecraft/Mod.h + minecraft/Mod.cpp + minecraft/ModList.h + minecraft/ModList.cpp + + # FTB + ftb/OneSixFTBInstance.h + ftb/OneSixFTBInstance.cpp + ftb/LegacyFTBInstance.h + ftb/LegacyFTBInstance.cpp + ftb/FTBProfileStrategy.h + ftb/FTBProfileStrategy.cpp + ftb/FTBPlugin.h + ftb/FTBPlugin.cpp + + # A Recursive file system watcher + RecursiveFileSystemWatcher.h + RecursiveFileSystemWatcher.cpp + + # the screenshots feature + screenshots/Screenshot.h + screenshots/ImgurUpload.h + screenshots/ImgurUpload.cpp + screenshots/ImgurAlbumCreation.h + screenshots/ImgurAlbumCreation.cpp + + # Icons + icons/MMCIcon.h + icons/MMCIcon.cpp + icons/IconList.h + icons/IconList.cpp + + # Tasks + tasks/ProgressProvider.h + tasks/Task.h + tasks/Task.cpp + tasks/ThreadTask.h + tasks/ThreadTask.cpp + tasks/SequentialTask.h + tasks/SequentialTask.cpp + + # Settings + settings/INIFile.cpp + settings/INIFile.h + settings/INISettingsObject.cpp + settings/INISettingsObject.h + settings/OverrideSetting.cpp + settings/OverrideSetting.h + settings/Setting.cpp + settings/Setting.h + settings/SettingsObject.cpp + settings/SettingsObject.h + + # Java related code + java/JavaChecker.h + java/JavaChecker.cpp + java/JavaUtils.h + java/JavaUtils.cpp + java/JavaVersionList.h + java/JavaVersionList.cpp + java/JavaCheckerJob.h + java/JavaCheckerJob.cpp + + # Assets + minecraft/AssetsUtils.h + minecraft/AssetsUtils.cpp + + # Forge and all things forge related + forge/ForgeVersion.h + forge/ForgeVersion.cpp + forge/ForgeVersionList.h + forge/ForgeVersionList.cpp + forge/ForgeMirror.h + forge/ForgeMirrors.h + forge/ForgeMirrors.cpp + forge/ForgeXzDownload.h + forge/ForgeXzDownload.cpp + forge/LegacyForge.h + forge/LegacyForge.cpp + forge/ForgeInstaller.h + forge/ForgeInstaller.cpp + + # Liteloader and related things + liteloader/LiteLoaderInstaller.h + liteloader/LiteLoaderInstaller.cpp + liteloader/LiteLoaderVersionList.h + liteloader/LiteLoaderVersionList.cpp + + # Translations + trans/TranslationDownloader.h + trans/TranslationDownloader.cpp + + # Tools + tools/BaseExternalTool.cpp + tools/BaseExternalTool.h + tools/BaseProfiler.cpp + tools/BaseProfiler.h + tools/JProfiler.cpp + tools/JProfiler.h + tools/JVisualVM.cpp + tools/JVisualVM.h + tools/MCEditTool.cpp + tools/MCEditTool.h + +) +################################ COMPILE ################################ + +# Add common library +add_library(MultiMC_logic STATIC ${LOGIC_SOURCES}) + +# Link +target_link_libraries(MultiMC_logic xz-embedded unpack200 iconfix libUtil LogicalGui ${QUAZIP_LIBRARIES} + Qt5::Core Qt5::Xml Qt5::Widgets Qt5::Network Qt5::Concurrent Qt5::WebKitWidgets + ${MultiMC_LINK_ADDITIONAL_LIBS}) + +add_dependencies(MultiMC_logic QuaZIP) diff --git a/logic/Env.cpp b/logic/Env.cpp index 69986be2..0607c7ea 100644 --- a/logic/Env.cpp +++ b/logic/Env.cpp @@ -1,5 +1,5 @@ #include "Env.h" -#include "logic/net/HttpMetaCache.h" +#include "net/HttpMetaCache.h" #include "icons/IconList.h" #include "BaseVersion.h" #include "BaseVersionList.h" @@ -7,7 +7,7 @@ #include #include #include -#include "logic/tasks/Task.h" +#include "tasks/Task.h" #include /* diff --git a/logic/InstanceList.cpp b/logic/InstanceList.cpp index 10faf1ca..013de31e 100644 --- a/logic/InstanceList.cpp +++ b/logic/InstanceList.cpp @@ -27,16 +27,16 @@ #include #include -#include "logic/InstanceList.h" -#include "logic/icons/IconList.h" -#include "logic/BaseInstance.h" +#include "InstanceList.h" +#include "icons/IconList.h" +#include "BaseInstance.h" //FIXME: this really doesn't belong *here* -#include "logic/minecraft/OneSixInstance.h" -#include "logic/minecraft/LegacyInstance.h" +#include "minecraft/OneSixInstance.h" +#include "minecraft/LegacyInstance.h" #include "minecraft/MinecraftVersion.h" #include "settings/INISettingsObject.h" -#include "logic/ftb/FTBPlugin.h" +#include "ftb/FTBPlugin.h" const static int GROUP_FILE_FORMAT_VERSION = 1; diff --git a/logic/InstanceList.h b/logic/InstanceList.h index 9600ffe9..07a71ffb 100644 --- a/logic/InstanceList.h +++ b/logic/InstanceList.h @@ -19,7 +19,7 @@ #include #include -#include "logic/BaseInstance.h" +#include "BaseInstance.h" class BaseInstance; class QDir; diff --git a/logic/MMCError.h b/logic/MMCError.h new file mode 100644 index 00000000..e81054a6 --- /dev/null +++ b/logic/MMCError.h @@ -0,0 +1,25 @@ +#pragma once +#include +#include +#include + +class MMCError : public std::exception +{ +public: + MMCError(QString cause) + { + exceptionCause = cause; + qCritical() << "Exception: " + cause; + }; + virtual ~MMCError() noexcept {} + virtual const char *what() const noexcept + { + return exceptionCause.toLocal8Bit(); + }; + virtual QString cause() const + { + return exceptionCause; + } +private: + QString exceptionCause; +}; diff --git a/logic/auth/MojangAccountList.cpp b/logic/auth/MojangAccountList.cpp index abed9b24..b69b9b81 100644 --- a/logic/auth/MojangAccountList.cpp +++ b/logic/auth/MojangAccountList.cpp @@ -13,7 +13,7 @@ * limitations under the License. */ -#include "logic/auth/MojangAccountList.h" +#include "auth/MojangAccountList.h" #include #include @@ -26,7 +26,7 @@ #include -#include "logic/auth/MojangAccount.h" +#include "auth/MojangAccount.h" #include #define ACCOUNT_LIST_FORMAT_VERSION 2 diff --git a/logic/auth/MojangAccountList.h b/logic/auth/MojangAccountList.h index 383d9dc4..b68343f2 100644 --- a/logic/auth/MojangAccountList.h +++ b/logic/auth/MojangAccountList.h @@ -20,7 +20,7 @@ #include #include -#include "logic/auth/MojangAccount.h" +#include "auth/MojangAccount.h" /*! * \brief List of available Mojang accounts. diff --git a/logic/auth/YggdrasilTask.cpp b/logic/auth/YggdrasilTask.cpp index 4d5c2594..3b6e0cfb 100644 --- a/logic/auth/YggdrasilTask.cpp +++ b/logic/auth/YggdrasilTask.cpp @@ -13,7 +13,7 @@ * limitations under the License. */ -#include +#include #include #include @@ -22,9 +22,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include diff --git a/logic/auth/YggdrasilTask.h b/logic/auth/YggdrasilTask.h index 1677bcf5..306d7358 100644 --- a/logic/auth/YggdrasilTask.h +++ b/logic/auth/YggdrasilTask.h @@ -15,14 +15,14 @@ #pragma once -#include +#include #include #include #include #include -#include "logic/auth/MojangAccount.h" +#include "auth/MojangAccount.h" class QNetworkReply; diff --git a/logic/auth/flows/AuthenticateTask.cpp b/logic/auth/flows/AuthenticateTask.cpp index 4141f00d..b26769d9 100644 --- a/logic/auth/flows/AuthenticateTask.cpp +++ b/logic/auth/flows/AuthenticateTask.cpp @@ -14,9 +14,9 @@ * limitations under the License. */ -#include +#include -#include +#include #include #include diff --git a/logic/auth/flows/AuthenticateTask.h b/logic/auth/flows/AuthenticateTask.h index 8b5f3efc..65975ae5 100644 --- a/logic/auth/flows/AuthenticateTask.h +++ b/logic/auth/flows/AuthenticateTask.h @@ -15,7 +15,7 @@ #pragma once -#include +#include #include #include diff --git a/logic/auth/flows/RefreshTask.cpp b/logic/auth/flows/RefreshTask.cpp index 2216c7e4..83511200 100644 --- a/logic/auth/flows/RefreshTask.cpp +++ b/logic/auth/flows/RefreshTask.cpp @@ -13,9 +13,9 @@ * limitations under the License. */ -#include +#include -#include +#include #include #include diff --git a/logic/auth/flows/RefreshTask.h b/logic/auth/flows/RefreshTask.h index 1b556776..6894e963 100644 --- a/logic/auth/flows/RefreshTask.h +++ b/logic/auth/flows/RefreshTask.h @@ -15,7 +15,7 @@ #pragma once -#include +#include #include #include diff --git a/logic/auth/flows/ValidateTask.cpp b/logic/auth/flows/ValidateTask.cpp index 21afb596..9a4dcd6d 100644 --- a/logic/auth/flows/ValidateTask.cpp +++ b/logic/auth/flows/ValidateTask.cpp @@ -14,9 +14,9 @@ * limitations under the License. */ -#include +#include -#include +#include #include #include diff --git a/logic/auth/flows/ValidateTask.h b/logic/auth/flows/ValidateTask.h index aa9da912..204596f9 100644 --- a/logic/auth/flows/ValidateTask.h +++ b/logic/auth/flows/ValidateTask.h @@ -19,7 +19,7 @@ #pragma once -#include +#include #include #include diff --git a/logic/forge/ForgeInstaller.cpp b/logic/forge/ForgeInstaller.cpp index cbd96869..ee68069b 100644 --- a/logic/forge/ForgeInstaller.cpp +++ b/logic/forge/ForgeInstaller.cpp @@ -14,14 +14,14 @@ */ #include "ForgeInstaller.h" -#include "logic/minecraft/MinecraftProfile.h" -#include "logic/minecraft/OneSixLibrary.h" -#include "logic/net/HttpMetaCache.h" -#include "logic/tasks/Task.h" -#include "logic/minecraft/OneSixInstance.h" -#include "logic/forge/ForgeVersionList.h" -#include "logic/minecraft/VersionFilterData.h" -#include "logic/Env.h" +#include "minecraft/MinecraftProfile.h" +#include "minecraft/OneSixLibrary.h" +#include "net/HttpMetaCache.h" +#include "tasks/Task.h" +#include "minecraft/OneSixInstance.h" +#include "forge/ForgeVersionList.h" +#include "minecraft/VersionFilterData.h" +#include "Env.h" #include #include diff --git a/logic/forge/ForgeInstaller.h b/logic/forge/ForgeInstaller.h index e85582fd..1b31d39f 100644 --- a/logic/forge/ForgeInstaller.h +++ b/logic/forge/ForgeInstaller.h @@ -15,7 +15,7 @@ #pragma once -#include "logic/BaseInstaller.h" +#include "BaseInstaller.h" #include #include diff --git a/logic/forge/ForgeMirrors.cpp b/logic/forge/ForgeMirrors.cpp index e922fcc3..0dea0826 100644 --- a/logic/forge/ForgeMirrors.cpp +++ b/logic/forge/ForgeMirrors.cpp @@ -1,4 +1,4 @@ -#include "logic/Env.h" +#include "Env.h" #include "ForgeMirrors.h" #include #include diff --git a/logic/forge/ForgeMirrors.h b/logic/forge/ForgeMirrors.h index 21d91a11..e7c90fa5 100644 --- a/logic/forge/ForgeMirrors.h +++ b/logic/forge/ForgeMirrors.h @@ -15,10 +15,10 @@ #pragma once -#include "logic/net/NetAction.h" -#include "logic/net/HttpMetaCache.h" -#include "logic/net/NetJob.h" -#include "logic/forge/ForgeXzDownload.h" +#include "net/NetAction.h" +#include "net/HttpMetaCache.h" +#include "net/NetJob.h" +#include "forge/ForgeXzDownload.h" #include #include typedef std::shared_ptr ForgeMirrorsPtr; diff --git a/logic/forge/ForgeVersion.cpp b/logic/forge/ForgeVersion.cpp index f3e64204..b859a28c 100644 --- a/logic/forge/ForgeVersion.cpp +++ b/logic/forge/ForgeVersion.cpp @@ -1,5 +1,5 @@ #include "ForgeVersion.h" -#include "logic/minecraft/VersionFilterData.h" +#include "minecraft/VersionFilterData.h" #include QString ForgeVersion::name() diff --git a/logic/forge/ForgeVersion.h b/logic/forge/ForgeVersion.h index e3c1aab9..e77d32f1 100644 --- a/logic/forge/ForgeVersion.h +++ b/logic/forge/ForgeVersion.h @@ -1,7 +1,7 @@ #pragma once #include #include -#include "logic/BaseVersion.h" +#include "BaseVersion.h" struct ForgeVersion; typedef std::shared_ptr ForgeVersionPtr; diff --git a/logic/forge/ForgeVersionList.cpp b/logic/forge/ForgeVersionList.cpp index 260f84eb..56ffad11 100644 --- a/logic/forge/ForgeVersionList.cpp +++ b/logic/forge/ForgeVersionList.cpp @@ -13,11 +13,11 @@ * limitations under the License. */ -#include "logic/forge/ForgeVersionList.h" -#include "logic/forge/ForgeVersion.h" -#include "logic/net/NetJob.h" -#include "logic/net/URLConstants.h" -#include "logic/Env.h" +#include "forge/ForgeVersionList.h" +#include "forge/ForgeVersion.h" +#include "net/NetJob.h" +#include "net/URLConstants.h" +#include "Env.h" #include #include diff --git a/logic/forge/ForgeVersionList.h b/logic/forge/ForgeVersionList.h index 6bc9e0a9..75e1dd78 100644 --- a/logic/forge/ForgeVersionList.h +++ b/logic/forge/ForgeVersionList.h @@ -20,10 +20,10 @@ #include #include -#include "logic/BaseVersionList.h" -#include "logic/tasks/Task.h" -#include "logic/net/NetJob.h" -#include "logic/forge/ForgeVersion.h" +#include "BaseVersionList.h" +#include "tasks/Task.h" +#include "net/NetJob.h" +#include "forge/ForgeVersion.h" class ForgeVersionList : public BaseVersionList { diff --git a/logic/forge/ForgeXzDownload.cpp b/logic/forge/ForgeXzDownload.cpp index 65b20959..712deb33 100644 --- a/logic/forge/ForgeXzDownload.cpp +++ b/logic/forge/ForgeXzDownload.cpp @@ -13,7 +13,7 @@ * limitations under the License. */ -#include "logic/Env.h" +#include "Env.h" #include "ForgeXzDownload.h" #include diff --git a/logic/forge/ForgeXzDownload.h b/logic/forge/ForgeXzDownload.h index 49cedbdf..45722812 100644 --- a/logic/forge/ForgeXzDownload.h +++ b/logic/forge/ForgeXzDownload.h @@ -15,8 +15,8 @@ #pragma once -#include "logic/net/NetAction.h" -#include "logic/net/HttpMetaCache.h" +#include "net/NetAction.h" +#include "net/HttpMetaCache.h" #include #include #include "ForgeMirror.h" diff --git a/logic/forge/LegacyForge.h b/logic/forge/LegacyForge.h index 5bc43fbf..f51d5e85 100644 --- a/logic/forge/LegacyForge.h +++ b/logic/forge/LegacyForge.h @@ -15,7 +15,7 @@ #pragma once -#include "logic/minecraft/Mod.h" +#include "minecraft/Mod.h" class MinecraftForge : public Mod { diff --git a/logic/ftb/FTBPlugin.cpp b/logic/ftb/FTBPlugin.cpp index de04e485..88f6e793 100644 --- a/logic/ftb/FTBPlugin.cpp +++ b/logic/ftb/FTBPlugin.cpp @@ -2,11 +2,11 @@ #include "FTBVersion.h" #include "LegacyFTBInstance.h" #include "OneSixFTBInstance.h" -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include "QDebug" #include diff --git a/logic/ftb/FTBPlugin.h b/logic/ftb/FTBPlugin.h index 8a38e2bb..30913d19 100644 --- a/logic/ftb/FTBPlugin.h +++ b/logic/ftb/FTBPlugin.h @@ -1,6 +1,6 @@ #pragma once -#include +#include // Pseudo-plugin for FTB related things. Super derpy! class FTBPlugin diff --git a/logic/ftb/FTBProfileStrategy.cpp b/logic/ftb/FTBProfileStrategy.cpp index 87be0ff9..cc20b247 100644 --- a/logic/ftb/FTBProfileStrategy.cpp +++ b/logic/ftb/FTBProfileStrategy.cpp @@ -1,7 +1,7 @@ -#include "logic/ftb/FTBProfileStrategy.h" -#include "logic/minecraft/VersionBuildError.h" -#include "logic/ftb/OneSixFTBInstance.h" -#include "logic/minecraft/MinecraftVersionList.h" +#include "ftb/FTBProfileStrategy.h" +#include "minecraft/VersionBuildError.h" +#include "ftb/OneSixFTBInstance.h" +#include "minecraft/MinecraftVersionList.h" #include #include diff --git a/logic/ftb/FTBVersion.h b/logic/ftb/FTBVersion.h index dbd9c29e..805319b4 100644 --- a/logic/ftb/FTBVersion.h +++ b/logic/ftb/FTBVersion.h @@ -1,5 +1,5 @@ #pragma once -#include +#include class FTBVersion : public BaseVersion { diff --git a/logic/ftb/LegacyFTBInstance.cpp b/logic/ftb/LegacyFTBInstance.cpp index 43a9b42a..e7490679 100644 --- a/logic/ftb/LegacyFTBInstance.cpp +++ b/logic/ftb/LegacyFTBInstance.cpp @@ -1,5 +1,5 @@ #include "LegacyFTBInstance.h" -#include +#include #include LegacyFTBInstance::LegacyFTBInstance(SettingsObjectPtr globalSettings, SettingsObjectPtr settings, const QString &rootDir) : diff --git a/logic/ftb/LegacyFTBInstance.h b/logic/ftb/LegacyFTBInstance.h index 80c6c5ab..3bacf653 100644 --- a/logic/ftb/LegacyFTBInstance.h +++ b/logic/ftb/LegacyFTBInstance.h @@ -1,6 +1,6 @@ #pragma once -#include "logic/minecraft/LegacyInstance.h" +#include "minecraft/LegacyInstance.h" class LegacyFTBInstance : public LegacyInstance { diff --git a/logic/ftb/OneSixFTBInstance.cpp b/logic/ftb/OneSixFTBInstance.cpp index 4902be08..7374b78f 100644 --- a/logic/ftb/OneSixFTBInstance.cpp +++ b/logic/ftb/OneSixFTBInstance.cpp @@ -1,13 +1,13 @@ #include "OneSixFTBInstance.h" #include "FTBProfileStrategy.h" -#include "logic/minecraft/MinecraftProfile.h" -#include "logic/minecraft/OneSixLibrary.h" -#include "logic/minecraft/VersionBuilder.h" -#include "logic/tasks/SequentialTask.h" -#include "logic/forge/ForgeInstaller.h" -#include "logic/forge/ForgeVersionList.h" -#include +#include "minecraft/MinecraftProfile.h" +#include "minecraft/OneSixLibrary.h" +#include "minecraft/VersionBuilder.h" +#include "tasks/SequentialTask.h" +#include "forge/ForgeInstaller.h" +#include "forge/ForgeVersionList.h" +#include #include "pathutils.h" OneSixFTBInstance::OneSixFTBInstance(SettingsObjectPtr globalSettings, SettingsObjectPtr settings, const QString &rootDir) : diff --git a/logic/ftb/OneSixFTBInstance.h b/logic/ftb/OneSixFTBInstance.h index 7af7c770..dd652fd1 100644 --- a/logic/ftb/OneSixFTBInstance.h +++ b/logic/ftb/OneSixFTBInstance.h @@ -1,6 +1,6 @@ #pragma once -#include "logic/minecraft/OneSixInstance.h" +#include "minecraft/OneSixInstance.h" class OneSixLibrary; diff --git a/logic/icons/IconList.h b/logic/icons/IconList.h index 124ecf27..07fb1379 100644 --- a/logic/icons/IconList.h +++ b/logic/icons/IconList.h @@ -22,8 +22,8 @@ #include #include #include "MMCIcon.h" -#include "logic/settings/Setting.h" -#include "logic/Env.h" // there is a global icon list inside Env. +#include "settings/Setting.h" +#include "Env.h" // there is a global icon list inside Env. class QFileSystemWatcher; diff --git a/logic/java/JavaCheckerJob.h b/logic/java/JavaCheckerJob.h index eba3751a..a98d88cd 100644 --- a/logic/java/JavaCheckerJob.h +++ b/logic/java/JavaCheckerJob.h @@ -18,7 +18,7 @@ #include #include #include "JavaChecker.h" -#include "logic/tasks/ProgressProvider.h" +#include "tasks/ProgressProvider.h" class JavaCheckerJob; typedef std::shared_ptr JavaCheckerJobPtr; diff --git a/logic/java/JavaUtils.cpp b/logic/java/JavaUtils.cpp index 3cacbbd2..ac1d60e4 100644 --- a/logic/java/JavaUtils.cpp +++ b/logic/java/JavaUtils.cpp @@ -18,13 +18,13 @@ #include #include -#include +#include #include #include -#include "logic/java/JavaUtils.h" -#include "logic/java/JavaCheckerJob.h" -#include "logic/java/JavaVersionList.h" +#include "java/JavaUtils.h" +#include "java/JavaCheckerJob.h" +#include "java/JavaVersionList.h" JavaUtils::JavaUtils() { diff --git a/logic/java/JavaVersionList.cpp b/logic/java/JavaVersionList.cpp index 4f8592ce..bb5f025f 100644 --- a/logic/java/JavaVersionList.cpp +++ b/logic/java/JavaVersionList.cpp @@ -19,9 +19,9 @@ #include -#include "logic/java/JavaVersionList.h" -#include "logic/java/JavaCheckerJob.h" -#include "logic/java/JavaUtils.h" +#include "java/JavaVersionList.h" +#include "java/JavaCheckerJob.h" +#include "java/JavaUtils.h" JavaVersionList::JavaVersionList(QObject *parent) : BaseVersionList(parent) { diff --git a/logic/java/JavaVersionList.h b/logic/java/JavaVersionList.h index 288f0608..820bd5a6 100644 --- a/logic/java/JavaVersionList.h +++ b/logic/java/JavaVersionList.h @@ -18,9 +18,9 @@ #include #include -#include "logic/BaseVersionList.h" -#include "logic/tasks/Task.h" -#include "logic/java/JavaCheckerJob.h" +#include "BaseVersionList.h" +#include "tasks/Task.h" +#include "java/JavaCheckerJob.h" class JavaListLoadTask; diff --git a/logic/liteloader/LiteLoaderInstaller.cpp b/logic/liteloader/LiteLoaderInstaller.cpp index fadcc790..ab802380 100644 --- a/logic/liteloader/LiteLoaderInstaller.cpp +++ b/logic/liteloader/LiteLoaderInstaller.cpp @@ -20,10 +20,10 @@ #include -#include "logic/minecraft/MinecraftProfile.h" -#include "logic/minecraft/OneSixLibrary.h" -#include "logic/minecraft/OneSixInstance.h" -#include "logic/liteloader/LiteLoaderVersionList.h" +#include "minecraft/MinecraftProfile.h" +#include "minecraft/OneSixLibrary.h" +#include "minecraft/OneSixInstance.h" +#include "liteloader/LiteLoaderVersionList.h" LiteLoaderInstaller::LiteLoaderInstaller() : BaseInstaller() { diff --git a/logic/liteloader/LiteLoaderInstaller.h b/logic/liteloader/LiteLoaderInstaller.h index b326cc3e..51d58706 100644 --- a/logic/liteloader/LiteLoaderInstaller.h +++ b/logic/liteloader/LiteLoaderInstaller.h @@ -18,8 +18,8 @@ #include #include -#include "logic/BaseInstaller.h" -#include "logic/liteloader/LiteLoaderVersionList.h" +#include "BaseInstaller.h" +#include "liteloader/LiteLoaderVersionList.h" class LiteLoaderInstaller : public BaseInstaller { diff --git a/logic/liteloader/LiteLoaderVersionList.cpp b/logic/liteloader/LiteLoaderVersionList.cpp index 89ea5df5..2e54afdf 100644 --- a/logic/liteloader/LiteLoaderVersionList.cpp +++ b/logic/liteloader/LiteLoaderVersionList.cpp @@ -14,9 +14,9 @@ */ #include "LiteLoaderVersionList.h" -#include "logic/Env.h" -#include "logic/net/URLConstants.h" -#include +#include "Env.h" +#include "net/URLConstants.h" +#include "MMCError.h" #include diff --git a/logic/liteloader/LiteLoaderVersionList.h b/logic/liteloader/LiteLoaderVersionList.h index f9764d72..fd20fcfa 100644 --- a/logic/liteloader/LiteLoaderVersionList.h +++ b/logic/liteloader/LiteLoaderVersionList.h @@ -19,11 +19,11 @@ #include #include -#include "logic/BaseVersion.h" -#include "logic/BaseVersionList.h" -#include "logic/tasks/Task.h" -#include "logic/net/NetJob.h" -#include +#include "BaseVersion.h" +#include "BaseVersionList.h" +#include "tasks/Task.h" +#include "net/NetJob.h" +#include class LLListLoadTask; class QNetworkReply; diff --git a/logic/minecraft/GradleSpecifier.h b/logic/minecraft/GradleSpecifier.h index 411aed65..18308537 100644 --- a/logic/minecraft/GradleSpecifier.h +++ b/logic/minecraft/GradleSpecifier.h @@ -2,7 +2,7 @@ #include #include -#include "logic/DefaultVariable.h" +#include "DefaultVariable.h" struct GradleSpecifier { diff --git a/logic/minecraft/JarMod.cpp b/logic/minecraft/JarMod.cpp index fce8a492..c7ba58f1 100644 --- a/logic/minecraft/JarMod.cpp +++ b/logic/minecraft/JarMod.cpp @@ -1,5 +1,5 @@ #include "JarMod.h" -#include "logic/MMCJson.h" +#include "MMCJson.h" using namespace MMCJson; JarmodPtr Jarmod::fromJson(const QJsonObject &libObj, const QString &filename) diff --git a/logic/minecraft/JarUtils.cpp b/logic/minecraft/JarUtils.cpp index 59326aba..b8fb6f0d 100644 --- a/logic/minecraft/JarUtils.cpp +++ b/logic/minecraft/JarUtils.cpp @@ -1,4 +1,4 @@ -#include "logic/minecraft/JarUtils.h" +#include "minecraft/JarUtils.h" #include #include #include diff --git a/logic/minecraft/LegacyInstance.cpp b/logic/minecraft/LegacyInstance.cpp index c0fe1513..a330842d 100644 --- a/logic/minecraft/LegacyInstance.cpp +++ b/logic/minecraft/LegacyInstance.cpp @@ -16,15 +16,17 @@ #include #include #include -#include +#include #include #include #include "LegacyInstance.h" -#include "logic/minecraft/LegacyUpdate.h" -#include "logic/icons/IconList.h" -#include "logic/minecraft/MinecraftProcess.h" +#include "minecraft/LegacyUpdate.h" +#include "icons/IconList.h" +#include "minecraft/MinecraftProcess.h" +#include "minecraft/ModList.h" +/* #include "gui/pages/LegacyUpgradePage.h" #include "gui/pages/ModFolderPage.h" #include "gui/pages/LegacyJarModPage.h" @@ -32,6 +34,7 @@ #include #include #include +*/ LegacyInstance::LegacyInstance(SettingsObjectPtr globalSettings, SettingsObjectPtr settings, const QString &rootDir) : MinecraftInstance(globalSettings, settings, rootDir) @@ -53,6 +56,7 @@ LegacyInstance::LegacyInstance(SettingsObjectPtr globalSettings, SettingsObjectP settings->registerSetting("CustomBaseJar", ""); } +/* QList LegacyInstance::getPages() { QList values; @@ -74,6 +78,7 @@ QString LegacyInstance::dialogTitle() { return tr("Edit Instance (%1)").arg(name()); } +*/ QString LegacyInstance::baseJar() const { diff --git a/logic/minecraft/LegacyInstance.h b/logic/minecraft/LegacyInstance.h index 353718c1..64bcb08b 100644 --- a/logic/minecraft/LegacyInstance.h +++ b/logic/minecraft/LegacyInstance.h @@ -15,13 +15,12 @@ #pragma once -#include "logic/minecraft/MinecraftInstance.h" -#include "gui/pages/BasePageProvider.h" +#include "minecraft/MinecraftInstance.h" class ModList; class Task; -class LegacyInstance : public MinecraftInstance, public BasePageProvider +class LegacyInstance : public MinecraftInstance { Q_OBJECT public: @@ -36,9 +35,11 @@ public: //! Path to the instance's modlist file. QString modListFile() const; + /* ////// Edit Instance Dialog stuff ////// virtual QList getPages(); virtual QString dialogTitle(); + */ ////// Mod Lists ////// std::shared_ptr jarModList() const ; diff --git a/logic/minecraft/LegacyUpdate.cpp b/logic/minecraft/LegacyUpdate.cpp index d853536a..e2fffbb3 100644 --- a/logic/minecraft/LegacyUpdate.cpp +++ b/logic/minecraft/LegacyUpdate.cpp @@ -20,16 +20,16 @@ #include #include -#include "logic/Env.h" -#include "logic/BaseInstance.h" -#include "logic/net/URLConstants.h" - -#include "logic/minecraft/JarUtils.h" -#include "logic/minecraft/LegacyUpdate.h" -#include "logic/minecraft/LwjglVersionList.h" -#include "logic/minecraft/MinecraftVersionList.h" -#include "logic/minecraft/ModList.h" -#include "logic/minecraft/LegacyInstance.h" +#include "Env.h" +#include "BaseInstance.h" +#include "net/URLConstants.h" + +#include "minecraft/JarUtils.h" +#include "minecraft/LegacyUpdate.h" +#include "minecraft/LwjglVersionList.h" +#include "minecraft/MinecraftVersionList.h" +#include "minecraft/ModList.h" +#include "minecraft/LegacyInstance.h" LegacyUpdate::LegacyUpdate(BaseInstance *inst, QObject *parent) : Task(parent), m_inst(inst) { diff --git a/logic/minecraft/LegacyUpdate.h b/logic/minecraft/LegacyUpdate.h index 78e456a1..61de75d3 100644 --- a/logic/minecraft/LegacyUpdate.h +++ b/logic/minecraft/LegacyUpdate.h @@ -19,9 +19,9 @@ #include #include -#include "logic/net/NetJob.h" -#include "logic/tasks/Task.h" -#include "logic/minecraft/VersionFilterData.h" +#include "net/NetJob.h" +#include "tasks/Task.h" +#include "minecraft/VersionFilterData.h" class MinecraftVersion; class BaseInstance; diff --git a/logic/minecraft/LwjglVersionList.cpp b/logic/minecraft/LwjglVersionList.cpp index 9e101b74..bb017368 100644 --- a/logic/minecraft/LwjglVersionList.cpp +++ b/logic/minecraft/LwjglVersionList.cpp @@ -14,7 +14,7 @@ */ #include "LwjglVersionList.h" -#include "logic/Env.h" +#include "Env.h" #include #include diff --git a/logic/minecraft/LwjglVersionList.h b/logic/minecraft/LwjglVersionList.h index c364fa13..9584f837 100644 --- a/logic/minecraft/LwjglVersionList.h +++ b/logic/minecraft/LwjglVersionList.h @@ -21,8 +21,8 @@ #include #include -#include "logic/BaseVersion.h" -#include "logic/BaseVersionList.h" +#include "BaseVersion.h" +#include "BaseVersionList.h" class LWJGLVersion; typedef std::shared_ptr PtrLWJGLVersion; diff --git a/logic/minecraft/MinecraftInstance.cpp b/logic/minecraft/MinecraftInstance.cpp index 93aeecd1..e4273cb9 100644 --- a/logic/minecraft/MinecraftInstance.cpp +++ b/logic/minecraft/MinecraftInstance.cpp @@ -1,8 +1,8 @@ #include "MinecraftInstance.h" -#include "logic/settings/SettingsObject.h" +#include "settings/SettingsObject.h" #include -#include "logic/Env.h" -#include "logic/minecraft/MinecraftVersionList.h" +#include "Env.h" +#include "minecraft/MinecraftVersionList.h" MinecraftInstance::MinecraftInstance(SettingsObjectPtr globalSettings, SettingsObjectPtr settings, const QString &rootDir) : BaseInstance(globalSettings, settings, rootDir) diff --git a/logic/minecraft/MinecraftInstance.h b/logic/minecraft/MinecraftInstance.h index 63519ae8..d7ae18ea 100644 --- a/logic/minecraft/MinecraftInstance.h +++ b/logic/minecraft/MinecraftInstance.h @@ -1,6 +1,6 @@ #pragma once -#include "logic/BaseInstance.h" -#include "logic/minecraft/Mod.h" +#include "BaseInstance.h" +#include "minecraft/Mod.h" class ModList; diff --git a/logic/minecraft/MinecraftProcess.cpp b/logic/minecraft/MinecraftProcess.cpp index 75287856..9d18ad90 100644 --- a/logic/minecraft/MinecraftProcess.cpp +++ b/logic/minecraft/MinecraftProcess.cpp @@ -14,8 +14,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "logic/minecraft/MinecraftProcess.h" -#include "logic/BaseInstance.h" +#include "minecraft/MinecraftProcess.h" +#include "BaseInstance.h" #include #include diff --git a/logic/minecraft/MinecraftProcess.h b/logic/minecraft/MinecraftProcess.h index 30a59e91..34c02b77 100644 --- a/logic/minecraft/MinecraftProcess.h +++ b/logic/minecraft/MinecraftProcess.h @@ -18,8 +18,8 @@ #pragma once #include -#include "logic/minecraft/MinecraftInstance.h" -#include "logic/BaseProcess.h" +#include "minecraft/MinecraftInstance.h" +#include "BaseProcess.h" /** * The MinecraftProcess class diff --git a/logic/minecraft/MinecraftProfile.cpp b/logic/minecraft/MinecraftProfile.cpp index 27277ab2..f38f8378 100644 --- a/logic/minecraft/MinecraftProfile.cpp +++ b/logic/minecraft/MinecraftProfile.cpp @@ -19,8 +19,8 @@ #include #include -#include "logic/minecraft/MinecraftProfile.h" -#include "logic/minecraft/VersionBuilder.h" +#include "minecraft/MinecraftProfile.h" +#include "minecraft/VersionBuilder.h" #include "ProfileUtils.h" #include "NullProfileStrategy.h" diff --git a/logic/minecraft/MinecraftVersion.cpp b/logic/minecraft/MinecraftVersion.cpp index 0d484497..977a1892 100644 --- a/logic/minecraft/MinecraftVersion.cpp +++ b/logic/minecraft/MinecraftVersion.cpp @@ -3,7 +3,7 @@ #include "VersionBuildError.h" #include "VersionBuilder.h" #include "ProfileUtils.h" -#include "logic/settings/SettingsObject.h" +#include "settings/SettingsObject.h" bool MinecraftVersion::usesLegacyLauncher() { diff --git a/logic/minecraft/MinecraftVersion.h b/logic/minecraft/MinecraftVersion.h index fbb209f2..9ee8425a 100644 --- a/logic/minecraft/MinecraftVersion.h +++ b/logic/minecraft/MinecraftVersion.h @@ -19,7 +19,7 @@ #include #include -#include "logic/BaseVersion.h" +#include "BaseVersion.h" #include "ProfilePatch.h" #include "VersionFile.h" #include "VersionSource.h" diff --git a/logic/minecraft/MinecraftVersionList.cpp b/logic/minecraft/MinecraftVersionList.cpp index 2f549752..34c1e3d4 100644 --- a/logic/minecraft/MinecraftVersionList.cpp +++ b/logic/minecraft/MinecraftVersionList.cpp @@ -14,15 +14,15 @@ */ #include -#include "logic/MMCJson.h" +#include "MMCJson.h" #include #include -#include "logic/Env.h" +#include "Env.h" #include "MMCError.h" #include "MinecraftVersionList.h" -#include "logic/net/URLConstants.h" +#include "net/URLConstants.h" #include "ParseUtils.h" #include "ProfileUtils.h" diff --git a/logic/minecraft/MinecraftVersionList.h b/logic/minecraft/MinecraftVersionList.h index be9f8581..3266fc2d 100644 --- a/logic/minecraft/MinecraftVersionList.h +++ b/logic/minecraft/MinecraftVersionList.h @@ -19,10 +19,10 @@ #include #include -#include "logic/BaseVersionList.h" -#include "logic/tasks/Task.h" -#include "logic/minecraft/MinecraftVersion.h" -#include +#include "BaseVersionList.h" +#include "tasks/Task.h" +#include "minecraft/MinecraftVersion.h" +#include class MCVListLoadTask; class MCVListVersionUpdateTask; diff --git a/logic/minecraft/Mod.cpp b/logic/minecraft/Mod.cpp index 7fa4905e..f8eb4faf 100644 --- a/logic/minecraft/Mod.cpp +++ b/logic/minecraft/Mod.cpp @@ -24,7 +24,7 @@ #include "Mod.h" #include -#include "logic/settings/INIFile.h" +#include "settings/INIFile.h" #include Mod::Mod(const QFileInfo &file) diff --git a/logic/minecraft/ModList.h b/logic/minecraft/ModList.h index e227356b..70eb5569 100644 --- a/logic/minecraft/ModList.h +++ b/logic/minecraft/ModList.h @@ -20,7 +20,7 @@ #include #include -#include "logic/minecraft/Mod.h" +#include "minecraft/Mod.h" class LegacyInstance; class BaseInstance; diff --git a/logic/minecraft/OneSixInstance.cpp b/logic/minecraft/OneSixInstance.cpp index f43275ab..915314d0 100644 --- a/logic/minecraft/OneSixInstance.cpp +++ b/logic/minecraft/OneSixInstance.cpp @@ -18,16 +18,16 @@ #include #include "MMCError.h" -#include "logic/minecraft/OneSixInstance.h" +#include "minecraft/OneSixInstance.h" -#include "logic/minecraft/OneSixUpdate.h" -#include "logic/minecraft/MinecraftProfile.h" -#include "logic/minecraft/VersionBuildError.h" -#include "logic/minecraft/MinecraftProcess.h" -#include "logic/minecraft/OneSixProfileStrategy.h" +#include "minecraft/OneSixUpdate.h" +#include "minecraft/MinecraftProfile.h" +#include "minecraft/VersionBuildError.h" +#include "minecraft/MinecraftProcess.h" +#include "minecraft/OneSixProfileStrategy.h" -#include "logic/minecraft/AssetsUtils.h" -#include "logic/icons/IconList.h" +#include "minecraft/AssetsUtils.h" +#include "icons/IconList.h" OneSixInstance::OneSixInstance(SettingsObjectPtr globalSettings, SettingsObjectPtr settings, const QString &rootDir) : MinecraftInstance(globalSettings, settings, rootDir) diff --git a/logic/minecraft/OneSixInstance.h b/logic/minecraft/OneSixInstance.h index 79e67bd2..dd5ddf5e 100644 --- a/logic/minecraft/OneSixInstance.h +++ b/logic/minecraft/OneSixInstance.h @@ -15,10 +15,10 @@ #pragma once -#include "logic/minecraft/MinecraftInstance.h" +#include "minecraft/MinecraftInstance.h" -#include "logic/minecraft/MinecraftProfile.h" -#include "logic/minecraft/ModList.h" +#include "minecraft/MinecraftProfile.h" +#include "minecraft/ModList.h" class OneSixInstance : public MinecraftInstance { diff --git a/logic/minecraft/OneSixLibrary.h b/logic/minecraft/OneSixLibrary.h index bdd3c85e..76e04c2c 100644 --- a/logic/minecraft/OneSixLibrary.h +++ b/logic/minecraft/OneSixLibrary.h @@ -22,9 +22,9 @@ #include #include -#include "logic/net/URLConstants.h" -#include "logic/minecraft/OpSys.h" -#include "logic/minecraft/RawLibrary.h" +#include "net/URLConstants.h" +#include "minecraft/OpSys.h" +#include "minecraft/RawLibrary.h" class OneSixLibrary; typedef std::shared_ptr OneSixLibraryPtr; diff --git a/logic/minecraft/OneSixProfileStrategy.cpp b/logic/minecraft/OneSixProfileStrategy.cpp index 6d80963f..4f596d12 100644 --- a/logic/minecraft/OneSixProfileStrategy.cpp +++ b/logic/minecraft/OneSixProfileStrategy.cpp @@ -1,8 +1,8 @@ -#include "logic/minecraft/OneSixProfileStrategy.h" -#include "logic/minecraft/VersionBuildError.h" -#include "logic/minecraft/OneSixInstance.h" -#include "logic/minecraft/MinecraftVersionList.h" -#include "logic/Env.h" +#include "minecraft/OneSixProfileStrategy.h" +#include "minecraft/VersionBuildError.h" +#include "minecraft/OneSixInstance.h" +#include "minecraft/MinecraftVersionList.h" +#include "Env.h" #include #include diff --git a/logic/minecraft/OneSixUpdate.cpp b/logic/minecraft/OneSixUpdate.cpp index f9ab6c65..6cea2341 100644 --- a/logic/minecraft/OneSixUpdate.cpp +++ b/logic/minecraft/OneSixUpdate.cpp @@ -13,7 +13,7 @@ * limitations under the License. */ -#include "logic/Env.h" +#include "Env.h" #include "OneSixUpdate.h" #include @@ -25,15 +25,15 @@ #include #include -#include "logic/BaseInstance.h" -#include "logic/minecraft/MinecraftVersionList.h" -#include "logic/minecraft/MinecraftProfile.h" -#include "logic/minecraft/OneSixLibrary.h" -#include "logic/minecraft/OneSixInstance.h" -#include "logic/forge/ForgeMirrors.h" -#include "logic/net/URLConstants.h" -#include "logic/minecraft/AssetsUtils.h" -#include "logic/minecraft/JarUtils.h" +#include "BaseInstance.h" +#include "minecraft/MinecraftVersionList.h" +#include "minecraft/MinecraftProfile.h" +#include "minecraft/OneSixLibrary.h" +#include "minecraft/OneSixInstance.h" +#include "forge/ForgeMirrors.h" +#include "net/URLConstants.h" +#include "minecraft/AssetsUtils.h" +#include "minecraft/JarUtils.h" OneSixUpdate::OneSixUpdate(OneSixInstance *inst, QObject *parent) : Task(parent), m_inst(inst) { diff --git a/logic/minecraft/OneSixUpdate.h b/logic/minecraft/OneSixUpdate.h index e3571e5a..c8c3b03f 100644 --- a/logic/minecraft/OneSixUpdate.h +++ b/logic/minecraft/OneSixUpdate.h @@ -19,9 +19,9 @@ #include #include -#include "logic/net/NetJob.h" -#include "logic/tasks/Task.h" -#include "logic/minecraft/VersionFilterData.h" +#include "net/NetJob.h" +#include "tasks/Task.h" +#include "minecraft/VersionFilterData.h" #include class MinecraftVersion; diff --git a/logic/minecraft/ParseUtils.cpp b/logic/minecraft/ParseUtils.cpp index f94de6ff..49e0e0ca 100644 --- a/logic/minecraft/ParseUtils.cpp +++ b/logic/minecraft/ParseUtils.cpp @@ -1,7 +1,7 @@ #include #include #include "ParseUtils.h" -#include +#include QDateTime timeFromS3Time(QString str) { diff --git a/logic/minecraft/ProfileUtils.cpp b/logic/minecraft/ProfileUtils.cpp index 21fcb2ef..3eaca920 100644 --- a/logic/minecraft/ProfileUtils.cpp +++ b/logic/minecraft/ProfileUtils.cpp @@ -1,6 +1,6 @@ #include "ProfileUtils.h" -#include "logic/minecraft/VersionFilterData.h" -#include "logic/MMCJson.h" +#include "minecraft/VersionFilterData.h" +#include "MMCJson.h" #include #include diff --git a/logic/minecraft/RawLibrary.cpp b/logic/minecraft/RawLibrary.cpp index 87dbf3ec..3c771895 100644 --- a/logic/minecraft/RawLibrary.cpp +++ b/logic/minecraft/RawLibrary.cpp @@ -1,4 +1,4 @@ -#include "logic/MMCJson.h" +#include "MMCJson.h" using namespace MMCJson; #include "RawLibrary.h" diff --git a/logic/minecraft/RawLibrary.h b/logic/minecraft/RawLibrary.h index 6263f99a..a3990740 100644 --- a/logic/minecraft/RawLibrary.h +++ b/logic/minecraft/RawLibrary.h @@ -7,10 +7,10 @@ #include #include -#include "logic/minecraft/OneSixRule.h" -#include "logic/minecraft/OpSys.h" +#include "minecraft/OneSixRule.h" +#include "minecraft/OpSys.h" #include "GradleSpecifier.h" -#include "logic/net/URLConstants.h" +#include "net/URLConstants.h" class RawLibrary; typedef std::shared_ptr RawLibraryPtr; diff --git a/logic/minecraft/SkinUtils.cpp b/logic/minecraft/SkinUtils.cpp index f44c9c70..e6e513a5 100644 --- a/logic/minecraft/SkinUtils.cpp +++ b/logic/minecraft/SkinUtils.cpp @@ -13,9 +13,9 @@ * limitations under the License. */ -#include "logic/minecraft/SkinUtils.h" -#include "logic/net/HttpMetaCache.h" -#include "logic/Env.h" +#include "minecraft/SkinUtils.h" +#include "net/HttpMetaCache.h" +#include "Env.h" #include #include diff --git a/logic/minecraft/VersionBuilder.cpp b/logic/minecraft/VersionBuilder.cpp index bc29c187..4d58b060 100644 --- a/logic/minecraft/VersionBuilder.cpp +++ b/logic/minecraft/VersionBuilder.cpp @@ -26,17 +26,17 @@ #include #include -#include "logic/minecraft/VersionBuilder.h" -#include "logic/minecraft/MinecraftProfile.h" -#include "logic/minecraft/OneSixRule.h" -#include "logic/minecraft/ProfilePatch.h" -#include "logic/minecraft/VersionFile.h" +#include "minecraft/VersionBuilder.h" +#include "minecraft/MinecraftProfile.h" +#include "minecraft/OneSixRule.h" +#include "minecraft/ProfilePatch.h" +#include "minecraft/VersionFile.h" #include "VersionBuildError.h" #include "MinecraftVersionList.h" #include "ProfileUtils.h" -#include "logic/minecraft/OneSixInstance.h" -#include "logic/MMCJson.h" +#include "minecraft/OneSixInstance.h" +#include "MMCJson.h" #include diff --git a/logic/minecraft/VersionFile.cpp b/logic/minecraft/VersionFile.cpp index 275be12e..0a20efcb 100644 --- a/logic/minecraft/VersionFile.cpp +++ b/logic/minecraft/VersionFile.cpp @@ -4,13 +4,13 @@ #include -#include "logic/minecraft/VersionFile.h" -#include "logic/minecraft/OneSixLibrary.h" -#include "logic/minecraft/MinecraftProfile.h" -#include "logic/minecraft/JarMod.h" +#include "minecraft/VersionFile.h" +#include "minecraft/OneSixLibrary.h" +#include "minecraft/MinecraftProfile.h" +#include "minecraft/JarMod.h" #include "ParseUtils.h" -#include "logic/MMCJson.h" +#include "MMCJson.h" using namespace MMCJson; #include "VersionBuildError.h" diff --git a/logic/minecraft/VersionFile.h b/logic/minecraft/VersionFile.h index 1e8772af..346a8dcd 100644 --- a/logic/minecraft/VersionFile.h +++ b/logic/minecraft/VersionFile.h @@ -4,8 +4,8 @@ #include #include #include -#include "logic/minecraft/OpSys.h" -#include "logic/minecraft/OneSixRule.h" +#include "minecraft/OpSys.h" +#include "minecraft/OneSixRule.h" #include "ProfilePatch.h" #include "MMCError.h" #include "OneSixLibrary.h" diff --git a/logic/net/ByteArrayDownload.cpp b/logic/net/ByteArrayDownload.cpp index 7a41ee28..151487f0 100644 --- a/logic/net/ByteArrayDownload.cpp +++ b/logic/net/ByteArrayDownload.cpp @@ -14,7 +14,7 @@ */ #include "ByteArrayDownload.h" -#include "logic/Env.h" +#include "Env.h" #include ByteArrayDownload::ByteArrayDownload(QUrl url) : NetAction() diff --git a/logic/net/CacheDownload.cpp b/logic/net/CacheDownload.cpp index 0bbe75c3..a4fac6ef 100644 --- a/logic/net/CacheDownload.cpp +++ b/logic/net/CacheDownload.cpp @@ -20,7 +20,7 @@ #include #include #include -#include "logic/Env.h" +#include "Env.h" CacheDownload::CacheDownload(QUrl url, MetaEntryPtr entry) : NetAction(), md5sum(QCryptographicHash::Md5) diff --git a/logic/net/HttpMetaCache.cpp b/logic/net/HttpMetaCache.cpp index 7e52f16c..bfd2cb42 100644 --- a/logic/net/HttpMetaCache.cpp +++ b/logic/net/HttpMetaCache.cpp @@ -13,7 +13,7 @@ * limitations under the License. */ -#include "logic/Env.h" +#include "Env.h" #include "HttpMetaCache.h" #include diff --git a/logic/net/MD5EtagDownload.cpp b/logic/net/MD5EtagDownload.cpp index 03752ea8..651ab602 100644 --- a/logic/net/MD5EtagDownload.cpp +++ b/logic/net/MD5EtagDownload.cpp @@ -13,7 +13,7 @@ * limitations under the License. */ -#include "logic/Env.h" +#include "Env.h" #include "MD5EtagDownload.h" #include #include diff --git a/logic/net/NetAction.h b/logic/net/NetAction.h index b306bdfe..7c5bd5de 100644 --- a/logic/net/NetAction.h +++ b/logic/net/NetAction.h @@ -19,7 +19,7 @@ #include #include #include -#include +#include enum JobStatus { diff --git a/logic/net/NetJob.h b/logic/net/NetJob.h index 708afa79..7f7b418c 100644 --- a/logic/net/NetJob.h +++ b/logic/net/NetJob.h @@ -21,8 +21,8 @@ #include "MD5EtagDownload.h" #include "CacheDownload.h" #include "HttpMetaCache.h" -#include "logic/tasks/ProgressProvider.h" -#include "logic/QObjectPtr.h" +#include "tasks/ProgressProvider.h" +#include "QObjectPtr.h" class NetJob; typedef QObjectPtr NetJobPtr; diff --git a/logic/net/PasteUpload.cpp b/logic/net/PasteUpload.cpp index 6bed0887..b780194f 100644 --- a/logic/net/PasteUpload.cpp +++ b/logic/net/PasteUpload.cpp @@ -1,5 +1,5 @@ #include "PasteUpload.h" -#include "logic/Env.h" +#include "Env.h" #include #include #include diff --git a/logic/net/PasteUpload.h b/logic/net/PasteUpload.h index 307d592b..e353f421 100644 --- a/logic/net/PasteUpload.h +++ b/logic/net/PasteUpload.h @@ -1,5 +1,5 @@ #pragma once -#include "logic/tasks/Task.h" +#include "tasks/Task.h" #include #include #include diff --git a/logic/news/NewsChecker.h b/logic/news/NewsChecker.h index d4855208..3a0f9ec8 100644 --- a/logic/news/NewsChecker.h +++ b/logic/news/NewsChecker.h @@ -19,7 +19,7 @@ #include #include -#include +#include #include "NewsEntry.h" diff --git a/logic/notifications/NotificationChecker.cpp b/logic/notifications/NotificationChecker.cpp index 77721770..4e35cacc 100644 --- a/logic/notifications/NotificationChecker.cpp +++ b/logic/notifications/NotificationChecker.cpp @@ -5,8 +5,8 @@ #include #include -#include "logic/Env.h" -#include "logic/net/CacheDownload.h" +#include "Env.h" +#include "net/CacheDownload.h" NotificationChecker::NotificationChecker(QObject *parent) diff --git a/logic/notifications/NotificationChecker.h b/logic/notifications/NotificationChecker.h index a3e615db..92bc23dc 100644 --- a/logic/notifications/NotificationChecker.h +++ b/logic/notifications/NotificationChecker.h @@ -2,8 +2,8 @@ #include -#include "logic/net/NetJob.h" -#include "logic/net/CacheDownload.h" +#include "net/NetJob.h" +#include "net/CacheDownload.h" class NotificationChecker : public QObject { diff --git a/logic/screenshots/ImgurAlbumCreation.cpp b/logic/screenshots/ImgurAlbumCreation.cpp index f7cc2971..f332c220 100644 --- a/logic/screenshots/ImgurAlbumCreation.cpp +++ b/logic/screenshots/ImgurAlbumCreation.cpp @@ -6,8 +6,8 @@ #include #include -#include "logic/net/URLConstants.h" -#include "logic/Env.h" +#include "net/URLConstants.h" +#include "Env.h" #include ImgurAlbumCreation::ImgurAlbumCreation(QList screenshots) : NetAction(), m_screenshots(screenshots) diff --git a/logic/screenshots/ImgurAlbumCreation.h b/logic/screenshots/ImgurAlbumCreation.h index 6e8fbe94..f4adf6f2 100644 --- a/logic/screenshots/ImgurAlbumCreation.h +++ b/logic/screenshots/ImgurAlbumCreation.h @@ -1,5 +1,5 @@ #pragma once -#include "logic/net/NetAction.h" +#include "net/NetAction.h" #include "Screenshot.h" typedef std::shared_ptr ImgurAlbumCreationPtr; diff --git a/logic/screenshots/ImgurUpload.cpp b/logic/screenshots/ImgurUpload.cpp index 4ae37dfa..053156b9 100644 --- a/logic/screenshots/ImgurUpload.cpp +++ b/logic/screenshots/ImgurUpload.cpp @@ -8,8 +8,8 @@ #include #include -#include "logic/net/URLConstants.h" -#include "logic/Env.h" +#include "net/URLConstants.h" +#include "Env.h" #include ImgurUpload::ImgurUpload(ScreenshotPtr shot) : NetAction(), m_shot(shot) diff --git a/logic/screenshots/ImgurUpload.h b/logic/screenshots/ImgurUpload.h index 1111a8d0..f569ac3e 100644 --- a/logic/screenshots/ImgurUpload.h +++ b/logic/screenshots/ImgurUpload.h @@ -1,5 +1,5 @@ #pragma once -#include "logic/net/NetAction.h" +#include "net/NetAction.h" #include "Screenshot.h" typedef std::shared_ptr ImgurUploadPtr; diff --git a/logic/settings/INIFile.cpp b/logic/settings/INIFile.cpp index cc35aa83..27534f12 100644 --- a/logic/settings/INIFile.cpp +++ b/logic/settings/INIFile.cpp @@ -13,7 +13,7 @@ * limitations under the License. */ -#include "logic/settings/INIFile.h" +#include "settings/INIFile.h" #include #include diff --git a/logic/settings/INISettingsObject.h b/logic/settings/INISettingsObject.h index a862135f..4d26ddf1 100644 --- a/logic/settings/INISettingsObject.h +++ b/logic/settings/INISettingsObject.h @@ -17,9 +17,9 @@ #include -#include "logic/settings/INIFile.h" +#include "settings/INIFile.h" -#include "logic/settings/SettingsObject.h" +#include "settings/SettingsObject.h" /*! * \brief A settings object that stores its settings in an INIFile. diff --git a/logic/settings/Setting.cpp b/logic/settings/Setting.cpp index c2cffd11..b17101a2 100644 --- a/logic/settings/Setting.cpp +++ b/logic/settings/Setting.cpp @@ -14,7 +14,7 @@ */ #include "Setting.h" -#include "logic/settings/SettingsObject.h" +#include "settings/SettingsObject.h" Setting::Setting(QStringList synonyms, QVariant defVal) : QObject(), m_synonyms(synonyms), m_defVal(defVal) diff --git a/logic/settings/SettingsObject.cpp b/logic/settings/SettingsObject.cpp index 280c07fa..e88eae49 100644 --- a/logic/settings/SettingsObject.cpp +++ b/logic/settings/SettingsObject.cpp @@ -13,9 +13,9 @@ * limitations under the License. */ -#include "logic/settings/SettingsObject.h" -#include "logic/settings/Setting.h" -#include "logic/settings/OverrideSetting.h" +#include "settings/SettingsObject.h" +#include "settings/Setting.h" +#include "settings/OverrideSetting.h" #include #include diff --git a/logic/status/StatusChecker.cpp b/logic/status/StatusChecker.cpp index 0e60db40..5e6cc612 100644 --- a/logic/status/StatusChecker.cpp +++ b/logic/status/StatusChecker.cpp @@ -15,10 +15,9 @@ #include "StatusChecker.h" -#include +#include #include -#include #include @@ -40,7 +39,7 @@ void StatusChecker::reloadStatus() // qDebug() << "Ignored request to reload status. Currently reloading already."; return; } - + // qDebug() << "Reloading status."; NetJob* job = new NetJob("Status JSON"); diff --git a/logic/status/StatusChecker.h b/logic/status/StatusChecker.h index 503d9f28..316066fe 100644 --- a/logic/status/StatusChecker.h +++ b/logic/status/StatusChecker.h @@ -19,7 +19,7 @@ #include #include -#include +#include class StatusChecker : public QObject { diff --git a/logic/tools/BaseExternalTool.cpp b/logic/tools/BaseExternalTool.cpp index 04edece8..d2931db7 100644 --- a/logic/tools/BaseExternalTool.cpp +++ b/logic/tools/BaseExternalTool.cpp @@ -8,11 +8,10 @@ #include #endif -#include "logic/BaseInstance.h" -#include "MultiMC.h" +#include "BaseInstance.h" -BaseExternalTool::BaseExternalTool(InstancePtr instance, QObject *parent) - : QObject(parent), m_instance(instance) +BaseExternalTool::BaseExternalTool(SettingsObjectPtr settings, InstancePtr instance, QObject *parent) + : QObject(parent), m_instance(instance), globalSettings(settings) { } @@ -30,8 +29,8 @@ qint64 BaseExternalTool::pid(QProcess *process) #endif } -BaseDetachedTool::BaseDetachedTool(InstancePtr instance, QObject *parent) - : BaseExternalTool(instance, parent) +BaseDetachedTool::BaseDetachedTool(SettingsObjectPtr settings, InstancePtr instance, QObject *parent) + : BaseExternalTool(settings, instance, parent) { } diff --git a/logic/tools/BaseExternalTool.h b/logic/tools/BaseExternalTool.h index 8b8b2790..3c0b23ed 100644 --- a/logic/tools/BaseExternalTool.h +++ b/logic/tools/BaseExternalTool.h @@ -1,7 +1,7 @@ #pragma once #include -#include +#include class BaseInstance; class SettingsObject; @@ -11,12 +11,12 @@ class BaseExternalTool : public QObject { Q_OBJECT public: - explicit BaseExternalTool(InstancePtr instance, QObject *parent = 0); + explicit BaseExternalTool(SettingsObjectPtr settings, InstancePtr instance, QObject *parent = 0); virtual ~BaseExternalTool(); protected: InstancePtr m_instance; - + SettingsObjectPtr globalSettings; qint64 pid(QProcess *process); }; @@ -24,7 +24,7 @@ class BaseDetachedTool : public BaseExternalTool { Q_OBJECT public: - explicit BaseDetachedTool(InstancePtr instance, QObject *parent = 0); + explicit BaseDetachedTool(SettingsObjectPtr settings, InstancePtr instance, QObject *parent = 0); public slots: @@ -41,12 +41,15 @@ public: virtual QString name() const = 0; - virtual void registerSettings(std::shared_ptr settings) = 0; + virtual void registerSettings(SettingsObjectPtr settings) = 0; virtual BaseExternalTool *createTool(InstancePtr instance, QObject *parent = 0) = 0; virtual bool check(QString *error) = 0; virtual bool check(const QString &path, QString *error) = 0; + +protected: + SettingsObjectPtr globalSettings; }; class BaseDetachedToolFactory : public BaseExternalToolFactory diff --git a/logic/tools/BaseProfiler.cpp b/logic/tools/BaseProfiler.cpp index d3c8d41e..2c9fed9b 100644 --- a/logic/tools/BaseProfiler.cpp +++ b/logic/tools/BaseProfiler.cpp @@ -2,8 +2,8 @@ #include -BaseProfiler::BaseProfiler(InstancePtr instance, QObject *parent) - : BaseExternalTool(instance, parent) +BaseProfiler::BaseProfiler(SettingsObjectPtr settings, InstancePtr instance, QObject *parent) + : BaseExternalTool(settings, instance, parent) { } diff --git a/logic/tools/BaseProfiler.h b/logic/tools/BaseProfiler.h index decaa5b8..56397489 100644 --- a/logic/tools/BaseProfiler.h +++ b/logic/tools/BaseProfiler.h @@ -11,7 +11,7 @@ class BaseProfiler : public BaseExternalTool { Q_OBJECT public: - explicit BaseProfiler(InstancePtr instance, QObject *parent = 0); + explicit BaseProfiler(SettingsObjectPtr settings, InstancePtr instance, QObject *parent = 0); public slots: diff --git a/logic/tools/JProfiler.cpp b/logic/tools/JProfiler.cpp index 7cdf0268..d53ec615 100644 --- a/logic/tools/JProfiler.cpp +++ b/logic/tools/JProfiler.cpp @@ -3,22 +3,23 @@ #include #include -#include "logic/settings/SettingsObject.h" -#include "logic/BaseProcess.h" -#include "logic/BaseInstance.h" -#include "MultiMC.h" +#include "settings/SettingsObject.h" +#include "BaseProcess.h" +#include "BaseInstance.h" -JProfiler::JProfiler(InstancePtr instance, QObject *parent) : BaseProfiler(instance, parent) +JProfiler::JProfiler(SettingsObjectPtr settings, InstancePtr instance, + QObject *parent) + : BaseProfiler(settings, instance, parent) { } void JProfiler::beginProfilingImpl(BaseProcess *process) { - int port = MMC->settings()->get("JProfilerPort").toInt(); + int port = globalSettings->get("JProfilerPort").toInt(); QProcess *profiler = new QProcess(this); profiler->setArguments(QStringList() << "-d" << QString::number(pid(process)) << "--gui" << "-p" << QString::number(port)); - profiler->setProgram(QDir(MMC->settings()->get("JProfilerPath").toString()) + profiler->setProgram(QDir(globalSettings->get("JProfilerPath").toString()) #ifdef Q_OS_WIN .absoluteFilePath("bin/jpenable.exe")); #else @@ -44,20 +45,21 @@ void JProfiler::beginProfilingImpl(BaseProcess *process) m_profilerProcess = profiler; } -void JProfilerFactory::registerSettings(std::shared_ptr settings) +void JProfilerFactory::registerSettings(SettingsObjectPtr settings) { settings->registerSetting("JProfilerPath"); settings->registerSetting("JProfilerPort", 42042); + globalSettings = settings; } BaseExternalTool *JProfilerFactory::createTool(InstancePtr instance, QObject *parent) { - return new JProfiler(instance, parent); + return new JProfiler(globalSettings, instance, parent); } bool JProfilerFactory::check(QString *error) { - return check(MMC->settings()->get("JProfilerPath").toString(), error); + return check(globalSettings->get("JProfilerPath").toString(), error); } bool JProfilerFactory::check(const QString &path, QString *error) diff --git a/logic/tools/JProfiler.h b/logic/tools/JProfiler.h index 0763a799..11df0779 100644 --- a/logic/tools/JProfiler.h +++ b/logic/tools/JProfiler.h @@ -6,7 +6,7 @@ class JProfiler : public BaseProfiler { Q_OBJECT public: - JProfiler(InstancePtr instance, QObject *parent = 0); + JProfiler(SettingsObjectPtr settings, InstancePtr instance, QObject *parent = 0); protected: void beginProfilingImpl(BaseProcess *process); @@ -16,7 +16,7 @@ class JProfilerFactory : public BaseProfilerFactory { public: QString name() const override { return "JProfiler"; } - void registerSettings(std::shared_ptr settings) override; + void registerSettings(SettingsObjectPtr settings) override; BaseExternalTool *createTool(InstancePtr instance, QObject *parent = 0) override; bool check(QString *error) override; bool check(const QString &path, QString *error) override; diff --git a/logic/tools/JVisualVM.cpp b/logic/tools/JVisualVM.cpp index 312be863..d258fde9 100644 --- a/logic/tools/JVisualVM.cpp +++ b/logic/tools/JVisualVM.cpp @@ -3,12 +3,12 @@ #include #include -#include "logic/settings/SettingsObject.h" -#include "logic/BaseProcess.h" -#include "logic/BaseInstance.h" -#include "MultiMC.h" +#include "settings/SettingsObject.h" +#include "BaseProcess.h" +#include "BaseInstance.h" -JVisualVM::JVisualVM(InstancePtr instance, QObject *parent) : BaseProfiler(instance, parent) +JVisualVM::JVisualVM(SettingsObjectPtr settings, InstancePtr instance, QObject *parent) + : BaseProfiler(settings, instance, parent) { } @@ -16,7 +16,7 @@ void JVisualVM::beginProfilingImpl(BaseProcess *process) { QProcess *profiler = new QProcess(this); profiler->setArguments(QStringList() << "--openpid" << QString::number(pid(process))); - profiler->setProgram(MMC->settings()->get("JVisualVMPath").toString()); + profiler->setProgram(globalSettings->get("JVisualVMPath").toString()); connect(profiler, &QProcess::started, [this]() { emit readyToLaunch(tr("JVisualVM started")); }); connect(profiler, @@ -37,7 +37,7 @@ void JVisualVM::beginProfilingImpl(BaseProcess *process) m_profilerProcess = profiler; } -void JVisualVMFactory::registerSettings(std::shared_ptr settings) +void JVisualVMFactory::registerSettings(SettingsObjectPtr settings) { QString defaultValue = QStandardPaths::findExecutable("jvisualvm"); if (defaultValue.isNull()) @@ -45,16 +45,17 @@ void JVisualVMFactory::registerSettings(std::shared_ptr settings defaultValue = QStandardPaths::findExecutable("visualvm"); } settings->registerSetting("JVisualVMPath", defaultValue); + globalSettings = settings; } BaseExternalTool *JVisualVMFactory::createTool(InstancePtr instance, QObject *parent) { - return new JVisualVM(instance, parent); + return new JVisualVM(globalSettings, instance, parent); } bool JVisualVMFactory::check(QString *error) { - return check(MMC->settings()->get("JVisualVMPath").toString(), error); + return check(globalSettings->get("JVisualVMPath").toString(), error); } bool JVisualVMFactory::check(const QString &path, QString *error) diff --git a/logic/tools/JVisualVM.h b/logic/tools/JVisualVM.h index 2a273568..f4ffe1bd 100644 --- a/logic/tools/JVisualVM.h +++ b/logic/tools/JVisualVM.h @@ -6,7 +6,7 @@ class JVisualVM : public BaseProfiler { Q_OBJECT public: - JVisualVM(InstancePtr instance, QObject *parent = 0); + JVisualVM(SettingsObjectPtr settings, InstancePtr instance, QObject *parent = 0); protected: void beginProfilingImpl(BaseProcess *process); @@ -16,7 +16,7 @@ class JVisualVMFactory : public BaseProfilerFactory { public: QString name() const override { return "JVisualVM"; } - void registerSettings(std::shared_ptr settings) override; + void registerSettings(SettingsObjectPtr settings) override; BaseExternalTool *createTool(InstancePtr instance, QObject *parent = 0) override; bool check(QString *error) override; bool check(const QString &path, QString *error) override; diff --git a/logic/tools/MCEditTool.cpp b/logic/tools/MCEditTool.cpp index c918d5d0..058eede8 100644 --- a/logic/tools/MCEditTool.cpp +++ b/logic/tools/MCEditTool.cpp @@ -6,14 +6,14 @@ #include // FIXME: mixing logic and UI!!!! #include +#include -#include "logic/settings/SettingsObject.h" -#include "logic/BaseInstance.h" -#include "logic/minecraft/MinecraftInstance.h" -#include "MultiMC.h" +#include "settings/SettingsObject.h" +#include "BaseInstance.h" +#include "minecraft/MinecraftInstance.h" -MCEditTool::MCEditTool(InstancePtr instance, QObject *parent) - : BaseDetachedTool(instance, parent) +MCEditTool::MCEditTool(SettingsObjectPtr settings, InstancePtr instance, QObject *parent) + : BaseDetachedTool(settings, instance, parent) { } @@ -37,8 +37,7 @@ QString MCEditTool::getSave() const } } bool ok = true; - const QString save = QInputDialog::getItem( - MMC->activeWindow(), tr("MCEdit"), tr("Choose which world to open:"), + const QString save = QInputDialog::getItem(QApplication::activeWindow(), tr("MCEdit"), tr("Choose which world to open:"), worlds, 0, false, &ok); if (ok) { @@ -49,7 +48,7 @@ QString MCEditTool::getSave() const void MCEditTool::runImpl() { - const QString mceditPath = MMC->settings()->get("MCEditPath").toString(); + const QString mceditPath = globalSettings->get("MCEditPath").toString(); const QString save = getSave(); if (save.isNull()) { @@ -80,17 +79,18 @@ void MCEditTool::runImpl() #endif } -void MCEditFactory::registerSettings(std::shared_ptr settings) +void MCEditFactory::registerSettings(SettingsObjectPtr settings) { settings->registerSetting("MCEditPath"); + globalSettings = settings; } BaseExternalTool *MCEditFactory::createTool(InstancePtr instance, QObject *parent) { - return new MCEditTool(instance, parent); + return new MCEditTool(globalSettings, instance, parent); } bool MCEditFactory::check(QString *error) { - return check(MMC->settings()->get("MCEditPath").toString(), error); + return check(globalSettings->get("MCEditPath").toString(), error); } bool MCEditFactory::check(const QString &path, QString *error) { diff --git a/logic/tools/MCEditTool.h b/logic/tools/MCEditTool.h index b5cfc64e..bd40f02d 100644 --- a/logic/tools/MCEditTool.h +++ b/logic/tools/MCEditTool.h @@ -6,7 +6,7 @@ class MCEditTool : public BaseDetachedTool { Q_OBJECT public: - explicit MCEditTool(InstancePtr instance, QObject *parent = 0); + explicit MCEditTool(SettingsObjectPtr settings, InstancePtr instance, QObject *parent = 0); protected: QString getSave() const; @@ -17,7 +17,7 @@ class MCEditFactory : public BaseDetachedToolFactory { public: QString name() const override { return "MCEdit"; } - void registerSettings(std::shared_ptr settings) override; + void registerSettings(SettingsObjectPtr settings) override; BaseExternalTool *createTool(InstancePtr instance, QObject *parent = 0) override; bool check(QString *error) override; bool check(const QString &path, QString *error) override; diff --git a/logic/trans/TranslationDownloader.cpp b/logic/trans/TranslationDownloader.cpp index e977b65c..ccc4d590 100644 --- a/logic/trans/TranslationDownloader.cpp +++ b/logic/trans/TranslationDownloader.cpp @@ -1,9 +1,8 @@ #include "TranslationDownloader.h" -#include "logic/net/NetJob.h" -#include "logic/net/ByteArrayDownload.h" -#include "logic/net/CacheDownload.h" -#include "logic/net/URLConstants.h" -#include "logic/Env.h" +#include "net/NetJob.h" +#include "net/CacheDownload.h" +#include "net/URLConstants.h" +#include "Env.h" #include TranslationDownloader::TranslationDownloader() diff --git a/logic/updater/DownloadTask.cpp b/logic/updater/DownloadTask.cpp index badbc0d0..65d894f9 100644 --- a/logic/updater/DownloadTask.cpp +++ b/logic/updater/DownloadTask.cpp @@ -15,9 +15,9 @@ #include "DownloadTask.h" -#include "logic/updater/UpdateChecker.h" +#include "updater/UpdateChecker.h" #include "GoUpdate.h" -#include "logic/net/NetJob.h" +#include "net/NetJob.h" #include "pathutils.h" #include diff --git a/logic/updater/DownloadTask.h b/logic/updater/DownloadTask.h index 2b8c6299..24e39415 100644 --- a/logic/updater/DownloadTask.h +++ b/logic/updater/DownloadTask.h @@ -15,8 +15,8 @@ #pragma once -#include "logic/tasks/Task.h" -#include "logic/net/NetJob.h" +#include "tasks/Task.h" +#include "net/NetJob.h" #include "GoUpdate.h" namespace GoUpdate diff --git a/logic/updater/GoUpdate.cpp b/logic/updater/GoUpdate.cpp index 84dc164c..21bef2c0 100644 --- a/logic/updater/GoUpdate.cpp +++ b/logic/updater/GoUpdate.cpp @@ -3,7 +3,7 @@ #include #include #include -#include +#include namespace GoUpdate { diff --git a/logic/updater/GoUpdate.h b/logic/updater/GoUpdate.h index bea6cce7..c58fd1eb 100644 --- a/logic/updater/GoUpdate.h +++ b/logic/updater/GoUpdate.h @@ -1,6 +1,6 @@ #pragma once #include -#include +#include namespace GoUpdate { diff --git a/logic/updater/UpdateChecker.h b/logic/updater/UpdateChecker.h index 0eaceea0..760245cd 100644 --- a/logic/updater/UpdateChecker.h +++ b/logic/updater/UpdateChecker.h @@ -15,7 +15,7 @@ #pragma once -#include "logic/net/NetJob.h" +#include "net/NetJob.h" #include "GoUpdate.h" #include diff --git a/main.cpp b/main.cpp deleted file mode 100644 index 56ffa8a1..00000000 --- a/main.cpp +++ /dev/null @@ -1,43 +0,0 @@ -#include "MultiMC.h" -#include "gui/MainWindow.h" - -int main_gui(MultiMC &app) -{ - // show main window - app.setIconTheme(MMC->settings()->get("IconTheme").toString()); - MainWindow mainWin; - mainWin.restoreState(QByteArray::fromBase64(MMC->settings()->get("MainWindowState").toByteArray())); - mainWin.restoreGeometry(QByteArray::fromBase64(MMC->settings()->get("MainWindowGeometry").toByteArray())); - mainWin.show(); - mainWin.checkSetDefaultJava(); - mainWin.checkInstancePathForProblems(); - return app.exec(); -} - -int main(int argc, char *argv[]) -{ - // initialize Qt - MultiMC app(argc, argv); - - Q_INIT_RESOURCE(instances); - Q_INIT_RESOURCE(multimc); - Q_INIT_RESOURCE(backgrounds); - Q_INIT_RESOURCE(versions); - - Q_INIT_RESOURCE(pe_dark); - Q_INIT_RESOURCE(pe_light); - Q_INIT_RESOURCE(pe_blue); - Q_INIT_RESOURCE(pe_colored); - Q_INIT_RESOURCE(OSX); - Q_INIT_RESOURCE(iOS); - - switch (app.status()) - { - case MultiMC::Initialized: - return main_gui(app); - case MultiMC::Failed: - return 1; - case MultiMC::Succeeded: - return 0; - } -} diff --git a/package/linux/MultiMC b/package/linux/MultiMC deleted file mode 100755 index 80225e53..00000000 --- a/package/linux/MultiMC +++ /dev/null @@ -1,80 +0,0 @@ -#!/bin/bash -# Basic start script for running MultiMC with the libs packaged with it. - -function printerror { - printf "$1" - if which zenity >/dev/null; then zenity --error --text="$1" &>/dev/null; - elif which kdialog >/dev/null; then kdialog --error "$1" &>/dev/null; - fi -} - -if [[ $EUID -eq 0 ]]; then - printerror "This program should not be run using sudo or as the root user!\n" - exit 1 -fi - - -MMC_DIR="$(dirname "$(readlink -f "$0")")" -echo "MultiMC Dir: ${MMC_DIR}" - -# Set up env -export LD_LIBRARY_PATH="${MMC_DIR}/bin":$LD_LIBRARY_PATH -export QT_PLUGIN_PATH="${MMC_DIR}/plugins" -export QT_FONTPATH="${MMC_DIR}/fonts" - -# Detect missing dependencies... -DEPS_LIST=`ldd "${MMC_DIR}"/plugins/*/*.so 2>/dev/null | grep "not found" | awk -vORS=", " '{ print $1 }'` -if [ "x$DEPS_LIST" = "x" ]; then - # We have all our dependencies. Run MultiMC. - echo "No missing dependencies found." - - # Just to be sure... - chmod +x "${MMC_DIR}/bin/MultiMC" - - # Run MultiMC - "${MMC_DIR}/bin/MultiMC" -d "${MMC_DIR}" $@ - - # Run MultiMC in valgrind - # valgrind --log-file="valgrind.log" --leak-check=full --track-origins=yes "${MMC_DIR}/bin/MultiMC" -d "${MMC_DIR}" $@ - - # Exit with MultiMC's exit code. - exit $? -else - # apt - if which apt-file &>/dev/null; then - LIBRARIES=`echo "$DEPS_LIST" | grep -oP "[^, ]*"` - COMMAND_LIBS=`for LIBRARY in $LIBRARIES; do apt-file -l search $LIBRARY; done` - COMMAND_LIBS=`echo "$COMMAND_LIBS" | awk -vORS=" " '{ print $1 }'` - INSTALL_CMD="sudo apt-get install $COMMAND_LIBS" - # pacman - elif which pkgfile &>/dev/null; then - LIBRARIES=`echo "$DEPS_LIST" | grep -oP "[^, ]*"` - COMMAND_LIBS=`for LIBRARY in $LIBRARIES; do pkgfile $LIBRARY; done` - COMMAND_LIBS=`echo "$COMMAND_LIBS" | awk -vORS=" " '{ print $1 }'` - INSTALL_CMD="sudo pacman -S $COMMAND_LIBS" - # yum - elif which yum &>/dev/null; then - LIBRARIES=`echo "$DEPS_LIST" | grep -oP "[^, ]*"` - COMMAND_LIBS=`for LIBRARY in $LIBRARIES; do yum whatprovides $LIBRARY; done` - COMMAND_LIBS=`echo "$COMMAND_LIBS" | awk -vORS=" " '{ print $1 }'` - INSTALL_CMD="sudo yum install $COMMAND_LIBS" - # zypper - elif which zypper &>/dev/null; then - LIBRARIES=`echo "$DEPS_LIST" | grep -oP "[^, ]*"` - COMMAND_LIBS=`for LIBRARY in $LIBRARIES; do zypper wp $LIBRARY; done` - COMMAND_LIBS=`echo "$COMMAND_LIBS" | awk -vORS=" " '{ print $1 }'` - INSTALL_CMD="sudo zypper install $COMMAND_LIBS" - # emerge - elif which pfl &>/dev/null; then - LIBRARIES=`echo "$DEPS_LIST" | grep -oP "[^, ]*"` - COMMAND_LIBS=`for LIBRARY in $LIBRARIES; do pfl $LIBRARY; done` - COMMAND_LIBS=`echo "$COMMAND_LIBS" | awk -vORS=" " '{ print $1 }'` - INSTALL_CMD="sudo emerge $COMMAND_LIBS" - fi - - MESSAGE="Error: MultiMC is missing the following libraries that it needs to work correctly:\n\t${DEPS_LIST}\nPlease install them from your distribution's package manager." - MESSAGE="$MESSAGE\n\nHint: $INSTALL_CMD\n" - - printerror "$MESSAGE" - exit 1 -fi diff --git a/resources/MultiMC.icns b/resources/MultiMC.icns deleted file mode 100644 index 05ce9207..00000000 Binary files a/resources/MultiMC.icns and /dev/null differ diff --git a/resources/MultiMC.ico b/resources/MultiMC.ico deleted file mode 100644 index 734af0fb..00000000 Binary files a/resources/MultiMC.ico and /dev/null differ diff --git a/resources/MultiMC.manifest b/resources/MultiMC.manifest deleted file mode 100644 index 3acf8f7f..00000000 --- a/resources/MultiMC.manifest +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - Custom Minecraft launcher for managing multiple installs. - - - - - - - - - - - \ No newline at end of file diff --git a/resources/OSX/OSX.qrc b/resources/OSX/OSX.qrc deleted file mode 100644 index 20c71eb8..00000000 --- a/resources/OSX/OSX.qrc +++ /dev/null @@ -1,35 +0,0 @@ - - - - index.theme - scalable/about.svg - scalable/accounts.svg - scalable/bug.svg - scalable/centralmods.svg - scalable/checkupdate.svg - scalable/copy.svg - scalable/coremods.svg - scalable/externaltools.svg - scalable/instance-settings.svg - scalable/jarmods.svg - scalable/java.svg - scalable/loadermods.svg - scalable/log.svg - scalable/minecraft.svg - scalable/multimc.svg - scalable/new.svg - scalable/news.svg - scalable/notes.svg - scalable/patreon.svg - scalable/proxy.svg - scalable/quickmods.svg - scalable/refresh.svg - scalable/resourcepacks.svg - scalable/screenshots.svg - scalable/settings.svg - scalable/status-bad.svg - scalable/status-good.svg - scalable/status-yellow.svg - scalable/viewfolder.svg - - diff --git a/resources/OSX/index.theme b/resources/OSX/index.theme deleted file mode 100644 index 7f90a32e..00000000 --- a/resources/OSX/index.theme +++ /dev/null @@ -1,11 +0,0 @@ -[Icon Theme] -Name=OSX -Comment=OSX theme by pexner -Inherits=multimc -Directories=scalable - -[scalable] -Size=48 -Type=Scalable -MinSize=16 -MaxSize=256 diff --git a/resources/OSX/scalable/about.svg b/resources/OSX/scalable/about.svg deleted file mode 100644 index eb87ccf1..00000000 --- a/resources/OSX/scalable/about.svg +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/resources/OSX/scalable/accounts.svg b/resources/OSX/scalable/accounts.svg deleted file mode 100644 index 163bcee0..00000000 --- a/resources/OSX/scalable/accounts.svg +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - diff --git a/resources/OSX/scalable/bug.svg b/resources/OSX/scalable/bug.svg deleted file mode 100644 index 00565bb6..00000000 --- a/resources/OSX/scalable/bug.svg +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - diff --git a/resources/OSX/scalable/centralmods.svg b/resources/OSX/scalable/centralmods.svg deleted file mode 100644 index 37b821e4..00000000 --- a/resources/OSX/scalable/centralmods.svg +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - diff --git a/resources/OSX/scalable/checkupdate.svg b/resources/OSX/scalable/checkupdate.svg deleted file mode 100644 index 30cec51f..00000000 --- a/resources/OSX/scalable/checkupdate.svg +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/resources/OSX/scalable/copy.svg b/resources/OSX/scalable/copy.svg deleted file mode 100644 index 7382d6e2..00000000 --- a/resources/OSX/scalable/copy.svg +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - diff --git a/resources/OSX/scalable/coremods.svg b/resources/OSX/scalable/coremods.svg deleted file mode 100644 index b0df6052..00000000 --- a/resources/OSX/scalable/coremods.svg +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/resources/OSX/scalable/externaltools.svg b/resources/OSX/scalable/externaltools.svg deleted file mode 100644 index a2b7488e..00000000 --- a/resources/OSX/scalable/externaltools.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - diff --git a/resources/OSX/scalable/instance-settings.svg b/resources/OSX/scalable/instance-settings.svg deleted file mode 100644 index 394877f8..00000000 --- a/resources/OSX/scalable/instance-settings.svg +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/resources/OSX/scalable/jarmods.svg b/resources/OSX/scalable/jarmods.svg deleted file mode 100644 index 213ec833..00000000 --- a/resources/OSX/scalable/jarmods.svg +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/OSX/scalable/java.svg b/resources/OSX/scalable/java.svg deleted file mode 100644 index e1aee159..00000000 --- a/resources/OSX/scalable/java.svg +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/OSX/scalable/loadermods.svg b/resources/OSX/scalable/loadermods.svg deleted file mode 100644 index 76951ebd..00000000 --- a/resources/OSX/scalable/loadermods.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - diff --git a/resources/OSX/scalable/log.svg b/resources/OSX/scalable/log.svg deleted file mode 100644 index 0ac45d54..00000000 --- a/resources/OSX/scalable/log.svg +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - diff --git a/resources/OSX/scalable/minecraft.svg b/resources/OSX/scalable/minecraft.svg deleted file mode 100644 index 86c915bc..00000000 --- a/resources/OSX/scalable/minecraft.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - diff --git a/resources/OSX/scalable/multimc.svg b/resources/OSX/scalable/multimc.svg deleted file mode 100644 index caad21b5..00000000 --- a/resources/OSX/scalable/multimc.svg +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - diff --git a/resources/OSX/scalable/new.svg b/resources/OSX/scalable/new.svg deleted file mode 100644 index 79ee87ba..00000000 --- a/resources/OSX/scalable/new.svg +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - diff --git a/resources/OSX/scalable/news.svg b/resources/OSX/scalable/news.svg deleted file mode 100644 index b8ce3cd1..00000000 --- a/resources/OSX/scalable/news.svg +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - diff --git a/resources/OSX/scalable/notes.svg b/resources/OSX/scalable/notes.svg deleted file mode 100644 index c2e95cfd..00000000 --- a/resources/OSX/scalable/notes.svg +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - diff --git a/resources/OSX/scalable/patreon.svg b/resources/OSX/scalable/patreon.svg deleted file mode 100644 index 4f0da3e5..00000000 --- a/resources/OSX/scalable/patreon.svg +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - diff --git a/resources/OSX/scalable/proxy.svg b/resources/OSX/scalable/proxy.svg deleted file mode 100644 index 99acaa2b..00000000 --- a/resources/OSX/scalable/proxy.svg +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - diff --git a/resources/OSX/scalable/quickmods.svg b/resources/OSX/scalable/quickmods.svg deleted file mode 100644 index e0aaad87..00000000 --- a/resources/OSX/scalable/quickmods.svg +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - diff --git a/resources/OSX/scalable/refresh.svg b/resources/OSX/scalable/refresh.svg deleted file mode 100644 index c97489c1..00000000 --- a/resources/OSX/scalable/refresh.svg +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - diff --git a/resources/OSX/scalable/resourcepacks.svg b/resources/OSX/scalable/resourcepacks.svg deleted file mode 100644 index c85d4e3c..00000000 --- a/resources/OSX/scalable/resourcepacks.svg +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - diff --git a/resources/OSX/scalable/screenshots.svg b/resources/OSX/scalable/screenshots.svg deleted file mode 100644 index 12df0c88..00000000 --- a/resources/OSX/scalable/screenshots.svg +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/resources/OSX/scalable/settings.svg b/resources/OSX/scalable/settings.svg deleted file mode 100644 index dcdd9f1c..00000000 --- a/resources/OSX/scalable/settings.svg +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - diff --git a/resources/OSX/scalable/status-bad.svg b/resources/OSX/scalable/status-bad.svg deleted file mode 100644 index add7a6f7..00000000 --- a/resources/OSX/scalable/status-bad.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - diff --git a/resources/OSX/scalable/status-good.svg b/resources/OSX/scalable/status-good.svg deleted file mode 100644 index f10da757..00000000 --- a/resources/OSX/scalable/status-good.svg +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - diff --git a/resources/OSX/scalable/status-yellow.svg b/resources/OSX/scalable/status-yellow.svg deleted file mode 100644 index fba697bc..00000000 --- a/resources/OSX/scalable/status-yellow.svg +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - diff --git a/resources/OSX/scalable/viewfolder.svg b/resources/OSX/scalable/viewfolder.svg deleted file mode 100644 index 682c72c7..00000000 --- a/resources/OSX/scalable/viewfolder.svg +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - diff --git a/resources/backgrounds/backgrounds.qrc b/resources/backgrounds/backgrounds.qrc deleted file mode 100644 index 55de139e..00000000 --- a/resources/backgrounds/backgrounds.qrc +++ /dev/null @@ -1,6 +0,0 @@ - - - - catbgrnd2.png - - diff --git a/resources/backgrounds/catbgrnd2.png b/resources/backgrounds/catbgrnd2.png deleted file mode 100644 index 2b949e0b..00000000 Binary files a/resources/backgrounds/catbgrnd2.png and /dev/null differ diff --git a/resources/iOS/iOS.qrc b/resources/iOS/iOS.qrc deleted file mode 100644 index eb625d0b..00000000 --- a/resources/iOS/iOS.qrc +++ /dev/null @@ -1,35 +0,0 @@ - - - - index.theme - scalable/about.svg - scalable/accounts.svg - scalable/bug.svg - scalable/centralmods.svg - scalable/checkupdate.svg - scalable/copy.svg - scalable/coremods.svg - scalable/externaltools.svg - scalable/instance-settings.svg - scalable/jarmods.svg - scalable/java.svg - scalable/loadermods.svg - scalable/log.svg - scalable/minecraft.svg - scalable/multimc.svg - scalable/new.svg - scalable/news.svg - scalable/notes.svg - scalable/patreon.svg - scalable/proxy.svg - scalable/quickmods.svg - scalable/refresh.svg - scalable/resourcepacks.svg - scalable/screenshots.svg - scalable/settings.svg - scalable/status-bad.svg - scalable/status-good.svg - scalable/status-yellow.svg - scalable/viewfolder.svg - - diff --git a/resources/iOS/index.theme b/resources/iOS/index.theme deleted file mode 100644 index b0f2f6ba..00000000 --- a/resources/iOS/index.theme +++ /dev/null @@ -1,11 +0,0 @@ -[Icon Theme] -Name=iOS -Comment=iOS theme by pexner -Inherits=multimc -Directories=scalable - -[scalable] -Size=48 -Type=Scalable -MinSize=16 -MaxSize=256 diff --git a/resources/iOS/scalable/about.svg b/resources/iOS/scalable/about.svg deleted file mode 100644 index c4d35471..00000000 --- a/resources/iOS/scalable/about.svg +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - diff --git a/resources/iOS/scalable/accounts.svg b/resources/iOS/scalable/accounts.svg deleted file mode 100644 index 65f76c3f..00000000 --- a/resources/iOS/scalable/accounts.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - diff --git a/resources/iOS/scalable/bug.svg b/resources/iOS/scalable/bug.svg deleted file mode 100644 index fc4a3d69..00000000 --- a/resources/iOS/scalable/bug.svg +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - diff --git a/resources/iOS/scalable/centralmods.svg b/resources/iOS/scalable/centralmods.svg deleted file mode 100644 index 1b4c4741..00000000 --- a/resources/iOS/scalable/centralmods.svg +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - diff --git a/resources/iOS/scalable/checkupdate.svg b/resources/iOS/scalable/checkupdate.svg deleted file mode 100644 index 9fc983d1..00000000 --- a/resources/iOS/scalable/checkupdate.svg +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - diff --git a/resources/iOS/scalable/copy.svg b/resources/iOS/scalable/copy.svg deleted file mode 100644 index 3ccc2f06..00000000 --- a/resources/iOS/scalable/copy.svg +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - diff --git a/resources/iOS/scalable/coremods.svg b/resources/iOS/scalable/coremods.svg deleted file mode 100644 index ea47872c..00000000 --- a/resources/iOS/scalable/coremods.svg +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/resources/iOS/scalable/externaltools.svg b/resources/iOS/scalable/externaltools.svg deleted file mode 100644 index 16e9fa48..00000000 --- a/resources/iOS/scalable/externaltools.svg +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - diff --git a/resources/iOS/scalable/instance-settings.svg b/resources/iOS/scalable/instance-settings.svg deleted file mode 100644 index 95b8a508..00000000 --- a/resources/iOS/scalable/instance-settings.svg +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - diff --git a/resources/iOS/scalable/jarmods.svg b/resources/iOS/scalable/jarmods.svg deleted file mode 100644 index c4c5ca8c..00000000 --- a/resources/iOS/scalable/jarmods.svg +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/iOS/scalable/java.svg b/resources/iOS/scalable/java.svg deleted file mode 100644 index 8d7c2798..00000000 --- a/resources/iOS/scalable/java.svg +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/iOS/scalable/loadermods.svg b/resources/iOS/scalable/loadermods.svg deleted file mode 100644 index 010efa11..00000000 --- a/resources/iOS/scalable/loadermods.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - diff --git a/resources/iOS/scalable/log.svg b/resources/iOS/scalable/log.svg deleted file mode 100644 index 5d1c7f06..00000000 --- a/resources/iOS/scalable/log.svg +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - diff --git a/resources/iOS/scalable/minecraft.svg b/resources/iOS/scalable/minecraft.svg deleted file mode 100644 index 069b4e71..00000000 --- a/resources/iOS/scalable/minecraft.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - diff --git a/resources/iOS/scalable/multimc.svg b/resources/iOS/scalable/multimc.svg deleted file mode 100644 index bc819433..00000000 --- a/resources/iOS/scalable/multimc.svg +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - diff --git a/resources/iOS/scalable/new.svg b/resources/iOS/scalable/new.svg deleted file mode 100644 index 9f221580..00000000 --- a/resources/iOS/scalable/new.svg +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - diff --git a/resources/iOS/scalable/news.svg b/resources/iOS/scalable/news.svg deleted file mode 100644 index d3c010bb..00000000 --- a/resources/iOS/scalable/news.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - diff --git a/resources/iOS/scalable/notes.svg b/resources/iOS/scalable/notes.svg deleted file mode 100644 index b42ebeef..00000000 --- a/resources/iOS/scalable/notes.svg +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - diff --git a/resources/iOS/scalable/patreon.svg b/resources/iOS/scalable/patreon.svg deleted file mode 100644 index 1bd06f4a..00000000 --- a/resources/iOS/scalable/patreon.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - diff --git a/resources/iOS/scalable/proxy.svg b/resources/iOS/scalable/proxy.svg deleted file mode 100644 index f6552281..00000000 --- a/resources/iOS/scalable/proxy.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - diff --git a/resources/iOS/scalable/quickmods.svg b/resources/iOS/scalable/quickmods.svg deleted file mode 100644 index cd63ba71..00000000 --- a/resources/iOS/scalable/quickmods.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - diff --git a/resources/iOS/scalable/refresh.svg b/resources/iOS/scalable/refresh.svg deleted file mode 100644 index 297b79c9..00000000 --- a/resources/iOS/scalable/refresh.svg +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - diff --git a/resources/iOS/scalable/resourcepacks.svg b/resources/iOS/scalable/resourcepacks.svg deleted file mode 100644 index 5b359d63..00000000 --- a/resources/iOS/scalable/resourcepacks.svg +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - diff --git a/resources/iOS/scalable/screenshots.svg b/resources/iOS/scalable/screenshots.svg deleted file mode 100644 index 39ce7b82..00000000 --- a/resources/iOS/scalable/screenshots.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - diff --git a/resources/iOS/scalable/settings.svg b/resources/iOS/scalable/settings.svg deleted file mode 100644 index 95b8a508..00000000 --- a/resources/iOS/scalable/settings.svg +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - diff --git a/resources/iOS/scalable/status-bad.svg b/resources/iOS/scalable/status-bad.svg deleted file mode 100644 index 4019c8da..00000000 --- a/resources/iOS/scalable/status-bad.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - diff --git a/resources/iOS/scalable/status-good.svg b/resources/iOS/scalable/status-good.svg deleted file mode 100644 index e1859113..00000000 --- a/resources/iOS/scalable/status-good.svg +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - diff --git a/resources/iOS/scalable/status-yellow.svg b/resources/iOS/scalable/status-yellow.svg deleted file mode 100644 index d8a28e23..00000000 --- a/resources/iOS/scalable/status-yellow.svg +++ /dev/null @@ -1,56 +0,0 @@ - - - -image/svg+xml \ No newline at end of file diff --git a/resources/iOS/scalable/viewfolder.svg b/resources/iOS/scalable/viewfolder.svg deleted file mode 100644 index 0ae0c0b5..00000000 --- a/resources/iOS/scalable/viewfolder.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - diff --git a/resources/instances/brick.png b/resources/instances/brick.png deleted file mode 100644 index 0b534366..00000000 Binary files a/resources/instances/brick.png and /dev/null differ diff --git a/resources/instances/broken.png b/resources/instances/broken.png deleted file mode 100644 index 7a80a76e..00000000 Binary files a/resources/instances/broken.png and /dev/null differ diff --git a/resources/instances/chicken.png b/resources/instances/chicken.png deleted file mode 100644 index f870467a..00000000 Binary files a/resources/instances/chicken.png and /dev/null differ diff --git a/resources/instances/chicken128.png b/resources/instances/chicken128.png deleted file mode 100644 index 71f6dedc..00000000 Binary files a/resources/instances/chicken128.png and /dev/null differ diff --git a/resources/instances/creeper.png b/resources/instances/creeper.png deleted file mode 100644 index a67ecfc3..00000000 Binary files a/resources/instances/creeper.png and /dev/null differ diff --git a/resources/instances/creeper128.png b/resources/instances/creeper128.png deleted file mode 100644 index 41b7d07d..00000000 Binary files a/resources/instances/creeper128.png and /dev/null differ diff --git a/resources/instances/derp.png b/resources/instances/derp.png deleted file mode 100644 index 4c361942..00000000 Binary files a/resources/instances/derp.png and /dev/null differ diff --git a/resources/instances/diamond.png b/resources/instances/diamond.png deleted file mode 100644 index 376ab901..00000000 Binary files a/resources/instances/diamond.png and /dev/null differ diff --git a/resources/instances/dirt.png b/resources/instances/dirt.png deleted file mode 100644 index 9e19eb8f..00000000 Binary files a/resources/instances/dirt.png and /dev/null differ diff --git a/resources/instances/enderman.png b/resources/instances/enderman.png deleted file mode 100644 index 9f3a72b3..00000000 Binary files a/resources/instances/enderman.png and /dev/null differ diff --git a/resources/instances/enderpearl.png b/resources/instances/enderpearl.png deleted file mode 100644 index a818eb8e..00000000 Binary files a/resources/instances/enderpearl.png and /dev/null differ diff --git a/resources/instances/enderpearl128.png b/resources/instances/enderpearl128.png deleted file mode 100644 index 0a5bf91a..00000000 Binary files a/resources/instances/enderpearl128.png and /dev/null differ diff --git a/resources/instances/ftb_glow.png b/resources/instances/ftb_glow.png deleted file mode 100644 index c4e6fd5d..00000000 Binary files a/resources/instances/ftb_glow.png and /dev/null differ diff --git a/resources/instances/ftb_glow128.png b/resources/instances/ftb_glow128.png deleted file mode 100644 index 86632b21..00000000 Binary files a/resources/instances/ftb_glow128.png and /dev/null differ diff --git a/resources/instances/ftb_logo.png b/resources/instances/ftb_logo.png deleted file mode 100644 index 20df7171..00000000 Binary files a/resources/instances/ftb_logo.png and /dev/null differ diff --git a/resources/instances/ftb_logo128.png b/resources/instances/ftb_logo128.png deleted file mode 100644 index e725b7fe..00000000 Binary files a/resources/instances/ftb_logo128.png and /dev/null differ diff --git a/resources/instances/gear.png b/resources/instances/gear.png deleted file mode 100644 index da9ba2f9..00000000 Binary files a/resources/instances/gear.png and /dev/null differ diff --git a/resources/instances/gear128.png b/resources/instances/gear128.png deleted file mode 100644 index 75c68a66..00000000 Binary files a/resources/instances/gear128.png and /dev/null differ diff --git a/resources/instances/gold.png b/resources/instances/gold.png deleted file mode 100644 index 9bedda16..00000000 Binary files a/resources/instances/gold.png and /dev/null differ diff --git a/resources/instances/grass.png b/resources/instances/grass.png deleted file mode 100644 index f1694547..00000000 Binary files a/resources/instances/grass.png and /dev/null differ diff --git a/resources/instances/herobrine.png b/resources/instances/herobrine.png deleted file mode 100644 index e5460da3..00000000 Binary files a/resources/instances/herobrine.png and /dev/null differ diff --git a/resources/instances/herobrine128.png b/resources/instances/herobrine128.png deleted file mode 100644 index 13f1494c..00000000 Binary files a/resources/instances/herobrine128.png and /dev/null differ diff --git a/resources/instances/infinity.png b/resources/instances/infinity.png deleted file mode 100644 index bd94a3dc..00000000 Binary files a/resources/instances/infinity.png and /dev/null differ diff --git a/resources/instances/infinity128.png b/resources/instances/infinity128.png deleted file mode 100644 index 226847fb..00000000 Binary files a/resources/instances/infinity128.png and /dev/null differ diff --git a/resources/instances/instances.qrc b/resources/instances/instances.qrc deleted file mode 100644 index 09ae25d0..00000000 --- a/resources/instances/instances.qrc +++ /dev/null @@ -1,49 +0,0 @@ - - - - - brick.png - diamond.png - dirt.png - gold.png - grass.png - stone.png - tnt.png - iron.png - planks.png - - - derp.png - enderman.png - - - chicken128.png - creeper128.png - enderpearl128.png - ftb_glow128.png - ftb_logo128.png - gear128.png - herobrine128.png - infinity128.png - magitech128.png - meat128.png - netherstar128.png - skeleton128.png - squarecreeper128.png - steve128.png - - - - enderman.png - herobrine.png - derp.png - - - updateavailable.png - - - kitten.png - - broken.png - - diff --git a/resources/instances/iron.png b/resources/instances/iron.png deleted file mode 100644 index 28960782..00000000 Binary files a/resources/instances/iron.png and /dev/null differ diff --git a/resources/instances/kitten.png b/resources/instances/kitten.png deleted file mode 100644 index d17661ce..00000000 Binary files a/resources/instances/kitten.png and /dev/null differ diff --git a/resources/instances/magitech.png b/resources/instances/magitech.png deleted file mode 100644 index 6fd8ff60..00000000 Binary files a/resources/instances/magitech.png and /dev/null differ diff --git a/resources/instances/magitech128.png b/resources/instances/magitech128.png deleted file mode 100644 index 0f81a199..00000000 Binary files a/resources/instances/magitech128.png and /dev/null differ diff --git a/resources/instances/meat.png b/resources/instances/meat.png deleted file mode 100644 index 6694859d..00000000 Binary files a/resources/instances/meat.png and /dev/null differ diff --git a/resources/instances/meat128.png b/resources/instances/meat128.png deleted file mode 100644 index fefc9bf1..00000000 Binary files a/resources/instances/meat128.png and /dev/null differ diff --git a/resources/instances/netherstar.png b/resources/instances/netherstar.png deleted file mode 100644 index 43cb5113..00000000 Binary files a/resources/instances/netherstar.png and /dev/null differ diff --git a/resources/instances/netherstar128.png b/resources/instances/netherstar128.png deleted file mode 100644 index 132085f0..00000000 Binary files a/resources/instances/netherstar128.png and /dev/null differ diff --git a/resources/instances/planks.png b/resources/instances/planks.png deleted file mode 100644 index 7fcf8467..00000000 Binary files a/resources/instances/planks.png and /dev/null differ diff --git a/resources/instances/skeleton.png b/resources/instances/skeleton.png deleted file mode 100644 index 0c8d3505..00000000 Binary files a/resources/instances/skeleton.png and /dev/null differ diff --git a/resources/instances/skeleton128.png b/resources/instances/skeleton128.png deleted file mode 100644 index 55fcf5a9..00000000 Binary files a/resources/instances/skeleton128.png and /dev/null differ diff --git a/resources/instances/squarecreeper.png b/resources/instances/squarecreeper.png deleted file mode 100644 index b78c4ae0..00000000 Binary files a/resources/instances/squarecreeper.png and /dev/null differ diff --git a/resources/instances/squarecreeper128.png b/resources/instances/squarecreeper128.png deleted file mode 100644 index c82d8406..00000000 Binary files a/resources/instances/squarecreeper128.png and /dev/null differ diff --git a/resources/instances/steve.png b/resources/instances/steve.png deleted file mode 100644 index 07c6acde..00000000 Binary files a/resources/instances/steve.png and /dev/null differ diff --git a/resources/instances/steve128.png b/resources/instances/steve128.png deleted file mode 100644 index a07cbd2f..00000000 Binary files a/resources/instances/steve128.png and /dev/null differ diff --git a/resources/instances/stone.png b/resources/instances/stone.png deleted file mode 100644 index 34f9a751..00000000 Binary files a/resources/instances/stone.png and /dev/null differ diff --git a/resources/instances/tnt.png b/resources/instances/tnt.png deleted file mode 100644 index e40d404d..00000000 Binary files a/resources/instances/tnt.png and /dev/null differ diff --git a/resources/instances/updateavailable.png b/resources/instances/updateavailable.png deleted file mode 100644 index 754005f9..00000000 Binary files a/resources/instances/updateavailable.png and /dev/null differ diff --git a/resources/multimc.rc b/resources/multimc.rc deleted file mode 100644 index e7340f2a..00000000 --- a/resources/multimc.rc +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include - -IDI_ICON1 ICON DISCARDABLE "MultiMC.ico" -1 RT_MANIFEST "MultiMC.manifest" - -VS_VERSION_INFO VERSIONINFO -FILEVERSION 1,0,0,0 -FILEOS VOS_NT_WINDOWS32 -FILETYPE VFT_APP -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "000004b0" - BEGIN - VALUE "CompanyName", "MultiMC Contributors" - VALUE "FileDescription", "MultiMC Launcher" - VALUE "FileVersion", "1.0.0.0" - VALUE "ProductName", "MultiMC" - VALUE "ProductVersion", "5" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x0000, 0x04b0 // Unicode - END -END diff --git a/resources/multimc/16x16/about.png b/resources/multimc/16x16/about.png deleted file mode 100644 index a6a986e1..00000000 Binary files a/resources/multimc/16x16/about.png and /dev/null differ diff --git a/resources/multimc/16x16/bug.png b/resources/multimc/16x16/bug.png deleted file mode 100644 index 0c5b78b4..00000000 Binary files a/resources/multimc/16x16/bug.png and /dev/null differ diff --git a/resources/multimc/16x16/cat.png b/resources/multimc/16x16/cat.png deleted file mode 100644 index e6e31b44..00000000 Binary files a/resources/multimc/16x16/cat.png and /dev/null differ diff --git a/resources/multimc/16x16/centralmods.png b/resources/multimc/16x16/centralmods.png deleted file mode 100644 index c1b91c76..00000000 Binary files a/resources/multimc/16x16/centralmods.png and /dev/null differ diff --git a/resources/multimc/16x16/checkupdate.png b/resources/multimc/16x16/checkupdate.png deleted file mode 100644 index f3742058..00000000 Binary files a/resources/multimc/16x16/checkupdate.png and /dev/null differ diff --git a/resources/multimc/16x16/copy.png b/resources/multimc/16x16/copy.png deleted file mode 100644 index ccaed9e1..00000000 Binary files a/resources/multimc/16x16/copy.png and /dev/null differ diff --git a/resources/multimc/16x16/coremods.png b/resources/multimc/16x16/coremods.png deleted file mode 100644 index af0f1166..00000000 Binary files a/resources/multimc/16x16/coremods.png and /dev/null differ diff --git a/resources/multimc/16x16/help.png b/resources/multimc/16x16/help.png deleted file mode 100644 index e6edf6ba..00000000 Binary files a/resources/multimc/16x16/help.png and /dev/null differ diff --git a/resources/multimc/16x16/instance-settings.png b/resources/multimc/16x16/instance-settings.png deleted file mode 100644 index b916cd24..00000000 Binary files a/resources/multimc/16x16/instance-settings.png and /dev/null differ diff --git a/resources/multimc/16x16/jarmods.png b/resources/multimc/16x16/jarmods.png deleted file mode 100644 index 1a97c9c0..00000000 Binary files a/resources/multimc/16x16/jarmods.png and /dev/null differ diff --git a/resources/multimc/16x16/loadermods.png b/resources/multimc/16x16/loadermods.png deleted file mode 100644 index b5ab3fce..00000000 Binary files a/resources/multimc/16x16/loadermods.png and /dev/null differ diff --git a/resources/multimc/16x16/log.png b/resources/multimc/16x16/log.png deleted file mode 100644 index efa2a0b5..00000000 Binary files a/resources/multimc/16x16/log.png and /dev/null differ diff --git a/resources/multimc/16x16/minecraft.png b/resources/multimc/16x16/minecraft.png deleted file mode 100644 index e9f2f2a5..00000000 Binary files a/resources/multimc/16x16/minecraft.png and /dev/null differ diff --git a/resources/multimc/16x16/new.png b/resources/multimc/16x16/new.png deleted file mode 100644 index 2e56f589..00000000 Binary files a/resources/multimc/16x16/new.png and /dev/null differ diff --git a/resources/multimc/16x16/news.png b/resources/multimc/16x16/news.png deleted file mode 100644 index 872e85db..00000000 Binary files a/resources/multimc/16x16/news.png and /dev/null differ diff --git a/resources/multimc/16x16/noaccount.png b/resources/multimc/16x16/noaccount.png deleted file mode 100644 index b49bcf36..00000000 Binary files a/resources/multimc/16x16/noaccount.png and /dev/null differ diff --git a/resources/multimc/16x16/patreon.png b/resources/multimc/16x16/patreon.png deleted file mode 100644 index cde2b326..00000000 Binary files a/resources/multimc/16x16/patreon.png and /dev/null differ diff --git a/resources/multimc/16x16/refresh.png b/resources/multimc/16x16/refresh.png deleted file mode 100644 index 86b6f82c..00000000 Binary files a/resources/multimc/16x16/refresh.png and /dev/null differ diff --git a/resources/multimc/16x16/resourcepacks.png b/resources/multimc/16x16/resourcepacks.png deleted file mode 100644 index d862f5ca..00000000 Binary files a/resources/multimc/16x16/resourcepacks.png and /dev/null differ diff --git a/resources/multimc/16x16/screenshots.png b/resources/multimc/16x16/screenshots.png deleted file mode 100644 index 460000d4..00000000 Binary files a/resources/multimc/16x16/screenshots.png and /dev/null differ diff --git a/resources/multimc/16x16/settings.png b/resources/multimc/16x16/settings.png deleted file mode 100644 index b916cd24..00000000 Binary files a/resources/multimc/16x16/settings.png and /dev/null differ diff --git a/resources/multimc/16x16/status-bad.png b/resources/multimc/16x16/status-bad.png deleted file mode 100644 index 5b3f2051..00000000 Binary files a/resources/multimc/16x16/status-bad.png and /dev/null differ diff --git a/resources/multimc/16x16/status-good.png b/resources/multimc/16x16/status-good.png deleted file mode 100644 index 5cbdee81..00000000 Binary files a/resources/multimc/16x16/status-good.png and /dev/null differ diff --git a/resources/multimc/16x16/status-yellow.png b/resources/multimc/16x16/status-yellow.png deleted file mode 100644 index b25375d1..00000000 Binary files a/resources/multimc/16x16/status-yellow.png and /dev/null differ diff --git a/resources/multimc/16x16/viewfolder.png b/resources/multimc/16x16/viewfolder.png deleted file mode 100644 index 98b8a944..00000000 Binary files a/resources/multimc/16x16/viewfolder.png and /dev/null differ diff --git a/resources/multimc/22x22/about.png b/resources/multimc/22x22/about.png deleted file mode 100644 index 57775e25..00000000 Binary files a/resources/multimc/22x22/about.png and /dev/null differ diff --git a/resources/multimc/22x22/bug.png b/resources/multimc/22x22/bug.png deleted file mode 100644 index 90481bba..00000000 Binary files a/resources/multimc/22x22/bug.png and /dev/null differ diff --git a/resources/multimc/22x22/cat.png b/resources/multimc/22x22/cat.png deleted file mode 100644 index 3ea7ba69..00000000 Binary files a/resources/multimc/22x22/cat.png and /dev/null differ diff --git a/resources/multimc/22x22/centralmods.png b/resources/multimc/22x22/centralmods.png deleted file mode 100644 index a10f9a2b..00000000 Binary files a/resources/multimc/22x22/centralmods.png and /dev/null differ diff --git a/resources/multimc/22x22/checkupdate.png b/resources/multimc/22x22/checkupdate.png deleted file mode 100644 index badb200c..00000000 Binary files a/resources/multimc/22x22/checkupdate.png and /dev/null differ diff --git a/resources/multimc/22x22/copy.png b/resources/multimc/22x22/copy.png deleted file mode 100644 index ea236a24..00000000 Binary files a/resources/multimc/22x22/copy.png and /dev/null differ diff --git a/resources/multimc/22x22/help.png b/resources/multimc/22x22/help.png deleted file mode 100644 index da79b3e3..00000000 Binary files a/resources/multimc/22x22/help.png and /dev/null differ diff --git a/resources/multimc/22x22/instance-settings.png b/resources/multimc/22x22/instance-settings.png deleted file mode 100644 index daf56aad..00000000 Binary files a/resources/multimc/22x22/instance-settings.png and /dev/null differ diff --git a/resources/multimc/22x22/new.png b/resources/multimc/22x22/new.png deleted file mode 100644 index c707fbbf..00000000 Binary files a/resources/multimc/22x22/new.png and /dev/null differ diff --git a/resources/multimc/22x22/news.png b/resources/multimc/22x22/news.png deleted file mode 100644 index 1953bf7b..00000000 Binary files a/resources/multimc/22x22/news.png and /dev/null differ diff --git a/resources/multimc/22x22/patreon.png b/resources/multimc/22x22/patreon.png deleted file mode 100644 index b6235ad2..00000000 Binary files a/resources/multimc/22x22/patreon.png and /dev/null differ diff --git a/resources/multimc/22x22/refresh.png b/resources/multimc/22x22/refresh.png deleted file mode 100644 index 45b5535c..00000000 Binary files a/resources/multimc/22x22/refresh.png and /dev/null differ diff --git a/resources/multimc/22x22/screenshots.png b/resources/multimc/22x22/screenshots.png deleted file mode 100644 index 6fb42bbd..00000000 Binary files a/resources/multimc/22x22/screenshots.png and /dev/null differ diff --git a/resources/multimc/22x22/settings.png b/resources/multimc/22x22/settings.png deleted file mode 100644 index daf56aad..00000000 Binary files a/resources/multimc/22x22/settings.png and /dev/null differ diff --git a/resources/multimc/22x22/status-bad.png b/resources/multimc/22x22/status-bad.png deleted file mode 100644 index 2707539e..00000000 Binary files a/resources/multimc/22x22/status-bad.png and /dev/null differ diff --git a/resources/multimc/22x22/status-good.png b/resources/multimc/22x22/status-good.png deleted file mode 100644 index f55debc3..00000000 Binary files a/resources/multimc/22x22/status-good.png and /dev/null differ diff --git a/resources/multimc/22x22/status-yellow.png b/resources/multimc/22x22/status-yellow.png deleted file mode 100644 index 481eb7f3..00000000 Binary files a/resources/multimc/22x22/status-yellow.png and /dev/null differ diff --git a/resources/multimc/22x22/viewfolder.png b/resources/multimc/22x22/viewfolder.png deleted file mode 100644 index b645167f..00000000 Binary files a/resources/multimc/22x22/viewfolder.png and /dev/null differ diff --git a/resources/multimc/24x24/cat.png b/resources/multimc/24x24/cat.png deleted file mode 100644 index c93245f6..00000000 Binary files a/resources/multimc/24x24/cat.png and /dev/null differ diff --git a/resources/multimc/24x24/coremods.png b/resources/multimc/24x24/coremods.png deleted file mode 100644 index 90603d24..00000000 Binary files a/resources/multimc/24x24/coremods.png and /dev/null differ diff --git a/resources/multimc/24x24/jarmods.png b/resources/multimc/24x24/jarmods.png deleted file mode 100644 index 68cb8e9d..00000000 Binary files a/resources/multimc/24x24/jarmods.png and /dev/null differ diff --git a/resources/multimc/24x24/loadermods.png b/resources/multimc/24x24/loadermods.png deleted file mode 100644 index 250a6260..00000000 Binary files a/resources/multimc/24x24/loadermods.png and /dev/null differ diff --git a/resources/multimc/24x24/log.png b/resources/multimc/24x24/log.png deleted file mode 100644 index fe302053..00000000 Binary files a/resources/multimc/24x24/log.png and /dev/null differ diff --git a/resources/multimc/24x24/minecraft.png b/resources/multimc/24x24/minecraft.png deleted file mode 100644 index b31177c9..00000000 Binary files a/resources/multimc/24x24/minecraft.png and /dev/null differ diff --git a/resources/multimc/24x24/noaccount.png b/resources/multimc/24x24/noaccount.png deleted file mode 100644 index ac12437c..00000000 Binary files a/resources/multimc/24x24/noaccount.png and /dev/null differ diff --git a/resources/multimc/24x24/patreon.png b/resources/multimc/24x24/patreon.png deleted file mode 100644 index c1da080f..00000000 Binary files a/resources/multimc/24x24/patreon.png and /dev/null differ diff --git a/resources/multimc/24x24/resourcepacks.png b/resources/multimc/24x24/resourcepacks.png deleted file mode 100644 index 68359d39..00000000 Binary files a/resources/multimc/24x24/resourcepacks.png and /dev/null differ diff --git a/resources/multimc/24x24/status-bad.png b/resources/multimc/24x24/status-bad.png deleted file mode 100644 index d1547a47..00000000 Binary files a/resources/multimc/24x24/status-bad.png and /dev/null differ diff --git a/resources/multimc/24x24/status-good.png b/resources/multimc/24x24/status-good.png deleted file mode 100644 index 3545bc4c..00000000 Binary files a/resources/multimc/24x24/status-good.png and /dev/null differ diff --git a/resources/multimc/24x24/status-yellow.png b/resources/multimc/24x24/status-yellow.png deleted file mode 100644 index dd5fde67..00000000 Binary files a/resources/multimc/24x24/status-yellow.png and /dev/null differ diff --git a/resources/multimc/256x256/minecraft.png b/resources/multimc/256x256/minecraft.png deleted file mode 100644 index 77e3f03e..00000000 Binary files a/resources/multimc/256x256/minecraft.png and /dev/null differ diff --git a/resources/multimc/32x32/about.png b/resources/multimc/32x32/about.png deleted file mode 100644 index 5174c4f1..00000000 Binary files a/resources/multimc/32x32/about.png and /dev/null differ diff --git a/resources/multimc/32x32/bug.png b/resources/multimc/32x32/bug.png deleted file mode 100644 index ada46653..00000000 Binary files a/resources/multimc/32x32/bug.png and /dev/null differ diff --git a/resources/multimc/32x32/cat.png b/resources/multimc/32x32/cat.png deleted file mode 100644 index 78ff98e9..00000000 Binary files a/resources/multimc/32x32/cat.png and /dev/null differ diff --git a/resources/multimc/32x32/centralmods.png b/resources/multimc/32x32/centralmods.png deleted file mode 100644 index cd2b8208..00000000 Binary files a/resources/multimc/32x32/centralmods.png and /dev/null differ diff --git a/resources/multimc/32x32/checkupdate.png b/resources/multimc/32x32/checkupdate.png deleted file mode 100644 index 754005f9..00000000 Binary files a/resources/multimc/32x32/checkupdate.png and /dev/null differ diff --git a/resources/multimc/32x32/copy.png b/resources/multimc/32x32/copy.png deleted file mode 100644 index c137b0f1..00000000 Binary files a/resources/multimc/32x32/copy.png and /dev/null differ diff --git a/resources/multimc/32x32/coremods.png b/resources/multimc/32x32/coremods.png deleted file mode 100644 index 770d695e..00000000 Binary files a/resources/multimc/32x32/coremods.png and /dev/null differ diff --git a/resources/multimc/32x32/help.png b/resources/multimc/32x32/help.png deleted file mode 100644 index b3854278..00000000 Binary files a/resources/multimc/32x32/help.png and /dev/null differ diff --git a/resources/multimc/32x32/instance-settings.png b/resources/multimc/32x32/instance-settings.png deleted file mode 100644 index a9c0817c..00000000 Binary files a/resources/multimc/32x32/instance-settings.png and /dev/null differ diff --git a/resources/multimc/32x32/jarmods.png b/resources/multimc/32x32/jarmods.png deleted file mode 100644 index 5cda173a..00000000 Binary files a/resources/multimc/32x32/jarmods.png and /dev/null differ diff --git a/resources/multimc/32x32/loadermods.png b/resources/multimc/32x32/loadermods.png deleted file mode 100644 index c4ca12e2..00000000 Binary files a/resources/multimc/32x32/loadermods.png and /dev/null differ diff --git a/resources/multimc/32x32/log.png b/resources/multimc/32x32/log.png deleted file mode 100644 index d620da12..00000000 Binary files a/resources/multimc/32x32/log.png and /dev/null differ diff --git a/resources/multimc/32x32/minecraft.png b/resources/multimc/32x32/minecraft.png deleted file mode 100644 index 816bec98..00000000 Binary files a/resources/multimc/32x32/minecraft.png and /dev/null differ diff --git a/resources/multimc/32x32/new.png b/resources/multimc/32x32/new.png deleted file mode 100644 index a3555ba4..00000000 Binary files a/resources/multimc/32x32/new.png and /dev/null differ diff --git a/resources/multimc/32x32/news.png b/resources/multimc/32x32/news.png deleted file mode 100644 index c579fd44..00000000 Binary files a/resources/multimc/32x32/news.png and /dev/null differ diff --git a/resources/multimc/32x32/noaccount.png b/resources/multimc/32x32/noaccount.png deleted file mode 100644 index a73afc94..00000000 Binary files a/resources/multimc/32x32/noaccount.png and /dev/null differ diff --git a/resources/multimc/32x32/patreon.png b/resources/multimc/32x32/patreon.png deleted file mode 100644 index f5ae8a5e..00000000 Binary files a/resources/multimc/32x32/patreon.png and /dev/null differ diff --git a/resources/multimc/32x32/refresh.png b/resources/multimc/32x32/refresh.png deleted file mode 100644 index afa2a9d7..00000000 Binary files a/resources/multimc/32x32/refresh.png and /dev/null differ diff --git a/resources/multimc/32x32/resourcepacks.png b/resources/multimc/32x32/resourcepacks.png deleted file mode 100644 index c14759ef..00000000 Binary files a/resources/multimc/32x32/resourcepacks.png and /dev/null differ diff --git a/resources/multimc/32x32/screenshots.png b/resources/multimc/32x32/screenshots.png deleted file mode 100644 index 4fcd6224..00000000 Binary files a/resources/multimc/32x32/screenshots.png and /dev/null differ diff --git a/resources/multimc/32x32/settings.png b/resources/multimc/32x32/settings.png deleted file mode 100644 index a9c0817c..00000000 Binary files a/resources/multimc/32x32/settings.png and /dev/null differ diff --git a/resources/multimc/32x32/status-bad.png b/resources/multimc/32x32/status-bad.png deleted file mode 100644 index 8c2c9d4f..00000000 Binary files a/resources/multimc/32x32/status-bad.png and /dev/null differ diff --git a/resources/multimc/32x32/status-good.png b/resources/multimc/32x32/status-good.png deleted file mode 100644 index 1a805e68..00000000 Binary files a/resources/multimc/32x32/status-good.png and /dev/null differ diff --git a/resources/multimc/32x32/status-yellow.png b/resources/multimc/32x32/status-yellow.png deleted file mode 100644 index 42c68552..00000000 Binary files a/resources/multimc/32x32/status-yellow.png and /dev/null differ diff --git a/resources/multimc/32x32/viewfolder.png b/resources/multimc/32x32/viewfolder.png deleted file mode 100644 index 74ab8fa6..00000000 Binary files a/resources/multimc/32x32/viewfolder.png and /dev/null differ diff --git a/resources/multimc/48x48/about.png b/resources/multimc/48x48/about.png deleted file mode 100644 index b4ac71b8..00000000 Binary files a/resources/multimc/48x48/about.png and /dev/null differ diff --git a/resources/multimc/48x48/bug.png b/resources/multimc/48x48/bug.png deleted file mode 100644 index 298f9397..00000000 Binary files a/resources/multimc/48x48/bug.png and /dev/null differ diff --git a/resources/multimc/48x48/cat.png b/resources/multimc/48x48/cat.png deleted file mode 100644 index 25912a3c..00000000 Binary files a/resources/multimc/48x48/cat.png and /dev/null differ diff --git a/resources/multimc/48x48/centralmods.png b/resources/multimc/48x48/centralmods.png deleted file mode 100644 index d927e39b..00000000 Binary files a/resources/multimc/48x48/centralmods.png and /dev/null differ diff --git a/resources/multimc/48x48/checkupdate.png b/resources/multimc/48x48/checkupdate.png deleted file mode 100644 index 2e2c7d6b..00000000 Binary files a/resources/multimc/48x48/checkupdate.png and /dev/null differ diff --git a/resources/multimc/48x48/copy.png b/resources/multimc/48x48/copy.png deleted file mode 100644 index ea40e34b..00000000 Binary files a/resources/multimc/48x48/copy.png and /dev/null differ diff --git a/resources/multimc/48x48/help.png b/resources/multimc/48x48/help.png deleted file mode 100644 index 82d828fa..00000000 Binary files a/resources/multimc/48x48/help.png and /dev/null differ diff --git a/resources/multimc/48x48/instance-settings.png b/resources/multimc/48x48/instance-settings.png deleted file mode 100644 index 6674eb23..00000000 Binary files a/resources/multimc/48x48/instance-settings.png and /dev/null differ diff --git a/resources/multimc/48x48/log.png b/resources/multimc/48x48/log.png deleted file mode 100644 index 45f60e6b..00000000 Binary files a/resources/multimc/48x48/log.png and /dev/null differ diff --git a/resources/multimc/48x48/minecraft.png b/resources/multimc/48x48/minecraft.png deleted file mode 100644 index 38fc9f6c..00000000 Binary files a/resources/multimc/48x48/minecraft.png and /dev/null differ diff --git a/resources/multimc/48x48/new.png b/resources/multimc/48x48/new.png deleted file mode 100644 index a81753b3..00000000 Binary files a/resources/multimc/48x48/new.png and /dev/null differ diff --git a/resources/multimc/48x48/news.png b/resources/multimc/48x48/news.png deleted file mode 100644 index 0f82d857..00000000 Binary files a/resources/multimc/48x48/news.png and /dev/null differ diff --git a/resources/multimc/48x48/noaccount.png b/resources/multimc/48x48/noaccount.png deleted file mode 100644 index 4703796c..00000000 Binary files a/resources/multimc/48x48/noaccount.png and /dev/null differ diff --git a/resources/multimc/48x48/patreon.png b/resources/multimc/48x48/patreon.png deleted file mode 100644 index 2708a85a..00000000 Binary files a/resources/multimc/48x48/patreon.png and /dev/null differ diff --git a/resources/multimc/48x48/refresh.png b/resources/multimc/48x48/refresh.png deleted file mode 100644 index 0b08b238..00000000 Binary files a/resources/multimc/48x48/refresh.png and /dev/null differ diff --git a/resources/multimc/48x48/screenshots.png b/resources/multimc/48x48/screenshots.png deleted file mode 100644 index 03c0059f..00000000 Binary files a/resources/multimc/48x48/screenshots.png and /dev/null differ diff --git a/resources/multimc/48x48/settings.png b/resources/multimc/48x48/settings.png deleted file mode 100644 index 6674eb23..00000000 Binary files a/resources/multimc/48x48/settings.png and /dev/null differ diff --git a/resources/multimc/48x48/status-bad.png b/resources/multimc/48x48/status-bad.png deleted file mode 100644 index 41c9cf22..00000000 Binary files a/resources/multimc/48x48/status-bad.png and /dev/null differ diff --git a/resources/multimc/48x48/status-good.png b/resources/multimc/48x48/status-good.png deleted file mode 100644 index df7cb59b..00000000 Binary files a/resources/multimc/48x48/status-good.png and /dev/null differ diff --git a/resources/multimc/48x48/status-yellow.png b/resources/multimc/48x48/status-yellow.png deleted file mode 100644 index 4f3b11d6..00000000 Binary files a/resources/multimc/48x48/status-yellow.png and /dev/null differ diff --git a/resources/multimc/48x48/viewfolder.png b/resources/multimc/48x48/viewfolder.png deleted file mode 100644 index 0492a736..00000000 Binary files a/resources/multimc/48x48/viewfolder.png and /dev/null differ diff --git a/resources/multimc/64x64/about.png b/resources/multimc/64x64/about.png deleted file mode 100644 index b83e9269..00000000 Binary files a/resources/multimc/64x64/about.png and /dev/null differ diff --git a/resources/multimc/64x64/bug.png b/resources/multimc/64x64/bug.png deleted file mode 100644 index 156b0315..00000000 Binary files a/resources/multimc/64x64/bug.png and /dev/null differ diff --git a/resources/multimc/64x64/cat.png b/resources/multimc/64x64/cat.png deleted file mode 100644 index 2cc21f80..00000000 Binary files a/resources/multimc/64x64/cat.png and /dev/null differ diff --git a/resources/multimc/64x64/centralmods.png b/resources/multimc/64x64/centralmods.png deleted file mode 100644 index 8831f437..00000000 Binary files a/resources/multimc/64x64/centralmods.png and /dev/null differ diff --git a/resources/multimc/64x64/checkupdate.png b/resources/multimc/64x64/checkupdate.png deleted file mode 100644 index dd1e29ac..00000000 Binary files a/resources/multimc/64x64/checkupdate.png and /dev/null differ diff --git a/resources/multimc/64x64/copy.png b/resources/multimc/64x64/copy.png deleted file mode 100644 index d12cf9c8..00000000 Binary files a/resources/multimc/64x64/copy.png and /dev/null differ diff --git a/resources/multimc/64x64/coremods.png b/resources/multimc/64x64/coremods.png deleted file mode 100644 index 668be334..00000000 Binary files a/resources/multimc/64x64/coremods.png and /dev/null differ diff --git a/resources/multimc/64x64/help.png b/resources/multimc/64x64/help.png deleted file mode 100644 index 0f3948c2..00000000 Binary files a/resources/multimc/64x64/help.png and /dev/null differ diff --git a/resources/multimc/64x64/instance-settings.png b/resources/multimc/64x64/instance-settings.png deleted file mode 100644 index e3ff58fa..00000000 Binary files a/resources/multimc/64x64/instance-settings.png and /dev/null differ diff --git a/resources/multimc/64x64/jarmods.png b/resources/multimc/64x64/jarmods.png deleted file mode 100644 index 55d1a42a..00000000 Binary files a/resources/multimc/64x64/jarmods.png and /dev/null differ diff --git a/resources/multimc/64x64/loadermods.png b/resources/multimc/64x64/loadermods.png deleted file mode 100644 index 24618fd0..00000000 Binary files a/resources/multimc/64x64/loadermods.png and /dev/null differ diff --git a/resources/multimc/64x64/log.png b/resources/multimc/64x64/log.png deleted file mode 100644 index 0f531cdf..00000000 Binary files a/resources/multimc/64x64/log.png and /dev/null differ diff --git a/resources/multimc/64x64/new.png b/resources/multimc/64x64/new.png deleted file mode 100644 index c3c6796c..00000000 Binary files a/resources/multimc/64x64/new.png and /dev/null differ diff --git a/resources/multimc/64x64/news.png b/resources/multimc/64x64/news.png deleted file mode 100644 index e306eed3..00000000 Binary files a/resources/multimc/64x64/news.png and /dev/null differ diff --git a/resources/multimc/64x64/patreon.png b/resources/multimc/64x64/patreon.png deleted file mode 100644 index 7b4814ec..00000000 Binary files a/resources/multimc/64x64/patreon.png and /dev/null differ diff --git a/resources/multimc/64x64/refresh.png b/resources/multimc/64x64/refresh.png deleted file mode 100644 index 8373d819..00000000 Binary files a/resources/multimc/64x64/refresh.png and /dev/null differ diff --git a/resources/multimc/64x64/resourcepacks.png b/resources/multimc/64x64/resourcepacks.png deleted file mode 100644 index fb874e7d..00000000 Binary files a/resources/multimc/64x64/resourcepacks.png and /dev/null differ diff --git a/resources/multimc/64x64/screenshots.png b/resources/multimc/64x64/screenshots.png deleted file mode 100644 index af18e39c..00000000 Binary files a/resources/multimc/64x64/screenshots.png and /dev/null differ diff --git a/resources/multimc/64x64/settings.png b/resources/multimc/64x64/settings.png deleted file mode 100644 index e3ff58fa..00000000 Binary files a/resources/multimc/64x64/settings.png and /dev/null differ diff --git a/resources/multimc/64x64/status-bad.png b/resources/multimc/64x64/status-bad.png deleted file mode 100644 index 64060ba0..00000000 Binary files a/resources/multimc/64x64/status-bad.png and /dev/null differ diff --git a/resources/multimc/64x64/status-good.png b/resources/multimc/64x64/status-good.png deleted file mode 100644 index e862ddcd..00000000 Binary files a/resources/multimc/64x64/status-good.png and /dev/null differ diff --git a/resources/multimc/64x64/status-yellow.png b/resources/multimc/64x64/status-yellow.png deleted file mode 100644 index 3d54d320..00000000 Binary files a/resources/multimc/64x64/status-yellow.png and /dev/null differ diff --git a/resources/multimc/64x64/viewfolder.png b/resources/multimc/64x64/viewfolder.png deleted file mode 100644 index 7d531f9c..00000000 Binary files a/resources/multimc/64x64/viewfolder.png and /dev/null differ diff --git a/resources/multimc/8x8/noaccount.png b/resources/multimc/8x8/noaccount.png deleted file mode 100644 index 466e4c07..00000000 Binary files a/resources/multimc/8x8/noaccount.png and /dev/null differ diff --git a/resources/multimc/index.theme b/resources/multimc/index.theme deleted file mode 100644 index 5f7d3f3f..00000000 --- a/resources/multimc/index.theme +++ /dev/null @@ -1,42 +0,0 @@ -[Icon Theme] -Name=multimc -Comment=MultiMC Default Icons -Inherits=default -Directories=scalable/apps,8x8,16x16,22x22,24x24,32x32,48x48,scalable - -[scalable/apps] -Size=48 -Type=scalable -MinSize=1 -MaxSize=512 -Context=Applications - -[8x8] -Size=8 - -[16x16] -Size=16 - -[22x22] -Size=22 - -[24x24] -Size=24 - -[32x32] -Size=32 - -[48x48] -Size=48 - -[64x64] -Size=64 - -[256x256] -Size=256 - -[scalable] -Size=48 -Type=Scalable -MinSize=16 -MaxSize=256 diff --git a/resources/multimc/multimc.qrc b/resources/multimc/multimc.qrc deleted file mode 100644 index d02d0e0e..00000000 --- a/resources/multimc/multimc.qrc +++ /dev/null @@ -1,206 +0,0 @@ - - - - index.theme - - scalable/multimc.svg - - - scalable/console.svg - - - scalable/console_error.svg - - - scalable/proxy.svg - - - scalable/java.svg - - - 16x16/minecraft.png - 24x24/minecraft.png - 32x32/minecraft.png - 48x48/minecraft.png - 256x256/minecraft.png - - - 16x16/about.png - 22x22/about.png - 32x32/about.png - 48x48/about.png - 64x64/about.png - - - scalable/bug.svg - 16x16/bug.png - 22x22/bug.png - 32x32/bug.png - 48x48/bug.png - 64x64/bug.png - - - - 16x16/screenshots.png - 22x22/screenshots.png - 32x32/screenshots.png - 48x48/screenshots.png - 64x64/screenshots.png - scalable/screenshots.svg - - - 16x16/patreon.png - 22x22/patreon.png - 24x24/patreon.png - 32x32/patreon.png - 48x48/patreon.png - 64x64/patreon.png - - - 16x16/cat.png - 22x22/cat.png - 24x24/cat.png - 32x32/cat.png - 48x48/cat.png - 64x64/cat.png - - - scalable/centralmods.svg - 16x16/centralmods.png - 22x22/centralmods.png - 32x32/centralmods.png - 48x48/centralmods.png - 64x64/centralmods.png - - - scalable/checkupdate.svg - 16x16/checkupdate.png - 22x22/checkupdate.png - 32x32/checkupdate.png - 48x48/checkupdate.png - 64x64/checkupdate.png - - - 16x16/copy.png - 22x22/copy.png - 32x32/copy.png - 48x48/copy.png - 64x64/copy.png - - - 16x16/help.png - 22x22/help.png - 32x32/help.png - 48x48/help.png - 64x64/help.png - - - 16x16/new.png - 22x22/new.png - 32x32/new.png - 48x48/new.png - 64x64/new.png - - - scalable/news.svg - 16x16/news.png - 22x22/news.png - 32x32/news.png - 48x48/news.png - 64x64/news.png - - - 16x16/status-bad.png - 24x24/status-bad.png - 22x22/status-bad.png - 32x32/status-bad.png - 48x48/status-bad.png - 64x64/status-bad.png - - - 16x16/status-good.png - 24x24/status-good.png - 22x22/status-good.png - 32x32/status-good.png - 48x48/status-good.png - 64x64/status-good.png - - - 16x16/status-yellow.png - 24x24/status-yellow.png - 22x22/status-yellow.png - 32x32/status-yellow.png - 48x48/status-yellow.png - 64x64/status-yellow.png - - - 16x16/loadermods.png - 24x24/loadermods.png - 32x32/loadermods.png - 64x64/loadermods.png - - - 16x16/jarmods.png - 24x24/jarmods.png - 32x32/jarmods.png - 64x64/jarmods.png - - - 16x16/coremods.png - 24x24/coremods.png - 32x32/coremods.png - 64x64/coremods.png - - - 16x16/resourcepacks.png - 24x24/resourcepacks.png - 32x32/resourcepacks.png - 64x64/resourcepacks.png - - - 16x16/refresh.png - 22x22/refresh.png - 32x32/refresh.png - 48x48/refresh.png - 64x64/refresh.png - - - 16x16/settings.png - 22x22/settings.png - 32x32/settings.png - 48x48/settings.png - 64x64/settings.png - - - 16x16/instance-settings.png - 22x22/instance-settings.png - 32x32/instance-settings.png - 48x48/instance-settings.png - 64x64/instance-settings.png - - - scalable/viewfolder.svg - 16x16/viewfolder.png - 22x22/viewfolder.png - 32x32/viewfolder.png - 48x48/viewfolder.png - 64x64/viewfolder.png - - - 8x8/noaccount.png - 16x16/noaccount.png - 24x24/noaccount.png - 32x32/noaccount.png - 48x48/noaccount.png - - - 16x16/log.png - 24x24/log.png - 32x32/log.png - 48x48/log.png - 64x64/log.png - - - scalable/screenshot-placeholder.svg - - diff --git a/resources/multimc/scalable/bug.svg b/resources/multimc/scalable/bug.svg deleted file mode 100644 index 178e3c23..00000000 --- a/resources/multimc/scalable/bug.svg +++ /dev/null @@ -1,387 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/multimc/scalable/centralmods.svg b/resources/multimc/scalable/centralmods.svg deleted file mode 100644 index a8b123d0..00000000 --- a/resources/multimc/scalable/centralmods.svg +++ /dev/null @@ -1,346 +0,0 @@ - - - - - - - - - - unsorted - - - - - Open Clip Art Library, Source: Oxygen Icons, Source: Oxygen Icons, Source: Oxygen Icons, Source: Oxygen Icons - - - - - - - - - - - - - - image/svg+xml - - - en - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/multimc/scalable/checkupdate.svg b/resources/multimc/scalable/checkupdate.svg deleted file mode 100644 index fc09cb4c..00000000 --- a/resources/multimc/scalable/checkupdate.svg +++ /dev/null @@ -1,167 +0,0 @@ - - - - - - - - - - unsorted - - - - - Open Clip Art Library, Source: GNOME-Colors, Source: GNOME-Colors, Source: GNOME-Colors, Source: GNOME-Colors, Source: GNOME-Colors - - - - - - - - - - - - - - image/svg+xml - - - en - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/multimc/scalable/console.svg b/resources/multimc/scalable/console.svg deleted file mode 100644 index ec14ab68..00000000 --- a/resources/multimc/scalable/console.svg +++ /dev/null @@ -1,228 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - MC - - - diff --git a/resources/multimc/scalable/console_error.svg b/resources/multimc/scalable/console_error.svg deleted file mode 100644 index a71c6b35..00000000 --- a/resources/multimc/scalable/console_error.svg +++ /dev/null @@ -1,247 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - diff --git a/resources/multimc/scalable/java.svg b/resources/multimc/scalable/java.svg deleted file mode 100644 index fd15e5c6..00000000 --- a/resources/multimc/scalable/java.svg +++ /dev/null @@ -1,773 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/multimc/scalable/multimc.svg b/resources/multimc/scalable/multimc.svg deleted file mode 100644 index 178509ac..00000000 --- a/resources/multimc/scalable/multimc.svg +++ /dev/null @@ -1,1993 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/multimc/scalable/new.svg b/resources/multimc/scalable/new.svg deleted file mode 100644 index c9cff358..00000000 --- a/resources/multimc/scalable/new.svg +++ /dev/null @@ -1,127 +0,0 @@ - - - - - - New Document - - - - regular - plaintext - text - document - - - - - Source: GNOME Icon Theme, Source: GNOME Icon Theme, Source: GNOME Icon Theme, Source: GNOME Icon Theme, Source: GNOME Icon Theme - - - - - Jakub Steiner - - - - - Jakub Steiner - - - - image/svg+xml - - - en - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/multimc/scalable/news.svg b/resources/multimc/scalable/news.svg deleted file mode 100644 index 67a370df..00000000 --- a/resources/multimc/scalable/news.svg +++ /dev/null @@ -1,296 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce convallis mauris ullamcorper mauris viverra molestie. Donec ultricies faucibus laoreet. Donec convallis congue neque consequat vehicula. Morbi condimentum tempor nulla et rhoncus. Etiam auctor, augue eu pharetra congue, elit justo lacinia risus, non lacinia est justo sed erat. Ut risus urna, viverra id interdum in, molestie non sem. Morbi leo orci, gravida auctor tempor vel, varius et enim. Nulla sem enim, ultricies vel laoreet ac, semper vel mauris. Ut adipiscing sapien sed leo pretium id vulputate erat gravida. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Cras tempor leo sit amet velit molestie commodo eget tincidunt leo. Cras dictum metus non ante pulvinar pellentesque. Morbi id elit ullamcorper mi vulputate lobortis. Cras ac vehicula felis. Phasellus dictum, tellus at molestie pellentesque, purus purus. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce convallis mauris ullamcorper mauris viverra molestie. Donec ultricies faucibus laoreet. Donec convallis congue neque consequat vehicula. Morbi condimentum tempor nulla et rhoncus. Etiam auctor, augue eu pharetra congue, elit justo lacinia risus, non lacinia est justo sed erat. Ut risus urna, - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/multimc/scalable/proxy.svg b/resources/multimc/scalable/proxy.svg deleted file mode 100644 index 55ee6f93..00000000 --- a/resources/multimc/scalable/proxy.svg +++ /dev/null @@ -1,260 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/multimc/scalable/screenshot-placeholder.svg b/resources/multimc/scalable/screenshot-placeholder.svg deleted file mode 100644 index a7a2a3d6..00000000 --- a/resources/multimc/scalable/screenshot-placeholder.svg +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - diff --git a/resources/multimc/scalable/screenshots.svg b/resources/multimc/scalable/screenshots.svg deleted file mode 100644 index a3d4d8e2..00000000 --- a/resources/multimc/scalable/screenshots.svg +++ /dev/null @@ -1,1231 +0,0 @@ - - - - - Golden Picture Frame - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - Open Clip Art Library - - - Golden Picture Frame - 2012-05-24T10:08:07 - Golden picture frame, Landscape - http://openclipart.org/detail/170182/golden-picture-frame-by-tasper - - - tasper - - - - - clip art - clipart - frame - golden - landscape - photo - picture - - - - - edited by Paul Sherman - - - - - - - - - - - diff --git a/resources/multimc/scalable/status-bad.svg b/resources/multimc/scalable/status-bad.svg deleted file mode 100644 index 9f47307e..00000000 --- a/resources/multimc/scalable/status-bad.svg +++ /dev/null @@ -1,142 +0,0 @@ - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - diff --git a/resources/multimc/scalable/status-good.svg b/resources/multimc/scalable/status-good.svg deleted file mode 100644 index 0a35c80f..00000000 --- a/resources/multimc/scalable/status-good.svg +++ /dev/null @@ -1,201 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - diff --git a/resources/multimc/scalable/status-yellow.svg b/resources/multimc/scalable/status-yellow.svg deleted file mode 100644 index 140e6082..00000000 --- a/resources/multimc/scalable/status-yellow.svg +++ /dev/null @@ -1,155 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - diff --git a/resources/multimc/scalable/viewfolder.svg b/resources/multimc/scalable/viewfolder.svg deleted file mode 100644 index 4ba0ed0a..00000000 --- a/resources/multimc/scalable/viewfolder.svg +++ /dev/null @@ -1,122 +0,0 @@ - - - - - - - - - - unsorted - - - - - Open Clip Art Library, Source: Oxygen Icons, Source: Oxygen Icons, Source: Oxygen Icons, Source: Oxygen Icons - - - - - - - - - - - - - - image/svg+xml - - - en - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/pe_blue/index.theme b/resources/pe_blue/index.theme deleted file mode 100644 index c9e0d93a..00000000 --- a/resources/pe_blue/index.theme +++ /dev/null @@ -1,11 +0,0 @@ -[Icon Theme] -Name=pe_blue -Comment=Icons by pexner (blue) -Inherits=multimc -Directories=scalable - -[scalable] -Size=48 -Type=Scalable -MinSize=16 -MaxSize=256 diff --git a/resources/pe_blue/pe_blue.qrc b/resources/pe_blue/pe_blue.qrc deleted file mode 100644 index a4525d2e..00000000 --- a/resources/pe_blue/pe_blue.qrc +++ /dev/null @@ -1,35 +0,0 @@ - - - - index.theme - scalable/about.svg - scalable/accounts.svg - scalable/bug.svg - scalable/centralmods.svg - scalable/checkupdate.svg - scalable/copy.svg - scalable/coremods.svg - scalable/externaltools.svg - scalable/instance-settings.svg - scalable/jarmods.svg - scalable/java.svg - scalable/loadermods.svg - scalable/log.svg - scalable/minecraft.svg - scalable/multimc.svg - scalable/new.svg - scalable/news.svg - scalable/notes.svg - scalable/patreon.svg - scalable/proxy.svg - scalable/quickmods.svg - scalable/refresh.svg - scalable/resourcepacks.svg - scalable/screenshots.svg - scalable/settings.svg - scalable/status-bad.svg - scalable/status-good.svg - scalable/status-yellow.svg - scalable/viewfolder.svg - - diff --git a/resources/pe_blue/scalable/about.svg b/resources/pe_blue/scalable/about.svg deleted file mode 100644 index 56e7fc9b..00000000 --- a/resources/pe_blue/scalable/about.svg +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - diff --git a/resources/pe_blue/scalable/accounts.svg b/resources/pe_blue/scalable/accounts.svg deleted file mode 100644 index 77e3f45a..00000000 --- a/resources/pe_blue/scalable/accounts.svg +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/pe_blue/scalable/bug.svg b/resources/pe_blue/scalable/bug.svg deleted file mode 100644 index 75a19e29..00000000 --- a/resources/pe_blue/scalable/bug.svg +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/pe_blue/scalable/centralmods.svg b/resources/pe_blue/scalable/centralmods.svg deleted file mode 100644 index cda39b1f..00000000 --- a/resources/pe_blue/scalable/centralmods.svg +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/pe_blue/scalable/checkupdate.svg b/resources/pe_blue/scalable/checkupdate.svg deleted file mode 100644 index a7d9ee81..00000000 --- a/resources/pe_blue/scalable/checkupdate.svg +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/pe_blue/scalable/copy.svg b/resources/pe_blue/scalable/copy.svg deleted file mode 100644 index 7ce014ed..00000000 --- a/resources/pe_blue/scalable/copy.svg +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/pe_blue/scalable/coremods.svg b/resources/pe_blue/scalable/coremods.svg deleted file mode 100644 index 4cc030d0..00000000 --- a/resources/pe_blue/scalable/coremods.svg +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/pe_blue/scalable/externaltools.svg b/resources/pe_blue/scalable/externaltools.svg deleted file mode 100644 index 45b73496..00000000 --- a/resources/pe_blue/scalable/externaltools.svg +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/pe_blue/scalable/instance-settings.svg b/resources/pe_blue/scalable/instance-settings.svg deleted file mode 100644 index 43f0b2f2..00000000 --- a/resources/pe_blue/scalable/instance-settings.svg +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/pe_blue/scalable/jarmods.svg b/resources/pe_blue/scalable/jarmods.svg deleted file mode 100644 index bb75f4b1..00000000 --- a/resources/pe_blue/scalable/jarmods.svg +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - diff --git a/resources/pe_blue/scalable/java.svg b/resources/pe_blue/scalable/java.svg deleted file mode 100644 index 5e369203..00000000 --- a/resources/pe_blue/scalable/java.svg +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/pe_blue/scalable/loadermods.svg b/resources/pe_blue/scalable/loadermods.svg deleted file mode 100644 index a54dc211..00000000 --- a/resources/pe_blue/scalable/loadermods.svg +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/pe_blue/scalable/log.svg b/resources/pe_blue/scalable/log.svg deleted file mode 100644 index 89d373f4..00000000 --- a/resources/pe_blue/scalable/log.svg +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/pe_blue/scalable/minecraft.svg b/resources/pe_blue/scalable/minecraft.svg deleted file mode 100644 index 2fe6a028..00000000 --- a/resources/pe_blue/scalable/minecraft.svg +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/pe_blue/scalable/multimc.svg b/resources/pe_blue/scalable/multimc.svg deleted file mode 100644 index 820c0b53..00000000 --- a/resources/pe_blue/scalable/multimc.svg +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/pe_blue/scalable/new.svg b/resources/pe_blue/scalable/new.svg deleted file mode 100644 index dcc8579e..00000000 --- a/resources/pe_blue/scalable/new.svg +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/pe_blue/scalable/news.svg b/resources/pe_blue/scalable/news.svg deleted file mode 100644 index 3ca3be37..00000000 --- a/resources/pe_blue/scalable/news.svg +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - diff --git a/resources/pe_blue/scalable/notes.svg b/resources/pe_blue/scalable/notes.svg deleted file mode 100644 index d0991259..00000000 --- a/resources/pe_blue/scalable/notes.svg +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/pe_blue/scalable/patreon.svg b/resources/pe_blue/scalable/patreon.svg deleted file mode 100644 index 644b9b41..00000000 --- a/resources/pe_blue/scalable/patreon.svg +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/pe_blue/scalable/proxy.svg b/resources/pe_blue/scalable/proxy.svg deleted file mode 100644 index 8266f9b8..00000000 --- a/resources/pe_blue/scalable/proxy.svg +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/pe_blue/scalable/quickmods.svg b/resources/pe_blue/scalable/quickmods.svg deleted file mode 100644 index 8b577376..00000000 --- a/resources/pe_blue/scalable/quickmods.svg +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/pe_blue/scalable/refresh.svg b/resources/pe_blue/scalable/refresh.svg deleted file mode 100644 index a3d2281d..00000000 --- a/resources/pe_blue/scalable/refresh.svg +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/pe_blue/scalable/resourcepacks.svg b/resources/pe_blue/scalable/resourcepacks.svg deleted file mode 100644 index a17e7e82..00000000 --- a/resources/pe_blue/scalable/resourcepacks.svg +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - diff --git a/resources/pe_blue/scalable/screenshots.svg b/resources/pe_blue/scalable/screenshots.svg deleted file mode 100644 index 1aa4e559..00000000 --- a/resources/pe_blue/scalable/screenshots.svg +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/pe_blue/scalable/settings.svg b/resources/pe_blue/scalable/settings.svg deleted file mode 100644 index 43f0b2f2..00000000 --- a/resources/pe_blue/scalable/settings.svg +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/pe_blue/scalable/status-bad.svg b/resources/pe_blue/scalable/status-bad.svg deleted file mode 100644 index 4a48b5d8..00000000 --- a/resources/pe_blue/scalable/status-bad.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/resources/pe_blue/scalable/status-good.svg b/resources/pe_blue/scalable/status-good.svg deleted file mode 100644 index 4cfa56f0..00000000 --- a/resources/pe_blue/scalable/status-good.svg +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - diff --git a/resources/pe_blue/scalable/status-yellow.svg b/resources/pe_blue/scalable/status-yellow.svg deleted file mode 100644 index 0551fed2..00000000 --- a/resources/pe_blue/scalable/status-yellow.svg +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - diff --git a/resources/pe_blue/scalable/viewfolder.svg b/resources/pe_blue/scalable/viewfolder.svg deleted file mode 100644 index 2634f8ff..00000000 --- a/resources/pe_blue/scalable/viewfolder.svg +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/pe_colored/index.theme b/resources/pe_colored/index.theme deleted file mode 100644 index b757bbd7..00000000 --- a/resources/pe_colored/index.theme +++ /dev/null @@ -1,11 +0,0 @@ -[Icon Theme] -Name=pe_colored -Comment=Icons by pexner (colored) -Inherits=multimc -Directories=scalable - -[scalable] -Size=48 -Type=Scalable -MinSize=16 -MaxSize=256 diff --git a/resources/pe_colored/pe_colored.qrc b/resources/pe_colored/pe_colored.qrc deleted file mode 100644 index 7de8d5ab..00000000 --- a/resources/pe_colored/pe_colored.qrc +++ /dev/null @@ -1,35 +0,0 @@ - - - - index.theme - scalable/about.svg - scalable/accounts.svg - scalable/bug.svg - scalable/centralmods.svg - scalable/checkupdate.svg - scalable/copy.svg - scalable/coremods.svg - scalable/externaltools.svg - scalable/instance-settings.svg - scalable/jarmods.svg - scalable/java.svg - scalable/loadermods.svg - scalable/log.svg - scalable/minecraft.svg - scalable/multimc.svg - scalable/new.svg - scalable/news.svg - scalable/notes.svg - scalable/patreon.svg - scalable/proxy.svg - scalable/quickmods.svg - scalable/refresh.svg - scalable/resourcepacks.svg - scalable/screenshots.svg - scalable/settings.svg - scalable/status-bad.svg - scalable/status-good.svg - scalable/status-yellow.svg - scalable/viewfolder.svg - - diff --git a/resources/pe_colored/scalable/about.svg b/resources/pe_colored/scalable/about.svg deleted file mode 100644 index 95e99689..00000000 --- a/resources/pe_colored/scalable/about.svg +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/resources/pe_colored/scalable/accounts.svg b/resources/pe_colored/scalable/accounts.svg deleted file mode 100644 index 301eb368..00000000 --- a/resources/pe_colored/scalable/accounts.svg +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - diff --git a/resources/pe_colored/scalable/bug.svg b/resources/pe_colored/scalable/bug.svg deleted file mode 100644 index 8c92df0a..00000000 --- a/resources/pe_colored/scalable/bug.svg +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - diff --git a/resources/pe_colored/scalable/centralmods.svg b/resources/pe_colored/scalable/centralmods.svg deleted file mode 100644 index 57a97259..00000000 --- a/resources/pe_colored/scalable/centralmods.svg +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - diff --git a/resources/pe_colored/scalable/checkupdate.svg b/resources/pe_colored/scalable/checkupdate.svg deleted file mode 100644 index 0adc8eeb..00000000 --- a/resources/pe_colored/scalable/checkupdate.svg +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - diff --git a/resources/pe_colored/scalable/copy.svg b/resources/pe_colored/scalable/copy.svg deleted file mode 100644 index b9b0f1b1..00000000 --- a/resources/pe_colored/scalable/copy.svg +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - diff --git a/resources/pe_colored/scalable/coremods.svg b/resources/pe_colored/scalable/coremods.svg deleted file mode 100644 index ca7a22f0..00000000 --- a/resources/pe_colored/scalable/coremods.svg +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - diff --git a/resources/pe_colored/scalable/externaltools.svg b/resources/pe_colored/scalable/externaltools.svg deleted file mode 100644 index 1469674f..00000000 --- a/resources/pe_colored/scalable/externaltools.svg +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - diff --git a/resources/pe_colored/scalable/instance-settings.svg b/resources/pe_colored/scalable/instance-settings.svg deleted file mode 100644 index 72032f8a..00000000 --- a/resources/pe_colored/scalable/instance-settings.svg +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/resources/pe_colored/scalable/jarmods.svg b/resources/pe_colored/scalable/jarmods.svg deleted file mode 100644 index bb75f4b1..00000000 --- a/resources/pe_colored/scalable/jarmods.svg +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - diff --git a/resources/pe_colored/scalable/java.svg b/resources/pe_colored/scalable/java.svg deleted file mode 100644 index 32c0225b..00000000 --- a/resources/pe_colored/scalable/java.svg +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/pe_colored/scalable/loadermods.svg b/resources/pe_colored/scalable/loadermods.svg deleted file mode 100644 index 2d80c7f3..00000000 --- a/resources/pe_colored/scalable/loadermods.svg +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - diff --git a/resources/pe_colored/scalable/log.svg b/resources/pe_colored/scalable/log.svg deleted file mode 100644 index 42659b53..00000000 --- a/resources/pe_colored/scalable/log.svg +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - diff --git a/resources/pe_colored/scalable/minecraft.svg b/resources/pe_colored/scalable/minecraft.svg deleted file mode 100644 index 52815487..00000000 --- a/resources/pe_colored/scalable/minecraft.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - diff --git a/resources/pe_colored/scalable/multimc.svg b/resources/pe_colored/scalable/multimc.svg deleted file mode 100644 index a146c52e..00000000 --- a/resources/pe_colored/scalable/multimc.svg +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/resources/pe_colored/scalable/new.svg b/resources/pe_colored/scalable/new.svg deleted file mode 100644 index f18ed28a..00000000 --- a/resources/pe_colored/scalable/new.svg +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - diff --git a/resources/pe_colored/scalable/news.svg b/resources/pe_colored/scalable/news.svg deleted file mode 100644 index 4f924cd8..00000000 --- a/resources/pe_colored/scalable/news.svg +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - diff --git a/resources/pe_colored/scalable/notes.svg b/resources/pe_colored/scalable/notes.svg deleted file mode 100644 index 55ece163..00000000 --- a/resources/pe_colored/scalable/notes.svg +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/resources/pe_colored/scalable/patreon.svg b/resources/pe_colored/scalable/patreon.svg deleted file mode 100644 index d3c6d2d5..00000000 --- a/resources/pe_colored/scalable/patreon.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - diff --git a/resources/pe_colored/scalable/proxy.svg b/resources/pe_colored/scalable/proxy.svg deleted file mode 100644 index 0aee69b7..00000000 --- a/resources/pe_colored/scalable/proxy.svg +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - diff --git a/resources/pe_colored/scalable/quickmods.svg b/resources/pe_colored/scalable/quickmods.svg deleted file mode 100644 index 199b2dae..00000000 --- a/resources/pe_colored/scalable/quickmods.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - diff --git a/resources/pe_colored/scalable/refresh.svg b/resources/pe_colored/scalable/refresh.svg deleted file mode 100644 index c2e7e91f..00000000 --- a/resources/pe_colored/scalable/refresh.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - diff --git a/resources/pe_colored/scalable/resourcepacks.svg b/resources/pe_colored/scalable/resourcepacks.svg deleted file mode 100644 index 0318354c..00000000 --- a/resources/pe_colored/scalable/resourcepacks.svg +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - diff --git a/resources/pe_colored/scalable/screenshots.svg b/resources/pe_colored/scalable/screenshots.svg deleted file mode 100644 index 844fcbaa..00000000 --- a/resources/pe_colored/scalable/screenshots.svg +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - diff --git a/resources/pe_colored/scalable/settings.svg b/resources/pe_colored/scalable/settings.svg deleted file mode 100644 index 72032f8a..00000000 --- a/resources/pe_colored/scalable/settings.svg +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/resources/pe_colored/scalable/status-bad.svg b/resources/pe_colored/scalable/status-bad.svg deleted file mode 100644 index bc42c248..00000000 --- a/resources/pe_colored/scalable/status-bad.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/resources/pe_colored/scalable/status-good.svg b/resources/pe_colored/scalable/status-good.svg deleted file mode 100644 index 4cfa56f0..00000000 --- a/resources/pe_colored/scalable/status-good.svg +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - diff --git a/resources/pe_colored/scalable/status-yellow.svg b/resources/pe_colored/scalable/status-yellow.svg deleted file mode 100644 index 0551fed2..00000000 --- a/resources/pe_colored/scalable/status-yellow.svg +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - diff --git a/resources/pe_colored/scalable/viewfolder.svg b/resources/pe_colored/scalable/viewfolder.svg deleted file mode 100644 index 91832577..00000000 --- a/resources/pe_colored/scalable/viewfolder.svg +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - diff --git a/resources/pe_dark/index.theme b/resources/pe_dark/index.theme deleted file mode 100644 index b7d1ad01..00000000 --- a/resources/pe_dark/index.theme +++ /dev/null @@ -1,11 +0,0 @@ -[Icon Theme] -Name=pe_dark -Comment=Icons by pexner (dark) -Inherits=multimc -Directories=scalable - -[scalable] -Size=48 -Type=Scalable -MinSize=16 -MaxSize=256 diff --git a/resources/pe_dark/pe_dark.qrc b/resources/pe_dark/pe_dark.qrc deleted file mode 100644 index cafc2559..00000000 --- a/resources/pe_dark/pe_dark.qrc +++ /dev/null @@ -1,35 +0,0 @@ - - - - index.theme - scalable/about.svg - scalable/accounts.svg - scalable/bug.svg - scalable/centralmods.svg - scalable/checkupdate.svg - scalable/copy.svg - scalable/coremods.svg - scalable/externaltools.svg - scalable/instance-settings.svg - scalable/jarmods.svg - scalable/java.svg - scalable/loadermods.svg - scalable/log.svg - scalable/minecraft.svg - scalable/multimc.svg - scalable/new.svg - scalable/news.svg - scalable/notes.svg - scalable/patreon.svg - scalable/proxy.svg - scalable/quickmods.svg - scalable/refresh.svg - scalable/resourcepacks.svg - scalable/screenshots.svg - scalable/settings.svg - scalable/status-bad.svg - scalable/status-good.svg - scalable/status-yellow.svg - scalable/viewfolder.svg - - diff --git a/resources/pe_dark/scalable/about.svg b/resources/pe_dark/scalable/about.svg deleted file mode 100644 index e75ea6ca..00000000 --- a/resources/pe_dark/scalable/about.svg +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - diff --git a/resources/pe_dark/scalable/accounts.svg b/resources/pe_dark/scalable/accounts.svg deleted file mode 100644 index 6d46b2df..00000000 --- a/resources/pe_dark/scalable/accounts.svg +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/pe_dark/scalable/bug.svg b/resources/pe_dark/scalable/bug.svg deleted file mode 100644 index 9da71adb..00000000 --- a/resources/pe_dark/scalable/bug.svg +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/pe_dark/scalable/centralmods.svg b/resources/pe_dark/scalable/centralmods.svg deleted file mode 100644 index f3b0c0e4..00000000 --- a/resources/pe_dark/scalable/centralmods.svg +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/pe_dark/scalable/checkupdate.svg b/resources/pe_dark/scalable/checkupdate.svg deleted file mode 100644 index 97585447..00000000 --- a/resources/pe_dark/scalable/checkupdate.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - diff --git a/resources/pe_dark/scalable/copy.svg b/resources/pe_dark/scalable/copy.svg deleted file mode 100644 index 8c30ac0b..00000000 --- a/resources/pe_dark/scalable/copy.svg +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/pe_dark/scalable/coremods.svg b/resources/pe_dark/scalable/coremods.svg deleted file mode 100644 index 1e2eb227..00000000 --- a/resources/pe_dark/scalable/coremods.svg +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/pe_dark/scalable/externaltools.svg b/resources/pe_dark/scalable/externaltools.svg deleted file mode 100644 index 29b45f26..00000000 --- a/resources/pe_dark/scalable/externaltools.svg +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/pe_dark/scalable/instance-settings.svg b/resources/pe_dark/scalable/instance-settings.svg deleted file mode 100644 index c9f701e7..00000000 --- a/resources/pe_dark/scalable/instance-settings.svg +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/pe_dark/scalable/jarmods.svg b/resources/pe_dark/scalable/jarmods.svg deleted file mode 100644 index cb9a97ba..00000000 --- a/resources/pe_dark/scalable/jarmods.svg +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/pe_dark/scalable/java.svg b/resources/pe_dark/scalable/java.svg deleted file mode 100644 index 9e1091fa..00000000 --- a/resources/pe_dark/scalable/java.svg +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/pe_dark/scalable/loadermods.svg b/resources/pe_dark/scalable/loadermods.svg deleted file mode 100644 index 24226a09..00000000 --- a/resources/pe_dark/scalable/loadermods.svg +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/pe_dark/scalable/log.svg b/resources/pe_dark/scalable/log.svg deleted file mode 100644 index 68686a7d..00000000 --- a/resources/pe_dark/scalable/log.svg +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/pe_dark/scalable/minecraft.svg b/resources/pe_dark/scalable/minecraft.svg deleted file mode 100644 index 01baf575..00000000 --- a/resources/pe_dark/scalable/minecraft.svg +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/pe_dark/scalable/multimc.svg b/resources/pe_dark/scalable/multimc.svg deleted file mode 100644 index e4cf7b7f..00000000 --- a/resources/pe_dark/scalable/multimc.svg +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/pe_dark/scalable/new.svg b/resources/pe_dark/scalable/new.svg deleted file mode 100644 index 0377aceb..00000000 --- a/resources/pe_dark/scalable/new.svg +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/pe_dark/scalable/news.svg b/resources/pe_dark/scalable/news.svg deleted file mode 100644 index 84979dcb..00000000 --- a/resources/pe_dark/scalable/news.svg +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - diff --git a/resources/pe_dark/scalable/notes.svg b/resources/pe_dark/scalable/notes.svg deleted file mode 100644 index 72649721..00000000 --- a/resources/pe_dark/scalable/notes.svg +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/pe_dark/scalable/patreon.svg b/resources/pe_dark/scalable/patreon.svg deleted file mode 100644 index 01cb279a..00000000 --- a/resources/pe_dark/scalable/patreon.svg +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/pe_dark/scalable/proxy.svg b/resources/pe_dark/scalable/proxy.svg deleted file mode 100644 index 98bcfac1..00000000 --- a/resources/pe_dark/scalable/proxy.svg +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/pe_dark/scalable/quickmods.svg b/resources/pe_dark/scalable/quickmods.svg deleted file mode 100644 index 346729f1..00000000 --- a/resources/pe_dark/scalable/quickmods.svg +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/pe_dark/scalable/refresh.svg b/resources/pe_dark/scalable/refresh.svg deleted file mode 100644 index c227cd6c..00000000 --- a/resources/pe_dark/scalable/refresh.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - diff --git a/resources/pe_dark/scalable/resourcepacks.svg b/resources/pe_dark/scalable/resourcepacks.svg deleted file mode 100644 index 0db2beb1..00000000 --- a/resources/pe_dark/scalable/resourcepacks.svg +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - diff --git a/resources/pe_dark/scalable/screenshots.svg b/resources/pe_dark/scalable/screenshots.svg deleted file mode 100644 index 2803b9aa..00000000 --- a/resources/pe_dark/scalable/screenshots.svg +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/pe_dark/scalable/settings.svg b/resources/pe_dark/scalable/settings.svg deleted file mode 100644 index c9f701e7..00000000 --- a/resources/pe_dark/scalable/settings.svg +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/pe_dark/scalable/status-bad.svg b/resources/pe_dark/scalable/status-bad.svg deleted file mode 100644 index f455965a..00000000 --- a/resources/pe_dark/scalable/status-bad.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/resources/pe_dark/scalable/status-good.svg b/resources/pe_dark/scalable/status-good.svg deleted file mode 100644 index 4ba91f2d..00000000 --- a/resources/pe_dark/scalable/status-good.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - diff --git a/resources/pe_dark/scalable/status-yellow.svg b/resources/pe_dark/scalable/status-yellow.svg deleted file mode 100644 index 69133817..00000000 --- a/resources/pe_dark/scalable/status-yellow.svg +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - diff --git a/resources/pe_dark/scalable/viewfolder.svg b/resources/pe_dark/scalable/viewfolder.svg deleted file mode 100644 index 3af36240..00000000 --- a/resources/pe_dark/scalable/viewfolder.svg +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/pe_light/index.theme b/resources/pe_light/index.theme deleted file mode 100644 index c106acc8..00000000 --- a/resources/pe_light/index.theme +++ /dev/null @@ -1,11 +0,0 @@ -[Icon Theme] -Name=pe_light -Comment=Icons by pexner (light) -Inherits=multimc -Directories=scalable - -[scalable] -Size=48 -Type=Scalable -MinSize=16 -MaxSize=256 diff --git a/resources/pe_light/pe_light.qrc b/resources/pe_light/pe_light.qrc deleted file mode 100644 index 53d0890b..00000000 --- a/resources/pe_light/pe_light.qrc +++ /dev/null @@ -1,36 +0,0 @@ - - - - index.theme - scalable/about.svg - scalable/accounts.svg - scalable/bug.svg - scalable/centralmods.svg - scalable/checkupdate.svg - scalable/copy.svg - scalable/coremods.svg - scalable/externaltools.svg - scalable/instance-settings.svg - scalable/jarmods.svg - scalable/java.svg - scalable/loadermods.svg - scalable/log.svg - scalable/minecraft.svg - scalable/multimc.svg - scalable/new.svg - scalable/news.svg - scalable/notes.svg - scalable/patreon.svg - scalable/proxy.svg - scalable/quickmods.svg - scalable/refresh.svg - scalable/resourcepacks.svg - scalable/screenshots.svg - scalable/settings.svg - scalable/status-bad.svg - scalable/status-good.svg - scalable/status-yellow.svg - scalable/viewfolder.svg - - - diff --git a/resources/pe_light/scalable/about.svg b/resources/pe_light/scalable/about.svg deleted file mode 100644 index 8d00c32e..00000000 --- a/resources/pe_light/scalable/about.svg +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - diff --git a/resources/pe_light/scalable/accounts.svg b/resources/pe_light/scalable/accounts.svg deleted file mode 100644 index 3a092d03..00000000 --- a/resources/pe_light/scalable/accounts.svg +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/pe_light/scalable/bug.svg b/resources/pe_light/scalable/bug.svg deleted file mode 100644 index ccb64bc5..00000000 --- a/resources/pe_light/scalable/bug.svg +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/pe_light/scalable/centralmods.svg b/resources/pe_light/scalable/centralmods.svg deleted file mode 100644 index 050fdc58..00000000 --- a/resources/pe_light/scalable/centralmods.svg +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/pe_light/scalable/checkupdate.svg b/resources/pe_light/scalable/checkupdate.svg deleted file mode 100644 index 08b8dcd5..00000000 --- a/resources/pe_light/scalable/checkupdate.svg +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - diff --git a/resources/pe_light/scalable/copy.svg b/resources/pe_light/scalable/copy.svg deleted file mode 100644 index abdcce09..00000000 --- a/resources/pe_light/scalable/copy.svg +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/pe_light/scalable/coremods.svg b/resources/pe_light/scalable/coremods.svg deleted file mode 100644 index c8fb0eb9..00000000 --- a/resources/pe_light/scalable/coremods.svg +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/pe_light/scalable/externaltools.svg b/resources/pe_light/scalable/externaltools.svg deleted file mode 100644 index 4d232bcf..00000000 --- a/resources/pe_light/scalable/externaltools.svg +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/pe_light/scalable/instance-settings.svg b/resources/pe_light/scalable/instance-settings.svg deleted file mode 100644 index 83b92a52..00000000 --- a/resources/pe_light/scalable/instance-settings.svg +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/pe_light/scalable/jarmods.svg b/resources/pe_light/scalable/jarmods.svg deleted file mode 100644 index 9852c805..00000000 --- a/resources/pe_light/scalable/jarmods.svg +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/pe_light/scalable/java.svg b/resources/pe_light/scalable/java.svg deleted file mode 100644 index 0584058a..00000000 --- a/resources/pe_light/scalable/java.svg +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/pe_light/scalable/loadermods.svg b/resources/pe_light/scalable/loadermods.svg deleted file mode 100644 index 913c1968..00000000 --- a/resources/pe_light/scalable/loadermods.svg +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/pe_light/scalable/log.svg b/resources/pe_light/scalable/log.svg deleted file mode 100644 index 82282ca4..00000000 --- a/resources/pe_light/scalable/log.svg +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/pe_light/scalable/minecraft.svg b/resources/pe_light/scalable/minecraft.svg deleted file mode 100644 index d772111f..00000000 --- a/resources/pe_light/scalable/minecraft.svg +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/pe_light/scalable/multimc.svg b/resources/pe_light/scalable/multimc.svg deleted file mode 100644 index 8b2cb631..00000000 --- a/resources/pe_light/scalable/multimc.svg +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/pe_light/scalable/new.svg b/resources/pe_light/scalable/new.svg deleted file mode 100644 index 96fd1f5b..00000000 --- a/resources/pe_light/scalable/new.svg +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/pe_light/scalable/news.svg b/resources/pe_light/scalable/news.svg deleted file mode 100644 index 6f184afc..00000000 --- a/resources/pe_light/scalable/news.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - diff --git a/resources/pe_light/scalable/notes.svg b/resources/pe_light/scalable/notes.svg deleted file mode 100644 index 02dc11ec..00000000 --- a/resources/pe_light/scalable/notes.svg +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/pe_light/scalable/patreon.svg b/resources/pe_light/scalable/patreon.svg deleted file mode 100644 index 0bd08826..00000000 --- a/resources/pe_light/scalable/patreon.svg +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/pe_light/scalable/proxy.svg b/resources/pe_light/scalable/proxy.svg deleted file mode 100644 index 9de8d6d1..00000000 --- a/resources/pe_light/scalable/proxy.svg +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/pe_light/scalable/quickmods.svg b/resources/pe_light/scalable/quickmods.svg deleted file mode 100644 index 6dbeab52..00000000 --- a/resources/pe_light/scalable/quickmods.svg +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/pe_light/scalable/refresh.svg b/resources/pe_light/scalable/refresh.svg deleted file mode 100644 index 9a724d91..00000000 --- a/resources/pe_light/scalable/refresh.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - diff --git a/resources/pe_light/scalable/resourcepacks.svg b/resources/pe_light/scalable/resourcepacks.svg deleted file mode 100644 index 7d6323f2..00000000 --- a/resources/pe_light/scalable/resourcepacks.svg +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - diff --git a/resources/pe_light/scalable/screenshots.svg b/resources/pe_light/scalable/screenshots.svg deleted file mode 100644 index f2887be6..00000000 --- a/resources/pe_light/scalable/screenshots.svg +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/pe_light/scalable/settings.svg b/resources/pe_light/scalable/settings.svg deleted file mode 100644 index 83b92a52..00000000 --- a/resources/pe_light/scalable/settings.svg +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/pe_light/scalable/status-bad.svg b/resources/pe_light/scalable/status-bad.svg deleted file mode 100644 index 2c24970c..00000000 --- a/resources/pe_light/scalable/status-bad.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/resources/pe_light/scalable/status-good.svg b/resources/pe_light/scalable/status-good.svg deleted file mode 100644 index bf9a4174..00000000 --- a/resources/pe_light/scalable/status-good.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - diff --git a/resources/pe_light/scalable/status-yellow.svg b/resources/pe_light/scalable/status-yellow.svg deleted file mode 100644 index f7d2236b..00000000 --- a/resources/pe_light/scalable/status-yellow.svg +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - diff --git a/resources/pe_light/scalable/viewfolder.svg b/resources/pe_light/scalable/viewfolder.svg deleted file mode 100644 index b36343fe..00000000 --- a/resources/pe_light/scalable/viewfolder.svg +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/sources/clucker.svg b/resources/sources/clucker.svg deleted file mode 100644 index 0c1727eb..00000000 --- a/resources/sources/clucker.svg +++ /dev/null @@ -1,404 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/sources/creeper.svg b/resources/sources/creeper.svg deleted file mode 100644 index 2a2e39b6..00000000 --- a/resources/sources/creeper.svg +++ /dev/null @@ -1,775 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/sources/enderpearl.svg b/resources/sources/enderpearl.svg deleted file mode 100644 index ac9378f5..00000000 --- a/resources/sources/enderpearl.svg +++ /dev/null @@ -1,271 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - diff --git a/resources/sources/ftb-glow.svg b/resources/sources/ftb-glow.svg deleted file mode 100644 index be78c78e..00000000 --- a/resources/sources/ftb-glow.svg +++ /dev/null @@ -1,606 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/sources/ftb-logo.svg b/resources/sources/ftb-logo.svg deleted file mode 100644 index 8cf73567..00000000 --- a/resources/sources/ftb-logo.svg +++ /dev/null @@ -1,257 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/sources/gear.svg b/resources/sources/gear.svg deleted file mode 100644 index c0169aec..00000000 --- a/resources/sources/gear.svg +++ /dev/null @@ -1,434 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - diff --git a/resources/sources/herobrine.svg b/resources/sources/herobrine.svg deleted file mode 100644 index 7392ba36..00000000 --- a/resources/sources/herobrine.svg +++ /dev/null @@ -1,583 +0,0 @@ - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/sources/magitech.svg b/resources/sources/magitech.svg deleted file mode 100644 index c6dd6bc0..00000000 --- a/resources/sources/magitech.svg +++ /dev/null @@ -1,886 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/sources/meat.svg b/resources/sources/meat.svg deleted file mode 100644 index 69a20073..00000000 --- a/resources/sources/meat.svg +++ /dev/null @@ -1,371 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/sources/netherstar.svg b/resources/sources/netherstar.svg deleted file mode 100644 index 4046e4ec..00000000 --- a/resources/sources/netherstar.svg +++ /dev/null @@ -1,342 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/sources/pskeleton.svg b/resources/sources/pskeleton.svg deleted file mode 100644 index c2783df8..00000000 --- a/resources/sources/pskeleton.svg +++ /dev/null @@ -1,581 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/sources/skeleton.svg b/resources/sources/skeleton.svg deleted file mode 100644 index 5d55f272..00000000 --- a/resources/sources/skeleton.svg +++ /dev/null @@ -1,610 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/sources/squarecreeper.svg b/resources/sources/squarecreeper.svg deleted file mode 100644 index a1b0f4d1..00000000 --- a/resources/sources/squarecreeper.svg +++ /dev/null @@ -1,828 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/sources/steve.svg b/resources/sources/steve.svg deleted file mode 100644 index 2233272c..00000000 --- a/resources/sources/steve.svg +++ /dev/null @@ -1,534 +0,0 @@ - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/versions/LWJGL/2.9.0.json b/resources/versions/LWJGL/2.9.0.json deleted file mode 100644 index 5dbd624e..00000000 --- a/resources/versions/LWJGL/2.9.0.json +++ /dev/null @@ -1,45 +0,0 @@ - { - "fileId": "org.lwjgl", - "name": "LWJGL", - "version": "2.9.0", - "+libraries": [ - { - "name": "net.java.jinput:jinput:2.0.5" - }, - { - "name": "net.java.jinput:jinput-platform:2.0.5", - "natives": { - "linux": "natives-linux", - "windows": "natives-windows", - "osx": "natives-osx" - }, - "extract": { - "exclude": [ - "META-INF/" - ] - } - }, - { - "name": "net.java.jutils:jutils:1.0.0" - }, - { - "name": "org.lwjgl.lwjgl:lwjgl:2.9.0" - }, - { - "name": "org.lwjgl.lwjgl:lwjgl_util:2.9.0" - }, - { - "name": "org.lwjgl.lwjgl:lwjgl-platform:2.9.0", - "natives": { - "linux": "natives-linux", - "windows": "natives-windows", - "osx": "natives-osx" - }, - "extract": { - "exclude": [ - "META-INF/" - ] - } - } - ] -} diff --git a/resources/versions/LWJGL/2.9.1-nightly-20130708-debug3.json b/resources/versions/LWJGL/2.9.1-nightly-20130708-debug3.json deleted file mode 100644 index 7265b3b0..00000000 --- a/resources/versions/LWJGL/2.9.1-nightly-20130708-debug3.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "fileId": "org.lwjgl", - "name": "LWJGL", - "version": "2.9.1-nightly-20130708-debug3", - "+libraries": [ - { - "name": "net.java.jinput:jinput:2.0.5" - }, - { - "name": "net.java.jinput:jinput-platform:2.0.5", - "natives": { - "linux": "natives-linux", - "windows": "natives-windows", - "osx": "natives-osx" - }, - "extract": { - "exclude": [ - "META-INF/" - ] - } - }, - { - "name": "net.java.jutils:jutils:1.0.0" - }, - { - "name": "org.lwjgl.lwjgl:lwjgl:2.9.1-nightly-20130708-debug3" - }, - { - "name": "org.lwjgl.lwjgl:lwjgl_util:2.9.1-nightly-20130708-debug3" - }, - { - "name": "org.lwjgl.lwjgl:lwjgl-platform:2.9.1-nightly-20130708-debug3", - "natives": { - "linux": "natives-linux", - "windows": "natives-windows", - "osx": "natives-osx" - }, - "extract": { - "exclude": [ - "META-INF/" - ] - } - } - ] -} diff --git a/resources/versions/LWJGL/2.9.1.json b/resources/versions/LWJGL/2.9.1.json deleted file mode 100644 index e7f5e947..00000000 --- a/resources/versions/LWJGL/2.9.1.json +++ /dev/null @@ -1,45 +0,0 @@ - { - "fileId": "org.lwjgl", - "name": "LWJGL", - "version": "2.9.1", - "+libraries": [ - { - "name": "net.java.jinput:jinput:2.0.5" - }, - { - "name": "net.java.jinput:jinput-platform:2.0.5", - "natives": { - "linux": "natives-linux", - "windows": "natives-windows", - "osx": "natives-osx" - }, - "extract": { - "exclude": [ - "META-INF/" - ] - } - }, - { - "name": "net.java.jutils:jutils:1.0.0" - }, - { - "name": "org.lwjgl.lwjgl:lwjgl:2.9.1" - }, - { - "name": "org.lwjgl.lwjgl:lwjgl_util:2.9.1" - }, - { - "name": "org.lwjgl.lwjgl:lwjgl-platform:2.9.1", - "natives": { - "linux": "natives-linux", - "windows": "natives-windows", - "osx": "natives-osx" - }, - "extract": { - "exclude": [ - "META-INF/" - ] - } - } - ] -} diff --git a/resources/versions/LWJGL/2.9.2-nightly-20140822.json b/resources/versions/LWJGL/2.9.2-nightly-20140822.json deleted file mode 100644 index 25b22eb9..00000000 --- a/resources/versions/LWJGL/2.9.2-nightly-20140822.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "fileId": "org.lwjgl", - "name": "LWJGL", - "version": "2.9.2-nightly-20140822", - "+libraries": [ - { - "name": "net.java.jinput:jinput:2.0.5" - }, - { - "name": "net.java.jinput:jinput-platform:2.0.5", - "natives": { - "linux": "natives-linux", - "windows": "natives-windows", - "osx": "natives-osx" - }, - "extract": { - "exclude": [ - "META-INF/" - ] - } - }, - { - "name": "net.java.jutils:jutils:1.0.0" - }, - { - "name": "org.lwjgl.lwjgl:lwjgl:2.9.2-nightly-20140822" - }, - { - "name": "org.lwjgl.lwjgl:lwjgl_util:2.9.2-nightly-20140822" - }, - { - "name": "org.lwjgl.lwjgl:lwjgl-platform:2.9.2-nightly-20140822", - "natives": { - "linux": "natives-linux", - "windows": "natives-windows", - "osx": "natives-osx" - }, - "extract": { - "exclude": [ - "META-INF/" - ] - } - } - ] -} diff --git a/resources/versions/minecraft.json b/resources/versions/minecraft.json deleted file mode 100644 index 58b153c2..00000000 --- a/resources/versions/minecraft.json +++ /dev/null @@ -1,668 +0,0 @@ -{ -"versions": [ - { - "id": "1.5.2", - "checksum": "6897c3287fb971c9f362eb3ab20f5ddd", - "releaseTime": "2013-04-25T17:45:00+02:00", - "type": "release", - "processArguments": "legacy", - "+traits": ["legacyLaunch", "texturepacks"] - }, - { - "id": "1.5.1", - "checksum": "5c1219d869b87d233de3033688ec7567", - "releaseTime": "2013-03-20T12:00:00+02:00", - "type": "release", - "processArguments": "legacy", - "+traits": ["legacyLaunch", "texturepacks"] - }, - { - "id": "1.5", - "checksum": "fd11cbc5b01aae1d62cff0145171f3d9", - "releaseTime": "2013-03-07T00:00:00+02:00", - "type": "snapshot", - "processArguments": "legacy", - "+traits": ["legacyLaunch", "texturepacks"] - }, - { - "id": "1.4.7", - "checksum": "8e80fb01b321c6b3c7efca397a3eea35", - "releaseTime": "2012-12-28T00:00:00+02:00", - "type": "release", - "processArguments": "legacy", - "+traits": ["legacyLaunch", "texturepacks"] - }, - { - "id": "1.4.6", - "checksum": "48677dc4c2b98c29918722b5ab27b4fd", - "releaseTime": "2012-12-20T00:00:00+02:00", - "type": "release", - "processArguments": "legacy", - "+traits": ["legacyLaunch", "texturepacks"] - }, - { - "id": "1.4.5", - "checksum": "b15e2b2b6b4629f0d99a95b6b44412a0", - "releaseTime": "2012-11-20T00:00:00+02:00", - "type": "release", - "processArguments": "legacy", - "+traits": ["legacyLaunch", "texturepacks"] - }, - { - "id": "1.4.4", - "checksum": "7aa46c8058cba2f38e9d2ddddcc77c72", - "releaseTime": "2012-11-14T00:00:00+02:00", - "type": "release", - "processArguments": "legacy", - "+traits": ["legacyLaunch", "texturepacks"] - }, - { - "id": "1.4.3", - "checksum": "9cc3295931edb6339f22989fe1b612a6", - "releaseTime": "2012-11-01T00:00:00+02:00", - "type": "snapshot", - "processArguments": "legacy", - "+traits": ["legacyLaunch", "texturepacks"] - }, - { - "id": "1.4.2", - "checksum": "771175c01778ea67395bc6919a5a9dc5", - "releaseTime": "2012-10-25T00:00:00+02:00", - "type": "release", - "processArguments": "legacy", - "+traits": ["legacyLaunch", "texturepacks"] - }, - { - "id": "1.4.1", - "checksum": "542621a5298659dc65f383f35170fc4c", - "releaseTime": "2012-10-23T00:00:00+02:00", - "type": "snapshot", - "processArguments": "legacy", - "+traits": ["legacyLaunch", "texturepacks"] - }, - { - "id": "1.4", - "checksum": "32a654388b54d3e4bb29c1a46e7d6a12", - "releaseTime": "2012-10-19T00:00:00+02:00", - "type": "snapshot", - "processArguments": "legacy", - "+traits": ["legacyLaunch", "texturepacks"] - }, - { - "id": "1.3.2", - "checksum": "969699f13e5bbe7f12e40ac4f32b7d9a", - "releaseTime": "2012-08-16T00:00:00+02:00", - "type": "release", - "processArguments": "legacy", - "+traits": ["legacyLaunch", "texturepacks"] - }, - { - "id": "1.3.1", - "checksum": "266ccbc9798afd2eadf3d6c01b4c562a", - "releaseTime": "2012-08-01T00:00:00+02:00", - "type": "release", - "processArguments": "legacy", - "+traits": ["legacyLaunch", "texturepacks"] - }, - { - "id": "1.3", - "checksum": "a6effac1eaccf5d429aae340cf95ed5d", - "releaseTime": "2012-07-26T00:00:00+02:00", - "type": "snapshot", - "processArguments": "legacy", - "+traits": ["legacyLaunch", "texturepacks"] - }, - { - "id": "1.2.5", - "checksum": "8e8778078a175a33603a585257f28563", - "releaseTime": "2012-03-30T00:00:00+02:00", - "type": "release", - "processArguments": "legacy", - "+traits": ["legacyLaunch", "texturepacks"] - }, - { - "id": "1.2.4", - "checksum": "25423eab6d8707f96cc6ad8a21a7250a", - "releaseTime": "2012-03-22T00:00:00+02:00", - "type": "release", - "processArguments": "legacy", - "+traits": ["legacyLaunch", "texturepacks"] - }, - { - "id": "1.2.3", - "checksum": "12f6c4b1bdcc63f029e3c088a364b8e4", - "releaseTime": "2012-03-02T00:00:00+02:00", - "type": "release", - "processArguments": "legacy", - "+traits": ["legacyLaunch", "texturepacks"] - }, - { - "id": "1.2.2", - "checksum": "6189e96efaea11e5164b4a4755574324", - "releaseTime": "2012-03-01T00:00:01+02:00", - "type": "release", - "processArguments": "legacy", - "+traits": ["legacyLaunch", "texturepacks"] - }, - { - "id": "1.2.1", - "checksum": "97067a603eba2b6eb75d3194f81f6bcd", - "releaseTime": "2012-03-01T00:00:00+02:00", - "type": "release", - "processArguments": "legacy", - "+traits": ["legacyLaunch", "texturepacks"] - }, - { - "id": "1.1", - "checksum": "e92302d2acdba7c97e0d8df1e10d2006", - "releaseTime": "2012-01-12T00:00:00+02:00", - "type": "release", - "processArguments": "legacy", - "+traits": ["legacyLaunch", "texturepacks"] - }, - { - "id": "1.0", - "checksum": "3820d222b95d0b8c520d9596a756a6e6", - "releaseTime": "2011-11-18T00:00:00+02:00", - "type": "release", - "processArguments": "legacy", - "+traits": ["legacyLaunch", "texturepacks"] - }, - { - "id": "b1.8.1", - "checksum": "f8c5a2ccd3bc996792bbe436d8cc08bc", - "releaseTime": "2011-09-19T00:00:00+02:00", - "type": "old_beta", - "processArguments": "legacy", - "+traits": ["legacyLaunch", "texturepacks"] - }, - { - "id": "b1.8", - "checksum": "a59a9fd4c726a573b0a2bdd10d857f59", - "releaseTime": "2011-09-15T00:00:00+02:00", - "type": "old_beta", - "processArguments": "legacy", - "+traits": ["legacyLaunch", "texturepacks"] - }, - { - "id": "b1.7.3", - "checksum": "eae3353fdaa7e10a59b4cb5b45bfa10d", - "releaseTime": "2011-07-08T00:00:00+02:00", - "type": "old_beta", - "processArguments": "legacy", - "+traits": ["legacyLaunch", "texturepacks"] - }, - { - "id": "b1.7.2", - "checksum": "dd9215ab1141170d4871f42bff4ab302", - "releaseTime": "2011-07-01T00:00:00+02:00", - "type": "old_beta", - "processArguments": "legacy", - "+traits": ["legacyLaunch", "texturepacks"] - }, - { - "id": "b1.7", - "checksum": "682419e9ed1a236c3067822d53cda1e4", - "releaseTime": "2011-06-30T00:00:00+02:00", - "type": "old_beta", - "processArguments": "legacy", - "+traits": ["legacyLaunch", "texturepacks"] - }, - { - "id": "b1.6.6", - "checksum": "ce80072464433cd5b05d505aa8ff29d1", - "releaseTime": "2011-05-31T00:00:00+02:00", - "type": "old_beta", - "processArguments": "legacy", - "+traits": ["legacyLaunch", "texturepacks"] - }, - { - "id": "b1.6.5", - "checksum": "2aba888864b32038c8d22ee5df71b7c8", - "releaseTime": "2011-05-28T00:00:00+02:00", - "type": "old_beta", - "processArguments": "legacy", - "+traits": ["legacyLaunch", "texturepacks"] - }, - { - "id": "b1.6.4", - "checksum": "5c4df6f120336f113180698613853dba", - "releaseTime": "2011-05-26T00:00:04+02:00", - "type": "old_beta", - "processArguments": "legacy", - "+traits": ["legacyLaunch", "texturepacks"] - }, - { - "id": "b1.6.3", - "checksum": "efc2becca965e4f8feb5b4210c6a4fd1", - "releaseTime": "2011-05-26T00:00:03+02:00", - "type": "old_beta", - "processArguments": "legacy", - "+traits": ["legacyLaunch", "texturepacks"] - }, - { - "id": "b1.6.2", - "checksum": "01330b1c930102a683a4dd8d792e632e", - "releaseTime": "2011-05-26T00:00:02+02:00", - "type": "old_beta", - "processArguments": "legacy", - "+traits": ["legacyLaunch", "texturepacks"] - }, - { - "id": "b1.6.1", - "checksum": "a7e82c441a57ef4068c533f4d777336a", - "releaseTime": "2011-05-26T00:00:01+02:00", - "type": "old_beta", - "processArguments": "legacy", - "+traits": ["legacyLaunch", "texturepacks"] - }, - { - "id": "b1.6", - "checksum": "d531e221227a65392259d3141893280d", - "releaseTime": "2011-05-26T00:00:00+02:00", - "type": "old_beta", - "processArguments": "legacy", - "+traits": ["legacyLaunch", "texturepacks"] - }, - { - "id": "b1.5_01", - "checksum": "d02fa9998e30693d8d989d5f88cf0040", - "releaseTime": "2011-04-20T00:00:00+02:00", - "type": "old_beta", - "processArguments": "legacy", - "+traits": ["legacyLaunch", "texturepacks"] - }, - { - "id": "b1.5", - "checksum": "24289130902822d73f8722b52bc07cdb", - "releaseTime": "2011-04-19T00:00:00+02:00", - "type": "old_beta", - "processArguments": "legacy", - "+traits": ["legacyLaunch", "texturepacks"] - }, - { - "id": "b1.4_01", - "checksum": "9379e54b581ba4ef3acc3e326e87db91", - "releaseTime": "2011-04-05T00:00:00+02:00", - "type": "old_beta", - "processArguments": "legacy", - "+traits": ["legacyLaunch", "texturepacks"] - }, - { - "id": "b1.4", - "checksum": "71e64b61175b371ed148b385f2d14ebf", - "releaseTime": "2011-03-31T00:00:00+02:00", - "type": "old_beta", - "processArguments": "legacy", - "+traits": ["legacyLaunch", "texturepacks"] - }, - { - "id": "b1.3_01", - "checksum": "4203826f35e1036f089919032c3d19d1", - "releaseTime": "2011-02-23T00:00:00+02:00", - "type": "old_beta", - "processArguments": "legacy", - "+traits": ["legacyLaunch", "texturepacks"] - }, - { - "id": "b1.3b", - "checksum": "de2164df461d028229ed2e101181bbd4", - "releaseTime": "2011-02-22T00:00:00+02:00", - "type": "old_beta", - "processArguments": "legacy", - "+traits": ["legacyLaunch", "texturepacks"] - }, - { - "id": "b1.2_02", - "checksum": "1736c5ba4f63a981220c2a18a4120180", - "releaseTime": "2011-01-21T00:00:00+02:00", - "type": "old_beta", - "processArguments": "legacy", - "+traits": ["legacyLaunch", "texturepacks"] - }, - { - "id": "b1.2_01", - "checksum": "486d83ec00554b45ffa21af2faa0116a", - "releaseTime": "2011-01-14T00:00:00+02:00", - "type": "old_beta", - "processArguments": "legacy", - "+traits": ["legacyLaunch", "texturepacks"] - }, - { - "id": "b1.2", - "checksum": "6426223efe23c3931a4ef89685be3349", - "releaseTime": "2011-01-13T00:00:00+02:00", - "type": "old_beta", - "processArguments": "legacy", - "+traits": ["legacyLaunch", "texturepacks"] - }, - { - "id": "b1.1_02", - "checksum": "7d547e495a770c62054ef136add43034", - "releaseTime": "2010-12-22T00:00:01+02:00", - "type": "old_beta", - "processArguments": "legacy", - "+traits": ["legacyLaunch", "texturepacks"] - }, - { - "id": "b1.1_01", - "checksum": "1f9331f2bfca81b6ce2acdfc1f105837", - "releaseTime": "2010-12-22T00:00:00+02:00", - "type": "old_beta", - "processArguments": "legacy", - "+traits": ["legacyLaunch", "texturepacks"] - }, - { - "id": "b1.0.2", - "checksum": "d200c465b8c167cc8df6537531fc9a48", - "releaseTime": "2010-12-21T00:00:00+02:00", - "type": "old_beta", - "processArguments": "legacy", - "+traits": ["legacyLaunch", "texturepacks"] - }, - { - "id": "b1.0_01", - "checksum": "03bd20b870dbbd121de5dca98af4e1ce", - "releaseTime": "2010-12-20T00:00:01+02:00", - "type": "old_beta", - "processArguments": "legacy", - "+traits": ["legacyLaunch", "texturepacks"] - }, - { - "id": "b1.0", - "checksum": "5f8733dbbf09b4e7c874661a3c29c239", - "releaseTime": "2010-12-20T00:00:00+02:00", - "type": "old_beta", - "processArguments": "legacy", - "+traits": ["legacyLaunch", "texturepacks"] - }, - { - "id": "a1.2.6", - "checksum": "ddd5e39467f28d1ea1a03b4d9e790867", - "releaseTime": "2010-12-03T00:00:00+02:00", - "type": "old_alpha", - "processArguments": "legacy", - "+traits": ["legacyLaunch", "texturepacks"] - }, - { - "id": "a1.2.5", - "checksum": "7d3a43037190970ff2e11153b5718b74", - "releaseTime": "2010-12-01T00:00:00+02:00", - "type": "old_alpha", - "processArguments": "legacy", - "+traits": ["legacyLaunch", "texturepacks"] - }, - { - "id": "a1.2.4_01", - "checksum": "0a1cc8c668faa6dc93fc418e8b4b097a", - "releaseTime": "2010-11-30T00:00:00+02:00", - "type": "old_alpha", - "processArguments": "legacy", - "+traits": ["legacyLaunch", "texturepacks"] - }, - { - "id": "a1.2.3_04", - "checksum": "b2c25a753c82a1cd228ce71469829dc1", - "releaseTime": "2010-11-26T00:00:00+02:00", - "type": "old_alpha", - "processArguments": "legacy", - "+traits": ["legacyLaunch", "texturepacks"] - }, - { - "id": "a1.2.3_02", - "checksum": "3ad4808ef2ac3b65d10305315260da03", - "releaseTime": "2010-11-25T00:00:00+02:00", - "type": "old_alpha", - "processArguments": "legacy", - "+traits": ["legacyLaunch", "texturepacks"] - }, - { - "id": "a1.2.3_01", - "checksum": "70cbab762b17c5b11fefea9b12564119", - "releaseTime": "2010-11-24T00:00:01+02:00", - "type": "old_alpha", - "processArguments": "legacy", - "+traits": ["legacyLaunch", "texturepacks"] - }, - { - "id": "a1.2.3", - "checksum": "25f053114e34b915e675f82d58f08711", - "releaseTime": "2010-11-24T00:00:00+02:00", - "type": "old_alpha", - "processArguments": "legacy", - "+traits": ["legacyLaunch", "texturepacks"] - }, - { - "id": "a1.2.2b", - "checksum": "6250fb17f8898c4d970d6bd03c229177", - "releaseTime": "2010-11-10T00:00:01+02:00", - "type": "old_alpha", - "processArguments": "legacy", - "+traits": ["legacyLaunch", "texturepacks"] - }, - { - "id": "a1.2.2a", - "checksum": "0f9fe018b344fd9dd849005f9bdca803", - "releaseTime": "2010-11-10T00:00:00+02:00", - "type": "old_alpha", - "processArguments": "legacy", - "+traits": ["legacyLaunch", "texturepacks"] - }, - { - "id": "a1.2.1_01", - "checksum": "0a496e44a7b4e2f493b5893d8e5845bd", - "releaseTime": "2010-11-05T00:00:01+02:00", - "type": "old_alpha", - "processArguments": "legacy", - "+traits": ["legacyLaunch", "no-texturepacks"] - }, - { - "id": "a1.2.1", - "checksum": "0a496e44a7b4e2f493b5893d8e5845bd", - "releaseTime": "2010-11-05T00:00:00+02:00", - "type": "old_alpha", - "processArguments": "legacy", - "+traits": ["legacyLaunch", "no-texturepacks"] - }, - { - "id": "a1.2.0_02", - "checksum": "f5bcb4d0c0e78bc220f164b89ae9bd60", - "releaseTime": "2010-11-04T00:00:00+02:00", - "type": "old_alpha", - "processArguments": "legacy", - "+traits": ["legacyLaunch", "no-texturepacks"] - }, - { - "id": "a1.2.0_01", - "checksum": "b2e9333e967cb89488884c2e5c715d4f", - "releaseTime": "2010-10-31T00:00:00+02:00", - "type": "old_alpha", - "processArguments": "legacy", - "+traits": ["legacyLaunch", "no-texturepacks"] - }, - { - "id": "a1.2.0", - "checksum": "44c384dae02390f700458b95d82c3e2a", - "releaseTime": "2010-10-30T00:00:00+02:00", - "type": "old_alpha", - "processArguments": "legacy", - "+traits": ["legacyLaunch", "no-texturepacks"] - }, - { - "id": "a1.1.2_01", - "checksum": "94346e1b8f6ad0e4a284314f0e29207b", - "releaseTime": "2010-09-23T00:00:00+02:00", - "type": "old_alpha", - "processArguments": "legacy", - "+traits": ["legacyLaunch", "no-texturepacks"] - }, - { - "id": "a1.1.2", - "checksum": "72ba1f834327805cb44164a42b331522", - "releaseTime": "2010-09-20T00:00:00+02:00", - "type": "old_alpha", - "processArguments": "legacy", - "+traits": ["legacyLaunch", "no-texturepacks"] - }, - { - "id": "a1.1.0", - "checksum": "891fd93e04f5daaf35d73c58e45c01b1", - "releaseTime": "2010-09-13T00:00:00+02:00", - "type": "old_alpha", - "processArguments": "legacy", - "+traits": ["legacyLaunch", "no-texturepacks"] - }, - { - "id": "a1.0.17_04", - "checksum": "16ed7dc58244772847991e504afcf02f", - "releaseTime": "2010-08-23T00:00:00+02:00", - "type": "old_alpha", - "processArguments": "legacy", - "+traits": ["legacyLaunch", "no-texturepacks"] - }, - { - "id": "a1.0.17_02", - "checksum": "d89760b0871ef61a55c9f336c0439d58", - "releaseTime": "2010-08-20T00:00:00+02:00", - "type": "old_alpha", - "processArguments": "legacy", - "+traits": ["legacyLaunch", "no-texturepacks"] - }, - { - "id": "a1.0.16", - "checksum": "6bbde02c13aed5766275f4398ede6aae", - "releaseTime": "2010-08-12T00:00:00+02:00", - "type": "old_alpha", - "processArguments": "legacy", - "+traits": ["legacyLaunch", "no-texturepacks"] - }, - { - "id": "a1.0.15", - "checksum": "ade257d2080d56fa983763f9c701fa14", - "releaseTime": "2010-08-04T00:00:00+02:00", - "type": "old_alpha", - "processArguments": "legacy", - "+traits": ["legacyLaunch", "no-texturepacks"] - }, - { - "id": "a1.0.14", - "checksum": "227d0c6fa896a231de6269a074c9a458", - "releaseTime": "2010-07-30T00:00:00+02:00", - "type": "old_alpha", - "processArguments": "legacy", - "+traits": ["legacyLaunch", "no-texturepacks"] - }, - { - "id": "a1.0.11", - "checksum": "6f1b1dd157fa0df39760f5be3eab01b0", - "releaseTime": "2010-07-23T00:00:00+02:00", - "type": "old_alpha", - "processArguments": "legacy", - "+traits": ["legacyLaunch", "no-texturepacks"] - }, - { - "id": "a1.0.5_01", - "checksum": "ae5f606caa18222e7568819c910ee423", - "releaseTime": "2010-07-13T00:00:00+02:00", - "type": "old_alpha", - "processArguments": "legacy", - "mainClass": "y", - "+traits": ["legacyLaunch", "no-texturepacks"] - }, - { - "id": "a1.0.4", - "checksum": "13ce7935c3670e7494e26b2704bfa3e9", - "releaseTime": "2010-07-09T00:00:00+02:00", - "type": "old_alpha", - "processArguments": "legacy", - "mainClass": "ax", - "+traits": ["legacyLaunch", "no-texturepacks"] - }, - { - "id": "inf-20100618", - "checksum": "f5f5aa34760facc10486e906a7c60196", - "releaseTime": "2010-06-16T00:00:00+02:00", - "type": "old_alpha", - "processArguments": "legacy", - "mainClass": "net.minecraft.client.d", - "appletClass": "net.minecraft.client.MinecraftApplet", - "+traits": ["legacyLaunch", "no-texturepacks"] - }, - { - "id": "c0.30_01c", - "checksum": "fcfd7f83a6b27503cf48202381a5adf2", - "releaseTime": "2009-12-22T00:00:00+02:00", - "type": "old_alpha", - "processArguments": "legacy", - "mainClass": "com.mojang.minecraft.l", - "appletClass": "com.mojang.minecraft.MinecraftApplet", - "+traits": ["legacyLaunch", "no-texturepacks"] - }, - { - "id": "c0.0.13a_03", - "checksum": "a9527cb5aef198e0f53e235ebe13dc75", - "releaseTime": "2009-05-22T00:00:00+02:00", - "type": "old_alpha", - "processArguments": "legacy", - "mainClass": "com.mojang.minecraft.c", - "appletClass": "com.mojang.minecraft.MinecraftApplet", - "+traits": ["legacyLaunch", "no-texturepacks"] - }, - { - "id": "c0.0.13a", - "checksum": "3617fbf5fbfd2b837ebf5ceb63584908", - "releaseTime": "2009-05-31T00:00:00+02:00", - "type": "old_alpha", - "processArguments": "legacy", - "mainClass": "com.mojang.minecraft.Minecraft", - "appletClass": "com.mojang.minecraft.MinecraftApplet", - "+traits": ["legacyLaunch", "no-texturepacks"] - }, - { - "id": "c0.0.11a", - "checksum": "a6e03c2eaf74709facc0d2477648e999", - "releaseTime": "2009-05-17T00:00:00+02:00", - "type": "old_alpha", - "processArguments": "legacy", - "mainClass": "com.mojang.minecraft.Minecraft", - "appletClass": "com.mojang.minecraft.MinecraftApplet", - "+traits": ["legacyLaunch", "no-texturepacks"] - }, - { - "id": "rd-161348", - "checksum": "80882b8936a5c8d91500838a6660b504", - "releaseTime": "2009-05-16T13:48:00+02:00", - "type": "old_alpha", - "processArguments": "legacy", - "mainClass": "com.mojang.minecraft.RubyDung", - "+traits": ["no-texturepacks"] - }, - { - "id": "rd-160052", - "checksum": "24c5cc99a2a612697ed2f7d5d04242fe", - "releaseTime": "2009-05-16T00:52:00+02:00", - "type": "old_alpha", - "processArguments": "legacy", - "mainClass": "com.mojang.rubydung.RubyDung", - "+traits": ["no-texturepacks"] - }, - { - "id": "rd-132328", - "checksum": "70e33a81c541b13a477e68c1207124eb", - "releaseTime": "2009-05-13T23:28:00+02:00", - "type": "old_alpha", - "processArguments": "legacy", - "mainClass": "com.mojang.rubydung.RubyDung", - "+traits": ["no-texturepacks"] - }, - { - "id": "rd-132211", - "checksum": "99fdaea10c494b9c3c3254636b98b799", - "releaseTime": "2009-05-13T22:11:00+02:00", - "type": "old_alpha", - "processArguments": "legacy", - "mainClass": "com.mojang.rubydung.RubyDung", - "+traits": ["no-texturepacks"] - } -] -} diff --git a/resources/versions/versions.qrc b/resources/versions/versions.qrc deleted file mode 100644 index e9621e97..00000000 --- a/resources/versions/versions.qrc +++ /dev/null @@ -1,12 +0,0 @@ - - - - - minecraft.json - - LWJGL/2.9.0.json - LWJGL/2.9.1-nightly-20130708-debug3.json - LWJGL/2.9.1.json - LWJGL/2.9.2-nightly-20140822.json - - diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index e891c379..2cf9e7cb 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,7 +1,8 @@ # run the unit tests with `make test` find_package(Qt5 COMPONENTS Test Core Network) -include_directories(${MMC_SRC}) +include_directories(../logic) +include_directories(../depends/util/include/) unset(MultiMC_TESTS) macro(add_unit_test name) @@ -14,7 +15,7 @@ macro(add_unit_test name) endforeach() add_executable(tst_${name} ${srcs}) qt5_use_modules(tst_${name} Test Core Network) - target_link_libraries(tst_${name} MultiMC_common) + target_link_libraries(tst_${name} MultiMC_logic) list(APPEND MultiMC_TESTS tst_${name}) add_test(NAME ${name} COMMAND tst_${name}) endmacro() @@ -38,9 +39,9 @@ set(COVERAGE_SOURCE_DIRS ${MMC_SRC}/logic/lists/* ${MMC_SRC}/logic/net/* ${MMC_SRC}/logic/tasks/* - ${MMC_SRC}/gui/* - ${MMC_SRC}/gui/dialogs/* - ${MMC_SRC}/gui/widgets/* + ${MMC_SRC}/application/* + ${MMC_SRC}/application/dialogs/* + ${MMC_SRC}/application/widgets/* ${MMC_SRC}/depends/settings/include/* ${MMC_SRC}/depends/settings/src/* ${MMC_SRC}/depends/util/include/* diff --git a/tests/tst_DownloadTask.cpp b/tests/tst_DownloadTask.cpp index 9c87b027..9482b666 100644 --- a/tests/tst_DownloadTask.cpp +++ b/tests/tst_DownloadTask.cpp @@ -3,10 +3,10 @@ #include "TestUtil.h" -#include "logic/updater/GoUpdate.h" -#include "logic/updater/DownloadTask.h" -#include "logic/updater/UpdateChecker.h" -#include "depends/util/include/pathutils.h" +#include "updater/GoUpdate.h" +#include "updater/DownloadTask.h" +#include "updater/UpdateChecker.h" +#include "pathutils.h" using namespace GoUpdate; diff --git a/tests/tst_UpdateChecker.cpp b/tests/tst_UpdateChecker.cpp index d212f79b..42d44e77 100644 --- a/tests/tst_UpdateChecker.cpp +++ b/tests/tst_UpdateChecker.cpp @@ -2,7 +2,7 @@ #include #include "TestUtil.h" -#include "logic/updater/UpdateChecker.h" +#include "updater/UpdateChecker.h" Q_DECLARE_METATYPE(UpdateChecker::ChannelListEntry) diff --git a/tests/tst_gradlespecifier.cpp b/tests/tst_gradlespecifier.cpp index 56c29b85..146c9838 100644 --- a/tests/tst_gradlespecifier.cpp +++ b/tests/tst_gradlespecifier.cpp @@ -1,7 +1,7 @@ #include #include "TestUtil.h" -#include "logic/minecraft/GradleSpecifier.h" +#include "minecraft/GradleSpecifier.h" class GradleSpecifierTest : public QObject { diff --git a/tests/tst_inifile.cpp b/tests/tst_inifile.cpp index 6bec32f5..94b5e559 100644 --- a/tests/tst_inifile.cpp +++ b/tests/tst_inifile.cpp @@ -1,7 +1,7 @@ #include #include "TestUtil.h" -#include "logic/settings/INIFile.h" +#include "settings/INIFile.h" class IniFileTest : public QObject { diff --git a/tests/tst_pathutils.cpp b/tests/tst_pathutils.cpp index eed5b560..bccc6dca 100644 --- a/tests/tst_pathutils.cpp +++ b/tests/tst_pathutils.cpp @@ -1,7 +1,7 @@ #include #include "TestUtil.h" -#include "depends/util/include/pathutils.h" +#include "pathutils.h" class PathUtilsTest : public QObject { diff --git a/tests/tst_userutils.cpp b/tests/tst_userutils.cpp index 893e064e..bc7644f3 100644 --- a/tests/tst_userutils.cpp +++ b/tests/tst_userutils.cpp @@ -2,7 +2,7 @@ #include #include "TestUtil.h" -#include "depends/util/include/userutils.h" +#include "userutils.h" class UserUtilsTest : public QObject { diff --git a/translations/CMakeLists.txt b/translations/CMakeLists.txt deleted file mode 100644 index c5ae65a6..00000000 --- a/translations/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -set_directory_properties(PROPERTIES CLEAN_NO_CUSTOM 1) - -### translation stuff - -file(GLOB TRANSLATION_FILES ${CMAKE_CURRENT_LIST_DIR}/*.ts) - -qt5_create_translation(TRANSLATION_MESSAGES ${FILES_TO_TRANSLATE} ${TRANSLATION_FILES}) -qt5_add_translation(TRANSLATION_QM ${TRANSLATION_FILES}) -add_custom_target(translations_update DEPENDS ${TRANSLATION_MESSAGES}) -add_custom_target(translations DEPENDS ${TRANSLATION_QM}) - -if(APPLE AND UNIX) ## OSX - install(FILES ${TRANSLATION_QM} DESTINATION MultiMC.app/Contents/Resources/translations) -else() - install(FILES ${TRANSLATION_QM} DESTINATION translations) -endif() -- cgit