mirror of
https://github.com/ModOrganizer2/modorganizer.git
synced 2026-07-27 13:58:24 -07:00
Compare commits
274
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ac8f6dbdec | ||
|
|
d2ab10ecff | ||
|
|
883f4d9894 | ||
|
|
d3e904e9ad | ||
|
|
e38592da97 | ||
|
|
268d2ffe8b | ||
|
|
9d3364f4da | ||
|
|
9ea5086c4c | ||
|
|
4c1155a6ab | ||
|
|
90365041f4 | ||
|
|
183b571560 | ||
|
|
0f1271dd99 | ||
|
|
dbdc2538f9 | ||
|
|
5a908442d6 | ||
|
|
328244692b | ||
|
|
f32b4c3ce1 | ||
|
|
83a896d0a9 | ||
|
|
209fe5cab5 | ||
|
|
cd68c9d53c | ||
|
|
65b64d111b | ||
|
|
73fa7045b6 | ||
|
|
a25d889e78 | ||
|
|
3680e37d39 | ||
|
|
abba182b1b | ||
|
|
ffb470a380 | ||
|
|
1403d51a82 | ||
|
|
89eabf3c4d | ||
|
|
26368df7a6 | ||
|
|
5f399f6a39 | ||
|
|
c909f8ce4f | ||
|
|
ce925bc73e | ||
|
|
927504cbd9 | ||
|
|
a44cb011a5 | ||
|
|
11e67d7a6c | ||
|
|
0b58653e2d | ||
|
|
e47e04dcf2 | ||
|
|
fd584f8038 | ||
|
|
942bd04e5e | ||
|
|
4b6e8ac51b | ||
|
|
8c2e88b9c9 | ||
|
|
ef39699d69 | ||
|
|
55eacfbd80 | ||
|
|
056acd03cd | ||
|
|
9eb1a303a7 | ||
|
|
a44c4bbdb2 | ||
|
|
8cca47454a | ||
|
|
a818688d3f | ||
|
|
feaad36168 | ||
|
|
a6f7480ab9 | ||
|
|
1ba140e0fa | ||
|
|
eed3664302 | ||
|
|
35eb41daf9 | ||
|
|
38eb03c306 | ||
|
|
6ff201385c | ||
|
|
0269fc36e6 | ||
|
|
fa5d3cdaf3 | ||
|
|
ab28c9631a | ||
|
|
04b6f2e475 | ||
|
|
0d5197a3c8 | ||
|
|
8eb63a068c | ||
|
|
4d4a7713fb | ||
|
|
4161696527 | ||
|
|
73eea93abb | ||
|
|
db7c6e6006 | ||
|
|
266a696429 | ||
|
|
ea520baf4e | ||
|
|
07b8896f92 | ||
|
|
4a2e4652f4 | ||
|
|
a9e1d44a2a | ||
|
|
b210a2f083 | ||
|
|
cbbc2d191d | ||
|
|
cad7ed47be | ||
|
|
a9cec9e5e2 | ||
|
|
771dde7771 | ||
|
|
c6758e47c8 | ||
|
|
4a99cfe6ad | ||
|
|
f134c7ab4c | ||
|
|
03b029c613 | ||
|
|
a1c8e529f7 | ||
|
|
39dd67f22f | ||
|
|
de79d15980 | ||
|
|
16beb6f9b1 | ||
|
|
a00a9a5bba | ||
|
|
4b1059f5a1 | ||
|
|
2628dd3fb8 | ||
|
|
2d20185e77 | ||
|
|
7a1ae9b0f1 | ||
|
|
d45ebf1348 | ||
|
|
db2954e8eb | ||
|
|
8c0756bd9d | ||
|
|
026b97835e | ||
|
|
97d6f7ce01 | ||
|
|
d80cdf726e | ||
|
|
9c8f0a2041 | ||
|
|
1b16897228 | ||
|
|
4bd5df5ab4 | ||
|
|
d08e0ebab0 | ||
|
|
6479f972dc | ||
|
|
e01ab940b0 | ||
|
|
e9c937f909 | ||
|
|
d87661a66f | ||
|
|
3c030a28e9 | ||
|
|
6b4cb9ff4c | ||
|
|
cbe84327c6 | ||
|
|
ce228e512c | ||
|
|
1579e4dcb0 | ||
|
|
671d96383b | ||
|
|
bdfd41a862 | ||
|
|
8aa6dc4c7d | ||
|
|
c3a95bdef1 | ||
|
|
f756aede08 | ||
|
|
855e8bd737 | ||
|
|
b0fe23a711 | ||
|
|
c2edbcf90f | ||
|
|
2400e2c99e | ||
|
|
af1e3d0187 | ||
|
|
9ab9c072fc | ||
|
|
30c016567f | ||
|
|
da27ec45da | ||
|
|
1321564a92 | ||
|
|
4d9795527d | ||
|
|
9f09c30e08 | ||
|
|
caf31e72cc | ||
|
|
f2ab6825bf | ||
|
|
25348238b2 | ||
|
|
8b3a42bd17 | ||
|
|
6f1162c23f | ||
|
|
2b21463514 | ||
|
|
d20a26e0eb | ||
|
|
9edc39633b | ||
|
|
b415db619e | ||
|
|
bd8267993d | ||
|
|
f5c56efeb3 | ||
|
|
a16e25380f | ||
|
|
459816ab71 | ||
|
|
9b5c238938 | ||
|
|
e7b6a7cbdd | ||
|
|
ab925e1e7c | ||
|
|
7bfb48d6ab | ||
|
|
88817c7f3b | ||
|
|
ee0041ba18 | ||
|
|
306ba78b0f | ||
|
|
e33406b4b5 | ||
|
|
a5906f1044 | ||
|
|
ebfeb2fbf9 | ||
|
|
f666e3d835 | ||
|
|
003cb6dec5 | ||
|
|
7fb7207ac7 | ||
|
|
64eced4614 | ||
|
|
8634b97bea | ||
|
|
116a36b943 | ||
|
|
479fdb3dcd | ||
|
|
acf35da699 | ||
|
|
6eb05396e4 | ||
|
|
9fcf34fec7 | ||
|
|
6c1e63258c | ||
|
|
226993eece | ||
|
|
b2d04d70fc | ||
|
|
99de80e722 | ||
|
|
78f628e0af | ||
|
|
78da5fc37f | ||
|
|
ffef339e2b | ||
|
|
4fa700bb55 | ||
|
|
45a46778fb | ||
|
|
cfb863f6c3 | ||
|
|
f2f9e11fdd | ||
|
|
9907437d93 | ||
|
|
d23466f036 | ||
|
|
3b7a468f73 | ||
|
|
53896e66f1 | ||
|
|
efc77930ad | ||
|
|
01265e9b03 | ||
|
|
9494938534 | ||
|
|
0b14949d0e | ||
|
|
2237d7c103 | ||
|
|
7c1273b246 | ||
|
|
9ab7bada1c | ||
|
|
1eea3bd90e | ||
|
|
10cc566081 | ||
|
|
53d1f3e00e | ||
|
|
20db939501 | ||
|
|
df0bd3331a | ||
|
|
db0e278817 | ||
|
|
bfa6c9ab1e | ||
|
|
7a7c464b18 | ||
|
|
2ce135e0bf | ||
|
|
93bd29c13d | ||
|
|
a62ecc5bf1 | ||
|
|
637ce6bcc1 | ||
|
|
5f1022917b | ||
|
|
d3d7e30286 | ||
|
|
b77dcb2206 | ||
|
|
7d27138086 | ||
|
|
430048d201 | ||
|
|
19cb2d4076 | ||
|
|
4c42a6fbf1 | ||
|
|
5aa5c90d39 | ||
|
|
243b59c64c | ||
|
|
12a57d7f6d | ||
|
|
b0a4748da5 | ||
|
|
482f13a50b | ||
|
|
9daeb9479b | ||
|
|
f481a7aae3 | ||
|
|
15b9927cef | ||
|
|
cc42e76f54 | ||
|
|
07bae15d7c | ||
|
|
84598cbcbf | ||
|
|
778160cf0d | ||
|
|
02973be652 | ||
|
|
14106436ca | ||
|
|
fc2591e028 | ||
|
|
4f509e365e | ||
|
|
9a97098cc3 | ||
|
|
4ebc8dc014 | ||
|
|
4b1e6683d2 | ||
|
|
5d3c1f34f4 | ||
|
|
06701856f8 | ||
|
|
5d4a55c3a6 | ||
|
|
844ba99892 | ||
|
|
470b6ed0bf | ||
|
|
715623e790 | ||
|
|
0050cb0740 | ||
|
|
9879aae575 | ||
|
|
f6ef5477e7 | ||
|
|
cc9827cdda | ||
|
|
e24f3fef77 | ||
|
|
4e5a67fc06 | ||
|
|
0a152ceadf | ||
|
|
5718af3510 | ||
|
|
434b6be69d | ||
|
|
67b0268e70 | ||
|
|
d412060d59 | ||
|
|
84c66727bf | ||
|
|
bfb3385e49 | ||
|
|
f59f52501c | ||
|
|
9b67e338e1 | ||
|
|
7944bacfd9 | ||
|
|
1b4c07eb20 | ||
|
|
d93df95dcf | ||
|
|
46a32ff3b7 | ||
|
|
0046d8710e | ||
|
|
2b5748003d | ||
|
|
a49ed5c33c | ||
|
|
62b0c07a93 | ||
|
|
05c58c8b3d | ||
|
|
9b33e0a970 | ||
|
|
b1ac479fb6 | ||
|
|
80b10107d9 | ||
|
|
1707941f6e | ||
|
|
d0b75e8b25 | ||
|
|
4fc441b249 | ||
|
|
581d065d7a | ||
|
|
5d2b5202af | ||
|
|
8044ef4f1d | ||
|
|
3d98491ebc | ||
|
|
923654961b | ||
|
|
76c861ed12 | ||
|
|
31cab54861 | ||
|
|
2a16cc4262 | ||
|
|
a5b6556d67 | ||
|
|
af89733121 | ||
|
|
baf1240be7 | ||
|
|
6e4626852c | ||
|
|
e8f56d65d2 | ||
|
|
5e7c875b29 | ||
|
|
b2a7c7c223 | ||
|
|
7b4582c1b1 | ||
|
|
5d7b23acef | ||
|
|
3628ec930b | ||
|
|
e22aeca3ff | ||
|
|
cbd6b288eb | ||
|
|
484749e612 | ||
|
|
5b3cdaa83b | ||
|
|
6d3f88b330 |
@@ -1,4 +1,6 @@
|
||||
syntax: glob
|
||||
scons_configure.py
|
||||
scons-ModOrganizer-*
|
||||
ModOrganizer-build-desktop*
|
||||
outputd/*
|
||||
output/*
|
||||
@@ -18,5 +20,27 @@ staging_prepare/*
|
||||
staging_trans/*
|
||||
tools/python_zip/*
|
||||
Makefile
|
||||
html
|
||||
*.vcxproj
|
||||
*.pdb
|
||||
*.dll
|
||||
*.exp
|
||||
*.tlog
|
||||
*.user
|
||||
*.obj
|
||||
*.suo
|
||||
*.sln
|
||||
*.log
|
||||
*.filters
|
||||
*.lib
|
||||
source/organizer/resources/contents/icons
|
||||
source/plugins/build-*
|
||||
*/GeneratedFiles/*
|
||||
translations/*
|
||||
source/LocalPaths.pri
|
||||
source/*/Win32/Debug/*
|
||||
source/plugins/*/Win32/Debug/*
|
||||
*~
|
||||
syntax: regexp
|
||||
Makefile\.(Debug|Release)
|
||||
source/.*/debug/.*
|
||||
|
||||
+94
-35
@@ -10,7 +10,7 @@ Please note that if you only want to work on and build a plugin you can save you
|
||||
Overview:
|
||||
---------
|
||||
|
||||
As of December 2013 MO consists of the following subprojects:
|
||||
As of July 2014 MO consists of the following subprojects:
|
||||
- organizer: The main userinterface. heavy usage of various libraries
|
||||
- hookdll: core library of the virtual file system
|
||||
- uibase: interop between plugins and the main application as well as some reusable functionality
|
||||
@@ -23,14 +23,15 @@ As of December 2013 MO consists of the following subprojects:
|
||||
- archive: small wrapper library around 7zip for dealing with mod archives. Requires 7zip
|
||||
- NCC: extension to NMM to provide a binary with command line interface for fomod installation. This is c# code and does not build with the rest of the project. Requires the rest of NMM
|
||||
- bossdummy: dummy dll that looks like the boss.dll. This is used instead of the real boss dlls in NCC to save some disk space
|
||||
- pythonrunner: library for embedding python code. Requires boost_python, python 2.7 and pyqt4
|
||||
- pythonrunner: library for embedding python code. Requires boost_python, python 2.7 and pyqt5
|
||||
- loot_cli: this is a command line client of loot. This can be better integrated with MO than the official loot client.
|
||||
|
||||
And various plugins:
|
||||
- bsaExtractor: offers to extract bsas after a mod has been installed
|
||||
- checkFNIS: Activates each time an application is started from MO and runs fnis if necessary
|
||||
- diagnoseBasic: Various diagnostic checks on the game
|
||||
- inieditor: minimalistic file editor for ini files
|
||||
- installerBain: handles non-scripted bain installers
|
||||
- installerBCF: no functionality. Supposed to eventually allow installations using bcfs (bain conversion file). python code
|
||||
- installerBundle: handles installation of archives wrapped in archives
|
||||
- installerFomod: handles installation of xml fomods
|
||||
- installerManual: handles installations of archives that aren't supported by any other plugin (or if the user chooses to do the installation manually)
|
||||
@@ -39,25 +40,30 @@ And various plugins:
|
||||
- NMMImport: importer from existing nmm installation
|
||||
- proxyPython: integrates pythonrunner as a plugin into MO
|
||||
- pyniEdit: more user-friendly ini editor. python code
|
||||
- previewBase: used for file previews. this plugin covers image formats supported by the qt installation (usually at least jpg, gif, png) and text files
|
||||
- previewDDS: used to preview dds textures. uses code from the nif file format library
|
||||
|
||||
There are a few more plugins that are either broken or samples
|
||||
- installerBCF: this was intended to use .bcf (bain conversion file) files as installation instructions but currently it is completely function-less
|
||||
- helloWorldCpp: sample for cpp plugins. This should compile even without fulfilling most dependencies below
|
||||
- pageTESAlliance: integrates the tes alliance page into MO. This integration is not nearly as tight as that of nexus.
|
||||
|
||||
Requirements:
|
||||
-------------
|
||||
|
||||
Visual C++ compiler 2010 (VC 10.0) or up
|
||||
- Included in visual c++ express 2010 or windows sdk 7.x
|
||||
Visual C++ compiler 2013 (VC 12.0) or up
|
||||
- Included in visual c++ express 2013
|
||||
- Do install windows sdk too if only for the cdb debugger which is included in that package
|
||||
Note: If you're having trouble installing the windows sdk, you may be affected by this bug: http://support.microsoft.com/kb/2717426
|
||||
|
||||
Qt Libraries 4.8.x (http://qt-project.org/downloads)
|
||||
- i.e. "Qt libraries 4.8.5 for Windows (VS 2010, 235 MB)"
|
||||
- tested: 4.8.5
|
||||
- Qt5 is not yet supported but WIP. You will see a few conditional qt5 pathes
|
||||
Qt Libraries 5.4.x (http://www.qt.io/download-open-source/#section-2)
|
||||
- i.e. "Qt libraries 5.4.0 for Windows (VS 2013, 722 MB)"
|
||||
- tested: 5.4.0 for Windows 32-bit (VS 2013, OpenGL, 695 MB)
|
||||
- Install according to instruction
|
||||
|
||||
boost libraries (http://www.boost.org/)
|
||||
- tested: 1.49
|
||||
- Build according to their instructions (using vc++): http://www.boost.org/doc/libs/1_54_0/more/getting_started/windows.html
|
||||
- tested: 1.56
|
||||
- Build according to their instructions (using vc++): http://www.boost.org/doc/libs/1_57_0/more/getting_started/windows.html
|
||||
- A few of the boost libraries need to be built (the rest is header-only). The only compiled libs MO needs (at the time of writing) are
|
||||
boost_thread (for everything that links agains bsatk) and boost_python (for pythonrunner). You can disable the others to save yourself compile time (even on a modern system compiling boost can easily take an hour)
|
||||
|
||||
@@ -73,26 +79,27 @@ zlib (http://www.zlib.net/)
|
||||
Python 2.7 (32-bit)
|
||||
- only for pythonrunner
|
||||
|
||||
PyQt4 for Python 2.7
|
||||
- tested: 4.10
|
||||
PyQt5 for Python 2.7 (http://www.riverbankcomputing.co.uk/software/pyqt/download)
|
||||
- tested: PyQt-gpl-5.4.zip
|
||||
- only for pythonrunner
|
||||
|
||||
SIP (http://www.riverbankcomputing.com/software/sip/download)
|
||||
- presumably only for pythonrunner as it's needed for PyQT5
|
||||
|
||||
Recommended:
|
||||
------------
|
||||
|
||||
Qt Creator
|
||||
- http://qt-project.org/downloads#qt-creator
|
||||
- I.e. "Qt Creator 2.8.1 for Windows (53 MB)"
|
||||
- included in Qt SDK
|
||||
- With Qt Creator usually the rule is "the newer the better"
|
||||
- Start Qt Creator and check if things are set up correctly:
|
||||
1) Go to Tools > Options > Build & Run > Qt Versions
|
||||
2.1) If the QtSDK 4.8.x you installed earlier is not auto-detected, click "Add" to add it manually
|
||||
2.2) Navigate to your <your qt4 installation>\bin\qmake.exe
|
||||
2.1) If the QtSDK 5.4.x you installed earlier is not auto-detected, click "Add" to add it manually
|
||||
2.2) Navigate to your <your qt5 installation>\bin\qmake.exe
|
||||
2.3) Restart qt creator
|
||||
3) Go to Tools > Options > Build & Run > Kits
|
||||
3.1) If no Kit is auto-detected (or the auto-detected ones have picked up the wrong qt or vc++ installation) click "Add"
|
||||
3.2) Enter a Name (i.e. "Qt 4.8.5 MSVC2010 32bit")
|
||||
3.2) Enter a Name (i.e. "Qt 5.4 MSVC2013 32bit")
|
||||
3.3) In Compiler select the visual studio compiler installed earlier (may show up as "Microsoft Windows SDK for Windows x). Make sure you select the x86 variant
|
||||
3.4) CDB should be auto-detected
|
||||
3.5) Select the qt version set up earlier
|
||||
@@ -101,25 +108,26 @@ Qt Creator
|
||||
Set up (using Qt Creator):
|
||||
--------------------------
|
||||
|
||||
1. Using Qt Creator open source/ModOrganizer.pro from your working copy
|
||||
2. Open the "Projects" tab, open the "Details" for "Build Environment"
|
||||
3a. Click "Add" to add a variable called "BOOSTPATH" with the path of your boost installation as the value (i.e. C:\code\boost_1_49_0)
|
||||
3b. Click "Add" to add a variable called "ZLIBPATH" with the path of your zlib installation as the value (i.e. C:\code\zlib-1.2.7)
|
||||
3c. Click "Add" to add a variable called "7ZIPPATH" with the path of your zlib installation as the value (i.e. C:\code\7zip)
|
||||
3d. Click "Add" to add a variable called "PYTHONPATH" with the path of your zlib installation as the value (i.e. C:\code\python)
|
||||
4. Switch the build configuration at the very top of the same page from "debug" to "release" (or vice versa) and repeat step 3
|
||||
5. Compile the configuration(s) you want to use (debug and/or release) (Build All). This should compile correctly.
|
||||
6. <reserved for future use. Maybe grab a coffee?>
|
||||
7. return to the "projects" tab and switch to "Run Settings"
|
||||
8. Determine the folder of the qt binaries in the package you downloaded. This could be "QtSDK\Desktop\Qt\4.8.5\msvc2010\bin" or "Qt4.8.5\bin"
|
||||
1. Create a file called "LocalPaths.pri" in your ModOrganizer\source directory
|
||||
2. Open that file with any text editor and enter (one entry per line)
|
||||
2a. BOOSTPATH=<path to your boost installation> (i.e. C:\code\boost_1_56_0)
|
||||
2b. LOOTPATH=C:/Users/Tannin/Documents/Projects/loot_api
|
||||
2c. PYTHONPATH=D:/Python278
|
||||
2d. SEVENZIPPATH=D:/Documents/Projects/7zip
|
||||
2e. ZLIBPATH=D:/Documents/Projects/zlib-1.2.7
|
||||
3. Using Qt Creator open source/ModOrganizer.pro from your working copy
|
||||
4. Compile the configuration(s) you want to use (debug and/or release) (Build All). This should compile correctly (though right now it produces a lot of warnings in boost headers).
|
||||
5. <reserved for future use. Maybe grab a coffee?>
|
||||
6. return to the "projects" tab and switch to "Run Settings"
|
||||
7. Determine the folder of the qt binaries in the package you downloaded. This could be "QtSDK\Desktop\Qt\5.4.0\msvc2013\bin" or "Qt5.4.0\bin"
|
||||
For Release build:
|
||||
9r. Add a "Run configuration" that points to <your working copy>\output\ModOrganizer.exe
|
||||
10r. Copy "7z.dll" to <your working copy>\output\dlls
|
||||
11r. From the qt binaries directory, copy the following files to <your working copy>\output\dlls: QtCore4.dll, QtDeclarative4.dll, QtGui4.dll, QtNetwork4.dll, QtScript4.dll, QtSql4.dll, QtWebkit4.dll, QtXml4.dll, QtXmlPatterns4.dll
|
||||
8r. Add a "Run configuration" that points to <your working copy>\output\ModOrganizer.exe
|
||||
9r. Copy "7z.dll" to <your working copy>\output\dlls
|
||||
10r. From the qt binaries directory, copy the following files to <your working copy>\output\dlls: Qt5Core.dll, Qt5Declarative.dll, Qt5Gui.dll, Qt5Network.dll, Qt5Script.dll, Qt5Sql.dll, Qt5Webkit.dll, Qt5Xml.dll, Qt5XmlPatterns.dll
|
||||
For Debug build:
|
||||
9d. Add a "Run configuration" that points to <your working copy>\outputd\ModOrganizer.exe
|
||||
10d. Copy "7z.dll" to <your working copy>\outputd\dlls
|
||||
11d. From the qt binaries copy the following files to <your working copy>\outputd\dlls: QtCored4.dll, QtDeclaratived4.dll, QtGuid4.dll, QtNetworkd4.dll, QtScriptd4.dll, QtSqld4.dll, QtWebkitd4.dll, QtXmld4.dll, QtXmlPatternsd4.dll
|
||||
8d. Add a "Run configuration" that points to <your working copy>\outputd\ModOrganizer.exe
|
||||
9d. Copy "7z.dll" to <your working copy>\outputd\dlls
|
||||
10d. From the qt binaries copy the following files to <your working copy>\outputd\dlls: Qt5Cored.dll, Qt5Declaratived.dll, Qt5Guid.dll, Qt5Networkd.dll, Qt5Scriptd.dll, Qt5Sqld.dll, Qt5Webkitd.dll, Qt5Xmld.dll, Qt5XmlPatternsd.dll
|
||||
|
||||
Now you should be able to compile and run Mod Organizer.
|
||||
Please note that when you change anything apart from the "organizer" subproject, qt creator may not pick up on the changes
|
||||
@@ -157,6 +165,8 @@ Troubleshooting (thanks to Ross):
|
||||
./bsatk/bsatk.pro
|
||||
./hookdll/hookdll.pro
|
||||
|
||||
Please note if building this, you need to switch OFF -DZLIB_WINAPI ...
|
||||
|
||||
2) After building, I try to open {MOPROJECTPATH}\outputd\ModOragnizer.exe and get this error
|
||||
"The program can't start because QtDeclaratived4.dll is missing from your computer. Try reinstalling the program to fix this problem."
|
||||
|
||||
@@ -212,3 +222,52 @@ Troubleshooting (thanks to Ross):
|
||||
Unlocker: http://www.filehippo.com/download_unlocker/ or http://www.emptyloop.com/unlocker/
|
||||
Warning: With Unlocker v1.9.2, you must select "Advanced" then uncheck everything to
|
||||
avoid having some Delta toolbar garbage installed...
|
||||
|
||||
5) Problem TT has seen:
|
||||
Complains about 'qtwebkit4' missing. For some reason this seems to insist on
|
||||
living with modorganiser.exe
|
||||
|
||||
6) Debugging the python proxy: I (TT) don't think this is possible unless you have a debug
|
||||
build of PyQt. However, a debug build of PyQt requires a debug build of python. There doesn't
|
||||
appear to be a half way house which is build wiht normal python but debug versions of QT libraries.
|
||||
You can confuse pyqt by copying the debug QT DLLs to appropriate named files in the DLLs
|
||||
directory, and removing QT from your project run path, which results in the python proxy
|
||||
initialising succesfully, but causes mod organiser to crash in strange places.
|
||||
|
||||
-------------------
|
||||
Building with scons
|
||||
-------------------
|
||||
|
||||
1) Download scons from www.scons.org and install
|
||||
2) Download QT4 (and/or QT5) from https://bitbucket.org/dirkbaechle/scons_qt4 and
|
||||
https://bitbucket.org/dirkbaechle/scons_qt5. Install as per instructions
|
||||
3) Copy scons_configure_template.py to scons_configure.py. Edit to point to your
|
||||
boost/python/zlib/7zip/loot directories as appropriate.
|
||||
4) Create build kits as follows:
|
||||
Custom Process step:
|
||||
Command: <python path>\Scripts\scons.bat
|
||||
Arguments: -u .
|
||||
Working directory: %{sourcedir}
|
||||
|
||||
Clean Custom Process step:
|
||||
Command: <python path>\Scripts\scons.bat
|
||||
Arguments: -c -u .
|
||||
Working directory: %{sourcedir}
|
||||
|
||||
For the release build, add 'CONFIG=release' to the arguments.
|
||||
|
||||
If you want to do parallel builds, add -j and a number to the arguments.
|
||||
However you may need to install pywin32 (but it seems to work OK for me).
|
||||
-j 4 did the entire build in 2m 15s. scons uses -Z7 to store debugging
|
||||
information in the .obj files which removes the issues with multiple
|
||||
processes attempting to access one datafile.
|
||||
|
||||
Note. If you want to build a sub project separately, it seems to be better
|
||||
to open the subproject, set that up with the scons kit and build that as a
|
||||
project.
|
||||
|
||||
Please note: the generated (runnable) output files end up in the build directory,
|
||||
in the '_ModOrganizer' subdirectory (not at the top level). Named like that
|
||||
so you can see it! The scons build will also populate the directory with
|
||||
all the necessary DLLs (but see note 6 above about your build tool path if
|
||||
trying to debug).
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
# This python script contains the configuration for scons
|
||||
# Copy this to scons_configure.py and adjust to taste.
|
||||
|
||||
# Path to your boost install - it should have a boost/ subdirectory and a stage/
|
||||
# subdirectory. The scons script will use stage/lib if there, or the appropriate
|
||||
# version for your compiler, if you installed the multiple-build version
|
||||
BOOSTPATH = 'C:\\Apps\\boost_1_55_0'
|
||||
|
||||
# Version of Visual Studio to use, if you wish to use a specific version. If you
|
||||
# don't specify a version, the latest will be picked.. See the scons manual for
|
||||
# supported values.
|
||||
#MSVC_VERSION = '10.0Exp'
|
||||
|
||||
# Path to your python install
|
||||
# You don't really need to set this up but you might if (say) you have a 32- and
|
||||
# 64-bit python install and scons has been installed for the 64 bit version
|
||||
#PYTHONPATH=C:\Apps\Python
|
||||
|
||||
# Path to your QT install. This might constrain the version of MSVC you can use.
|
||||
# This seems to be set by QTCreator
|
||||
#QTDIR = 'C:\\Apps\\Qt\\4.8.6'
|
||||
|
||||
# Path to 7-zip sources
|
||||
SEVENZIPPATH = 'C:\\Apps\\7-Zip\\7z920'
|
||||
|
||||
# Path to zlib. Please read the README file for more information about how this
|
||||
# needs to be set up
|
||||
ZLIBPATH = 'C:\\Apps\\zlib-1.2.8'
|
||||
+1566
-1059
File diff suppressed because it is too large
Load Diff
+37
-8
@@ -1,6 +1,5 @@
|
||||
TEMPLATE = subdirs
|
||||
|
||||
|
||||
SUBDIRS = bsatk \
|
||||
shared \
|
||||
uibase \
|
||||
@@ -9,19 +8,49 @@ SUBDIRS = bsatk \
|
||||
archive \
|
||||
helper \
|
||||
plugins \
|
||||
proxydll \
|
||||
nxmhandler \
|
||||
BossDummy \
|
||||
pythonRunner \
|
||||
esptk \
|
||||
loot_cli
|
||||
loot_cli \
|
||||
esptk
|
||||
|
||||
plugins.depends = pythonRunner
|
||||
pythonRunner.depends = uibase
|
||||
plugins.depends = pythonRunner uibase
|
||||
hookdll.depends = shared
|
||||
organizer.depends = shared uibase plugins loot_cli
|
||||
organizer.depends = shared uibase plugins
|
||||
|
||||
CONFIG(debug, debug|release) {
|
||||
DESTDIR = outputd
|
||||
DESTDIR = $$PWD/../outputd
|
||||
} else {
|
||||
DESTDIR = output
|
||||
DESTDIR = $$PWD/../output
|
||||
}
|
||||
|
||||
STATICDATAPATH = $${DESTDIR}\\..\\tools\\static_data\\dlls
|
||||
DLLSPATH = $${DESTDIR}\\dlls
|
||||
|
||||
otherlibs.path = $$DLLSPATH
|
||||
otherlibs.files += $${STATICDATAPATH}\\7z.dll \
|
||||
$${BOOSTPATH}\\stage\\lib\\boost_python-vc*-mt-1*.dll
|
||||
|
||||
qtlibs.path = $$DLLSPATH
|
||||
|
||||
greaterThan(QT_MAJOR_VERSION, 4) {
|
||||
QTLIBNAMES += Core Gui Network OpenGL Script Sql Svg Qml Quick Webkit Widgets Xml XmlPatterns
|
||||
} else {
|
||||
QTLIBNAMES += Core Declarative Gui Network OpenGL Script Sql Svg Webkit Xml XmlPatterns
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
for(QTNAME, QTLIBNAMES) {
|
||||
QTFILE = Qt$${QTNAME}
|
||||
qtlibs.files += $$[QT_INSTALL_BINS]\\$${QTFILE}$${QTLIBSUFFIX}
|
||||
}
|
||||
|
||||
INSTALLS += qtlibs otherlibs
|
||||
|
||||
OTHER_FILES +=\
|
||||
../SConstruct\
|
||||
../scons_configure.py\
|
||||
SConscript
|
||||
|
||||
+127
@@ -0,0 +1,127 @@
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
Import('qt_env')
|
||||
|
||||
env = qt_env.Clone()
|
||||
|
||||
modules = [
|
||||
'Core',
|
||||
'Gui',
|
||||
'Network',
|
||||
'Script',
|
||||
'Sql',
|
||||
'WebKit',
|
||||
'Xml',
|
||||
'XmlPatterns',
|
||||
'Declarative'
|
||||
]
|
||||
|
||||
if env['QT_MAJOR_VERSION'] > 4:
|
||||
modules += [
|
||||
'Widgets',
|
||||
'Qml',
|
||||
'WebKitWidgets'
|
||||
]
|
||||
|
||||
env.EnableQtModules(*modules)
|
||||
|
||||
env.Uic(env.Glob('*.ui'))
|
||||
|
||||
env.RequireLibraries('uibase', 'shared', 'bsatk', 'esptk')
|
||||
|
||||
|
||||
env.AppendUnique(LIBS = [
|
||||
'shell32',
|
||||
'user32',
|
||||
'ole32',
|
||||
'advapi32',
|
||||
'gdi32',
|
||||
'shlwapi',
|
||||
'Psapi',
|
||||
'Version'
|
||||
])
|
||||
|
||||
# We have to 'persuade' moc to generate certain other targets and inject them
|
||||
# into the list of cpps
|
||||
other_sources = env.AddExtraMoc(env.Glob('*.h'))
|
||||
|
||||
for file in env.Glob('*.rc'):
|
||||
# version.rc is included in app_icon.rc. Not sure why it's a separate file.
|
||||
if file.name == 'version.rc':
|
||||
continue
|
||||
other_sources.append(env.RES(file))
|
||||
|
||||
# Note the order of this is important, or you can pick up the wrong report.h...
|
||||
# Doing appendunique seems to throw the moc code into a tizzy
|
||||
env['CPPPATH'] += [
|
||||
'../archive',
|
||||
# '../boss_modified/boss-api',
|
||||
'../plugins/gamefeatures',
|
||||
'.', # Why is this necessary?
|
||||
'${LOOTPATH}',
|
||||
'${BOOSTPATH}',
|
||||
]
|
||||
|
||||
env.AppendUnique(CPPDEFINES = [
|
||||
'_UNICODE',
|
||||
'_CRT_SECURE_NO_WARNINGS',
|
||||
'_SCL_SECURE_NO_WARNINGS',
|
||||
'BOOST_DISABLE_ASSERTS',
|
||||
'NDEBUG',
|
||||
'QT_MESSAGELOGCONTEXT'
|
||||
])
|
||||
|
||||
env.AppendUnique(CPPFLAGS = [ '-wd4100', '-wd4127', '-wd4512', '-wd4189' ])
|
||||
|
||||
env.AppendUnique(LINKFLAGS = [
|
||||
'/SUBSYSTEM:WINDOWS',
|
||||
'${EXE_MANIFEST_DEPENDENCY}'
|
||||
])
|
||||
|
||||
# modeltest is optional and it doesn't compile anyway...
|
||||
cpp_files = [
|
||||
x for x in Glob('*.cpp')
|
||||
if x.name != 'modeltest.cpp' and x.name != 'aboutdialog.cpp'
|
||||
]
|
||||
|
||||
about_env = env.Clone()
|
||||
try:
|
||||
hgid = subprocess.check_output(['hg', 'id', '-i']).rstrip()
|
||||
except:
|
||||
hgid = 'Unknown version'
|
||||
|
||||
# FIXME: It'd be much easier to stringify this in the source code
|
||||
about_env.AppendUnique(CPPDEFINES = [ 'HGID=\\"%s\\"' % hgid ])
|
||||
other_sources.append(about_env.StaticObject('aboutdialog.cpp'))
|
||||
|
||||
env.AppendUnique(LIBPATH = "${ZLIBPATH}/build")
|
||||
env.AppendUnique(LIBS = 'zlibstatic')
|
||||
|
||||
prog = env.Program('ModOrganizer',
|
||||
cpp_files + env.Glob('*.qrc') + other_sources)
|
||||
|
||||
env.InstallModule(prog)
|
||||
|
||||
for subdir in ('tutorials', 'stylesheets'):
|
||||
env.Install(os.path.join(env['INSTALL_PATH'], subdir),
|
||||
env.Glob(os.path.join(subdir, '*')))
|
||||
|
||||
# FIXME Sort the translations. Except they don't exist on the 1.2 branch
|
||||
|
||||
res = env['QT_USED_MODULES']
|
||||
Return('res')
|
||||
|
||||
"""
|
||||
CONFIG(debug, debug|release) {
|
||||
} else {
|
||||
QMAKE_CXXFLAGS += /Zi /GL
|
||||
QMAKE_LFLAGS += /DEBUG /LTCG /OPT:REF /OPT:ICF
|
||||
}
|
||||
|
||||
TRANSLATIONS = organizer_en.ts
|
||||
|
||||
|
||||
QMAKE_POST_LINK += xcopy /y /s /I $$quote($$BASEDIR\\*.qm) $$quote($$DSTDIR)\\translations $$escape_expand(\\n)
|
||||
|
||||
"""
|
||||
+6
-6
@@ -35,17 +35,17 @@ AboutDialog::AboutDialog(const QString &version, QWidget *parent)
|
||||
m_LicenseFiles[LICENSE_BOOST] = "boost.txt";
|
||||
m_LicenseFiles[LICENSE_CCBY3] = "by-sa3.txt";
|
||||
m_LicenseFiles[LICENSE_ZLIB] = "zlib.txt";
|
||||
m_LicenseFiles[LICENSE_APACHE2] = "apache-license-2.0.txt";
|
||||
|
||||
addLicense("Qt 4.8.5", LICENSE_LGPL3);
|
||||
addLicense("Qt 5.4", LICENSE_LGPL3);
|
||||
addLicense("Qt Json", LICENSE_GPL3);
|
||||
addLicense("Boost Library", LICENSE_BOOST);
|
||||
addLicense("Tango Icon Theme", LICENSE_NONE);
|
||||
addLicense("RRZE Icon Set", LICENSE_CCBY3);
|
||||
addLicense("7-zip", LICENSE_LGPL3);
|
||||
addLicense("ZLib", LICENSE_ZLIB);
|
||||
addLicense("NIF File Format Library", LICENSE_BSD3);
|
||||
addLicense("BOSS (modified)", LICENSE_GPL3);
|
||||
addLicense("Alphanum Algorithm", LICENSE_ZLIB);
|
||||
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_APACHE2);
|
||||
|
||||
ui->nameLabel->setText(QString("<span style=\"font-size:12pt; font-weight:600;\">%1 %2</span>").arg(ui->nameLabel->text()).arg(version));
|
||||
#ifdef HGID
|
||||
|
||||
+2
-1
@@ -48,7 +48,8 @@ private:
|
||||
LICENSE_BSD3,
|
||||
LICENSE_BOOST,
|
||||
LICENSE_CCBY3,
|
||||
LICENSE_ZLIB
|
||||
LICENSE_ZLIB,
|
||||
LICENSE_APACHE2
|
||||
};
|
||||
|
||||
private:
|
||||
|
||||
@@ -178,6 +178,11 @@
|
||||
<string notr="true">tokcdk (Russian)</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Ren (Korean)</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
@@ -214,6 +219,16 @@
|
||||
<string notr="true">Bridger</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>GamerPoet</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Gopher</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">GSDFan</string>
|
||||
|
||||
+97
-97
@@ -1,97 +1,97 @@
|
||||
/*
|
||||
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 <QLabel>
|
||||
|
||||
ActivateModsDialog::ActivateModsDialog(const std::map<QString, std::vector<QString> > &missingPlugins, QWidget *parent)
|
||||
: TutorableDialog("ActivateMods", parent), ui(new Ui::ActivateModsDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
QTableWidget *modsTable = findChild<QTableWidget*>("modsTable");
|
||||
QHeaderView *headerView = modsTable->horizontalHeader();
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
|
||||
headerView->setSectionResizeMode(0, QHeaderView::Stretch);
|
||||
headerView->setSectionResizeMode(1, QHeaderView::Interactive);
|
||||
#else
|
||||
headerView->setResizeMode(0, QHeaderView::Stretch);
|
||||
headerView->setResizeMode(1, QHeaderView::Interactive);
|
||||
#endif
|
||||
|
||||
int row = 0;
|
||||
|
||||
modsTable->setRowCount(missingPlugins.size());
|
||||
|
||||
for (std::map<QString, std::vector<QString> >::const_iterator espIter = missingPlugins.begin();
|
||||
espIter != missingPlugins.end(); ++espIter, ++row) {
|
||||
modsTable->setCellWidget(row, 0, new QLabel(espIter->first));
|
||||
if (espIter->second.size() == 0) {
|
||||
modsTable->setCellWidget(row, 1, new QLabel(tr("not found")));
|
||||
} else {
|
||||
QComboBox* combo = new QComboBox();
|
||||
for (std::vector<QString>::const_iterator modIter = espIter->second.begin();
|
||||
modIter != espIter->second.end(); ++modIter) {
|
||||
combo->addItem(*modIter);
|
||||
}
|
||||
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 != NULL) {
|
||||
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 != NULL) {
|
||||
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 <QLabel>
|
||||
|
||||
ActivateModsDialog::ActivateModsDialog(const std::map<QString, std::vector<QString> > &missingPlugins, QWidget *parent)
|
||||
: TutorableDialog("ActivateMods", parent), ui(new Ui::ActivateModsDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
QTableWidget *modsTable = findChild<QTableWidget*>("modsTable");
|
||||
QHeaderView *headerView = modsTable->horizontalHeader();
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
|
||||
headerView->setSectionResizeMode(0, QHeaderView::Stretch);
|
||||
headerView->setSectionResizeMode(1, QHeaderView::Interactive);
|
||||
#else
|
||||
headerView->setResizeMode(0, QHeaderView::Stretch);
|
||||
headerView->setResizeMode(1, QHeaderView::Interactive);
|
||||
#endif
|
||||
|
||||
int row = 0;
|
||||
|
||||
modsTable->setRowCount(missingPlugins.size());
|
||||
|
||||
for (std::map<QString, std::vector<QString> >::const_iterator espIter = missingPlugins.begin();
|
||||
espIter != missingPlugins.end(); ++espIter, ++row) {
|
||||
modsTable->setCellWidget(row, 0, new QLabel(espIter->first));
|
||||
if (espIter->second.size() == 0) {
|
||||
modsTable->setCellWidget(row, 1, new QLabel(tr("not found")));
|
||||
} else {
|
||||
QComboBox* combo = new QComboBox();
|
||||
for (std::vector<QString>::const_iterator modIter = espIter->second.begin();
|
||||
modIter != espIter->second.end(); ++modIter) {
|
||||
combo->addItem(*modIter);
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
+70
-70
@@ -1,70 +1,70 @@
|
||||
/*
|
||||
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 "tutorabledialog.h"
|
||||
#include <map>
|
||||
#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(const std::map<QString, std::vector<QString> > &missingPlugins, 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 "tutorabledialog.h"
|
||||
#include <map>
|
||||
#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(const std::map<QString, std::vector<QString> > &missingPlugins, 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
|
||||
|
||||
+274
-234
File diff suppressed because it is too large
Load Diff
+40
-40
@@ -1,40 +1,40 @@
|
||||
/*
|
||||
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 BBCODE_H
|
||||
#define BBCODE_H
|
||||
|
||||
|
||||
#include <QString>
|
||||
|
||||
|
||||
namespace BBCode {
|
||||
|
||||
/**
|
||||
* @brief convert a string with BB Code-Tags to HTML
|
||||
* @param input the input string with BB tags
|
||||
* @param replaceOccured if not NULL, this parameter will be set to true if any bb tags were replaced
|
||||
* @return the same string in html representation
|
||||
**/
|
||||
QString convertToHTML(const QString &input);
|
||||
|
||||
}
|
||||
|
||||
|
||||
#endif // BBCODE_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 BBCODE_H
|
||||
#define BBCODE_H
|
||||
|
||||
|
||||
#include <QString>
|
||||
|
||||
|
||||
namespace BBCode {
|
||||
|
||||
/**
|
||||
* @brief convert a string with BB Code-Tags to HTML
|
||||
* @param input the input string with BB tags
|
||||
* @param replaceOccured if not nullptr, this parameter will be set to true if any bb tags were replaced
|
||||
* @return the same string in html representation
|
||||
**/
|
||||
QString convertToHTML(const QString &input);
|
||||
|
||||
}
|
||||
|
||||
|
||||
#endif // BBCODE_H
|
||||
|
||||
+296
-270
File diff suppressed because it is too large
Load Diff
+126
-124
@@ -1,124 +1,126 @@
|
||||
/*
|
||||
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 BROWSERDIALOG_H
|
||||
#define BROWSERDIALOG_H
|
||||
|
||||
#include "browserview.h"
|
||||
#include "tutorialcontrol.h"
|
||||
#include <QDialog>
|
||||
#include <QProgressBar>
|
||||
#include <QNetworkRequest>
|
||||
#include <QNetworkReply>
|
||||
#include <QTimer>
|
||||
#include <QWebView>
|
||||
#include <QQueue>
|
||||
#include <QTabWidget>
|
||||
#include <QAtomicInt>
|
||||
|
||||
|
||||
namespace Ui {
|
||||
class BrowserDialog;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief a dialog containing a webbrowser that is intended to browse the nexus network
|
||||
**/
|
||||
class BrowserDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
|
||||
/**
|
||||
* @brief constructor
|
||||
*
|
||||
* @param accessManager the access manager to use for network requests
|
||||
* @param parent parent widget
|
||||
**/
|
||||
explicit BrowserDialog(QWidget *parent = 0);
|
||||
~BrowserDialog();
|
||||
|
||||
/**
|
||||
* @brief set the url to open. If automatic login is enabled, the url is opened after login
|
||||
*
|
||||
* @param url the url to open
|
||||
**/
|
||||
void openUrl(const QUrl &url);
|
||||
|
||||
signals:
|
||||
|
||||
/**
|
||||
* @brief emitted when the user starts a download
|
||||
* @param pageUrl url of the current web site from which the download was started
|
||||
* @param reply network reply of the started download
|
||||
*/
|
||||
void requestDownload(const QUrl &pageUrl, QNetworkReply *reply);
|
||||
|
||||
protected:
|
||||
|
||||
virtual void closeEvent(QCloseEvent *);
|
||||
|
||||
private slots:
|
||||
|
||||
void initTab(BrowserView *newView);
|
||||
void openInNewTab(const QUrl &url);
|
||||
|
||||
void progress(int value);
|
||||
|
||||
void titleChanged(const QString &title);
|
||||
void unsupportedContent(QNetworkReply *reply);
|
||||
void downloadRequested(const QNetworkRequest &request);
|
||||
|
||||
void tabCloseRequested(int index);
|
||||
|
||||
void urlChanged(const QUrl &url);
|
||||
|
||||
void on_backBtn_clicked();
|
||||
|
||||
void on_fwdBtn_clicked();
|
||||
|
||||
void on_searchEdit_returnPressed();
|
||||
|
||||
void startSearch();
|
||||
|
||||
void on_refreshBtn_clicked();
|
||||
|
||||
void on_browserTabWidget_currentChanged(int index);
|
||||
|
||||
private:
|
||||
|
||||
QString guessFileName(const QString &url);
|
||||
|
||||
BrowserView *getCurrentView();
|
||||
|
||||
void maximizeWidth();
|
||||
|
||||
private:
|
||||
|
||||
Ui::BrowserDialog *ui;
|
||||
|
||||
QNetworkAccessManager *m_AccessManager;
|
||||
|
||||
QTabWidget *m_Tabs;
|
||||
|
||||
};
|
||||
|
||||
#endif // BROWSERDIALOG_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 BROWSERDIALOG_H
|
||||
#define BROWSERDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
#include <QNetworkRequest>
|
||||
#include <QNetworkReply>
|
||||
#include <QTimer>
|
||||
#include <QWebView>
|
||||
#include <QQueue>
|
||||
#include <QTabWidget>
|
||||
#include <QAtomicInt>
|
||||
|
||||
|
||||
namespace Ui {
|
||||
class BrowserDialog;
|
||||
}
|
||||
|
||||
class BrowserView;
|
||||
|
||||
/**
|
||||
* @brief a dialog containing a webbrowser that is intended to browse the nexus network
|
||||
**/
|
||||
class BrowserDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
|
||||
/**
|
||||
* @brief constructor
|
||||
*
|
||||
* @param accessManager the access manager to use for network requests
|
||||
* @param parent parent widget
|
||||
**/
|
||||
explicit BrowserDialog(QWidget *parent = 0);
|
||||
~BrowserDialog();
|
||||
|
||||
/**
|
||||
* @brief set the url to open. If automatic login is enabled, the url is opened after login
|
||||
*
|
||||
* @param url the url to open
|
||||
**/
|
||||
void openUrl(const QUrl &url);
|
||||
|
||||
virtual bool eventFilter(QObject *object, QEvent *event);
|
||||
signals:
|
||||
|
||||
/**
|
||||
* @brief emitted when the user starts a download
|
||||
* @param pageUrl url of the current web site from which the download was started
|
||||
* @param reply network reply of the started download
|
||||
*/
|
||||
void requestDownload(const QUrl &pageUrl, QNetworkReply *reply);
|
||||
|
||||
protected:
|
||||
|
||||
virtual void closeEvent(QCloseEvent *);
|
||||
|
||||
private slots:
|
||||
|
||||
void initTab(BrowserView *newView);
|
||||
void openInNewTab(const QUrl &url);
|
||||
|
||||
void progress(int value);
|
||||
|
||||
void titleChanged(const QString &title);
|
||||
void unsupportedContent(QNetworkReply *reply);
|
||||
void downloadRequested(const QNetworkRequest &request);
|
||||
|
||||
void tabCloseRequested(int index);
|
||||
|
||||
void urlChanged(const QUrl &url);
|
||||
|
||||
void on_backBtn_clicked();
|
||||
|
||||
void on_fwdBtn_clicked();
|
||||
|
||||
void on_searchEdit_returnPressed();
|
||||
|
||||
void startSearch();
|
||||
|
||||
void on_refreshBtn_clicked();
|
||||
|
||||
void on_browserTabWidget_currentChanged(int index);
|
||||
|
||||
void on_urlEdit_returnPressed();
|
||||
|
||||
private:
|
||||
|
||||
QString guessFileName(const QString &url);
|
||||
|
||||
BrowserView *getCurrentView();
|
||||
|
||||
void maximizeWidth();
|
||||
|
||||
private:
|
||||
|
||||
Ui::BrowserDialog *ui;
|
||||
|
||||
QNetworkAccessManager *m_AccessManager;
|
||||
|
||||
QTabWidget *m_Tabs;
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif // BROWSERDIALOG_H
|
||||
|
||||
+27
-2
@@ -17,7 +17,16 @@
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
@@ -180,7 +189,16 @@
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
@@ -237,6 +255,13 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="urlEdit">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
|
||||
+75
-76
@@ -1,76 +1,75 @@
|
||||
/*
|
||||
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 "browserview.h"
|
||||
|
||||
#include <QEvent>
|
||||
#include <QKeyEvent>
|
||||
#include <QWebFrame>
|
||||
#include <QWebElement>
|
||||
#include <QNetworkDiskCache>
|
||||
#include <QMenu>
|
||||
#include <Shlwapi.h>
|
||||
#include "utility.h"
|
||||
|
||||
BrowserView::BrowserView(QWidget *parent)
|
||||
: QWebView(parent)
|
||||
{
|
||||
installEventFilter(this);
|
||||
|
||||
page()->settings()->setMaximumPagesInCache(10);
|
||||
}
|
||||
|
||||
|
||||
QWebView *BrowserView::createWindow(QWebPage::WebWindowType)
|
||||
{
|
||||
BrowserView *newView = new BrowserView(parentWidget());
|
||||
emit initTab(newView);
|
||||
return newView;
|
||||
}
|
||||
|
||||
|
||||
bool BrowserView::eventFilter(QObject *obj, QEvent *event)
|
||||
{
|
||||
if (event->type() == QEvent::ShortcutOverride) {
|
||||
QKeyEvent *keyEvent = static_cast<QKeyEvent*>(event);
|
||||
if (keyEvent->matches(QKeySequence::Find)) {
|
||||
emit startFind();
|
||||
} else if (keyEvent->matches(QKeySequence::FindNext)) {
|
||||
emit findAgain();
|
||||
}
|
||||
} else if (event->type() == QEvent::MouseButtonPress) {
|
||||
QMouseEvent *mouseEvent = static_cast<QMouseEvent*>(event);
|
||||
if (mouseEvent->button() == Qt::MidButton) {
|
||||
mouseEvent->ignore();
|
||||
return true;
|
||||
}
|
||||
} else if (event->type() == QEvent::MouseButtonRelease) {
|
||||
QMouseEvent *mouseEvent = static_cast<QMouseEvent*>(event);
|
||||
if (mouseEvent->button() == Qt::MidButton) {
|
||||
QWebHitTestResult hitTest = page()->frameAt(mouseEvent->pos())->hitTestContent(mouseEvent->pos());
|
||||
if (hitTest.linkUrl().isValid()) {
|
||||
emit openUrlInNewTab(hitTest.linkUrl());
|
||||
}
|
||||
mouseEvent->ignore();
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return QWebView::eventFilter(obj, event);
|
||||
}
|
||||
/*
|
||||
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 "browserview.h"
|
||||
|
||||
#include <QEvent>
|
||||
#include <QKeyEvent>
|
||||
#include <QWebFrame>
|
||||
#include <QWebElement>
|
||||
#include <QNetworkDiskCache>
|
||||
#include <QMenu>
|
||||
#include <Shlwapi.h>
|
||||
#include "utility.h"
|
||||
|
||||
|
||||
BrowserView::BrowserView(QWidget *parent)
|
||||
: QWebView(parent)
|
||||
{
|
||||
installEventFilter(this);
|
||||
|
||||
page()->settings()->setMaximumPagesInCache(10);
|
||||
}
|
||||
|
||||
QWebView *BrowserView::createWindow(QWebPage::WebWindowType)
|
||||
{
|
||||
BrowserView *newView = new BrowserView(parentWidget());
|
||||
emit initTab(newView);
|
||||
return newView;
|
||||
}
|
||||
|
||||
bool BrowserView::eventFilter(QObject *obj, QEvent *event)
|
||||
{
|
||||
if (event->type() == QEvent::ShortcutOverride) {
|
||||
QKeyEvent *keyEvent = static_cast<QKeyEvent*>(event);
|
||||
if (keyEvent->matches(QKeySequence::Find)) {
|
||||
emit startFind();
|
||||
} else if (keyEvent->matches(QKeySequence::FindNext)) {
|
||||
emit findAgain();
|
||||
}
|
||||
} else if (event->type() == QEvent::MouseButtonPress) {
|
||||
QMouseEvent *mouseEvent = static_cast<QMouseEvent*>(event);
|
||||
if (mouseEvent->button() == Qt::MidButton) {
|
||||
mouseEvent->ignore();
|
||||
return true;
|
||||
}
|
||||
} else if (event->type() == QEvent::MouseButtonRelease) {
|
||||
QMouseEvent *mouseEvent = static_cast<QMouseEvent*>(event);
|
||||
if (mouseEvent->button() == Qt::MidButton) {
|
||||
QWebHitTestResult hitTest = page()->frameAt(mouseEvent->pos())->hitTestContent(mouseEvent->pos());
|
||||
if (hitTest.linkUrl().isValid()) {
|
||||
emit openUrlInNewTab(hitTest.linkUrl());
|
||||
}
|
||||
mouseEvent->ignore();
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return QWebView::eventFilter(obj, event);
|
||||
}
|
||||
|
||||
+79
-80
@@ -1,80 +1,79 @@
|
||||
/*
|
||||
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 NEXUSVIEW_H
|
||||
#define NEXUSVIEW_H
|
||||
|
||||
#include "finddialog.h"
|
||||
|
||||
#include <QWebView>
|
||||
#include <QWebPage>
|
||||
#include <QTabWidget>
|
||||
|
||||
/**
|
||||
* @brief web view used to display a nexus page
|
||||
**/
|
||||
class BrowserView : public QWebView
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
|
||||
explicit BrowserView(QWidget *parent = 0);
|
||||
|
||||
signals:
|
||||
|
||||
/**
|
||||
* @brief emitted when the user opens a new window to be displayed in another tab
|
||||
*
|
||||
* @param newView the view for the newly opened window
|
||||
**/
|
||||
void initTab(BrowserView *newView);
|
||||
|
||||
/**
|
||||
* @brief emitted when the user requests a link to be opened in a new tab by middle-clicking
|
||||
*
|
||||
* @param url the url to open
|
||||
*/
|
||||
void openUrlInNewTab(const QUrl &url);
|
||||
|
||||
/**
|
||||
* @brief Ctrl-f was clicked. The containing dialog should activate its find-facility
|
||||
*/
|
||||
void startFind();
|
||||
|
||||
/**
|
||||
* @brief F3 was pressed. The containing dialog should search again
|
||||
*/
|
||||
void findAgain();
|
||||
|
||||
protected:
|
||||
|
||||
virtual QWebView *createWindow(QWebPage::WebWindowType type);
|
||||
|
||||
virtual bool eventFilter(QObject *obj, QEvent *event);
|
||||
|
||||
|
||||
private:
|
||||
|
||||
QString m_FindPattern;
|
||||
bool m_MiddleClick;
|
||||
|
||||
};
|
||||
|
||||
#endif // NEXUSVIEW_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 NEXUSVIEW_H
|
||||
#define NEXUSVIEW_H
|
||||
|
||||
|
||||
#include <QWebView>
|
||||
#include <QWebPage>
|
||||
#include <QTabWidget>
|
||||
|
||||
/**
|
||||
* @brief web view used to display a nexus page
|
||||
**/
|
||||
class BrowserView : public QWebView
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
|
||||
explicit BrowserView(QWidget *parent = 0);
|
||||
|
||||
signals:
|
||||
|
||||
/**
|
||||
* @brief emitted when the user opens a new window to be displayed in another tab
|
||||
*
|
||||
* @param newView the view for the newly opened window
|
||||
**/
|
||||
void initTab(BrowserView *newView);
|
||||
|
||||
/**
|
||||
* @brief emitted when the user requests a link to be opened in a new tab by middle-clicking
|
||||
*
|
||||
* @param url the url to open
|
||||
*/
|
||||
void openUrlInNewTab(const QUrl &url);
|
||||
|
||||
/**
|
||||
* @brief Ctrl-f was clicked. The containing dialog should activate its find-facility
|
||||
*/
|
||||
void startFind();
|
||||
|
||||
/**
|
||||
* @brief F3 was pressed. The containing dialog should search again
|
||||
*/
|
||||
void findAgain();
|
||||
|
||||
protected:
|
||||
|
||||
virtual QWebView *createWindow(QWebPage::WebWindowType type);
|
||||
|
||||
virtual bool eventFilter(QObject *obj, QEvent *event);
|
||||
|
||||
|
||||
private:
|
||||
|
||||
QString m_FindPattern;
|
||||
bool m_MiddleClick;
|
||||
|
||||
};
|
||||
|
||||
#endif // NEXUSVIEW_H
|
||||
|
||||
+319
-301
File diff suppressed because it is too large
Load Diff
+200
-198
@@ -1,198 +1,200 @@
|
||||
/*
|
||||
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 CATEGORIES_H
|
||||
#define CATEGORIES_H
|
||||
|
||||
|
||||
#include <QString>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include <functional>
|
||||
|
||||
|
||||
/**
|
||||
* @brief Manage the available mod categories
|
||||
* @warning member functions of this class currently use a wild mix of ids and indexes to look up categories,
|
||||
* optimized to where the request comes from. Therefore be very careful which of the two you have available
|
||||
**/
|
||||
class CategoryFactory {
|
||||
|
||||
friend class CategoriesDialog;
|
||||
|
||||
public:
|
||||
|
||||
static const int CATEGORY_NONE = 0;
|
||||
|
||||
static const int CATEGORY_SPECIAL_FIRST = 10000;
|
||||
static const int CATEGORY_SPECIAL_CHECKED = CATEGORY_SPECIAL_FIRST;
|
||||
static const int CATEGORY_SPECIAL_UNCHECKED = 10001;
|
||||
static const int CATEGORY_SPECIAL_UPDATEAVAILABLE = 10002;
|
||||
static const int CATEGORY_SPECIAL_NOCATEGORY = 10003;
|
||||
static const int CATEGORY_SPECIAL_CONFLICT = 10004;
|
||||
static const int CATEGORY_SPECIAL_NOTENDORSED = 10005;
|
||||
|
||||
public:
|
||||
|
||||
struct Category {
|
||||
Category(int sortValue, int id, const QString &name, const std::vector<int> &nexusIDs, int parentID)
|
||||
: m_SortValue(sortValue), m_ID(id), m_Name(name), m_HasChildren(false),
|
||||
m_NexusIDs(nexusIDs), m_ParentID(parentID) {}
|
||||
int m_SortValue;
|
||||
int m_ID;
|
||||
int m_ParentID;
|
||||
bool m_HasChildren;
|
||||
QString m_Name;
|
||||
std::vector<int> m_NexusIDs;
|
||||
|
||||
friend bool operator<(const Category &LHS, const Category &RHS) {
|
||||
return LHS.m_SortValue < RHS.m_SortValue;
|
||||
}
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
/**
|
||||
* @brief reset the list of categories
|
||||
**/
|
||||
void reset();
|
||||
|
||||
/**
|
||||
* @brief save the categories to the categories.dat file
|
||||
**/
|
||||
void saveCategories();
|
||||
|
||||
/**
|
||||
* @brief retrieve the number of available categories
|
||||
*
|
||||
* @return unsigned int number of categories
|
||||
**/
|
||||
unsigned numCategories() const { return m_Categories.size(); }
|
||||
|
||||
/**
|
||||
* @brief count all categories that match a specified filter
|
||||
* @param filter the filter to test
|
||||
* @return number of matching categories
|
||||
*/
|
||||
unsigned int countCategories(std::tr1::function<bool (const Category &category)> filter);
|
||||
|
||||
/**
|
||||
* @brief get the id of the parent category
|
||||
*
|
||||
* @param index the index to look up
|
||||
* @return int id of the parent category
|
||||
**/
|
||||
int getParentID(unsigned int index) const;
|
||||
|
||||
/**
|
||||
* @brief determine if a category exists (by id)
|
||||
*
|
||||
* @param id the id to check for existance
|
||||
* @return true if the category exists, false otherwise
|
||||
**/
|
||||
bool categoryExists(int id) const;
|
||||
|
||||
/**
|
||||
* @brief test if a category is child of a second one
|
||||
* @param id the presumed child id
|
||||
* @param parentID the parent id to test for
|
||||
* @return true if id is a child of parentID
|
||||
**/
|
||||
bool isDecendantOf(int id, int parentID) const;
|
||||
|
||||
/**
|
||||
* @brief test if the specified category has child categories
|
||||
*
|
||||
* @param index index of the category to look up
|
||||
* @return bool true if the category has child categories
|
||||
**/
|
||||
bool hasChildren(unsigned int index) const;
|
||||
|
||||
/**
|
||||
* @brief retrieve the name of a category
|
||||
*
|
||||
* @param index index of the category to look up
|
||||
* @return QString name of the category
|
||||
**/
|
||||
QString getCategoryName(unsigned int index) const;
|
||||
|
||||
/**
|
||||
* @brief look up the id of a category by its index
|
||||
*
|
||||
* @param index index of the category to look up
|
||||
* @return int id of the category
|
||||
**/
|
||||
int getCategoryID(unsigned int index) const;
|
||||
|
||||
/**
|
||||
* @brief look up the index of a category by its id
|
||||
*
|
||||
* @param id index of the category to look up
|
||||
* @return unsigned int index of the category
|
||||
**/
|
||||
int getCategoryIndex(int ID) const;
|
||||
|
||||
/**
|
||||
* @brief retrieve the index of a category by its nexus id
|
||||
*
|
||||
* @param nexusID nexus id of the category to look up
|
||||
* @return unsigned int index of the category or 0 if no category matches
|
||||
**/
|
||||
unsigned int resolveNexusID(int nexusID) const;
|
||||
|
||||
public:
|
||||
|
||||
/**
|
||||
* @brief retrieve a reference to the singleton instance
|
||||
*
|
||||
* @return the reference to the singleton
|
||||
**/
|
||||
static CategoryFactory &instance();
|
||||
|
||||
/**
|
||||
* @return path to the file that contains the categories list
|
||||
*/
|
||||
static QString categoriesFilePath();
|
||||
|
||||
private:
|
||||
|
||||
CategoryFactory();
|
||||
|
||||
void loadDefaultCategories();
|
||||
|
||||
void addCategory(int id, const QString &name, const std::vector<int> &nexusID, int parentID);
|
||||
|
||||
void setParents();
|
||||
|
||||
static void cleanup();
|
||||
|
||||
private:
|
||||
|
||||
static CategoryFactory *s_Instance;
|
||||
|
||||
std::vector<Category> m_Categories;
|
||||
std::map<int, unsigned int> m_IDMap;
|
||||
std::map<int, unsigned int> m_NexusMap;
|
||||
|
||||
private:
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif // CATEGORIES_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 CATEGORIES_H
|
||||
#define CATEGORIES_H
|
||||
|
||||
|
||||
#include <QString>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include <functional>
|
||||
|
||||
|
||||
/**
|
||||
* @brief Manage the available mod categories
|
||||
* @warning member functions of this class currently use a wild mix of ids and indexes to look up categories,
|
||||
* optimized to where the request comes from. Therefore be very careful which of the two you have available
|
||||
**/
|
||||
class CategoryFactory {
|
||||
|
||||
friend class CategoriesDialog;
|
||||
|
||||
public:
|
||||
|
||||
static const int CATEGORY_NONE = 0;
|
||||
|
||||
static const int CATEGORY_SPECIAL_FIRST = 10000;
|
||||
static const int CATEGORY_SPECIAL_CHECKED = CATEGORY_SPECIAL_FIRST;
|
||||
static const int CATEGORY_SPECIAL_UNCHECKED = 10001;
|
||||
static const int CATEGORY_SPECIAL_UPDATEAVAILABLE = 10002;
|
||||
static const int CATEGORY_SPECIAL_NOCATEGORY = 10003;
|
||||
static const int CATEGORY_SPECIAL_CONFLICT = 10004;
|
||||
static const int CATEGORY_SPECIAL_NOTENDORSED = 10005;
|
||||
static const int CATEGORY_SPECIAL_MANAGED = 10006;
|
||||
static const int CATEGORY_SPECIAL_UNMANAGED = 10007;
|
||||
|
||||
public:
|
||||
|
||||
struct Category {
|
||||
Category(int sortValue, int id, const QString &name, const std::vector<int> &nexusIDs, int parentID)
|
||||
: m_SortValue(sortValue), m_ID(id), m_Name(name), m_HasChildren(false),
|
||||
m_NexusIDs(nexusIDs), m_ParentID(parentID) {}
|
||||
int m_SortValue;
|
||||
int m_ID;
|
||||
int m_ParentID;
|
||||
bool m_HasChildren;
|
||||
QString m_Name;
|
||||
std::vector<int> m_NexusIDs;
|
||||
|
||||
friend bool operator<(const Category &LHS, const Category &RHS) {
|
||||
return LHS.m_SortValue < RHS.m_SortValue;
|
||||
}
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
/**
|
||||
* @brief reset the list of categories
|
||||
**/
|
||||
void reset();
|
||||
|
||||
/**
|
||||
* @brief save the categories to the categories.dat file
|
||||
**/
|
||||
void saveCategories();
|
||||
|
||||
/**
|
||||
* @brief retrieve the number of available categories
|
||||
*
|
||||
* @return unsigned int number of categories
|
||||
**/
|
||||
unsigned numCategories() const { return m_Categories.size(); }
|
||||
|
||||
/**
|
||||
* @brief count all categories that match a specified filter
|
||||
* @param filter the filter to test
|
||||
* @return number of matching categories
|
||||
*/
|
||||
unsigned int countCategories(std::tr1::function<bool (const Category &category)> filter);
|
||||
|
||||
/**
|
||||
* @brief get the id of the parent category
|
||||
*
|
||||
* @param index the index to look up
|
||||
* @return int id of the parent category
|
||||
**/
|
||||
int getParentID(unsigned int index) const;
|
||||
|
||||
/**
|
||||
* @brief determine if a category exists (by id)
|
||||
*
|
||||
* @param id the id to check for existance
|
||||
* @return true if the category exists, false otherwise
|
||||
**/
|
||||
bool categoryExists(int id) const;
|
||||
|
||||
/**
|
||||
* @brief test if a category is child of a second one
|
||||
* @param id the presumed child id
|
||||
* @param parentID the parent id to test for
|
||||
* @return true if id is a child of parentID
|
||||
**/
|
||||
bool isDecendantOf(int id, int parentID) const;
|
||||
|
||||
/**
|
||||
* @brief test if the specified category has child categories
|
||||
*
|
||||
* @param index index of the category to look up
|
||||
* @return bool true if the category has child categories
|
||||
**/
|
||||
bool hasChildren(unsigned int index) const;
|
||||
|
||||
/**
|
||||
* @brief retrieve the name of a category
|
||||
*
|
||||
* @param index index of the category to look up
|
||||
* @return QString name of the category
|
||||
**/
|
||||
QString getCategoryName(unsigned int index) const;
|
||||
|
||||
/**
|
||||
* @brief look up the id of a category by its index
|
||||
*
|
||||
* @param index index of the category to look up
|
||||
* @return int id of the category
|
||||
**/
|
||||
int getCategoryID(unsigned int index) const;
|
||||
|
||||
/**
|
||||
* @brief look up the index of a category by its id
|
||||
*
|
||||
* @param id index of the category to look up
|
||||
* @return unsigned int index of the category
|
||||
**/
|
||||
int getCategoryIndex(int ID) const;
|
||||
|
||||
/**
|
||||
* @brief retrieve the index of a category by its nexus id
|
||||
*
|
||||
* @param nexusID nexus id of the category to look up
|
||||
* @return unsigned int index of the category or 0 if no category matches
|
||||
**/
|
||||
unsigned int resolveNexusID(int nexusID) const;
|
||||
|
||||
public:
|
||||
|
||||
/**
|
||||
* @brief retrieve a reference to the singleton instance
|
||||
*
|
||||
* @return the reference to the singleton
|
||||
**/
|
||||
static CategoryFactory &instance();
|
||||
|
||||
/**
|
||||
* @return path to the file that contains the categories list
|
||||
*/
|
||||
static QString categoriesFilePath();
|
||||
|
||||
private:
|
||||
|
||||
CategoryFactory();
|
||||
|
||||
void loadDefaultCategories();
|
||||
|
||||
void addCategory(int id, const QString &name, const std::vector<int> &nexusID, int parentID);
|
||||
|
||||
void setParents();
|
||||
|
||||
static void cleanup();
|
||||
|
||||
private:
|
||||
|
||||
static CategoryFactory *s_Instance;
|
||||
|
||||
std::vector<Category> m_Categories;
|
||||
std::map<int, unsigned int> m_IDMap;
|
||||
std::map<int, unsigned int> m_NexusMap;
|
||||
|
||||
private:
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif // CATEGORIES_H
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user