fix: gnupg info not loading

This commit is contained in:
saturneric 2024-12-01 22:14:06 +01:00
parent 2dc2f2e048
commit fcc31759f8
5 changed files with 94 additions and 34 deletions

View File

@ -23,7 +23,7 @@
#
# SPDX-License-Identifier: GPL-3.0-or-later
# com.bktus.gpgfrontend.module.integrated.gnupg_info_gathering
# com.bktus.gpgfrontend.module.integrated.email
set(INTEGRATED_MODULE_SOURCE "")
aux_source_directory(. INTEGRATED_MODULE_SOURCE)

View File

@ -14,6 +14,18 @@
<string>GnuPG Info</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item row="0" column="0">
<layout class="QVBoxLayout" name="verticalLayout" stretch="0,0,0,0">
<property name="spacing">
@ -43,10 +55,10 @@
<string/>
</property>
<property name="pixmap">
<pixmap resource="../gpgfrontend.qrc">:/icons/gnupg.png</pixmap>
<pixmap>:/icons/gnupg.png</pixmap>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
<set>Qt::AlignmentFlag::AlignCenter</set>
</property>
<property name="margin">
<number>10</number>
@ -59,7 +71,7 @@
<string>Version</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
<set>Qt::AlignmentFlag::AlignCenter</set>
</property>
<property name="margin">
<number>5</number>
@ -75,49 +87,60 @@
</sizepolicy>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
<enum>Qt::Orientation::Horizontal</enum>
</property>
</widget>
</item>
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="tabPosition">
<enum>QTabWidget::TabPosition::South</enum>
</property>
<property name="tabShape">
<enum>QTabWidget::Rounded</enum>
<enum>QTabWidget::TabShape::Triangular</enum>
</property>
<property name="currentIndex">
<number>0</number>
</property>
<property name="tabBarAutoHide">
<property name="elideMode">
<enum>Qt::TextElideMode::ElideMiddle</enum>
</property>
<property name="documentMode">
<bool>true</bool>
</property>
<property name="tabsClosable">
<bool>false</bool>
</property>
<property name="tabBarAutoHide">
<bool>true</bool>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
<string>Components</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_3">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QTableWidget" name="componentDetailsTable">
<property name="sizeAdjustPolicy">
<enum>QAbstractScrollArea::AdjustToContents</enum>
<enum>QAbstractScrollArea::SizeAdjustPolicy::AdjustIgnored</enum>
</property>
<property name="autoScrollMargin">
<number>16</number>
</property>
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QProgressBar" name="loadProgressBar">
<property name="maximum">
<number>0</number>
</property>
<property name="value">
<number>-1</number>
</property>
<property name="textVisible">
<bool>false</bool>
<set>QAbstractItemView::EditTrigger::NoEditTriggers</set>
</property>
</widget>
</item>
@ -128,13 +151,25 @@
<string>Directories</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_2">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QTableWidget" name="directoriesDetailsTable">
<property name="sizeAdjustPolicy">
<enum>QAbstractScrollArea::AdjustToContents</enum>
<enum>QAbstractScrollArea::SizeAdjustPolicy::AdjustIgnored</enum>
</property>
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
<set>QAbstractItemView::EditTrigger::NoEditTriggers</set>
</property>
</widget>
</item>
@ -145,6 +180,18 @@
<string>Options</string>
</attribute>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QTableWidget" name="optionDetailsTable"/>
</item>
@ -154,6 +201,19 @@
</item>
</layout>
</item>
<item row="1" column="0">
<widget class="QProgressBar" name="loadProgressBar">
<property name="maximum">
<number>0</number>
</property>
<property name="value">
<number>-1</number>
</property>
<property name="textVisible">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</widget>
<resources>

View File

@ -47,7 +47,7 @@
#include "GpgInfo.h"
GF_MODULE_API_DEFINE("com.bktus.gpgfrontend.module.gnupg_info_gathering",
"GatherGnupgInfo", "1.0.1",
"GatherGnupgInfo", "1.1.0",
"Try gathering gnupg information.", "Saturneric")
DEFINE_TRANSLATIONS_STRUCTURE(ModuleGnuPGInfoGathering);

View File

@ -108,14 +108,14 @@ GnupgTab::GnupgTab(QWidget* parent)
ui_->optionDetailsTable->setFocusPolicy(Qt::NoFocus);
ui_->optionDetailsTable->setAlternatingRowColors(true);
auto future = (QThreadPool::globalInstance(), [=]() {
if (GFModuleRetrieveRTValueOrDefaultBool(
DUP("ui"), DUP("env.state.gnupg_info_gathering"), 0) == 1) {
process_software_info();
} else {
gather_gnupg_info();
}
});
if (GFModuleRetrieveRTValueOrDefaultBool(
DUP("ui"), DUP("env.state.gnupg_info_gathering"), 0) == 1) {
process_software_info();
} else {
auto future = QtConcurrent::run(QThreadPool::globalInstance(),
[=]() { gather_gnupg_info(); });
}
}
void GnupgTab::process_software_info() {

View File

@ -23,7 +23,7 @@
#
# SPDX-License-Identifier: GPL-3.0-or-later
# com.bktus.gpgfrontend.module.integrated.gnupg_info_gathering
# com.bktus.gpgfrontend.module.integrated.paper_key
set(INTEGRATED_MODULE_SOURCE "")
aux_source_directory(. INTEGRATED_MODULE_SOURCE)