From bd9c9ca594dfaba3631ee48c861fc801024b41b0 Mon Sep 17 00:00:00 2001 From: keshavbhatt Date: Wed, 5 May 2021 03:08:32 +0530 Subject: minor fixes --- snap_launcher/bin/whatsie | Bin 1708224 -> 1708304 bytes src/mainwindow.cpp | 2 +- src/rateapp.cpp | 1 - src/settingswidget.cpp | 6 + src/settingswidget.h | 2 + src/settingswidget.ui | 365 ++++++++++++++++++++++++---------------------- src/webenginepage.cpp | 9 +- 7 files changed, 204 insertions(+), 181 deletions(-) diff --git a/snap_launcher/bin/whatsie b/snap_launcher/bin/whatsie index 9e4c2d6..a238f51 100755 Binary files a/snap_launcher/bin/whatsie and b/snap_launcher/bin/whatsie differ diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 42047ea..e777486 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -55,7 +55,7 @@ MainWindow::MainWindow(QWidget *parent) updateWindowTheme(); - RateApp *rateApp = new RateApp(this, "snap://whatsie", 3, 5, 1000 * 30); + RateApp *rateApp = new RateApp(this, "snap://whatsie", 5, 5, 1000 * 30); rateApp->setWindowTitle(QApplication::applicationName()+" | "+tr("Rate Application")); rateApp->setVisible(false); rateApp->setWindowFlags(Qt::Dialog); diff --git a/src/rateapp.cpp b/src/rateapp.cpp index 03926e2..cd29c06 100644 --- a/src/rateapp.cpp +++ b/src/rateapp.cpp @@ -88,7 +88,6 @@ RateApp::~RateApp() delete ui; } - void RateApp::on_rateNowBtn_clicked() { QDesktopServices::openUrl(QUrl(app_rating_url)); diff --git a/src/settingswidget.cpp b/src/settingswidget.cpp index 1101c88..2807ab5 100644 --- a/src/settingswidget.cpp +++ b/src/settingswidget.cpp @@ -28,6 +28,7 @@ SettingsWidget::SettingsWidget(QWidget *parent, QString engineCachePath, QString ui->enableSpellCheck->setChecked(settings.value("sc_enabled",true).toBool()); ui->notificationTimeOutspinBox->setValue(settings.value("notificationTimeOut",9000).toInt()/1000); ui->notificationCombo->setCurrentIndex(settings.value("notificationCombo",1).toInt()); + ui->useNativeFileDialog->setChecked(settings.value("useNativeFileDialog",true).toBool()); ui->automaticThemeCheckBox->blockSignals(true); bool automaticThemeSwitching = settings.value("automaticTheme",false).toBool(); @@ -413,3 +414,8 @@ void SettingsWidget::on_automaticThemeCheckBox_toggled(bool checked) updateAutomaticTheme(); } } + +void SettingsWidget::on_useNativeFileDialog_toggled(bool checked) +{ + settings.setValue("useNativeFileDialog",checked); +} diff --git a/src/settingswidget.h b/src/settingswidget.h index 300b7e3..a49eda8 100644 --- a/src/settingswidget.h +++ b/src/settingswidget.h @@ -86,6 +86,8 @@ private slots: void updateAutomaticTheme(); void themeSwitchTimerTimeout(); + void on_useNativeFileDialog_toggled(bool checked); + private: Ui::SettingsWidget *ui; QString engineCachePath,enginePersistentStoragePath; diff --git a/src/settingswidget.ui b/src/settingswidget.ui index 0f400a3..3f7e2d4 100644 --- a/src/settingswidget.ui +++ b/src/settingswidget.ui @@ -7,7 +7,7 @@ 0 0 512 - 613 + 644 @@ -109,81 +109,100 @@ background:transparent; General settings - - - - 0 - + + - + - App permissions + User Agent - + + + + - Show permissions + Set - :/icons/categories/security.png:/icons/categories/security.png + :/icons/categories/utilities.png:/icons/categories/utilities.png + + + + + + + Default + + + + :/icons/refresh-line.png:/icons/refresh-line.png - - + + - + - Notification type + Close button action - + - Native notification + Minimize to tray - :/icons/categories/featured.png:/icons/categories/featured.png + :/icons/window-2-line.png:/icons/window-2-line.png - Customized notification + Quit Application - :/icons/categories/devices-and-iot.png:/icons/categories/devices-and-iot.png + :/icons/shut-down-line.png:/icons/shut-down-line.png - - - - - 0 - 0 - - - - Try - - - - :/icons/categories/science.png:/icons/categories/science.png - - - + + + + + 0 + 1 + + + + + 16777215 + 1 + + + + background-color: rgba(63, 129, 216, 48); + + + QFrame::Raised + + + Qt::Horizontal + + + @@ -230,100 +249,54 @@ background:transparent; - - + + + + 0 + - + - Global App shortcuts + App permissions - + - Show shortcuts + Show permissions - :/icons/share-forward-line.png:/icons/share-forward-line.png + :/icons/categories/security.png:/icons/categories/security.png - - - - - - - 1 - 0 - - - - - 1 - 16777215 - - - - background-color: rgba(63, 129, 216, 48); - - - Qt::Vertical - - - - - + + + + - Disable Notifications PopUp + Global App shortcuts - - + + - Disable Auto Playback of Media + Show shortcuts - - - - - - Mute Audio from Page + + + :/icons/share-forward-line.png:/icons/share-forward-line.png - - - - - - PopUp timeout - - - - - - - Secs - - - 2 - - - 20 - - - - - - + 0 @@ -347,43 +320,7 @@ background:transparent; - - - - - - User Agent - - - - - - - - - - Set - - - - :/icons/categories/utilities.png:/icons/categories/utilities.png - - - - - - - Default - - - - :/icons/refresh-line.png:/icons/refresh-line.png - - - - - - + @@ -432,65 +369,128 @@ background:transparent; - - - - - 0 - 1 - - - - - 16777215 - 1 - - - - background-color: rgba(63, 129, 216, 48); - - - QFrame::Raised - - - Qt::Horizontal - - - - - + + - + - Close button action + Notification type - + - Minimize to tray + Native notification - :/icons/window-2-line.png:/icons/window-2-line.png + :/icons/categories/featured.png:/icons/categories/featured.png - Quit Application + Customized notification - :/icons/shut-down-line.png:/icons/shut-down-line.png + :/icons/categories/devices-and-iot.png:/icons/categories/devices-and-iot.png + + + + + 0 + 0 + + + + Try + + + + :/icons/categories/science.png:/icons/categories/science.png + + + - + + + + + + + 1 + 0 + + + + + 1 + 16777215 + + + + background-color: rgba(63, 129, 216, 48); + + + Qt::Vertical + + + + + + + Disable Notifications PopUp + + + + + + + Disable Auto Playback of Media + + + + + + + Mute Audio from Page + + + + + + + + + PopUp timeout + + + + + + + Secs + + + 2 + + + 20 + + + + + + + + @@ -515,6 +515,17 @@ background:transparent; + + + + + + Use Native File Dialog + + + + + diff --git a/src/webenginepage.cpp b/src/webenginepage.cpp index bdb6ccb..9e34a61 100644 --- a/src/webenginepage.cpp +++ b/src/webenginepage.cpp @@ -123,7 +123,7 @@ void WebEnginePage::handleLoadFinished(bool ok) void WebEnginePage::fullScreenRequestedByPage(QWebEngineFullScreenRequest request) { - qDebug()<<"Fullscreen"; + //qDebug()<<"Fullscreen"; request.accept(); } @@ -138,8 +138,13 @@ QStringList WebEnginePage::chooseFiles(QWebEnginePage::FileSelectionMode mode, c } QFileDialog* dialog = new QFileDialog(); + dialog->setAttribute(Qt::WA_DeleteOnClose,true); dialog->setFileMode(dialogMode); - dialog->setOption(QFileDialog::DontUseNativeDialog,settings.value("useNativeFileDialog",true).toBool()); + if(settings.value("useNativeFileDialog",true).toBool() == false){ + dialog->setOption(QFileDialog::DontUseNativeDialog,true); + }else{ + dialog->setOption(QFileDialog::DontUseNativeDialog,false); + } QStringList mimeFilters = acceptedMimeTypes; mimeFilters.append("application/octet-stream"); // to show All files(*) -- cgit v1.2.3