X-Git-Url: https://gitweb.stoutner.com/?a=blobdiff_plain;f=src%2Fmainwindow.cpp;fp=src%2Fmainwindow.cpp;h=0000000000000000000000000000000000000000;hb=8e2e267828a6fbd7ed9950204c50a100e3f413fa;hp=c48e4955853c03f469af71149129dfa565127d36;hpb=aca3bbeca7fee2ff50918a9d09a41be4edf1140c;p=PrivacyBrowserPC.git diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp deleted file mode 100644 index c48e495..0000000 --- a/src/mainwindow.cpp +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright © 2022 Soren Stoutner . - * - * This file is part of Privacy Browser PC . - * - * Privacy Browser PC 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 3 of the License, or - * (at your option) any later version. - * - * Privacy Browser PC 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 Privacy Browser PC. If not, see . - */ - -// Application headers. -#include "mainview.h" -#include "mainwindow.h" -#include "settings.h" -#include "ui_settings.h" - -// KDE Frameworks headers. -#include -#include - -MainWindow::MainWindow() : KXmlGuiWindow() -{ - // Instantiate the main view pointer. - MainView *mainViewPointer = new MainView(this); - - // Set the main view as the central widget. - setCentralWidget(mainViewPointer); - - // Get a handle for the action collectoin. - KActionCollection *actionCollectionPointer = this->actionCollection(); - - // Add the standard actions. - KStandardAction::openNew(this, SLOT(fileNew()), actionCollectionPointer); - KStandardAction::quit(qApp, SLOT(closeAllWindows()), actionCollectionPointer); - KStandardAction::preferences(this, SLOT(settingsConfigure()), actionCollectionPointer); - - // Setup the GUI based on the privacybrowserui.rc file. - setupGUI(); -} - -void MainWindow::fileNew() -{ - // Display a new instance of Privacy Browser. - (new MainWindow)->show(); -} - -void MainWindow::settingsConfigure() -{ - // Check to make sure the dialog box isn't already displayed. - if (!KConfigDialog::exists(QStringLiteral("settings"))) - { - // Create a general settings page. - QWidget *generalSettingsWidgetPointer = new QWidget; - - // Instantiate the settings UI. - Ui::Settings settingsUi; - - // Setup the UI to display the general settings widget. - settingsUi.setupUi(generalSettingsWidgetPointer); - - // Instantiate a settings config dialog from the settings.kcfg file. - KConfigDialog *configDialogPointer = new KConfigDialog(this, QStringLiteral("settings"), Settings::self()); - - // Add the general settings widget page. - configDialogPointer->addPage(generalSettingsWidgetPointer, i18nc("@title:tab", "General"), QStringLiteral("breeze-settings")); - - // Delete the config dialog when it is closed. - configDialogPointer->setAttribute(Qt::WA_DeleteOnClose); - - // Make it so. - configDialogPointer->show(); - } -}