mirror of
https://github.com/ModOrganizer2/modorganizer.git
synced 2026-07-27 13:58:24 -07:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
afa0cb9446 | ||
|
|
0657774e2e | ||
|
|
695593968b | ||
|
|
61edeb12f1 | ||
|
|
db6b536fb1 | ||
|
|
64590a10d7 | ||
|
|
4a582e524d | ||
|
|
a00cda607c | ||
|
|
42407866e9 | ||
|
|
c3a8a0b9eb | ||
|
|
607b2a10aa | ||
|
|
6b60d54853 | ||
|
|
c7101be7d8 | ||
|
|
d80a77a4cb | ||
|
|
33b544112c | ||
|
|
8a3af93b39 | ||
|
|
352975e757 | ||
|
|
cd83f4e732 | ||
|
|
4f25a0689f | ||
|
|
3d642563cb | ||
|
|
0100c86887 | ||
|
|
8d04c77c29 | ||
|
|
b935ce3862 | ||
|
|
fcebf21c44 | ||
|
|
3d1dfadb40 | ||
|
|
c2c48bd39a | ||
|
|
9163a6dc34 | ||
|
|
8bf3037d4b | ||
|
|
4f1bb36933 | ||
|
|
cbdea13a9c | ||
|
|
b36c666899 | ||
|
|
bbab59f681 | ||
|
|
bfbb190998 | ||
|
|
c3b7737ae4 | ||
|
|
30878ae394 | ||
|
|
45a182a381 | ||
|
|
0b07cfa3f0 | ||
|
|
986330a3bd | ||
|
|
81c5ca5308 | ||
|
|
3a8da159da | ||
|
|
f6c3b516fd | ||
|
|
5665be7fd1 | ||
|
|
a625acd17b | ||
|
|
e522afa63b | ||
|
|
e3c3c2dcc4 | ||
|
|
519f215fd7 | ||
|
|
89221af929 | ||
|
|
f5a815185f | ||
|
|
59a36107a1 | ||
|
|
bc5d5d8bfa | ||
|
|
a294f8410f | ||
|
|
256cdb8df7 | ||
|
|
32480f7a81 | ||
|
|
e43762e7db | ||
|
|
afe0d749c4 | ||
|
|
eb97c46ed6 | ||
|
|
d958e11e2b | ||
|
|
b0e3e86a61 | ||
|
|
9df612c7ca | ||
|
|
0899724d90 | ||
|
|
53d9789740 | ||
|
|
4f8c71d626 | ||
|
|
ba8464f01f | ||
|
|
fd68248698 | ||
|
|
1ad2115e01 | ||
|
|
8d1dd6238f | ||
|
|
aaa1f52bdd | ||
|
|
b085aeea0e | ||
|
|
ea621ef859 | ||
|
|
3202713cff | ||
|
|
ad9d50e5f0 | ||
|
|
63eaf453e0 | ||
|
|
8a9a1680b0 | ||
|
|
0e9a86ebfc | ||
|
|
8da9ba5404 | ||
|
|
387326f2d6 | ||
|
|
d07b4f7ff0 | ||
|
|
197c49e996 | ||
|
|
0d50427b83 | ||
|
|
e90fbb1df2 | ||
|
|
a4dbe82be7 | ||
|
|
42417b6a01 | ||
|
|
f2b2ee1a11 | ||
|
|
ae6bb99c52 | ||
|
|
3869eaaf2b | ||
|
|
6edf12f2f7 | ||
|
|
f55a5f2b21 | ||
|
|
5f5184ebfe | ||
|
|
30b29635f6 | ||
|
|
0c536a4c12 | ||
|
|
967c2ae653 | ||
|
|
ba176e5e9b |
+82
@@ -0,0 +1,82 @@
|
||||
[main]
|
||||
host = https://www.transifex.com
|
||||
|
||||
[mod-organizer.organizer]
|
||||
file_filter = organizer/organizer_<lang>.ts
|
||||
source_file = organizer/organizer_en.ts
|
||||
source_lang = en
|
||||
|
||||
[mod-organizer.diagnosebasic]
|
||||
file_filter = plugins/diagnoseBasic/diagnoseBasic_<lang>.ts
|
||||
source_file = plugins/diagnoseBasic/diagnoseBasic_en.ts
|
||||
source_lang = en
|
||||
|
||||
[mod-organizer.bsaextractor]
|
||||
file_filter = plugins/bsaExtractor/bsaExtractor_<lang>.ts
|
||||
source_file = plugins/bsaExtractor/bsaExtractor_en.ts
|
||||
source_lang = en
|
||||
|
||||
[mod-organizer.checkfnis]
|
||||
file_filter = plugins/checkFNIS/checkFNIS_<lang>.ts
|
||||
source_file = plugins/checkFNIS/checkFNIS_en.ts
|
||||
source_lang = en
|
||||
|
||||
[mod-organizer.inieditor]
|
||||
file_filter = plugins/iniEditor/iniEditor_<lang>.ts
|
||||
source_file = plugins/iniEditor/iniEditor_en.ts
|
||||
source_lang = en
|
||||
|
||||
[mod-organizer.installerbain]
|
||||
file_filter = plugins/installerBAIN/installerBAIN_<lang>.ts
|
||||
source_file = plugins/installerBAIN/installerBAIN_en.ts
|
||||
source_lang = en
|
||||
|
||||
[mod-organizer.installerbundle]
|
||||
file_filter = plugins/installerBundle/installerBundle_<lang>.ts
|
||||
source_file = plugins/installerBundle/installerBundle_en.ts
|
||||
source_lang = en
|
||||
|
||||
[mod-organizer.installerfomod]
|
||||
file_filter = plugins/installerFomod/installerFomod_<lang>.ts
|
||||
source_file = plugins/installerFomod/installerFomod_en.ts
|
||||
source_lang = en
|
||||
|
||||
[mod-organizer.installermanual]
|
||||
file_filter = plugins/installerManual/installerManual_<lang>.ts
|
||||
source_file = plugins/installerManual/installerManual_en.ts
|
||||
source_lang = en
|
||||
|
||||
[mod-organizer.installerncc]
|
||||
file_filter = plugins/installerNCC/installerNCC_<lang>.ts
|
||||
source_file = plugins/installerNCC/installerNCC_en.ts
|
||||
source_lang = en
|
||||
|
||||
[mod-organizer.installerquick]
|
||||
file_filter = plugins/installerQuick/installerQuick_<lang>.ts
|
||||
source_file = plugins/installerQuick/installerQuick_en.ts
|
||||
source_lang = en
|
||||
|
||||
[mod-organizer.nmmimport]
|
||||
file_filter = plugins/NMMImport/NMMImport_<lang>.ts
|
||||
source_file = plugins/NMMImport/NMMImport_en.ts
|
||||
source_lang = en
|
||||
|
||||
[mod-organizer.previewbase]
|
||||
file_filter = plugins/previewBase/previewBase_<lang>.ts
|
||||
source_file = plugins/previewBase/previewBase_en.ts
|
||||
source_lang = en
|
||||
|
||||
[mod-organizer.previewdds]
|
||||
file_filter = plugins/previewDDS/previewDDS_<lang>.ts
|
||||
source_file = plugins/previewDDS/previewDDS_en.ts
|
||||
source_lang = en
|
||||
|
||||
[mod-organizer.proxypython]
|
||||
file_filter = plugins/proxyPython/proxyPython_<lang>.ts
|
||||
source_file = plugins/proxyPython/proxyPython_en.ts
|
||||
source_lang = en
|
||||
|
||||
[mod-organizer.configurator]
|
||||
file_filter = plugins/pyniEdit/pyniEdit_<lang>.ts
|
||||
source_file = plugins/pyniEdit/pyniEdit_en.ts
|
||||
source_lang = en
|
||||
+2
-2
@@ -2,13 +2,13 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
|
||||
|
||||
PROJECT(organizer)
|
||||
|
||||
|
||||
SET(DEPENDENCIES_DIR CACHE PATH "")
|
||||
# hint to find qt in dependencies path
|
||||
LIST(APPEND CMAKE_PREFIX_PATH ${DEPENDENCIES_DIR}/qt5/lib/cmake)
|
||||
|
||||
FILE(GLOB_RECURSE BOOST_ROOT ${DEPENDENCIES_DIR}/boost*/project-config.jam)
|
||||
GET_FILENAME_COMPONENT(BOOST_ROOT ${BOOST_ROOT} DIRECTORY)
|
||||
|
||||
SET(ZLIB_ROOT ${DEPENDENCIES_DIR}/zlib)
|
||||
|
||||
ADD_SUBDIRECTORY(src)
|
||||
ADD_SUBDIRECTORY(src)
|
||||
|
||||
+33
-10
@@ -431,16 +431,24 @@ msvs_version = int(env['MSVS_VERSION'].split('.')[0]) + 2000
|
||||
if msvs_version > 2010:
|
||||
msvs_version += 1
|
||||
|
||||
# Need more work on the qt version stuff
|
||||
#build-ModOrganizer-Desktop_Qt_5_4_1_MSVC2013_OpenGL_32bit-Debug
|
||||
build_dir = 'scons-ModOrganizer-QT_%s_for_MSVS%d_32bit-%s' % (
|
||||
#os.path.basename(env['QTDIR']).replace('.', '_'),
|
||||
'5_4_1_OpenGL',
|
||||
# Read the QT version info
|
||||
with open(os.path.join(env['QTDIR'], 'mkspecs', 'qconfig.pri')) as qtinfo:
|
||||
for line in qtinfo:
|
||||
info = re.split(r'\s*=\s*', line.rstrip())
|
||||
if info[0] == 'QT_VERSION':
|
||||
env[info[0]] = info[1]
|
||||
elif '_VERSION' in info[0]:
|
||||
env[info[0]] = int(info[1])
|
||||
|
||||
build_dir = 'scons-ModOrganizer-QT_%s_%sfor_MSVS%d_32bit-%s' % (
|
||||
env['QT_VERSION'].replace('.', '_'),
|
||||
'OpenGL_' if 'opengl' in env['QTDIR'] else '',
|
||||
msvs_version,
|
||||
config.title())
|
||||
|
||||
# Put the sconsign file somewhere sane
|
||||
env.SConsignFile(os.path.join(build_dir, '.sconsign.dblite'))
|
||||
env.CacheDir(os.path.join(build_dir, '.cache'))
|
||||
|
||||
#this doesn't seem to work
|
||||
#env.VariantDir('build/$CONFIG', 'source')
|
||||
@@ -531,9 +539,6 @@ qt_env = env.Clone()
|
||||
if qt_env['CONFIG'] != 'debug':
|
||||
qt_env.AppendUnique(CPPDEFINES = [ 'QT_NO_DEBUG' ])
|
||||
|
||||
# Better way of working this out
|
||||
qt_env['QT_MAJOR_VERSION'] = 5 #int(os.path.basename(env['QTDIR']).split('.')[0])
|
||||
|
||||
qt_env.Tool('qt%d' % qt_env['QT_MAJOR_VERSION'])
|
||||
|
||||
# FIXME See if I can work out how to get official scons qt to work. Appears
|
||||
@@ -618,6 +623,20 @@ if qt_env['QT_MAJOR_VERSION'] > 4:
|
||||
]
|
||||
|
||||
# Finally, set up rules to install the DLLs.
|
||||
# use windeployqt.exe to install all required libraries
|
||||
#SET(windeploy_parameters --no-translations --no-plugins --libdir dlls --release-with-debug-info --no-compiler-runtime)
|
||||
#INSTALL(
|
||||
# CODE
|
||||
# "EXECUTE_PROCESS(
|
||||
# COMMAND
|
||||
# ${qt5bin}/windeployqt.exe ModOrganizer.exe ${windeploy_parameters}
|
||||
# COMMAND
|
||||
# ${qt5bin}/windeployqt.exe uibase.dll ${windeploy_parameters}
|
||||
# WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}/bin
|
||||
# )"
|
||||
#)
|
||||
# this should probably be a rule though it seems to produce an awful lot of
|
||||
# Stuff(TM). or a postaction
|
||||
|
||||
dll_path = os.path.join('$INSTALL_PATH', 'DLLs')
|
||||
|
||||
@@ -648,8 +667,12 @@ if 'WebKit' in libs_to_install and qt_env['QT_MAJOR_VERSION'] == 4:
|
||||
if qt_env['QT_MAJOR_VERSION'] > 4:
|
||||
# Guesswork a bit.
|
||||
dlls_to_install += [
|
||||
os.path.join(env['QTDIR'], 'bin', 'icu%s53.dll' % lib)
|
||||
for lib in ('dt','in', 'uc')
|
||||
os.path.join(env['QTDIR'],
|
||||
'bin',
|
||||
'icu%s%d%d.dll' % (lib,
|
||||
qt_env['QT_MAJOR_VERSION'],
|
||||
qt_env['QT_MINOR_VERSION'] - 1))
|
||||
for lib in ('dt','in', 'uc')
|
||||
]
|
||||
|
||||
platform_dlls = []
|
||||
|
||||
+23
-12
@@ -35,7 +35,8 @@ removing = None
|
||||
includes = dict()
|
||||
|
||||
adding = None
|
||||
added = dict()
|
||||
added = defaultdict(list)
|
||||
lcadded = dict()
|
||||
|
||||
foundline = None
|
||||
|
||||
@@ -69,9 +70,10 @@ def process_next_line(line, outfile):
|
||||
elif adding:
|
||||
m = re.match(r'.*class (.*);', line)
|
||||
if m:
|
||||
added[m.group(1)] = (adding, line)
|
||||
added[m.group(1)].append((adding, line))
|
||||
lcadded[m.group(1).lower() + '.h'] = m.group(1)
|
||||
else:
|
||||
added[line] = (adding, line)
|
||||
added[line].append((adding, line))
|
||||
elif removing:
|
||||
# Really we should stash these so that if we get a 'class xxx' in
|
||||
# the add lines we can print it here. also we could do the case
|
||||
@@ -79,12 +81,20 @@ def process_next_line(line, outfile):
|
||||
m = re.match(r'- #include [<"](.*)[">] +// lines (.*)-', line)
|
||||
if m:
|
||||
foundline = m.group(2)
|
||||
if m.group(1) in added:
|
||||
messages[removing].append(
|
||||
'%s(%s) : warning I0004: Replace include of %s with '
|
||||
'forward reference %s' % (
|
||||
removing, m.group(2), m.group(1), added[m.group(1)][1]))
|
||||
del added[m.group(1)]
|
||||
# Note: In this project at least we have a naming convention of
|
||||
# lower case filename and upper case classname.
|
||||
clname = m.group(1)
|
||||
if clname not in added:
|
||||
if clname in lcadded:
|
||||
clname = lcadded[clname]
|
||||
if clname in added:
|
||||
for item in added[clname]:
|
||||
if removing == item[0]:
|
||||
messages[removing].append(
|
||||
'%s(%s) : warning I0004: Replace include of %s'
|
||||
' with forward reference %s' % (
|
||||
removing, m.group(2), m.group(1), item[1]))
|
||||
del added[clname]
|
||||
else:
|
||||
messages[removing].append(
|
||||
'%s(%s) : warning I0001: Unnecessary include of %s' % (
|
||||
@@ -132,9 +142,10 @@ if foundline is None:
|
||||
foundline = '1'
|
||||
|
||||
for add in added:
|
||||
messages[added[add][0]].append(
|
||||
'%s(%s) : warning I0003: Need to include %s' % (
|
||||
added[add][0], foundline, added[add][1]))
|
||||
for item in added[add]:
|
||||
messages[item[0]].append(
|
||||
'%s(%s) : warning I0003: Need to include %s' % (
|
||||
item[0], foundline, item[1]))
|
||||
|
||||
for file in sorted(messages.keys(), reverse = True):
|
||||
for line in messages[file]:
|
||||
|
||||
@@ -2463,7 +2463,7 @@
|
||||
{ include: [ "@\"(QtCore/)?qglobal\\.h\"", "private", "<QtGlobal>", "public" ] },
|
||||
{ include: [ "@\"(QtCore/)?qnamespace\\.h\"", "private", "<Qt>", "public" ] },
|
||||
{ include: [ "@\"(QtCore/)?qlogging\\.h\"", "private", "<QtDebug>", "public" ] }, #qDebug, qWarning, etc
|
||||
{ include: [ "@\"(QtCore/)?qalgorithms\\.h\"", "private", "<QAlgorithms>", "public" ] }, #qSort, etc
|
||||
{ include: [ "@\"(QtCore/)?qalgorithms\\.h\"", "private", "<QtAlgorithms>", "public" ] }, #qSort, etc
|
||||
{ include: [ "@\"(QtWinExtras/)?qwinfunctions\\.h\"", "private", "<QtWin>", "public" ] }, # for fromHICON
|
||||
|
||||
# These ones are just madness. For instance, why with the above do we get
|
||||
|
||||
+21
-34
@@ -18,10 +18,6 @@ SET(organizer_SRCS
|
||||
settings.cpp
|
||||
selfupdater.cpp
|
||||
selectiondialog.cpp
|
||||
savegameinfowidgetgamebryo.cpp
|
||||
savegameinfowidget.cpp
|
||||
savegamegamebryo.cpp
|
||||
savegame.cpp
|
||||
queryoverwritedialog.cpp
|
||||
profilesdialog.cpp
|
||||
profile.cpp
|
||||
@@ -80,7 +76,6 @@ SET(organizer_SRCS
|
||||
previewdialog.cpp
|
||||
aboutdialog.cpp
|
||||
json.cpp
|
||||
safewritefile.cpp
|
||||
modflagicondelegate.cpp
|
||||
genericicondelegate.cpp
|
||||
organizerproxy.cpp
|
||||
@@ -89,18 +84,12 @@ SET(organizer_SRCS
|
||||
organizercore.cpp
|
||||
instancemanager.cpp
|
||||
usvfsconnector.cpp
|
||||
eventfilter.cpp
|
||||
|
||||
shared/inject.cpp
|
||||
shared/windows_error.cpp
|
||||
shared/error_report.cpp
|
||||
shared/directoryentry.cpp
|
||||
shared/gameinfo.cpp
|
||||
shared/oblivioninfo.cpp
|
||||
shared/fallout3info.cpp
|
||||
shared/fallout4info.cpp
|
||||
shared/falloutnvinfo.cpp
|
||||
shared/util.cpp
|
||||
shared/skyriminfo.cpp
|
||||
shared/appconfig.cpp
|
||||
shared/leaktrace.cpp
|
||||
shared/stackdata.cpp
|
||||
@@ -115,10 +104,6 @@ SET(organizer_HDRS
|
||||
settings.h
|
||||
selfupdater.h
|
||||
selectiondialog.h
|
||||
savegameinfowidgetgamebryo.h
|
||||
savegameinfowidget.h
|
||||
savegamegamebyro.h
|
||||
savegame.h
|
||||
queryoverwritedialog.h
|
||||
profilesdialog.h
|
||||
profile.h
|
||||
@@ -176,7 +161,6 @@ SET(organizer_HDRS
|
||||
previewdialog.h
|
||||
aboutdialog.h
|
||||
json.h
|
||||
safewritefile.h
|
||||
modflagicondelegate.h
|
||||
genericicondelegate.h
|
||||
organizerproxy.h
|
||||
@@ -186,18 +170,12 @@ SET(organizer_HDRS
|
||||
iuserinterface.h
|
||||
instancemanager.h
|
||||
usvfsconnector.h
|
||||
eventfilter.h
|
||||
|
||||
shared/inject.h
|
||||
shared/windows_error.h
|
||||
shared/error_report.h
|
||||
shared/directoryentry.h
|
||||
shared/gameinfo.h
|
||||
shared/oblivioninfo.h
|
||||
shared/fallout3info.h
|
||||
shared/fallout4info.h
|
||||
shared/falloutnvinfo.h
|
||||
shared/util.h
|
||||
shared/skyriminfo.h
|
||||
shared/appconfig.h
|
||||
shared/appconfig.inc
|
||||
shared/leaktrace.h
|
||||
@@ -210,7 +188,6 @@ SET(organizer_UIS
|
||||
simpleinstalldialog.ui
|
||||
settingsdialog.ui
|
||||
selectiondialog.ui
|
||||
savegameinfowidget.ui
|
||||
queryoverwritedialog.ui
|
||||
profilesdialog.ui
|
||||
overwriteinfodialog.ui
|
||||
@@ -260,15 +237,17 @@ FIND_PACKAGE(Qt5Declarative REQUIRED)
|
||||
FIND_PACKAGE(Qt5Network REQUIRED)
|
||||
FIND_PACKAGE(Qt5WinExtras REQUIRED)
|
||||
FIND_PACKAGE(Qt5WebKitWidgets REQUIRED)
|
||||
FIND_PACKAGE(Qt5LinguistTools)
|
||||
QT5_WRAP_UI(organizer_UIHDRS ${organizer_UIS})
|
||||
QT5_ADD_RESOURCES(organizer_RCCPPS ${organizer_QRCS})
|
||||
QT5_CREATE_TRANSLATION(organizer_translations_qm ${CMAKE_SOURCE_DIR}/src ${CMAKE_SOURCE_DIR}/src/organizer_en.ts)
|
||||
|
||||
INCLUDE_DIRECTORIES(${Qt5Declarative_INCLUDES})
|
||||
|
||||
ADD_DEFINITIONS(-DQT_MESSAGELOGCONTEXT)
|
||||
|
||||
# Boost
|
||||
SET(Boost_USE_STATIC_LIBS ON)
|
||||
SET(Boost_USE_STATIC_LIBS OFF)
|
||||
SET(Boost_USE_MULTITHREADED ON)
|
||||
SET(Boost_USE_STATIC_RUNTIME OFF)
|
||||
FIND_PACKAGE(Boost REQUIRED)
|
||||
@@ -295,16 +274,22 @@ INCLUDE_DIRECTORIES(${project_path}/uibase/src
|
||||
${project_path}/archive/src
|
||||
${project_path}/../usvfs/usvfs
|
||||
${project_path}/game_gamebryo/src
|
||||
${project_path}/game_features/src)
|
||||
|
||||
MESSAGE(STATUS ${project_path}/gameGamebryo/src)
|
||||
${project_path}/game_features/src
|
||||
${project_path}/githubpp/src)
|
||||
|
||||
|
||||
INCLUDE_DIRECTORIES(shared ${ZLIB_INCLUDE_DIRS})
|
||||
LINK_DIRECTORIES(${lib_path}
|
||||
${project_path}/../zlib/lib)
|
||||
|
||||
ADD_DEFINITIONS(-D_UNICODE -DUNICODE -DNOMINMAX -D_CRT_SECURE_NO_WARNINGS)
|
||||
EXECUTE_PROCESS(
|
||||
COMMAND git log -1 --format=%h
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
OUTPUT_VARIABLE GIT_COMMIT_HASH
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
|
||||
ADD_DEFINITIONS(-D_UNICODE -DUNICODE -DNOMINMAX -D_CRT_SECURE_NO_WARNINGS -DGITID="${GIT_COMMIT_HASH}")
|
||||
|
||||
IF("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
|
||||
SET(usvfs_name usvfs_x64)
|
||||
@@ -312,16 +297,18 @@ ELSE()
|
||||
SET(usvfs_name usvfs_x86)
|
||||
ENDIF()
|
||||
|
||||
ADD_EXECUTABLE(ModOrganizer WIN32 ${organizer_HDRS} ${organizer_SRCS} ${organizer_UIHDRS} ${organizer_RCS} ${organizer_RCCPPS})
|
||||
ADD_EXECUTABLE(ModOrganizer WIN32 ${organizer_HDRS} ${organizer_SRCS} ${organizer_UIHDRS} ${organizer_RCS} ${organizer_RCCPPS} ${organizer_translations_qm})
|
||||
TARGET_LINK_LIBRARIES(ModOrganizer
|
||||
Qt5::Widgets Qt5::WinExtras Qt5::WebKitWidgets
|
||||
${Boost_LIBRARIES}
|
||||
zlibstatic
|
||||
uibase esptk bsatk
|
||||
uibase esptk bsatk githubpp
|
||||
${usvfs_name}
|
||||
Dbghelp advapi32 Version Shlwapi)
|
||||
|
||||
SET_TARGET_PROPERTIES(ModOrganizer PROPERTIES COMPILE_FLAGS /GL)
|
||||
IF (NOT "${OPTIMIZE_COMPILE_FLAGS}" STREQUAL "")
|
||||
SET_TARGET_PROPERTIES(ModOrganizer PROPERTIES COMPILE_FLAGS_RELWITHDEBINFO
|
||||
${OPTIMIZE_COMPILE_FLAGS})
|
||||
ENDIF()
|
||||
SET_TARGET_PROPERTIES(ModOrganizer PROPERTIES LINK_FLAGS_RELWITHDEBINFO
|
||||
"/LARGEADDRESSAWARE ${OPTIMIZE_LINK_FLAGS}")
|
||||
|
||||
|
||||
+12
-1
@@ -22,6 +22,14 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
|
||||
#include "ui_aboutdialog.h"
|
||||
#include <utility.h>
|
||||
|
||||
#include <QApplication>
|
||||
#include <QLabel>
|
||||
#include <QListWidget>
|
||||
#include <QListWidgetItem>
|
||||
#include <QTextBrowser>
|
||||
#include <QVariant>
|
||||
#include <Qt>
|
||||
|
||||
|
||||
AboutDialog::AboutDialog(const QString &version, QWidget *parent)
|
||||
: QDialog(parent)
|
||||
@@ -46,10 +54,13 @@ AboutDialog::AboutDialog(const QString &version, QWidget *parent)
|
||||
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);
|
||||
addLicense("LOOT", LICENSE_GPL3);
|
||||
|
||||
ui->nameLabel->setText(QString("<span style=\"font-size:12pt; font-weight:600;\">%1 %2</span>").arg(ui->nameLabel->text()).arg(version));
|
||||
#ifdef HGID
|
||||
#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
|
||||
|
||||
+4
-3
@@ -22,10 +22,11 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
|
||||
#define ABOUTDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
#include <QListWidgetItem>
|
||||
class QListWidgetItem;
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
|
||||
#include <map>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
|
||||
namespace Ui {
|
||||
class AboutDialog;
|
||||
|
||||
+48
-6
@@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>508</width>
|
||||
<height>335</height>
|
||||
<width>604</width>
|
||||
<height>369</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@@ -18,13 +18,50 @@
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<spacer name="verticalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="iconLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>250</width>
|
||||
<height>250</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>250</width>
|
||||
<height>250</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap resource="resources.qrc">:/MO/gui/mo_icon.ico</pixmap>
|
||||
<pixmap resource="resources.qrc">:/MO/gui/splash</pixmap>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -83,7 +120,7 @@
|
||||
<item>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string notr="true">Copyright 2011-2015 Sebastian Herbord</string>
|
||||
<string notr="true">Copyright 2011-2016 Sebastian Herbord</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -114,7 +151,7 @@
|
||||
</widget>
|
||||
<widget class="QWidget" name="credits">
|
||||
<attribute name="title">
|
||||
<string>Credits</string>
|
||||
<string>Thanks</string>
|
||||
</attribute>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
@@ -202,7 +239,7 @@
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_2">
|
||||
<property name="title">
|
||||
<string>Others</string>
|
||||
<string>Other Supporter</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_7">
|
||||
<item>
|
||||
@@ -265,6 +302,11 @@
|
||||
<string notr="true">thosrtanner</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>ogrotten</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
|
||||
+13
-14
@@ -21,37 +21,36 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
|
||||
#include "ui_activatemodsdialog.h"
|
||||
|
||||
#include <QComboBox>
|
||||
#include <QHeaderView>
|
||||
#include <QLabel>
|
||||
#include <QString>
|
||||
#include <QTableWidget>
|
||||
|
||||
ActivateModsDialog::ActivateModsDialog(const std::map<QString, std::vector<QString> > &missingPlugins, QWidget *parent)
|
||||
#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();
|
||||
#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());
|
||||
modsTable->setRowCount(missingAssets.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) {
|
||||
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 (std::vector<QString>::const_iterator modIter = espIter->second.begin();
|
||||
modIter != espIter->second.end(); ++modIter) {
|
||||
combo->addItem(*modIter);
|
||||
for (QString const &mod : espIter.value()) {
|
||||
combo->addItem(mod);
|
||||
}
|
||||
modsTable->setCellWidget(row, 1, combo);
|
||||
}
|
||||
|
||||
@@ -20,8 +20,14 @@ 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 <map>
|
||||
|
||||
#include <QObject>
|
||||
|
||||
class QString;
|
||||
class QWidget;
|
||||
|
||||
#include <set>
|
||||
|
||||
namespace Ui {
|
||||
@@ -42,7 +48,7 @@ public:
|
||||
* @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);
|
||||
explicit ActivateModsDialog(SaveGameInfo::MissingAssets const &missingAssets, QWidget *parent = 0);
|
||||
~ActivateModsDialog();
|
||||
|
||||
/**
|
||||
|
||||
+5
-1
@@ -44,6 +44,10 @@ QString CategoryFactory::categoriesFilePath()
|
||||
CategoryFactory::CategoryFactory()
|
||||
{
|
||||
atexit(&cleanup);
|
||||
}
|
||||
|
||||
void CategoryFactory::loadCategories()
|
||||
{
|
||||
reset();
|
||||
|
||||
QFile categoryFile(categoriesFilePath());
|
||||
@@ -188,7 +192,7 @@ int CategoryFactory::addCategory(const QString &name, const std::vector<int> &ne
|
||||
|
||||
void CategoryFactory::addCategory(int id, const QString &name, const std::vector<int> &nexusIDs, int parentID)
|
||||
{
|
||||
int index = m_Categories.size();
|
||||
int index = static_cast<int>(m_Categories.size());
|
||||
m_Categories.push_back(Category(index, id, name, nexusIDs, parentID));
|
||||
for (int nexusID : nexusIDs) {
|
||||
m_NexusMap[nexusID] = index;
|
||||
|
||||
@@ -75,6 +75,11 @@ public:
|
||||
**/
|
||||
void reset();
|
||||
|
||||
/**
|
||||
* @brief read categories from file
|
||||
*/
|
||||
void loadCategories();
|
||||
|
||||
/**
|
||||
* @brief save the categories to the categories.dat file
|
||||
**/
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>282</width>
|
||||
<width>294</width>
|
||||
<height>156</height>
|
||||
</rect>
|
||||
</property>
|
||||
@@ -25,29 +25,25 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<layout class="QFormLayout" name="formLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Username</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="usernameEdit"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Password</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="passwordEdit">
|
||||
<property name="echoMode">
|
||||
<enum>QLineEdit::Password</enum>
|
||||
|
||||
@@ -159,7 +159,7 @@ void DirectoryRefresher::refresh()
|
||||
} catch (const std::exception &e) {
|
||||
emit error(tr("failed to read mod (%1): %2").arg(iter->modName, e.what()));
|
||||
}
|
||||
emit progress((i * 100) / m_Mods.size() + 1);
|
||||
emit progress((i * 100) / static_cast<int>(m_Mods.size()) + 1);
|
||||
}
|
||||
|
||||
emit progress(100);
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
|
||||
<assemblyIdentity type="win32" name="dlls" version="1.0.0.0" processorArchitecture="x86"/>
|
||||
<file name="icuin53.dll"/>
|
||||
<file name="icuuc53.dll"/>
|
||||
<file name="icudt53.dll"/>
|
||||
<file name="icuin54.dll"/>
|
||||
<file name="icuuc54.dll"/>
|
||||
<file name="icudt54.dll"/>
|
||||
<file name="Qt5Cored.dll"/>
|
||||
<file name="Qt5Declaratived.dll"/>
|
||||
<file name="Qt5Guid.dll"/>
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
|
||||
<assemblyIdentity type="win32" name="dlls" version="1.0.0.0" processorArchitecture="x86"/>
|
||||
<file name="icuin53.dll"/>
|
||||
<file name="icuuc53.dll"/>
|
||||
<file name="icudt53.dll"/>
|
||||
<file name="icuin54.dll"/>
|
||||
<file name="icuuc54.dll"/>
|
||||
<file name="icudt54.dll"/>
|
||||
<file name="libeay32.dll"/>
|
||||
<file name="ssleay32.dll"/>
|
||||
<file name="Qt5Core.dll"/>
|
||||
<file name="Qt5Declarative.dll"/>
|
||||
<file name="Qt5Gui.dll"/>
|
||||
|
||||
+36
-32
@@ -88,7 +88,8 @@ DownloadManager::DownloadInfo *DownloadManager::DownloadInfo::createFromMeta(con
|
||||
QString fileName = QFileInfo(filePath).fileName();
|
||||
|
||||
if (fileName.endsWith(UNFINISHED)) {
|
||||
info->m_FileName = fileName.mid(0, fileName.length() - strlen(UNFINISHED));
|
||||
info->m_FileName = fileName.mid(
|
||||
0, fileName.length() - static_cast<int>(strlen(UNFINISHED)));
|
||||
info->m_State = STATE_PAUSED;
|
||||
} else {
|
||||
info->m_FileName = fileName;
|
||||
@@ -471,7 +472,7 @@ void DownloadManager::addNXMDownload(const QString &url)
|
||||
void DownloadManager::removeFile(int index, bool deleteFile)
|
||||
{
|
||||
if (index >= m_ActiveDownloads.size()) {
|
||||
throw MyException(tr("invalid index"));
|
||||
throw MyException(tr("remove: invalid download index %1").arg(index));
|
||||
}
|
||||
|
||||
DownloadInfo *download = m_ActiveDownloads.at(index);
|
||||
@@ -538,7 +539,7 @@ void DownloadManager::refreshAlphabeticalTranslation()
|
||||
void DownloadManager::restoreDownload(int index)
|
||||
{
|
||||
if ((index < 0) || (index >= m_ActiveDownloads.size())) {
|
||||
throw MyException(tr("invalid index"));
|
||||
throw MyException(tr("restore: invalid download index: %1").arg(index));
|
||||
}
|
||||
|
||||
DownloadInfo *download = m_ActiveDownloads.at(index);
|
||||
@@ -571,7 +572,7 @@ void DownloadManager::removeDownload(int index, bool deleteFile)
|
||||
}
|
||||
} else {
|
||||
if (index >= m_ActiveDownloads.size()) {
|
||||
reportError(tr("invalid index %1").arg(index));
|
||||
reportError(tr("remove: invalid download index %1").arg(index));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -589,7 +590,7 @@ void DownloadManager::removeDownload(int index, bool deleteFile)
|
||||
void DownloadManager::cancelDownload(int index)
|
||||
{
|
||||
if ((index < 0) || (index >= m_ActiveDownloads.size())) {
|
||||
reportError(tr("invalid index %1").arg(index));
|
||||
reportError(tr("cancel: invalid download index %1").arg(index));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -602,7 +603,7 @@ void DownloadManager::cancelDownload(int index)
|
||||
void DownloadManager::pauseDownload(int index)
|
||||
{
|
||||
if ((index < 0) || (index >= m_ActiveDownloads.size())) {
|
||||
reportError(tr("invalid index %1").arg(index));
|
||||
reportError(tr("pause: invalid download index %1").arg(index));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -622,7 +623,7 @@ void DownloadManager::pauseDownload(int index)
|
||||
void DownloadManager::resumeDownload(int index)
|
||||
{
|
||||
if ((index < 0) || (index >= m_ActiveDownloads.size())) {
|
||||
reportError(tr("invalid index %1").arg(index));
|
||||
reportError(tr("resume: invalid download index %1").arg(index));
|
||||
return;
|
||||
}
|
||||
DownloadInfo *info = m_ActiveDownloads[index];
|
||||
@@ -633,7 +634,7 @@ void DownloadManager::resumeDownload(int index)
|
||||
void DownloadManager::resumeDownloadInt(int index)
|
||||
{
|
||||
if ((index < 0) || (index >= m_ActiveDownloads.size())) {
|
||||
reportError(tr("invalid index %1").arg(index));
|
||||
reportError(tr("resume (int): invalid download index %1").arg(index));
|
||||
return;
|
||||
}
|
||||
DownloadInfo *info = m_ActiveDownloads[index];
|
||||
@@ -673,7 +674,7 @@ DownloadManager::DownloadInfo *DownloadManager::downloadInfoByID(unsigned int id
|
||||
void DownloadManager::queryInfo(int index)
|
||||
{
|
||||
if ((index < 0) || (index >= m_ActiveDownloads.size())) {
|
||||
reportError(tr("invalid index %1").arg(index));
|
||||
reportError(tr("query: invalid download index %1").arg(index));
|
||||
return;
|
||||
}
|
||||
DownloadInfo *info = m_ActiveDownloads[index];
|
||||
@@ -721,7 +722,7 @@ int DownloadManager::numPendingDownloads() const
|
||||
std::pair<int, int> DownloadManager::getPendingDownload(int index)
|
||||
{
|
||||
if ((index < 0) || (index >= m_PendingDownloads.size())) {
|
||||
throw MyException(tr("invalid index"));
|
||||
throw MyException(tr("get pending: invalid download index %1").arg(index));
|
||||
}
|
||||
|
||||
return m_PendingDownloads.at(index);
|
||||
@@ -730,7 +731,7 @@ std::pair<int, int> DownloadManager::getPendingDownload(int index)
|
||||
QString DownloadManager::getFilePath(int index) const
|
||||
{
|
||||
if ((index < 0) || (index >= m_ActiveDownloads.size())) {
|
||||
throw MyException(tr("invalid index"));
|
||||
throw MyException(tr("get path: invalid download index %1").arg(index));
|
||||
}
|
||||
|
||||
return m_OutputDirectory + "/" + m_ActiveDownloads.at(index)->m_FileName;
|
||||
@@ -751,24 +752,27 @@ QString DownloadManager::getFileTypeString(int fileType)
|
||||
QString DownloadManager::getDisplayName(int index) const
|
||||
{
|
||||
if ((index < 0) || (index >= m_ActiveDownloads.size())) {
|
||||
throw MyException(tr("invalid index"));
|
||||
throw MyException(tr("display name: invalid download index %1").arg(index));
|
||||
}
|
||||
|
||||
DownloadInfo *info = m_ActiveDownloads.at(index);
|
||||
|
||||
QTextDocument doc;
|
||||
if (!info->m_FileInfo->name.isEmpty()) {
|
||||
return QString("%1 (%2, v%3)").arg(info->m_FileInfo->name)
|
||||
doc.setHtml(info->m_FileInfo->name);
|
||||
return QString("%1 (%2, v%3)").arg(doc.toPlainText())
|
||||
.arg(getFileTypeString(info->m_FileInfo->fileCategory))
|
||||
.arg(info->m_FileInfo->version.displayString());
|
||||
} else {
|
||||
return info->m_FileName;
|
||||
doc.setHtml(info->m_FileName);
|
||||
return doc.toPlainText();
|
||||
}
|
||||
}
|
||||
|
||||
QString DownloadManager::getFileName(int index) const
|
||||
{
|
||||
if ((index < 0) || (index >= m_ActiveDownloads.size())) {
|
||||
throw MyException(tr("invalid index"));
|
||||
throw MyException(tr("file name: invalid download index %1").arg(index));
|
||||
}
|
||||
|
||||
return m_ActiveDownloads.at(index)->m_FileName;
|
||||
@@ -777,7 +781,7 @@ QString DownloadManager::getFileName(int index) const
|
||||
QDateTime DownloadManager::getFileTime(int index) const
|
||||
{
|
||||
if ((index < 0) || (index >= m_ActiveDownloads.size())) {
|
||||
throw MyException(tr("invalid index"));
|
||||
throw MyException(tr("file time: invalid download index %1").arg(index));
|
||||
}
|
||||
|
||||
DownloadInfo *info = m_ActiveDownloads.at(index);
|
||||
@@ -791,7 +795,7 @@ QDateTime DownloadManager::getFileTime(int index) const
|
||||
qint64 DownloadManager::getFileSize(int index) const
|
||||
{
|
||||
if ((index < 0) || (index >= m_ActiveDownloads.size())) {
|
||||
throw MyException(tr("invalid index"));
|
||||
throw MyException(tr("file size: invalid download index %1").arg(index));
|
||||
}
|
||||
|
||||
return m_ActiveDownloads.at(index)->m_TotalSize;
|
||||
@@ -801,7 +805,7 @@ qint64 DownloadManager::getFileSize(int index) const
|
||||
int DownloadManager::getProgress(int index) const
|
||||
{
|
||||
if ((index < 0) || (index >= m_ActiveDownloads.size())) {
|
||||
throw MyException(tr("invalid index"));
|
||||
throw MyException(tr("progress: invalid download index %1").arg(index));
|
||||
}
|
||||
|
||||
return m_ActiveDownloads.at(index)->m_Progress;
|
||||
@@ -811,7 +815,7 @@ int DownloadManager::getProgress(int index) const
|
||||
DownloadManager::DownloadState DownloadManager::getState(int index) const
|
||||
{
|
||||
if ((index < 0) || (index >= m_ActiveDownloads.size())) {
|
||||
throw MyException(tr("invalid index"));
|
||||
throw MyException(tr("state: invalid download index %1").arg(index));
|
||||
}
|
||||
|
||||
return m_ActiveDownloads.at(index)->m_State;
|
||||
@@ -821,7 +825,7 @@ DownloadManager::DownloadState DownloadManager::getState(int index) const
|
||||
bool DownloadManager::isInfoIncomplete(int index) const
|
||||
{
|
||||
if ((index < 0) || (index >= m_ActiveDownloads.size())) {
|
||||
throw MyException(tr("invalid index"));
|
||||
throw MyException(tr("infocomplete: invalid download index %1").arg(index));
|
||||
}
|
||||
|
||||
DownloadInfo *info = m_ActiveDownloads.at(index);
|
||||
@@ -836,7 +840,7 @@ bool DownloadManager::isInfoIncomplete(int index) const
|
||||
int DownloadManager::getModID(int index) const
|
||||
{
|
||||
if ((index < 0) || (index >= m_ActiveDownloads.size())) {
|
||||
throw MyException(tr("invalid index"));
|
||||
throw MyException(tr("mod id: invalid download index %1").arg(index));
|
||||
}
|
||||
return m_ActiveDownloads.at(index)->m_FileInfo->modID;
|
||||
}
|
||||
@@ -844,7 +848,7 @@ int DownloadManager::getModID(int index) const
|
||||
bool DownloadManager::isHidden(int index) const
|
||||
{
|
||||
if ((index < 0) || (index >= m_ActiveDownloads.size())) {
|
||||
throw MyException(tr("invalid index"));
|
||||
throw MyException(tr("ishidden: invalid download index %1").arg(index));
|
||||
}
|
||||
return m_ActiveDownloads.at(index)->m_Hidden;
|
||||
}
|
||||
@@ -853,7 +857,7 @@ bool DownloadManager::isHidden(int index) const
|
||||
const ModRepositoryFileInfo *DownloadManager::getFileInfo(int index) const
|
||||
{
|
||||
if ((index < 0) || (index >= m_ActiveDownloads.size())) {
|
||||
throw MyException(tr("invalid index"));
|
||||
throw MyException(tr("file info: invalid download index %1").arg(index));
|
||||
}
|
||||
|
||||
return m_ActiveDownloads.at(index)->m_FileInfo;
|
||||
@@ -863,7 +867,7 @@ const ModRepositoryFileInfo *DownloadManager::getFileInfo(int index) const
|
||||
void DownloadManager::markInstalled(int index)
|
||||
{
|
||||
if ((index < 0) || (index >= m_ActiveDownloads.size())) {
|
||||
throw MyException(tr("invalid index"));
|
||||
throw MyException(tr("mark installed: invalid download index %1").arg(index));
|
||||
}
|
||||
|
||||
DownloadInfo *info = m_ActiveDownloads.at(index);
|
||||
@@ -878,7 +882,7 @@ void DownloadManager::markInstalled(int index)
|
||||
void DownloadManager::markUninstalled(int index)
|
||||
{
|
||||
if ((index < 0) || (index >= m_ActiveDownloads.size())) {
|
||||
throw MyException(tr("invalid index"));
|
||||
throw MyException(tr("mark uninstalled: invalid download index %1").arg(index));
|
||||
}
|
||||
|
||||
DownloadInfo *info = m_ActiveDownloads.at(index);
|
||||
@@ -1057,7 +1061,9 @@ void DownloadManager::nxmDescriptionAvailable(int, QVariant userData, QVariant r
|
||||
DownloadInfo *info = downloadInfoByID(userData.toInt());
|
||||
if (info == nullptr) return;
|
||||
info->m_FileInfo->categoryID = result["category_id"].toInt();
|
||||
info->m_FileInfo->modName = result["name"].toString().trimmed();
|
||||
QTextDocument doc;
|
||||
doc.setHtml(result["name"].toString().trimmed());
|
||||
info->m_FileInfo->modName = doc.toPlainText();
|
||||
info->m_FileInfo->newestVersion.parse(result["version"].toString());
|
||||
if (info->m_FileInfo->fileID != 0) {
|
||||
setState(info, STATE_READY);
|
||||
@@ -1115,7 +1121,7 @@ void DownloadManager::nxmFilesAvailable(int, QVariant userData, QVariant resultD
|
||||
|
||||
bool found = false;
|
||||
|
||||
foreach(QVariant file, result) {
|
||||
for (QVariant file : result) {
|
||||
QVariantMap fileInfo = file.toMap();
|
||||
QString fileName = fileInfo["uri"].toString();
|
||||
QString fileNameVariant = fileName.mid(0).replace(' ', '_');
|
||||
@@ -1126,12 +1132,10 @@ void DownloadManager::nxmFilesAvailable(int, QVariant userData, QVariant resultD
|
||||
if (!info->m_FileInfo->version.isValid()) {
|
||||
info->m_FileInfo->version = info->m_FileInfo->newestVersion;
|
||||
}
|
||||
//Nexus has HTMLd these so unhtml them if necessary
|
||||
// we receive some names html-encoded. This is used to decode it
|
||||
QTextDocument doc;
|
||||
doc.setHtml(info->m_FileInfo->modName);
|
||||
doc.setHtml(fileInfo["modName"].toString());
|
||||
info->m_FileInfo->modName = doc.toPlainText();
|
||||
doc.setHtml(info->m_FileInfo->name);
|
||||
info->m_FileInfo->name = doc.toPlainText();
|
||||
info->m_FileInfo->fileCategory = convertFileCategory(fileInfo["category_id"].toInt());
|
||||
info->m_FileInfo->fileTime = matchDate(fileInfo["date"].toString());
|
||||
info->m_FileInfo->fileID = fileInfo["id"].toInt();
|
||||
@@ -1147,7 +1151,7 @@ void DownloadManager::nxmFilesAvailable(int, QVariant userData, QVariant resultD
|
||||
emit showMessage(tr("No matching file found on Nexus! Maybe this file is no longer available or it was renamed?"));
|
||||
} else {
|
||||
SelectionDialog selection(tr("No file on Nexus matches the selected file by name. Please manually choose the correct one."));
|
||||
foreach(QVariant file, result) {
|
||||
for (QVariant file : result) {
|
||||
QVariantMap fileInfo = file.toMap();
|
||||
selection.addChoice(fileInfo["uri"].toString(), "", file);
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
|
||||
#include "ui_editexecutablesdialog.h"
|
||||
#include "filedialogmemory.h"
|
||||
#include "stackdata.h"
|
||||
#include "modlist.h"
|
||||
#include <QMessageBox>
|
||||
#include <Shellapi.h>
|
||||
#include <utility.h>
|
||||
@@ -29,15 +30,20 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
|
||||
using namespace MOBase;
|
||||
using namespace MOShared;
|
||||
|
||||
EditExecutablesDialog::EditExecutablesDialog(const ExecutablesList &executablesList, QWidget *parent)
|
||||
EditExecutablesDialog::EditExecutablesDialog(
|
||||
const ExecutablesList &executablesList, const ModList &modList,
|
||||
Profile *profile, QWidget *parent)
|
||||
: TutorableDialog("EditExecutables", parent)
|
||||
, ui(new Ui::EditExecutablesDialog)
|
||||
, m_CurrentItem(nullptr)
|
||||
, m_ExecutablesList(executablesList)
|
||||
, m_Profile(profile)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
refreshExecutablesWidget();
|
||||
|
||||
ui->newFilesModBox->addItems(modList.allMods());
|
||||
}
|
||||
|
||||
EditExecutablesDialog::~EditExecutablesDialog()
|
||||
@@ -86,23 +92,30 @@ void EditExecutablesDialog::resetInput()
|
||||
ui->appIDOverwriteEdit->clear();
|
||||
ui->overwriteAppIDBox->setChecked(false);
|
||||
ui->useAppIconCheckBox->setChecked(false);
|
||||
ui->newFilesModCheckBox->setChecked(false);
|
||||
m_CurrentItem = nullptr;
|
||||
}
|
||||
|
||||
|
||||
void EditExecutablesDialog::saveExecutable()
|
||||
{
|
||||
m_ExecutablesList.updateExecutable(ui->titleEdit->text(),
|
||||
QDir::fromNativeSeparators(ui->binaryEdit->text()),
|
||||
ui->argumentsEdit->text(),
|
||||
QDir::fromNativeSeparators(ui->workingDirEdit->text()),
|
||||
ui->overwriteAppIDBox->isChecked() ?
|
||||
ui->appIDOverwriteEdit->text() : "",
|
||||
Executable::UseApplicationIcon | Executable::CustomExecutable,
|
||||
(ui->useAppIconCheckBox->isChecked() ?
|
||||
Executable::UseApplicationIcon : Executable::Flags())
|
||||
| Executable::CustomExecutable);
|
||||
m_ExecutablesList.updateExecutable(
|
||||
ui->titleEdit->text(),
|
||||
QDir::fromNativeSeparators(ui->binaryEdit->text()),
|
||||
ui->argumentsEdit->text(),
|
||||
QDir::fromNativeSeparators(ui->workingDirEdit->text()),
|
||||
ui->overwriteAppIDBox->isChecked() ?
|
||||
ui->appIDOverwriteEdit->text() : "",
|
||||
Executable::UseApplicationIcon | Executable::CustomExecutable,
|
||||
(ui->useAppIconCheckBox->isChecked() ?
|
||||
Executable::UseApplicationIcon : Executable::Flags())
|
||||
| Executable::CustomExecutable);
|
||||
|
||||
if (ui->newFilesModCheckBox->isChecked()) {
|
||||
m_Profile->storeSetting("custom_overwrites", ui->titleEdit->text(),
|
||||
ui->newFilesModBox->currentText());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void EditExecutablesDialog::delayedRefresh()
|
||||
@@ -126,15 +139,17 @@ void EditExecutablesDialog::on_addButton_clicked()
|
||||
|
||||
void EditExecutablesDialog::on_browseButton_clicked()
|
||||
{
|
||||
QString binaryName = FileDialogMemory::getOpenFileName("editExecutableBinary", this,
|
||||
tr("Select a binary"), QString(), tr("Executable (%1)").arg("*.exe *.bat *.jar"));
|
||||
QString binaryName = FileDialogMemory::getOpenFileName(
|
||||
"editExecutableBinary", this, tr("Select a binary"), QString(),
|
||||
tr("Executable (%1)").arg("*.exe *.bat *.jar"));
|
||||
|
||||
if (binaryName.endsWith(".jar", Qt::CaseInsensitive)) {
|
||||
QString binaryPath;
|
||||
{ // try to find java automatically
|
||||
std::wstring binaryNameW = ToWString(binaryName);
|
||||
WCHAR buffer[MAX_PATH];
|
||||
if (::FindExecutableW(binaryNameW.c_str(), nullptr, buffer) > (HINSTANCE)32) {
|
||||
if (::FindExecutableW(binaryNameW.c_str(), nullptr, buffer)
|
||||
> reinterpret_cast<HINSTANCE>(32)) {
|
||||
DWORD binaryType = 0UL;
|
||||
if (!::GetBinaryTypeW(binaryNameW.c_str(), &binaryType)) {
|
||||
qDebug("failed to determine binary type of \"%ls\": %lu", binaryNameW.c_str(), ::GetLastError());
|
||||
@@ -210,8 +225,13 @@ bool EditExecutablesDialog::executableChanged()
|
||||
{
|
||||
if (m_CurrentItem != nullptr) {
|
||||
Executable const &selectedExecutable(m_ExecutablesList.find(m_CurrentItem->text()));
|
||||
|
||||
QString storedCustomOverwrite = m_Profile->setting("custom_overwrites", selectedExecutable.m_Title).toString();
|
||||
|
||||
return selectedExecutable.m_Arguments != ui->argumentsEdit->text()
|
||||
|| selectedExecutable.m_SteamAppID != ui->appIDOverwriteEdit->text()
|
||||
|| !storedCustomOverwrite.isEmpty() != ui->newFilesModCheckBox->isChecked()
|
||||
|| !storedCustomOverwrite.isEmpty() && (storedCustomOverwrite != ui->newFilesModBox->currentText())
|
||||
|| selectedExecutable.m_WorkingDirectory != QDir::fromNativeSeparators(ui->workingDirEdit->text())
|
||||
|| selectedExecutable.m_BinaryInfo.absoluteFilePath() != QDir::fromNativeSeparators(ui->binaryEdit->text())
|
||||
|| selectedExecutable.usesOwnIcon() != ui->useAppIconCheckBox->isChecked();
|
||||
@@ -294,5 +314,23 @@ void EditExecutablesDialog::on_executablesListBox_clicked(const QModelIndex &cur
|
||||
ui->appIDOverwriteEdit->clear();
|
||||
}
|
||||
ui->useAppIconCheckBox->setChecked(selectedExecutable.usesOwnIcon());
|
||||
|
||||
int index = -1;
|
||||
|
||||
QString customOverwrite = m_Profile->setting("custom_overwrites", selectedExecutable.m_Title).toString();
|
||||
if (!customOverwrite.isEmpty()) {
|
||||
index = ui->newFilesModBox->findText(customOverwrite);
|
||||
qDebug("find %s -> %d", qPrintable(customOverwrite), index);
|
||||
}
|
||||
|
||||
ui->newFilesModCheckBox->setChecked(index != -1);
|
||||
if (index != -1) {
|
||||
ui->newFilesModBox->setCurrentIndex(index);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void EditExecutablesDialog::on_newFilesModCheckBox_toggled(bool checked)
|
||||
{
|
||||
ui->newFilesModBox->setEnabled(checked);
|
||||
}
|
||||
|
||||
@@ -24,11 +24,16 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
|
||||
#include <QListWidgetItem>
|
||||
#include <QTimer>
|
||||
#include "executableslist.h"
|
||||
#include "profile.h"
|
||||
|
||||
namespace Ui {
|
||||
class EditExecutablesDialog;
|
||||
}
|
||||
|
||||
|
||||
class ModList;
|
||||
|
||||
|
||||
/**
|
||||
* @brief Dialog to manage the list of executables
|
||||
**/
|
||||
@@ -44,7 +49,10 @@ public:
|
||||
* @param executablesList current list of executables
|
||||
* @param parent parent widget
|
||||
**/
|
||||
explicit EditExecutablesDialog(const ExecutablesList &executablesList, QWidget *parent = 0);
|
||||
explicit EditExecutablesDialog(const ExecutablesList &executablesList,
|
||||
const ModList &modList,
|
||||
Profile *profile,
|
||||
QWidget *parent = 0);
|
||||
|
||||
~EditExecutablesDialog();
|
||||
|
||||
@@ -56,6 +64,10 @@ public:
|
||||
ExecutablesList getExecutablesList() const;
|
||||
|
||||
void saveExecutable();
|
||||
|
||||
private slots:
|
||||
void on_newFilesModCheckBox_toggled(bool checked);
|
||||
|
||||
private slots:
|
||||
|
||||
void on_binaryEdit_textChanged(const QString &arg1);
|
||||
@@ -89,12 +101,13 @@ private:
|
||||
bool executableChanged();
|
||||
|
||||
private:
|
||||
Ui::EditExecutablesDialog *ui;
|
||||
Ui::EditExecutablesDialog *ui;
|
||||
|
||||
QListWidgetItem *m_CurrentItem;
|
||||
QListWidgetItem *m_CurrentItem;
|
||||
|
||||
ExecutablesList m_ExecutablesList;
|
||||
ExecutablesList m_ExecutablesList;
|
||||
|
||||
Profile *m_Profile;
|
||||
};
|
||||
|
||||
#endif // EDITEXECUTABLESDIALOG_H
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user