5 #include "classes/wrappedclockswidget.h"
8 /*! A class that gives accedd to settings
10 Used to save the last used dialog settings.
11 Uses QSettings internally.
12 Note: not compatible with the settings used in the Maemo versions.
13 The group names are the same, but the times are saved as ints (milliseconds) rather than QTimes.
15 @author Heli Hyvättinen
21 class Settings : public QObject
25 explicit Settings(QObject *parent = 0);
27 Returns turns per addition from settings.
28 @param timeControl Time control for which the setting is queried
29 @param isWhite true for white player, false for black
31 Q_INVOKABLE int getTurnsPerAddition(WrappedClocksWidget::TimeControlType timeControl, bool isWhite);
34 Returns intitial time (in milliseconds) from settings.
35 @param timeControl Time control for which the setting is queried
36 @param isWhite true for white player, false for black
38 Q_INVOKABLE int getInitialTime(WrappedClocksWidget::TimeControlType timeControl, bool isWhite);
41 Returns additional time (in milliseconds) from settings.
42 @param timeControl Time control for which the setting is queried
43 @param isWhite true for white player, false for black
45 Q_INVOKABLE int getAdditionalTime(WrappedClocksWidget::TimeControlType timeControl, bool isWhite);
48 Returns whether the equal times is set in the settings
49 @param timeControl Time control for which the setting is queried
51 Q_INVOKABLE bool isEqualTimes(WrappedClocksWidget::TimeControlType timeControl);
60 Sets turns per addition in settings.
61 @param timeControl Time control for which the setting is set
62 @param isWhite true for white player, false for black
63 @param turns The value to be saved
65 void setTurnsPerAddition(WrappedClocksWidget::TimeControlType timeControl, bool isWhite, int turns);
68 Sets initial time in settings.
69 @param timeControl Time control for which the setting is set
70 @param isWhite true for white player, false for black
71 @param time The time to be saved, in milliseconds
73 void setInitialTime(WrappedClocksWidget::TimeControlType timeControl, bool isWhite, int time);
76 Sets additional time in settings.
77 @param timeControl Time control for which the setting is set
78 @param isWhite true for white player, false for black
79 @param time The time to be saved, in milliseconds
82 void setAdditionalTime(WrappedClocksWidget::TimeControlType timeControl, bool isWhite, int time);
84 /*! Sets the equal times setting
85 @param timeControl Time control for which the setting is set
87 void setEqualTimes(WrappedClocksWidget::TimeControlType timeControl,bool on);
91 QString getGroupName(WrappedClocksWidget::TimeControlType timeControl);