Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Extensions #1705

Closed
wants to merge 13 commits into from
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ endif()

project(organizer)
add_subdirectory(src)
add_subdirectory(themes)

install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/dump_running_process.bat DESTINATION bin)
15 changes: 12 additions & 3 deletions 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 All @@ -16,7 +16,6 @@ install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/dlls.manifest.qt5"
RENAME dlls.manifest)

install(DIRECTORY
"${CMAKE_CURRENT_SOURCE_DIR}/stylesheets"
"${CMAKE_CURRENT_SOURCE_DIR}/tutorials"
DESTINATION bin)

Expand Down Expand Up @@ -45,18 +44,27 @@ mo2_add_filter(NAME src/browser GROUPS
mo2_add_filter(NAME src/core GROUPS
categories
archivefiletree
inibakery
installationmanager
nexusinterface
nxmaccessmanager
organizercore
plugincontainer
apiuseraccount
processrunner
qdirfiletree
virtualfiletree
uilocker
)

mo2_add_filter(NAME src/extensions GROUPS
thememanager
translationmanager
extensionmanager
extensionwatcher
pluginmanager
proxyqt
)

mo2_add_filter(NAME src/dialogs GROUPS
aboutdialog
activatemodsdialog
Expand Down Expand Up @@ -192,6 +200,7 @@ mo2_add_filter(NAME src/profiles GROUPS
mo2_add_filter(NAME src/proxies GROUPS
downloadmanagerproxy
modlistproxy
extensionlistproxy
organizerproxy
pluginlistproxy
proxyutils
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
10 changes: 5 additions & 5 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 @@ -132,13 +132,13 @@ CreateInstanceDialog::CreateInstanceDialog(const PluginContainer& pc, Settings*

addShortcutAction(QKeySequence::Find, Actions::Find);

addShortcut(Qt::ALT + Qt::Key_Left, [&] {
addShortcut(Qt::ALT | Qt::Key_Left, [&] {
back();
});
addShortcut(Qt::ALT + Qt::Key_Right, [&] {
addShortcut(Qt::ALT | Qt::Key_Right, [&] {
next(false);
});
addShortcut(Qt::CTRL + Qt::Key_Return, [&] {
addShortcut(Qt::CTRL | Qt::Key_Return, [&] {
next();
});

Expand All @@ -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