GpgFrontend Project
A Free, Powerful, Easy-to-Use, Compact, Cross-Platform, and Installation-Free OpenPGP(pgp) Crypto Tool.
GpgFrontend::UI::CommonUtils Class Reference
Inheritance diagram for GpgFrontend::UI::CommonUtils:
Inheritance graph
Collaboration diagram for GpgFrontend::UI::CommonUtils:
Collaboration graph

Public Types

using ImportCallbackFunctiopn = std::function< void(const QString &, const QString &, size_t, size_t)>
 

Public Slots

void SlotImportKeys (QWidget *parent, const QString &in_buffer)
 
void SlotImportKeyFromFile (QWidget *parent)
 
void SlotImportKeyFromKeyServer (QWidget *parent)
 
void SlotImportKeyFromClipboard (QWidget *parent)
 
static void SlotImportKeyFromKeyServer (const GpgFrontend::KeyIdArgsList &key_ids, const GpgFrontend::UI::CommonUtils::ImportCallbackFunctiopn &callback)
 
void SlotExecuteGpgCommand (const QStringList &arguments, const std::function< void(QProcess *)> &interact_func)
 
void SlotExecuteCommand (const QString &cmd, const QStringList &arguments, const std::function< void(QProcess *)> &interact_func)
 
void SlotRestartApplication (int)
 

Signals

void SignalKeyStatusUpdated ()
 
void SignalBadGnupgEnv (QString)
 
void SignalKeyDatabaseRefreshDone ()
 emit when the key database is refreshed
 
void SignalRestartApplication (int)
 

Public Member Functions

 CommonUtils ()
 Construct a new Common Utils object.
 
bool isApplicationNeedRestart ()
 
bool KeyExistsinFavouriteList (const GpgKey &key)
 
void AddKey2Favourtie (const GpgKey &key)
 
void RemoveKeyFromFavourite (const GpgKey &key)
 
void ImportKeyFromKeyServer (const KeyIdArgsList &)
 

Static Public Member Functions

static CommonUtilsGetInstance ()
 Get the Instance object. More...
 
static void WaitForOpera (QWidget *parent, const QString &, const OperaWaitingCb &)
 
static void RaiseMessageBox (QWidget *parent, GpgError err)
 
static void RaiseFailureMessageBox (QWidget *parent, GpgError err)
 

Private Slots

void slot_update_key_status ()
 update the key status when signal is emitted
 
void slot_update_key_from_server_finished (bool, QString, QByteArray, std::shared_ptr< GpgImportInformation >)
 

Private Attributes

bool application_need_to_restart_at_once_ = false
 

Static Private Attributes

static std::unique_ptr< CommonUtilsinstance_ = nullptr
 

Member Function Documentation

◆ GetInstance()

◆ RaiseFailureMessageBox()

void GpgFrontend::UI::CommonUtils::RaiseFailureMessageBox ( QWidget *  parent,
GpgError  err 
)
static

◆ RaiseMessageBox()

◆ SlotExecuteCommand

void GpgFrontend::UI::CommonUtils::SlotExecuteCommand ( const QString &  cmd,
const QStringList &  arguments,
const std::function< void(QProcess *)> &  interact_func 
)
slot
Parameters
arguments
interact_func

◆ SlotExecuteGpgCommand

void GpgFrontend::UI::CommonUtils::SlotExecuteGpgCommand ( const QStringList &  arguments,
const std::function< void(QProcess *)> &  interact_func 
)
slot
Parameters
arguments
interact_func

◆ SlotImportKeyFromClipboard

void GpgFrontend::UI::CommonUtils::SlotImportKeyFromClipboard ( QWidget *  parent)
slot
Parameters
parent

References SlotImportKeys().

Referenced by GpgFrontend::UI::KeyMgmt::create_actions().

◆ SlotImportKeyFromFile

void GpgFrontend::UI::CommonUtils::SlotImportKeyFromFile ( QWidget *  parent)
slot
Parameters
parent

References GpgFrontend::ReadFile(), and SlotImportKeys().

Referenced by GpgFrontend::UI::KeyMgmt::create_actions().

◆ SlotImportKeyFromKeyServer [1/2]

void GpgFrontend::UI::CommonUtils::SlotImportKeyFromKeyServer ( const GpgFrontend::KeyIdArgsList &  key_ids,
const GpgFrontend::UI::CommonUtils::ImportCallbackFunctiopn &  callback 
)
staticslot

◆ SlotImportKeyFromKeyServer [2/2]

void GpgFrontend::UI::CommonUtils::SlotImportKeyFromKeyServer ( QWidget *  parent)
slot
Parameters
parent

Referenced by GpgFrontend::UI::KeyMgmt::create_actions().

◆ SlotImportKeys

void GpgFrontend::UI::CommonUtils::SlotImportKeys ( QWidget *  parent,
const QString &  in_buffer 
)
slot

◆ WaitForOpera()


The documentation for this class was generated from the following files: