summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLostDragonist <lost.dragonist@gmail.com>2018-11-01 14:51:14 -0500
committerLostDragonist <lost.dragonist@gmail.com>2018-11-01 16:55:58 -0500
commit3dbfba91e1618e6cdf3ed5ce7ff7955376df03eb (patch)
tree1aefee6df04696afb54093e2dbdce0d235deab0c /src
parent2c53f9d934c27bf3d0414d5bb355dfde52cc4d73 (diff)
Add separators according to context location of context menu
Diffstat (limited to 'src')
-rw-r--r--src/mainwindow.cpp14
-rw-r--r--src/mainwindow.h1
-rw-r--r--src/organizercore.cpp2
3 files changed, 16 insertions, 1 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 5e4bb86f..5b257977 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -204,6 +204,7 @@ MainWindow::MainWindow(QSettings &initSettings
, m_CategoryFactory(CategoryFactory::instance())
, m_ContextItem(nullptr)
, m_ContextAction(nullptr)
+ , m_ContextRow(-1)
, m_CurrentSaveView(nullptr)
, m_OrganizerCore(organizerCore)
, m_PluginContainer(pluginContainer)
@@ -328,6 +329,7 @@ MainWindow::MainWindow(QSettings &initSettings
ui->linkButton->setMenu(linkMenu);
ui->listOptionsBtn->setMenu(modListContextMenu());
+ connect(ui->listOptionsBtn, SIGNAL(pressed()), this, SLOT(on_listOptionsBtn_pressed()));
ui->openFolderMenu->setMenu(openFolderMenu());
@@ -2866,8 +2868,15 @@ void MainWindow::createSeparator_clicked()
{
return;
}
+ int newPriority;
+ if (m_ContextRow >= 0) {
+ newPriority = m_OrganizerCore.currentProfile()->getModPriority(m_ContextRow);
+ }
if (m_OrganizerCore.createMod(name) == nullptr) { return; }
m_OrganizerCore.refreshModList();
+ if (m_ContextRow >= 0) {
+ m_OrganizerCore.modList()->changeModPriority(ModInfo::getIndex(name), newPriority);
+ }
}
void MainWindow::setColor_clicked()
@@ -3023,6 +3032,11 @@ void MainWindow::on_modList_doubleClicked(const QModelIndex &index)
}
}
+void MainWindow::on_listOptionsBtn_pressed()
+{
+ m_ContextRow = -1;
+}
+
void MainWindow::on_espList_doubleClicked(const QModelIndex &index)
{
if (!index.isValid()) {
diff --git a/src/mainwindow.h b/src/mainwindow.h
index 9dee2953..c595575e 100644
--- a/src/mainwindow.h
+++ b/src/mainwindow.h
@@ -590,6 +590,7 @@ private slots: // ui slots
void on_executablesListBox_currentIndexChanged(int index);
void on_modList_customContextMenuRequested(const QPoint &pos);
void on_modList_doubleClicked(const QModelIndex &index);
+ void on_listOptionsBtn_pressed();
void on_espList_doubleClicked(const QModelIndex &index);
void on_profileBox_currentIndexChanged(int index);
void on_savegameList_customContextMenuRequested(const QPoint &pos);
diff --git a/src/organizercore.cpp b/src/organizercore.cpp
index 1fafd4c1..fe720a0c 100644
--- a/src/organizercore.cpp
+++ b/src/organizercore.cpp
@@ -1184,7 +1184,7 @@ QStringList OrganizerCore::modsSortedByProfilePriority() const
{
QStringList res;
for (int i = currentProfile()->getPriorityMinimum();
- i < currentProfile()->getPriorityMinimum() + currentProfile()->numRegularMods();
+ i < currentProfile()->getPriorityMinimum() + (int)currentProfile()->numRegularMods();
++i) {
int modIndex = currentProfile()->modIndexByPriority(i);
res.push_back(ModInfo::getByIndex(modIndex)->name());