GpgFrontend Project A Free, Powerful, Easy-to-Use, Compact, Cross-Platform, and Installation-Free OpenPGP(pgp) Crypto Tool.

Public Member Functions | Private Member Functions | Private Attributes | List of all members
GpgFrontend::GlobalSettingStation Class Reference
Inheritance diagram for GpgFrontend::GlobalSettingStation:
Collaboration diagram for GpgFrontend::GlobalSettingStation:

## Public Member Functions
| GlobalSettingStation (int channel=SingletonFunctionObject::GetDefaultChannel()) noexcept
| Construct a new Global Setting Station object.
| ~GlobalSettingStation () noexcept override
| Destroy the Global Setting Station object.
libconfig::Setting & | GetUISettings () noexcept
template<typename T >
T | LookupSettings (std::string path, T default_value) noexcept
std::filesystem::path | GetAppDir () const
| Get the App Dir object. More...
std::filesystem::path | GetAppDataPath () const
std::filesystem::path | GetLogDir () const
| Get the Log Dir object. More...
std::filesystem::path | GetStandaloneDatabaseDir () const
| Get the Standalone Database Dir object. More...
std::filesystem::path | GetAppConfigPath () const
std::filesystem::path | GetStandaloneGpgBinDir () const
| Get the Standalone Gpg Bin Dir object. More...
std::filesystem::path | GetLocaleDir () const
| Get the Locale Dir object. More...
std::filesystem::path | GetResourceDir () const
| Get the Resource Dir object. More...
std::filesystem::path | GetCertsDir () const
| Get the Certs Dir object. More...
std::string | GetLogFilesSize () const
std::string | GetDataObjectsFilesSize () const
void | ClearAllLogFiles () const
void | ClearAllDataObjects () const
void | SyncSettings () noexcept
| sync the settings to the file More...
Public Member Functions inherited from GpgFrontend::SingletonFunctionObject< GlobalSettingStation >
| SingletonFunctionObject (const SingletonFunctionObject< GlobalSettingStation > &)=delete
| prohibit copy
| SingletonFunctionObject (GlobalSettingStation &&)=delete
| Construct a new Singleton Function Object object.
| SingletonFunctionObject (const GlobalSettingStation &)=delete
| Construct a new Singleton Function Object object.
SingletonFunctionObject & | operator= (const SingletonFunctionObject< GlobalSettingStation > &)=delete
| prohibit copy More...
void | operator= (const GlobalSettingStation &)=delete
int | GetChannel () const
| Get the Channel object. More...
Public Member Functions inherited from GpgFrontend::ChannelObject
| ChannelObject () noexcept
| Construct a new Default Channel Object object.
| ChannelObject (int channel)
| Construct a new Channel Object object. More...
int | GetChannel () const
| Get the Channel object. More...
void | SetChannel (int channel)
| Set the Channel object. More...

## Private Member Functions
void | init_app_secure_key ()
int64_t | get_files_size_at_path (std::filesystem::path path, std::string filename_pattern) const
std::string | get_human_readable_size (int64_t size) const
void | delete_all_files (std::filesystem::path path, std::string filename_pattern) const

## Private Attributes
std::filesystem::path | app_path_
| Program Location. More...
std::filesystem::path | app_data_path_
| Program Data Location. More...
std::filesystem::path | app_log_path_
| Program Data Location. More...
std::filesystem::path | app_data_objs_path_
| Object storage path. More...
std::filesystem::path | app_resource_path_
| Program Data Location. More...
std::filesystem::path | app_locale_path_
| Program Data Location. More...
std::filesystem::path | app_configure_path_
| Program Configure Location. More...
std::filesystem::path | ui_config_dir_path_
| Configure File Directory Location. More...
std::filesystem::path | ui_config_path_
| Main Configure File Location. More...
libconfig::Config | ui_cfg_
| UI Configure File.

## Additional Inherited Members
Static Public Member Functions inherited from GpgFrontend::SingletonFunctionObject< GlobalSettingStation >
static GlobalSettingStation & | GetInstance (int channel=GpgFrontend::GPGFRONTEND_DEFAULT_CHANNEL)
| Get the Instance object. More...
static GlobalSettingStation & | CreateInstance (int channel, std::function< std::unique_ptr< ChannelObject >(void)> factory)
| Create a Instance object. More...
static void | ReleaseChannel (int channel)
static int | GetDefaultChannel ()
| Get the Default Channel object. More...
static std::vector< int > | GetAllChannelId ()
| Get all the channel ids. More...
Static Public Member Functions inherited from GpgFrontend::ChannelObject
static int | GetDefaultChannel ()
| Get the Default Channel object. More...
Protected Member Functions inherited from GpgFrontend::SingletonFunctionObject< GlobalSettingStation >
| SingletonFunctionObject ()=default
| Construct a new Singleton Function Object object.
| SingletonFunctionObject (int channel)
| Construct a new Singleton Function Object object. More...
virtual | ~SingletonFunctionObject ()=default
| Destroy the Singleton Function Object object.

## Member Function Documentation

## ◆ GetAppDir()

std::filesystem::path GpgFrontend::GlobalSettingStation::GetAppDir | ( |  | ) | const
| inline

Get the App Dir object.

Returns
  std::filesystem::path

## ◆ GetCertsDir()

std::filesystem::path GpgFrontend::GlobalSettingStation::GetCertsDir | ( |  | ) | const
| inline

Get the Certs Dir object.

Returns
  std::filesystem::path

## ◆ GetLocaleDir()

std::filesystem::path GpgFrontend::GlobalSettingStation::GetLocaleDir | ( |  | ) | const
| inline

Get the Locale Dir object.

Returns
  std::filesystem::path

Referenced by GpgFrontend::UI::SettingsDialog::ListLanguages().

## ◆ GetLogDir()

std::filesystem::path GpgFrontend::GlobalSettingStation::GetLogDir | ( |  | ) | const
| inline

Get the Log Dir object.

Returns
  std::filesystem::path

Referenced by GpgFrontend::InitCoreLoggingSystem().

## ◆ GetResourceDir()

std::filesystem::path GpgFrontend::GlobalSettingStation::GetResourceDir | ( |  | ) | const
| inline

Get the Resource Dir object.

Returns
  std::filesystem::path

Referenced by GpgFrontend::UI::InitGpgFrontendUI(), and GpgFrontend::UI::TranslatorsTab::TranslatorsTab().

## ◆ GetStandaloneDatabaseDir()

std::filesystem::path GpgFrontend::GlobalSettingStation::GetStandaloneDatabaseDir | ( |  | ) | const
| inline

Get the Standalone Database Dir object.

Returns
  std::filesystem::path

## ◆ GetStandaloneGpgBinDir()

std::filesystem::path GpgFrontend::GlobalSettingStation::GetStandaloneGpgBinDir | ( |  | ) | const
| inline

Get the Standalone Gpg Bin Dir object.

Returns
  std::filesystem::path

## ◆ GetUISettings()

libconfig::Setting & GpgFrontend::GlobalSettingStation::GetUISettings | ( |  | ) |
| noexcept

Returns
  libconfig::Setting&

References ui_cfg_.

Referenced by GpgFrontend::UI::KeyList::dropEvent(), GpgFrontend::UI::GnuPGControllerDialog::GnuPGControllerDialog(), GpgFrontend::UI::init_locale(), GpgFrontend::UI::KeyPairOperaTab::KeyPairOperaTab(), GpgFrontend::UI::GeneralTab::SetSettings(), GpgFrontend::UI::NetworkTab::SetSettings(), and GpgFrontend::UI::CommonUtils::SlotImportKeyFromKeyServer().

## ◆ LookupSettings()

template<typename T >

T GpgFrontend::GlobalSettingStation::LookupSettings | ( | std::string | path,
|  | T | default_value
| ) |  |
| inline noexcept

Returns
  libconfig::Setting&

Referenced by GpgFrontend::UI::KeyMgmt::create_actions(), GpgFrontend::UI::MainWindow::create_actions(), GpgFrontend::UI::KeyList::dropEvent(), GpgFrontend::UI::InitGpgFrontendUI(), GpgFrontend::UI::KeyGenDialog::KeyGenDialog(), GpgFrontend::UI::KeyServerImportDialog::KeyServerImportDialog(), GpgFrontend::UI::MainWindow::SlotFileEncrypt(), GpgFrontend::UI::MainWindow::SlotFileEncryptSign(), GpgFrontend::UI::MainWindow::SlotFileSign(), GpgFrontend::UI::MainWindow::SlotFileVerify(), GpgFrontend::UI::SubkeyGenerateDialog::SubkeyGenerateDialog(), GpgFrontend::UI::VerifyKeyDetailBox::VerifyKeyDetailBox(), and GpgFrontend::UI::Wizard::Wizard().

## ◆ SyncSettings()

void GpgFrontend::GlobalSettingStation::SyncSettings | ( |  | ) |
| noexcept

sync the settings to the file

Copyright (C) 2021 Saturneric

This file is part of GpgFrontend.

GpgFrontend is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

GpgFrontend is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with GpgFrontend. If not, see https://www.gnu.org/licenses/.

The initial version of the source code is inherited from the gpg4usb project, which is under GPL-3.0-or-later.

All the source code of GpgFrontend was modified and released by Saturnericeric@.nosp@m.bktu.nosp@m.s.com starting on May 12, 2021.

SPDX-License-Identifier: GPL-3.0-or-later

References ui_cfg_, and ui_config_path_.

Referenced by GpgFrontend::UI::KeyList::dropEvent(), and GpgFrontend::UI::init_locale().

## Member Data Documentation

## ◆ app_configure_path_

std::filesystem::path GpgFrontend::GlobalSettingStation::app_configure_path_
| private

Initial value:
=
QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation)
.toStdString()

Program Configure Location.

Referenced by GlobalSettingStation().

## ◆ app_data_objs_path_

std::filesystem::path GpgFrontend::GlobalSettingStation::app_data_objs_path_
| private

Initial value:
=
app_data_path_ / "data_objs"
GpgFrontend::GlobalSettingStation::app_data_path_
std::filesystem::path app_data_path_
Program Data Location.
Definition: GlobalSettingStation.h:173

Object storage path.

## ◆ app_data_path_

std::filesystem::path GpgFrontend::GlobalSettingStation::app_data_path_
| private

Initial value:
=
QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation)
.toStdString()

Program Data Location.

Referenced by GlobalSettingStation().

## ◆ app_locale_path_

std::filesystem::path GpgFrontend::GlobalSettingStation::app_locale_path_
| private

Initial value:
=
app_resource_path_ / "locales"
GpgFrontend::GlobalSettingStation::app_resource_path_
std::filesystem::path app_resource_path_
Program Data Location.
Definition: GlobalSettingStation.h:186

Program Data Location.

Referenced by GlobalSettingStation().

## ◆ app_log_path_

std::filesystem::path GpgFrontend::GlobalSettingStation::app_log_path_
| private

Initial value:
=
app_data_path_ / "logs"

Program Data Location.

Referenced by GlobalSettingStation().

## ◆ app_path_

std::filesystem::path GpgFrontend::GlobalSettingStation::app_path_
| private

Initial value:
= QCoreApplication::applicationDirPath()
.toStdString()

Program Location.

Referenced by GlobalSettingStation().

## ◆ app_resource_path_

std::filesystem::path GpgFrontend::GlobalSettingStation::app_resource_path_
| private

Initial value:
=
RESOURCE_DIR_BOOST_PATH(app_path_)
GpgFrontend::GlobalSettingStation::app_path_
std::filesystem::path app_path_
Program Location.
Definition: GlobalSettingStation.h:171

Program Data Location.

## ◆ ui_config_dir_path_

std::filesystem::path GpgFrontend::GlobalSettingStation::ui_config_dir_path_
| private

Initial value:
=
app_configure_path_ / "conf"
GpgFrontend::GlobalSettingStation::app_configure_path_
std::filesystem::path app_configure_path_
Program Configure Location.
Definition: GlobalSettingStation.h:198

Configure File Directory Location.

Referenced by GlobalSettingStation().

## ◆ ui_config_path_

std::filesystem::path GpgFrontend::GlobalSettingStation::ui_config_path_
| private

Initial value:
=
ui_config_dir_path_ / "main.cfg"
GpgFrontend::GlobalSettingStation::ui_config_dir_path_
std::filesystem::path ui_config_dir_path_
Configure File Directory Location.
Definition: GlobalSettingStation.h:201

Main Configure File Location.

Referenced by GlobalSettingStation(), and SyncSettings().

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

- src/core/function/GlobalSettingStation.h
- src/core/function/GlobalSettingStation.cpp