From 7bc9214b73a3b593233d87e17b9d8bf1a82155c9 Mon Sep 17 00:00:00 2001 From: keshavbhatt Date: Sat, 10 Apr 2021 21:55:22 +0530 Subject: added permission dialog in settings window --- src/settingswidget.cpp | 25 ++++--- src/settingswidget.h | 7 +- src/settingswidget.ui | 172 ++++++++++++++++++++++++++++++------------------- 3 files changed, 127 insertions(+), 77 deletions(-) (limited to 'src') diff --git a/src/settingswidget.cpp b/src/settingswidget.cpp index fe91502..0b51099 100644 --- a/src/settingswidget.cpp +++ b/src/settingswidget.cpp @@ -12,8 +12,6 @@ SettingsWidget::SettingsWidget(QWidget *parent, QString engineCachePath, QString { ui->setupUi(this); - ui->disableVideosCheckBox->hide();//impl later - this->engineCachePath = engineCachePath; this->enginePersistentStoragePath = enginePersistentStoragePath; @@ -225,12 +223,6 @@ void SettingsWidget::on_setUserAgent_clicked() } - -void SettingsWidget::on_disableVideosCheckBox_toggled(bool checked) -{ - settings.setValue("disableVideos",checked); -} - void SettingsWidget::on_closeButtonActionComboBox_currentIndexChanged(int index) { settings.setValue("closeButtonActionCombo",index); @@ -274,7 +266,9 @@ void SettingsWidget::on_showShortcutsButton_clicked() { QWidget *sheet = new QWidget(this); sheet->setWindowTitle(QApplication::applicationName()+" | Global shortcuts"); - sheet->setWindowFlag(Qt::Sheet); + + sheet->setWindowFlags(Qt::Popup |Qt::FramelessWindowHint); + sheet->move(this->geometry().center()-sheet->geometry().center()); QVBoxLayout *layout = new QVBoxLayout(sheet); sheet->setLayout(layout); @@ -288,3 +282,16 @@ void SettingsWidget::on_showShortcutsButton_clicked() sheet->setAttribute(Qt::WA_DeleteOnClose); sheet->show(); } + +void SettingsWidget::on_showPermissionsButton_clicked() +{ + PermissionDialog *permissionDialog = new PermissionDialog(this); + permissionDialog->setWindowTitle(QApplication::applicationName()+" | "+tr("Feature permissions")); + permissionDialog->setWindowFlag(Qt::Dialog); + permissionDialog->move(this->geometry().center()-permissionDialog->geometry().center()); + permissionDialog->setMinimumSize(485,310); + permissionDialog->adjustSize(); + permissionDialog->show(); + +} + diff --git a/src/settingswidget.h b/src/settingswidget.h index e126930..737b987 100644 --- a/src/settingswidget.h +++ b/src/settingswidget.h @@ -5,6 +5,8 @@ #include #include "utils.h" +#include "permissiondialog.h" + namespace Ui { @@ -58,8 +60,6 @@ private slots: void on_autoPlayMediaCheckBox_toggled(bool checked); - void on_disableVideosCheckBox_toggled(bool checked); - void on_closeButtonActionComboBox_currentIndexChanged(int index); void on_applock_checkbox_toggled(bool checked); @@ -70,6 +70,9 @@ private slots: void on_showShortcutsButton_clicked(); + void on_showPermissionsButton_clicked(); + + private: Ui::SettingsWidget *ui; QString engineCachePath,enginePersistentStoragePath; diff --git a/src/settingswidget.ui b/src/settingswidget.ui index aec1dfe..21348f7 100644 --- a/src/settingswidget.ui +++ b/src/settingswidget.ui @@ -6,8 +6,8 @@ 0 0 - 554 - 565 + 527 + 590 @@ -104,6 +104,53 @@ background:transparent; General settings + + + + + + Disable Auto Playback of Media + + + + + + + Mute Audio from Page + + + + + + + Disable Notifications PopUp + + + + + + + + 1 + 0 + + + + + 1 + 16777215 + + + + background-color: rgba(63, 129, 216, 48); + + + Qt::Vertical + + + + + @@ -175,7 +222,53 @@ background:transparent; - + + + + 0 + + + + + <html><head/><body><p>Enable application lock screen.</p></body></html> + + + Enable App Lock on Start + + + + + + + Current Password: + + + + + + + + + + + Global App shortcuts + + + + + + + Show shortcuts + + + + :/icons/eye-line.png:/icons/eye-line.png + + + + + + @@ -211,7 +304,7 @@ background:transparent; - + @@ -236,62 +329,6 @@ background:transparent; - - - - - - Disable Notifications PopUp - - - - - - - Mute Audio from Page - - - - - - - Disable Auto Playback of Media - - - - - - - Disable loading videos - - - - - - - - - 0 - - - - - <html><head/><body><p>Enable application lock screen.</p></body></html> - - - Enable App Lock on Start - - - - - - - Current Password: - - - - - @@ -317,19 +354,22 @@ background:transparent; - - + + + + 0 + - + - Global App shortcuts + App permissions - + - Show + Show permissions -- cgit v1.2.3