aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui/widgets/InfoBoardWidget.cpp
diff options
context:
space:
mode:
authorSaturneric <[email protected]>2021-07-20 16:42:50 +0000
committerSaturneric <[email protected]>2021-07-20 16:42:50 +0000
commitc57feb6a678e27140bb9ae7d132b641947514c31 (patch)
tree5ed7a7728c084214ce858323a4eccdcba98200b6 /src/ui/widgets/InfoBoardWidget.cpp
parentUpdate Workflow (diff)
parentFix problem that macos cannot use multi-languages. (diff)
downloadGpgFrontend-c57feb6a678e27140bb9ae7d132b641947514c31.tar.gz
GpgFrontend-c57feb6a678e27140bb9ae7d132b641947514c31.zip
Merge branch 'develop' into develop-ci
Diffstat (limited to '')
-rw-r--r--src/ui/widgets/InfoBoardWidget.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/ui/widgets/InfoBoardWidget.cpp b/src/ui/widgets/InfoBoardWidget.cpp
index 33517a8e..f26917a4 100644
--- a/src/ui/widgets/InfoBoardWidget.cpp
+++ b/src/ui/widgets/InfoBoardWidget.cpp
@@ -25,7 +25,9 @@
#include "ui/widgets/InfoBoardWidget.h"
InfoBoardWidget::InfoBoardWidget(QWidget *parent, GpgME::GpgContext *ctx, KeyList *keyList) :
- QWidget(parent), mCtx(ctx), mKeyList(keyList) {
+ QWidget(parent), mCtx(ctx), mKeyList(keyList), appPath(qApp->applicationDirPath()),
+ settings(RESOURCE_DIR(appPath) + "/conf/gpgfrontend.ini",
+ QSettings::IniFormat) {
infoBoard = new QTextEdit(this);
infoBoard->setReadOnly(true);
@@ -42,7 +44,7 @@ InfoBoardWidget::InfoBoardWidget(QWidget *parent, GpgME::GpgContext *ctx, KeyLis
detailMenu->addAction(importFromKeyserverAct);
importFromKeyserverAct->setVisible(false);
- QWidget *actionButtonMenu = new QWidget();
+ auto *actionButtonMenu = new QWidget();
actionButtonMenu->setContentsMargins(0, 0, 0, 0);
actionButtonMenu->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Minimum);
actionButtonMenu->setFixedHeight(36);
@@ -52,7 +54,7 @@ InfoBoardWidget::InfoBoardWidget(QWidget *parent, GpgME::GpgContext *ctx, KeyLis
actionButtonLayout->setSpacing(0);
actionButtonMenu->setLayout(actionButtonLayout);
- auto label = new QLabel("Optional Actions Menu");
+ auto label = new QLabel(tr("Optional Actions Menu"));
label->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
label->setContentsMargins(0, 0, 0, 0);
@@ -107,7 +109,8 @@ void InfoBoardWidget::setInfoBoard(const QString &text, InfoBoardStatus verifyLa
QPalette status = infoBoard->palette();
status.setColor(QPalette::Text, color);
infoBoard->setPalette(status);
- infoBoard->setFont(QFont("Times", 10));
+ auto infoBoardFontSize = settings.value("informationBoard/fontSize", 10).toInt();
+ infoBoard->setFont(QFont("Times", infoBoardFontSize));
}
void InfoBoardWidget::slotRefresh(const QString &text, InfoBoardStatus status) {
@@ -135,13 +138,16 @@ void InfoBoardWidget::associateTabWidget(QTabWidget *tab) {
disconnect(mTextPage, SIGNAL(textChanged()), this, SLOT(slotReset()));
// if (mFileTreeView != nullptr)
// disconnect(mFileTreeView, &FilePage::pathChanged, this, &InfoBoardWidget::slotReset);
- if (mTabWidget != nullptr)
+ if (mTabWidget != nullptr) {
disconnect(mTabWidget, SIGNAL(tabBarClicked(int)), this, SLOT(slotReset()));
+ connect(mTabWidget, SIGNAL(tabCloseRequested(int)), this, SLOT(slotReset()));
+ }
mTextPage = nullptr;
mFileTreeView = nullptr;
mTabWidget = tab;
connect(tab, SIGNAL(tabBarClicked(int)), this, SLOT(slotReset()));
+ connect(tab, SIGNAL(tabCloseRequested(int)), this, SLOT(slotReset()));
}
void InfoBoardWidget::addOptionalAction(const QString &name, const std::function<void()> &action) {