├── .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