summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnne Jan Brouwer <brouwer@annejan.com>2016-11-22 22:31:28 +0100
committerAnne Jan Brouwer <brouwer@annejan.com>2016-11-22 22:31:28 +0100
commit9a7ed14239987d6b60edc02afcfa3a1b8cb43648 (patch)
tree025758b207f609f2abb493e941e0e8970bdb1c49
parent6e9298e084f1e63c65c98d33091d8360ece3a68f (diff)
Only show notification when clearPannel comming from timer, fixes #231
-rw-r--r--mainwindow.cpp16
-rw-r--r--mainwindow.h2
2 files changed, 10 insertions, 8 deletions
diff --git a/mainwindow.cpp b/mainwindow.cpp
index 943798a0..f7bdadc8 100644
--- a/mainwindow.cpp
+++ b/mainwindow.cpp
@@ -570,7 +570,7 @@ void MainWindow::on_treeView_clicked(const QModelIndex &index) {
"-d --quiet --yes --no-encrypt-to --batch --use-agent \"" +
file + '"');
} else {
- clearPanel();
+ clearPanel(false);
ui->editButton->setEnabled(false);
ui->deleteButton->setEnabled(true);
}
@@ -606,7 +606,7 @@ void MainWindow::deselect() {
currentDir = "/";
copyTextToClipboard("");
ui->passwordName->setText("");
- clearPanel();
+ clearPanel(false);
}
/**
@@ -699,7 +699,7 @@ void MainWindow::readyRead(bool finished = false) {
copyTextToClipboard(tokens[0]);
if (QtPassSettings::isUseAutoclearPanel()) {
QTimer::singleShot(1000 * QtPassSettings::getAutoclearPanelSeconds(),
- this, SLOT(clearPanel()));
+ this, SLOT(clearPanel(true)));
}
if (QtPassSettings::isHidePassword() &&
!QtPassSettings::isUseTemplate()) {
@@ -755,7 +755,7 @@ void MainWindow::readyRead(bool finished = false) {
autoclearTimer->setSingleShot(true);
autoclearTimer->setInterval(1000 *
QtPassSettings::getAutoclearPanelSeconds());
- connect(autoclearTimer, SIGNAL(timeout()), this, SLOT(clearPanel()));
+ connect(autoclearTimer, SIGNAL(timeout()), this, SLOT(clearPanel(true)));
autoclearTimer->start();
}
}
@@ -809,14 +809,16 @@ void MainWindow::clearClipboard() {
/**
* @brief MainWindow::clearPanel hide the information from shoulder surfers
*/
-void MainWindow::clearPanel() {
+void MainWindow::clearPanel(bool notify = true) {
while (ui->gridLayout->count() > 0) {
QLayoutItem *item = ui->gridLayout->takeAt(0);
delete item->widget();
delete item;
}
- QString output = "***" + tr("Password and Content hidden") + "***";
- ui->textBrowser->setHtml(output);
+ if (notify) {
+ QString output = "***" + tr("Password and Content hidden") + "***";
+ ui->textBrowser->setHtml(output);
+ }
}
/**
diff --git a/mainwindow.h b/mainwindow.h
index c2160809..cfbb3976 100644
--- a/mainwindow.h
+++ b/mainwindow.h
@@ -126,7 +126,7 @@ private slots:
void processFinished(int, QProcess::ExitStatus);
void processError(QProcess::ProcessError);
void clearClipboard();
- void clearPanel();
+ void clearPanel(bool notify);
void on_lineEdit_textChanged(const QString &arg1);
void on_lineEdit_returnPressed();
void on_addButton_clicked();