LeechCraft  0.6.70-15082-g543737046d
Modular cross-platform feature rich live environment.
LC::Util::BackendSelector Class Reference

A common dialog to select storage backend. More...

#include "backendselector.h"

+ Inheritance diagram for LC::Util::BackendSelector:
+ Collaboration diagram for LC::Util::BackendSelector:

Public Slots

void accept ()
 Updates the settings manager. More...
 
void reject ()
 Restores the settings in UI. More...
 

Public Member Functions

 BackendSelector (BaseSettingsManager *manager, QWidget *parent=nullptr)
 Constructs the BackendSelector. More...
 
 ~BackendSelector () override
 

Detailed Description

A common dialog to select storage backend.

Currently following backends are supported:

  • SQLite
  • PostgreSQL If driver is not available, PostgreSQL will be grayed out.

Communication is performed via BaseSettingsManager object passed to the constructor. The following properties are used in it:

  • StorageType of type QString Could be either SQLite or PostgreSQL
  • SQLiteVacuum of type bool Used if SQLite is chosen to set the VACUUM option.
  • SQLiteJournalMode of type string Used if SQLite is chosen to set the desired journal mode.
  • SQLiteTempStore of type string Used if SQLite is chosen to set the temporary storage.
  • SQLiteSynchronous of type string Used if SQLite is chosen to set the sync mode.
  • PostgresHostname Used if PostgreSQL is chosen to set server's host name.
  • PostgresPort Used if PostgreSQL is chosen to set server's port.
  • PostgresDBName Used if PostgreSQL is chosen to set database name.
  • PostgresUsername Used if PostgreSQL is chosen to set user name for the database.
  • PostgresPassword Used if PostgreSQL is chosen to set password for the database.

These settings are also queried when constructing the selector to use them as default ones.

Definition at line 62 of file backendselector.h.

Constructor & Destructor Documentation

◆ BackendSelector()

LC::Util::BackendSelector::BackendSelector ( BaseSettingsManager *  manager,
QWidget *  parent = nullptr 
)
explicit

Constructs the BackendSelector.

Constructs the BackendSelector from the given settings manager and parent widget.

Parameters
[in,out]managerThe settings manager to use to communicate with the outer world.
[in]parentThe parent widget.

Definition at line 22 of file backendselector.cpp.

◆ ~BackendSelector()

LC::Util::BackendSelector::~BackendSelector ( )
overridedefault

Member Function Documentation

◆ accept

void LC::Util::BackendSelector::accept ( )
slot

Updates the settings manager.

This function fills the settings manager with the settings entered by the user in UI.

Definition at line 67 of file backendselector.cpp.

◆ reject

void LC::Util::BackendSelector::reject ( )
slot

Restores the settings in UI.

This function restores the settings in UI from the settings in the settings manager.

Definition at line 84 of file backendselector.cpp.


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