Skip to content

Commit b82aff8

Browse files
committed
Update
1 parent 424bd1a commit b82aff8

25 files changed

+36
-1209
lines changed

.gitmodules

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,7 @@
3333
[submodule "jetbrains-docking-system"]
3434
path = libs/jetbrains-docking-system
3535
url = ../../stdware/jetbrains-docking-system.git
36+
37+
[submodule "libs/idecore"]
38+
path = libs/idecore
39+
url = ../../diffscope/idecore.git

libs/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ set(OPENDSPX_INSTALL off)
55
set(JBDS_INSTALL off)
66
set(SUBSTATE_INSTALL off)
77
set(TALCS_INSTALL off)
8+
set(IDECORE_INSTALL off)
89

910
add_subdirectory(qtmediate)
1011

@@ -20,6 +21,8 @@ add_subdirectory(substate)
2021

2122
add_subdirectory(talcs)
2223

24+
add_subdirectory(idecore)
25+
2326
set(CK_CMAKE_MODULES_DIR ${CMAKE_CURRENT_LIST_DIR}/choruskit/cmake PARENT_SCOPE)
2427

2528
set(CK_CKAEC_EXECUTABLE $<TARGET_FILE:ckaec> PARENT_SCOPE)

libs/choruskit

libs/idecore

Submodule idecore added at 069a1cf

libs/qtmediate

libs/talcs

src/app/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ qm_configure_target(${PROJECT_NAME}
88
QT_LINKS
99
Core Widgets
1010
LINKS_PRIVATE
11-
ChorusKit::Loader ChorusKit::AppCore
11+
ChorusKit::Loader idecore::Framework
1212
INCLUDE_PRIVATE
1313
${CK_BUILD_INCLUDE_DIR}
1414
)

src/app/main.cpp

Lines changed: 3 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
#include <QtCore/QProcess>
33
#include <QtNetwork/QNetworkProxyFactory>
44
#include <QtWidgets/QApplication>
5-
#include <QtWidgets/QToolTip>
65

76
#include <extensionsystem/pluginmanager.h>
87

@@ -21,6 +20,8 @@
2120

2221
#include <choruskit_config.h>
2322

23+
#include <idecoreFramework/initroutine.h>
24+
2425
class MyLoaderConfiguration : public Loader::LoaderConfiguration {
2526
public:
2627
MyLoaderConfiguration() {
@@ -55,69 +56,7 @@ class MyLoaderConfiguration : public Loader::LoaderConfiguration {
5556
QNetworkProxyFactory::setUseSystemConfiguration(true);
5657

5758
// Restore language and themes
58-
{
59-
auto settings = ExtensionSystem::PluginManager::settings();
60-
settings->beginGroup(QStringLiteral("Preferences"));
61-
auto value = settings->value(QStringLiteral("Translation"));
62-
if (!value.isNull()) {
63-
qIDec->setLocale(value.toString());
64-
}
65-
66-
value = settings->value(QStringLiteral("Theme"));
67-
if (!value.isNull()) {
68-
qIDec->setTheme(value.toString());
69-
}
70-
71-
value = settings->value(QStringLiteral("Zoom"));
72-
if (!value.isNull()) {
73-
qIDec->setZoomRatio(value.toString().toDouble() / 100);
74-
}
75-
76-
value = settings->value(QStringLiteral("Font"));
77-
{
78-
// Default font
79-
QFont font(QMAppExtension::systemDefaultFont());
80-
font.setPixelSize(12);
81-
82-
// Get font
83-
if (!value.isNull()) {
84-
font.fromString(value.toString());
85-
}
86-
87-
// Normalize font
88-
if (font.pixelSize() <= 0) {
89-
font.setPixelSize(12);
90-
}
91-
qIDec->setFontRatio(font.pixelSize() / 12.0);
92-
93-
// The application font is determined at startup and remains unchanged, using the
94-
// `userFont` property to record the changes made by the user during the current
95-
// application life.
96-
qApp->setProperty("userFont", font);
97-
qApp->setProperty("userFontInitial", font);
98-
99-
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
100-
font.setPointSize(font.pixelSize() * 0.75 * qIDec->zoomRatio());
101-
#else
102-
font.setPixelSize(font.pixelSize() * qIDec->zoomRatio());
103-
#endif
104-
// Make the default font update with system dpi
105-
QGuiApplication::setFont(font);
106-
QToolTip::setFont(font);
107-
}
108-
109-
value = settings->value(QStringLiteral("UseSystemFont"));
110-
{
111-
// Default value
112-
qApp->setProperty("useSystemFont", true);
113-
// Get value
114-
if (value.type() == QVariant::String) {
115-
qApp->setProperty("useSystemFont",
116-
value.toString().toLower() == QStringLiteral("true"));
117-
}
118-
}
119-
settings->endGroup();
120-
}
59+
Core::InitRoutine::initializeAppearance(ExtensionSystem::PluginManager::settings());
12160

12261
// Set ILoader settings path
12362
Core::ILoader &loader = *Core::ILoader::instance();
@@ -127,9 +66,6 @@ class MyLoaderConfiguration : public Loader::LoaderConfiguration {
12766
loader.setSettingsPath(QSettings::SystemScope,
12867
QStringLiteral("%1/%2.settings.json")
12968
.arg(systemSettingsPath, QStringLiteral(APP_NAME)));
130-
131-
// Pass splash screen to core plugin
132-
Core::ILoaderPrivate::quickData(0) = splash;
13369
}
13470

13571
void afterLoadPlugins() override {

src/plugins/audioplugin/internal/audioplugin.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@
99

1010
#include <CoreApi/iloader.h>
1111

12+
#include <idecoreFramework/initroutine.h>
13+
1214
#include <coreplugin/icore.h>
1315
#include <coreplugin/iprojectwindow.h>
14-
#include <coreplugin/initroutine.h>
1516

1617
#include <audioplugin/internal/audiosystem.h>
1718
#include <audioplugin/internal/outputsystem.h>

src/plugins/coreplugin/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ qm_configure_target(${PROJECT_NAME}
2828
Gui
2929
Widgets
3030
LINKS
31+
idecore::Framework
3132
ExtensionSystem::ExtensionSystem
3233
ChorusKit::AppCore
33-
svscraft::Widgets
3434
JetBrainsDockingSystem
3535
dspxmodel
3636
opendspx::opendspx

src/plugins/coreplugin/core/actionmanager.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ namespace Core {
2121
explicit ActionManager(QObject *parent = nullptr);
2222
~ActionManager();
2323

24-
2524
public:
2625
ActionDomain *domain() const;
2726

src/plugins/coreplugin/core/icore.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,11 @@
2121
#include <CoreApi/iloader.h>
2222
#include <CoreApi/private/icorebase_p.h>
2323

24+
#include <idecoreFramework/settingsdialog.h>
25+
#include <idecoreFramework/plugindialog.h>
26+
2427
#include "dspxspec.h"
2528
#include "ihomewindow.h"
26-
#include "settingsdialog.h"
27-
#include "plugindialog.h"
2829
#include "appextra.h"
2930

3031
namespace Core {
@@ -48,7 +49,7 @@ namespace Core {
4849
}
4950

5051
int ICore::showSettingsDialog(const QString &id, QWidget *parent) {
51-
static Internal::SettingsDialog *dlg = nullptr;
52+
static SettingsDialog *dlg = nullptr;
5253

5354
if (dlg) {
5455
if (!id.isEmpty())
@@ -58,7 +59,7 @@ namespace Core {
5859

5960
int code;
6061
{
61-
Internal::SettingsDialog dlg2(parent);
62+
SettingsDialog dlg2(parent);
6263
dlg = &dlg2;
6364
if (!id.isEmpty())
6465
dlg2.selectPage(id);
@@ -70,7 +71,7 @@ namespace Core {
7071
}
7172

7273
void ICore::showPluginsDialog(QWidget *parent) {
73-
Internal::PluginDialog dlg(parent);
74+
PluginDialog dlg(parent);
7475
dlg.exec();
7576
}
7677

src/plugins/coreplugin/core/initroutine.cpp

Lines changed: 0 additions & 30 deletions
This file was deleted.

src/plugins/coreplugin/core/initroutine.h

Lines changed: 0 additions & 37 deletions
This file was deleted.

src/plugins/coreplugin/core/initroutine_p.h

Lines changed: 0 additions & 17 deletions
This file was deleted.

src/plugins/coreplugin/internal/coreplugin.cpp

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@
1818
#include <CoreApi/private/iloader_p.h>
1919
#include <CoreApi/actiondomain.h>
2020

21+
#include <idecoreFramework/initroutine.h>
22+
2123
#include "dspxspec.h"
22-
#include "initroutine_p.h"
2324

2425
// Windows
2526
#include "ihomewindow.h"
@@ -30,8 +31,9 @@
3031
#include "projectaddon.h"
3132

3233
// Settings
34+
#include <idecoreFramework/appearancepage.h>
35+
3336
#include "enviromenttoppage.h"
34-
#include "appearancepage.h"
3537
#include "actionlayoutspage.h"
3638
#include "keymappage.h"
3739
#include "menutoolbarpage.h"
@@ -46,8 +48,6 @@ namespace Core::Internal {
4648

4749
static QSplashScreen *splash = nullptr;
4850

49-
InitRoutinePrivate *ir = nullptr;
50-
5151
static int openFileFromCommand(QString workingDir, const QStringList &args, IWindow *iWin) {
5252
int cnt = 0;
5353

@@ -87,18 +87,11 @@ namespace Core::Internal {
8787
}
8888

8989
bool CorePlugin::initialize(const QStringList &arguments, QString *errorMessage) {
90-
// Receive splash screen
91-
std::swap(splash, reinterpret_cast<QSplashScreen *&>(ILoaderPrivate::quickData(0)));
92-
93-
static InitRoutinePrivate ir1;
94-
ir = &ir1;
95-
ir->splash = splash;
96-
9790
// Add resources
9891
qIDec->addTranslationPath(pluginSpec()->location() + QStringLiteral("/translations"));
9992
qIDec->addThemePath(pluginSpec()->location() + QStringLiteral("/themes"));
10093

101-
splash->showMessage(tr("Initializing core plugin..."));
94+
InitRoutine::splash()->showMessage(tr("Initializing core plugin..."));
10295

10396
// Init ICore instance
10497
icore = new ICore(this);
@@ -171,8 +164,8 @@ namespace Core::Internal {
171164
bool CorePlugin::delayedInitialize() {
172165
splash->showMessage(tr("Initializing user interface..."));
173166

174-
if (ir->entry) {
175-
waitSplash(ir->entry());
167+
if (auto entry = InitRoutine::startEntry()) {
168+
waitSplash(entry());
176169
return false;
177170
}
178171

0 commit comments

Comments
 (0)