29 #ifndef GPGFRONTEND_USER_INTERFACE_UTILS_H
30 #define GPGFRONTEND_USER_INTERFACE_UTILS_H
32 #include "core/GpgModel.h"
33 #include "core/function/result_analyse/GpgVerifyResultAnalyse.h"
34 #include "core/model/GpgKey.h"
35 #include "ui/GpgFrontendUI.h"
38 class GpgResultAnalyse;
43 class InfoBoardWidget;
55 GpgError error,
const GpgVerifyResult& verify_result);
64 QWidget* parent,
const GpgVerifyResultAnalyse& verify_res);
74 const std::string& report_text);
84 const GpgResultAnalyse& result_analyse);
95 const GpgResultAnalyse& result_analyse_a,
96 const GpgResultAnalyse& result_analyse_b);
106 QWidget* parent,
const std::string& waiting_title,
107 GpgFrontend::Thread::Task::TaskRunnable func,
108 GpgFrontend::Thread::Task::TaskCallback callback =
nullptr,
109 Thread::Task::DataObjectPtr data_object =
nullptr);
119 const std::string& key_server);
132 using ImportCallbackFunctiopn = std::function<void(
133 const std::string&,
const std::string&,
size_t,
size_t)>;
152 bool isApplicationNeedRestart();
158 bool KeyExistsinFavouriteList(
const GpgKey& key);
164 void AddKey2Favourtie(
const GpgKey& key);
170 void RemoveKeyFromFavourite(
const GpgKey& key);
177 void SignalKeyStatusUpdated();
183 void SignalGnupgNotInstall();
195 void SignalNeedUserInputPassphrase();
201 void SignalUserInputPassphraseDone(QString passphrase);
207 void SignalRestartApplication(
int);
216 void SlotImportKeys(QWidget* parent,
const std::string& in_buffer);
247 const GpgFrontend::KeyIdArgsList& key_ids,
248 const GpgFrontend::UI::CommonUtils::ImportCallbackFunctiopn& callback);
257 const QStringList& arguments,
258 const std::function<
void(QProcess*)>& interact_func);
267 const std::function<
void(QProcess*)>& interact_func);
273 void SlotRestartApplication(
int);
287 void slot_popup_passphrase_input_dialog();
290 static std::unique_ptr<CommonUtils> instance_;
291 bool application_need_to_restart_at_once_ =
false;
Definition: UserInterfaceUtils.h:125
void SlotImportKeyFromFile(QWidget *parent)
Definition: UserInterfaceUtils.cpp:231
void SlotImportKeyFromClipboard(QWidget *parent)
Definition: UserInterfaceUtils.cpp:252
void SignalKeyDatabaseRefreshDone()
emit when the key database is refreshed
void SlotImportKeys(QWidget *parent, const std::string &in_buffer)
Definition: UserInterfaceUtils.cpp:223
CommonUtils()
Construct a new Common Utils object.
Definition: UserInterfaceUtils.cpp:156
void SlotExecuteCommand(const std::string &cmd, const QStringList &arguments, const std::function< void(QProcess *)> &interact_func)
Definition: UserInterfaceUtils.cpp:258
void slot_update_key_status()
update the key status when signal is emitted
Definition: UserInterfaceUtils.cpp:435
static CommonUtils * GetInstance()
Get the Instance object.
Definition: UserInterfaceUtils.cpp:149
void SlotImportKeyFromKeyServer(QWidget *parent)
Definition: UserInterfaceUtils.cpp:247
void SlotExecuteGpgCommand(const QStringList &arguments, const std::function< void(QProcess *)> &interact_func)
Definition: UserInterfaceUtils.cpp:290
Definition: FileReadTask.cpp:29
void refresh_info_board(InfoBoardWidget *info_board, int status, const std::string &report_text)
Definition: UserInterfaceUtils.cpp:89
void process_operation(QWidget *parent, const std::string &waiting_title, const Thread::Task::TaskRunnable func, const Thread::Task::TaskCallback callback, Thread::Task::DataObjectPtr data_object)
Definition: UserInterfaceUtils.cpp:119
void show_verify_details(QWidget *parent, InfoBoardWidget *info_board, GpgError error, const GpgVerifyResult &verify_result)
Definition: UserInterfaceUtils.cpp:57
void import_unknown_key_from_keyserver(QWidget *parent, const GpgVerifyResultAnalyse &verify_res)
Definition: UserInterfaceUtils.cpp:66
void import_key_from_keyserver(QWidget *parent, const std::string &key_id, const std::string &key_server)
void process_result_analyse(TextEdit *edit, InfoBoardWidget *info_board, const GpgResultAnalyse &result_analyse)
Definition: UserInterfaceUtils.cpp:101
Definition: CoreCommonUtil.cpp:31