From a803baa900caa16e45578205d4f68ee2bfde5cc1 Mon Sep 17 00:00:00 2001 From: Krzysztof Starecki Date: Thu, 14 Feb 2019 15:20:23 +0100 Subject: Fix mod context menu memleak (issue #379) --- src/organizer_en.ts | 268 ++++++++++++++++++++++++++-------------------------- 1 file changed, 134 insertions(+), 134 deletions(-) (limited to 'src/organizer_en.ts') diff --git a/src/organizer_en.ts b/src/organizer_en.ts index fea69f69..130c927b 100644 --- a/src/organizer_en.ts +++ b/src/organizer_en.ts @@ -1555,7 +1555,7 @@ p, li { white-space: pre-wrap; } - + Create Backup @@ -1732,7 +1732,7 @@ p, li { white-space: pre-wrap; } - + Refresh @@ -1927,7 +1927,7 @@ p, li { white-space: pre-wrap; } - + Update @@ -1969,7 +1969,7 @@ Right now this has very limited functionality - + Endorse Mod Organizer @@ -2037,8 +2037,8 @@ Error: %1 - - + + Endorse @@ -2269,8 +2269,8 @@ Error: %1 - - + + failed to rename "%1" to "%2" @@ -2278,7 +2278,7 @@ Error: %1 - + Confirm @@ -2387,7 +2387,7 @@ Error: %1 - + Create Mod... @@ -2432,7 +2432,7 @@ Please enter a name: - + Are you sure? @@ -2460,7 +2460,7 @@ This function will guess the versioning scheme under the assumption that the ins - + Sorry @@ -2685,184 +2685,184 @@ You can also use online editors and converters instead. - + All Mods - + Sync to Mods... - + Move content to Mod... - + Clear Overwrite... - - + + Open in Explorer - + Restore Backup - + Remove Backup... - - + + Change Categories - - + + Primary Category - + Rename Separator... - + Remove Separator... - + Select Color... - + Reset Color - + Change versioning scheme - + Un-ignore update - + Ignore update - - + + Enable selected - - + + Disable selected - + Rename Mod... - + Reinstall Mod - + Remove Mod... - + Un-Endorse - + Won't endorse - + Endorsement state unknown - + Ignore missing data - + Mark as converted/working - + Visit on Nexus - + Visit web page - + Information... - - + + Exception: - - + + Unknown exception - + <All> - + <Multiple> - + %1 more - + Are you sure you want to remove the following %n save(s)?<br><ul>%1</ul><br>Removed saves will be sent to the Recycle Bin. @@ -2870,12 +2870,12 @@ You can also use online editors and converters instead. - + Enable Mods... - + Delete %n save(s) @@ -2883,22 +2883,22 @@ You can also use online editors and converters instead. - + failed to remove %1 - + failed to create %1 - + Restarting MO - + Changing the managed game directory requires restarting MO. Any pending downloads will be paused. @@ -2906,335 +2906,335 @@ Click OK to restart MO now. - + Can't change download directory while downloads are in progress! - + 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 @@ -5649,7 +5649,7 @@ If the folder was still in use, restart MO and try again. - + <Manage...> -- cgit v1.3.1 From 448a37e6bccc3b7a792fe694c5e31586de82f971 Mon Sep 17 00:00:00 2001 From: Krzysztof Starecki Date: Thu, 14 Feb 2019 16:30:18 +0100 Subject: Fix mod context menu rendering issue --- src/mainwindow.cpp | 13 ++- src/mainwindow.h | 2 +- src/organizer_en.ts | 268 ++++++++++++++++++++++++++-------------------------- 3 files changed, 141 insertions(+), 142 deletions(-) (limited to 'src/organizer_en.ts') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index b136a3a7..f6ec4f40 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -338,7 +338,7 @@ MainWindow::MainWindow(QSettings &initSettings linkMenu->addAction(QIcon(":/MO/gui/link"), tr("Start Menu"), this, SLOT(linkMenu())); ui->linkButton->setMenu(linkMenu); - ui->listOptionsBtn->setMenu(modListContextMenu()); + ui->listOptionsBtn->setMenu(modListContextMenu(ui->listOptionsBtn)); connect(ui->listOptionsBtn, SIGNAL(pressed()), this, SLOT(on_listOptionsBtn_pressed())); ui->openFolderMenu->setMenu(openFolderMenu()); @@ -4375,9 +4375,9 @@ QMenu *MainWindow::openFolderMenu() return FolderMenu; } -QMenu *MainWindow::modListContextMenu() +QMenu *MainWindow::modListContextMenu(QWidget *parent) { - QMenu *menu = new QMenu(this); + QMenu *menu = new QMenu(parent); menu->addAction(tr("Install Mod..."), this, SLOT(installMod_clicked())); menu->addAction(tr("Create empty mod"), this, SLOT(createEmptyMod_clicked())); @@ -4439,13 +4439,12 @@ void MainWindow::on_modList_customContextMenuRequested(const QPoint &pos) m_ContextRow = m_ContextIdx.row(); QMenu *menu = nullptr; - QMenu *allMods = modListContextMenu(); if (m_ContextRow == -1) { // no selection - menu = allMods; + menu = modListContextMenu(this); } else { menu = new QMenu(this); - allMods->setParent(menu); + QMenu *allMods = modListContextMenu(menu); allMods->setTitle(tr("All Mods")); menu->addMenu(allMods); menu->addSeparator(); @@ -4922,7 +4921,7 @@ void MainWindow::languageChange(const QString &newLanguage) updateDownloadView(); updateProblemsButton(); - ui->listOptionsBtn->setMenu(modListContextMenu()); + ui->listOptionsBtn->setMenu(modListContextMenu(ui->listOptionsBtn)); ui->openFolderMenu->setMenu(openFolderMenu()); } diff --git a/src/mainwindow.h b/src/mainwindow.h index e919ed2c..6e2f247d 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -281,7 +281,7 @@ private: bool createBackup(const QString &filePath, const QDateTime &time); QString queryRestore(const QString &filePath); - QMenu *modListContextMenu(); + QMenu *modListContextMenu(QWidget *parent); void addModSendToContextMenu(QMenu *menu); void addPluginSendToContextMenu(QMenu *menu); diff --git a/src/organizer_en.ts b/src/organizer_en.ts index 130c927b..ddeb2c28 100644 --- a/src/organizer_en.ts +++ b/src/organizer_en.ts @@ -1555,7 +1555,7 @@ p, li { white-space: pre-wrap; } - + Create Backup @@ -1732,7 +1732,7 @@ p, li { white-space: pre-wrap; } - + Refresh @@ -1927,7 +1927,7 @@ p, li { white-space: pre-wrap; } - + Update @@ -1969,7 +1969,7 @@ Right now this has very limited functionality - + Endorse Mod Organizer @@ -2037,8 +2037,8 @@ Error: %1 - - + + Endorse @@ -2269,8 +2269,8 @@ Error: %1 - - + + failed to rename "%1" to "%2" @@ -2278,7 +2278,7 @@ Error: %1 - + Confirm @@ -2387,7 +2387,7 @@ Error: %1 - + Create Mod... @@ -2432,7 +2432,7 @@ Please enter a name: - + Are you sure? @@ -2460,7 +2460,7 @@ This function will guess the versioning scheme under the assumption that the ins - + Sorry @@ -2685,184 +2685,184 @@ You can also use online editors and converters instead. - + All Mods - + Sync to Mods... - + Move content to Mod... - + Clear Overwrite... - - + + Open in Explorer - + Restore Backup - + Remove Backup... - - + + Change Categories - - + + Primary Category - + Rename Separator... - + Remove Separator... - + Select Color... - + Reset Color - + Change versioning scheme - + Un-ignore update - + Ignore update - - + + Enable selected - - + + Disable selected - + Rename Mod... - + Reinstall Mod - + Remove Mod... - + Un-Endorse - + Won't endorse - + Endorsement state unknown - + Ignore missing data - + Mark as converted/working - + Visit on Nexus - + Visit web page - + Information... - - + + Exception: - - + + Unknown exception - + <All> - + <Multiple> - + %1 more - + Are you sure you want to remove the following %n save(s)?<br><ul>%1</ul><br>Removed saves will be sent to the Recycle Bin. @@ -2870,12 +2870,12 @@ You can also use online editors and converters instead. - + Enable Mods... - + Delete %n save(s) @@ -2883,22 +2883,22 @@ You can also use online editors and converters instead. - + failed to remove %1 - + failed to create %1 - + Restarting MO - + Changing the managed game directory requires restarting MO. Any pending downloads will be paused. @@ -2906,335 +2906,335 @@ Click OK to restart MO now. - + Can't change download directory while downloads are in progress! - + 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 @@ -5649,7 +5649,7 @@ If the folder was still in use, restart MO and try again. - + <Manage...> -- cgit v1.3.1