31 #include "core/function/result_analyse/GpgVerifyResultAnalyse.h"
32 #include "core/model/GpgKey.h"
33 #include "core/thread/Task.h"
34 #include "core/typedef/GpgTypedef.h"
37 class GpgResultAnalyse;
38 class GpgImportInformation;
43 class InfoBoardWidget;
46 using OperaWaitingHd = std::function<void()>;
47 using OperaWaitingCb =
const std::function<void(OperaWaitingHd)>;
58 GpgError error,
const GpgVerifyResult& verify_result);
67 QWidget* parent,
const GpgVerifyResultAnalyse& verify_res);
77 const QString& report_text);
87 const GpgResultAnalyse& result_analyse);
98 const GpgResultAnalyse& result_analyse_a,
99 const GpgResultAnalyse& result_analyse_b);
109 Thread::Task::TaskRunnable func,
110 Thread::Task::TaskCallback callback =
nullptr,
111 DataObjectPtr data_object =
nullptr);
124 using ImportCallbackFunctiopn =
125 std::function<void(
const QString&,
const QString&,
size_t,
size_t)>;
145 static void WaitForOpera(QWidget* parent,
const QString&,
146 const OperaWaitingCb&);
166 bool isApplicationNeedRestart();
172 bool KeyExistsinFavouriteList(
const GpgKey& key);
178 void AddKey2Favourtie(
const GpgKey& key);
184 void RemoveKeyFromFavourite(
const GpgKey& key);
190 void ImportKeyFromKeyServer(
const KeyIdArgsList&);
197 void SignalKeyStatusUpdated();
203 void SignalBadGnupgEnv(QString);
215 void SignalRestartApplication(
int);
255 const GpgFrontend::KeyIdArgsList& key_ids,
256 const GpgFrontend::UI::CommonUtils::ImportCallbackFunctiopn& callback);
265 const QStringList& arguments,
266 const std::function<
void(QProcess*)>& interact_func);
275 const std::function<
void(QProcess*)>& interact_func);
281 void SlotRestartApplication(
int);
295 void slot_update_key_from_server_finished(
296 bool, QString, QByteArray, std::shared_ptr<GpgImportInformation>);
299 static std::unique_ptr<CommonUtils> instance_;
300 bool application_need_to_restart_at_once_ =
false;
Definition: UserInterfaceUtils.h:117
void SlotImportKeyFromFile(QWidget *parent)
Definition: UserInterfaceUtils.cpp:277
void SlotImportKeyFromClipboard(QWidget *parent)
Definition: UserInterfaceUtils.cpp:313
void SignalKeyDatabaseRefreshDone()
emit when the key database is refreshed
static void RaiseMessageBox(QWidget *parent, GpgError err)
Definition: UserInterfaceUtils.cpp:245
void SlotExecuteCommand(const QString &cmd, const QStringList &arguments, const std::function< void(QProcess *)> &interact_func)
Definition: UserInterfaceUtils.cpp:318
static void RaiseFailureMessageBox(QWidget *parent, GpgError err)
Definition: UserInterfaceUtils.cpp:257
static CommonUtils * GetInstance()
Get the Instance object.
Definition: UserInterfaceUtils.cpp:149
CommonUtils()
Construct a new Common Utils object.
Definition: UserInterfaceUtils.cpp:156
void slot_update_key_status()
update the key status when signal is emitted
Definition: UserInterfaceUtils.cpp:474
static void WaitForOpera(QWidget *parent, const QString &, const OperaWaitingCb &)
Definition: UserInterfaceUtils.cpp:221
void SlotImportKeys(QWidget *parent, const QString &in_buffer)
Definition: UserInterfaceUtils.cpp:269
void SlotImportKeyFromKeyServer(QWidget *parent)
Definition: UserInterfaceUtils.cpp:308
void SlotExecuteGpgCommand(const QStringList &arguments, const std::function< void(QProcess *)> &interact_func)
Definition: UserInterfaceUtils.cpp:350
Definition: FileReadTask.cpp:31
void process_operation(QWidget *parent, const QString &waiting_title, const Thread::Task::TaskRunnable func, const Thread::Task::TaskCallback callback, DataObjectPtr data_object)
Definition: UserInterfaceUtils.cpp:120
void show_verify_details(QWidget *parent, InfoBoardWidget *info_board, GpgError error, const GpgVerifyResult &verify_result)
Definition: UserInterfaceUtils.cpp:58
void import_unknown_key_from_keyserver(QWidget *parent, const GpgVerifyResultAnalyse &verify_res)
Definition: UserInterfaceUtils.cpp:67
void process_result_analyse(TextEdit *edit, InfoBoardWidget *info_board, const GpgResultAnalyse &result_analyse)
Definition: UserInterfaceUtils.cpp:102
void refresh_info_board(InfoBoardWidget *info_board, int status, const QString &report_text)
Definition: UserInterfaceUtils.cpp:91
gpgme_error_t GpgError
gpgme error
Definition: GpgTypedef.h:42