From fd6345cd4e49a135dd833e8567cb5bbe6887ebb9 Mon Sep 17 00:00:00 2001 From: Krzysztof Starecki Date: Mon, 31 Dec 2018 20:29:03 +0100 Subject: Add 'download meta information' support to download tab --- src/downloadlist.cpp | 7 +- src/downloadlist.h | 3 + src/downloadlistwidget.cpp | 10 + src/downloadlistwidget.h | 4 + src/mainwindow.cpp | 7 +- src/organizer_en.ts | 502 ++++++++++++++++++++++----------------------- 6 files changed, 279 insertions(+), 254 deletions(-) (limited to 'src') diff --git a/src/downloadlist.cpp b/src/downloadlist.cpp index fa2cc077..a0286aef 100644 --- a/src/downloadlist.cpp +++ b/src/downloadlist.cpp @@ -33,6 +33,11 @@ DownloadList::DownloadList(DownloadManager *manager, QObject *parent) connect(m_Manager, SIGNAL(aboutToUpdate()), this, SLOT(aboutToUpdate())); } +void DownloadList::setMetaDisplay(bool metaDisplay) +{ + m_MetaDisplay = metaDisplay; +} + int DownloadList::rowCount(const QModelIndex&) const { @@ -86,7 +91,7 @@ QVariant DownloadList::data(const QModelIndex &index, int role) const } } else { switch (index.column()) { - case COL_NAME: return m_Manager->getFileName(index.row()); + case COL_NAME: return m_MetaDisplay ? m_Manager->getDisplayName(index.row()) : m_Manager->getFileName(index.row()); case COL_SIZE: return sizeFormat(m_Manager->getFileSize(index.row())); case COL_STATUS: switch (m_Manager->getState(index.row())) { diff --git a/src/downloadlist.h b/src/downloadlist.h index 4e0b5ef4..a504f209 100644 --- a/src/downloadlist.h +++ b/src/downloadlist.h @@ -52,6 +52,8 @@ public: **/ explicit DownloadList(DownloadManager *manager, QObject *parent = 0); + void setMetaDisplay(bool metaDisplay); + /** * @brief retrieve the number of rows to display. Invoked by Qt * @@ -90,6 +92,7 @@ public slots: private: DownloadManager *m_Manager; + bool m_MetaDisplay; QString sizeFormat(quint64 size) const; }; diff --git a/src/downloadlistwidget.cpp b/src/downloadlistwidget.cpp index f69f9e9f..6c7447c8 100644 --- a/src/downloadlistwidget.cpp +++ b/src/downloadlistwidget.cpp @@ -84,6 +84,16 @@ void DownloadListWidget::setManager(DownloadManager *manager) m_Manager = manager; } +void DownloadListWidget::setSourceModel(DownloadList *sourceModel) +{ + m_SourceModel = sourceModel; +} + +void DownloadListWidget::setMetaDisplay(bool metaDisplay) +{ + m_SourceModel->setMetaDisplay(metaDisplay); +} + void DownloadListWidget::onDoubleClick(const QModelIndex &index) { QModelIndex sourceIndex = qobject_cast(model())->mapToSource(index); diff --git a/src/downloadlistwidget.h b/src/downloadlistwidget.h index 93ece07a..c8d4fe6e 100644 --- a/src/downloadlistwidget.h +++ b/src/downloadlistwidget.h @@ -21,6 +21,7 @@ along with Mod Organizer. If not, see . #define DOWNLOADLISTWIDGET_H #include "downloadmanager.h" +#include "downloadlist.h" #include "downloadlistsortproxy.h" #include #include @@ -58,6 +59,8 @@ public: ~DownloadListWidget(); void setManager(DownloadManager *manager); + void setSourceModel(DownloadList *sourceModel); + void setMetaDisplay(bool metaDisplay); signals: void installDownload(int index); @@ -95,6 +98,7 @@ private slots: private: DownloadManager *m_Manager; + DownloadList *m_SourceModel; int m_ContextRow; }; diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 2fcec086..63606833 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -5150,12 +5150,14 @@ void MainWindow::on_actionEndorseMO_triggered() void MainWindow::initDownloadView() { + DownloadList *sourceModel = new DownloadList(m_OrganizerCore.downloadManager(), ui->downloadView); DownloadListSortProxy *sortProxy = new DownloadListSortProxy(m_OrganizerCore.downloadManager(), ui->downloadView); - sortProxy->setSourceModel(new DownloadList(m_OrganizerCore.downloadManager(), ui->downloadView)); + sortProxy->setSourceModel(sourceModel); connect(ui->downloadFilterEdit, SIGNAL(textChanged(QString)), sortProxy, SLOT(updateFilter(QString))); connect(ui->downloadFilterEdit, SIGNAL(textChanged(QString)), this, SLOT(downloadFilterChanged(QString))); - ui->downloadView->setModel(sortProxy); + ui->downloadView->setSourceModel(sourceModel); + ui->downloadView->setModel(sortProxy); ui->downloadView->setManager(m_OrganizerCore.downloadManager()); ui->downloadView->setItemDelegate(new DownloadProgressDelegate(m_OrganizerCore.downloadManager(), sortProxy, ui->downloadView)); ui->downloadView->setUniformRowHeights(true); @@ -5183,6 +5185,7 @@ void MainWindow::updateDownloadView() ui->downloadView->setProperty("downloadView", "compact"); else ui->downloadView->setProperty("downloadView", "standard"); + ui->downloadView->setMetaDisplay(m_OrganizerCore.settings().metaDownloads()); ui->downloadView->style()->unpolish(ui->downloadView); ui->downloadView->style()->polish(ui->downloadView); m_OrganizerCore.downloadManager()->refreshList(); diff --git a/src/organizer_en.ts b/src/organizer_en.ts index 6c1488eb..48936ca9 100644 --- a/src/organizer_en.ts +++ b/src/organizer_en.ts @@ -292,97 +292,97 @@ p, li { white-space: pre-wrap; } DownloadList - + Name - + Size - + Status - + < game %1 mod %2 file %3 > - + Unknown - + Pending - + Started - + Canceling - + Pausing - + Canceled - + Paused - + Error - + Fetching Info 1 - + Fetching Info 2 - + Downloaded - + Installed - + Uninstalled - - pending download + + Pending download - + Information missing, please select "Query Info" from the context menu to re-retrieve. @@ -390,145 +390,145 @@ p, li { white-space: pre-wrap; } DownloadListWidget - + Install - + Query Info - + Visit on Nexus - + Open File - - - + + + Show in Folder - - + + Delete - + Un-Hide - + Hide - + Cancel - + Pause - + Resume - + Delete Installed... - + Delete Uninstalled... - + Delete All... - + Hide Installed... - + Hide Uninstalled... - + Hide All... - + Un-Hide All... - - - - + + + + Delete Files? - + This will permanently delete the selected download. - + This will remove all finished downloads from this list and from disk. - + This will remove all installed downloads from this list and from disk. - + This will remove all uninstalled downloads from this list and from disk. - - - + + + Are you sure? - + This will remove all finished downloads from this list (but NOT from disk). - + This will remove all installed downloads from this list (but NOT from disk). - + This will remove all uninstalled downloads from this list (but NOT from disk). @@ -1608,7 +1608,7 @@ p, li { white-space: pre-wrap; } - + Refresh @@ -1792,7 +1792,7 @@ p, li { white-space: pre-wrap; } - + Update @@ -1803,7 +1803,7 @@ p, li { white-space: pre-wrap; } - + No Problems @@ -1833,7 +1833,7 @@ Right now this has very limited functionality - + Endorse Mod Organizer @@ -1853,288 +1853,288 @@ Right now this has very limited functionality - + Toolbar - + Desktop - + Start Menu - + There is no supported sort mechanism for this game. You will probably have to use a third-party tool. - + Crash on exit - + MO crashed while exiting. Some settings may not be saved. Error: %1 - + Problems - + There are potential problems with your setup - + Everything seems to be in order - + Endorse - + Won't Endorse - + Help on UI - + Documentation Wiki - + Report Issue - + Tutorials - + About - + About Qt - + Name - + Please enter a name for the new profile - + failed to create profile: %1 - + Show tutorial? - + You are starting Mod Organizer for the first time. Do you want to show a tutorial of its basic features? If you choose no you can always start the tutorial from the "Help"-menu. - + Downloads in progress - + There are still downloads in progress, do you really want to quit? - + Plugin "%1" failed: %2 - + Plugin "%1" failed - + Browse Mod Page - + Also in: <br> - + No conflict - + <Edit...> - + This bsa is enabled in the ini file so it may be required! - + Activating Network Proxy - + Notice: Your current MO version (%1) is lower than the previous version (%2).<br>The GUI may not downgrade gracefully, so you may experience oddities.<br>However, there should be no serious issues. - + Choose Mod - + Mod Archive - + Start Tutorial? - + You're about to start a tutorial. For technical reasons it's not possible to end the tutorial early. Continue? - + failed to spawn notepad.exe: %1 - + failed to change origin name: %1 - + failed to move "%1" from mod "%2" to "%3": %4 - + <Contains %1> - + <Checked> - + <Unchecked> - + <Update> - + <Mod Backup> - + <Managed by MO> - + <Managed outside MO> - + <No category> - + <Conflicted> - + <Not Endorsed> - + failed to rename mod: %1 - + Overwrite? - + This will replace the existing mod "%1". Continue? - + failed to remove mod "%1" - - - + + + failed to rename "%1" to "%2" - + @@ -2142,129 +2142,129 @@ Error: %1 - + Remove the following mods?<br><ul>%1</ul> - + failed to remove mod: %1 - - - + + + Failed - + Installation file no longer exists - + Mods installed with old versions of MO can't be reinstalled in this way. - + Failed to create backup. - + You need to be logged in with Nexus to resume a download - - - - + + + + You need to be logged in with Nexus to endorse - - + + Endorsing multiple mods will take a while. Please wait... - - + + Unendorsing multiple mods will take a while. Please wait... - + Failed to display overwrite dialog: %1 - + Opening Nexus Links - + You are trying to open %1 links to Nexus Mods. Are you sure you want to do this? - + Nexus ID for this Mod is unknown - + Web page for this mod is unknown - + <table cellspacing="5"><tr><th>Type</th><th>All</th><th>Visible</th><tr><td>Enabled mods:&emsp;</td><td align=right>%1 / %2</td><td align=right>%3 / %4</td></tr><tr><td>Unmanaged/DLCs:&emsp;</td><td align=right>%5</td><td align=right>%6</td></tr><tr><td>Mod backups:&emsp;</td><td align=right>%7</td><td align=right>%8</td></tr><tr><td>Separators:&emsp;</td><td align=right>%9</td><td align=right>%10</td></tr></table> - + <table cellspacing="4"><tr><th>Type</th><th>Active</th><th>Total</th></tr><tr><td>Active plugins:</td><td align=right>%1</td><td align=right>%2</td></tr><tr><td>Active ESMs:</td><td align=right>%3</td><td align=right>%4</td></tr><tr><td>Active ESPs:</td><td align=right>%7</td><td align=right>%8</td></tr><tr><td>Active ESMs+ESPs:</td><td align=right>%9</td><td align=right>%10</td></tr><tr><td>Active ESLs:</td><td align=right>%5</td><td align=right>%6</td></tr></table> - + Create Mod... - + This will create an empty mod. Please enter a name: - + A mod with this name already exists - + Create Separator... - + This will create a new separator. Please enter a name: - + A separator with this name already exists @@ -2276,7 +2276,7 @@ Please enter a name: - + Are you sure? @@ -2304,7 +2304,7 @@ This function will guess the versioning scheme under the assumption that the ins - + Sorry @@ -2603,13 +2603,13 @@ You can also use online editors and converters instead. - + Enable selected - + Disable selected @@ -2670,13 +2670,13 @@ You can also use online editors and converters instead. - + Exception: - + Unknown exception @@ -2745,330 +2745,330 @@ Click OK to restart MO now. - + failed to write to file %1 - + %1 written - + Select binary - + Binary - + Enter Name - + Please enter a name for the executable - + Not an executable - + This is not a recognized executable. - - + + Replace file? - + There already is a hidden version of this file. Replace it? - - + + File operation failed - - + + Failed to remove "%1". Maybe you lack the required file permissions? - + There already is a visible version of this file. Replace it? - - + + Set Priority - + Set the priority of the selected plugins - + file not found: %1 - + failed to generate preview for %1 - + Sorry, can't preview anything. This function currently does not support extracting from bsas. - + Update available - + Open/Execute - + Add as Executable - + Preview - + Un-Hide - + Hide - + Write To File... - + Do you want to endorse Mod Organizer on %1 now? - + Thank you! - + Thank you for your endorsement! - + Request to Nexus failed: %1 - - + + failed to read %1: %2 - - + + Error - + failed to extract %1 (errorcode %2) - + Extract BSA - + This archive contains invalid hashes. Some files may be broken. - + Extract... - + This will restart MO, continue? - + Edit Categories... - + Deselect filter - + Remove - + Enable all - + Disable all - + Unlock load order - + Lock load order - + Open Origin in Explorer - + Open Origin Info... - + depends on missing "%1" - + incompatible with "%1" - + Please wait while LOOT is running - + loot failed. Exit code was: %1 - + failed to start loot - + failed to run loot: %1 - + Errors occured - + Backup of load order created - + Choose backup to restore - + No Backups - + There are no backups to restore - - + + Restore failed - - + + Failed to restore the backup. Errorcode: %1 - + Backup of modlist created - + A file with the same name has already been downloaded. What would you like to do? - + Overwrite - + Rename new file - + Ignore file - + Set the priority of the selected mods @@ -5410,7 +5410,7 @@ If the folder was still in use, restart MO and try again. - + Mod Organizer @@ -5425,18 +5425,18 @@ If the folder was still in use, restart MO and try again. - + Please use "Help" from the toolbar to get usage instructions to all elements - - + + <Manage...> - + failed to parse profile %1: %2 @@ -5487,12 +5487,12 @@ If the folder was still in use, restart MO and try again. - + Script Extender - + Proxy DLL @@ -5708,28 +5708,28 @@ Select Show Details option to see the full change-log. - - + + attempt to store setting for unknown plugin "%1" - + Error - + Failed to create "%1", you may not have the necessary permission. path remains unchanged. - + Restart Mod Organizer? - + In order to reset the window geometries, MO must be restarted. Restart it now? @@ -6410,22 +6410,22 @@ programs you are intentionally running. - + Confirm - + Changing the mod directory affects all your profiles! Mods not present (or named differently) in the new location will be disabled in all profiles. There is no way to undo this unless you backed up your profiles manually. Proceed? - + Executables Blacklist - + Enter one executable per line to be blacklisted from the virtual file system. Mods and other virtualized files will not be visible to these executables and any executables launched by them. @@ -6436,47 +6436,47 @@ Example: - + Select base directory - + Select download directory - + Select mod directory - + Select cache directory - + Select profiles directory - + Select overwrite directory - + Select game executable - + Confirm? - + This will make all dialogs show up again where you checked the "Remember selection"-box. Continue? -- cgit v1.3.1