diff options
| -rw-r--r-- | src/mainwindow.cpp | 38 | ||||
| -rw-r--r-- | src/mainwindow.h | 1 | ||||
| -rw-r--r-- | src/mainwindow.ui | 115 | ||||
| -rw-r--r-- | src/pluginlist.cpp | 7 | ||||
| -rw-r--r-- | src/pluginlist.h | 6 |
5 files changed, 88 insertions, 79 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 5999608c..c4e888ac 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -2872,6 +2872,44 @@ void MainWindow::on_modList_doubleClicked(const QModelIndex &index) }
}
+void MainWindow::on_espList_doubleClicked(const QModelIndex &index)
+{
+ if (!index.isValid()) {
+ return;
+ }
+
+ if (m_OrganizerCore.pluginList()->timeElapsedSinceLastChecked() <= QApplication::doubleClickInterval()) {
+ // don't interpret double click if we only just checked a plugin
+ return;
+ }
+
+ QModelIndex sourceIdx = mapToModel(m_OrganizerCore.pluginList(), index);
+ if (!sourceIdx.isValid()) {
+ return;
+ }
+ try {
+
+ QItemSelectionModel *selection = ui->espList->selectionModel();
+
+ if (selection->hasSelection() && selection->selectedRows().count() == 1) {
+
+ QModelIndex idx = selection->currentIndex();
+ QString fileName = idx.data().toString();
+
+
+ displayModInformation(ModInfo::getIndex(m_OrganizerCore.pluginList()->origin(fileName)));
+ // workaround to cancel the editor that might have opened because of
+ // selection-click
+ ui->espList->closePersistentEditor(index);
+
+
+ }
+ }
+ catch (const std::exception &e) {
+ reportError(e.what());
+ }
+}
+
bool MainWindow::populateMenuCategories(QMenu *menu, int targetID)
{
ModInfo::Ptr modInfo = ModInfo::getByIndex(m_ContextRow);
diff --git a/src/mainwindow.h b/src/mainwindow.h index 737a1534..773bf298 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -574,6 +574,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_espList_doubleClicked(const QModelIndex &index);
void on_profileBox_currentIndexChanged(int index);
void on_savegameList_customContextMenuRequested(const QPoint &pos);
void on_startButton_clicked();
diff --git a/src/mainwindow.ui b/src/mainwindow.ui index e0aa6f36..d8873d4f 100644 --- a/src/mainwindow.ui +++ b/src/mainwindow.ui @@ -96,9 +96,9 @@ </item>
<item>
<widget class="QPushButton" name="clickBlankButton">
- <property name="enabled">
- <bool>false</bool>
- </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Maximum">
<horstretch>0</horstretch>
@@ -194,7 +194,7 @@ </widget>
</item>
<item>
- <widget class="QComboBox" name="profileBox">
+ <widget class="QComboBox" name="profileBox">
<property name="toolTip">
<string>Pick a module collection</string>
</property>
@@ -248,7 +248,7 @@ p, li { white-space: pre-wrap; } <height>16</height>
</size>
</property>
- </widget>
+ </widget>
</item>
<item>
<widget class="QPushButton" name="openFolderMenu">
@@ -265,16 +265,6 @@ p, li { white-space: pre-wrap; } </widget>
</item>
<item>
-
-
-
-
-
-
-
-
-
-
<widget class="QPushButton" name="restoreModsButton">
<property name="toolTip">
<string>Restore Backup...</string>
@@ -509,7 +499,7 @@ p, li { white-space: pre-wrap; } </property>
</widget>
</item>
- <item>
+ <item>
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
@@ -521,7 +511,7 @@ p, li { white-space: pre-wrap; } </size>
</property>
</spacer>
- </item>
+ </item>
<item alignment="Qt::AlignLeft">
<widget class="QPushButton" name="clearFiltersButton">
<property name="sizePolicy">
@@ -536,12 +526,12 @@ p, li { white-space: pre-wrap; } <height>22</height>
</size>
</property>
- <property name="baseSize">
+ <property name="baseSize">
<size>
<width>95</width>
<height>0</height>
</size>
- </property>
+ </property>
<property name="visible">
<bool>false</bool>
</property>
@@ -567,7 +557,7 @@ p, li { white-space: pre-wrap; } </widget>
</item>
<item>
- <spacer name="horizontalSpacer_4">
+ <spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
@@ -579,14 +569,14 @@ p, li { white-space: pre-wrap; } </property>
</spacer>
</item>
- <item>
- <widget class="QComboBox" name="groupCombo">
- <property name="baseSize">
+ <item>
+ <widget class="QComboBox" name="groupCombo">
+ <property name="baseSize">
<size>
<width>220</width>
<height>0</height>
</size>
- </property>
+ </property>
<property name="focusPolicy">
<enum>Qt::ClickFocus</enum>
</property>
@@ -608,13 +598,13 @@ p, li { white-space: pre-wrap; } </widget>
</item>
<item>
- <widget class="MOBase::LineEditClear" name="modFilterEdit">
- <property name="baseSize">
+ <widget class="MOBase::LineEditClear" name="modFilterEdit">
+ <property name="baseSize">
<size>
<width>220</width>
<height>0</height>
</size>
- </property>
+ </property>
<property name="placeholderText">
<string>Namefilter</string>
</property>
@@ -835,12 +825,12 @@ p, li { white-space: pre-wrap; } <layout class="QHBoxLayout" name="horizontalLayout_7">
<item>
<widget class="QPushButton" name="bossButton">
- <property name="visible">
- <bool>true</bool>
- </property>
+ <property name="visible">
+ <bool>true</bool>
+ </property>
<property name="text">
<string>Sort</string>
- </property>
+ </property>
<property name="icon">
<iconset resource="resources.qrc">
<normaloff>:/MO/gui/sort</normaloff>:/MO/gui/sort</iconset>
@@ -954,6 +944,9 @@ p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">This list contains the esps, esms, and esls contained in the active mods. These require their own load order. Use drag&amp;drop to modify this load order. Please note that MO will only save the load order for mods that are active/checked.<br />There is a great tool named &quot;BOSS&quot; to automatically sort these files.</span></p></body></html></string>
</property>
+ <property name="editTriggers">
+ <set>QAbstractItemView::EditKeyPressed|QAbstractItemView::SelectedClicked</set>
+ </property>
<property name="dragEnabled">
<bool>true</bool>
</property>
@@ -987,6 +980,9 @@ p, li { white-space: pre-wrap; } <property name="sortingEnabled">
<bool>true</bool>
</property>
+ <property name="expandsOnDoubleClick">
+ <bool>false</bool>
+ </property>
<attribute name="headerStretchLastSection">
<bool>false</bool>
</attribute>
@@ -1009,15 +1005,12 @@ p, li { white-space: pre-wrap; } </layout>
</widget>
<widget class="QWidget" name="bsaTab">
-
-
-
+ <property name="visible">
+ <bool>false</bool>
+ </property>
<attribute name="title">
<string>Archives</string>
</attribute>
- <property name="visible">
- <bool>true</bool>
- </property>
<layout class="QVBoxLayout" name="verticalLayout_9">
<property name="leftMargin">
<number>6</number>
@@ -1032,17 +1025,7 @@ p, li { white-space: pre-wrap; } <number>6</number>
</property>
<item>
- <layout class="QHBoxLayout" name="horizontalLayout_9" stretch="0,1">
- <!--<item>-->
- <!--<widget class="QCheckBox" name="manageArchivesBox">-->
- <!--<property name="text">-->
- <!--<string/>-->
- <!--</property>-->
- <!--<property name="checked">-->
- <!--<bool>true</bool>-->
- <!--</property>-->
- <!--</widget>-->
- <!--</item>-->
+ <layout class="QHBoxLayout" name="horizontalLayout_9" stretch="0">
<item>
<widget class="QLabel" name="managedArchiveLabel">
<property name="toolTip">
@@ -1072,50 +1055,24 @@ p, li { white-space: pre-wrap; } BSAs checked here are loaded in such a way that your installation order is obeyed properly.</string>
</property>
- <property name="editTriggers">
- <set>QAbstractItemView::NoEditTriggers</set>
- </property>
<property name="showDropIndicator" stdset="0">
<bool>false</bool>
</property>
- <property name="dragEnabled">
+ <property name="dragEnabled" stdset="0">
<bool>false</bool>
</property>
- <property name="dragDropOverwriteMode">
+ <property name="dragDropOverwriteMode" stdset="0">
<bool>false</bool>
</property>
- <property name="dragDropMode">
- <enum>QAbstractItemView::NoDragDrop</enum>
- </property>
- <property name="defaultDropAction">
- <enum>Qt::IgnoreAction</enum>
- </property>
- <property name="selectionMode">
- <enum>QAbstractItemView::SingleSelection</enum>
- </property>
- <property name="selectionBehavior">
- <enum>QAbstractItemView::SelectRows</enum>
- </property>
- <property name="indentation">
+ <property name="indentation" stdset="0">
<number>20</number>
</property>
- <property name="itemsExpandable">
+ <property name="itemsExpandable" stdset="0">
<bool>true</bool>
</property>
- <property name="columnCount">
+ <property name="columnCount" stdset="0">
<number>1</number>
</property>
- <attribute name="headerVisible">
- <bool>false</bool>
- </attribute>
- <attribute name="headerDefaultSectionSize">
- <number>200</number>
- </attribute>
- <column>
- <property name="text">
- <string>File</string>
- </property>
- </column>
</widget>
</item>
</layout>
diff --git a/src/pluginlist.cpp b/src/pluginlist.cpp index 9153df72..c6cea045 100644 --- a/src/pluginlist.cpp +++ b/src/pluginlist.cpp @@ -77,6 +77,7 @@ PluginList::PluginList(QObject *parent) , m_FontMetrics(QFont())
{
connect(this, SIGNAL(writePluginsList()), this, SLOT(generatePluginIndexes()));
+ m_LastCheck.start();
}
PluginList::~PluginList()
@@ -583,6 +584,11 @@ void PluginList::disconnectSlots() { m_PluginStateChanged.disconnect_all_slots();
}
+int PluginList::timeElapsedSinceLastChecked() const
+{
+ return m_LastCheck.elapsed();
+}
+
QStringList PluginList::pluginNames() const
{
QStringList result;
@@ -954,6 +960,7 @@ bool PluginList::setData(const QModelIndex &modIndex, const QVariant &value, int if (role == Qt::CheckStateRole) {
m_ESPs[modIndex.row()].m_Enabled =
value.toInt() == Qt::Checked || m_ESPs[modIndex.row()].m_ForceEnabled;
+ m_LastCheck.restart();
emit dataChanged(modIndex, modIndex);
refreshLoadOrder();
diff --git a/src/pluginlist.h b/src/pluginlist.h index 583c7272..b8e35c32 100644 --- a/src/pluginlist.h +++ b/src/pluginlist.h @@ -28,6 +28,7 @@ namespace MOBase { class IPluginGame; } #include <QString>
#include <QListWidget>
#include <QTimer>
+#include <QTime>
#include <QTemporaryFile>
#pragma warning(push)
@@ -192,6 +193,8 @@ public: */
int enabledCount() const;
+ int timeElapsedSinceLastChecked() const;
+
QString getName(int index) const { return m_ESPs.at(index).m_Name; }
int getPriority(int index) const { return m_ESPs.at(index).m_Priority; }
QString getIndexPriority(int index) const;
@@ -273,6 +276,7 @@ signals: void writePluginsList();
+
private:
struct ESPInfo {
@@ -347,6 +351,8 @@ private: QTemporaryFile m_TempFile;
+ QTime m_LastCheck;
+
const MOBase::IPluginGame *m_GamePlugin;
};
|
