X-Git-Url: https://gitweb.stoutner.com/?a=blobdiff_plain;f=src%2Fprivacybrowserpcwindow.cpp;fp=src%2Fprivacybrowserpcwindow.cpp;h=0000000000000000000000000000000000000000;hb=597b6f74d41343f57e288694ec499e2303022f7e;hp=d27ea98fa578aabc59a2cbfb929e589b1ddcb9c2;hpb=6b2e1320fae530d918e617bbf2eab7b34e454498;p=PrivacyBrowserPC.git diff --git a/src/privacybrowserpcwindow.cpp b/src/privacybrowserpcwindow.cpp deleted file mode 100644 index d27ea98..0000000 --- a/src/privacybrowserpcwindow.cpp +++ /dev/null @@ -1,66 +0,0 @@ -/* - SPDX-FileCopyrightText: %{CURRENT_YEAR} %{AUTHOR} <%{EMAIL}> - - SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL -*/ - -// application headers -#include "privacybrowserpcwindow.h" - -#include "privacybrowserpcview.h" -#include "privacybrowserpcdebug.h" - -// KF headers -#include -#include - - -PrivacyBrowserPCWindow::PrivacyBrowserPCWindow() - : KXmlGuiWindow() -{ - m_privacybrowserpcView = new PrivacyBrowserPCView(this); - setCentralWidget(m_privacybrowserpcView); - - KActionCollection* actionCollection = this->actionCollection(); - m_switchAction = actionCollection->addAction(QStringLiteral("switch_action")); - m_switchAction->setText(i18nc("@action", "Switch Colors")); - m_switchAction->setIcon(QIcon::fromTheme(QStringLiteral("fill-color"))); - connect(m_switchAction, &QAction::triggered, m_privacybrowserpcView, &PrivacyBrowserPCView::switchColors); - - KStandardAction::openNew(this, SLOT(fileNew()), actionCollection); - KStandardAction::quit(qApp, SLOT(closeAllWindows()), actionCollection); - KStandardAction::preferences(this, SLOT(settingsConfigure()), actionCollection); - - setupGUI(); -} - -PrivacyBrowserPCWindow::~PrivacyBrowserPCWindow() -{ -} - -void PrivacyBrowserPCWindow::fileNew() -{ - qCDebug(PRIVACYBROWSERPC) << "PrivacyBrowserPCWindow::fileNew()"; - (new PrivacyBrowserPCWindow)->show(); -} - -void PrivacyBrowserPCWindow::settingsConfigure() -{ - qCDebug(PRIVACYBROWSERPC) << "PrivacyBrowserPCWindow::settingsConfigure()"; - // The preference dialog is derived from prefs_base.ui - // - // compare the names of the widgets in the .ui file - // to the names of the variables in the .kcfg file - //avoid to have 2 dialogs shown - if (KConfigDialog::showDialog(QStringLiteral("settings"))) { - return; - } - - KConfigDialog *dialog = new KConfigDialog(this, QStringLiteral("settings"), PrivacyBrowserPCSettings::self()); - QWidget *generalSettingsPage = new QWidget; - m_settings.setupUi(generalSettingsPage); - dialog->addPage(generalSettingsPage, i18nc("@title:tab", "General"), QStringLiteral("package_setting")); - connect(dialog, &KConfigDialog::settingsChanged, m_privacybrowserpcView, &PrivacyBrowserPCView::handleSettingsChanged); - dialog->setAttribute(Qt::WA_DeleteOnClose); - dialog->show(); -}