GpgFrontend::UI::CommonUtils Class Reference
Inheritance diagram for GpgFrontend::UI::CommonUtils:
Collaboration diagram for GpgFrontend::UI::CommonUtils:

## Public Types

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

## Public Slots

void | SlotImportKeys (QWidget *parent, const std::string &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)

## Signals

void | SignalKeyStatusUpdated ()
void | SignalGnupgNotInstall ()
void | SignalKeyDatabaseRefreshDone ()
| emit when the key database is refreshed More...

## Public Member Functions

| CommonUtils ()
| Construct a new Common Utils object. More...

## Static Public Member Functions

static CommonUtils * | GetInstance ()
| Get the Instance object. More...

## Private Slots

void | slot_update_key_status ()
| update the key status when signal is emitted More...

## Static Private Attributes

static std::unique_ptr< CommonUtils > | instance_ = nullptr

## Constructor & Destructor Documentation

## CommonUtils()

GpgFrontend::UI::CommonUtils::CommonUtils | ( |  | ) |

Construct a new Common Utils object.

References GpgFrontend::CoreCommonUtil::GetInstance(), GpgFrontend::UI::SignalStation::GetInstance(), SignalKeyDatabaseRefreshDone(), and slot_update_key_status().

## Member Function Documentation

## GetInstance()

CommonUtils * GpgFrontend::UI::CommonUtils::GetInstance | ( |  | ) |

static

Get the Instance object.

Returns
  CommonUtils*

Referenced by GpgFrontend::UI::KeyMgmt::create_actions(), GpgFrontend::UI::MainWindow::create_actions(), GpgFrontend::UI::InitGpgFrontendUI(), and GpgFrontend::UI::MainWindow::slot_import_key_from_edit().

## SignalKeyDatabaseRefreshDone

void GpgFrontend::UI::CommonUtils::SignalKeyDatabaseRefreshDone | ( |  | ) |

signal

emit when the key database is refreshed

Referenced by CommonUtils(), and slot_update_key_status().

## slot_update_key_status

void GpgFrontend::UI::CommonUtils::slot_update_key_status | ( |  | ) |

privateslot

update the key status when signal is emitted

References GpgFrontend::GpgKeyGetter::FlushKeyCache(), GpgFrontend::SingletonFunctionObject< GpgKeyGetter >::GetAllChannelId(), GpgFrontend::SingletonFunctionObject< GpgKeyGetter >::GetInstance(), GpgFrontend::SingletonFunctionObject< TaskRunnerGetter >::GetInstance(), and SignalKeyDatabaseRefreshDone().

Referenced by CommonUtils().

## SlotExecuteGpgCommand

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

slot

Parameters

  arguments |
  interact_func |

References GpgFrontend::GpgInfo::AppPath, GpgFrontend::GpgContext::GetInfo(), and GpgFrontend::SingletonFunctionObject< GpgContext >::GetInstance().

## SlotImportKeyFromClipboard

void GpgFrontend::UI::CommonUtils::SlotImportKeyFromClipboard | ( | QWidget * | parent | ) |

slot

Parameters

  parent |

References SlotImportKeys().

Referenced by GpgFrontend::UI::KeyMgmt::create_actions(), and GpgFrontend::UI::MainWindow::create_actions().

## SlotImportKeyFromFile

void GpgFrontend::UI::CommonUtils::SlotImportKeyFromFile | ( | QWidget * | parent | ) |

slot

Parameters

  parent |

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

Referenced by GpgFrontend::UI::KeyMgmt::create_actions(), and GpgFrontend::UI::MainWindow::create_actions().

## SlotImportKeyFromKeyServer [1/2]

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

staticslot

Parameters

  ctx_channel |
  key_ids |
  callback |

References GpgFrontend::UI::SettingsObject::Check(), GpgFrontend::SingletonFunctionObject< GpgKeyImportExporter >::GetInstance(), GpgFrontend::SingletonFunctionObject< GlobalSettingStation >::GetInstance(), GpgFrontend::GlobalSettingStation::GetUISettings(), and GpgFrontend::GpgKeyImportExporter::ImportKey().

## SlotImportKeyFromKeyServer [2/2]

void GpgFrontend::UI::CommonUtils::SlotImportKeyFromKeyServer | ( | QWidget * | parent | ) |

slot

Parameters

  parent |

Referenced by GpgFrontend::UI::KeyMgmt::create_actions(), and GpgFrontend::UI::MainWindow::create_actions().

## SlotImportKeys

void GpgFrontend::UI::CommonUtils::SlotImportKeys | ( | QWidget * | parent,
|  | const std::string & | in_buffer
| ) |  |

slot

Parameters

  parent |
  in_buffer |

References GpgFrontend::SingletonFunctionObject< GpgKeyImportExporter >::GetInstance(), and GpgFrontend::GpgKeyImportExporter::ImportKey().

Referenced by GpgFrontend::UI::MainWindow::slot_import_key_from_edit(), SlotImportKeyFromClipboard(), and SlotImportKeyFromFile().

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

- src/ui/UserInterfaceUtils.h
- src/ui/UserInterfaceUtils.cpp