Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
mobile Datovka
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
12
Issues
12
List
Boards
Labels
Service Desk
Milestones
Merge Requests
3
Merge Requests
3
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Datovka projects
mobile Datovka
Commits
cbf2aee6
Commit
cbf2aee6
authored
Oct 27, 2016
by
Martin Straka
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
User can set fontsize in the settings
parent
dc1316f8
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
47 additions
and
10 deletions
+47
-10
qml/pages/SettingsPage.qml
qml/pages/SettingsPage.qml
+25
-0
src/main.cpp
src/main.cpp
+6
-4
src/settings.cpp
src/settings.cpp
+5
-0
src/settings.h
src/settings.h
+2
-0
src/setwrapper.cpp
src/setwrapper.cpp
+3
-2
src/setwrapper.h
src/setwrapper.h
+6
-4
No files found.
qml/pages/SettingsPage.qml
View file @
cbf2aee6
...
...
@@ -75,6 +75,29 @@ Component {
wrapMode
:
Text
.
Wrap
}
}
Column
{
spacing
:
1
Label
{
id
:
fontSizeLabel
color
:
datovkaPalette
.
text
width
:
myWidht
text
:
qsTr
(
"
Font size and scale
"
)
}
Slider
{
id
:
ifontSizeSlider
width
:
myWidht
minimumValue
:
10
stepSize
:
1
value
:
16
maximumValue
:
20
}
Text
{
color
:
datovkaPalette
.
mid
width
:
myWidht
text
:
qsTr
(
"
Note: Font size will be changed after application restart.
"
)
wrapMode
:
Text
.
Wrap
}
}
Column
{
spacing
:
1
CheckBox
{
...
...
@@ -173,6 +196,7 @@ Component {
iusePinCode
.
checked
=
usePinCode
ipinCodeString
.
text
=
pinCodeString
languageComboBoxId
.
currentIndex
=
langIndex
ifontSizeSlider
.
value
=
fontSize
ipinCodeString
.
visible
=
usePinCode
}
}
...
...
@@ -186,6 +210,7 @@ Component {
iusePinCode
.
checked
=
false
}
settings
.
updateSettings
(
sLang
,
ifontSizeSlider
.
value
.
toString
(),
idownloadOnlyNewMsgs
.
checked
,
idownloadCompleteMsgs
.
checked
,
isaveFilesToDb
.
checked
,
...
...
src/main.cpp
View file @
cbf2aee6
...
...
@@ -78,10 +78,6 @@ int main(int argc, char *argv[])
app
.
setOrganizationDomain
(
APP_ORG_DOMAIN
);
app
.
setApplicationName
(
APP_NAME
);
app
.
setApplicationVersion
(
VERSION
);
QFont
font
;
font
.
setFamily
(
DEFAULT_FONT_FAMILY
);
font
.
setPointSize
(
DEFAULT_FONT_SIZE
);
app
.
setFont
(
font
);
/* load global settings */
{
...
...
@@ -90,6 +86,12 @@ int main(int argc, char *argv[])
globSet
.
loadGlobalSettingsFromFile
(
settings
);
}
/* set font family and font size from settings */
QFont
font
;
font
.
setFamily
(
DEFAULT_FONT_FAMILY
);
font
.
setPointSize
(
globSet
.
fontSize
);
app
.
setFont
(
font
);
/* load datovka localization and qtbase localization */
QTranslator
datovkaTrans
;
QTranslator
qtbaseTrans
;
...
...
src/settings.cpp
View file @
cbf2aee6
...
...
@@ -34,6 +34,7 @@ Settings globSet;
Settings
::
Settings
(
void
)
:
language
(
LANGUAGE_SYSTEM
),
fontSize
(
DEFAULT_FONT_SIZE
),
downloadOnlyNewMsgs
(
true
),
downloadCompleteMsgs
(
false
),
saveFilesToDb
(
true
),
...
...
@@ -61,6 +62,7 @@ void Settings::saveGlobalSettingsToFile(QSettings &settings) const
settings
.
beginGroup
(
SETTINGS_GLOBAL_GROUP
);
settings
.
setValue
(
SETTINGS_LANGUAGE
,
globSet
.
language
);
settings
.
setValue
(
SETTINGS_FONTSIZE
,
globSet
.
fontSize
);
settings
.
setValue
(
SETTINGS_ONLY_NEW_MSGS
,
globSet
.
downloadOnlyNewMsgs
);
settings
.
setValue
(
SETTINGS_COMPLETE_MSG
,
globSet
.
downloadCompleteMsgs
);
settings
.
setValue
(
SETTINGS_SAVE_FILE_DB
,
globSet
.
saveFilesToDb
);
...
...
@@ -85,6 +87,9 @@ void Settings::loadGlobalSettingsFromFile(const QSettings &settings)
globSet
.
language
=
settings
.
value
(
SETTINGS_GLOBAL_GROUP
"/"
SETTINGS_LANGUAGE
,
LANGUAGE_SYSTEM
).
toString
();
globSet
.
fontSize
=
settings
.
value
(
SETTINGS_GLOBAL_GROUP
"/"
SETTINGS_FONTSIZE
,
DEFAULT_FONT_SIZE
).
toInt
();
globSet
.
downloadOnlyNewMsgs
=
settings
.
value
(
SETTINGS_GLOBAL_GROUP
"/"
SETTINGS_ONLY_NEW_MSGS
,
true
).
toBool
();
globSet
.
downloadCompleteMsgs
=
settings
.
value
(
...
...
src/settings.h
View file @
cbf2aee6
...
...
@@ -46,6 +46,7 @@
#define SETTINGS_PIN_CODE_STRING "pin_code_string"
#define SETTINGS_LAST_UPDATE "last_update"
#define SETTINGS_LANGUAGE "language"
#define SETTINGS_FONTSIZE "font_size"
/*
...
...
@@ -86,6 +87,7 @@ public:
* @brief Holds global settings data.
*/
QString
language
;
int
fontSize
;
bool
downloadOnlyNewMsgs
;
bool
downloadCompleteMsgs
;
bool
saveFilesToDb
;
...
...
src/setwrapper.cpp
View file @
cbf2aee6
...
...
@@ -69,7 +69,7 @@ void GlobalSettingsQmlWrapper::loadSettings(void)
}
/* Send data to QML */
emit
sendSettingsData
(
langugeComboBoxIndex
,
emit
sendSettingsData
(
langugeComboBoxIndex
,
globSet
.
fontSize
,
globSet
.
downloadOnlyNewMsgs
,
globSet
.
downloadCompleteMsgs
,
globSet
.
saveFilesToDb
,
globSet
.
fileLifeTimeInDays
,
globSet
.
usePinCode
,
globSet
.
pinCodeString
);
...
...
@@ -81,12 +81,13 @@ void GlobalSettingsQmlWrapper::loadSettings(void)
* Slot: Set and save global settings from QML to global structure.
*/
void
GlobalSettingsQmlWrapper
::
updateSettings
(
const
QString
&
language
,
bool
downloadOnlyNewMsgs
,
bool
downloadCompleteMsgs
,
const
QString
&
fontSize
,
bool
downloadOnlyNewMsgs
,
bool
downloadCompleteMsgs
,
bool
saveFilesToDb
,
const
QString
&
fileLifeDays
,
bool
usePinCode
,
const
QString
&
pinCodeString
)
/* ========================================================================= */
{
globSet
.
language
=
language
;
globSet
.
fontSize
=
fontSize
.
toInt
();
globSet
.
downloadOnlyNewMsgs
=
downloadOnlyNewMsgs
;
globSet
.
downloadCompleteMsgs
=
downloadCompleteMsgs
;
globSet
.
saveFilesToDb
=
saveFilesToDb
;
...
...
src/setwrapper.h
View file @
cbf2aee6
...
...
@@ -61,8 +61,9 @@ public:
* @brief Save global settings from QML.
*/
Q_INVOKABLE
void
updateSettings
(
const
QString
&
language
,
bool
downloadOnlyNewMsgs
,
bool
downloadCompleteMsgs
,
bool
saveFilesToDb
,
const
QString
&
fileLifeDays
,
bool
usePinCode
,
const
QString
&
fontSize
,
bool
downloadOnlyNewMsgs
,
bool
downloadCompleteMsgs
,
bool
saveFilesToDb
,
const
QString
&
fileLifeDays
,
bool
usePinCode
,
const
QString
&
pinCodeString
);
/*!
...
...
@@ -80,8 +81,9 @@ signals:
/*!
* @brief Send current global settings to QML.
*/
void
sendSettingsData
(
int
langIndex
,
bool
downloadOnlyNewMsgs
,
bool
downloadCompleteMsgs
,
bool
saveFilesToDb
,
int
fileLifeDays
,
void
sendSettingsData
(
int
langIndex
,
int
fontSize
,
bool
downloadOnlyNewMsgs
,
bool
downloadCompleteMsgs
,
bool
saveFilesToDb
,
int
fileLifeDays
,
bool
usePinCode
,
QString
pinCodeString
);
/*!
...
...
Martin Straka
@mstraka
Mentioned in issue
#4 (closed)
·
Oct 27, 2016
Mentioned in issue
#4 (closed)
Mentioned in issue #4
Toggle commit list
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment