Page Menu
Home
GnuPG
Search
Configure Global Search
Log In
Files
F22947848
D597.id1609.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Size
11 KB
Subscribers
None
D597.id1609.diff
View Options
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -21,6 +21,7 @@
userinfo.h
usersdialog.h
util.h
+ welcomewidget.h
clipboardhelper.cpp
configdialog.cpp
filecontent.cpp
@@ -32,6 +33,7 @@
storemodel.cpp
usersdialog.cpp
util.cpp
+ welcomewidget.cpp
../resources.qrc
)
@@ -41,6 +43,7 @@
usersdialog.ui
passworddialog.ui
userswidget.ui
+ welcomewidget.ui
)
target_link_libraries(gpgpass_internal Qt6::Widgets KF6::Prison KF6::IconThemes KF6::I18n KF6::WidgetsAddons
diff --git a/src/clipboardhelper.cpp b/src/clipboardhelper.cpp
--- a/src/clipboardhelper.cpp
+++ b/src/clipboardhelper.cpp
@@ -63,8 +63,6 @@
}
if (cleared) {
m_mainWindow->statusBar()->showMessage(i18n("Clipboard cleared"), 2000);
- } else {
- m_mainWindow->statusBar()->showMessage(i18n("Clipboard not cleared"), 2000);
}
clippedText.clear();
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -11,8 +11,6 @@
*/
#include "mainwindow.h"
-#include <gpgpass_version.h>
-
#include "clipboardhelper.h"
#include "configdialog.h"
#include "filecontent.h"
@@ -253,16 +251,14 @@
}
/**
- * @brief MainWindow::initStatusBar init statusBar with default message and logo
+ * @brief MainWindow::initStatusBar init statusBar
*/
void MainWindow::initStatusBar()
{
- ui->statusBar->showMessage(i18nc("placeholder is version number","Welcome to GnuPG Password Manager %1", QString::fromLocal8Bit(GPGPASS_VERSION_STRING)));
-
- QPixmap logo = QPixmap(QStringLiteral(":/artwork/32-gpgpass.png"));
- QLabel *logoApp = new QLabel(statusBar());
- logoApp->setPixmap(logo);
- statusBar()->addPermanentWidget(logoApp);
+ statusBar()->hide();
+ connect(statusBar(), &QStatusBar::messageChanged, [this](const QString &message) {
+ statusBar()->setVisible(!message.isEmpty());
+ });
}
const QModelIndex MainWindow::getCurrentTreeViewIndex()
@@ -320,10 +316,12 @@
ui->passwordName->setText(index.data().toString());
if (!file.isEmpty() && QFileInfo(file).isFile() && !cleared) {
m_pass->Show(file);
+ ui->stackedWidget->setCurrentIndex(1);
} else {
clearPanel();
ui->actionEdit->setEnabled(false);
ui->actionDelete->setEnabled(true);
+ ui->stackedWidget->setCurrentIndex(0);
}
}
@@ -352,6 +350,7 @@
ui->actionDelete->setEnabled(false);
ui->passwordName->setText(QString{});
clearPanel();
+ ui->stackedWidget->setCurrentIndex(0);
}
void MainWindow::passShowHandler(const QString &p_output)
diff --git a/src/mainwindow.ui b/src/mainwindow.ui
--- a/src/mainwindow.ui
+++ b/src/mainwindow.ui
@@ -90,86 +90,91 @@
</layout>
</item>
<item>
- <layout class="QVBoxLayout" name="verticalLayoutPassword">
- <property name="spacing">
- <number>0</number>
- </property>
- <property name="topMargin">
- <number>7</number>
- </property>
- <item>
- <widget class="KTitleWidget" name="passwordName">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>0</width>
- <height>20</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>10000000</width>
- <height>30</height>
- </size>
- </property>
- <property name="text">
- <string>Welcome to GnuPG Password Manager</string>
- </property>
- </widget>
- </item>
- <item>
- <layout class="QFormLayout" name="contentLayout"/>
- </item>
- <item>
- <widget class="QTextBrowser" name="textBrowser">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>0</width>
- <height>20</height>
- </size>
- </property>
- <property name="autoFillBackground">
- <bool>false</bool>
- </property>
- <property name="styleSheet">
- <string notr="true">background: transparent</string>
- </property>
- <property name="frameShape">
- <enum>QFrame::NoFrame</enum>
- </property>
- <property name="frameShadow">
- <enum>QFrame::Plain</enum>
- </property>
- <property name="lineWidth">
+ <widget class="QStackedWidget" name="stackedWidget">
+ <widget class="WelcomeWidget" />
+ <widget class="QWidget">
+ <layout class="QVBoxLayout" name="verticalLayoutPassword">
+ <property name="spacing">
<number>0</number>
</property>
- <property name="html">
- <string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
+ <property name="topMargin">
+ <number>7</number>
+ </property>
+ <item>
+ <widget class="KTitleWidget" name="passwordName">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>20</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>10000000</width>
+ <height>30</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>Welcome to GnuPG Password Manager</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QFormLayout" name="contentLayout"/>
+ </item>
+ <item>
+ <widget class="QTextBrowser" name="textBrowser">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>20</height>
+ </size>
+ </property>
+ <property name="autoFillBackground">
+ <bool>false</bool>
+ </property>
+ <property name="styleSheet">
+ <string notr="true">background: transparent</string>
+ </property>
+ <property name="frameShape">
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>QFrame::Plain</enum>
+ </property>
+ <property name="lineWidth">
+ <number>0</number>
+ </property>
+ <property name="html">
+ <string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
p, li { white-space: pre-wrap; }
</style></head><body style=" font-family:'Noto Sans'; font-size:10pt; font-weight:400; font-style:normal;">
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p></body></html></string>
- </property>
- <property name="acceptRichText">
- <bool>true</bool>
- </property>
- <property name="openExternalLinks">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- </layout>
+ </property>
+ <property name="acceptRichText">
+ <bool>true</bool>
+ </property>
+ <property name="openExternalLinks">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </widget>
</item>
</layout>
</item>
@@ -269,6 +274,11 @@
<signal>signal1()</signal>
</slots>
</customwidget>
+ <customwidget>
+ <class>WelcomeWidget</class>
+ <extends>QWidget</extends>
+ <header location="global">welcomewidget.h</header>
+ </customwidget>
</customwidgets>
<tabstops>
<tabstop>lineEdit</tabstop>
diff --git a/src/welcomewidget.h b/src/welcomewidget.h
new file mode 100644
--- /dev/null
+++ b/src/welcomewidget.h
@@ -0,0 +1,23 @@
+// SPDX-FileCopyrightText: 2024 g10 Code GmbH
+// SPDX-Contributor: Carl Schwan <carl.schwan@gnupg.com>
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+#pragma once
+
+#include <QLabel>
+
+namespace Ui
+{
+class WelcomeWidget;
+}
+
+class WelcomeWidget : public QWidget
+{
+ Q_OBJECT
+public:
+ WelcomeWidget(QWidget *parent = nullptr);
+ ~WelcomeWidget();
+
+private:
+ QScopedPointer<Ui::WelcomeWidget> ui;
+};
diff --git a/src/welcomewidget.cpp b/src/welcomewidget.cpp
new file mode 100644
--- /dev/null
+++ b/src/welcomewidget.cpp
@@ -0,0 +1,32 @@
+// SPDX-FileCopyrightText: 2024 g10 Code GmbH
+// SPDX-Contributor: Carl Schwan <carl.schwan@gnupg.com>
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+#include "welcomewidget.h"
+#include "ui_welcomewidget.h"
+#include <gpgpass_version.h>
+
+using namespace Qt::Literals::StringLiterals;
+
+WelcomeWidget::WelcomeWidget(QWidget *parent)
+ : QWidget(parent)
+ , ui(new Ui::WelcomeWidget)
+{
+ ui->setupUi(this);
+
+ // center vertically
+ ui->mainLayout->insertStretch(0);
+ ui->mainLayout->addStretch();
+
+ const double titleFontSize = QApplication::font().pointSize() * 2;
+ auto font = ui->title->font();
+ font.setPointSize(titleFontSize);
+ ui->title->setFont(font);
+
+ QPixmap logo = QPixmap(QStringLiteral(":/artwork/64-gpgpass.png"));
+ ui->logo->setPixmap(logo);
+
+ ui->version->setText(i18nc("@info", "Version: %1", QString::fromLocal8Bit(GPGPASS_VERSION_STRING)));
+}
+
+WelcomeWidget::~WelcomeWidget() = default;
diff --git a/src/welcomewidget.ui b/src/welcomewidget.ui
new file mode 100644
--- /dev/null
+++ b/src/welcomewidget.ui
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+<!--
+SPDX-FileCopyrightText: 2024 g10 Code GmbH
+SPDX-Contributor: Carl Schwan <carl.schwan@gnupg.com>
+SPDX-License-Identifier: GPL-2.0-or-later
+-->
+ <class>WelcomeWidget</class>
+ <widget class="QWidget" name="WelcomeWidget">
+ <layout class="QVBoxLayout" name="mainLayout">
+ <item>
+ <widget class="QLabel" name="logo" />
+ </item>
+ <item>
+ <widget class="QLabel" name="title">
+ <property name="text">
+ <string>Welcome to GnuPG Password Manager</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="version" />
+ </item>
+ </layout>
+ </widget>
+</ui>
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, May 9, 8:36 AM (16 h, 23 m)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
8c/05/bc5f2a9c9c5200814e7d9166d535
Attached To
D597: Replace always visible status bar with welcome page
Event Timeline
Log In to Comment