chore(cpn): Increase number of profiles that can be created (#4373)

This commit is contained in:
philmoz
2023-12-06 10:45:24 +10:00
committed by GitHub
parent 8e8feca046
commit 5d8ffcc244
5 changed files with 231 additions and 178 deletions
+5 -1
View File
@@ -58,7 +58,7 @@
#define CPN_SETTINGS_INI_FILE QString(PRODUCT % " " % QCoreApplication::translate("Companion", "settings") % " %1.ini")
#define CPN_SETTINGS_INI_PATH QString(CPN_SETTINGS_BACKUP_DIR % "/" % CPN_SETTINGS_INI_FILE)
#define MAX_PROFILES 20
#define MAX_PROFILES 32
#define MAX_JS_AXES 10
#define MAX_JS_BUTTONS 32
#define MAX_COMPONENTS 10
@@ -472,6 +472,7 @@ class Profile: public CompStoreObj
protected:
explicit Profile();
explicit Profile(const Profile & rhs);
void setIndex(int idx) { index = idx; }
inline QString propertyGroup() const override { return QStringLiteral("Profiles"); }
inline QString settingsPath() const override { return QString("%1/profile%2/").arg(propertyGroup()).arg(index); }
@@ -685,6 +686,8 @@ class AppData: public CompStoreObj
const Profile & getProfile(int index) const;
//! List of all active profiles mapped by index.
QMap<int, QString> getActiveProfiles() const;
// Move the currently selected profile to the top of the list
void moveCurrentProfileToTop();
//! Get a modifiable (non-const) reference to the ComponentData at \a index. Returns component[0] if \a index is invalid.
ComponentData & getComponent(int index);
@@ -791,6 +794,7 @@ class AppData: public CompStoreObj
PROPERTY4(bool, jsSupport, "js_support", false)
PROPERTY4(bool, showSplash, "show_splash", true)
PROPERTY4(bool, sortProfiles, "sort_profiles", false)
PROPERTY4(bool, snapToClpbrd, "snapshot_to_clipboard", false)
PROPERTY(UpdateCheckFreq, updateCheckFreq, UPDATE_CHECK_MANUAL)