├── .clang-format ├── .editorconfig ├── .git-blame-ignore-revs ├── .gitattributes ├── .github ├── ISSUE_TEMPLATE │ ├── dev-ticket.md │ ├── feature_request.md │ ├── game-support-request.md │ └── issue-report.md └── workflows │ ├── build.yml │ └── linting.yml ├── .gitignore ├── .hgignore ├── .tx └── config ├── CMakeLists.txt ├── LICENSE ├── SConstruct ├── appveyor.yml ├── dump_running_process.bat ├── mappings.imp ├── massage_messages.py ├── modorganizer.natvis ├── qt5_4.imp ├── readme.md ├── scons_configure_template.py ├── src ├── CMakeLists.txt ├── Doxyfile ├── ModOrganizer.pro ├── SConscript ├── aboutdialog.cpp ├── aboutdialog.h ├── aboutdialog.ui ├── activatemodsdialog.cpp ├── activatemodsdialog.h ├── activatemodsdialog.ui ├── apiuseraccount.cpp ├── apiuseraccount.h ├── app_icon.rc ├── archivefiletree.cpp ├── archivefiletree.h ├── bbcode.cpp ├── bbcode.h ├── browserdialog.cpp ├── browserdialog.h ├── browserdialog.ui ├── browserview.cpp ├── browserview.h ├── categories.cpp ├── categories.h ├── categoriesdialog.cpp ├── categoriesdialog.h ├── categoriesdialog.ui ├── categoriestable.cpp ├── categoriestable.h ├── categoryimportdialog.cpp ├── categoryimportdialog.h ├── categoryimportdialog.ui ├── colortable.cpp ├── colortable.h ├── commandline.cpp ├── commandline.h ├── copyeventfilter.cpp ├── copyeventfilter.h ├── createinstancedialog.cpp ├── createinstancedialog.h ├── createinstancedialog.ui ├── createinstancedialogpages.cpp ├── createinstancedialogpages.h ├── credentialsdialog.cpp ├── credentialsdialog.h ├── credentialsdialog.ui ├── csvbuilder.cpp ├── csvbuilder.h ├── datatab.cpp ├── datatab.h ├── directoryrefresher.cpp ├── directoryrefresher.h ├── disableproxyplugindialog.cpp ├── disableproxyplugindialog.h ├── disableproxyplugindialog.ui ├── dlls.manifest.debug.qt6 ├── dlls.manifest.qt6 ├── downloadlist.cpp ├── downloadlist.h ├── downloadlistview.cpp ├── downloadlistview.h ├── downloadmanager.cpp ├── downloadmanager.h ├── downloadmanagerproxy.cpp ├── downloadmanagerproxy.h ├── downloadstab.cpp ├── downloadstab.h ├── editexecutablesdialog.cpp ├── editexecutablesdialog.h ├── editexecutablesdialog.ui ├── env.cpp ├── env.h ├── envdump.h ├── envfs.cpp ├── envfs.h ├── envmetrics.cpp ├── envmetrics.h ├── envmodule.cpp ├── envmodule.h ├── envsecurity.cpp ├── envsecurity.h ├── envshell.cpp ├── envshell.h ├── envshortcut.cpp ├── envshortcut.h ├── envwindows.cpp ├── envwindows.h ├── executableslist.cpp ├── executableslist.h ├── filedialogmemory.cpp ├── filedialogmemory.h ├── filerenamer.cpp ├── filerenamer.h ├── filetree.cpp ├── filetree.h ├── filetreeitem.cpp ├── filetreeitem.h ├── filetreemodel.cpp ├── filetreemodel.h ├── filterlist.cpp ├── filterlist.h ├── forcedloaddialog.cpp ├── forcedloaddialog.h ├── forcedloaddialog.ui ├── forcedloaddialogwidget.cpp ├── forcedloaddialogwidget.h ├── forcedloaddialogwidget.ui ├── game_features.cpp ├── game_features.h ├── gamefeaturesproxy.cpp ├── gamefeaturesproxy.h ├── genericicondelegate.cpp ├── genericicondelegate.h ├── glob_matching.h ├── icondelegate.cpp ├── icondelegate.h ├── iconfetcher.cpp ├── iconfetcher.h ├── installationmanager.cpp ├── installationmanager.h ├── instancemanager.cpp ├── instancemanager.h ├── instancemanagerdialog.cpp ├── instancemanagerdialog.h ├── instancemanagerdialog.ui ├── iuserinterface.h ├── json.h ├── lcdnumber.cpp ├── lcdnumber.h ├── listdialog.cpp ├── listdialog.h ├── listdialog.ui ├── loghighlighter.cpp ├── loghighlighter.h ├── loglist.cpp ├── loglist.h ├── loot.cpp ├── loot.h ├── lootdialog.cpp ├── lootdialog.h ├── lootdialog.ui ├── main.cpp ├── main.patch ├── mainwindow.cpp ├── mainwindow.h ├── mainwindow.ui ├── messagedialog.cpp ├── messagedialog.h ├── messagedialog.ui ├── mo_icon.ico ├── moapplication.cpp ├── moapplication.h ├── modconflicticondelegate.cpp ├── modconflicticondelegate.h ├── modcontenticondelegate.cpp ├── modcontenticondelegate.h ├── modelutils.cpp ├── modelutils.h ├── modflagicondelegate.cpp ├── modflagicondelegate.h ├── modidlineedit.cpp ├── modidlineedit.h ├── modinfo.cpp ├── modinfo.h ├── modinfobackup.cpp ├── modinfobackup.h ├── modinfodialog.cpp ├── modinfodialog.h ├── modinfodialog.ui ├── modinfodialogcategories.cpp ├── modinfodialogcategories.h ├── modinfodialogconflicts.cpp ├── modinfodialogconflicts.h ├── modinfodialogconflictsmodels.cpp ├── modinfodialogconflictsmodels.h ├── modinfodialogesps.cpp ├── modinfodialogesps.h ├── modinfodialogfiletree.cpp ├── modinfodialogfiletree.h ├── modinfodialogfwd.h ├── modinfodialogimages.cpp ├── modinfodialogimages.h ├── modinfodialognexus.cpp ├── modinfodialognexus.h ├── modinfodialogtab.cpp ├── modinfodialogtab.h ├── modinfodialogtextfiles.cpp ├── modinfodialogtextfiles.h ├── modinfoforeign.cpp ├── modinfoforeign.h ├── modinfooverwrite.cpp ├── modinfooverwrite.h ├── modinforegular.cpp ├── modinforegular.h ├── modinfoseparator.cpp ├── modinfoseparator.h ├── modinfowithconflictinfo.cpp ├── modinfowithconflictinfo.h ├── modlist.cpp ├── modlist.h ├── modlistbypriorityproxy.cpp ├── modlistbypriorityproxy.h ├── modlistcontextmenu.cpp ├── modlistcontextmenu.h ├── modlistdropinfo.cpp ├── modlistdropinfo.h ├── modlistproxy.cpp ├── modlistproxy.h ├── modlistsortproxy.cpp ├── modlistsortproxy.h ├── modlistversiondelegate.cpp ├── modlistversiondelegate.h ├── modlistview.cpp ├── modlistview.h ├── modlistviewactions.cpp ├── modlistviewactions.h ├── moshortcut.cpp ├── moshortcut.h ├── motddialog.cpp ├── motddialog.h ├── motddialog.ui ├── multiprocess.cpp ├── multiprocess.h ├── nexusinterface.cpp ├── nexusinterface.h ├── nexusmanualkey.ui ├── noeditdelegate.cpp ├── noeditdelegate.h ├── nxmaccessmanager.cpp ├── nxmaccessmanager.h ├── organizer.pro ├── organizer.qbs ├── organizer_en.ts ├── organizercore.cpp ├── organizercore.h ├── organizerproxy.cpp ├── organizerproxy.h ├── overwriteinfodialog.cpp ├── overwriteinfodialog.h ├── overwriteinfodialog.ui ├── pch.cpp ├── pch.h ├── persistentcookiejar.cpp ├── persistentcookiejar.h ├── plugincontainer.cpp ├── plugincontainer.h ├── pluginlist.cpp ├── pluginlist.h ├── pluginlistcontextmenu.cpp ├── pluginlistcontextmenu.h ├── pluginlistproxy.cpp ├── pluginlistproxy.h ├── pluginlistsortproxy.cpp ├── pluginlistsortproxy.h ├── pluginlistview.cpp ├── pluginlistview.h ├── previewdialog.cpp ├── previewdialog.h ├── previewdialog.ui ├── previewgenerator.cpp ├── previewgenerator.h ├── problemsdialog.cpp ├── problemsdialog.h ├── problemsdialog.ui ├── processrunner.cpp ├── processrunner.h ├── profile.cpp ├── profile.h ├── profileinputdialog.cpp ├── profileinputdialog.h ├── profileinputdialog.ui ├── profilesdialog.cpp ├── profilesdialog.h ├── profilesdialog.ui ├── proxyutils.h ├── qdirfiletree.cpp ├── qdirfiletree.h ├── qt.conf ├── qtgroupingproxy.cpp ├── qtgroupingproxy.h ├── queryoverwritedialog.cpp ├── queryoverwritedialog.h ├── queryoverwritedialog.ui ├── resources.qrc ├── resources │ ├── accessories-text-editor.png │ ├── application-x-executable.png │ ├── applications-accessories.png │ ├── archive-conflict-loser.png │ ├── archive-conflict-mixed.png │ ├── archive-conflict-neutral.png │ ├── archive-conflict-winner.png │ ├── arrange-boxes.png │ ├── badge_1.png │ ├── badge_2.png │ ├── badge_3.png │ ├── badge_4.png │ ├── badge_5.png │ ├── badge_6.png │ ├── badge_7.png │ ├── badge_8.png │ ├── badge_9.png │ ├── badge_more.png │ ├── branch-closed.png │ ├── branch-open.png │ ├── check.png │ ├── combobox-down.png │ ├── conflict-hidden.png │ ├── conflict-mixed-blue.png │ ├── conflict-mixed.png │ ├── conflict-overwrite-blue.png │ ├── conflict-overwrite.png │ ├── conflict-overwritten-blue.png │ ├── conflict-overwritten.png │ ├── conflict-redundant.png │ ├── contact-new.png │ ├── contents │ │ ├── breastplate.png │ │ ├── checkbox-tree.png │ │ ├── config.png │ │ ├── conversation.png │ │ ├── double-quaver.png │ │ ├── empty-chessboard.png │ │ ├── f4-nuclear.png │ │ ├── facegen.png │ │ ├── feather-and-scroll.png │ │ ├── hand-of-god.png │ │ ├── jigsaw-piece.png │ │ ├── locked-chest.png │ │ ├── lyre.png │ │ ├── media.png │ │ ├── mesh-box.png │ │ ├── tinker.png │ │ ├── usable.png │ │ └── xedit.png │ ├── dialog-information.png │ ├── dialog-warning.png │ ├── dialog-warning_16.png │ ├── dialog-warning_16.png (warning_16) │ ├── document-properties.png │ ├── document-save.png │ ├── document-save_32.png │ ├── dynamic-blue-right.png │ ├── edit-clear.png │ ├── edit-find-replace.png │ ├── edit-undo.png │ ├── emblem-favorite - 64.png │ ├── emblem-favorite.png │ ├── emblem-important.png │ ├── emblem-readonly.png │ ├── emblem-redundant.png │ ├── emblem-unreadable.png │ ├── error.png │ ├── function.png │ ├── game-warning-16.png │ ├── game-warning.png │ ├── go-down.png │ ├── go-jump.png │ ├── go-next_16.png │ ├── go-previous_16.png │ ├── go-up.png │ ├── help-browser.png │ ├── help-browser_32.png │ ├── icon-favorite.png │ ├── icons8-checked-checkbox.png │ ├── icons8-indeterminate-checkbox.png │ ├── icons8-unchecked-checkbox.png │ ├── internet-web-browser.png │ ├── list-add.png │ ├── list-remove.png │ ├── log-debug.png │ ├── mail-attachment.png │ ├── markdown.html │ ├── media-playback-start.png │ ├── mo_icon.png │ ├── multiply-red.png │ ├── open-Folder-Icon.png │ ├── package.png │ ├── plugins.png │ ├── preferences-system.png │ ├── process-stop.png │ ├── red-archive-conflict-loser.png │ ├── save.svg │ ├── show.png │ ├── software-update-available.png │ ├── start-here.png │ ├── status_active.png │ ├── status_awaiting.png │ ├── status_inactive.png │ ├── switch-instance-icon.png │ ├── symbol-backup.png │ ├── system-installer.png │ ├── system-search.png │ ├── system-software-update.png │ ├── tracked.png │ ├── view-refresh.png │ ├── view-refresh_16.png │ ├── word-wrap.svg │ └── x-office-calendar.png ├── sanitychecks.cpp ├── sanitychecks.h ├── savestab.cpp ├── savestab.h ├── savetextasdialog.cpp ├── savetextasdialog.h ├── savetextasdialog.ui ├── selectiondialog.cpp ├── selectiondialog.h ├── selectiondialog.ui ├── selfupdater.cpp ├── selfupdater.h ├── serverinfo.cpp ├── serverinfo.h ├── settings.cpp ├── settings.h ├── settingsdialog.cpp ├── settingsdialog.h ├── settingsdialog.ui ├── settingsdialogdiagnostics.cpp ├── settingsdialogdiagnostics.h ├── settingsdialoggeneral.cpp ├── settingsdialoggeneral.h ├── settingsdialogmodlist.cpp ├── settingsdialogmodlist.h ├── settingsdialognexus.cpp ├── settingsdialognexus.h ├── settingsdialogpaths.cpp ├── settingsdialogpaths.h ├── settingsdialogplugins.cpp ├── settingsdialogplugins.h ├── settingsdialogtheme.cpp ├── settingsdialogtheme.h ├── settingsdialogworkarounds.cpp ├── settingsdialogworkarounds.h ├── settingsutilities.cpp ├── settingsutilities.h ├── shared │ ├── SConscript │ ├── appconfig.cpp │ ├── appconfig.h │ ├── appconfig.inc │ ├── directoryentry.cpp │ ├── directoryentry.h │ ├── fileentry.cpp │ ├── fileentry.h │ ├── fileregister.cpp │ ├── fileregister.h │ ├── fileregisterfwd.h │ ├── filesorigin.cpp │ ├── filesorigin.h │ ├── originconnection.cpp │ ├── originconnection.h │ ├── shared.pro │ ├── shared.qbs │ ├── util.cpp │ ├── util.h │ ├── windows_error.cpp │ └── windows_error.h ├── spawn.cpp ├── spawn.h ├── splash.png ├── statusbar.cpp ├── statusbar.h ├── stylesheet_resource.qrc ├── stylesheets │ ├── Night Eyes.qss │ ├── Parchment v1.1 by Bob.qss │ ├── Parchment │ │ ├── checkbox-alt-checked.png │ │ ├── checkbox-alt-unchecked-hover.png │ │ ├── checkbox-alt-unchecked.png │ │ ├── checkbox-checked-disabled.png │ │ ├── checkbox-checked-hover.png │ │ ├── checkbox-checked.png │ │ ├── checkbox-disabled.png │ │ ├── checkbox-hover.png │ │ └── checkbox.png │ ├── dark.qss │ ├── dracula.qss │ ├── skyrim.qss │ ├── skyrim │ │ ├── arrow-down.png │ │ ├── arrow-left.png │ │ ├── arrow-right.png │ │ ├── arrow-up.png │ │ ├── border-image.png │ │ ├── border-image1.png │ │ ├── border-image2.png │ │ ├── branch-opened.png │ │ ├── button-big-border.png │ │ ├── button-border.png │ │ ├── button-checked-border.png │ │ ├── checkbox-alt-checked.png │ │ ├── checkbox-alt-unchecked-hover.png │ │ ├── checkbox-alt-unchecked.png │ │ ├── checkbox-checked-disabled.png │ │ ├── checkbox-checked-hover.png │ │ ├── checkbox-checked.png │ │ ├── checkbox-disabled.png │ │ ├── checkbox-hover.png │ │ ├── checkbox.png │ │ ├── context-menu-separator.png │ │ ├── progress-bar-border.png │ │ ├── progress-bar-chunk.png │ │ ├── radio-checked.png │ │ ├── radio-hover.png │ │ ├── radio.png │ │ ├── scrollbar-down.png │ │ ├── scrollbar-horizontal.png │ │ ├── scrollbar-left.png │ │ ├── scrollbar-right.png │ │ ├── scrollbar-up.png │ │ ├── scrollbar-vertical.png │ │ ├── separator.png │ │ ├── slider-border.png │ │ └── slider-handle.png │ ├── vs15 Dark-Green.qss │ ├── vs15 Dark-Orange.qss │ ├── vs15 Dark-Pink.qss │ ├── vs15 Dark-Purple.qss │ ├── vs15 Dark-Red.qss │ ├── vs15 Dark-Yellow.qss │ ├── vs15 Dark.qss │ └── vs15 │ │ ├── branch-closed.png │ │ ├── branch-open.png │ │ ├── checkbox-check-disabled.png │ │ ├── checkbox-check.png │ │ ├── combobox-down.png │ │ ├── scrollbar-down-disabled.png │ │ ├── scrollbar-down-hover.png │ │ ├── scrollbar-down.png │ │ ├── scrollbar-left-disabled.png │ │ ├── scrollbar-left-hover.png │ │ ├── scrollbar-left.png │ │ ├── scrollbar-right-disabled.png │ │ ├── scrollbar-right-hover.png │ │ ├── scrollbar-right.png │ │ ├── scrollbar-up-disabled.png │ │ ├── scrollbar-up-hover.png │ │ ├── scrollbar-up.png │ │ ├── sort-asc.png │ │ ├── sort-desc.png │ │ ├── spinner-down.png │ │ ├── spinner-up.png │ │ ├── sub-menu-arrow-hover.png │ │ └── sub-menu-arrow.png ├── syncoverwritedialog.cpp ├── syncoverwritedialog.h ├── syncoverwritedialog.ui ├── texteditor.cpp ├── texteditor.h ├── thread_utils.h ├── transfersavesdialog.cpp ├── transfersavesdialog.h ├── transfersavesdialog.ui ├── tutorials │ ├── Highlight.qml │ ├── Tooltip.qml │ ├── TooltipArea.qml │ ├── TutorialCanceller.qml │ ├── TutorialDescription.qml │ ├── TutorialOverlay.qml │ ├── tutorial_basics.js │ ├── tutorial_conflictresolution_main.js │ ├── tutorial_conflictresolution_modinfo.js │ ├── tutorial_firststeps.js │ ├── tutorial_firststeps_browser.js │ ├── tutorial_firststeps_main.js │ ├── tutorial_firststeps_modinfo.js │ ├── tutorial_firststeps_settings.js │ ├── tutorial_primer_main.js │ ├── tutorial_window_installer.js │ ├── tutorials.js │ ├── tutorials_installdialog.qml │ ├── tutorials_mainwindow.qml │ ├── tutorials_modinfodialog.qml │ ├── tutorials_nexusdialog.qml │ └── tutorials_settingsdialog.qml ├── uilocker.cpp ├── uilocker.h ├── updatedialog.cpp ├── updatedialog.h ├── updatedialog.ui ├── usvfsconnector.cpp ├── usvfsconnector.h ├── validationprogressdialog.ui ├── version.rc ├── viewmarkingscrollbar.cpp ├── viewmarkingscrollbar.h ├── virtualfiletree.cpp └── virtualfiletree.h └── win.imp /.clang-format: -------------------------------------------------------------------------------- 1 | --- 2 | # We'll use defaults from the LLVM style, but with 4 columns indentation. 3 | BasedOnStyle: LLVM 4 | IndentWidth: 2 5 | --- 6 | Language: Cpp 7 | DeriveLineEnding: false 8 | UseCRLF: true 9 | DerivePointerAlignment: false 10 | PointerAlignment: Left 11 | AlignConsecutiveAssignments: true 12 | AllowShortFunctionsOnASingleLine: Inline 13 | AllowShortIfStatementsOnASingleLine: Never 14 | AllowShortLambdasOnASingleLine: Empty 15 | AlwaysBreakTemplateDeclarations: Yes 16 | AccessModifierOffset: -2 17 | AlignTrailingComments: true 18 | SpacesBeforeTrailingComments: 2 19 | NamespaceIndentation: Inner 20 | MaxEmptyLinesToKeep: 1 21 | BreakBeforeBraces: Custom 22 | BraceWrapping: 23 | AfterCaseLabel: false 24 | AfterClass: true 25 | AfterControlStatement: false 26 | AfterEnum: true 27 | AfterFunction: true 28 | AfterNamespace: true 29 | AfterStruct: true 30 | AfterUnion: true 31 | AfterExternBlock: true 32 | BeforeCatch: false 33 | BeforeElse: false 34 | BeforeLambdaBody: false 35 | BeforeWhile: false 36 | IndentBraces: false 37 | SplitEmptyFunction: false 38 | SplitEmptyRecord: false 39 | SplitEmptyNamespace: true 40 | ColumnLimit: 88 41 | ForEachMacros: ['Q_FOREACH', 'foreach'] 42 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*.cpp] 4 | indent_style = space 5 | indent_size = 2 6 | insert_final_newline = true 7 | 8 | [*.h] 9 | indent_style = space 10 | indent_size = 2 11 | insert_final_newline = true 12 | 13 | [*.ui] 14 | indent_style = space 15 | indent_size = 2 16 | insert_final_newline = true 17 | -------------------------------------------------------------------------------- /.git-blame-ignore-revs: -------------------------------------------------------------------------------- 1 | d13f6bb870cdda71257f665367be8ef9fca86255 2 | 86bb01ba9eac879d3685c439ac9da0028bc4bc80 3 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Set the default behavior, in case people don't have core.autocrlf set. 2 | * text=auto 3 | 4 | # Explicitly declare text files you want to always be normalized and converted 5 | # to native line endings on checkout. 6 | *.cpp text eol=crlf 7 | *.h text eol=crlf 8 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/dev-ticket.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Dev Ticket 3 | about: Reserved for development tasks and management. 4 | title: '' 5 | labels: Dev Ticket 6 | assignees: '' 7 | 8 | --- 9 | 10 | Task: 11 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: Feature Request 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/game-support-request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Game support Request 3 | about: Request support for a new game 4 | title: Add support for game [GAME NAME] 5 | labels: 'Feature Request, additional games support, area: mo2 game plugins' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **This template is useful to add basic support using https://github.com/ModOrganizer2/modorganizer-basic_games.** 11 | 12 | **If you are vaguely familiar with programming you can try following the instructions on that link to get something working yourself. If you have trouble with that please fill in this template.** 13 | 14 | **Please provide the following information for the game (remove the optional lines you do not use):** 15 | 16 | - **Name:** Name of the game 17 | - **Short name:** Name of the game in Nexus URL (e.g. skyrimse for Skyrim SE). 18 | - **Nexus ID [optional]:** ID of the game on Nexus (you can usually find this in Nexus URL). 19 | - **Executable:** Name of the main executable for the game (relative to the game folder). 20 | - **Launcher [optional]:** Name of the game launcher (relative to the game folder). 21 | - **Data path:** Path to the data folder of the game (relative to the game folder). Please note that the Virtual Files System often does not work for top level dlls or exe files. 22 | - **Documents path:** Path to folder containing INI files, etc., for the game (usually under "My Games", or the game folder itself). 23 | - **Saves directory [optional]:** Path to the folder containing save games (this default to the path above). 24 | - **Save extension [optional]:** Extension of the saves 25 | - **Steam ID [optional]:** ID of the game on Steam (if the game is on Steam). 26 | 27 | **Provide additional details regarding the game that could be required for the plugin.** 28 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/issue-report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Issue Report 3 | about: Create an issue report. 4 | title: '' 5 | labels: issue report 6 | assignees: '' 7 | 8 | --- 9 | 10 | ## The problem: 11 | Briefly describe the issue you are experiencing. Tell us what you were trying to do and what happened instead. Remember, this is _not_ a place to ask questions. For that, go to our [Discord server](https://discord.gg/ewUVAqyrQX). 12 | 13 | 14 | ## To Reproduce: 15 | Steps to reproduce the behavior: 16 | 17 | 1. Go to '...' 18 | 2. Click on '....' 19 | 20 | ## Environment: 21 | 22 | * Mod Organizer Version that exhibits the issue: 23 | * Last Mod Organizer Version that did not exhibit the issue (if applicable): 24 | * Desktop OS/version used to run Mod Organizer: 25 | 26 | ## Details: 27 | If necessary, describe the problem you have been experiencing with more details and pictures. 28 | 29 | 30 | ## Link to Mod Organizer logs: 31 | Right click on the log window at the bottom of MO2, set log level to debug, restart Mo2 and reproduce the problem. 32 | To access the log files you can press the Open folder icon over the modlist and select "Open MO2 Logs folder". 33 | 34 | ### USVFS: 35 | Create a [GIST](https://gist.github.com) which is a paste of your latest USVFS log, and link them here. 36 | Do _NOT_ paste your full USVFS logs here, as it will make this issue very long and hard to read! 37 | If you are reporting a bug, _always_ include the USVFS logs! 38 | 39 | ### MO Interface: 40 | Create a [GIST](https://gist.github.com) which is a paste of your mo_interface logs, and link them here. 41 | Do _NOT_ paste your full mo_interface logs here, as it will make this issue very long and hard to read! 42 | If you are reporting a bug, _always_ include the mo_interface logs! 43 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: Build ModOrganizer 2 2 | 3 | on: 4 | push: 5 | branches: master 6 | pull_request: 7 | types: [opened, synchronize, reopened] 8 | 9 | jobs: 10 | build: 11 | runs-on: windows-2022 12 | steps: 13 | - name: Build ModOrganizer 2 14 | uses: ModOrganizer2/build-with-mob-action@master 15 | with: 16 | qt-modules: qtpositioning qtwebchannel qtwebengine qtwebsockets 17 | mo2-third-parties: 18 | 7z zlib gtest libbsarch libloot openssl bzip2 python lz4 spdlog 19 | boost boost-di sip pyqt pybind11 ss licenses explorerpp DirectXTex 20 | mo2-dependencies: usvfs cmake_common uibase githubpp bsatk esptk archive lootcli game_gamebryo 21 | -------------------------------------------------------------------------------- /.github/workflows/linting.yml: -------------------------------------------------------------------------------- 1 | name: Lint ModOrganizer 2 2 | 3 | on: 4 | push: 5 | pull_request: 6 | types: [opened, synchronize, reopened] 7 | 8 | jobs: 9 | lint: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - uses: actions/checkout@v3 13 | - name: Check format 14 | uses: ModOrganizer2/check-formatting-action@master 15 | with: 16 | check-path: "." 17 | exclude-regex: "third-party" 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.user 2 | Thumbs.db 3 | src/moc_*.cpp 4 | src/ui_*.h 5 | src/*.qrc.depends 6 | src/Modorganizer.* 7 | src/*.bak 8 | CMakeLists.txt.user 9 | edit 10 | /CMakeFiles 11 | .idea 12 | /msbuild.log 13 | /*std*.log 14 | /*build 15 | 16 | /src/version.aps 17 | -------------------------------------------------------------------------------- /.hgignore: -------------------------------------------------------------------------------- 1 | syntax: glob 2 | scons_configure.py 3 | scons-ModOrganizer-* 4 | ModOrganizer-build-desktop* 5 | outputd/* 6 | output/* 7 | build-ModOrganizer-* 8 | source/NCC/*/bin 9 | source/NCC/*/obj 10 | source/NCC/bin 11 | *.orig 12 | source/plugins/proxyPython/build 13 | staging/* 14 | source - Copy/* 15 | ModOrganizer-build-* 16 | pdbs/* 17 | source/NCC/BossDummy.x/* 18 | *.ts 19 | staging_prepare/* 20 | staging_trans/* 21 | tools/python_zip/* 22 | Makefile 23 | html 24 | *.vcxproj 25 | *.pdb 26 | *.dll 27 | *.exp 28 | *.tlog 29 | *.user 30 | *.obj 31 | *.suo 32 | *.sln 33 | *.log 34 | *.filters 35 | *.lib 36 | source/organizer/resources/contents/icons 37 | source/plugins/build-* 38 | */GeneratedFiles/* 39 | translations/* 40 | source/LocalPaths.pri 41 | source/*/Win32/Debug/* 42 | source/plugins/*/Win32/Debug/* 43 | *~ 44 | syntax: regexp 45 | Makefile\.(Debug|Release) 46 | source/.*/debug/.* 47 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.16) 2 | 3 | # TODO: move these to cmake_common? 4 | set(OPENSSL_USE_STATIC_LIBS FALSE CACHE STRING "" FORCE) 5 | set(MySQL_INCLUDE_DIRS CACHE STRING "" FORCE) 6 | 7 | if(DEFINED DEPENDENCIES_DIR) 8 | include(${DEPENDENCIES_DIR}/modorganizer_super/cmake_common/mo2.cmake) 9 | else() 10 | include(${CMAKE_CURRENT_LIST_DIR}/../cmake_common/mo2.cmake) 11 | endif() 12 | 13 | project(organizer) 14 | add_subdirectory(src) 15 | 16 | install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/dump_running_process.bat DESTINATION bin) 17 | -------------------------------------------------------------------------------- /dump_running_process.bat: -------------------------------------------------------------------------------- 1 | pushd "%~dp0" 2 | start ModOrganizer.exe crashdump 3 | -------------------------------------------------------------------------------- /scons_configure_template.py: -------------------------------------------------------------------------------- 1 | # This python script contains the configuration for scons 2 | # Copy this to scons_configure.py and adjust to taste. 3 | 4 | # Path to your boost install - it should have a boost/ subdirectory and a stage/ 5 | # subdirectory. The scons script will use stage/lib if there, or the appropriate 6 | # version for your compiler, if you installed the multiple-build version 7 | BOOSTPATH = r"C:\Apps\boost_1_55_0" 8 | 9 | # Version of Visual Studio to use, if you wish to use a specific version. If you 10 | # don't specify a version, the latest will be picked.. See the scons manual for 11 | # supported values. 12 | #MSVC_VERSION = '10.0Exp' 13 | 14 | # Path to your python install 15 | # You don't really need to set this up but you might if (say) you have a 32- and 16 | # 64-bit python install and scons has been installed for the 64 bit version 17 | #PYTHONPATH=r"C:\Apps\Python" 18 | 19 | # Path to your QT install. This might constrain the version of MSVC you can use. 20 | # This seems to be set by QTCreator 21 | #QTDIR = r"C:\Apps\Qt\4.8.6" 22 | 23 | # Path to 7-zip sources 24 | SEVENZIPPATH = r"C:\Apps\7-Zip\7z920" 25 | 26 | # Path to zlib. Please read the README file for more information about how this 27 | # needs to be set up 28 | ZLIBPATH = r"C:\Apps\zlib-1.2.8" 29 | 30 | # Source control programs. Sadly I can't get this information from qt, even 31 | # though you have to set it up in the configuration 32 | GIT = r"C:\Program Files\git\bin\git.exe" 33 | MERCURIAL = r"C:\Program Files\TortoiseHg\hg.exe" 34 | -------------------------------------------------------------------------------- /src/ModOrganizer.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = subdirs 2 | 3 | SUBDIRS = bsatk \ 4 | shared \ 5 | uibase \ 6 | esptk \ 7 | organizer \ 8 | hookdll \ 9 | archive \ 10 | helper \ 11 | plugins \ 12 | nxmhandler \ 13 | BossDummy \ 14 | pythonRunner \ 15 | loot_cli 16 | 17 | pythonRunner.depends = uibase 18 | plugins.depends = pythonRunner uibase 19 | hookdll.depends = shared 20 | organizer.depends = shared uibase plugins 21 | 22 | CONFIG(debug, debug|release) { 23 | DESTDIR = $$PWD/../outputd 24 | } else { 25 | DESTDIR = $$PWD/../output 26 | } 27 | 28 | STATICDATAPATH = $${DESTDIR}\\..\\tools\\static_data\\dlls 29 | DLLSPATH = $${DESTDIR}\\dlls 30 | 31 | otherlibs.path = $$DLLSPATH 32 | otherlibs.files += $${STATICDATAPATH}\\7z.dll \ 33 | $${BOOSTPATH}\\stage\\lib\\boost_python-vc*-mt-1*.dll 34 | 35 | qtlibs.path = $$DLLSPATH 36 | 37 | greaterThan(QT_MAJOR_VERSION, 4) { 38 | QTLIBNAMES += Core Gui Network OpenGL Script Sql Svg Qml Quick Webkit Widgets Xml XmlPatterns 39 | } else { 40 | QTLIBNAMES += Core Declarative Gui Network OpenGL Script Sql Svg Webkit Xml XmlPatterns 41 | } 42 | 43 | greaterThan(QT_MAJOR_VERSION, 5) { 44 | QTLIBNAMES += OpenGLWidgets 45 | } 46 | 47 | QTLIBSUFFIX = $${QT_MAJOR_VERSION}.dll 48 | CONFIG(debug, debug|release): QTLIBSUFFIX = "d$${QTLIBSUFFIX}" # Can't use Debug: .. here, it ignores the line - no idea why, as it works in BossDummy.pro 49 | 50 | for(QTNAME, QTLIBNAMES) { 51 | QTFILE = Qt$${QTNAME} 52 | qtlibs.files += $$[QT_INSTALL_BINS]\\$${QTFILE}$${QTLIBSUFFIX} 53 | } 54 | 55 | INSTALLS += qtlibs otherlibs 56 | 57 | OTHER_FILES +=\ 58 | ../SConstruct\ 59 | ../scons_configure.py\ 60 | SConscript 61 | -------------------------------------------------------------------------------- /src/app_icon.rc: -------------------------------------------------------------------------------- 1 | IDI_ICON1 ICON DISCARDABLE "mo_icon.ico" 2 | -------------------------------------------------------------------------------- /src/bbcode.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2012 Sebastian Herbord. All rights reserved. 3 | 4 | This file is part of Mod Organizer. 5 | 6 | Mod Organizer is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | Mod Organizer is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with Mod Organizer. If not, see . 18 | */ 19 | 20 | #ifndef BBCODE_H 21 | #define BBCODE_H 22 | 23 | #include 24 | 25 | namespace BBCode 26 | { 27 | 28 | /** 29 | * @brief convert a string with BB Code-Tags to HTML 30 | * @param input the input string with BB tags 31 | * @param replaceOccured if not nullptr, this parameter will be set to true if any bb 32 | *tags were replaced 33 | * @return the same string in html representation 34 | **/ 35 | QString convertToHTML(const QString& input); 36 | 37 | } // namespace BBCode 38 | 39 | #endif // BBCODE_H 40 | -------------------------------------------------------------------------------- /src/categoriestable.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2012 Sebastian Herbord. All rights reserved. 3 | 4 | This file is part of Mod Organizer. 5 | 6 | Mod Organizer is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | Mod Organizer is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with Mod Organizer. If not, see . 18 | */ 19 | 20 | #ifndef CATEGORIESTABLE_H 21 | #define CATEGORIESTABLE_H 22 | 23 | #include 24 | #include 25 | 26 | class CategoriesTable : public QTableWidget 27 | { 28 | Q_OBJECT 29 | public: 30 | CategoriesTable(QWidget* parent = 0); 31 | 32 | protected: 33 | virtual bool dropMimeData(int row, int column, const QMimeData* data, 34 | Qt::DropAction action); 35 | }; 36 | 37 | #endif // CATEGORIESTABLE_H 38 | -------------------------------------------------------------------------------- /src/categoryimportdialog.h: -------------------------------------------------------------------------------- 1 | #ifndef CATEGORYIMPORTDIALOG_H 2 | #define CATEGORYIMPORTDIALOG_H 3 | 4 | #include 5 | 6 | namespace Ui 7 | { 8 | class CategoryImportDialog; 9 | } 10 | 11 | /** 12 | * @brief Dialog that allows users to configure mod categories 13 | **/ 14 | class CategoryImportDialog : public QDialog 15 | { 16 | Q_OBJECT 17 | 18 | public: 19 | enum ImportStrategy 20 | { 21 | None, 22 | Overwrite, 23 | Merge 24 | }; 25 | 26 | public: 27 | explicit CategoryImportDialog(QWidget* parent = 0); 28 | ~CategoryImportDialog(); 29 | 30 | ImportStrategy strategy(); 31 | bool assign(); 32 | bool remap(); 33 | 34 | public slots: 35 | void accepted(); 36 | void rejected(); 37 | void on_strategyClicked(QAbstractButton* button); 38 | void on_assignOptionClicked(bool clicked); 39 | 40 | private: 41 | Ui::CategoryImportDialog* ui; 42 | }; 43 | 44 | #endif // CATEGORYIMPORTDIALOG_H 45 | -------------------------------------------------------------------------------- /src/colortable.h: -------------------------------------------------------------------------------- 1 | #ifndef COLORTABLE_H 2 | #define COLORTABLE_H 3 | 4 | #include 5 | 6 | class Settings; 7 | 8 | // a QTableWidget to view and modify color settings 9 | // 10 | class ColorTable : public QTableWidget 11 | { 12 | public: 13 | ColorTable(QWidget* parent = nullptr); 14 | 15 | // adds colors to the table from the settings 16 | // 17 | void load(Settings& s); 18 | 19 | // resets the colors to their default values; commitColors() must be called 20 | // to save them 21 | // 22 | void resetColors(); 23 | 24 | // commits any changes 25 | // 26 | void commitColors(); 27 | 28 | private: 29 | Settings* m_settings; 30 | 31 | void addColor(const QString& text, const QColor& defaultColor, 32 | std::function get, std::function commit); 33 | 34 | void onColorActivated(); 35 | }; 36 | 37 | #endif // COLORTABLE_H 38 | -------------------------------------------------------------------------------- /src/copyeventfilter.cpp: -------------------------------------------------------------------------------- 1 | #include "copyeventfilter.h" 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | CopyEventFilter::CopyEventFilter(QAbstractItemView* view, int column, int role) 8 | : CopyEventFilter(view, [=](auto& index) { 9 | return index.sibling(index.row(), column).data(role).toString(); 10 | }) 11 | {} 12 | 13 | CopyEventFilter::CopyEventFilter(QAbstractItemView* view, 14 | std::function format) 15 | : QObject(view), m_view(view), m_format(format) 16 | {} 17 | 18 | void CopyEventFilter::copySelection() const 19 | { 20 | if (!m_view->selectionModel()->hasSelection()) { 21 | return; 22 | } 23 | 24 | // sort to reflect the visual order 25 | QModelIndexList selectedRows = m_view->selectionModel()->selectedRows(); 26 | std::sort(selectedRows.begin(), selectedRows.end(), 27 | [=](const auto& lidx, const auto& ridx) { 28 | return m_view->visualRect(lidx).top() < m_view->visualRect(ridx).top(); 29 | }); 30 | 31 | QStringList rows; 32 | for (auto& idx : selectedRows) { 33 | rows.append(m_format(idx)); 34 | } 35 | 36 | QGuiApplication::clipboard()->setText(rows.join("\n")); 37 | } 38 | 39 | bool CopyEventFilter::eventFilter(QObject* sender, QEvent* event) 40 | { 41 | if (sender == m_view && event->type() == QEvent::KeyPress) { 42 | QKeyEvent* keyEvent = static_cast(event); 43 | if (keyEvent->modifiers() == Qt::ControlModifier && keyEvent->key() == Qt::Key_C) { 44 | copySelection(); 45 | return true; 46 | } 47 | } 48 | return QObject::eventFilter(sender, event); 49 | } 50 | -------------------------------------------------------------------------------- /src/copyeventfilter.h: -------------------------------------------------------------------------------- 1 | #ifndef COPY_EVENT_FILTER_H 2 | #define COPY_EVENT_FILTER_H 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | // this small class provides copy on Ctrl+C and also 11 | // exposes a method to actual copy the selection 12 | // 13 | // the way the selection is copied can be customized by 14 | // passing a functor to format each index, by default 15 | // it only extracts the display role 16 | // 17 | // only works for view that selects whole row since it only 18 | // considers the first cell in each row 19 | // 20 | class CopyEventFilter : public QObject 21 | { 22 | Q_OBJECT 23 | 24 | public: 25 | CopyEventFilter(QAbstractItemView* view, int column = 0, int role = Qt::DisplayRole); 26 | CopyEventFilter(QAbstractItemView* view, 27 | std::function format); 28 | 29 | // copy the selection of the view associated with this 30 | // event filter into the clipboard 31 | // 32 | void copySelection() const; 33 | 34 | bool eventFilter(QObject* sender, QEvent* event) override; 35 | 36 | private: 37 | QAbstractItemView* m_view; 38 | std::function m_format; 39 | }; 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /src/credentialsdialog.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2012 Sebastian Herbord. All rights reserved. 3 | 4 | This file is part of Mod Organizer. 5 | 6 | Mod Organizer is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | Mod Organizer is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with Mod Organizer. If not, see . 18 | */ 19 | 20 | #include "credentialsdialog.h" 21 | #include "ui_credentialsdialog.h" 22 | 23 | CredentialsDialog::CredentialsDialog(QWidget* parent) 24 | : QDialog(parent), ui(new Ui::CredentialsDialog) 25 | { 26 | ui->setupUi(this); 27 | } 28 | 29 | CredentialsDialog::~CredentialsDialog() 30 | { 31 | delete ui; 32 | } 33 | 34 | bool CredentialsDialog::store() const 35 | { 36 | return ui->rememberCheck->isChecked(); 37 | } 38 | 39 | bool CredentialsDialog::neverAsk() const 40 | { 41 | return ui->dontaskBox->isChecked(); 42 | } 43 | -------------------------------------------------------------------------------- /src/credentialsdialog.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2012 Sebastian Herbord. All rights reserved. 3 | 4 | This file is part of Mod Organizer. 5 | 6 | Mod Organizer is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | Mod Organizer is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with Mod Organizer. If not, see . 18 | */ 19 | 20 | #ifndef CREDENTIALSDIALOG_H 21 | #define CREDENTIALSDIALOG_H 22 | 23 | #include 24 | 25 | namespace Ui 26 | { 27 | class CredentialsDialog; 28 | } 29 | 30 | class CredentialsDialog : public QDialog 31 | { 32 | Q_OBJECT 33 | 34 | public: 35 | explicit CredentialsDialog(QWidget* parent = 0); 36 | ~CredentialsDialog(); 37 | 38 | bool store() const; 39 | bool neverAsk() const; 40 | 41 | private: 42 | Ui::CredentialsDialog* ui; 43 | }; 44 | 45 | #endif // CREDENTIALSDIALOG_H 46 | -------------------------------------------------------------------------------- /src/disableproxyplugindialog.cpp: -------------------------------------------------------------------------------- 1 | #include "disableproxyplugindialog.h" 2 | 3 | #include "ui_disableproxyplugindialog.h" 4 | 5 | using namespace MOBase; 6 | 7 | DisableProxyPluginDialog::DisableProxyPluginDialog( 8 | MOBase::IPlugin* proxyPlugin, std::vector const& required, 9 | QWidget* parent) 10 | : QDialog(parent), ui(new Ui::DisableProxyPluginDialog) 11 | { 12 | ui->setupUi(this); 13 | 14 | ui->topLabel->setText(QObject::tr("Disabling the '%1' plugin will prevent the " 15 | "following %2 plugin(s) from working:", 16 | "", required.size()) 17 | .arg(proxyPlugin->localizedName()) 18 | .arg(required.size())); 19 | 20 | connect(ui->noBtn, &QPushButton::clicked, this, &QDialog::reject); 21 | connect(ui->yesBtn, &QPushButton::clicked, this, &QDialog::accept); 22 | 23 | ui->requiredPlugins->setSelectionMode(QAbstractItemView::NoSelection); 24 | ui->requiredPlugins->setRowCount(required.size()); 25 | for (int i = 0; i < required.size(); ++i) { 26 | ui->requiredPlugins->setItem(i, 0, 27 | new QTableWidgetItem(required[i]->localizedName())); 28 | ui->requiredPlugins->setItem(i, 1, 29 | new QTableWidgetItem(required[i]->description())); 30 | ui->requiredPlugins->setRowHeight(i, 9); 31 | } 32 | ui->requiredPlugins->verticalHeader()->setVisible(false); 33 | ui->requiredPlugins->sortByColumn(0, Qt::AscendingOrder); 34 | } 35 | -------------------------------------------------------------------------------- /src/disableproxyplugindialog.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2020 Mikaël Capelle. All rights reserved. 3 | 4 | This file is part of Mod Organizer. 5 | 6 | Mod Organizer is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | Mod Organizer is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with Mod Organizer. If not, see . 18 | */ 19 | 20 | #ifndef DISABLEPROXYPLUGINDIALOG_H 21 | #define DISABLEPROXYPLUGINDIALOG_H 22 | 23 | #include 24 | 25 | #include "ipluginproxy.h" 26 | 27 | namespace Ui 28 | { 29 | class DisableProxyPluginDialog; 30 | } 31 | 32 | class DisableProxyPluginDialog : public QDialog 33 | { 34 | public: 35 | DisableProxyPluginDialog(MOBase::IPlugin* proxyPlugin, 36 | std::vector const& required, 37 | QWidget* parent = nullptr); 38 | 39 | private slots: 40 | 41 | Ui::DisableProxyPluginDialog* ui; 42 | }; 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /src/dlls.manifest.debug.qt6: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /src/dlls.manifest.qt6: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /src/downloadmanagerproxy.h: -------------------------------------------------------------------------------- 1 | #ifndef DOWNLOADMANAGERPROXY_H 2 | #define DOWNLOADMANAGERPROXY_H 3 | 4 | #include "downloadmanager.h" 5 | #include 6 | 7 | class OrganizerProxy; 8 | 9 | class DownloadManagerProxy : public MOBase::IDownloadManager 10 | { 11 | 12 | public: 13 | DownloadManagerProxy(OrganizerProxy* oproxy, DownloadManager* downloadManager); 14 | virtual ~DownloadManagerProxy(); 15 | 16 | int startDownloadURLs(const QStringList& urls) override; 17 | int startDownloadNexusFile(int modID, int fileID) override; 18 | int startDownloadNexusFileForGame(const QString& gameName, int modID, 19 | int fileID) override; 20 | QString downloadPath(int id) override; 21 | 22 | bool onDownloadComplete(const std::function& callback) override; 23 | bool onDownloadPaused(const std::function& callback) override; 24 | bool onDownloadFailed(const std::function& callback) override; 25 | bool onDownloadRemoved(const std::function& callback) override; 26 | 27 | private: 28 | friend class OrganizerProxy; 29 | 30 | // See OrganizerProxy::connectSignals(). 31 | void connectSignals(); 32 | void disconnectSignals(); 33 | 34 | OrganizerProxy* m_OrganizerProxy; 35 | DownloadManager* m_Proxied; 36 | 37 | DownloadManager::SignalDownloadCallback m_DownloadComplete; 38 | DownloadManager::SignalDownloadCallback m_DownloadPaused; 39 | DownloadManager::SignalDownloadCallback m_DownloadFailed; 40 | DownloadManager::SignalDownloadCallback m_DownloadRemoved; 41 | 42 | std::vector m_Connections; 43 | }; 44 | 45 | #endif // ORGANIZERPROXY_H 46 | -------------------------------------------------------------------------------- /src/downloadstab.h: -------------------------------------------------------------------------------- 1 | #ifndef MODORGANIZER_DOWNLOADTAB_INCLUDED 2 | #define MODORGANIZER_DOWNLOADTAB_INCLUDED 3 | 4 | #include 5 | 6 | namespace Ui 7 | { 8 | class MainWindow; 9 | } 10 | class OrganizerCore; 11 | class DownloadListView; 12 | 13 | class DownloadsTab : public QObject 14 | { 15 | Q_OBJECT; 16 | 17 | public: 18 | DownloadsTab(OrganizerCore& core, Ui::MainWindow* ui); 19 | 20 | void update(); 21 | 22 | private: 23 | struct DownloadsTabUi 24 | { 25 | QPushButton* refresh; 26 | DownloadListView* list; 27 | QCheckBox* showHidden; 28 | QLineEdit* filter; 29 | }; 30 | 31 | OrganizerCore& m_core; 32 | DownloadsTabUi ui; 33 | MOBase::FilterWidget m_filter; 34 | 35 | void refresh(); 36 | void resumeDownload(int downloadIndex); 37 | }; 38 | 39 | #endif // MODORGANIZER_DOWNLOADTAB_INCLUDED 40 | -------------------------------------------------------------------------------- /src/envdump.h: -------------------------------------------------------------------------------- 1 | #ifndef MODORGANIZER_ENVDUMP_INCLUDED 2 | #define MODORGANIZER_ENVDUMP_INCLUDED 3 | 4 | namespace env 5 | { 6 | 7 | enum class CoreDumpTypes 8 | { 9 | None, 10 | Mini, 11 | Data, 12 | Full 13 | }; 14 | 15 | CoreDumpTypes coreDumpTypeFromString(const std::string& s); 16 | std::string toString(CoreDumpTypes type); 17 | 18 | // creates a minidump file for this process 19 | // 20 | bool coredump(const wchar_t* dir, CoreDumpTypes type); 21 | 22 | // finds another process with the same name as this one and creates a minidump 23 | // file for it 24 | // 25 | bool coredumpOther(CoreDumpTypes type); 26 | 27 | } // namespace env 28 | 29 | #endif // MODORGANIZER_ENVDUMP_INCLUDED 30 | -------------------------------------------------------------------------------- /src/envmetrics.h: -------------------------------------------------------------------------------- 1 | #ifndef ENV_METRICS_H 2 | #define ENV_METRICS_H 3 | 4 | #include 5 | #include 6 | 7 | namespace env 8 | { 9 | 10 | // information about a monitor 11 | // 12 | class Display 13 | { 14 | public: 15 | Display(QString adapter, QString monitorDevice, bool primary); 16 | 17 | // display name of the adapter running the monitor 18 | // 19 | const QString& adapter() const; 20 | 21 | // internal device name of the monitor, this is not a display name 22 | // 23 | const QString& monitorDevice() const; 24 | 25 | // whether this monitor is the primary 26 | // 27 | bool primary(); 28 | 29 | // resolution 30 | // 31 | int resX() const; 32 | int resY() const; 33 | 34 | // dpi 35 | // 36 | int dpi(); 37 | 38 | // refresh rate in hz 39 | // 40 | int refreshRate() const; 41 | 42 | // string representation 43 | // 44 | QString toString() const; 45 | 46 | private: 47 | QString m_adapter; 48 | QString m_monitorDevice; 49 | bool m_primary; 50 | int m_resX, m_resY; 51 | int m_dpi; 52 | int m_refreshRate; 53 | 54 | void getSettings(); 55 | }; 56 | 57 | // holds various information about Windows metrics 58 | // 59 | class Metrics 60 | { 61 | public: 62 | Metrics(); 63 | 64 | // list of displays on the system 65 | // 66 | const std::vector& displays() const; 67 | 68 | // full resolution 69 | // 70 | QRect desktopGeometry() const; 71 | 72 | private: 73 | std::vector m_displays; 74 | 75 | void getDisplays(); 76 | }; 77 | 78 | } // namespace env 79 | 80 | #endif // ENV_METRICS_H 81 | -------------------------------------------------------------------------------- /src/envsecurity.h: -------------------------------------------------------------------------------- 1 | #ifndef ENV_SECURITY_H 2 | #define ENV_SECURITY_H 3 | 4 | #include 5 | #include 6 | 7 | namespace env 8 | { 9 | 10 | // represents a security product, such as an antivirus or a firewall 11 | // 12 | class SecurityProduct 13 | { 14 | public: 15 | SecurityProduct(QUuid guid, QString name, int provider, bool active, bool upToDate); 16 | 17 | // guid 18 | // 19 | const QUuid& guid() const; 20 | 21 | // display name of the product 22 | // 23 | const QString& name() const; 24 | 25 | // a bunch of _WSC_SECURITY_PROVIDER flags 26 | // 27 | int provider() const; 28 | 29 | // whether the product is active 30 | // 31 | bool active() const; 32 | 33 | // whether its definitions are up-to-date 34 | // 35 | bool upToDate() const; 36 | 37 | // string representation of the above 38 | // 39 | QString toString() const; 40 | 41 | private: 42 | QUuid m_guid; 43 | QString m_name; 44 | int m_provider; 45 | bool m_active; 46 | bool m_upToDate; 47 | 48 | QString providerToString() const; 49 | }; 50 | 51 | std::vector getSecurityProducts(); 52 | 53 | struct FileRights 54 | { 55 | QStringList list; 56 | bool hasExecute = false; 57 | bool normalRights = false; 58 | }; 59 | 60 | struct FileSecurity 61 | { 62 | QString owner; 63 | FileRights rights; 64 | QString error; 65 | }; 66 | 67 | FileSecurity getFileSecurity(const QString& file); 68 | 69 | } // namespace env 70 | 71 | #endif // ENV_SECURITY_H 72 | -------------------------------------------------------------------------------- /src/filterlist.h: -------------------------------------------------------------------------------- 1 | #ifndef MODORGANIZER_CATEGORIESLIST_INCLUDED 2 | #define MODORGANIZER_CATEGORIESLIST_INCLUDED 3 | 4 | #include "modlistsortproxy.h" 5 | #include 6 | 7 | namespace Ui 8 | { 9 | class MainWindow; 10 | }; 11 | class CategoryFactory; 12 | class Settings; 13 | class OrganizerCore; 14 | 15 | class FilterList : public QObject 16 | { 17 | Q_OBJECT; 18 | 19 | public: 20 | FilterList(Ui::MainWindow* ui, OrganizerCore& organizer, CategoryFactory& factory); 21 | 22 | void restoreState(const Settings& s); 23 | void saveState(Settings& s) const; 24 | 25 | void setSelection(const std::vector& criteria); 26 | void clearSelection(); 27 | void refresh(); 28 | 29 | signals: 30 | void criteriaChanged(std::vector criteria); 31 | void optionsChanged(ModListSortProxy::FilterMode mode, 32 | ModListSortProxy::SeparatorsMode sep); 33 | 34 | private: 35 | class CriteriaItem; 36 | 37 | Ui::MainWindow* ui; 38 | OrganizerCore& m_core; 39 | CategoryFactory& m_factory; 40 | 41 | bool onClick(QMouseEvent* e); 42 | void onItemActivated(QTreeWidgetItem* item); 43 | void onOptionsChanged(); 44 | 45 | void editCategories(); 46 | void checkCriteria(); 47 | std::vector selectedCriteria() const; 48 | bool cycleItem(QTreeWidgetItem* item, int direction); 49 | 50 | QTreeWidgetItem* addCriteriaItem(QTreeWidgetItem* root, const QString& name, 51 | int categoryID, ModListSortProxy::CriteriaType type); 52 | 53 | void addContentCriteria(); 54 | void addCategoryCriteria(QTreeWidgetItem* root, const std::set& categoriesUsed, 55 | int targetID); 56 | void addSpecialCriteria(int type); 57 | }; 58 | 59 | #endif // MODORGANIZER_CATEGORIESLIST_INCLUDED 60 | -------------------------------------------------------------------------------- /src/forcedloaddialog.h: -------------------------------------------------------------------------------- 1 | #ifndef FORCEDLOADDIALOG_H 2 | #define FORCEDLOADDIALOG_H 3 | 4 | #include 5 | #include 6 | 7 | #include "executableinfo.h" 8 | #include "iplugingame.h" 9 | 10 | namespace Ui 11 | { 12 | class ForcedLoadDialog; 13 | } 14 | 15 | class ForcedLoadDialog : public QDialog 16 | { 17 | Q_OBJECT 18 | 19 | public: 20 | explicit ForcedLoadDialog(const MOBase::IPluginGame* game, QWidget* parent = nullptr); 21 | ~ForcedLoadDialog(); 22 | 23 | void setValues(QList& values); 24 | QList values(); 25 | 26 | private slots: 27 | void on_addRowButton_clicked(); 28 | void on_deleteRowButton_clicked(); 29 | 30 | private: 31 | Ui::ForcedLoadDialog* ui; 32 | const MOBase::IPluginGame* m_GamePlugin; 33 | }; 34 | 35 | #endif // FORCEDLOADDIALOG_H 36 | -------------------------------------------------------------------------------- /src/forcedloaddialogwidget.h: -------------------------------------------------------------------------------- 1 | #ifndef FORCEDLOADDIALOGWIDGET_H 2 | #define FORCEDLOADDIALOGWIDGET_H 3 | 4 | #include "iplugingame.h" 5 | #include 6 | 7 | namespace Ui 8 | { 9 | class ForcedLoadDialogWidget; 10 | } 11 | 12 | class ForcedLoadDialogWidget : public QWidget 13 | { 14 | Q_OBJECT 15 | 16 | public: 17 | explicit ForcedLoadDialogWidget(const MOBase::IPluginGame* game, 18 | QWidget* parent = nullptr); 19 | ~ForcedLoadDialogWidget(); 20 | 21 | bool getEnabled(); 22 | bool getForced(); 23 | QString getLibraryPath(); 24 | QString getProcess(); 25 | 26 | void setEnabled(bool enabled); 27 | void setForced(bool forced); 28 | void setLibraryPath(const QString& path); 29 | void setProcess(const QString& name); 30 | 31 | private slots: 32 | void on_enabledBox_toggled(); 33 | void on_libraryPathBrowseButton_clicked(); 34 | void on_processBrowseButton_clicked(); 35 | 36 | private: 37 | Ui::ForcedLoadDialogWidget* ui; 38 | bool m_Forced; 39 | const MOBase::IPluginGame* m_GamePlugin; 40 | }; 41 | 42 | #endif // FORCEDLOADDIALOGWIDGET_H 43 | -------------------------------------------------------------------------------- /src/gamefeaturesproxy.cpp: -------------------------------------------------------------------------------- 1 | #include "gamefeaturesproxy.h" 2 | 3 | #include "game_features.h" 4 | #include "organizerproxy.h" 5 | 6 | GameFeaturesProxy::GameFeaturesProxy(OrganizerProxy* coreProxy, 7 | GameFeatures& gameFeatures) 8 | : m_CoreProxy(*coreProxy), m_Features(gameFeatures) 9 | {} 10 | 11 | bool GameFeaturesProxy::registerFeature(QStringList const& games, 12 | std::shared_ptr feature, 13 | int priority, bool replace) 14 | { 15 | if (replace) { 16 | m_Features.unregisterGameFeatures(m_CoreProxy.plugin(), feature->typeInfo()); 17 | } 18 | return m_Features.registerGameFeature(m_CoreProxy.plugin(), games, feature, priority); 19 | } 20 | 21 | bool GameFeaturesProxy::registerFeature(MOBase::IPluginGame* game, 22 | std::shared_ptr feature, 23 | int priority, bool replace) 24 | { 25 | return registerFeature({game->gameName()}, feature, priority, replace); 26 | } 27 | 28 | bool GameFeaturesProxy::registerFeature(std::shared_ptr feature, 29 | int priority, bool replace) 30 | { 31 | return registerFeature(QStringList(), feature, priority, replace); 32 | } 33 | 34 | bool GameFeaturesProxy::unregisterFeature(std::shared_ptr feature) 35 | { 36 | return m_Features.unregisterGameFeature(feature); 37 | } 38 | 39 | std::shared_ptr 40 | GameFeaturesProxy::gameFeatureImpl(std::type_info const& info) const 41 | { 42 | return m_Features.gameFeature(info); 43 | } 44 | 45 | int GameFeaturesProxy::unregisterFeaturesImpl(std::type_info const& info) 46 | { 47 | return m_Features.unregisterGameFeatures(m_CoreProxy.plugin(), info); 48 | } 49 | -------------------------------------------------------------------------------- /src/gamefeaturesproxy.h: -------------------------------------------------------------------------------- 1 | #ifndef GAMEFEATURESPROXY_H 2 | #define GAMEFEATURESPROXY_H 3 | 4 | #include "igamefeatures.h" 5 | 6 | class GameFeatures; 7 | class OrganizerProxy; 8 | 9 | class GameFeaturesProxy : public MOBase::IGameFeatures 10 | { 11 | public: 12 | GameFeaturesProxy(OrganizerProxy* coreProxy, GameFeatures& gameFeatures); 13 | 14 | bool registerFeature(QStringList const& games, 15 | std::shared_ptr feature, int priority, 16 | bool replace) override; 17 | bool registerFeature(MOBase::IPluginGame* game, 18 | std::shared_ptr feature, int priority, 19 | bool replace) override; 20 | bool registerFeature(std::shared_ptr feature, int priority, 21 | bool replace) override; 22 | bool unregisterFeature(std::shared_ptr feature) override; 23 | 24 | protected: 25 | std::shared_ptr 26 | gameFeatureImpl(std::type_info const& info) const override; 27 | int unregisterFeaturesImpl(std::type_info const& info) override; 28 | 29 | private: 30 | GameFeatures& m_Features; 31 | OrganizerProxy& m_CoreProxy; 32 | }; 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /src/genericicondelegate.cpp: -------------------------------------------------------------------------------- 1 | #include "genericicondelegate.h" 2 | #include "pluginlist.h" 3 | #include 4 | #include 5 | 6 | GenericIconDelegate::GenericIconDelegate(QTreeView* parent, int role, int logicalIndex, 7 | int compactSize) 8 | : IconDelegate(parent, logicalIndex, compactSize), m_Role(role) 9 | {} 10 | 11 | QList GenericIconDelegate::getIcons(const QModelIndex& index) const 12 | { 13 | QList result; 14 | if (index.isValid()) { 15 | for (const QVariant& var : index.data(m_Role).toList()) { 16 | if (!compact() || !var.toString().isEmpty()) { 17 | result.append(var.toString()); 18 | } 19 | } 20 | } 21 | return result; 22 | } 23 | 24 | size_t GenericIconDelegate::getNumIcons(const QModelIndex& index) const 25 | { 26 | return index.data(m_Role).toList().count(); 27 | } 28 | -------------------------------------------------------------------------------- /src/genericicondelegate.h: -------------------------------------------------------------------------------- 1 | #ifndef GENERICICONDELEGATE_H 2 | #define GENERICICONDELEGATE_H 3 | 4 | #include "icondelegate.h" 5 | 6 | /** 7 | * @brief an icon delegate that takes the list of icons from a user-defines data role 8 | */ 9 | class GenericIconDelegate : public IconDelegate 10 | { 11 | Q_OBJECT 12 | public: 13 | /** 14 | * @brief constructor 15 | * @param parent parent object 16 | * @param role role of the itemmodel from which the icon list can be queried (as a 17 | * QVariantList) 18 | * @param logicalIndex logical index within the model. This is part of a "hack". 19 | * Normally "empty" icons will be allocated the same space as a regular icon. This way 20 | * the model can use empty icons as spacers and thus align same icons horizontally. 21 | * Now, if you set the logical Index to a valid column and connect 22 | * the columnResized slot to the sectionResized signal of the view, the delegate will 23 | * turn off this behaviour if the column is smaller than "compactSize" 24 | * @param compactSize see explanation of logicalIndex 25 | */ 26 | GenericIconDelegate(QTreeView* parent, int role = Qt::UserRole + 1, 27 | int logicalIndex = -1, int compactSize = 150); 28 | 29 | private: 30 | virtual QList getIcons(const QModelIndex& index) const; 31 | virtual size_t getNumIcons(const QModelIndex& index) const; 32 | 33 | private: 34 | int m_Role; 35 | int m_LogicalIndex; 36 | int m_CompactSize; 37 | bool m_Compact; 38 | }; 39 | 40 | #endif // GENERICICONDELEGATE_H 41 | -------------------------------------------------------------------------------- /src/icondelegate.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2012 Sebastian Herbord. All rights reserved. 3 | 4 | This file is part of Mod Organizer. 5 | 6 | Mod Organizer is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | Mod Organizer is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with Mod Organizer. If not, see . 18 | */ 19 | 20 | #ifndef ICONDELEGATE_H 21 | #define ICONDELEGATE_H 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | class IconDelegate : public QStyledItemDelegate 28 | { 29 | Q_OBJECT; 30 | 31 | public: 32 | explicit IconDelegate(QTreeView* view, int column = -1, int compactSize = 100); 33 | 34 | void paint(QPainter* painter, const QStyleOptionViewItem& option, 35 | const QModelIndex& index) const override; 36 | 37 | protected: 38 | // check if icons should be compacted or not 39 | // 40 | bool compact() const { return m_compact; } 41 | 42 | static void paintIcons(QPainter* painter, const QStyleOptionViewItem& option, 43 | const QModelIndex& index, const QList& icons); 44 | 45 | virtual QList getIcons(const QModelIndex& index) const = 0; 46 | virtual size_t getNumIcons(const QModelIndex& index) const = 0; 47 | 48 | private: 49 | int m_column; 50 | int m_compactSize; 51 | bool m_compact; 52 | }; 53 | 54 | #endif // ICONDELEGATE_H 55 | -------------------------------------------------------------------------------- /src/iconfetcher.h: -------------------------------------------------------------------------------- 1 | #ifndef MODORGANIZER_ICONFETCHER_INCLUDED 2 | #define MODORGANIZER_ICONFETCHER_INCLUDED 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | class IconFetcher 9 | { 10 | public: 11 | IconFetcher(); 12 | ~IconFetcher(); 13 | 14 | void stop(); 15 | 16 | QVariant icon(const QString& path) const; 17 | QPixmap genericFileIcon() const; 18 | QPixmap genericDirectoryIcon() const; 19 | 20 | private: 21 | struct QuickCache 22 | { 23 | QPixmap file; 24 | QPixmap directory; 25 | }; 26 | 27 | struct Cache 28 | { 29 | std::map> map; 30 | std::mutex mapMutex; 31 | 32 | std::set queue; 33 | std::mutex queueMutex; 34 | }; 35 | 36 | class Waiter 37 | { 38 | public: 39 | void wait(); 40 | void wakeUp(); 41 | 42 | private: 43 | mutable std::mutex m_wakeUpMutex; 44 | std::condition_variable m_wakeUp; 45 | bool m_queueAvailable = false; 46 | }; 47 | 48 | const int m_iconSize; 49 | QFileIconProvider m_provider; 50 | std::thread m_thread; 51 | std::atomic m_stop; 52 | 53 | mutable QuickCache m_quickCache; 54 | mutable Cache m_extensionCache; 55 | mutable Cache m_fileCache; 56 | mutable Waiter m_waiter; 57 | 58 | bool hasOwnIcon(const QString& path) const; 59 | 60 | template 61 | QPixmap getPixmapIcon(T&& t) const 62 | { 63 | return m_provider.icon(t).pixmap({m_iconSize, m_iconSize}); 64 | } 65 | 66 | void threadFun(); 67 | 68 | void checkCache(Cache& cache); 69 | void queue(Cache& cache, QString path) const; 70 | 71 | QVariant fileIcon(const QString& path) const; 72 | QVariant extensionIcon(const QStringView& ext) const; 73 | }; 74 | 75 | #endif // MODORGANIZER_ICONFETCHER_INCLUDED 76 | -------------------------------------------------------------------------------- /src/iuserinterface.h: -------------------------------------------------------------------------------- 1 | #ifndef IUSERINTERFACE_H 2 | #define IUSERINTERFACE_H 3 | 4 | #include "modinfodialogfwd.h" 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | class IUserInterface 12 | { 13 | public: 14 | virtual void registerModPage(MOBase::IPluginModPage* modPage) = 0; 15 | 16 | virtual void installTranslator(const QString& name) = 0; 17 | 18 | virtual bool closeWindow() = 0; 19 | virtual void setWindowEnabled(bool enabled) = 0; 20 | 21 | virtual void displayModInformation(ModInfoPtr modInfo, unsigned int modIndex, 22 | ModInfoTabIDs tabID) = 0; 23 | 24 | virtual void updateBSAList(const QStringList& defaultArchives, 25 | const QStringList& activeArchives) = 0; 26 | 27 | virtual MOBase::DelayedFileWriterBase& archivesWriter() = 0; 28 | 29 | virtual QMainWindow* mainWindow() = 0; 30 | }; 31 | 32 | #endif // IUSERINTERFACE_H 33 | -------------------------------------------------------------------------------- /src/lcdnumber.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Mod Organizer. 3 | 4 | Mod Organizer is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | Mod Organizer is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with Mod Organizer. If not, see . 16 | */ 17 | 18 | #include "lcdnumber.h" 19 | 20 | #include 21 | #include 22 | 23 | LCDNumber::LCDNumber(QWidget* parent) : QLCDNumber(parent) {} 24 | 25 | void LCDNumber::mousePressEvent(QMouseEvent* event) 26 | { 27 | m_toolTipPosition = mapToGlobal(event->pos()); 28 | QTimer::singleShot(100, this, SLOT(showToolTip())); 29 | } 30 | 31 | void LCDNumber::showToolTip() 32 | { 33 | QToolTip::showText(m_toolTipPosition, toolTip()); 34 | } 35 | -------------------------------------------------------------------------------- /src/lcdnumber.h: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of Mod Organizer. 3 | 4 | Mod Organizer is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | Mod Organizer is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with Mod Organizer. If not, see . 16 | */ 17 | 18 | #include 19 | #include 20 | #include 21 | 22 | class LCDNumber : public QLCDNumber 23 | { 24 | Q_OBJECT 25 | 26 | public: 27 | LCDNumber(QWidget* parent = nullptr); 28 | void mousePressEvent(QMouseEvent* event); 29 | 30 | public slots: 31 | void showToolTip(); 32 | 33 | private: 34 | QPoint m_toolTipPosition; 35 | }; 36 | -------------------------------------------------------------------------------- /src/listdialog.h: -------------------------------------------------------------------------------- 1 | #ifndef LISTDIALOG_H 2 | #define LISTDIALOG_H 3 | 4 | #include 5 | 6 | namespace Ui 7 | { 8 | class ListDialog; 9 | } 10 | 11 | class ListDialog : public QDialog 12 | { 13 | Q_OBJECT 14 | 15 | public: 16 | explicit ListDialog(QWidget* parent = nullptr); 17 | ~ListDialog(); 18 | 19 | // also saves and restores geometry 20 | // 21 | int exec() override; 22 | 23 | void setChoices(QStringList choices); 24 | QString getChoice() const; 25 | 26 | public slots: 27 | void on_filterEdit_textChanged(QString filter); 28 | 29 | private: 30 | Ui::ListDialog* ui; 31 | QStringList m_Choices; 32 | }; 33 | 34 | #endif // LISTDIALOG_H 35 | -------------------------------------------------------------------------------- /src/loghighlighter.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2012 Sebastian Herbord. All rights reserved. 3 | 4 | This file is part of Mod Organizer. 5 | 6 | Mod Organizer is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | Mod Organizer is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with Mod Organizer. If not, see . 18 | */ 19 | 20 | #include "loghighlighter.h" 21 | 22 | LogHighlighter::LogHighlighter(QObject* parent) : QSyntaxHighlighter(parent) {} 23 | 24 | void LogHighlighter::highlightBlock(const QString& text) 25 | { 26 | int spacePos = text.indexOf(" "); 27 | if (spacePos != -1) { 28 | QString type = text.mid(0, spacePos); 29 | if (type == "DEBUG") { 30 | setFormat(0, text.length(), Qt::gray); 31 | } else if (type == "INFO") { 32 | setFormat(0, text.length(), Qt::darkGreen); 33 | } else if (type == "ERROR") { 34 | setFormat(0, text.length(), Qt::red); 35 | } 36 | } 37 | 38 | int markPos = text.indexOf("injecting to"); 39 | if (markPos != -1) { 40 | setFormat(markPos + 12, text.length(), Qt::blue); 41 | } 42 | 43 | markPos = text.indexOf("using profile"); 44 | if (markPos != -1) { 45 | setFormat(markPos + 13, text.length(), Qt::blue); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/loghighlighter.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2012 Sebastian Herbord. All rights reserved. 3 | 4 | This file is part of Mod Organizer. 5 | 6 | Mod Organizer is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | Mod Organizer is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with Mod Organizer. If not, see . 18 | */ 19 | 20 | #ifndef LOGHIGHLIGHTER_H 21 | #define LOGHIGHLIGHTER_H 22 | 23 | #include 24 | 25 | /** 26 | * @brief Syntax highlighter to make log files from mo.dll more readable. 27 | * @note this is currently not used! 28 | **/ 29 | class LogHighlighter : public QSyntaxHighlighter 30 | { 31 | Q_OBJECT 32 | public: 33 | explicit LogHighlighter(QObject* parent = 0); 34 | 35 | signals: 36 | 37 | public slots: 38 | 39 | protected: 40 | virtual void highlightBlock(const QString& text); 41 | }; 42 | 43 | #endif // LOGHIGHLIGHTER_H 44 | -------------------------------------------------------------------------------- /src/lootdialog.h: -------------------------------------------------------------------------------- 1 | #ifndef MODORGANIZER_LOOTDIALOG_H 2 | #define MODORGANIZER_LOOTDIALOG_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | namespace Ui 9 | { 10 | class LootDialog; 11 | } 12 | 13 | class OrganizerCore; 14 | class Loot; 15 | 16 | class MarkdownDocument : public QObject 17 | { 18 | Q_OBJECT; 19 | Q_PROPERTY(QString text MEMBER m_text NOTIFY textChanged FINAL); 20 | 21 | public: 22 | explicit MarkdownDocument(QObject* parent = nullptr); 23 | void setText(const QString& text); 24 | 25 | signals: 26 | void textChanged(const QString& text); 27 | 28 | private: 29 | QString m_text; 30 | }; 31 | 32 | class MarkdownPage : public QWebEnginePage 33 | { 34 | Q_OBJECT; 35 | 36 | public: 37 | explicit MarkdownPage(QObject* parent = nullptr); 38 | 39 | protected: 40 | bool acceptNavigationRequest(const QUrl& url, NavigationType, bool) override; 41 | }; 42 | 43 | class LootDialog : public QDialog 44 | { 45 | Q_OBJECT; 46 | 47 | public: 48 | LootDialog(QWidget* parent, OrganizerCore& core, Loot& loot); 49 | ~LootDialog(); 50 | 51 | void setText(const QString& s); 52 | void setProgress(lootcli::Progress p); 53 | 54 | void addOutput(const QString& s); 55 | bool result() const; 56 | void cancel(); 57 | void openReport(); 58 | 59 | int exec() override; 60 | void accept() override; 61 | void reject() override; 62 | 63 | private: 64 | std::unique_ptr ui; 65 | MOBase::ExpanderWidget m_expander; 66 | OrganizerCore& m_core; 67 | Loot& m_loot; 68 | bool m_finished; 69 | bool m_cancelling; 70 | MarkdownDocument m_report; 71 | 72 | void createUI(); 73 | void closeEvent(QCloseEvent* e) override; 74 | void addLineOutput(const QString& line); 75 | void onFinished(); 76 | void log(MOBase::log::Levels lv, const QString& s); 77 | void showReport(); 78 | }; 79 | 80 | #endif // MODORGANIZER_LOOTDIALOG_H 81 | -------------------------------------------------------------------------------- /src/main.patch: -------------------------------------------------------------------------------- 1 | Index: ./main.cpp 2 | =================================================================== 3 | --- ./main.cpp (revision 77) 4 | +++ ./main.cpp (revision 94) 5 | @@ -36,6 +36,7 @@ 6 | #include 7 | #include 8 | #include 9 | +#include 10 | #include 11 | 12 | //#pragma comment(linker, "/manifestDependency:\"name='dlls' processorArchitecture='*' version='1.0.0.0' type='win32' \"") 13 | @@ -114,6 +115,7 @@ 14 | 15 | 16 | class MyApplication : public QApplication { 17 | + 18 | public: 19 | 20 | MyApplication(int argc, char **argv) 21 | @@ -202,8 +204,10 @@ 22 | { 23 | MyApplication application(argc, argv); 24 | SetUnhandledExceptionFilter(MyUnhandledExceptionFilter); 25 | - 26 | LogBuffer::init(20, QtDebugMsg, application.applicationDirPath().append("/mo_interface.log")); 27 | + QPixmap pixmap(":/new/guiresources/splash.png"); 28 | + QSplashScreen splash(pixmap); 29 | + splash.show(); 30 | 31 | QStringList arguments = application.arguments(); 32 | 33 | @@ -390,7 +394,7 @@ 34 | (isNxmLink(arguments.at(1)))) { 35 | mainWindow.externalMessage(arguments.at(1)); 36 | } 37 | - 38 | + splash.finish(&mainWindow); 39 | return application.exec(); 40 | } catch (const std::exception &e) { 41 | reportError(e.what()); 42 | -------------------------------------------------------------------------------- /src/mo_icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/mo_icon.ico -------------------------------------------------------------------------------- /src/modconflicticondelegate.h: -------------------------------------------------------------------------------- 1 | #ifndef MODCONFLICTICONDELEGATE_H 2 | #define MODCONFLICTICONDELEGATE_H 3 | 4 | #include 5 | 6 | #include "icondelegate.h" 7 | #include "modinfo.h" 8 | 9 | class ModListView; 10 | 11 | class ModConflictIconDelegate : public IconDelegate 12 | { 13 | Q_OBJECT; 14 | 15 | public: 16 | explicit ModConflictIconDelegate(ModListView* view, int logicalIndex = -1, 17 | int compactSize = 80); 18 | QSize sizeHint(const QStyleOptionViewItem& option, 19 | const QModelIndex& index) const override; 20 | 21 | protected: 22 | static QList getIconsForFlags(std::vector flags, 23 | bool compact); 24 | static QString getFlagIcon(ModInfo::EConflictFlag flag); 25 | 26 | QList getIcons(const QModelIndex& index) const override; 27 | size_t getNumIcons(const QModelIndex& index) const override; 28 | 29 | // constructor for color table 30 | // 31 | ModConflictIconDelegate() : ModConflictIconDelegate(nullptr) {} 32 | 33 | private: 34 | static constexpr std::array s_ConflictFlags{ 35 | ModInfo::FLAG_CONFLICT_MIXED, ModInfo::FLAG_CONFLICT_OVERWRITE, 36 | ModInfo::FLAG_CONFLICT_OVERWRITTEN, ModInfo::FLAG_CONFLICT_REDUNDANT}; 37 | static constexpr std::array s_ArchiveLooseConflictFlags{ 38 | ModInfo::FLAG_ARCHIVE_LOOSE_CONFLICT_OVERWRITE, 39 | ModInfo::FLAG_ARCHIVE_LOOSE_CONFLICT_OVERWRITTEN}; 40 | static constexpr std::array s_ArchiveConflictFlags{ 41 | ModInfo::FLAG_ARCHIVE_CONFLICT_MIXED, ModInfo::FLAG_ARCHIVE_CONFLICT_OVERWRITE, 42 | ModInfo::FLAG_ARCHIVE_CONFLICT_OVERWRITTEN}; 43 | 44 | ModListView* m_view; 45 | }; 46 | 47 | #endif // MODCONFLICTICONDELEGATE_H 48 | -------------------------------------------------------------------------------- /src/modcontenticondelegate.h: -------------------------------------------------------------------------------- 1 | #ifndef MODCONTENTICONDELEGATE_H 2 | #define MODCONTENTICONDELEGATE_H 3 | 4 | #include "icondelegate.h" 5 | 6 | class ModListView; 7 | 8 | class ModContentIconDelegate : public IconDelegate 9 | { 10 | Q_OBJECT 11 | public: 12 | explicit ModContentIconDelegate(ModListView* view, int column = -1, 13 | int compactSize = 150); 14 | 15 | bool helpEvent(QHelpEvent* event, QAbstractItemView* view, 16 | const QStyleOptionViewItem& option, const QModelIndex& index) override; 17 | 18 | protected: 19 | QList getIcons(const QModelIndex& index) const override; 20 | size_t getNumIcons(const QModelIndex& index) const override; 21 | 22 | // constructor for color table 23 | // 24 | ModContentIconDelegate() : ModContentIconDelegate(nullptr) {} 25 | 26 | private: 27 | ModListView* m_view; 28 | }; 29 | 30 | #endif // GENERICICONDELEGATE_H 31 | -------------------------------------------------------------------------------- /src/modelutils.h: -------------------------------------------------------------------------------- 1 | #ifndef MODELUTILS_H 2 | #define MODELUTILS_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | namespace MOShared 9 | { 10 | 11 | // retrieve all the row index under the given parent 12 | QModelIndexList flatIndex(const QAbstractItemModel* model, int column = 0, 13 | const QModelIndex& parent = QModelIndex()); 14 | 15 | // retrieve all the visible index in the given view 16 | QModelIndexList visibleIndex(QTreeView* view, int column = 0); 17 | 18 | // convert back-and-forth through model proxies 19 | QModelIndex indexModelToView(const QModelIndex& index, const QAbstractItemView* view); 20 | QModelIndexList indexModelToView(const QModelIndexList& index, 21 | const QAbstractItemView* view); 22 | QModelIndex indexViewToModel(const QModelIndex& index, const QAbstractItemModel* model); 23 | QModelIndexList indexViewToModel(const QModelIndexList& index, 24 | const QAbstractItemModel* model); 25 | 26 | } // namespace MOShared 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /src/modflagicondelegate.h: -------------------------------------------------------------------------------- 1 | #ifndef MODFLAGICONDELEGATE_H 2 | #define MODFLAGICONDELEGATE_H 3 | 4 | #include 5 | 6 | #include "icondelegate.h" 7 | #include "modinfo.h" 8 | 9 | class ModListView; 10 | 11 | class ModFlagIconDelegate : public IconDelegate 12 | { 13 | Q_OBJECT; 14 | 15 | public: 16 | explicit ModFlagIconDelegate(ModListView* view, int column = -1, 17 | int compactSize = 120); 18 | QSize sizeHint(const QStyleOptionViewItem& option, 19 | const QModelIndex& index) const override; 20 | 21 | protected: 22 | static QList getIconsForFlags(std::vector flags, 23 | bool compact); 24 | static QString getFlagIcon(ModInfo::EFlag flag); 25 | 26 | QList getIcons(const QModelIndex& index) const override; 27 | size_t getNumIcons(const QModelIndex& index) const override; 28 | 29 | // constructor for color table 30 | // 31 | ModFlagIconDelegate() : ModFlagIconDelegate(nullptr) {} 32 | 33 | private: 34 | ModListView* m_view; 35 | }; 36 | 37 | #endif // MODFLAGICONDELEGATE_H 38 | -------------------------------------------------------------------------------- /src/modidlineedit.cpp: -------------------------------------------------------------------------------- 1 | #include "modidlineedit.h" 2 | #include 3 | 4 | #include 5 | #include 6 | 7 | ModIDLineEdit::ModIDLineEdit(QWidget* parent) : QLineEdit(parent) {} 8 | ModIDLineEdit::ModIDLineEdit(const QString& text, QWidget* parent) 9 | : QLineEdit(text, parent) 10 | {} 11 | 12 | bool ModIDLineEdit::event(QEvent* event) 13 | { 14 | if (event->type() == QEvent::WhatsThisClicked) { 15 | QWhatsThisClickedEvent* wtcEvent = static_cast(event); 16 | emit linkClicked(wtcEvent->href().trimmed()); 17 | } 18 | 19 | return QLineEdit::event(event); 20 | } 21 | -------------------------------------------------------------------------------- /src/modidlineedit.h: -------------------------------------------------------------------------------- 1 | #ifndef MODIDLINEEDIT_H 2 | #define MODIDLINEEDIT_H 3 | 4 | #include 5 | 6 | class ModIDLineEdit : public QLineEdit 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | explicit ModIDLineEdit(QWidget* parent = 0); 12 | explicit ModIDLineEdit(const QString& text, QWidget* parent = 0); 13 | 14 | public: 15 | virtual bool event(QEvent* event) override; 16 | 17 | signals: 18 | void linkClicked(QString); 19 | }; 20 | 21 | #endif // MODIDLINEEDIT_H 22 | -------------------------------------------------------------------------------- /src/modinfobackup.cpp: -------------------------------------------------------------------------------- 1 | #include "modinfobackup.h" 2 | 3 | std::vector ModInfoBackup::getFlags() const 4 | { 5 | std::vector result = ModInfoRegular::getFlags(); 6 | result.insert(result.begin(), ModInfo::FLAG_BACKUP); 7 | return result; 8 | } 9 | 10 | QString ModInfoBackup::getDescription() const 11 | { 12 | return tr("This is the backup of a mod"); 13 | } 14 | 15 | ModInfoBackup::ModInfoBackup(const QDir& path, OrganizerCore& core) 16 | : ModInfoRegular(path, core) 17 | {} 18 | -------------------------------------------------------------------------------- /src/modinfodialogcategories.h: -------------------------------------------------------------------------------- 1 | #include "modinfodialogtab.h" 2 | 3 | class CategoryFactory; 4 | 5 | class CategoriesTab : public ModInfoDialogTab 6 | { 7 | public: 8 | CategoriesTab(ModInfoDialogTabContext cx); 9 | 10 | void clear() override; 11 | void update() override; 12 | bool canHandleSeparators() const override; 13 | bool usesOriginFiles() const override; 14 | 15 | private: 16 | void add(const CategoryFactory& factory, const std::set& enabledCategories, 17 | QTreeWidgetItem* root, int rootLevel); 18 | 19 | void updatePrimary(); 20 | void addChecked(QTreeWidgetItem* tree); 21 | 22 | void save(QTreeWidgetItem* currentNode); 23 | 24 | void onCategoryChanged(QTreeWidgetItem* item, int col); 25 | void onPrimaryChanged(int index); 26 | }; 27 | -------------------------------------------------------------------------------- /src/modinfodialogesps.h: -------------------------------------------------------------------------------- 1 | #ifndef MODINFODIALOGESPS_H 2 | #define MODINFODIALOGESPS_H 3 | 4 | #include "modinfodialogtab.h" 5 | 6 | class ESPItem; 7 | class ESPListModel; 8 | 9 | class ESPsTab : public ModInfoDialogTab 10 | { 11 | Q_OBJECT; 12 | 13 | public: 14 | ESPsTab(ModInfoDialogTabContext cx); 15 | 16 | void clear() override; 17 | bool feedFile(const QString& rootPath, const QString& fullPath) override; 18 | void update(); 19 | void saveState(Settings& s) override; 20 | void restoreState(const Settings& s) override; 21 | 22 | private: 23 | ESPListModel* m_inactiveModel; 24 | ESPListModel* m_activeModel; 25 | 26 | void onActivate(); 27 | void onDeactivate(); 28 | void selectRow(QListView* list, int row); 29 | }; 30 | 31 | #endif // MODINFODIALOGESPS_H 32 | -------------------------------------------------------------------------------- /src/modinfodialogfiletree.h: -------------------------------------------------------------------------------- 1 | #ifndef MODINFODIALOGFILETREE_H 2 | #define MODINFODIALOGFILETREE_H 3 | 4 | #include "modinfodialogtab.h" 5 | #include 6 | 7 | class FileTreeTab : public ModInfoDialogTab 8 | { 9 | Q_OBJECT; 10 | 11 | public: 12 | FileTreeTab(ModInfoDialogTabContext cx); 13 | 14 | void clear() override; 15 | void saveState(Settings& s); 16 | void restoreState(const Settings& s); 17 | void update() override; 18 | bool deleteRequested() override; 19 | 20 | private: 21 | struct Actions 22 | { 23 | QAction* newFolder = nullptr; 24 | QAction* open = nullptr; 25 | QAction* runHooked = nullptr; 26 | QAction* preview = nullptr; 27 | QAction* explore = nullptr; 28 | QAction* rename = nullptr; 29 | QAction* del = nullptr; 30 | QAction* hide = nullptr; 31 | QAction* unhide = nullptr; 32 | }; 33 | 34 | QFileSystemModel* m_fs; 35 | Actions m_actions; 36 | 37 | void onCreateDirectory(); 38 | void onActivated(); 39 | void onOpen(); 40 | void onRunHooked(); 41 | void onPreview(); 42 | void onExplore(); 43 | void onRename(); 44 | void onDelete(); 45 | void onHide(); 46 | void onUnhide(); 47 | void onOpenInExplorer(); 48 | void onContextMenu(const QPoint& pos); 49 | 50 | QModelIndex singleSelection() const; 51 | bool deleteFile(const QModelIndex& index); 52 | bool deleteFileRecursive(const QModelIndex& index); 53 | void changeVisibility(bool visible); 54 | }; 55 | 56 | #endif // MODINFODIALOGFILETREE_H 57 | -------------------------------------------------------------------------------- /src/modinfodialogfwd.h: -------------------------------------------------------------------------------- 1 | #ifndef MODINFODIALOGFWD_H 2 | #define MODINFODIALOGFWD_H 3 | 4 | #include "filerenamer.h" 5 | #include 6 | 7 | class ModInfo; 8 | using ModInfoPtr = QSharedPointer; 9 | 10 | enum class ModInfoTabIDs 11 | { 12 | None = -1, 13 | TextFiles = 0, 14 | IniFiles, 15 | Images, 16 | Esps, 17 | Conflicts, 18 | Categories, 19 | Nexus, 20 | Notes, 21 | Filetree 22 | }; 23 | 24 | class PluginContainer; 25 | 26 | bool canPreviewFile(const PluginContainer& pluginContainer, bool isArchive, 27 | const QString& filename); 28 | bool canRunFile(bool isArchive, const QString& filename); 29 | bool canOpenFile(bool isArchive, const QString& filename); 30 | bool canExploreFile(bool isArchive, const QString& filename); 31 | bool canHideFile(bool isArchive, const QString& filename); 32 | bool canUnhideFile(bool isArchive, const QString& filename); 33 | 34 | FileRenamer::RenameResults hideFile(FileRenamer& renamer, const QString& oldName); 35 | FileRenamer::RenameResults unhideFile(FileRenamer& renamer, const QString& oldName); 36 | FileRenamer::RenameResults restoreHiddenFilesRecursive(FileRenamer& renamer, 37 | const QString& targetDir); 38 | 39 | class ElideLeftDelegate : public QStyledItemDelegate 40 | { 41 | public: 42 | using QStyledItemDelegate::QStyledItemDelegate; 43 | 44 | protected: 45 | void initStyleOption(QStyleOptionViewItem* o, const QModelIndex& i) const 46 | { 47 | QStyledItemDelegate::initStyleOption(o, i); 48 | o->textElideMode = Qt::ElideLeft; 49 | } 50 | }; 51 | 52 | #endif // MODINFODIALOGFWD_H 53 | -------------------------------------------------------------------------------- /src/modinfodialognexus.h: -------------------------------------------------------------------------------- 1 | #ifndef MODINFODIALOGNEXUS_H 2 | #define MODINFODIALOGNEXUS_H 3 | 4 | #include "modinfodialogtab.h" 5 | 6 | class NexusTabWebpage : public QWebEnginePage 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | NexusTabWebpage(QObject* parent = 0) : QWebEnginePage(parent) {} 12 | 13 | bool acceptNavigationRequest(const QUrl& url, QWebEnginePage::NavigationType type, 14 | bool) override 15 | { 16 | if (type == QWebEnginePage::NavigationTypeLinkClicked) { 17 | emit linkClicked(url); 18 | return false; 19 | } 20 | 21 | return true; 22 | } 23 | 24 | signals: 25 | void linkClicked(const QUrl&); 26 | }; 27 | 28 | class NexusTab : public ModInfoDialogTab 29 | { 30 | Q_OBJECT; 31 | 32 | public: 33 | NexusTab(ModInfoDialogTabContext cx); 34 | 35 | ~NexusTab(); 36 | 37 | void clear() override; 38 | void update() override; 39 | void firstActivation() override; 40 | void setMod(ModInfoPtr mod, MOShared::FilesOrigin* origin) override; 41 | bool usesOriginFiles() const override; 42 | 43 | private: 44 | QMetaObject::Connection m_modConnection; 45 | bool m_requestStarted; 46 | bool m_loading; 47 | 48 | void cleanup(); 49 | void updateVersionColor(); 50 | void updateWebpage(); 51 | void updateTracking(); 52 | 53 | void refreshData(int modID); 54 | bool tryRefreshData(int modID); 55 | void onModChanged(); 56 | 57 | void onModIDChanged(); 58 | void onSourceGameChanged(); 59 | void onVersionChanged(); 60 | void onCategoryChanged(); 61 | 62 | void onRefreshBrowser(); 63 | void onVisitNexus(); 64 | void onEndorse(); 65 | void onTrack(); 66 | 67 | void onCustomURLToggled(); 68 | void onCustomURLChanged(); 69 | void onVisitCustomURL(); 70 | }; 71 | 72 | #endif // MODINFODIALOGNEXUS_H 73 | -------------------------------------------------------------------------------- /src/modinfodialogtextfiles.h: -------------------------------------------------------------------------------- 1 | #ifndef MODINFODIALOGTEXTFILES_H 2 | #define MODINFODIALOGTEXTFILES_H 3 | 4 | #include "filterwidget.h" 5 | #include "modinfodialogtab.h" 6 | #include 7 | #include 8 | 9 | using namespace MOBase; 10 | 11 | class FileListItem; 12 | class FileListModel; 13 | class TextEditor; 14 | 15 | class GenericFilesTab : public ModInfoDialogTab 16 | { 17 | Q_OBJECT; 18 | 19 | public: 20 | void clear() override; 21 | bool canClose() override; 22 | bool feedFile(const QString& rootPath, const QString& fullPath) override; 23 | void update() override; 24 | void saveState(Settings& s) override; 25 | void restoreState(const Settings& s) override; 26 | 27 | protected: 28 | QListView* m_list; 29 | TextEditor* m_editor; 30 | QSplitter* m_splitter; 31 | FileListModel* m_model; 32 | FilterWidget m_filter; 33 | 34 | GenericFilesTab(ModInfoDialogTabContext cx, QListView* list, QSplitter* splitter, 35 | TextEditor* editor, QLineEdit* filter); 36 | 37 | virtual bool wantsFile(const QString& rootPath, const QString& fullPath) const = 0; 38 | 39 | private: 40 | void onSelection(const QModelIndex& current, const QModelIndex& previous); 41 | void select(const QModelIndex& index); 42 | }; 43 | 44 | class TextFilesTab : public GenericFilesTab 45 | { 46 | public: 47 | TextFilesTab(ModInfoDialogTabContext cx); 48 | 49 | protected: 50 | bool wantsFile(const QString& rootPath, const QString& fullPath) const override; 51 | }; 52 | 53 | class IniFilesTab : public GenericFilesTab 54 | { 55 | public: 56 | IniFilesTab(ModInfoDialogTabContext cx); 57 | 58 | protected: 59 | bool wantsFile(const QString& rootPath, const QString& fullPath) const override; 60 | }; 61 | 62 | #endif // MODINFODIALOGTEXTFILES_H 63 | -------------------------------------------------------------------------------- /src/modinfoseparator.cpp: -------------------------------------------------------------------------------- 1 | #include "modinfoseparator.h" 2 | 3 | bool ModInfoSeparator::setName(const QString& name) 4 | { 5 | return ModInfoRegular::setName(name); 6 | } 7 | 8 | std::vector ModInfoSeparator::getFlags() const 9 | { 10 | { 11 | auto result = ModInfoRegular::getFlags(); 12 | result.push_back(FLAG_SEPARATOR); 13 | return result; 14 | } 15 | } 16 | 17 | int ModInfoSeparator::getHighlight() const 18 | { 19 | return HIGHLIGHT_CENTER; 20 | } 21 | 22 | QString ModInfoSeparator::getDescription() const 23 | { 24 | return tr("This is a Separator"); 25 | } 26 | 27 | QString ModInfoSeparator::name() const 28 | { 29 | return ModInfoRegular::name(); 30 | } 31 | 32 | ModInfoSeparator::ModInfoSeparator(const QDir& path, OrganizerCore& core) 33 | : ModInfoRegular(path, core) 34 | {} 35 | -------------------------------------------------------------------------------- /src/modlistversiondelegate.h: -------------------------------------------------------------------------------- 1 | #ifndef MODLISTVERSIONDELEGATE_H 2 | #define MODLISTVERSIONDELEGATE_H 3 | 4 | #include 5 | 6 | class ModListView; 7 | class Settings; 8 | 9 | class ModListVersionDelegate : public QItemDelegate 10 | { 11 | public: 12 | ModListVersionDelegate(ModListView* view, Settings& settings); 13 | 14 | void paint(QPainter* painter, const QStyleOptionViewItem& option, 15 | const QModelIndex& index) const override; 16 | 17 | private: 18 | ModListView* m_view; 19 | Settings& m_settings; 20 | }; 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /src/moshortcut.cpp: -------------------------------------------------------------------------------- 1 | #include "moshortcut.h" 2 | 3 | MOShortcut::MOShortcut(const QString& link) 4 | : m_valid(link.startsWith("moshortcut://")), m_hasInstance(false), 5 | m_hasExecutable(false) 6 | { 7 | if (m_valid) { 8 | int start = (int)strlen("moshortcut://"); 9 | int sep = link.indexOf(':', start); 10 | if (sep >= 0) { 11 | m_hasInstance = true; 12 | m_instance = link.mid(start, sep - start); 13 | m_executable = link.mid(sep + 1); 14 | } else 15 | m_executable = link.mid(start); 16 | if (!(m_executable == "")) 17 | m_hasExecutable = true; 18 | } 19 | } 20 | 21 | bool MOShortcut::isValid() const 22 | { 23 | return m_valid; 24 | } 25 | 26 | bool MOShortcut::hasInstance() const 27 | { 28 | return m_hasInstance; 29 | } 30 | 31 | bool MOShortcut::hasExecutable() const 32 | { 33 | return m_hasExecutable; 34 | } 35 | 36 | QString MOShortcut::instanceDisplayName() const 37 | { 38 | return (m_instance == "" ? QObject::tr("Portable") : m_instance); 39 | } 40 | 41 | const QString& MOShortcut::instanceName() const 42 | { 43 | return m_instance; 44 | } 45 | 46 | const QString& MOShortcut::executableName() const 47 | { 48 | return m_executable; 49 | } 50 | 51 | bool MOShortcut::isForInstance(const Instance& i) const 52 | { 53 | if (!m_hasInstance) { 54 | // no instance name was specified, so the current one is fine 55 | return true; 56 | } 57 | 58 | if (m_instance == "") { 59 | // empty instance name means portable 60 | return i.isPortable(); 61 | } else { 62 | return (i.displayName() == m_instance); 63 | } 64 | } 65 | 66 | QString MOShortcut::toString() const 67 | { 68 | if (m_hasInstance) { 69 | return "moshortcut://" + m_instance + ":" + m_executable; 70 | } else { 71 | return "moshortcut://" + m_executable; 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /src/moshortcut.h: -------------------------------------------------------------------------------- 1 | #ifndef MODORGANIZER_MOSHORTCUT_INCLUDED 2 | #define MODORGANIZER_MOSHORTCUT_INCLUDED 3 | 4 | #include "instancemanager.h" 5 | #include 6 | 7 | class MOShortcut 8 | { 9 | public: 10 | MOShortcut(const QString& link = {}); 11 | 12 | // true if initialized using a valid moshortcut link 13 | // 14 | bool isValid() const; 15 | 16 | // whether an instance name was given 17 | // 18 | bool hasInstance() const; 19 | 20 | // whether an executable name was given 21 | // 22 | bool hasExecutable() const; 23 | 24 | // name of the instance given, "Portable" for portable; undefined if 25 | // hasInstance() returns false 26 | // 27 | QString instanceDisplayName() const; 28 | 29 | // name of the instance given, empty for portable; undefined if hasInstance() 30 | // returns false 31 | // 32 | const QString& instanceName() const; 33 | 34 | // name of the executable given 35 | // 36 | const QString& executableName() const; 37 | 38 | // whether this shortcut is for the given instance 39 | // 40 | bool isForInstance(const Instance& i) const; 41 | 42 | QString toString() const; 43 | 44 | private: 45 | QString m_instance; 46 | QString m_executable; 47 | bool m_valid; 48 | bool m_hasInstance; 49 | bool m_hasExecutable; 50 | }; 51 | 52 | #endif // MODORGANIZER_MOSHORTCUT_INCLUDED 53 | -------------------------------------------------------------------------------- /src/motddialog.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2012 Sebastian Herbord. All rights reserved. 3 | 4 | This file is part of Mod Organizer. 5 | 6 | Mod Organizer is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | Mod Organizer is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with Mod Organizer. If not, see . 18 | */ 19 | 20 | #include "motddialog.h" 21 | #include "bbcode.h" 22 | #include "organizercore.h" 23 | #include "ui_motddialog.h" 24 | #include "utility.h" 25 | #include 26 | #include 27 | 28 | using namespace MOBase; 29 | 30 | MotDDialog::MotDDialog(const QString& message, QWidget* parent) 31 | : QDialog(parent), ui(new Ui::MotDDialog) 32 | { 33 | ui->setupUi(this); 34 | ui->motdView->setHtml(BBCode::convertToHTML(message)); 35 | connect(ui->motdView, SIGNAL(anchorClicked(QUrl)), this, SLOT(linkClicked(QUrl))); 36 | } 37 | 38 | MotDDialog::~MotDDialog() 39 | { 40 | delete ui; 41 | } 42 | 43 | void MotDDialog::on_okButton_clicked() 44 | { 45 | this->close(); 46 | } 47 | 48 | void MotDDialog::linkClicked(const QUrl& url) 49 | { 50 | shell::Open(url); 51 | } 52 | -------------------------------------------------------------------------------- /src/motddialog.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2012 Sebastian Herbord. All rights reserved. 3 | 4 | This file is part of Mod Organizer. 5 | 6 | Mod Organizer is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | Mod Organizer is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with Mod Organizer. If not, see . 18 | */ 19 | 20 | #ifndef MOTDDIALOG_H 21 | #define MOTDDIALOG_H 22 | 23 | #include 24 | #include 25 | 26 | namespace Ui 27 | { 28 | class MotDDialog; 29 | } 30 | 31 | class MotDDialog : public QDialog 32 | { 33 | Q_OBJECT 34 | 35 | public: 36 | explicit MotDDialog(const QString& message, QWidget* parent = 0); 37 | ~MotDDialog(); 38 | 39 | private slots: 40 | void on_okButton_clicked(); 41 | void linkClicked(const QUrl& url); 42 | 43 | private: 44 | Ui::MotDDialog* ui; 45 | }; 46 | 47 | #endif // MOTDDIALOG_H 48 | -------------------------------------------------------------------------------- /src/motddialog.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | MotDDialog 4 | 5 | 6 | 7 | 0 8 | 0 9 | 483 10 | 372 11 | 12 | 13 | 14 | Message of the Day 15 | 16 | 17 | 18 | 19 | 20 | false 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | Qt::Horizontal 30 | 31 | 32 | 33 | 40 34 | 20 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | OK 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /src/multiprocess.h: -------------------------------------------------------------------------------- 1 | #ifndef MODORGANIZER_MOMULTIPROCESS_INCLUDED 2 | #define MODORGANIZER_MOMULTIPROCESS_INCLUDED 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | /** 9 | * used to ensure only a single process of Mod Organizer is started and to 10 | * allow ephemeral processes to send messages to the primary (visible) one. 11 | * This way, other processes can start a download in the primary one 12 | **/ 13 | class MOMultiProcess : public QObject 14 | { 15 | Q_OBJECT 16 | 17 | public: 18 | // `allowMultiple`: if another process is running, run this one 19 | // disconnected from the shared memory 20 | explicit MOMultiProcess(bool allowMultiple, QObject* parent = 0); 21 | 22 | /** 23 | * @return true if this process's job is to forward data to the primary 24 | * process through shared memory 25 | **/ 26 | bool ephemeral() const { return m_Ephemeral; } 27 | 28 | // returns true if this is not the primary process, but was allowed because 29 | // of the AllowMultiple flag 30 | // 31 | bool secondary() const { return !m_Ephemeral && !m_OwnsSM; } 32 | 33 | /** 34 | * send a message to the primary process. This can be used to transmit download urls 35 | * 36 | * @param message message to send 37 | **/ 38 | void sendMessage(const QString& message); 39 | 40 | signals: 41 | 42 | /** 43 | * @brief emitted when an ephemeral process has sent a message (to us) 44 | * 45 | * @param message the message we received 46 | **/ 47 | void messageSent(const QString& message); 48 | 49 | public slots: 50 | 51 | private slots: 52 | 53 | void receiveMessage(); 54 | 55 | private: 56 | bool m_Ephemeral; 57 | bool m_OwnsSM; 58 | QSharedMemory m_SharedMem; 59 | QLocalServer m_Server; 60 | }; 61 | 62 | #endif // MODORGANIZER_MOMULTIPROCESS_INCLUDED 63 | -------------------------------------------------------------------------------- /src/noeditdelegate.cpp: -------------------------------------------------------------------------------- 1 | #include "noeditdelegate.h" 2 | 3 | NoEditDelegate::NoEditDelegate(QObject* parent) : QStyledItemDelegate(parent) {} 4 | 5 | QWidget* NoEditDelegate::createEditor(QWidget*, const QStyleOptionViewItem&, 6 | const QModelIndex&) const 7 | { 8 | return nullptr; 9 | } 10 | -------------------------------------------------------------------------------- /src/noeditdelegate.h: -------------------------------------------------------------------------------- 1 | #ifndef NOEDITDELEGATE_H 2 | #define NOEDITDELEGATE_H 3 | 4 | #include 5 | 6 | class NoEditDelegate : public QStyledItemDelegate 7 | { 8 | public: 9 | NoEditDelegate(QObject* parent = nullptr); 10 | virtual QWidget* createEditor(QWidget* parent, const QStyleOptionViewItem& option, 11 | const QModelIndex& index) const; 12 | }; 13 | 14 | #endif // NOEDITDELEGATE_H 15 | -------------------------------------------------------------------------------- /src/organizer.qbs: -------------------------------------------------------------------------------- 1 | import qbs.base 1.0 2 | 3 | Application { 4 | name: 'Organizer' 5 | 6 | Depends { name: "Qt"; submodules: ["core", "gui", "network", "declarative"] } 7 | Depends { name: 'Shared' } 8 | Depends { name: 'UIBase' } 9 | Depends { name: 'cpp' } 10 | 11 | cpp.defines: [ 'UNICODE', '_UNICODE' ] 12 | cpp.libraryPaths: [ qbs.getenv('BOOSTPATH') + '/stage/lib' ] 13 | cpp.includePaths: [ '../shared', '../archive', '../bsatk', '../esptk', '../uibase', qbs.getenv("BOOSTPATH") ] 14 | // '../bsatk', '../esptk', 15 | 16 | cpp.staticLibraries: [ 'shell32', 'user32', 'Version', 'shlwapi' ] 17 | //LIBS += -lmo_shared -luibase -lshell32 -lole32 -luser32 -ladvapi32 -lgdi32 -lPsapi -lVersion -lbsatk -lshlwapi 18 | 19 | Group { 20 | name: 'Headers' 21 | files: [ '*.h' ] 22 | } 23 | 24 | Group { 25 | name: 'Sources' 26 | files: [ '*.cpp' ] 27 | } 28 | 29 | Group { 30 | name: 'UI Files' 31 | files: [ '*.ui' ] 32 | } 33 | 34 | Group { 35 | name: 'ESP Toolkit' 36 | files: [ '../esptk/*.h', '../esptk/*.cpp' ] 37 | } 38 | } 39 | 40 | // /nologo /c 41 | 42 | 43 | // /Zi -GR -W3 44 | -------------------------------------------------------------------------------- /src/pch.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | -------------------------------------------------------------------------------- /src/persistentcookiejar.h: -------------------------------------------------------------------------------- 1 | #ifndef PERSISTENTCOOKIEJAR_H 2 | #define PERSISTENTCOOKIEJAR_H 3 | 4 | #include 5 | 6 | class PersistentCookieJar : public QNetworkCookieJar 7 | { 8 | 9 | Q_OBJECT 10 | 11 | public: 12 | PersistentCookieJar(const QString& fileName, QObject* parent = 0); 13 | virtual ~PersistentCookieJar(); 14 | 15 | void clear(); 16 | 17 | private: 18 | void save(); 19 | 20 | void restore(); 21 | 22 | private: 23 | QString m_FileName; 24 | }; 25 | 26 | #endif // PERSISTENTCOOKIEJAR_H 27 | -------------------------------------------------------------------------------- /src/pluginlistcontextmenu.h: -------------------------------------------------------------------------------- 1 | #ifndef PLUGINLISTCONTEXTMENU_H 2 | #define PLUGINLISTCONTEXTMENU_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #include "modinfo.h" 9 | 10 | class PluginListView; 11 | class OrganizerCore; 12 | 13 | class PluginListContextMenu : public QMenu 14 | { 15 | Q_OBJECT 16 | 17 | public: 18 | // creates a new context menu, the given index is the one for the click and should be 19 | // valid 20 | // 21 | PluginListContextMenu(const QModelIndex& index, OrganizerCore& core, 22 | PluginListView* modListView); 23 | 24 | signals: 25 | 26 | // emitted to open a mod information 27 | // 28 | void openModInformation(unsigned int modIndex); 29 | 30 | public: 31 | // create the "Send to... " context menu 32 | // 33 | QMenu* createSendToContextMenu(); 34 | void sendPluginsToPriority(const QModelIndexList& indices); 35 | 36 | // set ESP lock on the given plugins 37 | // 38 | void setESPLock(const QModelIndexList& indices, bool locked); 39 | 40 | // open explorer or mod information for the origin of the plugins 41 | // 42 | void openOriginExplorer(const QModelIndexList& indices); 43 | void openOriginInformation(const QModelIndex& index); 44 | 45 | OrganizerCore& m_core; 46 | QModelIndex m_index; 47 | QModelIndexList m_selected; 48 | PluginListView* m_view; 49 | }; 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /src/previewdialog.cpp: -------------------------------------------------------------------------------- 1 | #include "previewdialog.h" 2 | #include "settings.h" 3 | #include "ui_previewdialog.h" 4 | #include 5 | 6 | PreviewDialog::PreviewDialog(const QString& fileName, QWidget* parent) 7 | : QDialog(parent), ui(new Ui::PreviewDialog) 8 | { 9 | ui->setupUi(this); 10 | ui->nameLabel->setText(QFileInfo(fileName).fileName()); 11 | ui->nextButton->setEnabled(false); 12 | ui->previousButton->setEnabled(false); 13 | } 14 | 15 | PreviewDialog::~PreviewDialog() 16 | { 17 | delete ui; 18 | } 19 | 20 | int PreviewDialog::exec() 21 | { 22 | GeometrySaver gs(Settings::instance(), this); 23 | return QDialog::exec(); 24 | } 25 | 26 | void PreviewDialog::addVariant(const QString& modName, QWidget* widget) 27 | { 28 | widget->setProperty("modName", modName); 29 | ui->variantsStack->addWidget(widget); 30 | if (ui->variantsStack->count() > 1) { 31 | ui->nextButton->setEnabled(true); 32 | ui->previousButton->setEnabled(true); 33 | } 34 | } 35 | 36 | int PreviewDialog::numVariants() const 37 | { 38 | return ui->variantsStack->count(); 39 | } 40 | 41 | void PreviewDialog::on_variantsStack_currentChanged(int index) 42 | { 43 | ui->modLabel->setText( 44 | ui->variantsStack->widget(index)->property("modName").toString()); 45 | } 46 | 47 | void PreviewDialog::on_closeButton_clicked() 48 | { 49 | this->accept(); 50 | } 51 | 52 | void PreviewDialog::on_previousButton_clicked() 53 | { 54 | int i = ui->variantsStack->currentIndex() - 1; 55 | if (i < 0) { 56 | i = ui->variantsStack->count() - 1; 57 | } 58 | ui->variantsStack->setCurrentIndex(i); 59 | } 60 | 61 | void PreviewDialog::on_nextButton_clicked() 62 | { 63 | ui->variantsStack->setCurrentIndex((ui->variantsStack->currentIndex() + 1) % 64 | ui->variantsStack->count()); 65 | } 66 | -------------------------------------------------------------------------------- /src/previewdialog.h: -------------------------------------------------------------------------------- 1 | #ifndef PREVIEWDIALOG_H 2 | #define PREVIEWDIALOG_H 3 | 4 | #include 5 | 6 | namespace Ui 7 | { 8 | class PreviewDialog; 9 | } 10 | 11 | class PreviewDialog : public QDialog 12 | { 13 | Q_OBJECT 14 | 15 | public: 16 | explicit PreviewDialog(const QString& fileName, QWidget* parent = 0); 17 | ~PreviewDialog(); 18 | 19 | // also saves and restores geometry 20 | // 21 | int exec() override; 22 | 23 | void addVariant(const QString& modName, QWidget* widget); 24 | int numVariants() const; 25 | 26 | private slots: 27 | 28 | void on_variantsStack_currentChanged(int arg1); 29 | 30 | void on_closeButton_clicked(); 31 | 32 | void on_previousButton_clicked(); 33 | 34 | void on_nextButton_clicked(); 35 | 36 | private: 37 | Ui::PreviewDialog* ui; 38 | }; 39 | 40 | #endif // PREVIEWDIALOG_H 41 | -------------------------------------------------------------------------------- /src/previewgenerator.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2014 Sebastian Herbord. All rights reserved. 3 | 4 | This file is part of Mod Organizer. 5 | 6 | Mod Organizer is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | Mod Organizer is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with Mod Organizer. If not, see . 18 | */ 19 | 20 | #ifndef PREVIEWGENERATOR_H 21 | #define PREVIEWGENERATOR_H 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | 29 | class PluginContainer; 30 | 31 | class PreviewGenerator 32 | { 33 | public: 34 | PreviewGenerator(const PluginContainer& pluginContainer); 35 | 36 | bool previewSupported(const QString& fileExtension, const bool& isArchive) const; 37 | 38 | QWidget* genPreview(const QString& fileName) const; 39 | 40 | QWidget* genArchivePreview(const QByteArray& fileData, const QString& fileName) const; 41 | 42 | private: 43 | const PluginContainer& m_PluginContainer; 44 | QSize m_MaxSize; 45 | }; 46 | 47 | #endif // PREVIEWGENERATOR_H 48 | -------------------------------------------------------------------------------- /src/problemsdialog.h: -------------------------------------------------------------------------------- 1 | #ifndef PROBLEMSDIALOG_H 2 | #define PROBLEMSDIALOG_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | namespace Ui 9 | { 10 | class ProblemsDialog; 11 | } 12 | 13 | class PluginContainer; 14 | 15 | class ProblemsDialog : public QDialog 16 | { 17 | Q_OBJECT 18 | 19 | public: 20 | explicit ProblemsDialog(PluginContainer const& pluginContainer, QWidget* parent = 0); 21 | ~ProblemsDialog(); 22 | 23 | // also saves and restores geometry 24 | // 25 | int exec() override; 26 | 27 | bool hasProblems() const; 28 | 29 | private: 30 | void runDiagnosis(); 31 | 32 | private slots: 33 | void selectionChanged(); 34 | void urlClicked(const QUrl& url); 35 | 36 | void startFix(); 37 | 38 | private: 39 | Ui::ProblemsDialog* ui; 40 | const PluginContainer& m_PluginContainer; 41 | bool m_hasProblems; 42 | }; 43 | 44 | #endif // PROBLEMSDIALOG_H 45 | -------------------------------------------------------------------------------- /src/profileinputdialog.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2012 Sebastian Herbord. All rights reserved. 3 | 4 | This file is part of Mod Organizer. 5 | 6 | Mod Organizer is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | Mod Organizer is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with Mod Organizer. If not, see . 18 | */ 19 | 20 | #include "profileinputdialog.h" 21 | #include "filesystemutilities.h" 22 | #include "ui_profileinputdialog.h" 23 | 24 | ProfileInputDialog::ProfileInputDialog(QWidget* parent) 25 | : QDialog(parent), ui(new Ui::ProfileInputDialog) 26 | { 27 | ui->setupUi(this); 28 | } 29 | 30 | ProfileInputDialog::~ProfileInputDialog() 31 | { 32 | delete ui; 33 | } 34 | 35 | QString ProfileInputDialog::getName() const 36 | { 37 | QString result = ui->nameEdit->text(); 38 | MOBase::fixDirectoryName(result); 39 | return result; 40 | } 41 | 42 | bool ProfileInputDialog::getPreferDefaultSettings() const 43 | { 44 | return ui->defaultSettingsBox->checkState() == Qt::Checked; 45 | } 46 | -------------------------------------------------------------------------------- /src/profileinputdialog.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2012 Sebastian Herbord. All rights reserved. 3 | 4 | This file is part of Mod Organizer. 5 | 6 | Mod Organizer is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | Mod Organizer is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with Mod Organizer. If not, see . 18 | */ 19 | 20 | #ifndef PROFILEINPUTDIALOG_H 21 | #define PROFILEINPUTDIALOG_H 22 | 23 | #include 24 | 25 | namespace Ui 26 | { 27 | class ProfileInputDialog; 28 | } 29 | 30 | class ProfileInputDialog : public QDialog 31 | { 32 | Q_OBJECT 33 | 34 | public: 35 | explicit ProfileInputDialog(QWidget* parent = 0); 36 | ~ProfileInputDialog(); 37 | 38 | QString getName() const; 39 | bool getPreferDefaultSettings() const; 40 | 41 | private: 42 | Ui::ProfileInputDialog* ui; 43 | }; 44 | 45 | #endif // PROFILEINPUTDIALOG_H 46 | -------------------------------------------------------------------------------- /src/proxyutils.h: -------------------------------------------------------------------------------- 1 | #ifndef PROXYUTILS_H 2 | #define PROXYUTILS_H 3 | 4 | #include 5 | 6 | #include "organizerproxy.h" 7 | 8 | namespace MOShared 9 | { 10 | 11 | template 12 | auto callIfPluginActive(OrganizerProxy* proxy, Fn&& callback, T defaultReturn = T{}) 13 | { 14 | return [fn = std::forward(callback), proxy, defaultReturn](auto&&... args) { 15 | if (proxy->isPluginEnabled(proxy->plugin())) { 16 | return fn(std::forward(args)...); 17 | } else { 18 | if constexpr (!std::is_same_v< 19 | std::invoke_result_t, decltype(args)...>, 20 | void>) { 21 | return defaultReturn; 22 | } 23 | } 24 | }; 25 | } 26 | 27 | // We need to connect to the organizer. 28 | template 29 | auto callSignalIfPluginActive(OrganizerProxy* proxy, const Signal& signal, 30 | T defaultReturn = T{}) 31 | { 32 | return callIfPluginActive( 33 | proxy, 34 | [&signal](auto&&... args) { 35 | return signal(std::forward(args)...); 36 | }, 37 | defaultReturn); 38 | } 39 | 40 | template 41 | auto callSignalAlways(const Signal& signal) 42 | { 43 | return [&signal](auto&&... args) { 44 | return signal(std::forward(args)...); 45 | }; 46 | } 47 | 48 | } // namespace MOShared 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /src/qt.conf: -------------------------------------------------------------------------------- 1 | [Paths] 2 | Prefix=. 3 | Plugins=dlls 4 | -------------------------------------------------------------------------------- /src/queryoverwritedialog.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2012 Sebastian Herbord. All rights reserved. 3 | 4 | This file is part of Mod Organizer. 5 | 6 | Mod Organizer is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | Mod Organizer is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with Mod Organizer. If not, see . 18 | */ 19 | 20 | #include "queryoverwritedialog.h" 21 | #include "ui_queryoverwritedialog.h" 22 | 23 | #include 24 | 25 | QueryOverwriteDialog::QueryOverwriteDialog(QWidget* parent, Backup b) 26 | : QDialog(parent), ui(new Ui::QueryOverwriteDialog), m_Action(ACT_NONE) 27 | { 28 | ui->setupUi(this); 29 | ui->backupBox->setChecked(b == BACKUP_YES); 30 | QIcon icon = QApplication::style()->standardIcon(QStyle::SP_MessageBoxQuestion); 31 | ui->iconLabel->setPixmap(icon.pixmap(128)); 32 | } 33 | 34 | QueryOverwriteDialog::~QueryOverwriteDialog() 35 | { 36 | delete ui; 37 | } 38 | 39 | bool QueryOverwriteDialog::backup() const 40 | { 41 | return ui->backupBox->isChecked(); 42 | } 43 | 44 | void QueryOverwriteDialog::on_mergeBtn_clicked() 45 | { 46 | this->m_Action = ACT_MERGE; 47 | this->accept(); 48 | } 49 | 50 | void QueryOverwriteDialog::on_replaceBtn_clicked() 51 | { 52 | this->m_Action = ACT_REPLACE; 53 | this->accept(); 54 | } 55 | 56 | void QueryOverwriteDialog::on_renameBtn_clicked() 57 | { 58 | this->m_Action = ACT_RENAME; 59 | this->accept(); 60 | } 61 | 62 | void QueryOverwriteDialog::on_cancelBtn_clicked() 63 | { 64 | this->reject(); 65 | } 66 | -------------------------------------------------------------------------------- /src/queryoverwritedialog.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2012 Sebastian Herbord. All rights reserved. 3 | 4 | This file is part of Mod Organizer. 5 | 6 | Mod Organizer is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | Mod Organizer is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with Mod Organizer. If not, see . 18 | */ 19 | 20 | #ifndef QUERYOVERWRITEDIALOG_H 21 | #define QUERYOVERWRITEDIALOG_H 22 | 23 | #include 24 | 25 | namespace Ui 26 | { 27 | class QueryOverwriteDialog; 28 | } 29 | 30 | class QueryOverwriteDialog : public QDialog 31 | { 32 | Q_OBJECT 33 | public: 34 | enum Action 35 | { 36 | ACT_NONE, 37 | ACT_MERGE, 38 | ACT_REPLACE, 39 | ACT_RENAME 40 | }; 41 | 42 | enum Backup 43 | { 44 | BACKUP_NO, 45 | BACKUP_YES 46 | }; 47 | 48 | public: 49 | QueryOverwriteDialog(QWidget* parent, Backup b); 50 | ~QueryOverwriteDialog(); 51 | bool backup() const; 52 | Action action() const { return m_Action; } 53 | private slots: 54 | void on_mergeBtn_clicked(); 55 | void on_replaceBtn_clicked(); 56 | void on_renameBtn_clicked(); 57 | void on_cancelBtn_clicked(); 58 | 59 | private: 60 | Ui::QueryOverwriteDialog* ui; 61 | Action m_Action; 62 | }; 63 | 64 | #endif // QUERYOVERWRITEDIALOG_H 65 | -------------------------------------------------------------------------------- /src/resources/accessories-text-editor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/accessories-text-editor.png -------------------------------------------------------------------------------- /src/resources/application-x-executable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/application-x-executable.png -------------------------------------------------------------------------------- /src/resources/applications-accessories.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/applications-accessories.png -------------------------------------------------------------------------------- /src/resources/archive-conflict-loser.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/archive-conflict-loser.png -------------------------------------------------------------------------------- /src/resources/archive-conflict-mixed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/archive-conflict-mixed.png -------------------------------------------------------------------------------- /src/resources/archive-conflict-neutral.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/archive-conflict-neutral.png -------------------------------------------------------------------------------- /src/resources/archive-conflict-winner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/archive-conflict-winner.png -------------------------------------------------------------------------------- /src/resources/arrange-boxes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/arrange-boxes.png -------------------------------------------------------------------------------- /src/resources/badge_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/badge_1.png -------------------------------------------------------------------------------- /src/resources/badge_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/badge_2.png -------------------------------------------------------------------------------- /src/resources/badge_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/badge_3.png -------------------------------------------------------------------------------- /src/resources/badge_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/badge_4.png -------------------------------------------------------------------------------- /src/resources/badge_5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/badge_5.png -------------------------------------------------------------------------------- /src/resources/badge_6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/badge_6.png -------------------------------------------------------------------------------- /src/resources/badge_7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/badge_7.png -------------------------------------------------------------------------------- /src/resources/badge_8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/badge_8.png -------------------------------------------------------------------------------- /src/resources/badge_9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/badge_9.png -------------------------------------------------------------------------------- /src/resources/badge_more.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/badge_more.png -------------------------------------------------------------------------------- /src/resources/branch-closed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/branch-closed.png -------------------------------------------------------------------------------- /src/resources/branch-open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/branch-open.png -------------------------------------------------------------------------------- /src/resources/check.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/check.png -------------------------------------------------------------------------------- /src/resources/combobox-down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/combobox-down.png -------------------------------------------------------------------------------- /src/resources/conflict-hidden.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/conflict-hidden.png -------------------------------------------------------------------------------- /src/resources/conflict-mixed-blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/conflict-mixed-blue.png -------------------------------------------------------------------------------- /src/resources/conflict-mixed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/conflict-mixed.png -------------------------------------------------------------------------------- /src/resources/conflict-overwrite-blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/conflict-overwrite-blue.png -------------------------------------------------------------------------------- /src/resources/conflict-overwrite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/conflict-overwrite.png -------------------------------------------------------------------------------- /src/resources/conflict-overwritten-blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/conflict-overwritten-blue.png -------------------------------------------------------------------------------- /src/resources/conflict-overwritten.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/conflict-overwritten.png -------------------------------------------------------------------------------- /src/resources/conflict-redundant.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/conflict-redundant.png -------------------------------------------------------------------------------- /src/resources/contact-new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/contact-new.png -------------------------------------------------------------------------------- /src/resources/contents/breastplate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/contents/breastplate.png -------------------------------------------------------------------------------- /src/resources/contents/checkbox-tree.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/contents/checkbox-tree.png -------------------------------------------------------------------------------- /src/resources/contents/config.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/contents/config.png -------------------------------------------------------------------------------- /src/resources/contents/conversation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/contents/conversation.png -------------------------------------------------------------------------------- /src/resources/contents/double-quaver.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/contents/double-quaver.png -------------------------------------------------------------------------------- /src/resources/contents/empty-chessboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/contents/empty-chessboard.png -------------------------------------------------------------------------------- /src/resources/contents/f4-nuclear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/contents/f4-nuclear.png -------------------------------------------------------------------------------- /src/resources/contents/facegen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/contents/facegen.png -------------------------------------------------------------------------------- /src/resources/contents/feather-and-scroll.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/contents/feather-and-scroll.png -------------------------------------------------------------------------------- /src/resources/contents/hand-of-god.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/contents/hand-of-god.png -------------------------------------------------------------------------------- /src/resources/contents/jigsaw-piece.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/contents/jigsaw-piece.png -------------------------------------------------------------------------------- /src/resources/contents/locked-chest.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/contents/locked-chest.png -------------------------------------------------------------------------------- /src/resources/contents/lyre.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/contents/lyre.png -------------------------------------------------------------------------------- /src/resources/contents/media.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/contents/media.png -------------------------------------------------------------------------------- /src/resources/contents/mesh-box.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/contents/mesh-box.png -------------------------------------------------------------------------------- /src/resources/contents/tinker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/contents/tinker.png -------------------------------------------------------------------------------- /src/resources/contents/usable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/contents/usable.png -------------------------------------------------------------------------------- /src/resources/contents/xedit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/contents/xedit.png -------------------------------------------------------------------------------- /src/resources/dialog-information.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/dialog-information.png -------------------------------------------------------------------------------- /src/resources/dialog-warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/dialog-warning.png -------------------------------------------------------------------------------- /src/resources/dialog-warning_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/dialog-warning_16.png -------------------------------------------------------------------------------- /src/resources/dialog-warning_16.png (warning_16): -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/dialog-warning_16.png (warning_16) -------------------------------------------------------------------------------- /src/resources/document-properties.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/document-properties.png -------------------------------------------------------------------------------- /src/resources/document-save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/document-save.png -------------------------------------------------------------------------------- /src/resources/document-save_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/document-save_32.png -------------------------------------------------------------------------------- /src/resources/dynamic-blue-right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/dynamic-blue-right.png -------------------------------------------------------------------------------- /src/resources/edit-clear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/edit-clear.png -------------------------------------------------------------------------------- /src/resources/edit-find-replace.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/edit-find-replace.png -------------------------------------------------------------------------------- /src/resources/edit-undo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/edit-undo.png -------------------------------------------------------------------------------- /src/resources/emblem-favorite - 64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/emblem-favorite - 64.png -------------------------------------------------------------------------------- /src/resources/emblem-favorite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/emblem-favorite.png -------------------------------------------------------------------------------- /src/resources/emblem-important.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/emblem-important.png -------------------------------------------------------------------------------- /src/resources/emblem-readonly.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/emblem-readonly.png -------------------------------------------------------------------------------- /src/resources/emblem-redundant.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/emblem-redundant.png -------------------------------------------------------------------------------- /src/resources/emblem-unreadable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/emblem-unreadable.png -------------------------------------------------------------------------------- /src/resources/error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/error.png -------------------------------------------------------------------------------- /src/resources/function.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/function.png -------------------------------------------------------------------------------- /src/resources/game-warning-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/game-warning-16.png -------------------------------------------------------------------------------- /src/resources/game-warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/game-warning.png -------------------------------------------------------------------------------- /src/resources/go-down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/go-down.png -------------------------------------------------------------------------------- /src/resources/go-jump.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/go-jump.png -------------------------------------------------------------------------------- /src/resources/go-next_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/go-next_16.png -------------------------------------------------------------------------------- /src/resources/go-previous_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/go-previous_16.png -------------------------------------------------------------------------------- /src/resources/go-up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/go-up.png -------------------------------------------------------------------------------- /src/resources/help-browser.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/help-browser.png -------------------------------------------------------------------------------- /src/resources/help-browser_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/help-browser_32.png -------------------------------------------------------------------------------- /src/resources/icon-favorite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/icon-favorite.png -------------------------------------------------------------------------------- /src/resources/icons8-checked-checkbox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/icons8-checked-checkbox.png -------------------------------------------------------------------------------- /src/resources/icons8-indeterminate-checkbox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/icons8-indeterminate-checkbox.png -------------------------------------------------------------------------------- /src/resources/icons8-unchecked-checkbox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/icons8-unchecked-checkbox.png -------------------------------------------------------------------------------- /src/resources/internet-web-browser.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/internet-web-browser.png -------------------------------------------------------------------------------- /src/resources/list-add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/list-add.png -------------------------------------------------------------------------------- /src/resources/list-remove.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/list-remove.png -------------------------------------------------------------------------------- /src/resources/log-debug.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/log-debug.png -------------------------------------------------------------------------------- /src/resources/mail-attachment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/mail-attachment.png -------------------------------------------------------------------------------- /src/resources/media-playback-start.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/media-playback-start.png -------------------------------------------------------------------------------- /src/resources/mo_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/mo_icon.png -------------------------------------------------------------------------------- /src/resources/multiply-red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/multiply-red.png -------------------------------------------------------------------------------- /src/resources/open-Folder-Icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/open-Folder-Icon.png -------------------------------------------------------------------------------- /src/resources/package.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/package.png -------------------------------------------------------------------------------- /src/resources/plugins.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/plugins.png -------------------------------------------------------------------------------- /src/resources/preferences-system.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/preferences-system.png -------------------------------------------------------------------------------- /src/resources/process-stop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/process-stop.png -------------------------------------------------------------------------------- /src/resources/red-archive-conflict-loser.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/red-archive-conflict-loser.png -------------------------------------------------------------------------------- /src/resources/save.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/resources/show.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/show.png -------------------------------------------------------------------------------- /src/resources/software-update-available.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/software-update-available.png -------------------------------------------------------------------------------- /src/resources/start-here.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/start-here.png -------------------------------------------------------------------------------- /src/resources/status_active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/status_active.png -------------------------------------------------------------------------------- /src/resources/status_awaiting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/status_awaiting.png -------------------------------------------------------------------------------- /src/resources/status_inactive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/status_inactive.png -------------------------------------------------------------------------------- /src/resources/switch-instance-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/switch-instance-icon.png -------------------------------------------------------------------------------- /src/resources/symbol-backup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/symbol-backup.png -------------------------------------------------------------------------------- /src/resources/system-installer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/system-installer.png -------------------------------------------------------------------------------- /src/resources/system-search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/system-search.png -------------------------------------------------------------------------------- /src/resources/system-software-update.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/system-software-update.png -------------------------------------------------------------------------------- /src/resources/tracked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/tracked.png -------------------------------------------------------------------------------- /src/resources/view-refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/view-refresh.png -------------------------------------------------------------------------------- /src/resources/view-refresh_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/view-refresh_16.png -------------------------------------------------------------------------------- /src/resources/word-wrap.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/resources/x-office-calendar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/resources/x-office-calendar.png -------------------------------------------------------------------------------- /src/sanitychecks.h: -------------------------------------------------------------------------------- 1 | #ifndef MODORGANIZER_SANITYCHECKS_INCLUDED 2 | #define MODORGANIZER_SANITYCHECKS_INCLUDED 3 | 4 | namespace env 5 | { 6 | class Environment; 7 | class Module; 8 | } // namespace env 9 | 10 | namespace MOBase 11 | { 12 | class IPluginGame; 13 | } 14 | 15 | class Settings; 16 | 17 | namespace sanity 18 | { 19 | 20 | void checkEnvironment(const env::Environment& env); 21 | int checkIncompatibleModule(const env::Module& m); 22 | int checkPaths(MOBase::IPluginGame& game, const Settings& s); 23 | 24 | } // namespace sanity 25 | 26 | #endif // MODORGANIZER_SANITYCHECKS_INCLUDED 27 | -------------------------------------------------------------------------------- /src/savestab.h: -------------------------------------------------------------------------------- 1 | #ifndef MODORGANIZER_SAVESTAB_INCLUDED 2 | #define MODORGANIZER_SAVESTAB_INCLUDED 3 | 4 | #include "savegameinfo.h" 5 | #include 6 | 7 | namespace Ui 8 | { 9 | class MainWindow; 10 | } 11 | 12 | namespace MOBase 13 | { 14 | class ISaveGame; 15 | class ISaveGameInfoWidget; 16 | } // namespace MOBase 17 | 18 | class MainWindow; 19 | class OrganizerCore; 20 | 21 | class SavesTab : public QObject 22 | { 23 | Q_OBJECT; 24 | 25 | public: 26 | SavesTab(QWidget* window, OrganizerCore& core, Ui::MainWindow* ui); 27 | 28 | void refreshSaveList(); 29 | void displaySaveGameInfo(QTreeWidgetItem* newItem); 30 | 31 | QDir currentSavesDir() const; 32 | 33 | void startMonitorSaves(); 34 | void stopMonitorSaves(); 35 | void hideSaveGameInfo(); 36 | 37 | protected: 38 | bool eventFilter(QObject* object, QEvent* e) override; 39 | 40 | private: 41 | struct SavesTabUi 42 | { 43 | QTabWidget* mainTabs; 44 | QWidget* tab; 45 | QTreeWidget* list; 46 | }; 47 | 48 | QWidget* m_window; 49 | OrganizerCore& m_core; 50 | SavesTabUi ui; 51 | MOBase::FilterWidget m_filter; 52 | std::vector> m_SaveGames; 53 | MOBase::ISaveGameInfoWidget* m_CurrentSaveView; 54 | 55 | QTimer m_SavesWatcherTimer; 56 | QFileSystemWatcher m_SavesWatcher; 57 | 58 | void onContextMenu(const QPoint& pos); 59 | void deleteSavegame(); 60 | void saveSelectionChanged(QTreeWidgetItem* newItem); 61 | void fixMods(MOBase::SaveGameInfo::MissingAssets const& missingAssets); 62 | void refreshSavesIfOpen(); 63 | void openInExplorer(); 64 | }; 65 | 66 | #endif // MODORGANIZER_SAVESTAB_INCLUDED 67 | -------------------------------------------------------------------------------- /src/savetextasdialog.cpp: -------------------------------------------------------------------------------- 1 | #include "savetextasdialog.h" 2 | #include "ui_savetextasdialog.h" 3 | #include 4 | #include 5 | #include 6 | 7 | using MOBase::reportError; 8 | 9 | SaveTextAsDialog::SaveTextAsDialog(QWidget* parent) 10 | : QDialog(parent), ui(new Ui::SaveTextAsDialog) 11 | { 12 | ui->setupUi(this); 13 | } 14 | 15 | SaveTextAsDialog::~SaveTextAsDialog() 16 | { 17 | delete ui; 18 | } 19 | 20 | void SaveTextAsDialog::setText(const QString& text) 21 | { 22 | ui->textEdit->setPlainText(text); 23 | } 24 | 25 | void SaveTextAsDialog::on_closeBtn_clicked() 26 | { 27 | this->close(); 28 | } 29 | 30 | void SaveTextAsDialog::on_clipboardBtn_clicked() 31 | { 32 | QClipboard* clipboard = QApplication::clipboard(); 33 | clipboard->setText(ui->textEdit->toPlainText()); 34 | } 35 | 36 | void SaveTextAsDialog::on_saveAsBtn_clicked() 37 | { 38 | QString fileName = QFileDialog::getSaveFileName(this, tr("Save CSV"), QString(), 39 | tr("Text Files") + " (*.txt *.csv)"); 40 | if (!fileName.isEmpty()) { 41 | QFile file(fileName); 42 | if (!file.open(QIODevice::WriteOnly)) { 43 | reportError(tr("failed to open \"%1\" for writing").arg(fileName)); 44 | return; 45 | } 46 | 47 | file.write(ui->textEdit->toPlainText().toUtf8()); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/savetextasdialog.h: -------------------------------------------------------------------------------- 1 | #ifndef SAVETEXTASDIALOG_H 2 | #define SAVETEXTASDIALOG_H 3 | 4 | #include 5 | 6 | namespace Ui 7 | { 8 | class SaveTextAsDialog; 9 | } 10 | 11 | class SaveTextAsDialog : public QDialog 12 | { 13 | Q_OBJECT 14 | 15 | public: 16 | explicit SaveTextAsDialog(QWidget* parent = 0); 17 | ~SaveTextAsDialog(); 18 | 19 | void setText(const QString& text); 20 | 21 | private slots: 22 | void on_closeBtn_clicked(); 23 | 24 | void on_clipboardBtn_clicked(); 25 | 26 | void on_saveAsBtn_clicked(); 27 | 28 | private: 29 | Ui::SaveTextAsDialog* ui; 30 | }; 31 | 32 | #endif // SAVETEXTASDIALOG_H 33 | -------------------------------------------------------------------------------- /src/serverinfo.h: -------------------------------------------------------------------------------- 1 | #ifndef SERVERINFO_H 2 | #define SERVERINFO_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | class ServerInfo 9 | { 10 | public: 11 | using SpeedList = std::vector; 12 | 13 | ServerInfo(); 14 | ServerInfo(QString name, bool premium, QDate lastSeen, int preferred, 15 | SpeedList lastDownloads); 16 | 17 | const QString& name() const; 18 | 19 | bool isPremium() const; 20 | void setPremium(bool b); 21 | 22 | const QDate& lastSeen() const; 23 | void updateLastSeen(); 24 | 25 | int preferred() const; 26 | void setPreferred(int i); 27 | 28 | const SpeedList& lastDownloads() const; 29 | int averageSpeed() const; 30 | void addDownload(int bytesPerSecond); 31 | 32 | private: 33 | QString m_name; 34 | bool m_premium; 35 | QDate m_lastSeen; 36 | int m_preferred; 37 | SpeedList m_lastDownloads; 38 | }; 39 | 40 | Q_DECLARE_METATYPE(ServerInfo) 41 | 42 | class ServerList 43 | { 44 | public: 45 | using container = std::vector; 46 | using iterator = container::iterator; 47 | using const_iterator = container::const_iterator; 48 | 49 | void add(ServerInfo s); 50 | 51 | iterator begin(); 52 | const_iterator begin() const; 53 | iterator end(); 54 | const_iterator end() const; 55 | std::size_t size() const; 56 | bool empty() const; 57 | 58 | container getPreferred() const; 59 | 60 | // removes servers that haven't been seen in a while 61 | // 62 | void cleanup(); 63 | 64 | private: 65 | container m_servers; 66 | }; 67 | 68 | #endif // SERVERINFO_H 69 | -------------------------------------------------------------------------------- /src/settingsdialogdiagnostics.h: -------------------------------------------------------------------------------- 1 | #ifndef SETTINGSDIALOGDIAGNOSTICS_H 2 | #define SETTINGSDIALOGDIAGNOSTICS_H 3 | 4 | #include "settings.h" 5 | #include "settingsdialog.h" 6 | 7 | class DiagnosticsSettingsTab : public SettingsTab 8 | { 9 | public: 10 | DiagnosticsSettingsTab(Settings& settings, SettingsDialog& dialog); 11 | 12 | void update(); 13 | 14 | private: 15 | void setLogLevel(); 16 | void setLootLogLevel(); 17 | void setCrashDumpTypesBox(); 18 | }; 19 | 20 | #endif // SETTINGSDIALOGDIAGNOSTICS_H 21 | -------------------------------------------------------------------------------- /src/settingsdialoggeneral.h: -------------------------------------------------------------------------------- 1 | #ifndef SETTINGSDIALOGGENERAL_H 2 | #define SETTINGSDIALOGGENERAL_H 3 | 4 | #include "plugincontainer.h" 5 | #include "settings.h" 6 | #include "settingsdialog.h" 7 | 8 | class GeneralSettingsTab : public SettingsTab 9 | { 10 | public: 11 | GeneralSettingsTab(Settings& settings, SettingsDialog& dialog); 12 | 13 | void update(); 14 | 15 | private: 16 | void addLanguages(); 17 | void selectLanguage(); 18 | 19 | void resetDialogs(); 20 | 21 | void onEditCategories(); 22 | void onResetDialogs(); 23 | }; 24 | 25 | #endif // SETTINGSDIALOGGENERAL_H 26 | -------------------------------------------------------------------------------- /src/settingsdialogmodlist.h: -------------------------------------------------------------------------------- 1 | #ifndef SETTINGSDIALOGMODLIST_H 2 | #define SETTINGSDIALOGMODLIST_H 3 | 4 | #include 5 | 6 | #include "settings.h" 7 | #include "settingsdialog.h" 8 | 9 | class ModListSettingsTab : public SettingsTab 10 | { 11 | public: 12 | ModListSettingsTab(Settings& settings, SettingsDialog& dialog); 13 | 14 | void update() override; 15 | 16 | protected slots: 17 | 18 | // enable/disable the collapsible separators group depending on 19 | // the checkbox states 20 | void updateCollapsibleSeparatorsGroup(); 21 | 22 | private: 23 | const std::map m_columnToBox; 24 | }; 25 | 26 | #endif // SETTINGSDIALOGGENERAL_H 27 | -------------------------------------------------------------------------------- /src/settingsdialognexus.h: -------------------------------------------------------------------------------- 1 | #ifndef SETTINGSDIALOGNEXUS_H 2 | #define SETTINGSDIALOGNEXUS_H 3 | 4 | #include "nxmaccessmanager.h" 5 | #include "settings.h" 6 | #include "settingsdialog.h" 7 | 8 | // used by the settings dialog and the create instance dialog 9 | // 10 | class NexusConnectionUI : public QObject 11 | { 12 | Q_OBJECT; 13 | 14 | public: 15 | NexusConnectionUI(QWidget* parent, Settings* s, QAbstractButton* connectButton, 16 | QAbstractButton* disconnectButton, QAbstractButton* manualButton, 17 | QListWidget* logList); 18 | 19 | void connect(); 20 | void manual(); 21 | void disconnect(); 22 | 23 | signals: 24 | void stateChanged(); 25 | void keyChanged(); 26 | 27 | private: 28 | QWidget* m_parent; 29 | Settings* m_settings; 30 | QAbstractButton* m_connect; 31 | QAbstractButton* m_disconnect; 32 | QAbstractButton* m_manual; 33 | QListWidget* m_log; 34 | 35 | std::unique_ptr m_nexusLogin; 36 | std::unique_ptr m_nexusValidator; 37 | 38 | void addLog(const QString& s); 39 | 40 | void updateState(); 41 | 42 | void validateKey(const QString& key); 43 | bool setKey(const QString& key); 44 | bool clearKey(); 45 | 46 | void onSSOKeyChanged(const QString& key); 47 | void onSSOStateChanged(NexusSSOLogin::States s, const QString& e); 48 | 49 | void onValidatorFinished(ValidationAttempt::Result r, const QString& message, 50 | std::optional useR); 51 | }; 52 | 53 | class NexusSettingsTab : public SettingsTab 54 | { 55 | public: 56 | NexusSettingsTab(Settings& settings, SettingsDialog& dialog); 57 | void update(); 58 | 59 | private: 60 | std::unique_ptr m_connectionUI; 61 | 62 | void clearCache(); 63 | void associate(); 64 | 65 | void updateNexusData(); 66 | void updateCustomBrowser(); 67 | void browseCustomBrowser(); 68 | }; 69 | 70 | #endif // SETTINGSDIALOGNEXUS_H 71 | -------------------------------------------------------------------------------- /src/settingsdialogpaths.h: -------------------------------------------------------------------------------- 1 | #ifndef SETTINGSDIALOGPATHS_H 2 | #define SETTINGSDIALOGPATHS_H 3 | 4 | #include "settings.h" 5 | #include "settingsdialog.h" 6 | 7 | class PathsSettingsTab : public SettingsTab 8 | { 9 | public: 10 | PathsSettingsTab(Settings& settings, SettingsDialog& dialog); 11 | void update(); 12 | 13 | private: 14 | void on_browseBaseDirBtn_clicked(); 15 | void on_browseCacheDirBtn_clicked(); 16 | void on_browseDownloadDirBtn_clicked(); 17 | void on_browseGameDirBtn_clicked(); 18 | void on_browseModDirBtn_clicked(); 19 | void on_browseOverwriteDirBtn_clicked(); 20 | void on_browseProfilesDirBtn_clicked(); 21 | 22 | void on_baseDirEdit_editingFinished(); 23 | void on_cacheDirEdit_editingFinished(); 24 | void on_downloadDirEdit_editingFinished(); 25 | void on_modDirEdit_editingFinished(); 26 | void on_overwriteDirEdit_editingFinished(); 27 | void on_profilesDirEdit_editingFinished(); 28 | 29 | void normalizePath(QLineEdit* lineEdit); 30 | 31 | QDir m_gameDir; 32 | }; 33 | 34 | #endif // SETTINGSDIALOGPATHS_H 35 | -------------------------------------------------------------------------------- /src/settingsdialogplugins.h: -------------------------------------------------------------------------------- 1 | #ifndef SETTINGSDIALOGPLUGINS_H 2 | #define SETTINGSDIALOGPLUGINS_H 3 | 4 | #include "filterwidget.h" 5 | 6 | #include "settings.h" 7 | #include "settingsdialog.h" 8 | 9 | class PluginsSettingsTab : public SettingsTab 10 | { 11 | public: 12 | PluginsSettingsTab(Settings& settings, PluginContainer* pluginContainer, 13 | SettingsDialog& dialog); 14 | 15 | void update(); 16 | void closing() override; 17 | 18 | private: 19 | void on_pluginsList_currentItemChanged(QTreeWidgetItem* current, 20 | QTreeWidgetItem* previous); 21 | void on_checkboxEnabled_clicked(bool checked); 22 | void deleteBlacklistItem(); 23 | void storeSettings(QTreeWidgetItem* pluginItem); 24 | 25 | private slots: 26 | 27 | /** 28 | * @brief Update the list item to display inactive plugins. 29 | */ 30 | void updateListItems(); 31 | 32 | /** 33 | * @brief Filter the plugin list according to the filter widget. 34 | * 35 | */ 36 | void filterPluginList(); 37 | 38 | /** 39 | * @brief Retrieve the plugin associated to the given item in the list. 40 | * 41 | */ 42 | MOBase::IPlugin* plugin(QTreeWidgetItem* pluginItem) const; 43 | 44 | enum 45 | { 46 | PluginRole = Qt::UserRole, 47 | SettingsRole = Qt::UserRole + 1, 48 | DescriptionsRole = Qt::UserRole + 2 49 | }; 50 | 51 | private: 52 | PluginContainer* m_pluginContainer; 53 | 54 | MOBase::FilterWidget m_filter; 55 | }; 56 | 57 | #endif // SETTINGSDIALOGPLUGINS_H 58 | -------------------------------------------------------------------------------- /src/settingsdialogtheme.h: -------------------------------------------------------------------------------- 1 | #ifndef SETTINGSDIALOGTHEME_H 2 | #define SETTINGSDIALOGTHEME_H 3 | 4 | #include 5 | 6 | #include "settings.h" 7 | #include "settingsdialog.h" 8 | 9 | class ThemeSettingsTab : public SettingsTab 10 | { 11 | public: 12 | ThemeSettingsTab(Settings& settings, SettingsDialog& dialog); 13 | 14 | void update() override; 15 | 16 | private: 17 | void addStyles(); 18 | void selectStyle(); 19 | void onExploreStyles(); 20 | }; 21 | 22 | #endif // SETTINGSDIALOGGENERAL_H 23 | -------------------------------------------------------------------------------- /src/settingsdialogworkarounds.h: -------------------------------------------------------------------------------- 1 | #ifndef SETTINGSDIALOGWORKAROUNDS_H 2 | #define SETTINGSDIALOGWORKAROUNDS_H 3 | 4 | #include "settings.h" 5 | #include "settingsdialog.h" 6 | 7 | class WorkaroundsSettingsTab : public SettingsTab 8 | { 9 | public: 10 | WorkaroundsSettingsTab(Settings& settings, SettingsDialog& dialog); 11 | 12 | // shows the blacklist dialog from the given settings, and changes the 13 | // settings when the user accepts it 14 | // 15 | static bool changeBlacklistNow(QWidget* parent, Settings& settings); 16 | 17 | // shows the blacklist dialog from the given string and returns the new 18 | // blacklist if the user accepted it 19 | // 20 | static std::optional changeBlacklistLater(QWidget* parent, 21 | const QString& current); 22 | 23 | // shows the blacklist dialog from the given string and returns the new 24 | // blacklist if the user accepted it 25 | // 26 | static std::optional changeSkipFileSuffixes(QWidget* parent, 27 | const QStringList& current); 28 | 29 | // shows the blacklist dialog from the given string and returns the new 30 | // blacklist if the user accepted it 31 | // 32 | static std::optional changeSkipDirectories(QWidget* parent, 33 | const QStringList& current); 34 | 35 | void update(); 36 | 37 | private: 38 | QString m_ExecutableBlacklist; 39 | QStringList m_SkipFileSuffixes; 40 | QStringList m_SkipDirectories; 41 | 42 | void on_bsaDateBtn_clicked(); 43 | void on_execBlacklistBtn_clicked(); 44 | void on_skipFileSuffixBtn_clicked(); 45 | void on_skipDirectoriesBtn_clicked(); 46 | void on_resetGeometryBtn_clicked(); 47 | }; 48 | 49 | #endif // SETTINGSDIALOGWORKAROUNDS_H 50 | -------------------------------------------------------------------------------- /src/shared/SConscript: -------------------------------------------------------------------------------- 1 | Import('env') 2 | 3 | env = env.Clone() 4 | 5 | env.AppendUnique(CPPDEFINES = [ 6 | 'UNICODE', 7 | '_UNICODE', 8 | '_CRT_SECURE_NO_WARNINGS', 9 | 'BOOST_DISABLE_ASSERTS', 10 | 'NDEBUG' 11 | ]) 12 | 13 | env.AppendUnique(CPPPATH = [ 14 | '../bsatk', 15 | '${BOOSTPATH}', 16 | '.' # Seriously! 17 | ]) 18 | 19 | # Not sure if renaming this helps much as it's static 20 | env.StaticLibrary('mo_shared', env.Glob('*.cpp')) 21 | 22 | #res = env['QT_USED_MODULES'] 23 | #Return('res') 24 | -------------------------------------------------------------------------------- /src/shared/appconfig.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2012 Sebastian Herbord. All rights reserved. 3 | 4 | This file is part of Mod Organizer. 5 | 6 | Mod Organizer is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | Mod Organizer is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with Mod Organizer. If not, see . 18 | */ 19 | 20 | #include "appconfig.h" 21 | 22 | namespace AppConfig 23 | { 24 | 25 | #define PARWSTRING wstring 26 | #define APPPARAM(partype, parid, value) \ 27 | partype parid() \ 28 | { \ 29 | return value; \ 30 | } 31 | #include "appconfig.inc" 32 | 33 | namespace MOShared 34 | { 35 | #undef PARWSTRING 36 | #undef APPPARAM 37 | 38 | } // namespace MOShared 39 | } // namespace AppConfig 40 | -------------------------------------------------------------------------------- /src/shared/appconfig.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2012 Sebastian Herbord. All rights reserved. 3 | 4 | This file is part of Mod Organizer. 5 | 6 | Mod Organizer is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | Mod Organizer is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with Mod Organizer. If not, see . 18 | */ 19 | 20 | #ifndef APPCONFIG_H 21 | #define APPCONFIG_H 22 | 23 | #include 24 | 25 | namespace AppConfig 26 | { 27 | 28 | #define PARWSTRING wstring 29 | #define APPPARAM(partype, parid, value) partype parid(); 30 | #include "appconfig.inc" 31 | 32 | namespace MOShared 33 | { 34 | #undef PARWSTRING 35 | #undef APPPARAM 36 | 37 | } // namespace MOShared 38 | 39 | } // namespace AppConfig 40 | 41 | #endif // APPCONFIG_H 42 | -------------------------------------------------------------------------------- /src/shared/appconfig.inc: -------------------------------------------------------------------------------- 1 | APPPARAM(std::wstring, translationPrefix, L"organizer") 2 | APPPARAM(std::wstring, pluginPath, L"plugins") 3 | APPPARAM(std::wstring, profilesPath, L"profiles") 4 | APPPARAM(std::wstring, modsPath, L"mods") 5 | APPPARAM(std::wstring, downloadPath, L"downloads") 6 | APPPARAM(std::wstring, overwritePath, L"overwrite") 7 | APPPARAM(std::wstring, stylesheetsPath, L"stylesheets") 8 | APPPARAM(std::wstring, cachePath, L"webcache") 9 | APPPARAM(std::wstring, tutorialsPath, L"tutorials") 10 | APPPARAM(std::wstring, logPath, L"logs") 11 | APPPARAM(std::wstring, dumpsDir, L"crashDumps") 12 | APPPARAM(std::wstring, defaultProfileName, L"Default") 13 | APPPARAM(std::wstring, profileTweakIni, L"profile_tweaks.ini") 14 | APPPARAM(std::wstring, logFileName, L"mo_interface.log") 15 | APPPARAM(std::wstring, iniFileName, L"ModOrganizer.ini") 16 | APPPARAM(std::wstring, proxyDLLTarget, L"steam_api.dll") 17 | APPPARAM(std::wstring, proxyDLLOrig, L"steam_api_orig.dll") // needs to be identical to the value used in proxydll-project 18 | APPPARAM(std::wstring, proxyDLLSource, L"proxy.dll") 19 | APPPARAM(std::wstring, vfs32DLLName, L"usvfs_x86.dll") 20 | APPPARAM(std::wstring, vfs64DLLName, L"usvfs_x64.dll") 21 | APPPARAM(std::wstring, nxmHandlerExe, L"nxmhandler.exe") 22 | APPPARAM(std::wstring, nxmHandlerIni, L"nxmhandler.ini") 23 | APPPARAM(std::wstring, portableLockFileName, L"portable.txt") 24 | APPPARAM(const wchar_t*, localSavePlaceholder, L"__MOProfileSave__\\") 25 | 26 | APPPARAM(std::wstring, firstStepsTutorial, L"tutorial_firststeps_main.js") 27 | APPPARAM(int, numLogFiles, 5) // number of log files to keep 28 | -------------------------------------------------------------------------------- /src/shared/fileregister.h: -------------------------------------------------------------------------------- 1 | #ifndef MO_REGISTER_FILESREGISTER_INCLUDED 2 | #define MO_REGISTER_FILESREGISTER_INCLUDED 3 | 4 | #include "fileregisterfwd.h" 5 | #include 6 | #include 7 | 8 | namespace MOShared 9 | { 10 | 11 | class FileRegister 12 | { 13 | public: 14 | FileRegister(boost::shared_ptr originConnection); 15 | 16 | // noncopyable 17 | FileRegister(const FileRegister&) = delete; 18 | FileRegister& operator=(const FileRegister&) = delete; 19 | 20 | bool indexValid(FileIndex index) const; 21 | 22 | FileEntryPtr createFile(std::wstring name, DirectoryEntry* parent, 23 | DirectoryStats& stats); 24 | 25 | FileEntryPtr getFile(FileIndex index) const; 26 | 27 | size_t highestCount() const 28 | { 29 | std::scoped_lock lock(m_Mutex); 30 | return m_Files.size(); 31 | } 32 | 33 | bool removeFile(FileIndex index); 34 | void removeOrigin(FileIndex index, OriginID originID); 35 | void removeOriginMulti(std::set indices, OriginID originID); 36 | 37 | void sortOrigins(); 38 | 39 | private: 40 | using FileMap = std::deque; 41 | 42 | mutable std::mutex m_Mutex; 43 | FileMap m_Files; 44 | boost::shared_ptr m_OriginConnection; 45 | std::atomic m_NextIndex; 46 | 47 | void unregisterFile(FileEntryPtr file); 48 | FileIndex generateIndex(); 49 | }; 50 | 51 | } // namespace MOShared 52 | 53 | #endif // MO_REGISTER_FILESREGISTER_INCLUDED 54 | -------------------------------------------------------------------------------- /src/shared/shared.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2011-05-03T18:35:56 4 | # 5 | #------------------------------------------------- 6 | 7 | QT -= gui core 8 | #QT += core 9 | 10 | TARGET = mo_shared 11 | TEMPLATE = lib 12 | CONFIG += staticlib c++11 13 | 14 | 15 | !include(../LocalPaths.pri) { 16 | message("paths to required libraries need to be set up in LocalPaths.pri") 17 | } 18 | 19 | SOURCES += \ 20 | inject.cpp \ 21 | windows_error.cpp \ 22 | error_report.cpp \ 23 | directoryentry.cpp \ 24 | util.cpp \ 25 | appconfig.cpp \ 26 | leaktrace.cpp \ 27 | stackdata.cpp 28 | 29 | HEADERS += \ 30 | inject.h \ 31 | windows_error.h \ 32 | error_report.h \ 33 | directoryentry.h \ 34 | util.h \ 35 | appconfig.h \ 36 | appconfig.inc \ 37 | leaktrace.h \ 38 | stackdata.h 39 | 40 | 41 | # only for custom leak detection 42 | #DEFINES += TRACE_LEAKS 43 | #LIBS += -lDbgHelp 44 | 45 | msvc:QMAKE_CXXFLAGS_DEBUG -= -Zi 46 | msvc:QMAKE_CXXFLAGS_DEBUG += -Z7 47 | 48 | CONFIG(debug, debug|release) { 49 | LIBS += -L$$OUT_PWD/../bsatk/debug 50 | LIBS += -lDbgHelp 51 | msvc:PRE_TARGETDEPS += $$OUT_PWD/../bsatk/debug/bsatk.lib 52 | } else { 53 | LIBS += -L$$OUT_PWD/../bsatk/release 54 | msvc:PRE_TARGETDEPS += $$OUT_PWD/../bsatk/release/bsatk.lib 55 | } 56 | 57 | gcc:QMAKE_CXXFLAGS += -Wno-unknown-pragmas -march=i686 -fno-tree-vectorize 58 | 59 | LIBS += -lbsatk 60 | 61 | DEFINES += UNICODE _UNICODE _CRT_SECURE_NO_WARNINGS 62 | 63 | DEFINES += BOOST_DISABLE_ASSERTS NDEBUG 64 | 65 | # QMAKE_CXXFLAGS += /analyze 66 | 67 | INCLUDEPATH += ../bsatk "$${BOOSTPATH}" 68 | 69 | OTHER_FILES += \ 70 | SConscript 71 | -------------------------------------------------------------------------------- /src/shared/shared.qbs: -------------------------------------------------------------------------------- 1 | import qbs.base 1.0 2 | 3 | StaticLibrary { 4 | name: { 5 | print(qbs.getenv("BOOSTPATH") + "/stage/lib") 6 | return 'Shared' 7 | } 8 | 9 | Depends { name: 'cpp' } 10 | Depends { name: 'BSAToolkit' } 11 | 12 | cpp.defines: [] 13 | cpp.libraryPaths: [ qbs.getenv("BOOSTPATH") + "/stage/lib" ] 14 | cpp.includePaths: [ '../bsatk', qbs.getenv("BOOSTPATH") ] 15 | files: [ 16 | '*.h', 17 | '*.cpp', 18 | '*.inc' 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /src/shared/windows_error.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2012 Sebastian Herbord. All rights reserved. 3 | 4 | This file is part of Mod Organizer. 5 | 6 | Mod Organizer is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | Mod Organizer is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with Mod Organizer. If not, see . 18 | */ 19 | 20 | #include "windows_error.h" 21 | #include 22 | 23 | namespace MOShared 24 | { 25 | 26 | std::string windows_error::constructMessage(const std::string& input, int inErrorCode) 27 | { 28 | std::ostringstream finalMessage; 29 | finalMessage << input; 30 | 31 | LPSTR buffer = nullptr; 32 | 33 | DWORD errorCode = inErrorCode != -1 ? inErrorCode : ::GetLastError(); 34 | 35 | // TODO: the message is not english? 36 | if (FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, 37 | nullptr, errorCode, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), 38 | (LPSTR)&buffer, 0, nullptr) == 0) { 39 | finalMessage << " (errorcode " << errorCode << ")"; 40 | } else { 41 | LPSTR lastChar = buffer + strlen(buffer) - 2; 42 | *lastChar = '\0'; 43 | finalMessage << " (" << buffer << " [" << errorCode << "])"; 44 | LocalFree(buffer); // allocated by FormatMessage 45 | } 46 | 47 | ::SetLastError( 48 | errorCode); // restore error code because FormatMessage might have modified it 49 | return finalMessage.str(); 50 | } 51 | 52 | } // namespace MOShared 53 | -------------------------------------------------------------------------------- /src/shared/windows_error.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2012 Sebastian Herbord. All rights reserved. 3 | 4 | This file is part of Mod Organizer. 5 | 6 | Mod Organizer is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | Mod Organizer is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with Mod Organizer. If not, see . 18 | */ 19 | 20 | #ifndef WINDOWS_ERROR_H 21 | #define WINDOWS_ERROR_H 22 | 23 | #include 24 | #define WIN32_LEAN_AND_MEAN 25 | #include 26 | 27 | namespace MOShared 28 | { 29 | 30 | class windows_error : public std::runtime_error 31 | { 32 | public: 33 | windows_error(const std::string& message, int errorcode = ::GetLastError()) 34 | : runtime_error(constructMessage(message, errorcode)), m_ErrorCode(errorcode) 35 | {} 36 | int getErrorCode() const { return m_ErrorCode; } 37 | 38 | private: 39 | std::string constructMessage(const std::string& input, int errorcode); 40 | 41 | private: 42 | int m_ErrorCode; 43 | }; 44 | 45 | } // namespace MOShared 46 | 47 | #endif // WINDOWS_ERROR_H 48 | -------------------------------------------------------------------------------- /src/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/splash.png -------------------------------------------------------------------------------- /src/statusbar.h: -------------------------------------------------------------------------------- 1 | #ifndef MO_STATUSBAR_H 2 | #define MO_STATUSBAR_H 3 | 4 | #include 5 | #include 6 | 7 | struct APIStats; 8 | class APIUserAccount; 9 | class Settings; 10 | class OrganizerCore; 11 | 12 | namespace Ui 13 | { 14 | class MainWindow; 15 | } 16 | 17 | class StatusBarAction : public QWidget 18 | { 19 | public: 20 | StatusBarAction(QAction* action); 21 | 22 | void set(bool visible); 23 | 24 | protected: 25 | void mouseDoubleClickEvent(QMouseEvent* e) override; 26 | 27 | private: 28 | QAction* m_action; 29 | QLabel* m_icon; 30 | QLabel* m_text; 31 | 32 | QString cleanupActionText(const QString& s) const; 33 | }; 34 | 35 | class StatusBar : public QStatusBar 36 | { 37 | Q_OBJECT; 38 | 39 | public: 40 | StatusBar(QWidget* parent = nullptr); 41 | 42 | void setup(Ui::MainWindow* ui, const Settings& settings); 43 | 44 | void setProgress(int percent); 45 | void setNotifications(bool hasNotifications); 46 | void setAPI(const APIStats& stats, const APIUserAccount& user); 47 | void setUpdateAvailable(bool b); 48 | void checkSettings(const Settings& settings); 49 | void updateNormalMessage(OrganizerCore& core); 50 | 51 | protected: 52 | void showEvent(QShowEvent* e); 53 | void hideEvent(QHideEvent* e); 54 | 55 | private: 56 | Ui::MainWindow* ui; 57 | QLabel* m_normal; 58 | QProgressBar* m_progress; 59 | QWidget* m_progressSpacer1; 60 | QWidget* m_progressSpacer2; 61 | StatusBarAction* m_notifications; 62 | StatusBarAction* m_update; 63 | QLabel* m_api; 64 | 65 | void visibilityChanged(bool visible); 66 | }; 67 | 68 | #endif // MO_STATUSBAR_H 69 | -------------------------------------------------------------------------------- /src/stylesheet_resource.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | resources/combobox-down.png 4 | resources/branch-closed.png 5 | resources/branch-open.png 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/stylesheets/Parchment/checkbox-alt-checked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/stylesheets/Parchment/checkbox-alt-checked.png -------------------------------------------------------------------------------- /src/stylesheets/Parchment/checkbox-alt-unchecked-hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/stylesheets/Parchment/checkbox-alt-unchecked-hover.png -------------------------------------------------------------------------------- /src/stylesheets/Parchment/checkbox-alt-unchecked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/stylesheets/Parchment/checkbox-alt-unchecked.png -------------------------------------------------------------------------------- /src/stylesheets/Parchment/checkbox-checked-disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/stylesheets/Parchment/checkbox-checked-disabled.png -------------------------------------------------------------------------------- /src/stylesheets/Parchment/checkbox-checked-hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/stylesheets/Parchment/checkbox-checked-hover.png -------------------------------------------------------------------------------- /src/stylesheets/Parchment/checkbox-checked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/stylesheets/Parchment/checkbox-checked.png -------------------------------------------------------------------------------- /src/stylesheets/Parchment/checkbox-disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/stylesheets/Parchment/checkbox-disabled.png -------------------------------------------------------------------------------- /src/stylesheets/Parchment/checkbox-hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/stylesheets/Parchment/checkbox-hover.png -------------------------------------------------------------------------------- /src/stylesheets/Parchment/checkbox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/stylesheets/Parchment/checkbox.png -------------------------------------------------------------------------------- /src/stylesheets/skyrim/arrow-down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/stylesheets/skyrim/arrow-down.png -------------------------------------------------------------------------------- /src/stylesheets/skyrim/arrow-left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/stylesheets/skyrim/arrow-left.png -------------------------------------------------------------------------------- /src/stylesheets/skyrim/arrow-right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/stylesheets/skyrim/arrow-right.png -------------------------------------------------------------------------------- /src/stylesheets/skyrim/arrow-up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/stylesheets/skyrim/arrow-up.png -------------------------------------------------------------------------------- /src/stylesheets/skyrim/border-image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/stylesheets/skyrim/border-image.png -------------------------------------------------------------------------------- /src/stylesheets/skyrim/border-image1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/stylesheets/skyrim/border-image1.png -------------------------------------------------------------------------------- /src/stylesheets/skyrim/border-image2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/stylesheets/skyrim/border-image2.png -------------------------------------------------------------------------------- /src/stylesheets/skyrim/branch-opened.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/stylesheets/skyrim/branch-opened.png -------------------------------------------------------------------------------- /src/stylesheets/skyrim/button-big-border.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/stylesheets/skyrim/button-big-border.png -------------------------------------------------------------------------------- /src/stylesheets/skyrim/button-border.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/stylesheets/skyrim/button-border.png -------------------------------------------------------------------------------- /src/stylesheets/skyrim/button-checked-border.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/stylesheets/skyrim/button-checked-border.png -------------------------------------------------------------------------------- /src/stylesheets/skyrim/checkbox-alt-checked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/stylesheets/skyrim/checkbox-alt-checked.png -------------------------------------------------------------------------------- /src/stylesheets/skyrim/checkbox-alt-unchecked-hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/stylesheets/skyrim/checkbox-alt-unchecked-hover.png -------------------------------------------------------------------------------- /src/stylesheets/skyrim/checkbox-alt-unchecked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/stylesheets/skyrim/checkbox-alt-unchecked.png -------------------------------------------------------------------------------- /src/stylesheets/skyrim/checkbox-checked-disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/stylesheets/skyrim/checkbox-checked-disabled.png -------------------------------------------------------------------------------- /src/stylesheets/skyrim/checkbox-checked-hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/stylesheets/skyrim/checkbox-checked-hover.png -------------------------------------------------------------------------------- /src/stylesheets/skyrim/checkbox-checked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/stylesheets/skyrim/checkbox-checked.png -------------------------------------------------------------------------------- /src/stylesheets/skyrim/checkbox-disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/stylesheets/skyrim/checkbox-disabled.png -------------------------------------------------------------------------------- /src/stylesheets/skyrim/checkbox-hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/stylesheets/skyrim/checkbox-hover.png -------------------------------------------------------------------------------- /src/stylesheets/skyrim/checkbox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/stylesheets/skyrim/checkbox.png -------------------------------------------------------------------------------- /src/stylesheets/skyrim/context-menu-separator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/stylesheets/skyrim/context-menu-separator.png -------------------------------------------------------------------------------- /src/stylesheets/skyrim/progress-bar-border.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/stylesheets/skyrim/progress-bar-border.png -------------------------------------------------------------------------------- /src/stylesheets/skyrim/progress-bar-chunk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/stylesheets/skyrim/progress-bar-chunk.png -------------------------------------------------------------------------------- /src/stylesheets/skyrim/radio-checked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/stylesheets/skyrim/radio-checked.png -------------------------------------------------------------------------------- /src/stylesheets/skyrim/radio-hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/stylesheets/skyrim/radio-hover.png -------------------------------------------------------------------------------- /src/stylesheets/skyrim/radio.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/stylesheets/skyrim/radio.png -------------------------------------------------------------------------------- /src/stylesheets/skyrim/scrollbar-down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/stylesheets/skyrim/scrollbar-down.png -------------------------------------------------------------------------------- /src/stylesheets/skyrim/scrollbar-horizontal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/stylesheets/skyrim/scrollbar-horizontal.png -------------------------------------------------------------------------------- /src/stylesheets/skyrim/scrollbar-left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/stylesheets/skyrim/scrollbar-left.png -------------------------------------------------------------------------------- /src/stylesheets/skyrim/scrollbar-right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/stylesheets/skyrim/scrollbar-right.png -------------------------------------------------------------------------------- /src/stylesheets/skyrim/scrollbar-up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/stylesheets/skyrim/scrollbar-up.png -------------------------------------------------------------------------------- /src/stylesheets/skyrim/scrollbar-vertical.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/stylesheets/skyrim/scrollbar-vertical.png -------------------------------------------------------------------------------- /src/stylesheets/skyrim/separator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/stylesheets/skyrim/separator.png -------------------------------------------------------------------------------- /src/stylesheets/skyrim/slider-border.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/stylesheets/skyrim/slider-border.png -------------------------------------------------------------------------------- /src/stylesheets/skyrim/slider-handle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/stylesheets/skyrim/slider-handle.png -------------------------------------------------------------------------------- /src/stylesheets/vs15/branch-closed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/stylesheets/vs15/branch-closed.png -------------------------------------------------------------------------------- /src/stylesheets/vs15/branch-open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/stylesheets/vs15/branch-open.png -------------------------------------------------------------------------------- /src/stylesheets/vs15/checkbox-check-disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/stylesheets/vs15/checkbox-check-disabled.png -------------------------------------------------------------------------------- /src/stylesheets/vs15/checkbox-check.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/stylesheets/vs15/checkbox-check.png -------------------------------------------------------------------------------- /src/stylesheets/vs15/combobox-down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/stylesheets/vs15/combobox-down.png -------------------------------------------------------------------------------- /src/stylesheets/vs15/scrollbar-down-disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/stylesheets/vs15/scrollbar-down-disabled.png -------------------------------------------------------------------------------- /src/stylesheets/vs15/scrollbar-down-hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/stylesheets/vs15/scrollbar-down-hover.png -------------------------------------------------------------------------------- /src/stylesheets/vs15/scrollbar-down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/stylesheets/vs15/scrollbar-down.png -------------------------------------------------------------------------------- /src/stylesheets/vs15/scrollbar-left-disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/stylesheets/vs15/scrollbar-left-disabled.png -------------------------------------------------------------------------------- /src/stylesheets/vs15/scrollbar-left-hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/stylesheets/vs15/scrollbar-left-hover.png -------------------------------------------------------------------------------- /src/stylesheets/vs15/scrollbar-left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/stylesheets/vs15/scrollbar-left.png -------------------------------------------------------------------------------- /src/stylesheets/vs15/scrollbar-right-disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/stylesheets/vs15/scrollbar-right-disabled.png -------------------------------------------------------------------------------- /src/stylesheets/vs15/scrollbar-right-hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/stylesheets/vs15/scrollbar-right-hover.png -------------------------------------------------------------------------------- /src/stylesheets/vs15/scrollbar-right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/stylesheets/vs15/scrollbar-right.png -------------------------------------------------------------------------------- /src/stylesheets/vs15/scrollbar-up-disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/stylesheets/vs15/scrollbar-up-disabled.png -------------------------------------------------------------------------------- /src/stylesheets/vs15/scrollbar-up-hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/stylesheets/vs15/scrollbar-up-hover.png -------------------------------------------------------------------------------- /src/stylesheets/vs15/scrollbar-up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/stylesheets/vs15/scrollbar-up.png -------------------------------------------------------------------------------- /src/stylesheets/vs15/sort-asc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/stylesheets/vs15/sort-asc.png -------------------------------------------------------------------------------- /src/stylesheets/vs15/sort-desc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/stylesheets/vs15/sort-desc.png -------------------------------------------------------------------------------- /src/stylesheets/vs15/spinner-down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/stylesheets/vs15/spinner-down.png -------------------------------------------------------------------------------- /src/stylesheets/vs15/spinner-up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/stylesheets/vs15/spinner-up.png -------------------------------------------------------------------------------- /src/stylesheets/vs15/sub-menu-arrow-hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/stylesheets/vs15/sub-menu-arrow-hover.png -------------------------------------------------------------------------------- /src/stylesheets/vs15/sub-menu-arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ModdingLinked/modorganizer/c9b893572e72953ceb21899a40dbc7acdda330b8/src/stylesheets/vs15/sub-menu-arrow.png -------------------------------------------------------------------------------- /src/syncoverwritedialog.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2012 Sebastian Herbord. All rights reserved. 3 | 4 | This file is part of Mod Organizer. 5 | 6 | Mod Organizer is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | Mod Organizer is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with Mod Organizer. If not, see . 18 | */ 19 | 20 | #ifndef SYNCOVERWRITEDIALOG_H 21 | #define SYNCOVERWRITEDIALOG_H 22 | 23 | #include "shared/fileregisterfwd.h" 24 | #include "tutorabledialog.h" 25 | #include 26 | 27 | namespace Ui 28 | { 29 | class SyncOverwriteDialog; 30 | } 31 | 32 | class SyncOverwriteDialog : public MOBase::TutorableDialog 33 | { 34 | Q_OBJECT 35 | 36 | public: 37 | explicit SyncOverwriteDialog(const QString& path, 38 | MOShared::DirectoryEntry* directoryStructure, 39 | QWidget* parent = 0); 40 | 41 | ~SyncOverwriteDialog(); 42 | 43 | void apply(const QString& modDirectory); 44 | 45 | private: 46 | void refresh(const QString& path); 47 | void readTree(const QString& path, MOShared::DirectoryEntry* directoryStructure, 48 | QTreeWidgetItem* subTree); 49 | void applyTo(QTreeWidgetItem* item, const QString& path, const QString& modDirectory); 50 | 51 | private: 52 | Ui::SyncOverwriteDialog* ui; 53 | QString m_SourcePath; 54 | MOShared::DirectoryEntry* m_DirectoryStructure; 55 | }; 56 | 57 | #endif // SYNCOVERWRITEDIALOG_H 58 | -------------------------------------------------------------------------------- /src/tutorials/Highlight.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.7 2 | 3 | Rectangle { 4 | radius: 10 5 | color: "transparent" 6 | height: 100 7 | border.color: "black" 8 | border.width: 3 9 | opacity: 0.9 10 | smooth: true 11 | 12 | SequentialAnimation on opacity { 13 | loops: Animation.Infinite 14 | 15 | PropertyAnimation { easing.type: Easing.InOutSine; duration: 300; to: 0.1 } 16 | PropertyAnimation { easing.type: Easing.OutInSine; duration: 300; to: 0.7 } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/tutorials/Tooltip.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.7 2 | 3 | 4 | Rectangle { 5 | color: "#EE888888" 6 | width: childrenRect.width + 15 7 | height: childrenRect.height + 15 8 | z: 20000 9 | clip: false 10 | border.color: "black" 11 | border.width: 1 12 | property alias text: tooltipText.text 13 | Text { 14 | id: tooltipText 15 | font.pointSize: 11 16 | wrapMode: Text.WordWrap 17 | anchors.left: parent.left 18 | anchors.top: parent.top 19 | anchors.leftMargin: 7 20 | anchors.rightMargin: 7 21 | z: parent.z 22 | color: "black" 23 | onTextChanged: { 24 | if (width > 200) 25 | width = 200 26 | } 27 | } 28 | visible: false 29 | } 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/tutorials/TooltipArea.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.7 2 | 3 | Rectangle { 4 | radius: 2 5 | color: clickable ? "#AA6666AA" : "#AA882222" 6 | height: 100 7 | border.color: "black" 8 | border.width: 2 9 | z: 1 10 | smooth: true 11 | property bool wasLocked: false 12 | property bool clickable: false 13 | property string tooltipText: "" 14 | 15 | MouseArea { 16 | id: clickArea 17 | anchors.fill: parent 18 | hoverEnabled: true 19 | 20 | onPositionChanged: { 21 | if (parent.parent.width - (parent.x + mouseX) < tooltip.width + 50) { 22 | tooltip.x = parent.x + mouseX - 15 - tooltip.width 23 | } else { 24 | tooltip.x = parent.x + mouseX + 15 25 | } 26 | 27 | if (parent.parent.height - (parent.y + mouseY) < tooltip.height + 50) { 28 | tooltip.y = parent.y + mouseY - 15 - tooltip.height 29 | } else { 30 | tooltip.y = parent.y + mouseY + 15 31 | } 32 | } 33 | 34 | onEntered: { 35 | tooltip.visible = true 36 | tooltip.text = tooltipText 37 | } 38 | 39 | onPressed: { 40 | wasLocked = tutToplevel.backgroundEnabled() 41 | if (wasLocked && clickable) { 42 | tutorialControl.simulateClick(mouseX + parent.x, mouseY + parent.y) 43 | } 44 | mouse.accepted = false 45 | } 46 | 47 | onCanceled: { 48 | tooltip.visible = false 49 | } 50 | 51 | onExited: { 52 | tooltip.visible = false 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/tutorials/TutorialCanceller.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.7 2 | 3 | // rectangle for description texts 4 | Rectangle { 5 | property alias text: textBox.text 6 | property alias cancelVisible: cancelIcon.visible 7 | property int innerWidth; 8 | signal clicked 9 | 10 | anchors.horizontalCenter: parent.horizontalCenter 11 | anchors.bottom: parent.bottom 12 | anchors.bottomMargin: 70 13 | width: textBox.width + 30 14 | height: textBox.height + 8 15 | border.color: "black" 16 | border.width: 3 17 | smooth: true 18 | //opacity: 0.9 19 | z: 10000 20 | color: "#FF707070" 21 | 22 | Image { 23 | id: cancelIcon 24 | anchors.bottom: parent.bottom 25 | anchors.bottomMargin: 5 26 | anchors.right: parent.right 27 | anchors.rightMargin: 5 28 | source: "qrc:/MO/gui/multiply_red" 29 | 30 | SequentialAnimation on opacity { 31 | loops: Animation.Infinite 32 | 33 | PauseAnimation { duration: 500 } 34 | PropertyAnimation { easing.type: Easing.InOutSine; duration: 400; to: 0.0 } 35 | PropertyAnimation { easing.type: Easing.OutInSine; duration: 400; to: 1.0 } 36 | } 37 | } 38 | 39 | Text { 40 | id: textBox 41 | text: qsTr("Exit Tutorial") 42 | font.pointSize: 12 43 | font.bold: false 44 | width: innerWidth 45 | font.family: "Courier" 46 | wrapMode: Text.WordWrap 47 | anchors.centerIn: parent 48 | } 49 | 50 | MouseArea { 51 | id: clickArea 52 | anchors.fill: parent 53 | onClicked: parent.clicked() 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/tutorials/TutorialDescription.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.7 2 | 3 | // rectangle for description texts 4 | Rectangle { 5 | property alias text: textBox.text 6 | property alias continueVisible: continueIcon.visible 7 | property int innerWidth; 8 | signal clicked 9 | 10 | anchors.horizontalCenter: parent.horizontalCenter 11 | anchors.bottom: parent.bottom 12 | anchors.bottomMargin: 100 13 | width: textBox.width + 30 14 | height: textBox.height + 8 15 | border.color: "black" 16 | border.width: 3 17 | smooth: true 18 | //opacity: 0.9 19 | z: 10000 20 | color: "#FF707070" 21 | 22 | Image { 23 | id: continueIcon 24 | anchors.bottom: parent.bottom 25 | anchors.bottomMargin: 5 26 | anchors.right: parent.right 27 | anchors.rightMargin: 5 28 | source: "qrc:/MO/gui/next" 29 | 30 | SequentialAnimation on opacity { 31 | loops: Animation.Infinite 32 | 33 | PauseAnimation { duration: 500 } 34 | PropertyAnimation { easing.type: Easing.InOutSine; duration: 400; to: 0.0 } 35 | PropertyAnimation { easing.type: Easing.OutInSine; duration: 400; to: 1.0 } 36 | } 37 | } 38 | 39 | Text { 40 | id: textBox 41 | text: "" 42 | font.pointSize: 12 43 | font.bold: false 44 | width: innerWidth 45 | font.family: "Courier" 46 | wrapMode: Text.WordWrap 47 | anchors.centerIn: parent 48 | } 49 | 50 | MouseArea { 51 | id: clickArea 52 | anchors.fill: parent 53 | onClicked: parent.clicked() 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/tutorials/TutorialOverlay.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.7 2 | import "tutorials.js" as Logic 3 | 4 | Rectangle { 5 | color: "transparent" 6 | 7 | id: tutToplevel 8 | 9 | property int step : 0 10 | property alias description: tutDescription 11 | property alias highlight: tutHighlight 12 | property alias text: tutDescription.text 13 | property alias boxOpacity: tutDescription.opacity 14 | property int offsetBottom: 50 15 | property int maxWidth: 400 16 | 17 | signal tabChanged(int index) 18 | 19 | function init() { 20 | Logic.init() 21 | Logic.nextStep() 22 | } 23 | 24 | function enableBackground(enabled) { 25 | disabledBackground.visible = enabled 26 | } 27 | 28 | function backgroundEnabled() { 29 | return disabledBackground.visible 30 | } 31 | 32 | function nextStep() { 33 | if (step == 0) { 34 | Logic.init() 35 | } 36 | 37 | Logic.nextStep() 38 | } 39 | 40 | TutorialDescription { 41 | id: tutDescription 42 | innerWidth: maxWidth 43 | anchors.bottomMargin: offsetBottom 44 | onClicked: { 45 | Logic.clickNext() 46 | } 47 | } 48 | 49 | TutorialCanceller { 50 | id: tutorialCanceller 51 | innerWidth: 200 52 | anchors.bottomMargin: offsetBottom - 30 53 | onClicked: { 54 | Logic.cancelTutorial() 55 | } 56 | } 57 | 58 | Rectangle { 59 | id: disabledBackground 60 | anchors.fill: parent 61 | opacity: 0.2 62 | color: "#808080" 63 | } 64 | 65 | Connections { 66 | target: manager 67 | function onTabChanged(index) 68 | { 69 | tabChanged(index) 70 | } 71 | } 72 | 73 | Tooltip { 74 | id: tooltip 75 | } 76 | 77 | Highlight { 78 | id: tutHighlight 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /src/tutorials/tutorial_basics.js: -------------------------------------------------------------------------------- 1 | function tutorial() { 2 | } 3 | -------------------------------------------------------------------------------- /src/tutorials/tutorial_conflictresolution_modinfo.js: -------------------------------------------------------------------------------- 1 | function getTutorialSteps() { 2 | tutorialCanceller.visible = false 3 | return [ 4 | function() { 5 | tutorial.text = qsTr("Please switch to the \"Conflicts\"-Tab.") 6 | highlightItem("tabWidget", true) 7 | if (!tutorialControl.waitForTabOpen("tabWidget", "tabConflicts")) { 8 | nextStep() 9 | } 10 | }, 11 | function() { 12 | tutorial.text = qsTr("Here you can see two lists: a list of files that this mod overwrites that are also " 13 | + "provided by other mods, and a list of files in this mod which are overwritten by " 14 | + "one or more other mods.") 15 | waitForClick() 16 | }, 17 | function() { 18 | tutorial.text = qsTr("Please close the information dialog.") 19 | waitForClick() 20 | } 21 | 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /src/tutorials/tutorial_firststeps.js: -------------------------------------------------------------------------------- 1 | // First Steps 2 | subTutorials = [ 3 | ["MainWindow", "tutorial_firststeps_main.js"], 4 | ["SettingsDialog", "tutorial_firststeps_settings.js"] 5 | ]; 6 | -------------------------------------------------------------------------------- /src/tutorials/tutorial_firststeps_browser.js: -------------------------------------------------------------------------------- 1 | function getTutorialSteps() 2 | { 3 | return [ 4 | function() { 5 | tutorial.text = qsTr("This is a fully featured browser that is set up to " 6 | +"open the correct nexus page for your game. You can " 7 | +"download any mod using the \"DOWNLOAD WITH MANAGER\"-button " 8 | +"or the \"manual\"-link and it will be downloaded by MO.") 9 | waitForClick() 10 | } 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /src/tutorials/tutorial_firststeps_modinfo.js: -------------------------------------------------------------------------------- 1 | function getTutorialSteps() 2 | { 3 | tutorialCanceller.visible = false 4 | return [ 5 | function() { 6 | tutorial.text = qsTr("This dialog tries to expose as much information about a mod as possible. " 7 | +"Depending on the mod, this may include readmes, screenshots, optional plugins and so on. " 8 | +"If a certain type of information was not found in a mod, the corresponding tab " 9 | +"is grayed out.") 10 | highlightItem("tabWidget", false) 11 | waitForClick() 12 | }, 13 | function() { 14 | tutorial.text = qsTr("If you installed the mod from Nexus, the corresponding tab should give you direct " 15 | +"access to the mod page description, which can be refreshed directly from Nexus.") 16 | waitForClick() 17 | }, 18 | function() { 19 | unhighlight() 20 | tutorial.text = qsTr("We may revisit this screen in later tutorials.") 21 | waitForClick() 22 | } 23 | ] 24 | } 25 | -------------------------------------------------------------------------------- /src/tutorials/tutorial_firststeps_settings.js: -------------------------------------------------------------------------------- 1 | function getTutorialSteps() 2 | { 3 | tutorialCanceller.visible = false 4 | return [ 5 | function() { 6 | highlightItem("tabWidget", true) 7 | tutorial.text = qsTr("It is possible to download files directly from Nexus.\n\n" 8 | + "Please open the \"Nexus\" tab.") 9 | tutorialControl.waitForTabOpen("tabWidget", "nexusTab") 10 | }, 11 | 12 | function() { 13 | highlightItem("associateButton", false) 14 | tutorial.text = qsTr("Clicking on this button should register Nexus \"Download with Manager\" buttons " 15 | +"to download with Mod Organizer.") 16 | waitForClick() 17 | }, 18 | 19 | function() { 20 | highlightItem("nexusBox", false) 21 | tutorial.text = qsTr("Use this interface to obtain an API key from NexusMods. " 22 | +"This is used for all API connections - downloads, updates " 23 | +"etc. MO2 uses the Windows Credential Manager to store " 24 | +"this data securely. If the SSO page on Nexus is failing, " 25 | +"use the manual entry and copy the API key from your profile.") 26 | waitForClick() 27 | } 28 | ] 29 | } 30 | -------------------------------------------------------------------------------- /src/tutorials/tutorial_window_installer.js: -------------------------------------------------------------------------------- 1 | //WIN InstallDialog 2 | function getTutorialSteps() 3 | { 4 | return [ 5 | function() { 6 | tutorial.text = qsTr("This mod has been packaged in a way that Mod Organizer did not automatically " 7 | + "recognize...") 8 | waitForClick() 9 | }, 10 | function() { 11 | tutorial.text = qsTr("You can use drag&drop on this list to fix the structure of the mod.") 12 | highlightItem("treeContent", false) 13 | waitForClick() 14 | }, 15 | function() { 16 | tutorial.text = qsTr("The correct structure replicates the data-directory of the game. That means " 17 | + "esps, the \"meshes\"- or \"textures\"-directory and so on should be directly " 18 | + "below \"\".") 19 | waitForClick() 20 | }, 21 | function() { 22 | tutorial.text = qsTr("You can also disable files and directories that you don't want to unpack.") 23 | waitForClick() 24 | }, 25 | function() { 26 | tutorial.text = qsTr("From the context menu (right-click) you can open textfiles, in case " 27 | + "you want to access a readme.") 28 | waitForClick() 29 | }, 30 | function() { 31 | tutorial.text = qsTr("This text will turn green if MO thinks the structure looks good.") 32 | highlightItem("problemLabel", false) 33 | manager.finishWindowTutorial("InstallDialog") 34 | waitForClick() 35 | } 36 | ] 37 | } 38 | -------------------------------------------------------------------------------- /src/tutorials/tutorials_installdialog.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.7 2 | 3 | TutorialOverlay { 4 | id: tutorial 5 | offsetBottom: 65 6 | maxWidth: 420 7 | } 8 | -------------------------------------------------------------------------------- /src/tutorials/tutorials_mainwindow.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.7 2 | 3 | TutorialOverlay { 4 | id: tutorial 5 | offsetBottom: 50 6 | maxWidth: 400 7 | } 8 | -------------------------------------------------------------------------------- /src/tutorials/tutorials_modinfodialog.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.7 2 | 3 | TutorialOverlay { 4 | id: tutorial 5 | offsetBottom: 60 6 | maxWidth: 420 7 | } 8 | -------------------------------------------------------------------------------- /src/tutorials/tutorials_nexusdialog.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.7 2 | 3 | TutorialOverlay { 4 | id: tutorial 5 | offsetBottom: 40 6 | maxWidth: 600 7 | boxOpacity: 0.95 8 | } 9 | -------------------------------------------------------------------------------- /src/tutorials/tutorials_settingsdialog.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.7 2 | 3 | TutorialOverlay { 4 | id: tutorial 5 | offsetBottom: 60 6 | maxWidth: 420 7 | } 8 | -------------------------------------------------------------------------------- /src/updatedialog.h: -------------------------------------------------------------------------------- 1 | #ifndef MODORGANIZER_UPDATEDIALOG_H 2 | #define MODORGANIZER_UPDATEDIALOG_H 3 | 4 | #include 5 | 6 | #include "lootdialog.h" // for MarkdownDocument 7 | #include 8 | 9 | namespace Ui 10 | { 11 | class UpdateDialog; 12 | } 13 | 14 | class UpdateDialog : public QDialog 15 | { 16 | Q_OBJECT; 17 | 18 | public: 19 | UpdateDialog(QWidget* parent); 20 | ~UpdateDialog(); 21 | 22 | void setChangeLogs(const QString& text); 23 | void setVersions(const QString& oldVersion, const QString& newVersion); 24 | 25 | private: 26 | std::unique_ptr ui; 27 | MOBase::ExpanderWidget m_expander; 28 | MarkdownDocument m_changeLogs; 29 | }; 30 | 31 | #endif // MODORGANIZER_UPDATEDIALOG_H 32 | -------------------------------------------------------------------------------- /src/version.rc: -------------------------------------------------------------------------------- 1 | #include "Winver.h" 2 | 3 | // If VS_FF_PRERELEASE is not set, MO labels the build as a release and uses VER_FILEVERSION to determine version number. 4 | // Otherwise, if letters are used in VER_FILEVERSION_STR, uses the full MOBase::VersionInfo parser 5 | // Otherwise, uses the numbers from VER_FILEVERSION and sets the release type as pre-alpha 6 | #define VER_FILEVERSION 2,5,2 7 | #define VER_FILEVERSION_STR "2.5.2-ML1.5\0" 8 | 9 | VS_VERSION_INFO VERSIONINFO 10 | FILEVERSION VER_FILEVERSION 11 | PRODUCTVERSION VER_FILEVERSION 12 | FILEFLAGSMASK VS_FFI_FILEFLAGSMASK 13 | FILEFLAGS VS_FF_PRERELEASE 14 | FILEOS VOS__WINDOWS32 15 | FILETYPE VFT_APP 16 | FILESUBTYPE (0) 17 | BEGIN 18 | BLOCK "StringFileInfo" 19 | BEGIN 20 | BLOCK "040904B0" 21 | BEGIN 22 | VALUE "FileVersion", VER_FILEVERSION_STR 23 | VALUE "CompanyName", "Mod Organizer 2 Team\0" 24 | VALUE "FileDescription", "Mod Organizer 2 GUI\0" 25 | VALUE "OriginalFilename", "ModOrganizer.exe\0" 26 | VALUE "InternalName", "ModOrganizer2\0" 27 | VALUE "LegalCopyright", "Copyright 2011-2016 Sebastian Herbord\r\nCopyright 2016-2024 Mod Organizer 2 contributors\0" 28 | VALUE "ProductName", "Mod Organizer 2\0" 29 | VALUE "ProductVersion", VER_FILEVERSION_STR 30 | END 31 | END 32 | 33 | BLOCK "VarFileInfo" 34 | BEGIN 35 | VALUE "Translation", 0x0409, 1200 36 | END 37 | END 38 | -------------------------------------------------------------------------------- /src/viewmarkingscrollbar.cpp: -------------------------------------------------------------------------------- 1 | #include "viewmarkingscrollbar.h" 2 | #include "modelutils.h" 3 | #include 4 | #include 5 | #include 6 | 7 | using namespace MOShared; 8 | 9 | ViewMarkingScrollBar::ViewMarkingScrollBar(QTreeView* view, int role) 10 | : QScrollBar(view), m_view(view), m_role(role) 11 | { 12 | // not implemented for horizontal sliders 13 | Q_ASSERT(this->orientation() == Qt::Vertical); 14 | } 15 | 16 | QColor ViewMarkingScrollBar::color(const QModelIndex& index) const 17 | { 18 | auto data = index.data(m_role); 19 | if (data.canConvert()) { 20 | return data.value(); 21 | } 22 | return QColor(); 23 | } 24 | 25 | void ViewMarkingScrollBar::paintEvent(QPaintEvent* event) 26 | { 27 | if (m_view->model() == nullptr) { 28 | return; 29 | } 30 | QScrollBar::paintEvent(event); 31 | 32 | QStyleOptionSlider styleOption; 33 | initStyleOption(&styleOption); 34 | 35 | QPainter painter(this); 36 | 37 | QRect handleRect = style()->subControlRect(QStyle::CC_ScrollBar, &styleOption, 38 | QStyle::SC_ScrollBarSlider, this); 39 | QRect innerRect = style()->subControlRect(QStyle::CC_ScrollBar, &styleOption, 40 | QStyle::SC_ScrollBarGroove, this); 41 | 42 | auto indices = visibleIndex(m_view, 0); 43 | 44 | painter.translate(innerRect.topLeft() + QPoint(0, 3)); 45 | qreal scale = 46 | static_cast(innerRect.height() - 3) / static_cast(indices.size()); 47 | 48 | for (int i = 0; i < indices.size(); ++i) { 49 | QColor color = this->color(indices[i]); 50 | if (color.isValid()) { 51 | painter.setPen(color); 52 | painter.setBrush(color); 53 | painter.drawRect(QRect(2, i * scale - 2, handleRect.width() - 5, 3)); 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/viewmarkingscrollbar.h: -------------------------------------------------------------------------------- 1 | #ifndef VIEWMARKINGSCROLLBAR_H 2 | #define VIEWMARKINGSCROLLBAR_H 3 | 4 | #include 5 | #include 6 | 7 | class ViewMarkingScrollBar : public QScrollBar 8 | { 9 | public: 10 | ViewMarkingScrollBar(QTreeView* view, int role); 11 | 12 | protected: 13 | void paintEvent(QPaintEvent* event) override; 14 | 15 | // retrieve the color of the marker for the given index 16 | // 17 | virtual QColor color(const QModelIndex& index) const; 18 | 19 | private: 20 | QTreeView* m_view; 21 | int m_role; 22 | }; 23 | 24 | #endif // VIEWMARKINGSCROLLBAR_H 25 | -------------------------------------------------------------------------------- /src/virtualfiletree.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) MO2 Team. All rights reserved. 3 | 4 | This file is part of Mod Organizer. 5 | 6 | Mod Organizer is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | Mod Organizer is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with Mod Organizer. If not, see . 18 | */ 19 | 20 | #ifndef ARCHIVEFILENETRY_H 21 | #define ARCHIVEFILENTRY_H 22 | 23 | #include 24 | 25 | #include "ifiletree.h" 26 | 27 | namespace MOShared 28 | { 29 | class DirectoryEntry; 30 | } 31 | 32 | /** 33 | * @brief Class that expose the VFS main directory structure as a `MOBase::IFileTree`. 34 | * 35 | * The tree is lazily populated: each subtree is only populated when needed, 36 | * as specified by IFileTree. 37 | * 38 | * This class does not expose mutable operations, so any mutable operations will 39 | * fail. 40 | */ 41 | class VirtualFileTree : public MOBase::IFileTree 42 | { 43 | public: 44 | /** 45 | * @brief Create a new file tree representing the given VFS directory. 46 | * 47 | * @param root Root directory. 48 | * 49 | * @return a file tree representing the VFS directory. 50 | */ 51 | static std::shared_ptr 52 | makeTree(const MOShared::DirectoryEntry* root); 53 | 54 | protected: 55 | using IFileTree::IFileTree; 56 | 57 | virtual bool 58 | doPopulate(std::shared_ptr parent, 59 | std::vector>& entries) const = 0; 60 | }; 61 | 62 | #endif 63 | --------------------------------------------------------------------------------