diff options
author | saturneric <[email protected]> | 2024-11-17 14:11:32 +0000 |
---|---|---|
committer | saturneric <[email protected]> | 2024-11-17 14:11:32 +0000 |
commit | d6bc631a4fb80c5dabbf898044b46cd2977a49a0 (patch) | |
tree | 2f86bd9b6af3075572fe097b30932f1b59f69948 | |
parent | feat: show current selected key db (diff) | |
download | GpgFrontend-d6bc631a4fb80c5dabbf898044b46cd2977a49a0.tar.gz GpgFrontend-d6bc631a4fb80c5dabbf898044b46cd2977a49a0.zip |
feat: set max key db number to 8
-rw-r--r-- | src/ui/dialog/controller/GnuPGControllerDialog.cpp | 9 | ||||
-rw-r--r-- | ui/KeyList.ui | 24 |
2 files changed, 29 insertions, 4 deletions
diff --git a/src/ui/dialog/controller/GnuPGControllerDialog.cpp b/src/ui/dialog/controller/GnuPGControllerDialog.cpp index b53649c4..f0a162a2 100644 --- a/src/ui/dialog/controller/GnuPGControllerDialog.cpp +++ b/src/ui/dialog/controller/GnuPGControllerDialog.cpp @@ -328,6 +328,15 @@ auto GnuPGControllerDialog::check_custom_gnupg_path(QString path) -> bool { void GnuPGControllerDialog::slot_add_new_key_database() { auto* dialog = new KeyDatabaseEditDialog(this); + + if (buffered_key_db_so_.size() >= 8) { + QMessageBox::critical( + this, tr("Maximum Key Database Limit Reached"), + tr("Currently, GpgFrontend supports a maximum of 8 key databases. " + "Please remove an existing database to add a new one.")); + return; + } + connect(dialog, &KeyDatabaseEditDialog::SignalKeyDatabaseInfoAccepted, this, [this](const QString& name, const QString& path) { auto& key_databases = buffered_key_db_so_; diff --git a/ui/KeyList.ui b/ui/KeyList.ui index 63defdb8..d29bdcb8 100644 --- a/ui/KeyList.ui +++ b/ui/KeyList.ui @@ -49,7 +49,23 @@ <normaloff>:/icons/database.png</normaloff>:/icons/database.png</iconset> </property> <property name="popupMode"> - <enum>QToolButton::InstantPopup</enum> + <enum>QToolButton::ToolButtonPopupMode::InstantPopup</enum> + </property> + </widget> + </item> + <item> + <widget class="QLCDNumber" name="channelLcdNumber"> + <property name="smallDecimalPoint"> + <bool>true</bool> + </property> + <property name="digitCount"> + <number>1</number> + </property> + <property name="mode"> + <enum>QLCDNumber::Mode::Dec</enum> + </property> + <property name="segmentStyle"> + <enum>QLCDNumber::SegmentStyle::Filled</enum> </property> </widget> </item> @@ -122,14 +138,14 @@ <normaloff>:/icons/filter.png</normaloff>:/icons/filter.png</iconset> </property> <property name="popupMode"> - <enum>QToolButton::InstantPopup</enum> + <enum>QToolButton::ToolButtonPopupMode::InstantPopup</enum> </property> </widget> </item> <item> <spacer name="horizontalSpacer"> <property name="orientation"> - <enum>Qt::Horizontal</enum> + <enum>Qt::Orientation::Horizontal</enum> </property> <property name="sizeHint" stdset="0"> <size> @@ -154,7 +170,7 @@ <item> <widget class="QTabWidget" name="keyGroupTab"> <property name="tabShape"> - <enum>QTabWidget::Rounded</enum> + <enum>QTabWidget::TabShape::Rounded</enum> </property> <property name="currentIndex"> <number>0</number> |