Q3270
A Qt-based 3270 Terminal Emulator
Loading...
Searching...
No Matches
KeyboardStore Class Reference

Public Member Functions

 KeyboardStore ()
 KeyboardStore::KeyboardStore - persistence layer for KeyboardMaps.
 
const QStringList themeNames () const
 KeyboardStore::themeNames - return a list of all KeyboardMap names.
 
KeyboardMap getTheme (const QString &name) const
 KeyboardStore::getTheme - return a named KeyboardMap.
 
void removeTheme (const QString &name)
 KeyboardStore::removeTheme - remove a named KeyboardMap.
 
void setTheme (const QString &name, const KeyboardMap &map)
 KeyboardStore::setTheme - insert/update a single keyboard map.
 
void setThemes (const QMap< QString, KeyboardMap > &newThemes)
 KeyboardStore::setThemes - replace the keyboard maps in the store.
 
void saveAllThemes () const
 KeyboardStore::saveToSettings.
 

Constructor & Destructor Documentation

◆ KeyboardStore()

KeyboardStore::KeyboardStore ( )

KeyboardStore::KeyboardStore - persistence layer for KeyboardMaps.

KeybaordStore is the persistence layer for keyboard maps. Everything is held in memory and modified there until the user actively saves changes. There is only one KeyboardStore across the entire application.

Member Function Documentation

◆ getTheme()

KeyboardMap KeyboardStore::getTheme ( const QString &  theme) const

KeyboardStore::getTheme - return a named KeyboardMap.

Parameters
theme- the name of the KeyboardMap
Returns
The specified KeyboardMap or Factory if not found

Returns the named keyboard map from the store.

◆ removeTheme()

void KeyboardStore::removeTheme ( const QString &  theme)

KeyboardStore::removeTheme - remove a named KeyboardMap.

Parameters
theme- KeyboardMap to remove

The KeyboardMap specified is removed from the store.

◆ saveAllThemes()

void KeyboardStore::saveAllThemes ( ) const

KeyboardStore::saveToSettings.

Persist the in-memory KeyboardMaps to disk in the config file.

◆ setTheme()

void KeyboardStore::setTheme ( const QString &  theme,
const KeyboardMap map 
)

KeyboardStore::setTheme - insert/update a single keyboard map.

Parameters
theme- the KeyboardMap name
map- the KeyboardMap

Used, for example, when the user modifies a KeyboardMap and presses 'Apply'. If one exists already it is removed first, and then re-added.

Factory map is ignored - it can't be replaced or updated.

◆ setThemes()

void KeyboardStore::setThemes ( const QMap< QString, KeyboardMap > &  newThemes)

KeyboardStore::setThemes - replace the keyboard maps in the store.

Parameters
newThemes- the new keyboard maps

Used by the KeyboardThemeDialog after a user has pressed 'OK'; this is used to re-populate the store with the edited KeyboardMaps which may have been changed during the dialog operation.

As always, the Factory map is ignore if it's present (which it should be) in the new theme list.

◆ themeNames()

const QStringList KeyboardStore::themeNames ( ) const

KeyboardStore::themeNames - return a list of all KeyboardMap names.

Returns
A list of KeyboardMap names, "Factory" always first.

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