Compare commits

...
Author SHA1 Message Date
Tannin bf0db9c218 - position of splitter in main window is now saved and restored
- confirmation dialog before enabling/disabling all plugins
- bugfix: GetPrivateProfileString-hook potentially accessed buffer that is allowed to be NULL
- bugfix: attempt to extract an archive crashed MO in 0.99.2
- bugfix: archive list wasn't saved correctly in 0.99.2
- bugfix: plugins.txt was incorrectly interpreted as utf-8
2013-08-25 13:15:23 +02:00
Tannin 8fcf21e771 - column sizing is now changeable by the user yet still automatically resizes fit content on first start 2013-08-24 23:11:20 +02:00
Tannin b46b2fe6f2 Merge 2013-08-24 22:50:22 +02:00
Tannin e91eebefbe - download size is now displayed
- multiple esps/mods can now be enabled/disabled at once using space
- bugfix: fomod installer didn't compile because of changes to condition checking
- bugfix: broken inverse virtual name resolution in case of non-default mod directory
2013-08-24 22:50:00 +02:00
Tannin 2e605b275b Added tag release v0.99.2 for changeset 95e629510d01 2013-08-24 14:14:00 +02:00
Tannin 5f2a49b3be - added code for c++ based boss dummy
- fixed staging scripts
2013-08-24 14:12:58 +02:00
Tannin c4955231cf - turned boss dummy into a c++ project (unmanaged exports with c# is a pain)
- updated NCC to current NMM codebase
- updated translation files
2013-08-24 12:08:57 +02:00
Tannin 87f4e2df26 Merge 2013-08-17 08:54:53 +02:00
Tannin 9272013103 - bugfix: download manager will now properly pause all downloads on exiting the application
- bugfix: resumed downloads now get their automatic-retry-count reset
- fiddled with condition tests in fomod (not sure if it works right now)
2013-08-17 08:54:09 +02:00
Tannin 78c4178f2a - plugins that failed to load are now reported as problems
- some wording fixes in the tutorial
- updated proxyPython to a modified interface
2013-08-17 08:49:36 +02:00
Tannin 7d79e3ad1e - bugfix: nameprefix-flag incorrectly interpreted on oblivion-style bsas
- bugfix: optimization for missing inis fixed
- bugfix: fixmods didn't search for esps in overwrite
- bugfix: configurator didn't work for fallout new vegas because of a missing cast
- bugfix: configurator attempted parameter formatting on ini files instead of using the raw data
- bugfix: searching for a path in the directory structure could cause a crash when not using the directory output
- optimization to findfirstfile for cases where a single file is searched
- display of bsas changed. hopefully it is more understandable now
- cache for the test whether a mod is in conflict. Should speed ab scrolling in mod list
- mod list has now an additional column for the installation time
- nmm importer no longer cancels in cases where a data file references an undeclared mod.
- integrated improved settings.json for the configurator contributed by "delta534"
2013-08-15 22:13:18 +02:00
Tannin d0f2c4fcf7 - now avoids a few unnecessary copy operations during generation of the directory structure
- bugfix: circular dependency caused a memory leak
- bugfix: removing a single mod lead to the wrong mod being deleted
2013-07-17 20:58:58 +02:00
Tannin 36ac91e0b7 - basic diagnosis plugin now catches an issue where the users fontconfig.txt refers missing files
- plugins can now resolve relative file names on the virtual directory (no enumeration yet)
- bugfix: dummy plugins were not initialized
2013-07-14 14:59:01 +02:00
Tannin 5c968a1242 - added the ability to connect to the internet through a proxy
- integrated fomod installer now supports the or-operator for page conditions
- integrated fomod installer now caches condition results to speed up tests
2013-07-13 22:11:30 +02:00
Tannin e09cef3909 - minor fixes to ncc build files
- MO will now use system-wide proxy if one is configured
2013-07-13 11:52:40 +02:00
Tannin 8d34ae3413 - some fixes to the refreshing behaviour
- "fix" buttons in problems dialog are now actually functional
- python proxy now has diagnosis functionality to warn user if correct proxy version is not available
- python proxy now has a configurable python path
2013-07-13 10:10:46 +02:00
Tannin 849a0a0ef4 bugfix: nxmhandler in headless calls didn't save changes 2013-07-05 14:34:46 +02:00
Tannin 3b3717a021 - nxmhandler now has a ui to modify the proxy-handler
- mo now registers itself with nxmhandler when launching the browser
- pdbs are now generated for plugins
- reverted configurator to pyqt4
2013-06-29 21:10:53 +02:00
Tannin fe37b48dff - caching of downloadwidgets to fix performance problem, currently broken and disabled
- added new state for downloads "uninstalled" for mods that were at one point installed and then removed
- user-configured server preference is now used
- updated tutorial to account for removal of integrated browser
- reverted to qt 4
- using performance optimised findfirstfile on win vista and up
- bugfix: it was possible to disable all columns of the mod list
- bugfix: hook.dll doesn't load on win xp
2013-06-29 18:04:10 +02:00
Tannin f8c683f700 - some fixes for qt5 compatibility
- hook.dll no longer creates a dump and uninstalls it if an exception is reported that doesn't originate from it
- NCC used read-only transactions again because otherwise solid archives become unusably slow.
- removed the integrated nexus browser
- the mod description and motd are now rendered in QTextBrowser. This (and the above) eliminates the dependency on qtwebkit
- removed the direct file download for mod files
- reduced CPU usage during downloads by invalidating only one column of the download list. This widget still needs to be replaced
- added the complete filename as an option for the modname
- applications that require elevation can now be started by invoking an elevated secondary ModOrganizer instance
- MO will now register nexus file servers and provides a settings dialog to pick preferred servers. (This preference is not used yet)
- worked around 1-2 bugs in QSortFilterProxy
- handling of nxm links is now done by an external application. This allows the registration of different applications depending on the game
- integrated fomod installer now displays the screenshot in a scalable view
- bugfix: integrated fomod installer didn't name output files correctly if the name differs from the source name
- bugfix: a successful login to nexus was (sometimes?) not correctly detected as a success
- bugfix: top-level entries in QtGroupingProxy were sometimes incorrectly displayed as groups
- bugfix: GetPrivateProfile... optimization could cause null-pointer indirection
- bugfix: GetCurrentWorkingDirectory caused buffer overflow in case of pre-flighting (buffer size 0)
- bugfix: configurator plugin now also uses qt5 (it's currently broken though)
2013-06-20 21:55:37 +02:00
Tannin 49cbe03491 - completed Qt5 compatibility
- added GetFileVerisonInfoW hook for Windows 8 compatibility
- fixed BossDummy to compile correctly with current version of the RGiesecke.DllExport assembly
- fixed NCC components compiling with different Framewerk versions
- dropped files-list in Nexus-tab of modinfo dialog
2013-06-15 14:42:20 +02:00
Tannin 6069decb15 - mod list no longer loses selection whenever categories context menu gets hidden 2013-06-08 22:23:25 +02:00
Tannin 30dece9093 Merge 2013-06-07 18:30:26 +02:00
Tannin 50d0523622 - locking/unlocking esps can now be done for the whole selection
- bugfix: MO crashed if the locked index file is borked. This shouldn't happen
anymore so I'm not sure how that file breaks to begin with
2013-06-07 18:16:52 +02:00
Tannin 067f272da3 - bugfix: archive file wasn't closed after installation
- bugfix: batch installer was treated as handler for "manual" installations
- bugfix: dropped include of unused sip interface
2013-06-06 20:19:38 +02:00
Tannin 97111de140 Merge 2013-06-05 10:05:29 +02:00
Tannin 280691ebc3 - skyrim-specific optimization to accelerate startup
- bugfix in SetCurrentDirectory hook
2013-06-05 10:04:56 +02:00
Tannin 1606c1366f - install plugins now get a chance to update name, version and modid of mods
- NCC now makes name, version and modid from the info.xml file available to the installer
- integrated fomod installer also uses version and modid from the info.xml
- mods can now be renamed during installation
- configurator plugin now highlights changed keys and saves changes
2013-06-05 09:51:48 +02:00
Tannin 8077c1ad73 updated .hgignore 2013-05-28 23:17:41 +02:00
Tannin aadd076269 - added hook for ansi version of SHFileOperation, this function may not be routed to the unicode version in every windows variant 2013-05-28 23:14:49 +02:00
Tannin d8cb9a4e37 - bugfixes in hookdll related to path-rerouting
- bugfix: expanding modlist groups after changes to modlist works now
- bugfix: sorting grouped modlist was broken
2013-05-28 22:43:19 +02:00
Tannin 3c21d1884a Merge 2013-05-25 12:26:13 +02:00
Tannin 16bda49e06 - bugfix: mod priority ordering could become incorrect
- bugfix: when grouping is enabled, newly installed mods broke grouping
- bugfix: syncing overwrite didn't clean up emptied directory
2013-05-25 12:24:48 +02:00
Tannin daf8bab136 - bugfix: installation using custom installer always created mod directory
- batch installer now displays progress during mod installation
2013-05-23 20:03:35 +02:00
Tannin 2c4ba2c62c Merge 2013-05-22 20:48:23 +02:00
Tannin 0ae7d4753c - diagnosis plugin now reports file in overwrite as a problem
- bugfix: GetModuleFileName returned the wrong string length
- bugfix: Vector Exception Handler no longer stops hook.dll on recoverable errors
2013-05-22 20:43:08 +02:00
Tannin f0ba6ce95c - added NCC to repository
- deleting files from download manager now moves them to recycle bin instead of deleting permanentyl
- cleanup in installation manager
- ini editor (old) can now be configured to open files in external editor
- bugfix: .net check in ncc installer was broken
- bugfix: mod-overwrite dialog wasn't displayed for complex installers
2013-05-22 18:16:56 +02:00
Tannin cdea0c9da5 Merge 2013-05-19 11:37:03 +02:00
Tannin 0beb88760b - added hook for GetModuleFileName
- downloads are now identifiable by ID
- fixed a bug with the multi-select categories list
- fixed a problem with the nexus-login code breaking support for certain passwords
- fixed a bug where detection of archive invalidation didn't work correctly
- fixed ncc plugin trying to handle archives that aren't actually fomods
2013-05-19 11:36:36 +02:00
Tannin 45f6cd21a2 - extended plugin interface to allow plugins access to download manager
- extended plugin interface to allow installation of mods from files
- improved detection of online state
- download tab now also displays files supported through plugins
- batch installer now has basic functionality (downloads and installes files)
2013-05-17 20:44:40 +02:00
Tannin fc3753dcc5 Merge 2013-05-10 11:00:09 +02:00
Tannin 9bc123e8e2 - initial support for exposing the nexusbridge to python
- started improving usability of nexus bridge
- support for installers implemented in python
2013-05-10 10:57:35 +02:00
Tannin d161e1a0d6 - if no version is known for a mod, the file date is used
- added files for the python proxy
2013-04-14 20:49:18 +02:00
Tannin 1c9018e9fd - bugfix: wrong multibyte to widechar conversion in hookdll breaks internationalization
- bugfix: mod names not checked for validity on rename
- bugfix: mod list wasn't invalidated after rename (regression?)
- problem reports moved to separate dialog
- ncc plugin now does the check for dotNet
- python plugin wrapper started (only supports tools currently)
- new ini editor plugin in python (non-functional currently)
2013-04-13 19:23:18 +02:00
Tannin 4fbfc9aa54 - multi-selection in category window
- profile loading is now slightly more forgiving
2013-04-12 15:31:47 +02:00
Tannin 528338d7bf some code cleanup 2013-04-05 18:24:36 +02:00
Tannin 5b04f38345 added modlist view class (updates drop behaviour on modlist depending on mime type) 2013-04-04 21:51:13 +02:00
Tannin de27ab391f - creating mods from overwrite
- moving files from overwrite to mods
- offline mode
- several fixes to the grouping system
- fix to "duplicate translation" errors
2013-04-04 21:49:44 +02:00
Tannin d9a6dbb916 Merge 2013-03-29 10:26:19 +01:00
Tannin f682f82db5 some improvements to the grouped modlist views 2013-03-29 10:25:38 +01:00
Tannin a47d971788 Merge with default 2013-03-29 10:12:34 +01:00
Tannin 59d6b7840b - post-merge cleanup 2013-03-29 09:41:41 +01:00
Tannin b4220cf2f4 Merge with branch1.0 2013-03-27 21:04:27 +01:00
Tannin e0eb97922d - added hooks for getFileVersion* functions
- automatic donwload retry
- support for storing multiple download urls
- improved "query info" functionality
- some cleanup to download manager code
- external fomod installer dialog are now brought to front
- added shell... functions to have windows handle problematic situations
- added visual clue when filters are active
- esps are now automatically activated when installing a mod
- added option to never endorse a mod
- added "previous" and "next" buttons to mod info dialog
- improved the way messagedialog text is shortened
- coloring in mod info dialog now visible in other color schemes
- plugin list is now saved automatically
- vanilla bsas are now enabled even if they are not listed in the ini file
- bugfix: setting mod to maximum now doesn't try to place the mod below overwrite
2013-03-27 20:48:33 +01:00
Tannin 10485e15e4 - some cleanup to hookdll
- exchanged grouping proxies with existing solution from the kde project
2013-03-27 12:32:23 +01:00
Tannin ec0ea9df8d Merge with default 2013-03-22 18:57:45 +01:00
Tannin 24cc386191 removed obsolete files 2013-03-22 18:54:04 +01:00
Tannin 0a19f04339 - support for grouping filters for mod list (incomplete)
- offering multiple options for mod names during installation
- support for renaming profiles
- updated installer plugins
- minor bugfixes
2013-03-22 18:46:40 +01:00
Tannin 74c75e60d6 Added tag release v0.12.9 for changeset ff711d0a1fa9 2013-03-18 20:03:57 +01:00
Tannin 8b31996525 - bugfix: invalid ini file name when creating profile for oblivion from default settings
- bugfix: archives.txt file was potentially not generated if there were no bsas
- bugfix: static __declspec(thread) declaration causes crashes in windows versions before vista
- logger class in hook.dll now tries alternative names for the log file if it can't access the regular file
- path-environment variable for mo-spawned processes now contains the path to MO, in case the hook.dll needs to find the msvc-dlls
- stack-search in ini-limit hack now starts searching on local stack. This should find the right stack position for the hack more reliable
2013-03-18 20:03:46 +01:00
Tannin b3d0fcb208 - some more safety checks in the ini-limit removal code
- some code cleanup and minor bug fixes based on results from static code analysis
- added naemfilter for the esp list
- bsa changes are now stored automatically but delayed by up to 0.5 seconds (for performance reasons)
- bugfix: buffer overrun when certain functions are called with empty file names
- bugfix: reroute for the ini-limit fix was placed in the data segment
- bugfix: mod list got mixed up when the mod directory was changed externally
- bugfix: plugins.txt reroute on skyrim didn't work on winXP
- bugfix: MO could become unresponsive if the tutorial script couldn't be interpreted
2013-03-13 19:35:20 +01:00
Tannin 93e073c324 Added tag release v0.12.8 for changeset 0f4efc99546f 2013-03-06 19:33:55 +01:00
Tannin b2f3d8e47c - rewrote the mechanism removing the Archive List limit
- openfile is now rerouted
- .jar files can now be added as executables directly
- bugfix: no message was displayed when checking for updates with no valid credentials configured
- added a readme with compilation instructions
2013-03-01 13:03:30 +01:00
Tannin 8b4e11060b - bugfix: update on overwrite directory leads files incorrectly being assigned to it
- bugfix: getfullpathname reroute now correctly handles relative paths
- bugfix: cwd change to overwrite is now handled too
- bugfix: using the external fomod installer to merge a mod caused error messages because directories couldn't be renamed
- bugfix: The memory for file dialogs wasn't saved to the ini file
- file category (main, update, optional, old) is now stored with the download for future use
- when overwriting a mod, the version of the mod is only increased, never reduced. This is less correct
  for the unusual case that the user is downgrading but more correct for the more commen case
  he is installing an optional file with incorrect version number
- the install mod dialog now uses the file dialog memory
2013-02-22 19:28:54 +01:00
Tannin cb297d20b6 - proper detection of user-preferred language
- resume and removal of failed download fixed
2013-02-19 21:33:58 +01:00
Tannin efe4243077 added hgignore 2013-02-19 20:34:38 +01:00
Tannin 2c1fad4d98 - fixed broken help menu
- work towards resume of failed downloads
2013-02-19 20:32:44 +01:00
Tannin fba05e7fab Added tag release v0.12.7 for changeset 92578a6d6331 2013-02-17 22:06:28 +01:00
142 changed files with 37447 additions and 22380 deletions
+15
View File
@@ -0,0 +1,15 @@
syntax: glob
ModOrganizer-build-desktop*
outputd/*
output/*
build-ModOrganizer-*
source/NCC/*/bin
source/NCC/*/obj
source/NCC/bin
*.orig
source/plugins/proxyPython/build
staging/*
source - Copy/*
ModOrganizer-build-*
pdbs/*
source/NCC/BossDummy.x/*
+68
View File
@@ -0,0 +1,68 @@
HOW TO BUILD
============
Requirements:
-------------
Visual C++ compiler 2010 (VC 10.0) or up
- Included in visual c++ express 2010 or windows sdk 7.0
QtSDK 4.8.x (http://qt-project.org/downloads)
- Qt5 is not yet supported but WIP
- Install according to instruction
boost libraries (http://www.boost.org/)
- Compile according to their instructions (using vc++)
- As of time of writing boost_thread is the only compiled boost library used, you can
disable the others to safe yourself the compile time
zlib (http://www.zlib.net/)
- Compile static library according to their instructions
- You should have a "zlibstatic.lib" under "build" afterwards
7z.dll (http://www.7-zip.org/download.html)
- Part of the 7-zip program
- Has to be the 32-bit dll! (approx. 893kb)
Recommended:
------------
Qt Creator
- Included in QtSDK but there might be a newer version as a separate download
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"
3. Click "Add" to add a variable called "BOOSTPATH" with the path of your boost installation as the value (i.e. C:\code\boost_1_52_0)
4. 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)
5. Switch the build configuration at the very top of the same page from "debug" to "release" (or vice versa) and repeat steps 3 and 4
6. Compile the configuration(s) you want to use (debug and/or release) (Build All). This should compile correctly.
7. return to the "projects" tab and switch to "Run Settings"
For Release build:
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 QtSDK\Desktop\Qt\4.8.0\msvc2010\bin 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
For Debug build:
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 QtSDK\Desktop\Qt\4.8.0\msvc2010\bin 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
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
and not recompile the modified subproject. the "organizer" project on the other hand is always re-linked. If anyone knowledgeable enough with qmake
can fix that that would be awesome.
Set up (without Qt Creator):
----------------------------
1. open a command line shell and navigate to <your working copy>\source
2. run "qmake -tp vc" to create a visual c++ solution
3. Open that solution
4. - 98. A miracle happens
99. You can now compile MO using VC
I'm not using this workflow so I can't give more detailed instructions.
Please note that the primary project format of MO remains qmake, if you work with visual studio and make changes to the project (like adding
source files) you have to manually transfer those changes to the .pro file.
+4 -2
View File
@@ -10,10 +10,12 @@ SUBDIRS = bsatk \
archive \
helper \
plugins \
proxydll
proxydll \
nxmhandler \
BossDummy
hookdll.depends = shared
organizer.depends = shared, uibase
organizer.depends = shared, uibase, plugins
CONFIG(debug, debug|release) {
DESTDIR = outputd
+83 -83
View File
@@ -17,86 +17,86 @@ 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 >= 0x050000
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;
}
void ActivateModsDialog::on_buttonBox_accepted()
{
}
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;
}
#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;
}
void ActivateModsDialog::on_buttonBox_accepted()
{
}
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;
}
-124
View File
@@ -1,124 +0,0 @@
/*
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 "baincomplexinstallerdialog.h"
#include "textviewer.h"
#include "ui_baincomplexinstallerdialog.h"
#include <QDir>
using namespace MOBase;
BainComplexInstallerDialog::BainComplexInstallerDialog(DirectoryTree *tree, const QString &modName, bool hasPackageTXT, QWidget *parent)
: TutorableDialog("BainInstaller", parent), ui(new Ui::BainComplexInstallerDialog), m_Manual(false)
{
ui->setupUi(this);
ui->nameEdit->setText(modName);
for (DirectoryTree::const_node_iterator iter = tree->nodesBegin(); iter != tree->nodesEnd(); ++iter) {
const QString &dirName = (*iter)->getData().name;
if ((dirName.compare("fomod", Qt::CaseInsensitive) == 0) ||
(dirName.startsWith("--"))) {
continue;
}
QListWidgetItem *item = new QListWidgetItem(ui->optionsList);
item->setText((*iter)->getData().name);
item->setFlags(item->flags() | Qt::ItemIsUserCheckable);
item->setCheckState(item->text().mid(0, 2) == "00" ? Qt::Checked : Qt::Unchecked);
item->setData(Qt::UserRole, qVariantFromValue((void*)(*iter)));
ui->optionsList->addItem(item);
}
ui->packageBtn->setEnabled(hasPackageTXT);
}
BainComplexInstallerDialog::~BainComplexInstallerDialog()
{
delete ui;
}
QString BainComplexInstallerDialog::getName() const
{
return ui->nameEdit->text();
}
void BainComplexInstallerDialog::moveTreeUp(DirectoryTree *target, DirectoryTree::Node *child)
{
for (DirectoryTree::const_node_iterator iter = child->nodesBegin();
iter != child->nodesEnd();) {
target->addNode(*iter, true);
iter = child->detach(iter);
}
for (DirectoryTree::const_leaf_reverse_iterator iter = child->leafsRBegin();
iter != child->leafsREnd(); ++iter) {
target->addLeaf(*iter);
}
}
DirectoryTree *BainComplexInstallerDialog::updateTree(DirectoryTree *tree)
{
DirectoryTree *newTree = new DirectoryTree;
for (DirectoryTree::const_node_reverse_iterator iter = tree->nodesRBegin();
iter != tree->nodesREnd();) {
QList<QListWidgetItem*> items = ui->optionsList->findItems((*iter)->getData().name, Qt::MatchFixedString);
if ((items.count() == 1) && (items.at(0)->checkState() == Qt::Checked)) {
moveTreeUp(newTree, *iter);
}
iter = tree->erase(iter);
}
return newTree;
}
void BainComplexInstallerDialog::on_okBtn_clicked()
{
this->accept();
}
void BainComplexInstallerDialog::on_cancelBtn_clicked()
{
this->reject();
}
void BainComplexInstallerDialog::on_manualBtn_clicked()
{
m_Manual = true;
this->reject();
}
void BainComplexInstallerDialog::on_packageBtn_clicked()
{
TextViewer viewer("package.txt", this);
viewer.setDescription("");
viewer.addFile(QDir::tempPath().append("/package.txt"), false);
viewer.exec();
}
-95
View File
@@ -1,95 +0,0 @@
/*
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 BAINCOMPLEXINSTALLERDIALOG_H
#define BAINCOMPLEXINSTALLERDIALOG_H
#include "mytree.h"
#include "installdialog.h"
#include "tutorabledialog.h"
namespace Ui {
class BainComplexInstallerDialog;
}
/**
* @brief Dialog to choose from options offered by a (complex) bain package
**/
class BainComplexInstallerDialog : public MOBase::TutorableDialog
{
Q_OBJECT
public:
/**
* @brief Constructor
*
* @param tree the directory tree of the archive. The caller is resonsible to verify this actually qualifies as a bain installer
* @param modName proposed name for the mod. The dialog allows the user to change this
* @param hasPackageTXT set to true if a package.txt is available for this archive. The file has to be unpacked to QDir::tempPath before displaying the dialog!
* @param parent parent widget
**/
explicit BainComplexInstallerDialog(MOBase::DirectoryTree *tree, const QString &modName, bool hasPackageTXT, QWidget *parent);
~BainComplexInstallerDialog();
/**
* @return bool true if the user requested the manual dialog
**/
bool manualRequested() const { return m_Manual; }
/**
* @return QString the (user-modified) name to be used for the mod
**/
QString getName() const;
/**
* @brief retrieve the updated archive tree from the dialog. The caller is responsible to delete the returned tree.
*
* @note This call is destructive on the input tree!
*
* @param tree input tree. (TODO isn't this the same as the tree passed in the constructor?)
* @return DataTree* a new tree with only the selected options and directories arranged correctly. The caller takes custody of this pointer!
**/
MOBase::DirectoryTree *updateTree(MOBase::DirectoryTree *tree);
private slots:
void on_manualBtn_clicked();
void on_okBtn_clicked();
void on_cancelBtn_clicked();
void on_packageBtn_clicked();
private:
void moveTreeUp(MOBase::DirectoryTree *target, MOBase::DirectoryTree::Node *child);
private:
Ui::BainComplexInstallerDialog *ui;
bool m_Manual;
};
#endif // BAINCOMPLEXINSTALLERDIALOG_H
+192 -190
View File
@@ -17,193 +17,195 @@ 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 "bbcode.h"
#include <QRegExp>
#include <map>
#include <algorithm>
namespace BBCode {
class BBCodeMap {
typedef std::map<QString, std::pair<QRegExp, QString> > TagMap;
public:
static BBCodeMap &instance() {
static BBCodeMap s_Instance;
return s_Instance;
}
QString convertTag(const QString &input, int &length)
{
// extract the tag name
m_TagNameExp.indexIn(input, 1, QRegExp::CaretAtOffset);
QString tagName = m_TagNameExp.cap(0).toLower();
//qDebug("tag name %s", tagName.toUtf8().constData());
TagMap::iterator tagIter = m_TagMap.find(tagName);
if (tagIter != m_TagMap.end()) {
// recognized tag
if (tagName.endsWith('=')) {
tagName.chop(1);
}
QString closeTag = tagName == "*" ? "<br/>"
: QString("[/%1]").arg(tagName);
int closeTagPos = input.indexOf(closeTag, 0, Qt::CaseInsensitive);
//qDebug("close tag %s at %d", closeTag.toUtf8().constData(), closeTagPos);
if (closeTagPos > -1) {
length = closeTagPos + closeTag.length();
QString temp = input.mid(0, length);
if (tagIter->second.first.indexIn(temp) == 0) {
return temp.replace(tagIter->second.first, tagIter->second.second);
} else {
// expression doesn't match. either the input string is invalid
// or the expression is
qWarning("%s doesn't match the expression for %s",
temp.toUtf8().constData(), tagName.toUtf8().constData());
length = 0;
return QString();
}
}
}
// not a recognized tag or tag invalid
length = 0;
return QString();
}
private:
BBCodeMap()
: m_TagNameExp("^[a-zA-Z*]*=?")
{
m_TagMap["b"] = std::make_pair(QRegExp("\\[b\\](.*)\\[/b\\]"),
"<b>\\1</b>");
m_TagMap["i"] = std::make_pair(QRegExp("\\[i\\](.*)\\[/i\\]"),
"<i>\\1</i>");
m_TagMap["u"] = std::make_pair(QRegExp("\\[u\\](.*)\\[/u\\]"),
"<u>\\1</u>");
m_TagMap["s"] = std::make_pair(QRegExp("\\[s\\](.*)\\[/s\\]"),
"<s>\\1</s>");
m_TagMap["sub"] = std::make_pair(QRegExp("\\[sub\\](.*)\\[/sub\\]"),
"<sub>\\1</sub>");
m_TagMap["sup"] = std::make_pair(QRegExp("\\[sup\\](.*)\\[/sup\\]"),
"<sup>\\1</sup>");
m_TagMap["size="] = std::make_pair(QRegExp("\\[size=([^\\]]*)\\](.*)\\[/size\\]"),
"<font size=\"\\1\">\\2</font>");
m_TagMap["color="] = std::make_pair(QRegExp("\\[color=([^\\]]*)\\](.*)\\[/color\\]"),
"<font style=\"color: #\\1;\">\\2</font>");
m_TagMap["font="] = std::make_pair(QRegExp("\\[font=([^\\]]*)\\](.*)\\[/font\\]"),
"<font face=\\1>\\2</font>");
m_TagMap["center"] = std::make_pair(QRegExp("\\[center\\](.*)\\[/center\\]"),
"<div align=\"center\">\\1</div>");
m_TagMap["quote"] = std::make_pair(QRegExp("\\[quote\\](.*)\\[/quote\\]"),
"<blockquote>\"\\1\"</blockquote>");
m_TagMap["quote="] = std::make_pair(QRegExp("\\[quote=([^\\]]*)\\](.*)\\[/quote\\]"),
"<blockquote>\"\\2\"<br/><span>--\\1</span></blockquote></p>");
m_TagMap["code"] = std::make_pair(QRegExp("\\[code\\](.*)\\[/code\\]"),
"<pre>\\1</pre>");
m_TagMap["heading"]= std::make_pair(QRegExp("\\[heading\\](.*)\\[/heading\\]"),
"<h2><strong>\\1</strong></h2>");
// lists
m_TagMap["list"] = std::make_pair(QRegExp("\\[list\\](.*)\\[/list\\]"),
"<ul>\\1</ul>");
m_TagMap["list="] = std::make_pair(QRegExp("\\[list.*\\](.*)\\[/list\\]"),
"<ol>\\1</ol>");
m_TagMap["ul"] = std::make_pair(QRegExp("\\[ul\\](.*)\\[/ul\\]"),
"<ul>\\1</ul>");
m_TagMap["ol"] = std::make_pair(QRegExp("\\[ol\\](.*)\\[/ol\\]"),
"<ol>\\1</ol>");
m_TagMap["li"] = std::make_pair(QRegExp("\\[li\\](.*)\\[/li\\]"),
"<li>\\1</li>");
m_TagMap["*"] = std::make_pair(QRegExp("\\[\\*\\](.*)<br/>"),
"<li>\\1</li>");
// tables
m_TagMap["table"] = std::make_pair(QRegExp("\\[table\\](.*)\\[/table\\]"),
"<table>\\1</table>");
m_TagMap["tr"] = std::make_pair(QRegExp("\\[tr\\](.*)\\[/tr\\]"),
"<tr>\\1</tr>");
m_TagMap["th"] = std::make_pair(QRegExp("\\[th\\](.*)\\[/th\\]"),
"<th>\\1</th>");
m_TagMap["td"] = std::make_pair(QRegExp("\\[td\\](.*)\\[/td\\]"),
"<td>\\1</td>");
// web content
m_TagMap["url"] = std::make_pair(QRegExp("\\[url\\](.*)\\[/url\\]"),
"<a href=\"\\1\">\\1</a>");
m_TagMap["url="] = std::make_pair(QRegExp("\\[url=([^\\]]*)\\](.*)\\[/url\\]"),
"<a href=\"\\1\">\\2</a>");
m_TagMap["img"] = std::make_pair(QRegExp("\\[img\\](.*)\\[/img\\]"),
"<img src=\"\\1\"/>");
m_TagMap["img="] = std::make_pair(QRegExp("\\[img=([^\\]]*)\\](.*)\\[/img\\]"),
"<img src=\"\\2\" align=\"\\1\" />");
m_TagMap["email="] = std::make_pair(QRegExp("\\[email=\"?([^\\]]*)\"?\\](.*)\\[/email\\]"),
"<a href=\"mailto:\\1\">\\2</a>");
m_TagMap["youtube"] = std::make_pair(QRegExp("\\[youtube\\](.*)\\[/youtube\\]"),
"<a href=\"http://www.youtube.com/v/\\1\">http://www.youtube.com/v/\\1</a>");
// make all patterns non-greedy and case-insensitive
for (TagMap::iterator iter = m_TagMap.begin(); iter != m_TagMap.end(); ++iter) {
iter->second.first.setCaseSensitivity(Qt::CaseInsensitive);
iter->second.first.setMinimal(true);
}
}
private:
QRegExp m_TagNameExp;
TagMap m_TagMap;
};
QString convertToHTML(const QString &inputParam)
{
// this code goes over the input string once and replaces all bbtags
// it encounters. This function is called recursively for every replaced
// string to convert nested tags.
//
// This could be implemented simpler by applying a set of regular expressions
// for each recognized bb-tag one after the other but that would probably be
// very inefficient (O(n^2)).
QString input = inputParam.mid(0).replace("\r\n", "<br/>");
input.replace("\\\"", "\"").replace("\\'", "'");
QString result;
int lastBlock = 0;
int pos = 0;
// iterate over the input buffer
while ((pos = input.indexOf('[', lastBlock)) != -1) {
// append everything between the previous tag-block and the current one
result.append(input.midRef(lastBlock, pos - lastBlock));
// convert the tag and content if necessary
int length = -1;
QString replacement = BBCodeMap::instance().convertTag(input.mid(pos), length);
if (length != 0) {
QString temp = convertToHTML(replacement);
result.append(temp);
// length contains the number of characters in the original tag
pos += length;
} else {
// nothing replaced
result.append('[');
++pos;
}
lastBlock = pos;
}
// append the remainder (everything after the last tag)
result.append(input.midRef(lastBlock));
return result;
}
} // namespace BBCode
#include "bbcode.h"
#include <QRegExp>
#include <map>
#include <algorithm>
namespace BBCode {
class BBCodeMap {
typedef std::map<QString, std::pair<QRegExp, QString> > TagMap;
public:
static BBCodeMap &instance() {
static BBCodeMap s_Instance;
return s_Instance;
}
QString convertTag(const QString &input, int &length)
{
// extract the tag name
m_TagNameExp.indexIn(input, 1, QRegExp::CaretAtOffset);
QString tagName = m_TagNameExp.cap(0).toLower();
//qDebug("tag name %s", tagName.toUtf8().constData());
TagMap::iterator tagIter = m_TagMap.find(tagName);
if (tagIter != m_TagMap.end()) {
// recognized tag
if (tagName.endsWith('=')) {
tagName.chop(1);
}
QString closeTag = tagName == "*" ? "<br/>"
: QString("[/%1]").arg(tagName);
int closeTagPos = input.indexOf(closeTag, 0, Qt::CaseInsensitive);
//qDebug("close tag %s at %d", closeTag.toUtf8().constData(), closeTagPos);
if (closeTagPos > -1) {
length = closeTagPos + closeTag.length();
QString temp = input.mid(0, length);
if (tagIter->second.first.indexIn(temp) == 0) {
return temp.replace(tagIter->second.first, tagIter->second.second);
} else {
// expression doesn't match. either the input string is invalid
// or the expression is
qWarning("%s doesn't match the expression for %s",
temp.toUtf8().constData(), tagName.toUtf8().constData());
length = 0;
return QString();
}
}
}
// not a recognized tag or tag invalid
length = 0;
return QString();
}
private:
BBCodeMap()
: m_TagNameExp("^[a-zA-Z*]*=?")
{
m_TagMap["b"] = std::make_pair(QRegExp("\\[b\\](.*)\\[/b\\]"),
"<b>\\1</b>");
m_TagMap["i"] = std::make_pair(QRegExp("\\[i\\](.*)\\[/i\\]"),
"<i>\\1</i>");
m_TagMap["u"] = std::make_pair(QRegExp("\\[u\\](.*)\\[/u\\]"),
"<u>\\1</u>");
m_TagMap["s"] = std::make_pair(QRegExp("\\[s\\](.*)\\[/s\\]"),
"<s>\\1</s>");
m_TagMap["sub"] = std::make_pair(QRegExp("\\[sub\\](.*)\\[/sub\\]"),
"<sub>\\1</sub>");
m_TagMap["sup"] = std::make_pair(QRegExp("\\[sup\\](.*)\\[/sup\\]"),
"<sup>\\1</sup>");
m_TagMap["size="] = std::make_pair(QRegExp("\\[size=([^\\]]*)\\](.*)\\[/size\\]"),
"<font size=\"\\1\">\\2</font>");
m_TagMap["color="] = std::make_pair(QRegExp("\\[color=([^\\]]*)\\](.*)\\[/color\\]"),
"<font style=\"color: #\\1;\">\\2</font>");
m_TagMap["font="] = std::make_pair(QRegExp("\\[font=([^\\]]*)\\](.*)\\[/font\\]"),
"<font face=\\1>\\2</font>");
m_TagMap["center"] = std::make_pair(QRegExp("\\[center\\](.*)\\[/center\\]"),
"<div align=\"center\">\\1</div>");
m_TagMap["quote"] = std::make_pair(QRegExp("\\[quote\\](.*)\\[/quote\\]"),
"<blockquote>\"\\1\"</blockquote>");
m_TagMap["quote="] = std::make_pair(QRegExp("\\[quote=([^\\]]*)\\](.*)\\[/quote\\]"),
"<blockquote>\"\\2\"<br/><span>--\\1</span></blockquote></p>");
m_TagMap["code"] = std::make_pair(QRegExp("\\[code\\](.*)\\[/code\\]"),
"<pre>\\1</pre>");
m_TagMap["heading"]= std::make_pair(QRegExp("\\[heading\\](.*)\\[/heading\\]"),
"<h2><strong>\\1</strong></h2>");
// lists
m_TagMap["list"] = std::make_pair(QRegExp("\\[list\\](.*)\\[/list\\]"),
"<ul>\\1</ul>");
m_TagMap["list="] = std::make_pair(QRegExp("\\[list.*\\](.*)\\[/list\\]"),
"<ol>\\1</ol>");
m_TagMap["ul"] = std::make_pair(QRegExp("\\[ul\\](.*)\\[/ul\\]"),
"<ul>\\1</ul>");
m_TagMap["ol"] = std::make_pair(QRegExp("\\[ol\\](.*)\\[/ol\\]"),
"<ol>\\1</ol>");
m_TagMap["li"] = std::make_pair(QRegExp("\\[li\\](.*)\\[/li\\]"),
"<li>\\1</li>");
m_TagMap["*"] = std::make_pair(QRegExp("\\[\\*\\](.*)<br/>"),
"<li>\\1</li>");
// tables
m_TagMap["table"] = std::make_pair(QRegExp("\\[table\\](.*)\\[/table\\]"),
"<table>\\1</table>");
m_TagMap["tr"] = std::make_pair(QRegExp("\\[tr\\](.*)\\[/tr\\]"),
"<tr>\\1</tr>");
m_TagMap["th"] = std::make_pair(QRegExp("\\[th\\](.*)\\[/th\\]"),
"<th>\\1</th>");
m_TagMap["td"] = std::make_pair(QRegExp("\\[td\\](.*)\\[/td\\]"),
"<td>\\1</td>");
// web content
m_TagMap["url"] = std::make_pair(QRegExp("\\[url\\](.*)\\[/url\\]"),
"<a href=\"\\1\">\\1</a>");
m_TagMap["url="] = std::make_pair(QRegExp("\\[url=([^\\]]*)\\](.*)\\[/url\\]"),
"<a href=\"\\1\">\\2</a>");
/* m_TagMap["img"] = std::make_pair(QRegExp("\\[img\\](.*)\\[/img\\]"),
"<img src=\"\\1\"/>");
m_TagMap["img="] = std::make_pair(QRegExp("\\[img=([^\\]]*)\\](.*)\\[/img\\]"),
"<img src=\"\\2\" align=\"\\1\" />");*/
m_TagMap["img"] = std::make_pair(QRegExp("\\[img\\](.*)\\[/img\\]"), "");
m_TagMap["img="] = std::make_pair(QRegExp("\\[img=([^\\]]*)\\](.*)\\[/img\\]"), "");
m_TagMap["email="] = std::make_pair(QRegExp("\\[email=\"?([^\\]]*)\"?\\](.*)\\[/email\\]"),
"<a href=\"mailto:\\1\">\\2</a>");
m_TagMap["youtube"] = std::make_pair(QRegExp("\\[youtube\\](.*)\\[/youtube\\]"),
"<a href=\"http://www.youtube.com/v/\\1\">http://www.youtube.com/v/\\1</a>");
// make all patterns non-greedy and case-insensitive
for (TagMap::iterator iter = m_TagMap.begin(); iter != m_TagMap.end(); ++iter) {
iter->second.first.setCaseSensitivity(Qt::CaseInsensitive);
iter->second.first.setMinimal(true);
}
}
private:
QRegExp m_TagNameExp;
TagMap m_TagMap;
};
QString convertToHTML(const QString &inputParam)
{
// this code goes over the input string once and replaces all bbtags
// it encounters. This function is called recursively for every replaced
// string to convert nested tags.
//
// This could be implemented simpler by applying a set of regular expressions
// for each recognized bb-tag one after the other but that would probably be
// very inefficient (O(n^2)).
QString input = inputParam.mid(0).replace("\r\n", "<br/>");
input.replace("\\\"", "\"").replace("\\'", "'");
QString result;
int lastBlock = 0;
int pos = 0;
// iterate over the input buffer
while ((pos = input.indexOf('[', lastBlock)) != -1) {
// append everything between the previous tag-block and the current one
result.append(input.midRef(lastBlock, pos - lastBlock));
// convert the tag and content if necessary
int length = -1;
QString replacement = BBCodeMap::instance().convertTag(input.mid(pos), length);
if (length != 0) {
QString temp = convertToHTML(replacement);
result.append(temp);
// length contains the number of characters in the original tag
pos += length;
} else {
// nothing replaced
result.append('[');
++pos;
}
lastBlock = pos;
}
// append the remainder (everything after the last tag)
result.append(input.midRef(lastBlock));
return result;
}
} // namespace BBCode
+21 -21
View File
@@ -17,24 +17,24 @@ 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
#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
+21 -2
View File
@@ -25,6 +25,7 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
#include <QFile>
#include <QDir>
#include <QList>
#include <QCoreApplication>
using namespace MOBase;
@@ -34,11 +35,17 @@ using namespace MOShared;
CategoryFactory* CategoryFactory::s_Instance = NULL;
QString CategoryFactory::categoriesFilePath()
{
return QCoreApplication::applicationDirPath() + "/categories.dat";
}
CategoryFactory::CategoryFactory()
{
reset();
QFile categoryFile(QDir::fromNativeSeparators(ToQString(GameInfo::instance().getOrganizerDirectory())).append("/categories.dat"));
QFile categoryFile(categoriesFilePath());
if (!categoryFile.open(QIODevice::ReadOnly)) {
loadDefaultCategories();
@@ -120,7 +127,7 @@ void CategoryFactory::setParents()
void CategoryFactory::saveCategories()
{
QFile categoryFile(QDir::fromNativeSeparators(ToQString(GameInfo::instance().getOrganizerDirectory())).append("/categories.dat"));
QFile categoryFile(categoriesFilePath());
if (!categoryFile.open(QIODevice::WriteOnly)) {
reportError(QObject::tr("Failed to save custom categories"));
@@ -144,6 +151,18 @@ void CategoryFactory::saveCategories()
}
unsigned int CategoryFactory::countCategories(std::tr1::function<bool (const Category &category)> filter)
{
unsigned int result = 0;
for (auto iter = m_Categories.begin(); iter != m_Categories.end(); ++iter) {
if (filter(*iter)) {
++result;
}
}
return result;
}
void CategoryFactory::addCategory(int id, const QString &name, const std::vector<int> &nexusIDs, int parentID)
{
int index = m_Categories.size();
+174 -161
View File
@@ -17,164 +17,177 @@ 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>
/**
* @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;
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 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();
private:
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;
}
};
private:
CategoryFactory();
void loadDefaultCategories();
void addCategory(int id, const QString &name, const std::vector<int> &nexusID, int parentID);
void setParents();
private:
static CategoryFactory *s_Instance;
std::vector<Category> m_Categories;
std::map<int, unsigned int> m_IDMap;
std::map<int, unsigned int> m_NexusMap;
};
#endif // CATEGORIES_H
#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;
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();
private:
static CategoryFactory *s_Instance;
std::vector<Category> m_Categories;
std::map<int, unsigned int> m_IDMap;
std::map<int, unsigned int> m_NexusMap;
};
#endif // CATEGORIES_H
+3 -2
View File
@@ -86,7 +86,8 @@ public:
{
QLineEdit *edit = qobject_cast<QLineEdit*>(editor);
int pos = 0;
if (m_Validator->validate(edit->text(), pos) == QValidator::Acceptable) {
QString editText = edit->text();
if (m_Validator->validate(editText, pos) == QValidator::Acceptable) {
QItemDelegate::setModelData(editor, model, index);
}
}
@@ -163,7 +164,7 @@ void CategoriesDialog::fillTable()
CategoryFactory &categories = CategoryFactory::instance();
QTableWidget *table = ui->categoriesTable;
#if QT_VERSION >= 0x050000
#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
table->horizontalHeader()->setSectionResizeMode(0, QHeaderView::Fixed);
table->horizontalHeader()->setSectionResizeMode(1, QHeaderView::Stretch);
table->horizontalHeader()->setSectionResizeMode(2, QHeaderView::Fixed);
+5
View File
@@ -33,6 +33,11 @@ DirectoryRefresher::DirectoryRefresher()
{
}
DirectoryRefresher::~DirectoryRefresher()
{
delete m_DirectoryStructure;
}
DirectoryEntry *DirectoryRefresher::getDirectoryStructure()
{
QMutexLocker locker(&m_RefreshLock);
+3 -1
View File
@@ -21,10 +21,10 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
#define DIRECTORYREFRESHER_H
#include <QObject>
#include <directoryentry.h>
#include <vector>
#include <QMutex>
#include <tuple>
#include <directoryentry.h>
/**
@@ -43,6 +43,8 @@ public:
**/
DirectoryRefresher();
~DirectoryRefresher();
/**
* @brief retrieve the updated directory structure
*
+15
View File
@@ -0,0 +1,15 @@
<?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="icuin49.dll"/>
<file name="icuuc49.dll"/>
<file name="icudt49.dll"/>
<file name="Qt5Cored.dll"/>
<file name="Qt5Declaratived.dll"/>
<file name="Qt5Guid.dll"/>
<file name="Qt5Networkd.dll"/>
<file name="Qt5Scriptd.dll"/>
<file name="Qt5Sqld.dll"/>
<file name="Qt5Widgetsd.dll"/>
<file name="Qt5XmlPatternsd.dll"/>
</assembly>
+17
View File
@@ -0,0 +1,17 @@
<?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="icuin49.dll"/>
<file name="icuuc49.dll"/>
<file name="icudt49.dll"/>
<file name="Qt5Core.dll"/>
<file name="Qt5Declarative.dll"/>
<file name="Qt5Gui.dll"/>
<file name="Qt5Network.dll"/>
<file name="Qt5Script.dll"/>
<file name="Qt5Sql.dll"/>
<file name="Qt5Svg.dll"/>
<file name="Qt5Widgets.dll"/>
<file name="Qt5Xml.dll"/>
<file name="Qt5XmlPatterns.dll"/>
</assembly>
+88 -87
View File
@@ -17,90 +17,91 @@ 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 "downloadlist.h"
#include "downloadmanager.h"
#include <QEvent>
#include <QSortFilterProxyModel>
DownloadList::DownloadList(DownloadManager *manager, QObject *parent)
: QAbstractTableModel(parent), m_Manager(manager)
{
connect(m_Manager, SIGNAL(update(int)), this, SLOT(update(int)));
connect(m_Manager, SIGNAL(aboutToUpdate()), this, SLOT(aboutToUpdate()));
}
int DownloadList::rowCount(const QModelIndex&) const
{
return m_Manager->numTotalDownloads();
}
int DownloadList::columnCount(const QModelIndex&) const
{
return 3;
}
QModelIndex DownloadList::index(int row, int column, const QModelIndex&) const
{
return createIndex(row, column, row);
}
QModelIndex DownloadList::parent(const QModelIndex&) const
{
return QModelIndex();
}
QVariant DownloadList::headerData(int section, Qt::Orientation orientation, int role) const
{
if ((role == Qt::DisplayRole) &&
(orientation == Qt::Horizontal)) {
switch (section) {
case 0: return tr("Name");
case 1: return tr("Filetime");
default: return tr("Done");
}
} else {
return QAbstractItemModel::headerData(section, orientation, role);
}
}
QVariant DownloadList::data(const QModelIndex &index, int role) const
{
if (role == Qt::DisplayRole) {
return index.row();
} else if (role == Qt::ToolTipRole) {
if (m_Manager->isInfoIncomplete(index.row())) {
return tr("Information missing, please select \"Query Info\" from the context menu to re-retrieve.");
} else {
NexusInfo info = m_Manager->getNexusInfo(index.row());
return QString("%1 (ID %2) %3").arg(info.m_ModName).arg(m_Manager->getModID(index.row())).arg(info.m_Version);
}
} else {
return QVariant();
}
}
void DownloadList::aboutToUpdate()
{
emit beginResetModel();
}
void DownloadList::update(int row)
{
if (row < 0) {
emit endResetModel();
} else if (row < this->rowCount()) {
emit dataChanged(this->index(row, 0, QModelIndex()), this->index(row, 1, QModelIndex()));
} else {
qCritical("invalid row %d in download list, update failed", row);
}
}
#include "downloadlist.h"
#include "downloadmanager.h"
#include <QEvent>
#include <QSortFilterProxyModel>
DownloadList::DownloadList(DownloadManager *manager, QObject *parent)
: QAbstractTableModel(parent), m_Manager(manager)
{
connect(m_Manager, SIGNAL(update(int)), this, SLOT(update(int)));
connect(m_Manager, SIGNAL(aboutToUpdate()), this, SLOT(aboutToUpdate()));
}
int DownloadList::rowCount(const QModelIndex&) const
{
return m_Manager->numTotalDownloads();
}
int DownloadList::columnCount(const QModelIndex&) const
{
return 3;
}
QModelIndex DownloadList::index(int row, int column, const QModelIndex&) const
{
return createIndex(row, column, row);
}
QModelIndex DownloadList::parent(const QModelIndex&) const
{
return QModelIndex();
}
QVariant DownloadList::headerData(int section, Qt::Orientation orientation, int role) const
{
if ((role == Qt::DisplayRole) &&
(orientation == Qt::Horizontal)) {
switch (section) {
case 0: return tr("Name");
case 1: return tr("Filetime");
default: return tr("Done");
}
} else {
return QAbstractItemModel::headerData(section, orientation, role);
}
}
QVariant DownloadList::data(const QModelIndex &index, int role) const
{
if (role == Qt::DisplayRole) {
return index.row();
} else if (role == Qt::ToolTipRole) {
if (m_Manager->isInfoIncomplete(index.row())) {
return tr("Information missing, please select \"Query Info\" from the context menu to re-retrieve.");
} else {
NexusInfo info = m_Manager->getNexusInfo(index.row());
return QString("%1 (ID %2) %3").arg(info.m_ModName).arg(m_Manager->getModID(index.row())).arg(info.m_Version);
}
} else {
return QVariant();
}
}
void DownloadList::aboutToUpdate()
{
emit beginResetModel();
}
void DownloadList::update(int row)
{
if (row < 0) {
emit endResetModel();
} else if (row < this->rowCount()) {
#pragma message("updating only the one column is a hack")
emit dataChanged(this->index(row, 2, QModelIndex()), this->index(row, 2, QModelIndex()));
} else {
qCritical("invalid row %d in download list, update failed", row);
}
}
+69 -73
View File
@@ -17,76 +17,72 @@ 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 DOWNLOADLIST_H
#define DOWNLOADLIST_H
#include <QAbstractTableModel>
class DownloadManager;
/**
* @brief model of the list of active and completed downloads
**/
class DownloadList : public QAbstractTableModel
{
Q_OBJECT
public:
/**
* @brief constructor
*
* @param manager the download manager processing downloads
* @param parent parent object Defaults to 0.
**/
explicit DownloadList(DownloadManager *manager, QObject *parent = 0);
/**
* @brief retrieve the number of rows to display. Invoked by Qt
*
* @param parent not relevant for this implementation
* @return number of rows to display
**/
virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
virtual int columnCount(const QModelIndex &parent) const;
QModelIndex index(int row, int column, const QModelIndex &parent) const;
QModelIndex parent(const QModelIndex &child) const;
virtual QVariant headerData(int section, Qt::Orientation orientation, int role) const;
/**
* @brief retrieve the data to display in a specific row. Invoked by Qt
*
* @param index location to look up
* @param role ... Defaults to Qt::DisplayRole.
* @return this implementation only returns the row, the QItemDelegate implementation is expected to fetch its information from the DownloadManager
**/
virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
signals:
public slots:
/**
* @brief used to inform the model that data has changed
*
* @param row the row that changed. This can be negative to update the whole view
**/
void update(int row);
void aboutToUpdate();
private:
private:
DownloadManager *m_Manager;
};
#endif // DOWNLOADLIST_H
#ifndef DOWNLOADLIST_H
#define DOWNLOADLIST_H
#include <QAbstractTableModel>
class DownloadManager;
/**
* @brief model of the list of active and completed downloads
**/
class DownloadList : public QAbstractTableModel
{
Q_OBJECT
public:
/**
* @brief constructor
*
* @param manager the download manager processing downloads
* @param parent parent object Defaults to 0.
**/
explicit DownloadList(DownloadManager *manager, QObject *parent = 0);
/**
* @brief retrieve the number of rows to display. Invoked by Qt
*
* @param parent not relevant for this implementation
* @return number of rows to display
**/
virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
virtual int columnCount(const QModelIndex &parent) const;
QModelIndex index(int row, int column, const QModelIndex &parent) const;
QModelIndex parent(const QModelIndex &child) const;
virtual QVariant headerData(int section, Qt::Orientation orientation, int role) const;
/**
* @brief retrieve the data to display in a specific row. Invoked by Qt
*
* @param index location to look up
* @param role ... Defaults to Qt::DisplayRole.
* @return this implementation only returns the row, the QItemDelegate implementation is expected to fetch its information from the DownloadManager
**/
virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
public slots:
/**
* @brief used to inform the model that data has changed
*
* @param row the row that changed. This can be negative to update the whole view
**/
void update(int row);
void aboutToUpdate();
private:
DownloadManager *m_Manager;
};
#endif // DOWNLOADLIST_H
+292 -223
View File
File diff suppressed because it is too large Load Diff
+95 -83
View File
@@ -17,86 +17,98 @@ 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 DOWNLOADLISTWIDGET_H
#define DOWNLOADLISTWIDGET_H
#include <QWidget>
#include <QItemDelegate>
#include <QLabel>
#include <QProgressBar>
#include <QTreeView>
namespace Ui {
class DownloadListWidget;
}
class DownloadListWidget : public QWidget
{
Q_OBJECT
public:
explicit DownloadListWidget(QWidget *parent = 0);
~DownloadListWidget();
private:
Ui::DownloadListWidget *ui;
};
class DownloadManager;
class DownloadListWidgetDelegate : public QItemDelegate
{
Q_OBJECT
public:
DownloadListWidgetDelegate(DownloadManager *manager, QTreeView *view, QObject *parent = 0);
~DownloadListWidgetDelegate();
virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
virtual QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const;
signals:
void installDownload(int index);
void queryInfo(int index);
void removeDownload(int index, bool deleteFile);
void cancelDownload(int index);
void pauseDownload(int index);
void resumeDownload(int index);
protected:
bool editorEvent(QEvent *event, QAbstractItemModel *model,
const QStyleOptionViewItem &option, const QModelIndex &index);
private slots:
void issueInstall();
void issueDelete();
void issueRemoveFromView();
void issueCancel();
void issuePause();
void issueResume();
void issueDeleteAll();
void issueDeleteCompleted();
void issueRemoveFromViewAll();
void issueRemoveFromViewCompleted();
void issueQueryInfo();
private:
DownloadListWidget *m_ItemWidget;
DownloadManager *m_Manager;
QLabel *m_NameLabel;
QProgressBar *m_Progress;
QLabel *m_InstallLabel;
int m_ContextRow;
QTreeView *m_View;
};
#endif // DOWNLOADLISTWIDGET_H
#ifndef DOWNLOADLISTWIDGET_H
#define DOWNLOADLISTWIDGET_H
#include <QWidget>
#include <QItemDelegate>
#include <QLabel>
#include <QProgressBar>
#include <QTreeView>
#include "downloadmanager.h"
namespace Ui {
class DownloadListWidget;
}
class DownloadListWidget : public QWidget
{
Q_OBJECT
public:
explicit DownloadListWidget(QWidget *parent = 0);
~DownloadListWidget();
private:
Ui::DownloadListWidget *ui;
};
class DownloadManager;
class DownloadListWidgetDelegate : public QItemDelegate
{
Q_OBJECT
public:
DownloadListWidgetDelegate(DownloadManager *manager, QTreeView *view, QObject *parent = 0);
~DownloadListWidgetDelegate();
virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
virtual QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const;
signals:
void installDownload(int index);
void queryInfo(int index);
void removeDownload(int index, bool deleteFile);
void cancelDownload(int index);
void pauseDownload(int index);
void resumeDownload(int index);
protected:
bool editorEvent(QEvent *event, QAbstractItemModel *model,
const QStyleOptionViewItem &option, const QModelIndex &index);
private:
void drawCache(QPainter *painter, const QStyleOptionViewItem &option, const QPixmap &cache) const;
private slots:
void issueInstall();
void issueDelete();
void issueRemoveFromView();
void issueCancel();
void issuePause();
void issueResume();
void issueDeleteAll();
void issueDeleteCompleted();
void issueRemoveFromViewAll();
void issueRemoveFromViewCompleted();
void issueQueryInfo();
void stateChanged(int row, DownloadManager::DownloadState);
void resetCache(int);
private:
DownloadListWidget *m_ItemWidget;
DownloadManager *m_Manager;
QLabel *m_NameLabel;
QLabel *m_SizeLabel;
QProgressBar *m_Progress;
QLabel *m_InstallLabel;
int m_ContextRow;
QTreeView *m_View;
mutable QMap<int, QPixmap> m_Cache;
};
#endif // DOWNLOADLISTWIDGET_H
+48 -17
View File
@@ -42,23 +42,54 @@
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QLabel" name="nameLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>323</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>Placeholder</string>
</property>
</widget>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="nameLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>323</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>Placeholder</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="sizeLabel">
<property name="text">
<string>0</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>KB</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">

Some files were not shown because too many files have changed in this diff Show More