|
Krita Source Code Documentation
|
A class to manage a list of profiles and actions. More...
#include <kis_input_profile_manager.h>
Inheritance diagram for KisInputProfileManager:Signals | |
| void | currentProfileChanged () |
| void | profilesChanged () |
Public Member Functions | |
| QList< KisAbstractInputAction * > | actions () |
| KisInputProfile * | addProfile (const QString &name) |
| void | createActions () |
| KisInputProfile * | currentProfile () const |
| void | duplicateProfile (const QString &name, const QString &newName) |
| QList< KisShortcutConfiguration * > | getConflictingShortcuts (KisInputProfile *profile) |
| KisInputProfileManager (QObject *parent=0) | |
| void | loadProfiles () |
| Private () | |
| KisInputProfile * | profile (const QString &name) const |
| QString | profileFileName (const QString &profileName) |
| QStringList | profileNames () const |
| QList< KisInputProfile * > | profiles () const |
| void | removeProfile (const QString &name) |
| bool | renameProfile (const QString &oldName, const QString &newName) |
| void | resetAll () |
| void | saveProfile (KisInputProfile *profile, QString storagePath) |
| void | saveProfiles () |
| void | setCurrentProfile (KisInputProfile *profile) |
| ~KisInputProfileManager () override | |
Static Public Member Functions | |
| static KisInputProfileManager * | instance () |
Public Attributes | |
| QList< KisAbstractInputAction * > | actions |
| KisInputProfile * | currentProfile |
| QMap< QString, KisInputProfile * > | profiles |
Private Attributes | |
| Private *const | d |
Private Attributes inherited from Private | |
| KisCanvas2 * | canvas |
| int | displayedFrame |
| int | intendedFrame |
Additional Inherited Members | |
Private Member Functions inherited from Private | |
| Private (KisCanvas2 *c) | |
A class to manage a list of profiles and actions.
Definition at line 39 of file kis_input_profile_manager.cpp.
| KisInputProfileManager::KisInputProfileManager | ( | QObject * | parent = 0 | ) |
Definition at line 423 of file kis_input_profile_manager.cpp.
References d.
|
override |
| QList< KisAbstractInputAction * > KisInputProfileManager::actions | ( | ) |
| KisInputProfile * KisInputProfileManager::addProfile | ( | const QString & | name | ) |
Add a profile.
| name | The name of the new profile. |
Definition at line 93 of file kis_input_profile_manager.cpp.
References d, profile(), profilesChanged(), and KisInputProfile::setName().
| void KisInputProfileManager::createActions | ( | ) |
| KisInputProfile * KisInputProfileManager::currentProfile | ( | ) | const |
|
signal |
Emitted when the current active profile changes.
| void KisInputProfileManager::duplicateProfile | ( | const QString & | name, |
| const QString & | newName ) |
Duplicate a profile.
This creates a new profile with the given name and copies all data from the old profile to the new profile.
| name | The name of the profile to duplicate. |
| newName | The name of the new profile. |
Definition at line 153 of file kis_input_profile_manager.cpp.
References KisInputProfile::addShortcut(), KisInputProfile::allShortcuts(), d, profile(), profilesChanged(), and KisInputProfile::setName().
| QList< KisShortcutConfiguration * > KisInputProfileManager::getConflictingShortcuts | ( | KisInputProfile * | profile | ) |
Return the configurations that have conflicts.
Definition at line 386 of file kis_input_profile_manager.cpp.
References KisInputProfile::allShortcuts(), KisShortcutConfiguration::isNoOp(), and profile().
|
static |
Definition at line 56 of file kis_input_profile_manager.cpp.
| void KisInputProfileManager::loadProfiles | ( | ) |
Load all profiles from the configuration stored on disk.
Definition at line 177 of file kis_input_profile_manager.cpp.
References addProfile(), KisInputProfile::addShortcut(), KisConfig::currentInputProfile(), currentProfile, currentProfileChanged(), d, dbgKrita, KoResourcePaths::findAllAssets(), ProfileEntry::fullpath, KisAbstractInputAction::id, KisInputProfileMigrator5To6::migrate(), ProfileEntry::name, p, PROFILE_VERSION, profiles, KoResourcePaths::Recursive, KoResourcePaths::saveLocation(), saveProfile(), KisShortcutConfiguration::setAction(), KisShortcutConfiguration::unserialize(), and ProfileEntry::version.
|
inline |
Definition at line 42 of file kis_input_profile_manager.cpp.
| KisInputProfile * KisInputProfileManager::profile | ( | const QString & | name | ) | const |
Retrieve a profile by name.
| name | The name of the profile to retrieve. |
Definition at line 71 of file kis_input_profile_manager.cpp.
References d.
| QString KisInputProfileManager::profileFileName | ( | const QString & | profileName | ) |
| QStringList KisInputProfileManager::profileNames | ( | ) | const |
Definition at line 66 of file kis_input_profile_manager.cpp.
References d.
| QList< KisInputProfile * > KisInputProfileManager::profiles | ( | ) | const |
|
signal |
Emitted when the list of profiles changes.
| void KisInputProfileManager::removeProfile | ( | const QString & | name | ) |
Remove a profile.
This will remove the given profile from the list of profiles and delete it.
| name | The profile to remove. |
Definition at line 108 of file kis_input_profile_manager.cpp.
References currentProfileChanged(), d, profilesChanged(), and KoResourcePaths::saveLocation().
| bool KisInputProfileManager::renameProfile | ( | const QString & | oldName, |
| const QString & | newName ) |
Rename a profile.
| oldName | The current name of the profile. |
| newName | The new name of the profile. |
Definition at line 132 of file kis_input_profile_manager.cpp.
References d, profile(), profilesChanged(), and KisInputProfile::setName().
| void KisInputProfileManager::resetAll | ( | ) |
Reset all profiles to the default state.
This will remove all custom profiles the user created and reset any changed profiles.
Definition at line 405 of file kis_input_profile_manager.cpp.
References KoResourcePaths::findAllAssets(), KoResourcePaths::getAppDataLocation(), loadProfiles(), profile(), profiles, profilesChanged(), and KoResourcePaths::Recursive.
| void KisInputProfileManager::saveProfile | ( | KisInputProfile * | profile, |
| QString | storagePath ) |
Save profile to storagePath
Definition at line 364 of file kis_input_profile_manager.cpp.
References d, KisAbstractInputAction::id, KisInputProfile::name(), profile(), PROFILE_VERSION, KisShortcutConfiguration::serialize(), and KisInputProfile::shortcutsForAction().
| void KisInputProfileManager::saveProfiles | ( | ) |
Save all profiles to configuration on disk.
Definition at line 350 of file kis_input_profile_manager.cpp.
References currentProfileChanged(), d, p, KoResourcePaths::saveLocation(), saveProfile(), and KisConfig::setCurrentInputProfile().
| void KisInputProfileManager::setCurrentProfile | ( | KisInputProfile * | profile | ) |
Set the current active profile.
| profile | The profile to set as current. |
Definition at line 85 of file kis_input_profile_manager.cpp.
References currentProfileChanged(), d, and profile().
| QList< KisAbstractInputAction * > KisInputProfileManager::actions |
Definition at line 51 of file kis_input_profile_manager.cpp.
| KisInputProfile * KisInputProfileManager::currentProfile |
Definition at line 47 of file kis_input_profile_manager.cpp.
|
private |
Definition at line 146 of file kis_input_profile_manager.h.
| QList< KisInputProfile * > KisInputProfileManager::profiles |
Definition at line 49 of file kis_input_profile_manager.cpp.