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 # 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 "") set(INTEGRATED_MODULE_SOURCE "")
aux_source_directory(. INTEGRATED_MODULE_SOURCE) aux_source_directory(. INTEGRATED_MODULE_SOURCE)

View File

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

View File

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

View File

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

View File

@ -23,7 +23,7 @@
# #
# SPDX-License-Identifier: GPL-3.0-or-later # 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 "") set(INTEGRATED_MODULE_SOURCE "")
aux_source_directory(. INTEGRATED_MODULE_SOURCE) aux_source_directory(. INTEGRATED_MODULE_SOURCE)