aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui/widgets
diff options
context:
space:
mode:
authorsaturneric <[email protected]>2025-04-17 15:28:04 +0000
committersaturneric <[email protected]>2025-04-17 15:28:04 +0000
commite276f9e86b161362d6f379ab790476936a0e6208 (patch)
tree65c27e3efcbf113a052bc053e1c2739f4a351217 /src/ui/widgets
parentfix: compiler issues on CI (diff)
downloadGpgFrontend-e276f9e86b161362d6f379ab790476936a0e6208.tar.gz
GpgFrontend-e276f9e86b161362d6f379ab790476936a0e6208.zip
feat: generate cark keys
Diffstat (limited to 'src/ui/widgets')
-rw-r--r--src/ui/widgets/FilePage.h2
-rw-r--r--src/ui/widgets/InfoBoardWidget.h2
-rw-r--r--src/ui/widgets/KeyList.h2
-rw-r--r--src/ui/widgets/KeyTreeView.cpp9
-rw-r--r--src/ui/widgets/KeyTreeView.h8
-rw-r--r--src/ui/widgets/PlainTextEditorPage.h2
6 files changed, 17 insertions, 8 deletions
diff --git a/src/ui/widgets/FilePage.h b/src/ui/widgets/FilePage.h
index 7c90b62f..fbf99ae9 100644
--- a/src/ui/widgets/FilePage.h
+++ b/src/ui/widgets/FilePage.h
@@ -119,7 +119,7 @@ class FilePage : public QWidget {
void keyPressEvent(QKeyEvent* event) override;
private:
- std::shared_ptr<Ui_FilePage> ui_; ///<
+ QSharedPointer<Ui_FilePage> ui_; ///<
QCompleter* path_edit_completer_; ///<
QStringListModel* path_complete_model_; ///<
diff --git a/src/ui/widgets/InfoBoardWidget.h b/src/ui/widgets/InfoBoardWidget.h
index c0416e2d..8fbd836a 100644
--- a/src/ui/widgets/InfoBoardWidget.h
+++ b/src/ui/widgets/InfoBoardWidget.h
@@ -122,7 +122,7 @@ class InfoBoardWidget : public QWidget {
void slot_save();
private:
- std::shared_ptr<Ui_InfoBoard> ui_; ///<
+ QSharedPointer<Ui_InfoBoard> ui_; ///<
QTextEdit* m_text_page_{
nullptr}; ///< TextEdit associated to the notification
diff --git a/src/ui/widgets/KeyList.h b/src/ui/widgets/KeyList.h
index bb48c63b..b2bd8928 100644
--- a/src/ui/widgets/KeyList.h
+++ b/src/ui/widgets/KeyList.h
@@ -318,7 +318,7 @@ class KeyList : public QWidget {
void slot_new_key_group();
private:
- std::shared_ptr<Ui_KeyList> ui_; ///<
+ QSharedPointer<Ui_KeyList> ui_; ///<
std::function<void(const GpgKey&, QWidget*)> m_action_ = nullptr; ///<
int current_gpg_context_channel_;
KeyMenuAbility menu_ability_ = KeyMenuAbility::kALL; ///<
diff --git a/src/ui/widgets/KeyTreeView.cpp b/src/ui/widgets/KeyTreeView.cpp
index a6fb23bf..2d4d8d8c 100644
--- a/src/ui/widgets/KeyTreeView.cpp
+++ b/src/ui/widgets/KeyTreeView.cpp
@@ -116,7 +116,7 @@ void KeyTreeView::init() {
});
connect(UISignalStation::GetInstance(),
- &UISignalStation::SignalKeyDatabaseRefresh, this, [=] {
+ &UISignalStation::SignalKeyDatabaseRefreshDone, this, [=] {
model_ = QSharedPointer<GpgKeyTreeModel>::create(
channel_, GpgAbstractKeyGetter::GetInstance(channel_).Fetch(),
[](auto) { return false; }, this);
@@ -143,11 +143,14 @@ void KeyTreeView::SetChannel(int channel) {
}
auto KeyTreeView::GetKeyByIndex(QModelIndex index) -> GpgAbstractKeyPtr {
- auto* i = index.isValid()
- ? static_cast<GpgKeyTreeItem*>(index.internalPointer())
+ auto s_index = proxy_model_.mapToSource(index);
+ auto* i = s_index.isValid()
+ ? static_cast<GpgKeyTreeItem*>(s_index.internalPointer())
: nullptr;
assert(i != nullptr);
return i->SharedKey();
}
+
+void KeyTreeView::Refresh() { SetChannel(channel_); }
} // namespace GpgFrontend::UI
diff --git a/src/ui/widgets/KeyTreeView.h b/src/ui/widgets/KeyTreeView.h
index af903273..b5a07f29 100644
--- a/src/ui/widgets/KeyTreeView.h
+++ b/src/ui/widgets/KeyTreeView.h
@@ -69,7 +69,7 @@ class KeyTreeView : public QTreeView {
* @param index
* @return GpgAbstractKeyPtr
*/
- static auto GetKeyByIndex(QModelIndex index) -> GpgAbstractKeyPtr;
+ auto GetKeyByIndex(QModelIndex index) -> GpgAbstractKeyPtr;
/**
* @brief Get the All Checked Key Ids object
@@ -99,6 +99,12 @@ class KeyTreeView : public QTreeView {
*/
void SetChannel(int channel);
+ /**
+ * @brief
+ *
+ */
+ void Refresh();
+
protected:
/**
* @brief
diff --git a/src/ui/widgets/PlainTextEditorPage.h b/src/ui/widgets/PlainTextEditorPage.h
index 86ec0a56..8c4f9b12 100644
--- a/src/ui/widgets/PlainTextEditorPage.h
+++ b/src/ui/widgets/PlainTextEditorPage.h
@@ -116,7 +116,7 @@ class PlainTextEditorPage : public QWidget {
void SignalUIBytesDisplayed();
protected:
- std::shared_ptr<Ui_PlainTextEditor> ui_; ///<
+ QSharedPointer<Ui_PlainTextEditor> ui_; ///<
private:
QString full_file_path_; ///< The path to the file handled in the tab