Even more encfs improvements

This commit is contained in:
Nicolas Mailloux 2021-10-18 08:46:27 -04:00
parent bb3ecedd8d
commit 6c6a64881d
5 changed files with 21 additions and 4 deletions

View file

@ -95,8 +95,8 @@ namespace global {
inline bool cancelSetup;
inline bool cancelUnlock;
inline bool lockdown;
inline bool enableStorageEncryptionDialog;
inline bool disableStorageEncryptionDialog;
inline bool disableStorageEncryption;
}
inline QString systemInfoText;
inline bool forbidOpenSearchDialog;

View file

@ -84,7 +84,7 @@ generalDialog::generalDialog(QWidget *parent) :
else if(global::settings::settingsRebootDialog == true) {
settingsRebootDialog = true;
ui->stackedWidget->setCurrentIndex(1);
if(global::kobox::koboxSettingsRebootDialog == true) {
if(global::kobox::koboxSettingsRebootDialog == true or global::encfs::enableStorageEncryptionDialog) {
koboxSettingsRebootDialog = true;
ui->bodyLabel->setText("The device will reboot now, since the settings you chose require it to work properly.");
}
@ -412,7 +412,7 @@ void generalDialog::on_acceptBtn_clicked()
}
if(settingsRebootDialog == true) {
if(koboxSettingsRebootDialog == true) {
if(koboxSettingsRebootDialog == true or global::encfs::enableStorageEncryptionDialog) {
reboot(true);
}
else {

View file

@ -365,6 +365,14 @@ MainWindow::MainWindow(QWidget *parent)
// We set the brightness level saved in the config file
QTimer::singleShot(2000, this, SLOT(setInitialBrightness()));
// If new files are found in /mnt/onboard/onboard/encfs-dropbox, ask if user wants to encrypt them
if(checkconfig(".config/18-encrypted_storage/status") == true) {
QDir encfsDropboxDir("/mnt/onboard/onboard/encfs-dropbox");
if(encfsDropboxDir.isEmpty()) {
QTimer::singleShot(1000, this, SLOT(openEncfsEncryptDialog()));
}
}
// Display quote if requested; otherwise, display recent books
string_checkconfig(".config/05-quote/config");
if(checkconfig_str_val == "") {
@ -1014,3 +1022,7 @@ void MainWindow::checkForUpdate() {
}
}
}
void MainWindow::openEncfsEncryptDialog() {
}

View file

@ -88,6 +88,7 @@ private slots:
void openBookFile(QString book, bool relativePath);
void openReaderFramework();
void checkForUpdate();
void openEncfsEncryptDialog();
private:
Ui::MainWindow *ui;

View file

@ -290,6 +290,10 @@ settings::settings(QWidget *parent) :
if(checkconfig(".config/18-encrypted_storage/status") == true) {
ui->enableEncryptedStorageCheckBox->click();
}
else {
// Next interaction will be by the user
enableEncryptedStorageUserChange = true;
}
// DPI checkbox
string_checkconfig(".config/09-dpi/config");
@ -892,6 +896,7 @@ void settings::on_enableEncryptedStorageCheckBox_toggled(bool checked)
QFile::remove(".config/18-encrypted_storage/storage_list");
}
global::settings::settingsRebootDialog = true;
global::encfs::enableStorageEncryptionDialog = true;
generalDialogWindow = new generalDialog(this);
generalDialogWindow->setAttribute(Qt::WA_DeleteOnClose);
generalDialogWindow->show();
@ -926,7 +931,6 @@ void settings::disableStorageEncryption() {
decDir.removeRecursively();
global::settings::settingsRebootDialog = true;
global::encfs::disableStorageEncryption = true;
generalDialogWindow = new generalDialog(this);
generalDialogWindow->setAttribute(Qt::WA_DeleteOnClose);
generalDialogWindow->show();