mirror of
https://github.com/ModOrganizer2/modorganizer.git
synced 2026-07-27 13:58:24 -07:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9c130cbf2f | ||
|
|
ea38fdc6ce | ||
|
|
89f39ef200 | ||
|
|
acd201157d | ||
|
|
f11925ab88 | ||
|
|
2395c13c25 | ||
|
|
cc92f6cf88 | ||
|
|
193442e773 | ||
|
|
a4f6298111 | ||
|
|
d3b647ab2b | ||
|
|
6d08d434a8 | ||
|
|
3d8bfdd1d4 | ||
|
|
fff03d34e2 | ||
|
|
88c386d74d | ||
|
|
c43535f5bc | ||
|
|
3d18f0cd38 | ||
|
|
a11617ff65 | ||
|
|
1871f32a8d | ||
|
|
fa82d1cca1 | ||
|
|
9ee4c5afe1 | ||
|
|
a1d199134d | ||
|
|
16423b2682 | ||
|
|
5adb1ec43d | ||
|
|
4472df8656 | ||
|
|
45c017de2f | ||
|
|
b350afee9e | ||
|
|
b3d27472cf | ||
|
|
e1932b34ea | ||
|
|
70a41a9b27 | ||
|
|
20aa98b511 | ||
|
|
783c05478f | ||
|
|
0315a88bd8 | ||
|
|
026fec4468 | ||
|
|
04eff9750f | ||
|
|
22714e5cdc | ||
|
|
8dd1637d1d | ||
|
|
2eade4c638 | ||
|
|
828c9c8157 | ||
|
|
773e3acd58 | ||
|
|
1b4ed39747 | ||
|
|
efef62f49d | ||
|
|
8c562fe8a9 | ||
|
|
8f77fff215 | ||
|
|
c48b7d8803 | ||
|
|
af5e04208a | ||
|
|
037e17e816 | ||
|
|
3c0cd1c888 | ||
|
|
f8954806c3 | ||
|
|
f6af8ed275 | ||
|
|
8f6ba13fbc | ||
|
|
2f5cca5c60 | ||
|
|
d57d8bdd5a | ||
|
|
1adb8b9ada | ||
|
|
cd4ba84219 | ||
|
|
067ae9c89d | ||
|
|
f8d02faf71 | ||
|
|
c92285bb20 | ||
|
|
16977b5159 | ||
|
|
028c8eafa9 | ||
|
|
48e8fdff0d | ||
|
|
09b8baac5a | ||
|
|
e9a5e5b274 | ||
|
|
7e50a26c6a | ||
|
|
81082d70e2 | ||
|
|
57e9b7e258 | ||
|
|
f8a3d5b86e | ||
|
|
b5ba8522d8 | ||
|
|
a705938ffd | ||
|
|
62e8ddc9ca | ||
|
|
c19fbb6818 | ||
|
|
0d5f023f76 | ||
|
|
34ad5d85ed | ||
|
|
ee8dbed66c | ||
|
|
ff0eb2fb70 | ||
|
|
63f663ac8a | ||
|
|
11d106ec0b | ||
|
|
590801329d | ||
|
|
e7ee47b6e2 | ||
|
|
79d457f598 | ||
|
|
523ea046a9 | ||
|
|
74668b9363 | ||
|
|
cdc16dfbb2 | ||
|
|
c30b5183ae | ||
|
|
11522cf700 | ||
|
|
4bd860a0d2 | ||
|
|
5f14c57555 | ||
|
|
5d67b8dd21 | ||
|
|
efdff42d5f | ||
|
|
b7d4d20bf1 | ||
|
|
a67a919e54 | ||
|
|
e22331fa03 | ||
|
|
31a85a3db5 | ||
|
|
aff3e09873 | ||
|
|
7c900bb1c8 | ||
|
|
d2e48ed72e | ||
|
|
133c072eb7 | ||
|
|
639fc787bf | ||
|
|
e18452ee76 | ||
|
|
049a7e2efd | ||
|
|
f8b015220d | ||
|
|
59bc9e3167 | ||
|
|
c50ad58843 | ||
|
|
f6bb73deb2 | ||
|
|
4342fe3ce1 | ||
|
|
6dfe55f444 | ||
|
|
41c4d09229 | ||
|
|
fba3d52f56 | ||
|
|
05edcc8ab4 | ||
|
|
eeddc993a7 | ||
|
|
9a801f6501 | ||
|
|
8f31a1ceec | ||
|
|
3243101eed | ||
|
|
b9f05672b9 | ||
|
|
535623693e | ||
|
|
69f953a3fb | ||
|
|
6016b04ef0 | ||
|
|
375b8e613e | ||
|
|
2f7478f8fc | ||
|
|
f764271b1f | ||
|
|
127db7799e | ||
|
|
4fd45b937c | ||
|
|
0b6afd6a9a | ||
|
|
83f9af3d3e | ||
|
|
7050927540 | ||
|
|
59b5b1cfca | ||
|
|
a6879e2c63 | ||
|
|
f2a784ed70 | ||
|
|
dff79a6cc0 | ||
|
|
800c2ea084 | ||
|
|
1387f6aefe | ||
|
|
6e9e4482c1 | ||
|
|
d15a87b0e6 | ||
|
|
b1f3c7ea51 | ||
|
|
3dc00922ed | ||
|
|
d586bb23e9 | ||
|
|
94455c2dab | ||
|
|
58cc25f322 | ||
|
|
e0d6bb12bf | ||
|
|
6b0b7a1cec | ||
|
|
5bb4a2aae7 | ||
|
|
fdc4ebd18c | ||
|
|
3f33571a18 | ||
|
|
69e73933b9 | ||
|
|
978b4b234b | ||
|
|
c8e247f900 | ||
|
|
92689d124a | ||
|
|
0dd04fbdb6 | ||
|
|
9ddde468ea | ||
|
|
26d32db436 | ||
|
|
6c0d1ccb5a | ||
|
|
27cf8372aa | ||
|
|
ef94aee284 | ||
|
|
3de050e9c0 | ||
|
|
fc8bdd073f | ||
|
|
78b0c89203 | ||
|
|
d13f6bb870 | ||
|
|
86bb01ba9e | ||
|
|
7d6cb8528d | ||
|
|
05059793b8 | ||
|
|
a95d3fa248 | ||
|
|
45b648ba21 | ||
|
|
e8c65d7779 | ||
|
|
37c9e13c60 | ||
|
|
c5a203f448 | ||
|
|
21bca0ca8d | ||
|
|
25e2e59888 | ||
|
|
318b8a5671 | ||
|
|
65eaeb848f | ||
|
|
a55fcd64d3 | ||
|
|
060ca725bf | ||
|
|
abe926dc15 | ||
|
|
14c6ee4d27 | ||
|
|
7a4cdc8f81 | ||
|
|
8e0970235b | ||
|
|
d998f9f493 | ||
|
|
712fbb4aff | ||
|
|
ab76e5212f | ||
|
|
5a41b73e41 | ||
|
|
d51b5bf060 | ||
|
|
5897ce138b | ||
|
|
adee725bb3 | ||
|
|
ec4a98c662 | ||
|
|
2fabe99830 | ||
|
|
05d01e39fa | ||
|
|
2017700eed | ||
|
|
af0337d5b4 | ||
|
|
35ca9ce0ba | ||
|
|
034ef8dfa6 | ||
|
|
20b3f2d705 | ||
|
|
f6c690e31f | ||
|
|
a99d0930c7 | ||
|
|
02667f8fde | ||
|
|
abe3f6b191 | ||
|
|
fb4cd4375c | ||
|
|
c4b2be45d2 | ||
|
|
ec01532ecb | ||
|
|
3b5aeebb72 | ||
|
|
1929e5e57b | ||
|
|
cfe03a8561 | ||
|
|
164c6af962 | ||
|
|
c6874c1771 | ||
|
|
8fb36b0b28 | ||
|
|
8159a476cf | ||
|
|
0b9c96e845 | ||
|
|
6d73f9a18a | ||
|
|
5b855f2e19 | ||
|
|
21487ad8ee | ||
|
|
e78f46cc9e | ||
|
|
25cdbe3918 | ||
|
|
da4a013590 | ||
|
|
0b14cc4753 | ||
|
|
cee8d5ed72 | ||
|
|
0783eb373b | ||
|
|
feb411fb2a | ||
|
|
3b1ee9d43b | ||
|
|
3f9020ea4b | ||
|
|
b4bbb09cb5 | ||
|
|
9fdf3b759d | ||
|
|
eb7f5bb5d1 | ||
|
|
656b4fae4d |
@@ -0,0 +1,41 @@
|
||||
---
|
||||
# We'll use defaults from the LLVM style, but with 4 columns indentation.
|
||||
BasedOnStyle: LLVM
|
||||
IndentWidth: 2
|
||||
---
|
||||
Language: Cpp
|
||||
DeriveLineEnding: false
|
||||
UseCRLF: true
|
||||
DerivePointerAlignment: false
|
||||
PointerAlignment: Left
|
||||
AlignConsecutiveAssignments: true
|
||||
AllowShortFunctionsOnASingleLine: Inline
|
||||
AllowShortIfStatementsOnASingleLine: Never
|
||||
AllowShortLambdasOnASingleLine: Empty
|
||||
AlwaysBreakTemplateDeclarations: Yes
|
||||
AccessModifierOffset: -2
|
||||
AlignTrailingComments: true
|
||||
SpacesBeforeTrailingComments: 2
|
||||
NamespaceIndentation: Inner
|
||||
MaxEmptyLinesToKeep: 1
|
||||
BreakBeforeBraces: Custom
|
||||
BraceWrapping:
|
||||
AfterCaseLabel: false
|
||||
AfterClass: true
|
||||
AfterControlStatement: false
|
||||
AfterEnum: true
|
||||
AfterFunction: true
|
||||
AfterNamespace: true
|
||||
AfterStruct: true
|
||||
AfterUnion: true
|
||||
AfterExternBlock: true
|
||||
BeforeCatch: false
|
||||
BeforeElse: false
|
||||
BeforeLambdaBody: false
|
||||
BeforeWhile: false
|
||||
IndentBraces: false
|
||||
SplitEmptyFunction: false
|
||||
SplitEmptyRecord: false
|
||||
SplitEmptyNamespace: true
|
||||
ColumnLimit: 88
|
||||
ForEachMacros: ['Q_FOREACH', 'foreach']
|
||||
@@ -0,0 +1,2 @@
|
||||
d13f6bb870cdda71257f665367be8ef9fca86255
|
||||
86bb01ba9eac879d3685c439ac9da0028bc4bc80
|
||||
@@ -0,0 +1,7 @@
|
||||
# Set the default behavior, in case people don't have core.autocrlf set.
|
||||
* text=auto
|
||||
|
||||
# Explicitly declare text files you want to always be normalized and converted
|
||||
# to native line endings on checkout.
|
||||
*.cpp text eol=crlf
|
||||
*.h text eol=crlf
|
||||
@@ -8,7 +8,7 @@ assignees: ''
|
||||
---
|
||||
|
||||
## The problem:
|
||||
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/6GKR9jZ).
|
||||
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).
|
||||
|
||||
|
||||
## To Reproduce:
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
name: Build ModOrganizer 2
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: master
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: windows-2022
|
||||
steps:
|
||||
- name: Build ModOrganizer 2
|
||||
uses: ModOrganizer2/build-with-mob-action@master
|
||||
with:
|
||||
qt-modules: qtpositioning qtwebchannel qtwebengine qtwebsockets
|
||||
mo2-third-parties:
|
||||
7z zlib gtest libbsarch libloot openssl bzip2 python lz4 spdlog
|
||||
boost boost-di sip pyqt pybind11 ss licenses explorerpp DirectXTex
|
||||
mo2-dependencies: usvfs cmake_common uibase githubpp bsatk esptk archive lootcli game_gamebryo
|
||||
@@ -0,0 +1,17 @@
|
||||
name: Lint ModOrganizer 2
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened]
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Check format
|
||||
uses: ModOrganizer2/check-formatting-action@master
|
||||
with:
|
||||
check-path: "."
|
||||
exclude-regex: "third-party"
|
||||
+7
-11
@@ -1,20 +1,16 @@
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
project(organizer)
|
||||
set(project_type exe)
|
||||
set(executable_name ModOrganizer)
|
||||
set(enable_warnings OFF)
|
||||
# TODO: move these to cmake_common?
|
||||
set(OPENSSL_USE_STATIC_LIBS FALSE CACHE STRING "" FORCE)
|
||||
set(MySQL_INCLUDE_DIRS CACHE STRING "" FORCE)
|
||||
|
||||
# appveyor does not build modorganizer in its standard location, so use
|
||||
# DEPENDENCIES_DIR to find cmake_common
|
||||
if(DEFINED DEPENDENCIES_DIR)
|
||||
include(${DEPENDENCIES_DIR}/modorganizer_super/cmake_common/project.cmake)
|
||||
include(${DEPENDENCIES_DIR}/modorganizer_super/cmake_common/mo2.cmake)
|
||||
else()
|
||||
include(../cmake_common/project.cmake)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/../cmake_common/mo2.cmake)
|
||||
endif()
|
||||
|
||||
set(additional_translations ${uibase_path}/src)
|
||||
|
||||
project(organizer)
|
||||
add_subdirectory(src)
|
||||
|
||||
install(FILES dump_running_process.bat DESTINATION bin)
|
||||
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/dump_running_process.bat DESTINATION bin)
|
||||
|
||||
@@ -12,7 +12,7 @@ The project took up speed again after a few more coders showed up in late 2017,
|
||||
## Help Wanted!
|
||||
Mod Organizer 2 is an open project in the hands of the community, there are problems that need to be solved and things that could be added. MO2 really needs developers and if you have the programming skills and some free time you can really improve the experience of the modding community.
|
||||
|
||||
To have more information, please join the open MO2 Development discord server: [Mod Organizer 2](https://discord.gg/6GKR9jZ)
|
||||
To have more information, please join the open MO2 Development discord server: [Mod Organizer 2](https://discord.gg/ewUVAqyrQX)
|
||||
If you want to help translate MO2 to your language you should join the discord server too and head to the #translation channel.
|
||||
To setup a development environment on your machine, there is the [mob project](https://github.com/modorganizer2/mob) that handles that.
|
||||
If you want to submit your code changes, please use a good formatting style like the default one in Visual Studio.
|
||||
@@ -20,7 +20,7 @@ If you want to submit your code changes, please use a good formatting style like
|
||||
Through the work of a few people of the community MO2 has come quite far, now it needs some more of those people to go further.
|
||||
|
||||
## Reporting Issues:
|
||||
Issues should be reported to the GitHub page or on the open discord server: [Mod Organizer 2](https://discord.gg/6GKR9jZ). Here is also where dev builds are tested, bugs are reported and investigated, suggestions are discussed and a lot more.
|
||||
Issues should be reported to the GitHub page or on the open discord server: [Mod Organizer 2](https://discord.gg/ewUVAqyrQX). Here is also where dev builds are tested, bugs are reported and investigated, suggestions are discussed and a lot more.
|
||||
|
||||
Credits to Tannin, LePresidente, Silarn, erasmux, AL12, LostDragonist, AnyOldName3, isa, Holt59 and many others for the development.
|
||||
|
||||
|
||||
+62
-56
@@ -1,15 +1,37 @@
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
# appveyor does not build modorganizer in its standard location, so use
|
||||
# DEPENDENCIES_DIR to find cmake_common
|
||||
if(DEFINED DEPENDENCIES_DIR)
|
||||
include(${DEPENDENCIES_DIR}/modorganizer_super/cmake_common/src.cmake)
|
||||
else()
|
||||
include(../cmake_common/src.cmake)
|
||||
endif()
|
||||
add_executable(organizer)
|
||||
set_target_properties(organizer PROPERTIES OUTPUT_NAME "ModOrganizer")
|
||||
mo2_configure_executable(organizer
|
||||
WARNINGS OFF
|
||||
EXTRA_TRANSLATIONS ${MO2_SUPER_PATH}/game_gamebryo/src ${MO2_UIBASE_PATH}/src
|
||||
PRIVATE_DEPENDS
|
||||
uibase githubpp bsatk esptk archive usvfs lootcli boost::program_options
|
||||
DirectXTex libbsarch Qt::WebEngineWidgets Qt::WebSockets)
|
||||
target_link_libraries(organizer PUBLIC Shlwapi)
|
||||
target_include_directories(organizer PUBLIC ${DDS_ROOT})
|
||||
mo2_install_target(organizer)
|
||||
|
||||
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/dlls.manifest.qt6"
|
||||
DESTINATION bin/dlls
|
||||
CONFIGURATIONS Release RelWithDebInfo
|
||||
RENAME dlls.manifest)
|
||||
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/dlls.manifest.debug.qt6"
|
||||
DESTINATION bin/dlls
|
||||
CONFIGURATIONS Debug
|
||||
RENAME dlls.manifest)
|
||||
|
||||
add_filter(NAME src/application GROUPS
|
||||
install(DIRECTORY
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/stylesheets"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/tutorials"
|
||||
DESTINATION bin)
|
||||
|
||||
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/resources/markdown.html"
|
||||
DESTINATION bin/resources)
|
||||
|
||||
mo2_deploy_qt(BINARIES ModOrganizer.exe uibase.dll plugins/bsa_packer.dll)
|
||||
|
||||
mo2_add_filter(NAME src/application GROUPS
|
||||
iuserinterface
|
||||
commandline
|
||||
main
|
||||
@@ -21,18 +43,25 @@ add_filter(NAME src/application GROUPS
|
||||
updatedialog
|
||||
)
|
||||
|
||||
add_filter(NAME src/browser GROUPS
|
||||
mo2_add_filter(NAME src/browser GROUPS
|
||||
browserdialog
|
||||
browserview
|
||||
)
|
||||
|
||||
add_filter(NAME src/core GROUPS
|
||||
categories
|
||||
mo2_add_filter(NAME src/categories GROUPS
|
||||
categories
|
||||
categoriestable
|
||||
categoriesdialog
|
||||
categoryimportdialog
|
||||
)
|
||||
|
||||
mo2_add_filter(NAME src/core GROUPS
|
||||
archivefiletree
|
||||
installationmanager
|
||||
nexusinterface
|
||||
nxmaccessmanager
|
||||
organizercore
|
||||
game_features
|
||||
plugincontainer
|
||||
apiuseraccount
|
||||
processrunner
|
||||
@@ -41,10 +70,9 @@ add_filter(NAME src/core GROUPS
|
||||
uilocker
|
||||
)
|
||||
|
||||
add_filter(NAME src/dialogs GROUPS
|
||||
mo2_add_filter(NAME src/dialogs GROUPS
|
||||
aboutdialog
|
||||
activatemodsdialog
|
||||
categoriesdialog
|
||||
credentialsdialog
|
||||
filedialogmemory
|
||||
forcedloaddialog
|
||||
@@ -62,13 +90,13 @@ add_filter(NAME src/dialogs GROUPS
|
||||
waitingonclosedialog
|
||||
)
|
||||
|
||||
add_filter(NAME src/downloads GROUPS
|
||||
mo2_add_filter(NAME src/downloads GROUPS
|
||||
downloadlist
|
||||
downloadlistview
|
||||
downloadmanager
|
||||
)
|
||||
|
||||
add_filter(NAME src/env GROUPS
|
||||
mo2_add_filter(NAME src/env GROUPS
|
||||
env
|
||||
envdump
|
||||
envfs
|
||||
@@ -80,24 +108,24 @@ add_filter(NAME src/env GROUPS
|
||||
envwindows
|
||||
)
|
||||
|
||||
add_filter(NAME src/executables GROUPS
|
||||
mo2_add_filter(NAME src/executables GROUPS
|
||||
executableslist
|
||||
editexecutablesdialog
|
||||
)
|
||||
|
||||
add_filter(NAME src/instances GROUPS
|
||||
mo2_add_filter(NAME src/instances GROUPS
|
||||
createinstancedialog
|
||||
createinstancedialogpages
|
||||
instancemanager
|
||||
instancemanagerdialog
|
||||
)
|
||||
|
||||
add_filter(NAME src/loot GROUPS
|
||||
mo2_add_filter(NAME src/loot GROUPS
|
||||
loot
|
||||
lootdialog
|
||||
)
|
||||
|
||||
add_filter(NAME src/mainwindow GROUPS
|
||||
mo2_add_filter(NAME src/mainwindow GROUPS
|
||||
datatab
|
||||
downloadstab
|
||||
iconfetcher
|
||||
@@ -109,7 +137,7 @@ add_filter(NAME src/mainwindow GROUPS
|
||||
statusbar
|
||||
)
|
||||
|
||||
add_filter(NAME src/modinfo GROUPS
|
||||
mo2_add_filter(NAME src/modinfo GROUPS
|
||||
modinfo
|
||||
modinfobackup
|
||||
modinfoforeign
|
||||
@@ -119,7 +147,7 @@ add_filter(NAME src/modinfo GROUPS
|
||||
modinfowithconflictinfo
|
||||
)
|
||||
|
||||
add_filter(NAME src/modinfo/dialog GROUPS
|
||||
mo2_add_filter(NAME src/modinfo/dialog GROUPS
|
||||
modinfodialog
|
||||
modinfodialogcategories
|
||||
modinfodialogconflicts
|
||||
@@ -133,18 +161,18 @@ add_filter(NAME src/modinfo/dialog GROUPS
|
||||
modinfodialogtextfiles
|
||||
)
|
||||
|
||||
add_filter(NAME src/modinfo/dialog/widgets GROUPS
|
||||
mo2_add_filter(NAME src/modinfo/dialog/widgets GROUPS
|
||||
modidlineedit
|
||||
)
|
||||
|
||||
add_filter(NAME src/modlist GROUPS
|
||||
mo2_add_filter(NAME src/modlist GROUPS
|
||||
modlist
|
||||
modlistdropinfo
|
||||
modlistsortproxy
|
||||
modlistbypriorityproxy
|
||||
)
|
||||
|
||||
add_filter(NAME src/modlist/view GROUPS
|
||||
mo2_add_filter(NAME src/modlist/view GROUPS
|
||||
filterlist
|
||||
modlistview
|
||||
modlistviewactions
|
||||
@@ -155,33 +183,34 @@ add_filter(NAME src/modlist/view GROUPS
|
||||
modlistversiondelegate
|
||||
)
|
||||
|
||||
add_filter(NAME src/plugins GROUPS
|
||||
mo2_add_filter(NAME src/plugins GROUPS
|
||||
pluginlist
|
||||
pluginlistsortproxy
|
||||
pluginlistview
|
||||
pluginlistcontextmenu
|
||||
)
|
||||
|
||||
add_filter(NAME src/previews GROUPS
|
||||
mo2_add_filter(NAME src/previews GROUPS
|
||||
previewdialog
|
||||
previewgenerator
|
||||
)
|
||||
|
||||
add_filter(NAME src/profiles GROUPS
|
||||
mo2_add_filter(NAME src/profiles GROUPS
|
||||
profile
|
||||
profileinputdialog
|
||||
profilesdialog
|
||||
)
|
||||
|
||||
add_filter(NAME src/proxies GROUPS
|
||||
mo2_add_filter(NAME src/proxies GROUPS
|
||||
downloadmanagerproxy
|
||||
gamefeaturesproxy
|
||||
modlistproxy
|
||||
organizerproxy
|
||||
pluginlistproxy
|
||||
proxyutils
|
||||
)
|
||||
|
||||
add_filter(NAME src/register GROUPS
|
||||
mo2_add_filter(NAME src/register GROUPS
|
||||
shared/directoryentry
|
||||
shared/fileentry
|
||||
shared/filesorigin
|
||||
@@ -191,12 +220,12 @@ add_filter(NAME src/register GROUPS
|
||||
directoryrefresher
|
||||
)
|
||||
|
||||
add_filter(NAME src/settings GROUPS
|
||||
mo2_add_filter(NAME src/settings GROUPS
|
||||
settings
|
||||
settingsutilities
|
||||
)
|
||||
|
||||
add_filter(NAME src/settingsdialog GROUPS
|
||||
mo2_add_filter(NAME src/settingsdialog GROUPS
|
||||
settingsdialog
|
||||
settingsdialogdiagnostics
|
||||
settingsdialoggeneral
|
||||
@@ -209,7 +238,7 @@ add_filter(NAME src/settingsdialog GROUPS
|
||||
disableproxyplugindialog
|
||||
)
|
||||
|
||||
add_filter(NAME src/utilities GROUPS
|
||||
mo2_add_filter(NAME src/utilities GROUPS
|
||||
shared/appconfig
|
||||
bbcode
|
||||
csvbuilder
|
||||
@@ -224,7 +253,7 @@ add_filter(NAME src/utilities GROUPS
|
||||
glob_matching
|
||||
)
|
||||
|
||||
add_filter(NAME src/widgets GROUPS
|
||||
mo2_add_filter(NAME src/widgets GROUPS
|
||||
colortable
|
||||
genericicondelegate
|
||||
filerenamer
|
||||
@@ -239,26 +268,3 @@ add_filter(NAME src/widgets GROUPS
|
||||
modelutils
|
||||
copyeventfilter
|
||||
)
|
||||
|
||||
|
||||
requires_project(game_features githubpp bsatk esptk archive usvfs)
|
||||
|
||||
target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE
|
||||
${modorganizer_super_path}/lootcli/include
|
||||
)
|
||||
|
||||
|
||||
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/dlls.manifest.qt5"
|
||||
DESTINATION bin/dlls
|
||||
RENAME dlls.manifest)
|
||||
|
||||
install(FILES ${qm_files} DESTINATION bin/translations)
|
||||
|
||||
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/stylesheets"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/tutorials"
|
||||
DESTINATION bin)
|
||||
|
||||
deploy_qt(BINARIES ModOrganizer.exe uibase.dll plugins/bsa_packer.dll)
|
||||
|
||||
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../qdds.dll" DESTINATION bin/dlls/imageformats)
|
||||
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/resources/markdown.html" DESTINATION bin/resources)
|
||||
|
||||
@@ -40,6 +40,10 @@ greaterThan(QT_MAJOR_VERSION, 4) {
|
||||
QTLIBNAMES += Core Declarative Gui Network OpenGL Script Sql Svg Webkit Xml XmlPatterns
|
||||
}
|
||||
|
||||
greaterThan(QT_MAJOR_VERSION, 5) {
|
||||
QTLIBNAMES += OpenGLWidgets
|
||||
}
|
||||
|
||||
QTLIBSUFFIX = $${QT_MAJOR_VERSION}.dll
|
||||
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
|
||||
|
||||
|
||||
+126
-124
@@ -1,124 +1,126 @@
|
||||
/*
|
||||
Copyright (C) 2014 Sebastian Herbord. All rights reserved.
|
||||
|
||||
This file is part of Mod Organizer.
|
||||
|
||||
Mod Organizer is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Mod Organizer is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#include "aboutdialog.h"
|
||||
#include "ui_aboutdialog.h"
|
||||
#include "shared/util.h"
|
||||
#include <utility.h>
|
||||
|
||||
#include <QApplication>
|
||||
#include <QLabel>
|
||||
#include <QListWidget>
|
||||
#include <QListWidgetItem>
|
||||
#include <QTextBrowser>
|
||||
#include <QVariant>
|
||||
#include <Qt>
|
||||
#include <QFontDatabase>
|
||||
|
||||
AboutDialog::AboutDialog(const QString &version, QWidget *parent)
|
||||
: QDialog(parent)
|
||||
, ui(new Ui::AboutDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
m_LicenseFiles[LICENSE_LGPL3] = "LGPL-v3.0.txt";
|
||||
m_LicenseFiles[LICENSE_LGPL21] = "GNU-LGPL-v2.1.txt";
|
||||
m_LicenseFiles[LICENSE_GPL3] = "GPL-v3.0.txt";
|
||||
m_LicenseFiles[LICENSE_GPL2] = "GPL-v2.0.txt";
|
||||
m_LicenseFiles[LICENSE_BOOST] = "boost.txt";
|
||||
m_LicenseFiles[LICENSE_7ZIP] = "7zip.txt";
|
||||
m_LicenseFiles[LICENSE_CCBY3] = "BY-SA-v3.0.txt";
|
||||
m_LicenseFiles[LICENSE_ZLIB] = "zlib.txt";
|
||||
m_LicenseFiles[LICENSE_PYTHON] = "python.txt";
|
||||
m_LicenseFiles[LICENSE_SSL] = "openssl.txt";
|
||||
m_LicenseFiles[LICENSE_CPPTOML] = "cpptoml.txt";
|
||||
m_LicenseFiles[LICENSE_UDIS] = "udis86.txt";
|
||||
m_LicenseFiles[LICENSE_SPDLOG] = "spdlog.txt";
|
||||
m_LicenseFiles[LICENSE_FMT] = "fmt.txt";
|
||||
m_LicenseFiles[LICENSE_SIP] = "sip.txt";
|
||||
m_LicenseFiles[LICENSE_CASTLE] = "Castle.txt";
|
||||
m_LicenseFiles[LICENSE_ANTLR] = "AntlrBuildTask.txt";
|
||||
m_LicenseFiles[LICENSE_DXTEX] = "DXTex.txt";
|
||||
|
||||
addLicense("Qt", LICENSE_LGPL3);
|
||||
addLicense("Qt Json", LICENSE_GPL3);
|
||||
addLicense("Boost Library", LICENSE_BOOST);
|
||||
addLicense("7-zip", LICENSE_7ZIP);
|
||||
addLicense("ZLib", LICENSE_NONE);
|
||||
addLicense("Tango Icon Theme", LICENSE_NONE);
|
||||
addLicense("RRZE Icon Set", LICENSE_CCBY3);
|
||||
addLicense("Icons by Lorc, Delapouite and sbed available on http://game-icons.net", LICENSE_CCBY3);
|
||||
addLicense("Castle Core", LICENSE_CASTLE);
|
||||
addLicense("ANTLR", LICENSE_ANTLR);
|
||||
addLicense("LOOT", LICENSE_GPL3);
|
||||
addLicense("Python", LICENSE_PYTHON);
|
||||
addLicense("OpenSSL", LICENSE_SSL);
|
||||
addLicense("cpptoml", LICENSE_CPPTOML);
|
||||
addLicense("Udis86", LICENSE_UDIS);
|
||||
addLicense("spdlog", LICENSE_SPDLOG);
|
||||
addLicense("{fmt}", LICENSE_FMT);
|
||||
addLicense("SIP", LICENSE_SIP);
|
||||
addLicense("DXTex Headers", LICENSE_DXTEX);
|
||||
|
||||
ui->nameLabel->setText(QString("<span style=\"font-size:12pt; font-weight:600;\">%1 %2</span>").arg(ui->nameLabel->text()).arg(version));
|
||||
#if defined(HGID)
|
||||
ui->revisionLabel->setText(ui->revisionLabel->text() + " " + HGID);
|
||||
#elif defined(GITID)
|
||||
ui->revisionLabel->setText(ui->revisionLabel->text() + " " + GITID);
|
||||
#else
|
||||
ui->revisionLabel->setText(ui->revisionLabel->text() + " unknown");
|
||||
#endif
|
||||
|
||||
|
||||
ui->usvfsLabel->setText(ui->usvfsLabel->text() + " " + MOShared::getUsvfsVersionString());
|
||||
ui->licenseText->setFont(QFontDatabase::systemFont(QFontDatabase::FixedFont));
|
||||
}
|
||||
|
||||
|
||||
AboutDialog::~AboutDialog()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
|
||||
void AboutDialog::addLicense(const QString &name, Licenses license)
|
||||
{
|
||||
QListWidgetItem *item = new QListWidgetItem(name);
|
||||
item->setData(Qt::UserRole, license);
|
||||
ui->creditsList->addItem(item);
|
||||
}
|
||||
|
||||
|
||||
void AboutDialog::on_creditsList_currentItemChanged(QListWidgetItem *current, QListWidgetItem*)
|
||||
{
|
||||
auto iter = m_LicenseFiles.find(current->data(Qt::UserRole).toInt());
|
||||
if (iter != m_LicenseFiles.end()) {
|
||||
QString filePath = qApp->applicationDirPath() + "/licenses/" + iter->second;
|
||||
QString text = MOBase::readFileText(filePath);
|
||||
ui->licenseText->setText(text);
|
||||
} else {
|
||||
ui->licenseText->setText(tr("No license"));
|
||||
}
|
||||
}
|
||||
|
||||
void AboutDialog::on_sourceText_linkActivated(const QString &link)
|
||||
{
|
||||
MOBase::shell::Open(QUrl(link));
|
||||
}
|
||||
/*
|
||||
Copyright (C) 2014 Sebastian Herbord. All rights reserved.
|
||||
|
||||
This file is part of Mod Organizer.
|
||||
|
||||
Mod Organizer is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Mod Organizer is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "aboutdialog.h"
|
||||
#include "shared/util.h"
|
||||
#include "ui_aboutdialog.h"
|
||||
#include <utility.h>
|
||||
|
||||
#include <QApplication>
|
||||
#include <QFontDatabase>
|
||||
#include <QLabel>
|
||||
#include <QListWidget>
|
||||
#include <QListWidgetItem>
|
||||
#include <QTextBrowser>
|
||||
#include <QVariant>
|
||||
#include <Qt>
|
||||
|
||||
AboutDialog::AboutDialog(const QString& version, QWidget* parent)
|
||||
: QDialog(parent), ui(new Ui::AboutDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
m_LicenseFiles[LICENSE_LGPL3] = "LGPL-v3.0.txt";
|
||||
m_LicenseFiles[LICENSE_LGPL21] = "GNU-LGPL-v2.1.txt";
|
||||
m_LicenseFiles[LICENSE_GPL3] = "GPL-v3.0.txt";
|
||||
m_LicenseFiles[LICENSE_GPL2] = "GPL-v2.0.txt";
|
||||
m_LicenseFiles[LICENSE_BOOST] = "boost.txt";
|
||||
m_LicenseFiles[LICENSE_7ZIP] = "7zip.txt";
|
||||
m_LicenseFiles[LICENSE_CCBY3] = "BY-SA-v3.0.txt";
|
||||
m_LicenseFiles[LICENSE_ZLIB] = "zlib.txt";
|
||||
m_LicenseFiles[LICENSE_PYTHON] = "python.txt";
|
||||
m_LicenseFiles[LICENSE_SSL] = "openssl.txt";
|
||||
m_LicenseFiles[LICENSE_CPPTOML] = "cpptoml.txt";
|
||||
m_LicenseFiles[LICENSE_UDIS] = "udis86.txt";
|
||||
m_LicenseFiles[LICENSE_SPDLOG] = "spdlog.txt";
|
||||
m_LicenseFiles[LICENSE_FMT] = "fmt.txt";
|
||||
m_LicenseFiles[LICENSE_SIP] = "sip.txt";
|
||||
m_LicenseFiles[LICENSE_CASTLE] = "Castle.txt";
|
||||
m_LicenseFiles[LICENSE_ANTLR] = "AntlrBuildTask.txt";
|
||||
m_LicenseFiles[LICENSE_DXTEX] = "DXTex.txt";
|
||||
m_LicenseFiles[LICENSE_VDF] = "ValveFileVDF.txt";
|
||||
|
||||
addLicense("Qt", LICENSE_LGPL3);
|
||||
addLicense("Qt Json", LICENSE_GPL3);
|
||||
addLicense("Boost Library", LICENSE_BOOST);
|
||||
addLicense("7-zip", LICENSE_7ZIP);
|
||||
addLicense("ZLib", LICENSE_NONE);
|
||||
addLicense("Tango Icon Theme", LICENSE_NONE);
|
||||
addLicense("RRZE Icon Set", LICENSE_CCBY3);
|
||||
addLicense("Icons by Lorc, Delapouite and sbed available on http://game-icons.net",
|
||||
LICENSE_CCBY3);
|
||||
addLicense("Castle Core", LICENSE_CASTLE);
|
||||
addLicense("ANTLR", LICENSE_ANTLR);
|
||||
addLicense("LOOT", LICENSE_GPL3);
|
||||
addLicense("Python", LICENSE_PYTHON);
|
||||
addLicense("OpenSSL", LICENSE_SSL);
|
||||
addLicense("cpptoml", LICENSE_CPPTOML);
|
||||
addLicense("Udis86", LICENSE_UDIS);
|
||||
addLicense("spdlog", LICENSE_SPDLOG);
|
||||
addLicense("{fmt}", LICENSE_FMT);
|
||||
addLicense("SIP", LICENSE_SIP);
|
||||
addLicense("DXTex Headers", LICENSE_DXTEX);
|
||||
addLicense("Valve File VDF Reader", LICENSE_VDF);
|
||||
|
||||
ui->nameLabel->setText(
|
||||
QString("<span style=\"font-size:12pt; font-weight:600;\">%1 %2</span>")
|
||||
.arg(ui->nameLabel->text())
|
||||
.arg(version));
|
||||
#if defined(HGID)
|
||||
ui->revisionLabel->setText(ui->revisionLabel->text() + " " + HGID);
|
||||
#elif defined(GITID)
|
||||
ui->revisionLabel->setText(ui->revisionLabel->text() + " " + GITID);
|
||||
#else
|
||||
ui->revisionLabel->setText(ui->revisionLabel->text() + " unknown");
|
||||
#endif
|
||||
|
||||
ui->usvfsLabel->setText(ui->usvfsLabel->text() + " " +
|
||||
MOShared::getUsvfsVersionString());
|
||||
ui->licenseText->setFont(QFontDatabase::systemFont(QFontDatabase::FixedFont));
|
||||
}
|
||||
|
||||
AboutDialog::~AboutDialog()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void AboutDialog::addLicense(const QString& name, Licenses license)
|
||||
{
|
||||
QListWidgetItem* item = new QListWidgetItem(name);
|
||||
item->setData(Qt::UserRole, license);
|
||||
ui->creditsList->addItem(item);
|
||||
}
|
||||
|
||||
void AboutDialog::on_creditsList_currentItemChanged(QListWidgetItem* current,
|
||||
QListWidgetItem*)
|
||||
{
|
||||
auto iter = m_LicenseFiles.find(current->data(Qt::UserRole).toInt());
|
||||
if (iter != m_LicenseFiles.end()) {
|
||||
QString filePath = qApp->applicationDirPath() + "/licenses/" + iter->second;
|
||||
QString text = MOBase::readFileText(filePath);
|
||||
ui->licenseText->setText(text);
|
||||
} else {
|
||||
ui->licenseText->setText(tr("No license"));
|
||||
}
|
||||
}
|
||||
|
||||
void AboutDialog::on_sourceText_linkActivated(const QString& link)
|
||||
{
|
||||
MOBase::shell::Open(QUrl(link));
|
||||
}
|
||||
|
||||
+82
-83
@@ -1,83 +1,82 @@
|
||||
#ifndef ABOUTDIALOG_H
|
||||
/*
|
||||
Copyright (C) 2014 Sebastian Herbord. All rights reserved.
|
||||
|
||||
This file is part of Mod Organizer.
|
||||
|
||||
Mod Organizer is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Mod Organizer is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#define ABOUTDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
class QListWidgetItem;
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
|
||||
#include <map>
|
||||
|
||||
namespace Ui {
|
||||
class AboutDialog;
|
||||
}
|
||||
|
||||
class AboutDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit AboutDialog(const QString &version, QWidget *parent = 0);
|
||||
~AboutDialog();
|
||||
|
||||
private:
|
||||
|
||||
enum Licenses {
|
||||
LICENSE_NONE,
|
||||
LICENSE_LGPL3,
|
||||
LICENSE_LGPL21,
|
||||
LICENSE_GPL3,
|
||||
LICENSE_GPL2,
|
||||
LICENSE_BOOST,
|
||||
LICENSE_CCBY3,
|
||||
LICENSE_PYTHON,
|
||||
LICENSE_SSL,
|
||||
LICENSE_CPPTOML,
|
||||
LICENSE_7ZIP,
|
||||
LICENSE_ZLIB,
|
||||
LICENSE_UDIS,
|
||||
LICENSE_SPDLOG,
|
||||
LICENSE_FMT,
|
||||
LICENSE_SIP,
|
||||
LICENSE_CASTLE,
|
||||
LICENSE_ANTLR,
|
||||
LICENSE_DXTEX
|
||||
};
|
||||
|
||||
private:
|
||||
|
||||
void addLicense(const QString &name, Licenses license);
|
||||
|
||||
private slots:
|
||||
void on_creditsList_currentItemChanged(QListWidgetItem *current, QListWidgetItem *previous);
|
||||
void on_sourceText_linkActivated(const QString &link);
|
||||
|
||||
private:
|
||||
|
||||
Ui::AboutDialog *ui;
|
||||
|
||||
std::map<int, QString> m_LicenseFiles;
|
||||
|
||||
};
|
||||
|
||||
#endif // ABOUTDIALOG_H
|
||||
#ifndef ABOUTDIALOG_H
|
||||
/*
|
||||
Copyright (C) 2014 Sebastian Herbord. All rights reserved.
|
||||
|
||||
This file is part of Mod Organizer.
|
||||
|
||||
Mod Organizer is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Mod Organizer is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#define ABOUTDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
class QListWidgetItem;
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
|
||||
#include <map>
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class AboutDialog;
|
||||
}
|
||||
|
||||
class AboutDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit AboutDialog(const QString& version, QWidget* parent = 0);
|
||||
~AboutDialog();
|
||||
|
||||
private:
|
||||
enum Licenses
|
||||
{
|
||||
LICENSE_NONE,
|
||||
LICENSE_LGPL3,
|
||||
LICENSE_LGPL21,
|
||||
LICENSE_GPL3,
|
||||
LICENSE_GPL2,
|
||||
LICENSE_BOOST,
|
||||
LICENSE_CCBY3,
|
||||
LICENSE_PYTHON,
|
||||
LICENSE_SSL,
|
||||
LICENSE_CPPTOML,
|
||||
LICENSE_7ZIP,
|
||||
LICENSE_ZLIB,
|
||||
LICENSE_UDIS,
|
||||
LICENSE_SPDLOG,
|
||||
LICENSE_FMT,
|
||||
LICENSE_SIP,
|
||||
LICENSE_CASTLE,
|
||||
LICENSE_ANTLR,
|
||||
LICENSE_DXTEX,
|
||||
LICENSE_VDF,
|
||||
};
|
||||
|
||||
private:
|
||||
void addLicense(const QString& name, Licenses license);
|
||||
|
||||
private slots:
|
||||
void on_creditsList_currentItemChanged(QListWidgetItem* current,
|
||||
QListWidgetItem* previous);
|
||||
void on_sourceText_linkActivated(const QString& link);
|
||||
|
||||
private:
|
||||
Ui::AboutDialog* ui;
|
||||
|
||||
std::map<int, QString> m_LicenseFiles;
|
||||
};
|
||||
|
||||
#endif // ABOUTDIALOG_H
|
||||
|
||||
+1
-1
@@ -127,7 +127,7 @@
|
||||
<item>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string notr="true"><html><head/><body><p>Copyright © 2011-2016 Sebastian Herbord<br/>Copyright © 2016-2021 Mod Organizer 2 Contributors</p></body></html></string>
|
||||
<string notr="true"><html><head/><body><p>Copyright © 2011-2016 Sebastian Herbord<br/>Copyright © 2016-2023 Mod Organizer 2 Contributors</p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
+96
-96
@@ -1,96 +1,96 @@
|
||||
/*
|
||||
Copyright (C) 2012 Sebastian Herbord. All rights reserved.
|
||||
|
||||
This file is part of Mod Organizer.
|
||||
|
||||
Mod Organizer is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Mod Organizer is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "activatemodsdialog.h"
|
||||
#include "ui_activatemodsdialog.h"
|
||||
|
||||
#include <QComboBox>
|
||||
#include <QHeaderView>
|
||||
#include <QLabel>
|
||||
#include <QString>
|
||||
#include <QTableWidget>
|
||||
|
||||
#include <QtGlobal>
|
||||
|
||||
ActivateModsDialog::ActivateModsDialog(SaveGameInfo::MissingAssets const &missingAssets, QWidget *parent)
|
||||
: TutorableDialog("ActivateMods", parent), ui(new Ui::ActivateModsDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
QTableWidget *modsTable = findChild<QTableWidget*>("modsTable");
|
||||
QHeaderView *headerView = modsTable->horizontalHeader();
|
||||
headerView->setSectionResizeMode(0, QHeaderView::Stretch);
|
||||
headerView->setSectionResizeMode(1, QHeaderView::Interactive);
|
||||
|
||||
int row = 0;
|
||||
|
||||
modsTable->setRowCount(missingAssets.size());
|
||||
|
||||
for (SaveGameInfo::MissingAssets::const_iterator espIter = missingAssets.begin();
|
||||
espIter != missingAssets.end(); ++espIter, ++row) {
|
||||
modsTable->setCellWidget(row, 0, new QLabel(espIter.key()));
|
||||
if (espIter->size() == 0) {
|
||||
modsTable->setCellWidget(row, 1, new QLabel(tr("not found")));
|
||||
} else {
|
||||
QComboBox* combo = new QComboBox();
|
||||
for (QString const &mod : espIter.value()) {
|
||||
combo->addItem(mod);
|
||||
}
|
||||
modsTable->setCellWidget(row, 1, combo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ActivateModsDialog::~ActivateModsDialog()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
|
||||
std::set<QString> ActivateModsDialog::getModsToActivate()
|
||||
{
|
||||
std::set<QString> result;
|
||||
QTableWidget *modsTable = findChild<QTableWidget*>("modsTable");
|
||||
|
||||
for (int row = 0; row < modsTable->rowCount(); ++row) {
|
||||
QComboBox *comboBox = dynamic_cast<QComboBox*>(modsTable->cellWidget(row, 1));
|
||||
if (comboBox != nullptr) {
|
||||
result.insert(comboBox->currentText());
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
std::set<QString> ActivateModsDialog::getESPsToActivate()
|
||||
{
|
||||
std::set<QString> result;
|
||||
QTableWidget *modsTable = findChild<QTableWidget*>("modsTable");
|
||||
|
||||
for (int row = 0; row < modsTable->rowCount(); ++row) {
|
||||
QComboBox *comboBox = dynamic_cast<QComboBox*>(modsTable->cellWidget(row, 1));
|
||||
if (comboBox != nullptr) {
|
||||
QLabel *espName = dynamic_cast<QLabel*>(modsTable->cellWidget(row, 0));
|
||||
|
||||
result.insert(espName->text());
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
/*
|
||||
Copyright (C) 2012 Sebastian Herbord. All rights reserved.
|
||||
|
||||
This file is part of Mod Organizer.
|
||||
|
||||
Mod Organizer is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Mod Organizer is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "activatemodsdialog.h"
|
||||
#include "ui_activatemodsdialog.h"
|
||||
|
||||
#include <QComboBox>
|
||||
#include <QHeaderView>
|
||||
#include <QLabel>
|
||||
#include <QString>
|
||||
#include <QTableWidget>
|
||||
|
||||
#include <QtGlobal>
|
||||
|
||||
using namespace MOBase;
|
||||
|
||||
ActivateModsDialog::ActivateModsDialog(SaveGameInfo::MissingAssets const& missingAssets,
|
||||
QWidget* parent)
|
||||
: TutorableDialog("ActivateMods", parent), ui(new Ui::ActivateModsDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
QTableWidget* modsTable = findChild<QTableWidget*>("modsTable");
|
||||
QHeaderView* headerView = modsTable->horizontalHeader();
|
||||
headerView->setSectionResizeMode(0, QHeaderView::Stretch);
|
||||
headerView->setSectionResizeMode(1, QHeaderView::Interactive);
|
||||
|
||||
int row = 0;
|
||||
|
||||
modsTable->setRowCount(missingAssets.size());
|
||||
|
||||
for (SaveGameInfo::MissingAssets::const_iterator espIter = missingAssets.begin();
|
||||
espIter != missingAssets.end(); ++espIter, ++row) {
|
||||
modsTable->setCellWidget(row, 0, new QLabel(espIter.key()));
|
||||
if (espIter->size() == 0) {
|
||||
modsTable->setCellWidget(row, 1, new QLabel(tr("not found")));
|
||||
} else {
|
||||
QComboBox* combo = new QComboBox();
|
||||
for (QString const& mod : espIter.value()) {
|
||||
combo->addItem(mod);
|
||||
}
|
||||
modsTable->setCellWidget(row, 1, combo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ActivateModsDialog::~ActivateModsDialog()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
std::set<QString> ActivateModsDialog::getModsToActivate()
|
||||
{
|
||||
std::set<QString> result;
|
||||
QTableWidget* modsTable = findChild<QTableWidget*>("modsTable");
|
||||
|
||||
for (int row = 0; row < modsTable->rowCount(); ++row) {
|
||||
QComboBox* comboBox = dynamic_cast<QComboBox*>(modsTable->cellWidget(row, 1));
|
||||
if (comboBox != nullptr) {
|
||||
result.insert(comboBox->currentText());
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
std::set<QString> ActivateModsDialog::getESPsToActivate()
|
||||
{
|
||||
std::set<QString> result;
|
||||
QTableWidget* modsTable = findChild<QTableWidget*>("modsTable");
|
||||
|
||||
for (int row = 0; row < modsTable->rowCount(); ++row) {
|
||||
QComboBox* comboBox = dynamic_cast<QComboBox*>(modsTable->cellWidget(row, 1));
|
||||
if (comboBox != nullptr) {
|
||||
QLabel* espName = dynamic_cast<QLabel*>(modsTable->cellWidget(row, 0));
|
||||
|
||||
result.insert(espName->text());
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
+78
-76
@@ -1,76 +1,78 @@
|
||||
/*
|
||||
Copyright (C) 2012 Sebastian Herbord. All rights reserved.
|
||||
|
||||
This file is part of Mod Organizer.
|
||||
|
||||
Mod Organizer is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Mod Organizer is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef ACTIVATEMODSDIALOG_H
|
||||
#define ACTIVATEMODSDIALOG_H
|
||||
|
||||
#include "savegameinfo.h"
|
||||
#include "tutorabledialog.h"
|
||||
|
||||
#include <QObject>
|
||||
|
||||
class QString;
|
||||
class QWidget;
|
||||
|
||||
#include <set>
|
||||
|
||||
namespace Ui {
|
||||
class ActivateModsDialog;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Dialog that is used to batch activate/deactivate mods and plugins
|
||||
**/
|
||||
class ActivateModsDialog : public MOBase::TutorableDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
/**
|
||||
* @brief constructor
|
||||
*
|
||||
* @param missingPlugins a map containing missing plugins that need to be activated
|
||||
* @param parent ... Defaults to 0.
|
||||
**/
|
||||
explicit ActivateModsDialog(SaveGameInfo::MissingAssets const &missingAssets, QWidget *parent = 0);
|
||||
~ActivateModsDialog();
|
||||
|
||||
/**
|
||||
* @brief get a list of mods that the user chose to activate
|
||||
*
|
||||
* @note This can of ocurse only be called after the dialog has been displayed
|
||||
*
|
||||
* @return set< QString > the mods to activate
|
||||
**/
|
||||
std::set<QString> getModsToActivate();
|
||||
|
||||
/**
|
||||
* @brief get a list of plugins that should be activated
|
||||
*
|
||||
* @return set< QString > the plugins to activate. This contains only plugins that become available after enabling the mods retrieved with getModsToActivate
|
||||
**/
|
||||
std::set<QString> getESPsToActivate();
|
||||
|
||||
private slots:
|
||||
|
||||
private:
|
||||
Ui::ActivateModsDialog *ui;
|
||||
};
|
||||
|
||||
#endif // ACTIVATEMODSDIALOG_H
|
||||
/*
|
||||
Copyright (C) 2012 Sebastian Herbord. All rights reserved.
|
||||
|
||||
This file is part of Mod Organizer.
|
||||
|
||||
Mod Organizer is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Mod Organizer is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef ACTIVATEMODSDIALOG_H
|
||||
#define ACTIVATEMODSDIALOG_H
|
||||
|
||||
#include "savegameinfo.h"
|
||||
#include "tutorabledialog.h"
|
||||
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
#include <QWidget>
|
||||
|
||||
#include <set>
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class ActivateModsDialog;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Dialog that is used to batch activate/deactivate mods and plugins
|
||||
**/
|
||||
class ActivateModsDialog : public MOBase::TutorableDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
/**
|
||||
* @brief constructor
|
||||
*
|
||||
* @param missingPlugins a map containing missing plugins that need to be activated
|
||||
* @param parent ... Defaults to 0.
|
||||
**/
|
||||
explicit ActivateModsDialog(MOBase::SaveGameInfo::MissingAssets const& missingAssets,
|
||||
QWidget* parent = 0);
|
||||
~ActivateModsDialog();
|
||||
|
||||
/**
|
||||
* @brief get a list of mods that the user chose to activate
|
||||
*
|
||||
* @note This can of ocurse only be called after the dialog has been displayed
|
||||
*
|
||||
* @return set< QString > the mods to activate
|
||||
**/
|
||||
std::set<QString> getModsToActivate();
|
||||
|
||||
/**
|
||||
* @brief get a list of plugins that should be activated
|
||||
*
|
||||
* @return set< QString > the plugins to activate. This contains only plugins that
|
||||
*become available after enabling the mods retrieved with getModsToActivate
|
||||
**/
|
||||
std::set<QString> getESPsToActivate();
|
||||
|
||||
private slots:
|
||||
|
||||
private:
|
||||
Ui::ActivateModsDialog* ui;
|
||||
};
|
||||
|
||||
#endif // ACTIVATEMODSDIALOG_H
|
||||
|
||||
+10
-17
@@ -2,25 +2,20 @@
|
||||
|
||||
QString localizedUserAccountType(APIUserAccountTypes t)
|
||||
{
|
||||
switch (t)
|
||||
{
|
||||
case APIUserAccountTypes::Regular:
|
||||
return QObject::tr("Regular");
|
||||
switch (t) {
|
||||
case APIUserAccountTypes::Regular:
|
||||
return QObject::tr("Regular");
|
||||
|
||||
case APIUserAccountTypes::Premium:
|
||||
return QObject::tr("Premium");
|
||||
case APIUserAccountTypes::Premium:
|
||||
return QObject::tr("Premium");
|
||||
|
||||
case APIUserAccountTypes::None: // fall-through
|
||||
default:
|
||||
return QObject::tr("None");
|
||||
case APIUserAccountTypes::None: // fall-through
|
||||
default:
|
||||
return QObject::tr("None");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
APIUserAccount::APIUserAccount()
|
||||
: m_type(APIUserAccountTypes::None)
|
||||
{
|
||||
}
|
||||
APIUserAccount::APIUserAccount() : m_type(APIUserAccountTypes::None) {}
|
||||
|
||||
bool APIUserAccount::isValid() const
|
||||
{
|
||||
@@ -84,9 +79,7 @@ APIUserAccount& APIUserAccount::limits(const APILimits& limits)
|
||||
|
||||
int APIUserAccount::remainingRequests() const
|
||||
{
|
||||
return std::max(
|
||||
m_limits.remainingDailyRequests,
|
||||
m_limits.remainingHourlyRequests);
|
||||
return std::max(m_limits.remainingDailyRequests, m_limits.remainingHourlyRequests);
|
||||
}
|
||||
|
||||
bool APIUserAccount::shouldThrottle() const
|
||||
|
||||
+35
-41
@@ -4,8 +4,8 @@
|
||||
#include <QString>
|
||||
|
||||
/**
|
||||
* represents user account types on a mod provider website such as nexus
|
||||
*/
|
||||
* represents user account types on a mod provider website such as nexus
|
||||
*/
|
||||
enum class APIUserAccountTypes
|
||||
{
|
||||
// not logged in
|
||||
@@ -20,10 +20,9 @@ enum class APIUserAccountTypes
|
||||
|
||||
QString localizedUserAccountType(APIUserAccountTypes t);
|
||||
|
||||
|
||||
/**
|
||||
* current limits imposed on the user account
|
||||
**/
|
||||
* current limits imposed on the user account
|
||||
**/
|
||||
struct APILimits
|
||||
{
|
||||
// maximum number of requests per day
|
||||
@@ -39,20 +38,18 @@ struct APILimits
|
||||
int remainingHourlyRequests = 0;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* API statistics
|
||||
*/
|
||||
* API statistics
|
||||
*/
|
||||
struct APIStats
|
||||
{
|
||||
// number of API requests currently queued
|
||||
int requestsQueued = 0;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* represents a user account on the mod provider website
|
||||
*/
|
||||
* represents a user account on the mod provider website
|
||||
*/
|
||||
class APIUserAccount
|
||||
{
|
||||
public:
|
||||
@@ -62,79 +59,76 @@ public:
|
||||
|
||||
APIUserAccount();
|
||||
|
||||
|
||||
/**
|
||||
* whether the user is logged in
|
||||
*/
|
||||
bool isValid() const;
|
||||
|
||||
/**
|
||||
* api key
|
||||
*/
|
||||
* api key
|
||||
*/
|
||||
const QString& apiKey() const;
|
||||
|
||||
/**
|
||||
* user id
|
||||
*/
|
||||
* user id
|
||||
*/
|
||||
const QString& id() const;
|
||||
|
||||
/**
|
||||
* user name
|
||||
*/
|
||||
* user name
|
||||
*/
|
||||
const QString& name() const;
|
||||
|
||||
/**
|
||||
* account type
|
||||
*/
|
||||
* account type
|
||||
*/
|
||||
APIUserAccountTypes type() const;
|
||||
|
||||
/**
|
||||
* current API limits
|
||||
*/
|
||||
* current API limits
|
||||
*/
|
||||
const APILimits& limits() const;
|
||||
|
||||
|
||||
/**
|
||||
* sets the api key
|
||||
*/
|
||||
APIUserAccount& apiKey(const QString& key);
|
||||
|
||||
/**
|
||||
* sets the user id
|
||||
*/
|
||||
* sets the user id
|
||||
*/
|
||||
APIUserAccount& id(const QString& id);
|
||||
|
||||
/**
|
||||
* sets the user name
|
||||
**/
|
||||
* sets the user name
|
||||
**/
|
||||
APIUserAccount& name(const QString& name);
|
||||
|
||||
/**
|
||||
* sets the account type
|
||||
*/
|
||||
* sets the account type
|
||||
*/
|
||||
APIUserAccount& type(APIUserAccountTypes type);
|
||||
|
||||
/**
|
||||
* sets the current limits
|
||||
*/
|
||||
* sets the current limits
|
||||
*/
|
||||
APIUserAccount& limits(const APILimits& limits);
|
||||
|
||||
|
||||
/**
|
||||
* returns the number of remaining requests
|
||||
*/
|
||||
* returns the number of remaining requests
|
||||
*/
|
||||
int remainingRequests() const;
|
||||
|
||||
/**
|
||||
* whether the number of remaining requests is low enough that further
|
||||
* requests should be throttled
|
||||
*/
|
||||
* whether the number of remaining requests is low enough that further
|
||||
* requests should be throttled
|
||||
*/
|
||||
bool shouldThrottle() const;
|
||||
|
||||
/**
|
||||
* true if all the remaining requests have been used and the API will refuse
|
||||
* further requests
|
||||
*/
|
||||
* true if all the remaining requests have been used and the API will refuse
|
||||
* further requests
|
||||
*/
|
||||
bool exhausted() const;
|
||||
|
||||
private:
|
||||
@@ -143,4 +137,4 @@ private:
|
||||
APILimits m_limits;
|
||||
};
|
||||
|
||||
#endif // APIUSERACCOUNT_H
|
||||
#endif // APIUSERACCOUNT_H
|
||||
|
||||
+87
-74
@@ -29,9 +29,9 @@ using namespace MOBase;
|
||||
/**
|
||||
* We use custom file entries to store the index.
|
||||
*/
|
||||
class ArchiveFileEntry : public virtual FileTreeEntry {
|
||||
class ArchiveFileEntry : public virtual FileTreeEntry
|
||||
{
|
||||
public:
|
||||
|
||||
/**
|
||||
* @brief Create a new entry.
|
||||
*
|
||||
@@ -39,11 +39,12 @@ public:
|
||||
* @param name The name of this entry.
|
||||
* @param index The index of the entry in the archive.
|
||||
*/
|
||||
ArchiveFileEntry(std::shared_ptr<const IFileTree> parent, QString name, int index) :
|
||||
FileTreeEntry(parent, name), m_Index(index) {
|
||||
}
|
||||
ArchiveFileEntry(std::shared_ptr<const IFileTree> parent, QString name, int index)
|
||||
: FileTreeEntry(parent, name), m_Index(index)
|
||||
{}
|
||||
|
||||
virtual std::shared_ptr<FileTreeEntry> clone() const override {
|
||||
virtual std::shared_ptr<FileTreeEntry> clone() const override
|
||||
{
|
||||
return std::make_shared<ArchiveFileEntry>(nullptr, name(), m_Index);
|
||||
}
|
||||
|
||||
@@ -51,67 +52,70 @@ public:
|
||||
const int m_Index;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class ArchiveFileTreeImpl: public virtual ArchiveFileTree, public virtual ArchiveFileEntry {
|
||||
class ArchiveFileTreeImpl : public virtual ArchiveFileTree,
|
||||
public virtual ArchiveFileEntry
|
||||
{
|
||||
public:
|
||||
|
||||
using File = std::tuple<QStringList, bool, int>;
|
||||
|
||||
public: // Public for make_shared (but not accessible by other since not exposed in .h):
|
||||
public
|
||||
: // Public for make_shared (but not accessible by other since not exposed in .h):
|
||||
ArchiveFileTreeImpl(std::shared_ptr<const IFileTree> parent, QString name, int index,
|
||||
std::vector<File> files)
|
||||
: FileTreeEntry(parent, name), ArchiveFileEntry(parent, name, index), IFileTree(),
|
||||
m_Files(std::move(files))
|
||||
{}
|
||||
|
||||
ArchiveFileTreeImpl(std::shared_ptr<const IFileTree> parent, QString name, int index, std::vector<File> files)
|
||||
: FileTreeEntry(parent, name), ArchiveFileEntry(parent, name, index), IFileTree(), m_Files(std::move(files)) { }
|
||||
public: // Override to avoid VS warnings:
|
||||
virtual std::shared_ptr<IFileTree> astree() override { return IFileTree::astree(); }
|
||||
|
||||
public: // Override to avoid VS warnings:
|
||||
|
||||
virtual std::shared_ptr<IFileTree> astree() override {
|
||||
return IFileTree::astree();
|
||||
}
|
||||
|
||||
virtual std::shared_ptr<const IFileTree> astree() const override {
|
||||
virtual std::shared_ptr<const IFileTree> astree() const override
|
||||
{
|
||||
return IFileTree::astree();
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
virtual std::shared_ptr<FileTreeEntry> clone() const override {
|
||||
virtual std::shared_ptr<FileTreeEntry> clone() const override
|
||||
{
|
||||
return IFileTree::clone();
|
||||
}
|
||||
|
||||
public: // Overrides:
|
||||
|
||||
public: // Overrides:
|
||||
/**
|
||||
*
|
||||
*/
|
||||
static void mapToArchive(IFileTree const& tree, QString path, std::vector<FileData*> const& data)
|
||||
static void mapToArchive(IFileTree const& tree, QString path,
|
||||
std::vector<FileData*> const& data)
|
||||
{
|
||||
if (path.length() > 0) {
|
||||
// when using a long windows path (starting with \\?\) we apparently can have redundant
|
||||
// . components in the path. This wasn't a problem with "regular" path names.
|
||||
// when using a long windows path (starting with \\?\) we apparently can have
|
||||
// redundant . components in the path. This wasn't a problem with "regular" path
|
||||
// names.
|
||||
if (path == ".") {
|
||||
path.clear();
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
path.append("\\");
|
||||
}
|
||||
}
|
||||
|
||||
for (auto const& entry : tree) {
|
||||
if (entry->isDir()) {
|
||||
const ArchiveFileTreeImpl& archiveEntry = dynamic_cast<const ArchiveFileTreeImpl&>(*entry);
|
||||
const ArchiveFileTreeImpl& archiveEntry =
|
||||
dynamic_cast<const ArchiveFileTreeImpl&>(*entry);
|
||||
QString tmp = path + archiveEntry.name();
|
||||
if (archiveEntry.m_Index != -1) {
|
||||
data[archiveEntry.m_Index]->addOutputFilePath(tmp.toStdWString());
|
||||
}
|
||||
mapToArchive(*archiveEntry.astree(), tmp, data);
|
||||
}
|
||||
else {
|
||||
const ArchiveFileEntry& archiveFileEntry = dynamic_cast<const ArchiveFileEntry&>(*entry);
|
||||
} else {
|
||||
const ArchiveFileEntry& archiveFileEntry =
|
||||
dynamic_cast<const ArchiveFileEntry&>(*entry);
|
||||
if (archiveFileEntry.m_Index != -1) {
|
||||
data[archiveFileEntry.m_Index]->addOutputFilePath((path + archiveFileEntry.name()).toStdWString());
|
||||
data[archiveFileEntry.m_Index]->addOutputFilePath(
|
||||
(path + archiveFileEntry.name()).toStdWString());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -120,36 +124,42 @@ public: // Overrides:
|
||||
/**
|
||||
*
|
||||
*/
|
||||
void mapToArchive(Archive &archive) const override {
|
||||
void mapToArchive(Archive& archive) const override
|
||||
{
|
||||
mapToArchive(*this, "", archive.getFileList());
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
/**
|
||||
* Overriding makeDirectory and makeFile to create file tree or file entry with index -1.
|
||||
* Overriding makeDirectory and makeFile to create file tree or file entry with index
|
||||
* -1.
|
||||
*
|
||||
*/
|
||||
virtual std::shared_ptr<IFileTree> makeDirectory(
|
||||
std::shared_ptr<const IFileTree> parent, QString name) const override {
|
||||
virtual std::shared_ptr<IFileTree>
|
||||
makeDirectory(std::shared_ptr<const IFileTree> parent, QString name) const override
|
||||
{
|
||||
return std::make_shared<ArchiveFileTreeImpl>(parent, name, -1, std::vector<File>{});
|
||||
}
|
||||
|
||||
virtual std::shared_ptr<FileTreeEntry> makeFile(
|
||||
std::shared_ptr<const IFileTree> parent, QString name) const override {
|
||||
virtual std::shared_ptr<FileTreeEntry>
|
||||
makeFile(std::shared_ptr<const IFileTree> parent, QString name) const override
|
||||
{
|
||||
return std::make_shared<ArchiveFileEntry>(parent, name, -1);
|
||||
}
|
||||
|
||||
virtual bool doPopulate(std::shared_ptr<const IFileTree> parent, std::vector<std::shared_ptr<FileTreeEntry>>& entries) const override {
|
||||
virtual bool
|
||||
doPopulate(std::shared_ptr<const IFileTree> parent,
|
||||
std::vector<std::shared_ptr<FileTreeEntry>>& entries) const override
|
||||
{
|
||||
|
||||
// Sort by name:
|
||||
std::sort(std::begin(m_Files), std::end(m_Files),
|
||||
[](const auto& a, const auto& b) {
|
||||
return std::get<0>(a)[0].compare(std::get<0>(b)[0], Qt::CaseInsensitive) < 0; });
|
||||
std::sort(std::begin(m_Files), std::end(m_Files), [](const auto& a, const auto& b) {
|
||||
return std::get<0>(a)[0].compare(std::get<0>(b)[0], Qt::CaseInsensitive) < 0;
|
||||
});
|
||||
|
||||
// We know that the files are sorted:
|
||||
QString currentName = "";
|
||||
int currentIndex = -1;
|
||||
int currentIndex = -1;
|
||||
std::vector<File> currentFiles;
|
||||
for (auto& p : m_Files) {
|
||||
|
||||
@@ -162,11 +172,12 @@ protected:
|
||||
// accumulated:
|
||||
if (currentName != std::get<0>(p)[0]) {
|
||||
|
||||
// We may or may not have an index here, it depends on the type of archive (some archives list
|
||||
// intermediate non-empty folders, some don't):
|
||||
entries.push_back(std::make_shared<ArchiveFileTreeImpl>(parent, currentName, currentIndex, std::move(currentFiles)));
|
||||
// We may or may not have an index here, it depends on the type of archive (some
|
||||
// archives list intermediate non-empty folders, some don't):
|
||||
entries.push_back(std::make_shared<ArchiveFileTreeImpl>(
|
||||
parent, currentName, currentIndex, std::move(currentFiles)));
|
||||
|
||||
currentFiles.clear(); // Back to a valid state.
|
||||
currentFiles.clear(); // Back to a valid state.
|
||||
|
||||
// Reset the index:
|
||||
currentIndex = -1;
|
||||
@@ -181,36 +192,35 @@ protected:
|
||||
// If it is not a directory, then it is a file in directly under this tree:
|
||||
if (!std::get<1>(p)) {
|
||||
entries.push_back(
|
||||
std::make_shared<ArchiveFileEntry>(parent, currentName, std::get<2>(p)));
|
||||
std::make_shared<ArchiveFileEntry>(parent, currentName, std::get<2>(p)));
|
||||
currentName = "";
|
||||
}
|
||||
else {
|
||||
// Otherwize, it is the actual "file" corresponding to the directory we are listing, so we can retrieve
|
||||
// the index here:
|
||||
} else {
|
||||
// Otherwize, it is the actual "file" corresponding to the directory we are
|
||||
// listing, so we can retrieve the index here:
|
||||
currentIndex = std::get<2>(p);
|
||||
}
|
||||
}
|
||||
else {
|
||||
currentFiles.push_back({
|
||||
QStringList(std::get<0>(p).begin() + 1, std::get<0>(p).end()), std::get<1>(p), std::get<2>(p)
|
||||
});
|
||||
} else {
|
||||
currentFiles.push_back(
|
||||
{QStringList(std::get<0>(p).begin() + 1, std::get<0>(p).end()),
|
||||
std::get<1>(p), std::get<2>(p)});
|
||||
}
|
||||
}
|
||||
|
||||
if (currentName != "") {
|
||||
entries.push_back(std::make_shared<ArchiveFileTreeImpl>(parent, currentName, currentIndex, std::move(currentFiles)));
|
||||
entries.push_back(std::make_shared<ArchiveFileTreeImpl>(
|
||||
parent, currentName, currentIndex, std::move(currentFiles)));
|
||||
}
|
||||
|
||||
// Let the parent class sort the entries:
|
||||
return false;
|
||||
}
|
||||
|
||||
virtual std::shared_ptr<IFileTree> doClone() const override {
|
||||
virtual std::shared_ptr<IFileTree> doClone() const override
|
||||
{
|
||||
return std::make_shared<ArchiveFileTreeImpl>(nullptr, name(), m_Index, m_Files);
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
mutable std::vector<File> m_Files;
|
||||
};
|
||||
|
||||
@@ -224,15 +234,15 @@ std::shared_ptr<ArchiveFileTree> ArchiveFileTree::makeTree(Archive const& archiv
|
||||
for (size_t i = 0; i < data.size(); ++i) {
|
||||
// Ignore "." and ".." as they're useless and muck things up
|
||||
if (data[i]->getArchiveFilePath().compare(L".") == 0 ||
|
||||
data[i]->getArchiveFilePath().compare(L"..") == 0)
|
||||
{
|
||||
data[i]->getArchiveFilePath().compare(L"..") == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
files.push_back(std::make_tuple(
|
||||
QString::fromStdWString(data[i]->getArchiveFilePath()).replace("\\", "/").split("/", Qt::SkipEmptyParts),
|
||||
data[i]->isDirectory(),
|
||||
(int) i));
|
||||
files.push_back(
|
||||
std::make_tuple(QString::fromStdWString(data[i]->getArchiveFilePath())
|
||||
.replace("\\", "/")
|
||||
.split("/", Qt::SkipEmptyParts),
|
||||
data[i]->isDirectory(), (int)i));
|
||||
}
|
||||
|
||||
auto tree = std::make_shared<ArchiveFileTreeImpl>(nullptr, "", -1, std::move(files));
|
||||
@@ -240,15 +250,16 @@ std::shared_ptr<ArchiveFileTree> ArchiveFileTree::makeTree(Archive const& archiv
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Recursive function for the ArchiveFileTree::mapToArchive method. Need a template
|
||||
* here because iterators from a vector of entries are not exactly the same as the iterators
|
||||
* returned by a IFileTree.
|
||||
* @brief Recursive function for the ArchiveFileTree::mapToArchive method. Need a
|
||||
* template here because iterators from a vector of entries are not exactly the same as
|
||||
* the iterators returned by a IFileTree.
|
||||
*
|
||||
*/
|
||||
template <class It>
|
||||
void mapToArchive(std::vector<FileData*> const& data, It begin, It end) {
|
||||
void mapToArchive(std::vector<FileData*> const& data, It begin, It end)
|
||||
{
|
||||
for (auto it = begin; it != end; ++it) {
|
||||
auto entry = *it;
|
||||
auto entry = *it;
|
||||
auto* aentry = dynamic_cast<const ArchiveFileEntry*>(entry.get());
|
||||
|
||||
if (aentry->m_Index != -1) {
|
||||
@@ -262,6 +273,8 @@ void mapToArchive(std::vector<FileData*> const& data, It begin, It end) {
|
||||
}
|
||||
}
|
||||
|
||||
void ArchiveFileTree::mapToArchive(Archive &archive, std::vector<std::shared_ptr<const FileTreeEntry>> const& entries) {
|
||||
void ArchiveFileTree::mapToArchive(
|
||||
Archive& archive, std::vector<std::shared_ptr<const FileTreeEntry>> const& entries)
|
||||
{
|
||||
::mapToArchive(archive.getFileList(), entries.cbegin(), entries.cend());
|
||||
}
|
||||
|
||||
@@ -23,13 +23,12 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
|
||||
#include "archive.h"
|
||||
#include "ifiletree.h"
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class ArchiveFileTree: public virtual MOBase::IFileTree {
|
||||
class ArchiveFileTree : public virtual MOBase::IFileTree
|
||||
{
|
||||
public:
|
||||
|
||||
/**
|
||||
* @brief Create a new file tree representing the given archive.
|
||||
*
|
||||
@@ -48,7 +47,7 @@ public:
|
||||
* @param archive The archive to update. Must be the one used to
|
||||
* create the tree.
|
||||
*/
|
||||
virtual void mapToArchive(Archive &archive) const = 0;
|
||||
virtual void mapToArchive(Archive& archive) const = 0;
|
||||
|
||||
/**
|
||||
* @brief Update the given archive to prepare for the extraction
|
||||
@@ -61,12 +60,12 @@ public:
|
||||
* @param entries List of entries to mark for extraction. All the entries must
|
||||
* come from a tree created with the given archive.
|
||||
*/
|
||||
static void mapToArchive(Archive &archive, std::vector<std::shared_ptr<const FileTreeEntry>> const& entries);
|
||||
static void
|
||||
mapToArchive(Archive& archive,
|
||||
std::vector<std::shared_ptr<const FileTreeEntry>> const& entries);
|
||||
|
||||
protected:
|
||||
|
||||
using IFileTree::IFileTree;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user