summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAl12rs <gabriel.cortesi@outlook.com>2018-04-17 16:13:43 +0200
committerAl12rs <gabriel.cortesi@outlook.com>2018-04-17 21:51:01 +0200
commitb64fd1ed4d68fc64ac061b0f126af54cf7147462 (patch)
treec1391be452c0db2e294afed2f585b931b4c162e8
parentb1329c18cde91c9e245f59475ae3b32c2c663a8c (diff)
Enter shourcut will now open the mod containing the selected plugin if the ESPList has the focus.
Added F5 shourcut to refresh the profile. Removed a redundant variable I saw by chance.
-rw-r--r--src/mainwindow.cpp50
-rw-r--r--src/mainwindow.h1
-rw-r--r--src/modlist.cpp1
3 files changed, 41 insertions, 11 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 0d9ca4a9..2d6ccc94 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -372,6 +372,9 @@ MainWindow::MainWindow(QSettings &initSettings
new QShortcut(QKeySequence(Qt::Key_Enter), this, SLOT(openExplorer_activated()));
new QShortcut(QKeySequence(Qt::Key_Return), this, SLOT(openExplorer_activated()));
+
+ new QShortcut(QKeySequence::Refresh, this, SLOT(refreshProfile_activated()));
+
m_UpdateProblemsTimer.setSingleShot(true);
connect(&m_UpdateProblemsTimer, SIGNAL(timeout()), this, SLOT(updateProblemsButton()));
@@ -2621,20 +2624,47 @@ void MainWindow::openExplorer_clicked()
void MainWindow::openExplorer_activated()
{
- QItemSelectionModel *selection = ui->modList->selectionModel();
- if (selection->hasSelection() && selection->selectedRows().count() == 1 && ui->modList->hasFocus()) {
-
- QModelIndex idx = selection->currentIndex();
- ModInfo::Ptr modInfo = ModInfo::getByIndex(idx.data(Qt::UserRole + 1).toInt());
- std::vector<ModInfo::EFlag> flags = modInfo->getFlags();
-
- if (modInfo->isRegular() || (std::find(flags.begin(), flags.end(), ModInfo::FLAG_OVERWRITE) != flags.end())) {
- ::ShellExecuteW(nullptr, L"explore", ToWString(modInfo->absolutePath()).c_str(), nullptr, nullptr, SW_SHOWNORMAL);
+ if (ui->modList->hasFocus()) {
+ QItemSelectionModel *selection = ui->modList->selectionModel();
+ if (selection->hasSelection() && selection->selectedRows().count() == 1 ) {
+
+ QModelIndex idx = selection->currentIndex();
+ ModInfo::Ptr modInfo = ModInfo::getByIndex(idx.data(Qt::UserRole + 1).toInt());
+ std::vector<ModInfo::EFlag> flags = modInfo->getFlags();
+
+ if (modInfo->isRegular() || (std::find(flags.begin(), flags.end(), ModInfo::FLAG_OVERWRITE) != flags.end())) {
+ ::ShellExecuteW(nullptr, L"explore", ToWString(modInfo->absolutePath()).c_str(), nullptr, nullptr, SW_SHOWNORMAL);
+ }
+
}
+ }
+
+ if (ui->espList->hasFocus()) {
+ QItemSelectionModel *selection = ui->espList->selectionModel();
+
+ if (selection->hasSelection() && selection->selectedRows().count() == 1) {
+
+ QModelIndex idx = selection->currentIndex();
+ QString fileName = idx.data().toString();
+
+
+ ModInfo::Ptr modInfo = ModInfo::getByIndex(ModInfo::getIndex(m_OrganizerCore.pluginList()->origin(fileName)));
+ std::vector<ModInfo::EFlag> flags = modInfo->getFlags();
+
+ if (modInfo->isRegular() || (std::find(flags.begin(), flags.end(), ModInfo::FLAG_OVERWRITE) != flags.end())) {
+ ::ShellExecuteW(nullptr, L"explore", ToWString(modInfo->absolutePath()).c_str(), nullptr, nullptr, SW_SHOWNORMAL);
+ }
+
+ }
}
}
+void MainWindow::refreshProfile_activated()
+{
+ m_OrganizerCore.profileRefresh();
+}
+
void MainWindow::information_clicked()
{
try {
@@ -4557,7 +4587,7 @@ void MainWindow::on_espList_customContextMenuRequested(const QPoint &pos)
menu.addAction(tr("Unlock load order"), this, SLOT(unlockESPIndex()));
}
if (hasUnlocked) {
- menu.addAction(tr("Lock load order"), this, SLOT(lockESPIndex()));
+ menu.addAction(tr("Lock load order"), this, SLOT(f()));
}
try {
diff --git a/src/mainwindow.h b/src/mainwindow.h
index 31c52bc0..3d093131 100644
--- a/src/mainwindow.h
+++ b/src/mainwindow.h
@@ -396,6 +396,7 @@ private slots:
//modlist shortcuts
void openExplorer_activated();
+ void refreshProfile_activated();
// modlist context menu
void installMod_clicked();
diff --git a/src/modlist.cpp b/src/modlist.cpp
index c8fd4b3e..3f9a732a 100644
--- a/src/modlist.cpp
+++ b/src/modlist.cpp
@@ -724,7 +724,6 @@ void ModList::highlightMods(const QItemSelection &selected, const MOShared::Dire
const MOShared::FileEntry::Ptr fileEntry = directoryEntry.findFile(modName.toStdWString());
if (fileEntry.get() != nullptr) {
- QString fileName;
bool archive = false;
std::vector<std::pair<int, std::wstring>> origins;
{