mirror of
https://github.com/ModOrganizer2/modorganizer.git
synced 2026-07-27 13:58:24 -07:00
Compare commits
7
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ad7d740a0b | ||
|
|
1c02ae101b | ||
|
|
280a32597f | ||
|
|
749ceff04f | ||
|
|
448a37e6bc | ||
|
|
d4a066dbd9 | ||
|
|
a803baa900 |
@@ -875,7 +875,8 @@ void DownloadManager::queryInfo(int index)
|
||||
std::numeric_limits<int>::max(), 1, &ok);
|
||||
// careful now: while the dialog was displayed, events were processed.
|
||||
// the download list might have changed and our info-ptr invalidated.
|
||||
m_ActiveDownloads[index]->m_FileInfo->modID = modId;
|
||||
if (ok)
|
||||
m_ActiveDownloads[index]->m_FileInfo->modID = modId;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
+20
-3
@@ -377,13 +377,30 @@ MOBase::IPluginGame *determineCurrentGame(QString const &moPath, QSettings &sett
|
||||
|
||||
if (!gamePath.isEmpty()) {
|
||||
QDir gameDir(gamePath);
|
||||
QList<IPluginGame *> possibleGames;
|
||||
for (IPluginGame * const game : plugins.plugins<IPluginGame>()) {
|
||||
if (game->looksValid(gameDir)) {
|
||||
return selectGame(settings, gameDir, game);
|
||||
possibleGames.append(game);
|
||||
//return selectGame(settings, gameDir, game);
|
||||
}
|
||||
}
|
||||
reportError(QObject::tr("No game identified in \"%1\". The directory is required to contain "
|
||||
"the game binary.").arg(gamePath));
|
||||
if (possibleGames.count() > 1) {
|
||||
SelectionDialog browseSelection(QObject::tr("Please select the game to manage"), nullptr, QSize(32, 32));
|
||||
for (IPluginGame *game : possibleGames) {
|
||||
QString path = game->gameDirectory().absolutePath();
|
||||
browseSelection.addChoice(game->gameIcon(), game->gameName(), path, QVariant::fromValue(game));
|
||||
}
|
||||
if (browseSelection.exec() == QDialog::Accepted) {
|
||||
return selectGame(settings, gameDir, browseSelection.getChoiceData().value<IPluginGame *>());
|
||||
} else {
|
||||
reportError(QObject::tr("Canceled finding game in \"%1\".").arg(gamePath));
|
||||
}
|
||||
} else if(possibleGames.count() == 1) {
|
||||
return selectGame(settings, gameDir, possibleGames[0]);
|
||||
} else {
|
||||
reportError(QObject::tr("No game identified in \"%1\". The directory is required to contain "
|
||||
"the game binary.").arg(gamePath));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+12
-11
@@ -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()));
|
||||
@@ -4404,7 +4404,7 @@ void MainWindow::addModSendToContextMenu(QMenu *menu)
|
||||
if (m_ModListSortProxy->sortColumn() != ModList::COL_PRIORITY)
|
||||
return;
|
||||
|
||||
QMenu *sub_menu = new QMenu(this);
|
||||
QMenu *sub_menu = new QMenu(menu);
|
||||
sub_menu->setTitle(tr("Send to"));
|
||||
sub_menu->addAction(tr("Top"), this, SLOT(sendSelectedModsToTop_clicked()));
|
||||
sub_menu->addAction(tr("Bottom"), this, SLOT(sendSelectedModsToBottom_clicked()));
|
||||
@@ -4439,12 +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);
|
||||
QMenu *allMods = modListContextMenu(menu);
|
||||
allMods->setTitle(tr("All Mods"));
|
||||
menu->addMenu(allMods);
|
||||
menu->addSeparator();
|
||||
@@ -4463,11 +4463,11 @@ void MainWindow::on_modList_customContextMenuRequested(const QPoint &pos)
|
||||
menu->addAction(tr("Remove Backup..."), this, SLOT(removeMod_clicked()));
|
||||
} else if (std::find(flags.begin(), flags.end(), ModInfo::FLAG_SEPARATOR) != flags.end()){
|
||||
menu->addSeparator();
|
||||
QMenu *addRemoveCategoriesMenu = new QMenu(tr("Change Categories"));
|
||||
QMenu *addRemoveCategoriesMenu = new QMenu(tr("Change Categories"), menu);
|
||||
populateMenuCategories(addRemoveCategoriesMenu, 0);
|
||||
connect(addRemoveCategoriesMenu, SIGNAL(aboutToHide()), this, SLOT(addRemoveCategories_MenuHandler()));
|
||||
addMenuAsPushButton(menu, addRemoveCategoriesMenu);
|
||||
QMenu *primaryCategoryMenu = new QMenu(tr("Primary Category"));
|
||||
QMenu *primaryCategoryMenu = new QMenu(tr("Primary Category"), menu);
|
||||
connect(primaryCategoryMenu, SIGNAL(aboutToShow()), this, SLOT(addPrimaryCategoryCandidates()));
|
||||
addMenuAsPushButton(menu, primaryCategoryMenu);
|
||||
menu->addSeparator();
|
||||
@@ -4482,12 +4482,12 @@ void MainWindow::on_modList_customContextMenuRequested(const QPoint &pos)
|
||||
} else if (std::find(flags.begin(), flags.end(), ModInfo::FLAG_FOREIGN) != flags.end()) {
|
||||
addModSendToContextMenu(menu);
|
||||
} else {
|
||||
QMenu *addRemoveCategoriesMenu = new QMenu(tr("Change Categories"));
|
||||
QMenu *addRemoveCategoriesMenu = new QMenu(tr("Change Categories"), menu);
|
||||
populateMenuCategories(addRemoveCategoriesMenu, 0);
|
||||
connect(addRemoveCategoriesMenu, SIGNAL(aboutToHide()), this, SLOT(addRemoveCategories_MenuHandler()));
|
||||
addMenuAsPushButton(menu, addRemoveCategoriesMenu);
|
||||
|
||||
QMenu *primaryCategoryMenu = new QMenu(tr("Primary Category"));
|
||||
QMenu *primaryCategoryMenu = new QMenu(tr("Primary Category"), menu);
|
||||
connect(primaryCategoryMenu, SIGNAL(aboutToShow()), this, SLOT(addPrimaryCategoryCandidates()));
|
||||
addMenuAsPushButton(menu, primaryCategoryMenu);
|
||||
|
||||
@@ -4568,6 +4568,7 @@ void MainWindow::on_modList_customContextMenuRequested(const QPoint &pos)
|
||||
}
|
||||
|
||||
menu->exec(modList->mapToGlobal(pos));
|
||||
delete menu;
|
||||
} catch (const std::exception &e) {
|
||||
reportError(tr("Exception: ").arg(e.what()));
|
||||
} catch (...) {
|
||||
@@ -4920,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());
|
||||
}
|
||||
|
||||
+1
-1
@@ -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);
|
||||
|
||||
|
||||
+179
-200
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -4,7 +4,7 @@
|
||||
// Otherwise, if letters are used in VER_FILEVERSION_STR, uses the full MOBase::VersionInfo parser
|
||||
// Otherwise, uses the numbers from VER_FILEVERSION and sets the release type as pre-alpha
|
||||
#define VER_FILEVERSION 2,2,0
|
||||
#define VER_FILEVERSION_STR "2.2.0beta1\0"
|
||||
#define VER_FILEVERSION_STR "2.2.0beta2\0"
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION VER_FILEVERSION
|
||||
|
||||
Reference in New Issue
Block a user