-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
469 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
#include "settingsdialog.h" | ||
#include "ui_settingsdialog.h" | ||
|
||
settingsDialog::settingsDialog(QWidget *parent) : | ||
QDialog(parent), | ||
ui(new Ui::settingsDialog), | ||
setting(new settings) | ||
{ | ||
ui->setupUi(this); | ||
|
||
if (setting->getDisplayMessageOnce() == 0) | ||
displayonce = false; | ||
else | ||
displayonce = true; | ||
|
||
ui->le_path_mailbox->setText(QDir::homePath() + "/mail"); | ||
readSettings(); | ||
} | ||
|
||
settingsDialog::~settingsDialog() | ||
{ | ||
delete setting; | ||
delete ui; | ||
} | ||
|
||
void settingsDialog::readSettings() | ||
{ | ||
ui->le_path_mailbox->setText(setting->getMailDir()); | ||
ui->cb_alwayswebview->setChecked(setting->getAlwaysUseWebview() ? true : false); | ||
ui->cb_automaticallywebview->setChecked(setting->getUseWebviewAutomatically() ? true : false); | ||
ui->gb_checknew->setChecked(setting->getCheckForNewMail() ? true : false); | ||
ui->sp_seconds_tocheck->setValue(setting->getCheckAfter()); | ||
ui->cb_trayicon->setChecked(setting->getDisplayTray() ? true : false); | ||
ui->cb_notify->setChecked(setting->getDisplayNotify() ? true : false); | ||
} | ||
|
||
void settingsDialog::writeSettings() | ||
{ | ||
setting->setMailDir(ui->le_path_mailbox->text()); | ||
setting->setAlwaysUseWebview(ui->cb_alwayswebview->isChecked() ? 1 : 0); | ||
setting->setUseWebviewAutomatically(ui->cb_automaticallywebview->isChecked() ? 1 : 0); | ||
setting->setCheckForNewMail(ui->gb_checknew->isChecked() ? 1 : 0); | ||
setting->setCheckAfter(ui->sp_seconds_tocheck->value()); | ||
setting->setDisplayTray(ui->cb_trayicon->isChecked() ? 1 : 0); | ||
setting->setDisplayNotify(ui->cb_notify->isChecked() ? 1 : 0); | ||
} | ||
|
||
void settingsDialog::on_cb_alwayswebview_clicked() | ||
{ | ||
if (!displayonce) | ||
{ | ||
QMessageBox::warning(this,\ | ||
"CuteMail - warning",\ | ||
"Note that webview might be 'no go' for privacy concerns." | ||
"Still many mail used html to display content. This message appears only once.",\ | ||
QMessageBox::Ok | ||
); | ||
|
||
setting->setDisplayMessageOnce(1); | ||
} | ||
} | ||
|
||
void settingsDialog::on_cb_automaticallywebview_clicked() | ||
{ | ||
if (!displayonce) | ||
{ | ||
QMessageBox::warning(this,\ | ||
"CuteMail - warning",\ | ||
"Note that webview might be 'no go' for privacy concerns." | ||
"Still many mail used html to display content. This message appears only once.",\ | ||
QMessageBox::Ok | ||
); | ||
|
||
setting->setDisplayMessageOnce(1); | ||
} | ||
} | ||
|
||
void settingsDialog::on_buttonBox_accepted() | ||
{ | ||
writeSettings(); | ||
} | ||
|
||
void settingsDialog::on_buttonBox_rejected() | ||
{ | ||
this->close(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#ifndef SETTINGSDIALOG_H | ||
#define SETTINGSDIALOG_H | ||
|
||
#include <QDialog> | ||
#include <QMessageBox> | ||
#include <QDir> | ||
|
||
#include "utils/settings.h" | ||
|
||
namespace Ui { class settingsDialog; } | ||
|
||
class settingsDialog : public QDialog | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
explicit settingsDialog(QWidget *parent = 0); | ||
~settingsDialog(); | ||
|
||
private slots: | ||
void on_cb_alwayswebview_clicked(); | ||
|
||
void on_cb_automaticallywebview_clicked(); | ||
|
||
void on_buttonBox_accepted(); | ||
|
||
void on_buttonBox_rejected(); | ||
|
||
private: | ||
Ui::settingsDialog *ui; | ||
settings *setting; | ||
|
||
void readSettings(); | ||
void writeSettings(); | ||
|
||
bool displayonce; | ||
}; | ||
|
||
#endif // SETTINGSDIALOG_H |
Oops, something went wrong.