Skip to content

Commit

Permalink
Update plugin manager.
Browse files Browse the repository at this point in the history
  • Loading branch information
Holt59 committed Jul 9, 2023
1 parent e623de9 commit bb4f0ba
Show file tree
Hide file tree
Showing 70 changed files with 1,588 additions and 2,398 deletions.
5 changes: 4 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ add_executable(organizer)
set_target_properties(organizer PROPERTIES OUTPUT_NAME "ModOrganizer")
mo2_configure_executable(organizer
WARNINGS OFF
EXTRA_TRANSLATIONS ${MO2_SUPER_PATH}/game_gamebryo/src ${MO2_UIBASE_PATH}/src
TRANSLATIONS ON
PRIVATE_DEPENDS
uibase githubpp bsatk esptk archive usvfs lootcli boost::program_options
Qt::WebEngineWidgets Qt::WebSockets)
Expand Down Expand Up @@ -44,6 +44,7 @@ mo2_add_filter(NAME src/browser GROUPS
mo2_add_filter(NAME src/core GROUPS
categories
archivefiletree
inibakery
installationmanager
nexusinterface
nxmaccessmanager
Expand All @@ -61,6 +62,8 @@ mo2_add_filter(NAME src/extensions GROUPS
translationmanager
extensionmanager
extensionwatcher
pluginmanager
proxyqt
)

mo2_add_filter(NAME src/dialogs GROUPS
Expand Down
3 changes: 2 additions & 1 deletion src/commandline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -827,8 +827,9 @@ std::optional<int> ReloadPluginCommand::runPostOrganizer(OrganizerCore& core)
QDir(qApp->applicationDirPath() + "/" + ToQString(AppConfig::pluginPath()))
.absoluteFilePath(name);

// TODO: reload extension, not plugin
log::debug("reloading plugin from {}", filepath);
core.pluginContainer().reloadPlugin(filepath);
// core.pluginManager().reloadPlugin(filepath);

return {};
}
Expand Down
4 changes: 2 additions & 2 deletions src/createinstancedialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class DirectoryCreator
std::vector<QDir> m_created;
};

CreateInstanceDialog::CreateInstanceDialog(const PluginContainer& pc, Settings* s,
CreateInstanceDialog::CreateInstanceDialog(const PluginManager& pc, Settings* s,
QWidget* parent)
: QDialog(parent), ui(new Ui::CreateInstanceDialog), m_pc(pc), m_settings(s),
m_switching(false), m_singlePage(false)
Expand Down Expand Up @@ -160,7 +160,7 @@ Ui::CreateInstanceDialog* CreateInstanceDialog::getUI()
return ui.get();
}

const PluginContainer& CreateInstanceDialog::pluginContainer()
const PluginManager& CreateInstanceDialog::pluginManager()
{
return m_pc;
}
Expand Down
9 changes: 4 additions & 5 deletions src/createinstancedialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace cid
class Page;
}

class PluginContainer;
class PluginManager;
class Settings;

// this is a wizard for creating a new instance, it is made out of Page objects,
Expand Down Expand Up @@ -80,13 +80,12 @@ class CreateInstanceDialog : public QDialog
Paths paths;
};

CreateInstanceDialog(const PluginContainer& pc, Settings* s,
QWidget* parent = nullptr);
CreateInstanceDialog(const PluginManager& pc, Settings* s, QWidget* parent = nullptr);

~CreateInstanceDialog();

Ui::CreateInstanceDialog* getUI();
const PluginContainer& pluginContainer();
const PluginManager& pluginManager();
Settings* settings();

// disables all the pages except for the given one, used on startup when some
Expand Down Expand Up @@ -175,7 +174,7 @@ class CreateInstanceDialog : public QDialog

private:
std::unique_ptr<Ui::CreateInstanceDialog> ui;
const PluginContainer& m_pc;
const PluginManager& m_pc;
Settings* m_settings;
std::vector<std::unique_ptr<cid::Page>> m_pages;
QString m_originalNext;
Expand Down
4 changes: 2 additions & 2 deletions src/createinstancedialogpages.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "createinstancedialogpages.h"
#include "filesystemutilities.h"
#include "instancemanager.h"
#include "plugincontainer.h"
#include "pluginmanager.h"
#include "settings.h"
#include "settingsdialognexus.h"
#include "shared/appconfig.h"
Expand Down Expand Up @@ -55,7 +55,7 @@ void PlaceholderLabel::setVisible(bool b)
}

Page::Page(CreateInstanceDialog& dlg)
: ui(dlg.getUI()), m_dlg(dlg), m_pc(dlg.pluginContainer()), m_skip(false),
: ui(dlg.getUI()), m_dlg(dlg), m_pc(dlg.pluginManager()), m_skip(false),
m_firstActivation(true)
{}

Expand Down
2 changes: 1 addition & 1 deletion src/createinstancedialogpages.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class Page
protected:
Ui::CreateInstanceDialog* ui;
CreateInstanceDialog& m_dlg;
const PluginContainer& m_pc;
const PluginManager& m_pc;
bool m_skip;
bool m_firstActivation;

Expand Down
6 changes: 3 additions & 3 deletions src/datatab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ using namespace MOBase;
// in mainwindow.cpp
QString UnmanagedModName();

DataTab::DataTab(OrganizerCore& core, PluginContainer& pc, QWidget* parent,
DataTab::DataTab(OrganizerCore& core, PluginManager& pc, QWidget* parent,
Ui::MainWindow* mwui)
: m_core(core), m_pluginContainer(pc),
: m_core(core), m_pluginManager(pc),
m_parent(parent), ui{mwui->tabWidget,
mwui->dataTab,
mwui->dataTabRefresh,
Expand All @@ -25,7 +25,7 @@ DataTab::DataTab(OrganizerCore& core, PluginContainer& pc, QWidget* parent,
mwui->dataTabShowFromArchives},
m_needUpdate(true)
{
m_filetree.reset(new FileTree(core, m_pluginContainer, ui.tree));
m_filetree.reset(new FileTree(core, m_pluginManager, ui.tree));
m_filter.setUseSourceSort(true);
m_filter.setFilterColumn(FileTreeModel::FileName);
m_filter.setEdit(mwui->dataTabFilter);
Expand Down
7 changes: 3 additions & 4 deletions src/datatab.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class MainWindow;
}
class OrganizerCore;
class Settings;
class PluginContainer;
class PluginManager;
class FileTree;

namespace MOShared
Expand All @@ -27,8 +27,7 @@ class DataTab : public QObject
Q_OBJECT;

public:
DataTab(OrganizerCore& core, PluginContainer& pc, QWidget* parent,
Ui::MainWindow* ui);
DataTab(OrganizerCore& core, PluginManager& pc, QWidget* parent, Ui::MainWindow* ui);

void saveState(Settings& s) const;
void restoreState(const Settings& s);
Expand Down Expand Up @@ -57,7 +56,7 @@ class DataTab : public QObject
};

OrganizerCore& m_core;
PluginContainer& m_pluginContainer;
PluginManager& m_pluginManager;
QWidget* m_parent;
DataTabUi ui;
std::unique_ptr<FileTree> m_filetree;
Expand Down
34 changes: 0 additions & 34 deletions src/disableproxyplugindialog.cpp

This file was deleted.

44 changes: 0 additions & 44 deletions src/disableproxyplugindialog.h

This file was deleted.

Loading

0 comments on commit bb4f0ba

Please sign in to comment.