Falkon Develop
Cross-platform Qt-based web browser
sbi_settingsdialog.cpp
Go to the documentation of this file.
1/* ============================================================
2* StatusBarIcons - Extra icons in statusbar for Falkon
3* Copyright (C) 2013-2014 David Rosca <nowrep@gmail.com>
4*
5* This program is free software: you can redistribute it and/or modify
6* it under the terms of the GNU General Public License as published by
7* the Free Software Foundation, either version 3 of the License, or
8* (at your option) any later version.
9*
10* This program is distributed in the hope that it will be useful,
11* but WITHOUT ANY WARRANTY; without even the implied warranty of
12* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13* GNU General Public License for more details.
14*
15* You should have received a copy of the GNU General Public License
16* along with this program. If not, see <http://www.gnu.org/licenses/>.
17* ============================================================ */
18#include "sbi_settingsdialog.h"
19#include "ui_sbi_settingsdialog.h"
20#include "sbi_iconsmanager.h"
21
23 : QDialog(parent)
24 , ui(new Ui::SBI_SettingsDialog)
25 , m_manager(manager)
26{
27 setAttribute(Qt::WA_DeleteOnClose);
28
29 ui->setupUi(this);
30
31 ui->showImagesIcon->setChecked(m_manager->showImagesIcon());
32 ui->showJavaScriptIcon->setChecked(m_manager->showJavaScriptIcon());
33 ui->showNetworkIcon->setChecked(m_manager->showNetworkIcon());
34 ui->showZoomWidget->setChecked(m_manager->showZoomWidget());
35
36 connect(ui->buttonBox, &QDialogButtonBox::accepted, this, &SBI_SettingsDialog::saveSettings);
37 connect(ui->buttonBox, &QDialogButtonBox::rejected, this, &QWidget::close);
38}
39
40void SBI_SettingsDialog::saveSettings()
41{
42 m_manager->setShowImagesIcon(ui->showImagesIcon->isChecked());
43 m_manager->setShowJavaScriptIcon(ui->showJavaScriptIcon->isChecked());
44 m_manager->setShowNetworkIcon(ui->showNetworkIcon->isChecked());
45 m_manager->setShowZoomWidget(ui->showZoomWidget->isChecked());
46
47 m_manager->reloadIcons();
48 close();
49}
50
52{
53 delete ui;
54}
bool showNetworkIcon() const
bool showImagesIcon() const
bool showZoomWidget() const
void setShowImagesIcon(bool show)
void setShowNetworkIcon(bool show)
bool showJavaScriptIcon() const
void setShowJavaScriptIcon(bool show)
void setShowZoomWidget(bool show)
SBI_SettingsDialog(SBI_IconsManager *manager, QWidget *parent=nullptr)