aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gpg/function/BasicOperator.cpp2
-rw-r--r--src/main.cpp2
-rwxr-xr-xsrc/ui/KeyMgmt.cpp7
-rw-r--r--src/ui/widgets/InfoBoardWidget.cpp2
-rw-r--r--src/ui/widgets/KeyList.cpp4
5 files changed, 13 insertions, 4 deletions
diff --git a/src/gpg/function/BasicOperator.cpp b/src/gpg/function/BasicOperator.cpp
index ee59ff37..56b7ca54 100644
--- a/src/gpg/function/BasicOperator.cpp
+++ b/src/gpg/function/BasicOperator.cpp
@@ -219,7 +219,7 @@ gpg_error_t GpgFrontend::BasicOperator::EncryptSymmetric(
// TODO(Saturneric): maybe a bug of gpgme
if (gpgme_err_code(err) == GPG_ERR_NO_ERROR) {
- auto temp_result = GpgEncrResult(gpgme_op_encrypt_result(ctx));
+ auto temp_result = _new_result(gpgme_op_encrypt_result(ctx));
std::swap(result, temp_result);
}
diff --git a/src/main.cpp b/src/main.cpp
index c03f072b..10d54958 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -76,7 +76,7 @@ int main(int argc, char* argv[]) {
// unicode in source
QTextCodec::setCodecForLocale(QTextCodec::codecForName("utf-8"));
-#if defined(WINDOWS)
+#if !defined(RELEASE) && defined(WINDOWS)
// css
boost::filesystem::path css_path = GpgFrontend::UI::GlobalSettingStation::GetInstance().GetResourceDir() / "css" / "default.qss";
QFile file(css_path.string().c_str());
diff --git a/src/ui/KeyMgmt.cpp b/src/ui/KeyMgmt.cpp
index d3759e44..c03b8e6b 100755
--- a/src/ui/KeyMgmt.cpp
+++ b/src/ui/KeyMgmt.cpp
@@ -141,6 +141,8 @@ KeyMgmt::KeyMgmt(QWidget* parent) : QMainWindow(parent) {
this->resize(size);
this->move(pos);
+ this->setWindowModality(Qt::ApplicationModal);
+ this->statusBar()->show();
setWindowTitle(_("KeyPair Management"));
mKeyList->addMenuAction(deleteSelectedKeysAct);
@@ -148,6 +150,11 @@ KeyMgmt::KeyMgmt(QWidget* parent) : QMainWindow(parent) {
connect(this, SIGNAL(signalKeyStatusUpdated()), SignalStation::GetInstance(),
SIGNAL(KeyDatabaseRefresh()));
+ connect(SignalStation::GetInstance(),
+ &SignalStation::signalRefreshStatusBar, this,
+ [=](const QString& message, int timeout) {
+ statusBar()->showMessage(message, timeout);
+ });
}
void KeyMgmt::createActions() {
diff --git a/src/ui/widgets/InfoBoardWidget.cpp b/src/ui/widgets/InfoBoardWidget.cpp
index 28ec5644..d46d5f92 100644
--- a/src/ui/widgets/InfoBoardWidget.cpp
+++ b/src/ui/widgets/InfoBoardWidget.cpp
@@ -163,6 +163,8 @@ void InfoBoardWidget::slotSave() {
auto file_path = QFileDialog::getSaveFileName(
this, _("Save Information Board's Content"), {}, tr("Text (*.txt)"));
LOG(INFO) << "file path" << file_path.toStdString();
+ if(file_path.isEmpty()) return;
+
QFile file(file_path);
if (file.open(QIODevice::WriteOnly | QIODevice::Truncate)) {
file.write(ui->infoBoard->toPlainText().toUtf8());
diff --git a/src/ui/widgets/KeyList.cpp b/src/ui/widgets/KeyList.cpp
index 3933b968..0e4c5bba 100644
--- a/src/ui/widgets/KeyList.cpp
+++ b/src/ui/widgets/KeyList.cpp
@@ -134,7 +134,7 @@ void KeyList::addListGroupTab(
}
void KeyList::slotRefresh() {
- LOG(INFO) << _("Called");
+ LOG(INFO) << _("Called") << "_m_key_list_id" << _m_key_list_id;
emit signalRefreshStatusBar(_("Refreshing Key List..."), 3000);
auto thread = QThread::create([this, _id = _m_key_list_id]() {
std::lock_guard<std::mutex> guard(buffered_key_list_mutex);
@@ -512,7 +512,7 @@ void KeyTable::Refresh(KeyLinkListPtr m_keys) {
table_buffered_keys.clear();
while (it != keys->end()) {
- table_buffered_keys.push_back(GpgKeyGetter::GetInstance().GetKey(it->id()));
+ table_buffered_keys.push_back(it->copy());
auto* tmp0 = new QTableWidgetItem(QString::number(row_index));
tmp0->setFlags(Qt::ItemIsUserCheckable | Qt::ItemIsEnabled |