feat: dual time zones, autostart, tray icon, config relocation, tests
- Dual clock (primary/secondary time zone) with IANA picker, persisted in XML - AutoStartManager: macOS LaunchAgent (com.clouck.clock, RunAtLoad) - Tray icon: template image, light/dark adaptation, toggle + quit menu - ConfigManager: default path moved to QStandardPaths::AppConfigLocation - Qt Test suite (ConfigManager, AutoStartManager) wired into CTest - GitHub origin renamed to upstream; private Gitea repo as origin
This commit is contained in:
+11
-3
@@ -16,11 +16,13 @@ class ConfigManager : public QObject
|
||||
public:
|
||||
explicit ConfigManager(QObject *parent = nullptr);
|
||||
|
||||
static QString defaultSettingsPath();
|
||||
|
||||
// Load settings from XML file
|
||||
bool loadSettings(const QString &filename = "config.xml");
|
||||
bool loadSettings(const QString &filename = QString());
|
||||
|
||||
// Save settings to XML file
|
||||
bool saveSettings(const QString &filename = "config.xml");
|
||||
bool saveSettings(const QString &filename = QString());
|
||||
|
||||
// Getters
|
||||
QColor fontColor() const { return m_fontColor; }
|
||||
@@ -29,6 +31,8 @@ public:
|
||||
bool alwaysOnTop() const { return m_alwaysOnTop; }
|
||||
QPoint windowPosition() const { return m_windowPosition; }
|
||||
QSize windowSize() const { return m_windowSize; }
|
||||
QString primaryTimeZoneId() const { return m_primaryTimeZoneId; }
|
||||
QString secondaryTimeZoneId() const { return m_secondaryTimeZoneId; }
|
||||
|
||||
// Setters
|
||||
void setFontColor(const QColor &color) { m_fontColor = color; }
|
||||
@@ -37,12 +41,14 @@ public:
|
||||
void setAlwaysOnTop(bool onTop) { m_alwaysOnTop = onTop; }
|
||||
void setWindowPosition(const QPoint &pos) { m_windowPosition = pos; }
|
||||
void setWindowSize(const QSize &size) { m_windowSize = size; }
|
||||
void setPrimaryTimeZoneId(const QString &timeZoneId) { m_primaryTimeZoneId = timeZoneId; }
|
||||
void setSecondaryTimeZoneId(const QString &timeZoneId) { m_secondaryTimeZoneId = timeZoneId; }
|
||||
|
||||
// Reset to default values
|
||||
void resetToDefaults();
|
||||
|
||||
// Check if config file exists
|
||||
bool configExists(const QString &filename = "config.xml") const;
|
||||
bool configExists(const QString &filename = QString()) const;
|
||||
|
||||
private:
|
||||
// Default values
|
||||
@@ -55,6 +61,8 @@ private:
|
||||
bool m_alwaysOnTop;
|
||||
QPoint m_windowPosition;
|
||||
QSize m_windowSize;
|
||||
QString m_primaryTimeZoneId;
|
||||
QString m_secondaryTimeZoneId;
|
||||
};
|
||||
|
||||
#endif // CONFIG_MANAGER_H
|
||||
|
||||
Reference in New Issue
Block a user