diff --git a/inkbox.pro b/inkbox.pro index a0c19d7..926528e 100644 --- a/inkbox.pro +++ b/inkbox.pro @@ -57,7 +57,7 @@ SOURCES += \ src/settings/settingschooser.cpp \ src/widgets/text/textwidget.cpp \ src/widgets/interfaceWidgets/toast.cpp \ - src/splash/usbms_splash.cpp \ + src/splash/usbmsSplash.cpp \ src/apps/userapps.cpp \ src/widgets/virtualKeyboard/virtualkeyboard.cpp \ src/widgets/virtualKeyboard/virtualkeypad.cpp \ @@ -100,7 +100,7 @@ HEADERS += \ src/settings/settingschooser.h \ src/widgets/text/textwidget.h \ src/widgets/interfaceWidgets/toast.h \ - src/splash/usbms_splash.h \ + src/splash/usbmsSplash.h \ src/apps/userapps.h \ src/widgets/virtualKeyboard/virtualkeyboard.h \ src/widgets/virtualKeyboard/virtualkeypad.h \ @@ -140,7 +140,7 @@ FORMS += \ src/settings/settingschooser.ui \ src/widgets/text/textwidget.ui \ src/widgets/interfaceWidgets/toast.ui \ - src/splash/usbms_splash.ui \ + src/splash/usbmsSplash.ui \ src/apps/userapps.ui \ src/widgets/virtualKeyboard/virtualkeyboard.ui \ src/widgets/virtualKeyboard/virtualkeypad.ui \ diff --git a/src/encfs/encryptionmanager.cpp b/src/encfs/encryptionmanager.cpp index 34a5e46..7493770 100644 --- a/src/encfs/encryptionmanager.cpp +++ b/src/encfs/encryptionmanager.cpp @@ -8,7 +8,7 @@ #include #include #include -#include "usbms_splash.h" +#include "usbmsSplash.h" #include "functions.h" encryptionManager::encryptionManager(QWidget *parent) : @@ -346,7 +346,7 @@ void encryptionManager::on_usbmsBtn_clicked() { log("Showing USBMS splash", className); global::usbms::launchUsbms = true; - usbmsWindow = new usbms_splash(); + usbmsWindow = new usbmsSplash(); usbmsWindow->setAttribute(Qt::WA_DeleteOnClose); usbmsWindow->setGeometry(QRect(QPoint(0,0), screen()->geometry ().size())); usbmsWindow->show(); diff --git a/src/encfs/encryptionmanager.h b/src/encfs/encryptionmanager.h index ac14c91..e90fdb3 100644 --- a/src/encfs/encryptionmanager.h +++ b/src/encfs/encryptionmanager.h @@ -48,7 +48,7 @@ private: toast * toastWindow; hourglassAnimationWidget * hourglassAnimationWidgetWindow; alert * alertWindow; - usbms_splash *usbmsWindow; + usbmsSplash *usbmsWindow; }; #endif // ENCRYPTIONMANAGER_H diff --git a/src/homeWidget/mainwindow.cpp b/src/homeWidget/mainwindow.cpp index 67a0df0..4b3406f 100644 --- a/src/homeWidget/mainwindow.cpp +++ b/src/homeWidget/mainwindow.cpp @@ -634,13 +634,13 @@ void MainWindow::setBatteryIcon() { stdIconHeight = sH / 16; QPixmap chargingPixmap(":/resources/battery_charging.png"); - QPixmap scaledChargingPixmap = chargingPixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio); + QPixmap scaledChargingPixmap = chargingPixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio, Qt::SmoothTransformation); QPixmap fullPixmap(":/resources/battery_full.png"); - QPixmap scaledFullPixmap = fullPixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio); + QPixmap scaledFullPixmap = fullPixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio, Qt::SmoothTransformation); QPixmap halfPixmap(":/resources/battery_half.png"); - QPixmap scaledHalfPixmap = halfPixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio); + QPixmap scaledHalfPixmap = halfPixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio, Qt::SmoothTransformation); QPixmap emptyPixmap(":/resources/battery_empty.png"); - QPixmap scaledEmptyPixmap = emptyPixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio); + QPixmap scaledEmptyPixmap = emptyPixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio, Qt::SmoothTransformation); // Checking battery level and status, then displaying the relevant icon on batteryIcon if(isUsbPluggedIn() == true) { @@ -664,13 +664,13 @@ void MainWindow::setBatteryIcon() { stdIconWidth = sW / 19; stdIconHeight = sH / 19; QPixmap chargingPixmap(":/resources/battery_charging.png"); - QPixmap scaledChargingPixmap = chargingPixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio); + QPixmap scaledChargingPixmap = chargingPixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio, Qt::SmoothTransformation); QPixmap fullPixmap(":/resources/battery_full.png"); - QPixmap scaledFullPixmap = fullPixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio); + QPixmap scaledFullPixmap = fullPixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio, Qt::SmoothTransformation); QPixmap halfPixmap(":/resources/battery_half.png"); - QPixmap scaledHalfPixmap = halfPixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio); + QPixmap scaledHalfPixmap = halfPixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio, Qt::SmoothTransformation); QPixmap emptyPixmap(":/resources/battery_empty.png"); - QPixmap scaledEmptyPixmap = emptyPixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio); + QPixmap scaledEmptyPixmap = emptyPixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio, Qt::SmoothTransformation); // Checking battery level and status, then displaying the relevant icon on batteryIcon if(isUsbPluggedIn() == true) { @@ -711,11 +711,12 @@ void MainWindow::setInitialBrightness() { // Coming from OOBE setup; not doing that fancy stuff again ;p QFile::remove("/tmp/oobe-inkbox_completed"); pre_set_brightness(brightness_value); + log("Ignoring cinematic brightness call because it has already been done", className); } else { // Fancy brightness fade-in - if(checkconfig("/tmp/inkbox-cinematic_brightness_auto") == true) { - QFile::remove("/tmp/inkbox-cinematic_brightness_auto"); + if(checkconfig("/tmp/inkbox-cinematicBrightness_auto") == true) { + QFile::remove("/tmp/inkbox-cinematicBrightness_auto"); cinematicBrightness(brightness_value, 2); } else { @@ -723,6 +724,9 @@ void MainWindow::setInitialBrightness() { string_writeconfig("/tmp/inkbox-cinematicBrightness_ran", "true"); cinematicBrightness(brightness_value, 0); } + else { + log("Ignoring cinematic brightness call because it has already been done", className); + } } } } diff --git a/src/homeWidget/mainwindow.h b/src/homeWidget/mainwindow.h index 539dfdd..b793017 100644 --- a/src/homeWidget/mainwindow.h +++ b/src/homeWidget/mainwindow.h @@ -8,7 +8,7 @@ #include "reader.h" #include "quit.h" #include "alert.h" -#include "usbms_splash.h" +#include "usbmsSplash.h" #include "brightnessdialog.h" #include "generaldialog.h" #include "koboxsettings.h" @@ -106,7 +106,7 @@ private: reader * readerWindow; quit * quitWindow; alert * alertWindow; - usbms_splash * usbmsWindow; + usbmsSplash * usbmsWindow; brightnessDialog * brightnessDialogWindow; generalDialog * generalDialogWindow; koboxSettings * koboxSettingsWindow; diff --git a/src/reader/reader.cpp b/src/reader/reader.cpp index 5893852..2c95bff 100644 --- a/src/reader/reader.cpp +++ b/src/reader/reader.cpp @@ -366,30 +366,24 @@ reader::reader(QWidget *parent) : float sH = QGuiApplication::screens()[0]->size().height(); // Defining what the icons' size will be if(checkconfig("/opt/inkbox_genuine") == true) { + float stdIconWidth; + float stdIconHeight; if(global::deviceID == "n705\n" or global::deviceID == "n905\n" or global::deviceID == "n613\n" or global::deviceID == "n236\n" or global::deviceID == "n437\n" or global::deviceID == "n306\n" or global::deviceID == "kt\n" or global::deviceID == "emu\n") { - float stdIconWidth = sW / 16; - float stdIconHeight = sW / 16; - QPixmap chargingPixmap(":/resources/battery_charging.png"); - scaledChargingPixmap = chargingPixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio); - QPixmap fullPixmap(":/resources/battery_full.png"); - scaledFullPixmap = fullPixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio); - QPixmap halfPixmap(":/resources/battery_half.png"); - scaledHalfPixmap = halfPixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio); - QPixmap emptyPixmap(":/resources/battery_empty.png"); - scaledEmptyPixmap = emptyPixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio); + stdIconWidth = sW / 16; + stdIconHeight = sW / 16; } else { - float stdIconWidth = sW / 19; - float stdIconHeight = sH / 19; - QPixmap chargingPixmap(":/resources/battery_charging.png"); - scaledChargingPixmap = chargingPixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio); - QPixmap fullPixmap(":/resources/battery_full.png"); - scaledFullPixmap = fullPixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio); - QPixmap halfPixmap(":/resources/battery_half.png"); - scaledHalfPixmap = halfPixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio); - QPixmap emptyPixmap(":/resources/battery_empty.png"); - scaledEmptyPixmap = emptyPixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio); + stdIconWidth = sW / 19; + stdIconHeight = sH / 19; } + QPixmap chargingPixmap(":/resources/battery_charging.png"); + scaledChargingPixmap = chargingPixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio, Qt::SmoothTransformation); + QPixmap fullPixmap(":/resources/battery_full.png"); + scaledFullPixmap = fullPixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio, Qt::SmoothTransformation); + QPixmap halfPixmap(":/resources/battery_half.png"); + scaledHalfPixmap = halfPixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio, Qt::SmoothTransformation); + QPixmap emptyPixmap(":/resources/battery_empty.png"); + scaledEmptyPixmap = emptyPixmap.scaled(stdIconWidth, stdIconHeight, Qt::KeepAspectRatio, Qt::SmoothTransformation); } else { float stdIconWidth = sW / 19; @@ -1282,7 +1276,7 @@ void reader::on_homeBtn_clicked() // Remount tmpfs string_writeconfig("/inkbox/remount", "true"); // Specify cinematic brightness mode - string_writeconfig("/tmp/inkbox-cinematic_brightness_auto", "true"); + string_writeconfig("/tmp/inkbox-cinematicBrightness_auto", "true"); // Relaunching process quit_restart(); diff --git a/src/resources/hide.png b/src/resources/hide.png index 5b643fd..3d2533a 100644 Binary files a/src/resources/hide.png and b/src/resources/hide.png differ diff --git a/src/resources/show.png b/src/resources/show.png index 0c0be28..0694e9c 100644 Binary files a/src/resources/show.png and b/src/resources/show.png differ diff --git a/src/settings/koboxsettings.cpp b/src/settings/koboxsettings.cpp index 119ebf6..1a9e45e 100644 --- a/src/settings/koboxsettings.cpp +++ b/src/settings/koboxsettings.cpp @@ -126,7 +126,7 @@ void koboxSettings::on_pushButton_clicked() log("Exporting KoBox extensions onboard storage via USB", className); log("Showing USBMS splash", className); - usbmsWindow = new usbms_splash(); + usbmsWindow = new usbmsSplash(); usbmsWindow->setAttribute(Qt::WA_DeleteOnClose); usbmsWindow->setGeometry(QRect(QPoint(0,0), screen()->geometry ().size())); usbmsWindow->show(); diff --git a/src/settings/koboxsettings.h b/src/settings/koboxsettings.h index 43b254a..fbced89 100644 --- a/src/settings/koboxsettings.h +++ b/src/settings/koboxsettings.h @@ -4,7 +4,7 @@ #include #include "generaldialog.h" -#include "usbms_splash.h" +#include "usbmsSplash.h" namespace Ui { class koboxSettings; @@ -33,7 +33,7 @@ private slots: private: Ui::koboxSettings *ui; generalDialog *generalDialogWindow; - usbms_splash *usbmsWindow; + usbmsSplash *usbmsWindow; }; #endif // KOBOXSETTINGS_H diff --git a/src/settings/settings.cpp b/src/settings/settings.cpp index d48f141..3133a81 100644 --- a/src/settings/settings.cpp +++ b/src/settings/settings.cpp @@ -901,7 +901,7 @@ void settings::usbms_launch() log("Showing USBMS splash", className); global::usbms::launchUsbms = true; - usbmsWindow = new usbms_splash(); + usbmsWindow = new usbmsSplash(); usbmsWindow->setAttribute(Qt::WA_DeleteOnClose); usbmsWindow->setGeometry(QRect(QPoint(0,0), screen()->geometry ().size())); usbmsWindow->show(); diff --git a/src/settings/settings.h b/src/settings/settings.h index 4ad0205..0089283 100644 --- a/src/settings/settings.h +++ b/src/settings/settings.h @@ -3,7 +3,7 @@ #include -#include +#include #include "generaldialog.h" #include "otamanager.h" #include "toast.h" @@ -79,7 +79,7 @@ signals: private: Ui::settings *ui; - usbms_splash *usbmsWindow; + usbmsSplash *usbmsWindow; generalDialog *generalDialogWindow; otaManager *otaManagerWindow; toast *toastWindow; diff --git a/src/splash/usbms_splash.cpp b/src/splash/usbmsSplash.cpp similarity index 94% rename from src/splash/usbms_splash.cpp rename to src/splash/usbmsSplash.cpp index 774b9bd..b99fa90 100644 --- a/src/splash/usbms_splash.cpp +++ b/src/splash/usbmsSplash.cpp @@ -1,5 +1,5 @@ -#include "usbms_splash.h" -#include "ui_usbms_splash.h" +#include "usbmsSplash.h" +#include "ui_usbmsSplash.h" #include #include @@ -7,12 +7,12 @@ #include "functions.h" -usbms_splash::usbms_splash(QWidget *parent) : +usbmsSplash::usbmsSplash(QWidget *parent) : QWidget(parent), - ui(new Ui::usbms_splash) + ui(new Ui::usbmsSplash) { ui->setupUi(this); - usbms_splash::setFont(QFont("u001")); + usbmsSplash::setFont(QFont("u001")); ui->label->setFont(QFont("Inter")); // Getting the screen's size @@ -60,11 +60,11 @@ usbms_splash::usbms_splash(QWidget *parent) : if(global::usbms::launchUsbms == true) { global::usbms::launchUsbms = false; - usbms_launch(); + usbmsLaunch(); } } -void usbms_splash::usbms_launch() +void usbmsSplash::usbmsLaunch() { log("Entering USBMS session", className); string_writeconfig("/tmp/in_usbms", "true"); @@ -169,16 +169,17 @@ void usbms_splash::usbms_launch() usbms_t->start(); } -usbms_splash::~usbms_splash() +usbmsSplash::~usbmsSplash() { delete ui; } -void usbms_splash::brightnessDown() { +void usbmsSplash::brightnessDown() { cinematicBrightness(0, 1); + writeFile("/tmp/inkbox-cinematicBrightness_ran", "false"); } -void usbms_splash::quit_restart() { +void usbmsSplash::quit_restart() { // If existing, cleaning bookconfig_mount mountpoint string_writeconfig("/opt/ibxd", "bookconfig_unmount\n"); @@ -188,7 +189,7 @@ void usbms_splash::quit_restart() { qApp->quit(); } -void usbms_splash::restartServices() { +void usbmsSplash::restartServices() { // Restarting USBNet // NOTE: USBNet is only started if required conditions are met (see https://github.com/Kobo-InkBox/rootfs/blob/master/etc/init.d/usbnet) string_writeconfig("/opt/ibxd", "usbnet_start\n"); diff --git a/src/splash/usbms_splash.h b/src/splash/usbmsSplash.h similarity index 66% rename from src/splash/usbms_splash.h rename to src/splash/usbmsSplash.h index 3d8d8af..cce0038 100644 --- a/src/splash/usbms_splash.h +++ b/src/splash/usbmsSplash.h @@ -4,22 +4,22 @@ #include namespace Ui { -class usbms_splash; +class usbmsSplash; } -class usbms_splash : public QWidget +class usbmsSplash : public QWidget { Q_OBJECT public: QString className = this->metaObject()->className(); - explicit usbms_splash(QWidget *parent = nullptr); - ~usbms_splash(); + explicit usbmsSplash(QWidget *parent = nullptr); + ~usbmsSplash(); float sW; float sH; QString massStorageModule; - void usbms_launch(); + void usbmsLaunch(); private slots: void brightnessDown(); @@ -27,7 +27,7 @@ private slots: void restartServices(); private: - Ui::usbms_splash *ui; + Ui::usbmsSplash *ui; }; #endif // USBMS_SPLASH_H diff --git a/src/splash/usbms_splash.ui b/src/splash/usbmsSplash.ui similarity index 97% rename from src/splash/usbms_splash.ui rename to src/splash/usbmsSplash.ui index 5b4fde8..57b7cda 100644 --- a/src/splash/usbms_splash.ui +++ b/src/splash/usbmsSplash.ui @@ -1,7 +1,7 @@ - usbms_splash - + usbmsSplash + 0 diff --git a/src/widgets/dialogs/generaldialog.cpp b/src/widgets/dialogs/generaldialog.cpp index a3c78eb..c3d0db0 100644 --- a/src/widgets/dialogs/generaldialog.cpp +++ b/src/widgets/dialogs/generaldialog.cpp @@ -337,7 +337,7 @@ void generalDialog::on_okBtn_clicked() global::usbms::usbmsDialog = false; global::usbms::launchUsbms = true; - usbmsWindow = new usbms_splash(); + usbmsWindow = new usbmsSplash(); usbmsWindow->setAttribute(Qt::WA_DeleteOnClose); usbmsWindow->setGeometry(QRect(QPoint(0,0), screen()->geometry ().size())); usbmsWindow->show(); diff --git a/src/widgets/dialogs/generaldialog.h b/src/widgets/dialogs/generaldialog.h index a1e742c..9f91738 100644 --- a/src/widgets/dialogs/generaldialog.h +++ b/src/widgets/dialogs/generaldialog.h @@ -3,7 +3,7 @@ #include -#include "usbms_splash.h" +#include "usbmsSplash.h" #include "textwidget.h" #include "virtualkeyboard.h" #include "virtualkeypad.h" @@ -73,7 +73,7 @@ private slots: private: Ui::generalDialog *ui; - usbms_splash *usbmsWindow; + usbmsSplash *usbmsWindow; textwidget *textwidgetWindow; virtualkeyboard *keyboardWidget; virtualkeypad *keypadWidget; diff --git a/src/widgets/dialogs/kobox/koboxappsdialog.cpp b/src/widgets/dialogs/kobox/koboxappsdialog.cpp index 2a8dd8f..2ad0c50 100644 --- a/src/widgets/dialogs/kobox/koboxappsdialog.cpp +++ b/src/widgets/dialogs/kobox/koboxappsdialog.cpp @@ -166,7 +166,7 @@ void koboxAppsDialog::on_launchBtn_clicked() // Re-use USBMS splash window for KoBox splash, since it's pretty much the same layout log("Showing KoBox splash", className); - usbmsSplashWindow = new usbms_splash(); + usbmsSplashWindow = new usbmsSplash(); usbmsSplashWindow->setAttribute(Qt::WA_DeleteOnClose); usbmsSplashWindow->setGeometry(QRect(QPoint(0,0), screen()->geometry().size())); usbmsSplashWindow->show(); diff --git a/src/widgets/dialogs/kobox/koboxappsdialog.h b/src/widgets/dialogs/kobox/koboxappsdialog.h index f3861f3..fa95967 100644 --- a/src/widgets/dialogs/kobox/koboxappsdialog.h +++ b/src/widgets/dialogs/kobox/koboxappsdialog.h @@ -4,7 +4,7 @@ #include #include -#include "usbms_splash.h" +#include "usbmsSplash.h" namespace Ui { class koboxAppsDialog; @@ -36,7 +36,7 @@ signals: private: Ui::koboxAppsDialog *ui; - usbms_splash *usbmsSplashWindow; + usbmsSplash *usbmsSplashWindow; }; #endif // KOBOXAPPSDIALOG_H diff --git a/src/widgets/dialogs/wifi/connectiondialog.cpp b/src/widgets/dialogs/wifi/connectiondialog.cpp index cc097ab..eaf01d0 100644 --- a/src/widgets/dialogs/wifi/connectiondialog.cpp +++ b/src/widgets/dialogs/wifi/connectiondialog.cpp @@ -12,6 +12,9 @@ connectiondialog::connectiondialog(QWidget *parent) : { ui->setupUi(this); this->setFont(QFont("u001")); + ui->passphraseTextEdit->setFont(QFont("Noto Mono")); + ui->label->setFont(QFont("Inter")); + ui->label_2->setFont(QFont("Inter")); // Stylesheet, style & misc. QFile stylesheetFile("/mnt/onboard/.adds/inkbox/eink.qss"); @@ -19,15 +22,29 @@ connectiondialog::connectiondialog(QWidget *parent) : this->setStyleSheet(stylesheetFile.readAll()); stylesheetFile.close(); - ui->cancelBtn->setStyleSheet("font-size: 9pt"); - ui->connectBtn->setStyleSheet("font-size: 9pt"); - ui->showPassphraseBtn->setStyleSheet("font-size: 9pt"); + ui->cancelBtn->setProperty("type", "borderless"); + ui->connectBtn->setProperty("type", "borderless"); + ui->showPassphraseBtn->setProperty("type", "borderless"); + + ui->label->setStyleSheet("font-weight: bold"); + ui->label_2->setStyleSheet("font-weight: bold"); + + ui->cancelBtn->setIcon(QIcon(":/resources/close.png")); + ui->connectBtn->setIcon(QIcon(":/resources/arrow-right.png")); // Size QRect screenGeometry = QGuiApplication::screens()[0]->geometry(); - this->setFixedWidth(screenGeometry.width()); + this->setFixedWidth(screenGeometry.width() / 1.5); + int halfOfHalfHeight = ((screenGeometry.height() / 2) / 2) / 2; + int finalHeight = screenGeometry.height() - halfOfHalfHeight * 6.3; + this->setFixedHeight(finalHeight); + + // Centering dialog + int x = (screenGeometry.width() - this->width()) / 2; + int y = (screenGeometry.height() - this->height()) / 2; + this->move(x, y); } connectiondialog::~connectiondialog() @@ -63,12 +80,17 @@ void connectiondialog::applyVariables() { } QString passphrase = searchDatabase(connectedNetworkData.name); if(passphrase.isEmpty() == false) { - log("Found passphrase: " + passphrase, className); + log("Found passphrase: '" + passphrase + "'", className); ui->showPassphraseBtn->setIcon(QIcon(":/resources/show.png")); showedPassphrase = false; savedPassphrase = passphrase; - ui->passphraseTextEdit->setText("********"); + int passphraseLength = passphrase.length(); + QString hiddenPassphrase; + for(int i = 0; i < passphraseLength; i++) { + hiddenPassphrase.append("•"); + } + ui->passphraseTextEdit->setText(hiddenPassphrase); } else { log("No passphrase found", className); @@ -224,12 +246,12 @@ void connectiondialog::on_passphraseTextEdit_cursorPositionChanged(int oldpos, i global::keyboard::keyboardText = ""; } else { - log("Passphrase is not saved; ignoring text edit call", className); + log("Passphrase is not saved; ignoring text edit widget call", className); } } } else { - log("Ignoring click on text edit", className); + log("Ignoring click on text edit widget", className); cursorPositionIgnore = true; } } @@ -248,7 +270,13 @@ void connectiondialog::on_showPassphraseBtn_clicked() else { showedPassphrase = false; ui->showPassphraseBtn->setIcon(QIcon(":/resources/show.png")); - ui->passphraseTextEdit->setText("********"); + + int passphraseLength = searchDatabase(connectedNetworkData.name).length(); + QString hiddenPassphrase; + for(int i = 0; i < passphraseLength; i++) { + hiddenPassphrase.append("•"); + } + ui->passphraseTextEdit->setText(hiddenPassphrase); } } diff --git a/src/widgets/dialogs/wifi/connectiondialog.ui b/src/widgets/dialogs/wifi/connectiondialog.ui index b8ea219..7c97ade 100644 --- a/src/widgets/dialogs/wifi/connectiondialog.ui +++ b/src/widgets/dialogs/wifi/connectiondialog.ui @@ -22,7 +22,7 @@ - Cancel + @@ -62,7 +62,7 @@ - Connect +