diff --git a/src/tests/demo_konsolepart/src/demo_konsolepart.cpp b/src/tests/demo_konsolepart/src/demo_konsolepart.cpp index 581fd4f1..08e75c1e 100644 --- a/src/tests/demo_konsolepart/src/demo_konsolepart.cpp +++ b/src/tests/demo_konsolepart/src/demo_konsolepart.cpp @@ -1,107 +1,108 @@ /* Copyright 2017 by Kurt Hindenburg This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License or (at your option) version 3 or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 14 of version 3 of the license. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #include "demo_konsolepart.h" #include #include #include #include #include #include #include #include #include +#include // see below notes //#include "../../../WindowSystemInfo.h" demo_konsolepart::demo_konsolepart() : KMainWindow(), _mainWindow(nullptr), _terminalPart(nullptr), _terminal(nullptr) { const bool useTranslucency = KWindowSystem::compositingActive(); setAttribute(Qt::WA_TranslucentBackground, useTranslucency); setAttribute(Qt::WA_NoSystemBackground, false); // This is used in EditProfileDialog to show the warnings about // transparency issues - needs refactoring as the above // include does not work // WindowSystemInfo::HAVE_TRANSPARENCY = useTranslucency; // Create terminal part and embed in into the main window _terminalPart = createPart(); if (_terminalPart == nullptr) { return; } QMenu* fileMenu = menuBar()->addMenu(QStringLiteral("File")); QAction* manageProfilesAction = fileMenu->addAction(QStringLiteral("Manage Profiles...")); connect(manageProfilesAction, &QAction::triggered, this, &demo_konsolepart::manageProfiles); QAction* quitAction = fileMenu->addAction(QStringLiteral("Quit")); connect(quitAction, &QAction::triggered, this, &demo_konsolepart::quit); connect(_terminalPart, &KParts::ReadOnlyPart::destroyed, this, &demo_konsolepart::quit); setCentralWidget(_terminalPart->widget()); _terminal = qobject_cast(_terminalPart); // Test if blur is enabled for profile bool blurEnabled; QMetaObject::invokeMethod(_terminalPart, "isBlurEnabled", Qt::DirectConnection, Q_RETURN_ARG(bool, blurEnabled)); qWarning()<<"blur enabled: "<library()).factory(); Q_ASSERT(factory); KParts::ReadOnlyPart* terminalPart = factory->create(this); return terminalPart; } void demo_konsolepart::manageProfiles() { QMetaObject::invokeMethod(_terminalPart, "showManageProfilesDialog", Qt::QueuedConnection, Q_ARG(QWidget*, QApplication::activeWindow())); } void demo_konsolepart::quit() { close(); }