proprocessor cryptopp
This commit is contained in:
@@ -6,7 +6,8 @@ AboutDialog::AboutDialog(QWidget *parent) :
|
||||
ui(new Ui::AboutDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
ui->appNameLabel->setText(QString("TaskNote (%1)").arg(QSysInfo::currentCpuArchitecture()));
|
||||
ui->appNameLabel->setText(QString("%1 (%2)").arg(APP_NAME, APP_ARCH));
|
||||
ui->versionLabel->setText(QString("Version %1").arg(APP_VERSION));
|
||||
}
|
||||
|
||||
AboutDialog::~AboutDialog()
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<widget class="QLabel" name="versionLabel">
|
||||
<property name="text">
|
||||
<string>Version 1.2.0.0</string>
|
||||
</property>
|
||||
|
||||
@@ -14,7 +14,9 @@ MainWindow::MainWindow(QWidget *parent)
|
||||
connect(ui->noteList, &QListWidget::currentRowChanged, this, &MainWindow::selectionChanged);
|
||||
connect(ui->titleEdit, &QLineEdit::textChanged, this, &MainWindow::titleChanged);
|
||||
connect(ui->contentEdit, &QPlainTextEdit::textChanged, this, &MainWindow::contentChanged);
|
||||
#ifdef __SECURED
|
||||
connect(ui->actionEncrypt, &QAction::triggered, this, &MainWindow::encryptNote);
|
||||
#endif
|
||||
const QFont fixedFont = QFontDatabase::systemFont(QFontDatabase::FixedFont);
|
||||
ui->contentEdit->setFont(fixedFont);
|
||||
this->savemng = new SaveManager();
|
||||
@@ -56,12 +58,16 @@ void MainWindow::selectionChanged(int i)
|
||||
ui->titleEdit->setDisabled(false);
|
||||
ui->contentEdit->setDisabled(false);
|
||||
ui->titleEdit->setText(n->getTitle());
|
||||
#ifdef __SECURED
|
||||
if (n->isEncrypted())
|
||||
{
|
||||
ui->contentEdit->setPlainText(n->getEncryptedContent("azertyuiop"));
|
||||
} else {
|
||||
ui->contentEdit->setPlainText(n->getContent());
|
||||
}
|
||||
#else
|
||||
ui->contentEdit->setPlainText(n->getContent());
|
||||
#endif
|
||||
ui->markdownViewer->setMarkdown(ui->contentEdit->toPlainText());
|
||||
}
|
||||
|
||||
@@ -107,6 +113,7 @@ void MainWindow::showAboutBox()
|
||||
dialog.exec();
|
||||
}
|
||||
|
||||
#ifdef __SECURED
|
||||
void MainWindow::encryptNote()
|
||||
{
|
||||
if (this->currentIndex > -1)
|
||||
@@ -116,6 +123,7 @@ void MainWindow::encryptNote()
|
||||
savemng->flushSave();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void MainWindow::contentChanged()
|
||||
{
|
||||
|
||||
@@ -30,7 +30,9 @@ private slots:
|
||||
void contentChanged();
|
||||
void titleChanged();
|
||||
void showAboutBox();
|
||||
#ifdef __SECURED
|
||||
void encryptNote();
|
||||
#endif
|
||||
|
||||
private:
|
||||
Ui::MainWindow *ui;
|
||||
|
||||
@@ -222,6 +222,9 @@
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionEncrypt">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../icons.qrc">
|
||||
<normaloff>:/icon/resources/outline_shield_black_48dp.png</normaloff>:/icon/resources/outline_shield_black_48dp.png</iconset>
|
||||
|
||||
Reference in New Issue
Block a user