From d28ddcfbb52394a2a7ac793ad376ea8fd7b514fe Mon Sep 17 00:00:00 2001 From: Al Date: Mon, 24 Dec 2018 17:29:16 +0100 Subject: Added Active Plugins and Active Mods counters --- src/mainwindow.cpp | 12 ++++++++++++ src/mainwindow.h | 1 + src/mainwindow.ui | 22 +++++++++++++++++++++- src/organizercore.cpp | 4 ++++ src/pluginlist.cpp | 1 + 5 files changed, 39 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index bb136364..74374c2b 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -458,6 +458,12 @@ MainWindow::MainWindow(QSettings &initSettings // set the name of the widget to the name of the action to allow styling ui->toolBar->widgetForAction(action)->setObjectName(action->objectName()); } + ui->activePluginsCounter->display(m_OrganizerCore.pluginList()->enabledCount()); + ui->activeModsCounter->display((int)m_OrganizerCore.currentProfile()->getActiveMods().size()); + qDebug("Plugin enabledCount: %d", m_OrganizerCore.pluginList()->enabledCount()); + qDebug("Mods enabledCount: %d", (int)m_OrganizerCore.currentProfile()->getActiveMods().size()); + + } @@ -2186,6 +2192,11 @@ void MainWindow::directory_refreshed() statusBar()->hide(); } +void MainWindow::esplist_changed() +{ + ui->activePluginsCounter->display(m_OrganizerCore.pluginList()->enabledCount()); +} + void MainWindow::modorder_changed() { for (unsigned int i = 0; i < m_OrganizerCore.currentProfile()->numMods(); ++i) { @@ -2443,6 +2454,7 @@ void MainWindow::restoreBackup_clicked() void MainWindow::modlistChanged(const QModelIndex&, int) { m_OrganizerCore.currentProfile()->writeModlist(); + ui->activeModsCounter->display((int)m_OrganizerCore.currentProfile()->getActiveMods().size()); } void MainWindow::modlistSelectionChanged(const QModelIndex ¤t, const QModelIndex&) diff --git a/src/mainwindow.h b/src/mainwindow.h index f66ea5e7..61113b8c 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -162,6 +162,7 @@ public slots: void displayColumnSelection(const QPoint &pos); void modorder_changed(); + void esplist_changed(); void refresher_progress(int percent); void directory_refreshed(); diff --git a/src/mainwindow.ui b/src/mainwindow.ui index 7e94000d..067cd4d0 100644 --- a/src/mainwindow.ui +++ b/src/mainwindow.ui @@ -179,7 +179,7 @@ 2 - + @@ -224,6 +224,16 @@ p, li { white-space: pre-wrap; } + + + + Active: + + + + + + @@ -853,6 +863,16 @@ p, li { white-space: pre-wrap; } + + + + Active: + + + + + + diff --git a/src/organizercore.cpp b/src/organizercore.cpp index d52ef40b..1f4e3434 100644 --- a/src/organizercore.cpp +++ b/src/organizercore.cpp @@ -560,6 +560,10 @@ void OrganizerCore::setUserInterface(IUserInterface *userInterface, SLOT(fileMoved(QString, QString, QString))); connect(&m_ModList, SIGNAL(modorder_changed()), widget, SLOT(modorder_changed())); + connect(&m_PluginList, SIGNAL(writePluginsList()), widget, + SLOT(esplist_changed())); + connect(&m_PluginList, SIGNAL(esplist_changed()), widget, + SLOT(esplist_changed())); connect(&m_DownloadManager, SIGNAL(showMessage(QString)), widget, SLOT(showMessage(QString))); } diff --git a/src/pluginlist.cpp b/src/pluginlist.cpp index b0f59e1e..fcb05979 100644 --- a/src/pluginlist.cpp +++ b/src/pluginlist.cpp @@ -846,6 +846,7 @@ void PluginList::generatePluginIndexes() m_ESPs[i].m_Index = QString("%1").arg(l - numESLs - numSkipped, 2, 16, QChar('0')).toUpper(); } } + emit esplist_changed(); } -- cgit v1.3.1