Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpenBoard
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lifo
Nicolas Ollinger
OpenBoard
Commits
0aec9cc4
Commit
0aec9cc4
authored
Oct 12, 2012
by
Claudio Valerio
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed issue 765
parent
00f87f85
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
157 additions
and
91 deletions
+157
-91
preferences.ui
resources/forms/preferences.ui
+92
-76
UBApplication.cpp
src/core/UBApplication.cpp
+2
-0
UBPreferencesController.cpp
src/core/UBPreferencesController.cpp
+25
-3
UBPreferencesController.h
src/core/UBPreferencesController.h
+2
-0
UBSettings.cpp
src/core/UBSettings.cpp
+27
-7
UBSettings.h
src/core/UBSettings.h
+9
-5
No files found.
resources/forms/preferences.ui
View file @
0aec9cc4
This diff is collapsed.
Click to expand it.
src/core/UBApplication.cpp
View file @
0aec9cc4
...
@@ -476,6 +476,8 @@ void UBApplication::closing()
...
@@ -476,6 +476,8 @@ void UBApplication::closing()
if
(
webController
)
if
(
webController
)
webController
->
closing
();
webController
->
closing
();
UBSettings
::
settings
()
->
closing
();
UBSettings
::
settings
()
->
appToolBarPositionedAtTop
->
set
(
mainWindow
->
toolBarArea
(
mainWindow
->
boardToolBar
)
==
Qt
::
TopToolBarArea
);
UBSettings
::
settings
()
->
appToolBarPositionedAtTop
->
set
(
mainWindow
->
toolBarArea
(
mainWindow
->
boardToolBar
)
==
Qt
::
TopToolBarArea
);
quit
();
quit
();
...
...
src/core/UBPreferencesController.cpp
View file @
0aec9cc4
...
@@ -67,8 +67,6 @@ UBPreferencesController::UBPreferencesController(QWidget *parent)
...
@@ -67,8 +67,6 @@ UBPreferencesController::UBPreferencesController(QWidget *parent)
mPreferencesWindow
=
new
UBPreferencesDialog
(
this
,
parent
,
Qt
::
Dialog
);
mPreferencesWindow
=
new
UBPreferencesDialog
(
this
,
parent
,
Qt
::
Dialog
);
mPreferencesUI
=
new
Ui
::
preferencesDialog
();
// deleted in
mPreferencesUI
=
new
Ui
::
preferencesDialog
();
// deleted in
mPreferencesUI
->
setupUi
(
mPreferencesWindow
);
mPreferencesUI
->
setupUi
(
mPreferencesWindow
);
connect
(
mPreferencesUI
->
Username_textBox
,
SIGNAL
(
editingFinished
()),
this
,
SLOT
(
onCommunityUsernameChanged
()));
connect
(
mPreferencesUI
->
Password_textEdit
,
SIGNAL
(
editingFinished
()),
this
,
SLOT
(
onCommunityPasswordChanged
()));
wire
();
wire
();
}
}
...
@@ -76,7 +74,7 @@ UBPreferencesController::UBPreferencesController(QWidget *parent)
...
@@ -76,7 +74,7 @@ UBPreferencesController::UBPreferencesController(QWidget *parent)
UBPreferencesController
::~
UBPreferencesController
()
UBPreferencesController
::~
UBPreferencesController
()
{
{
delete
mPreferencesWindow
;
delete
mPreferencesWindow
;
delete
mPreferencesUI
;
delete
mPreferencesUI
;
...
@@ -161,6 +159,12 @@ void UBPreferencesController::wire()
...
@@ -161,6 +159,12 @@ void UBPreferencesController::wire()
connect
(
mMarkerProperties
->
pressureSensitiveCheckBox
,
SIGNAL
(
clicked
(
bool
)),
settings
,
SLOT
(
setMarkerPressureSensitive
(
bool
)));
connect
(
mMarkerProperties
->
pressureSensitiveCheckBox
,
SIGNAL
(
clicked
(
bool
)),
settings
,
SLOT
(
setMarkerPressureSensitive
(
bool
)));
connect
(
mMarkerProperties
->
opacitySlider
,
SIGNAL
(
valueChanged
(
int
)),
this
,
SLOT
(
opacitySliderChanged
(
int
)));
connect
(
mMarkerProperties
->
opacitySlider
,
SIGNAL
(
valueChanged
(
int
)),
this
,
SLOT
(
opacitySliderChanged
(
int
)));
//network
connect
(
mPreferencesUI
->
Username_textBox
,
SIGNAL
(
editingFinished
()),
this
,
SLOT
(
onCommunityUsernameChanged
()));
connect
(
mPreferencesUI
->
Password_textEdit
,
SIGNAL
(
editingFinished
()),
this
,
SLOT
(
onCommunityPasswordChanged
()));
connect
(
mPreferencesUI
->
PSDataPersistenceCheckBox
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
onCommunityPersistenceChanged
()));
// about tab
// about tab
connect
(
mPreferencesUI
->
checkSoftwareUpdateAtLaunchCheckBox
,
SIGNAL
(
clicked
(
bool
)),
settings
->
appEnableAutomaticSoftwareUpdates
,
SLOT
(
setBool
(
bool
)));
connect
(
mPreferencesUI
->
checkSoftwareUpdateAtLaunchCheckBox
,
SIGNAL
(
clicked
(
bool
)),
settings
->
appEnableAutomaticSoftwareUpdates
,
SLOT
(
setBool
(
bool
)));
}
}
...
@@ -212,18 +216,36 @@ void UBPreferencesController::init()
...
@@ -212,18 +216,36 @@ void UBPreferencesController::init()
mMarkerProperties
->
opacitySlider
->
setValue
(
settings
->
boardMarkerAlpha
->
get
().
toDouble
()
*
100
);
mMarkerProperties
->
opacitySlider
->
setValue
(
settings
->
boardMarkerAlpha
->
get
().
toDouble
()
*
100
);
//network
mPreferencesUI
->
PSDataPersistenceCheckBox
->
setChecked
(
settings
->
getCommunityDataPersistence
());
persistanceCheckboxUpdate
();
}
}
void
UBPreferencesController
::
onCommunityUsernameChanged
()
void
UBPreferencesController
::
onCommunityUsernameChanged
()
{
{
UBSettings
*
settings
=
UBSettings
::
settings
();
UBSettings
*
settings
=
UBSettings
::
settings
();
settings
->
setCommunityUsername
(
mPreferencesUI
->
Username_textBox
->
text
());
settings
->
setCommunityUsername
(
mPreferencesUI
->
Username_textBox
->
text
());
persistanceCheckboxUpdate
();
}
}
void
UBPreferencesController
::
onCommunityPasswordChanged
()
void
UBPreferencesController
::
onCommunityPasswordChanged
()
{
{
UBSettings
*
settings
=
UBSettings
::
settings
();
UBSettings
*
settings
=
UBSettings
::
settings
();
settings
->
setCommunityPassword
(
mPreferencesUI
->
Password_textEdit
->
text
());
settings
->
setCommunityPassword
(
mPreferencesUI
->
Password_textEdit
->
text
());
persistanceCheckboxUpdate
();
}
void
UBPreferencesController
::
onCommunityPersistenceChanged
()
{
UBSettings
::
settings
()
->
setCommunityPersistence
(
mPreferencesUI
->
PSDataPersistenceCheckBox
->
isChecked
());
}
void
UBPreferencesController
::
persistanceCheckboxUpdate
()
{
bool
checkBoxEnabled
=
mPreferencesUI
->
Username_textBox
->
text
().
length
()
||
mPreferencesUI
->
Password_textEdit
->
text
().
length
();
mPreferencesUI
->
PSDataPersistenceCheckBox
->
setEnabled
(
checkBoxEnabled
);
mPreferencesUI
->
PSDataPersistenceCheckBox
->
setStyleSheet
(
checkBoxEnabled
?
"color:black;"
:
"color:lightgray;"
);
}
}
...
...
src/core/UBPreferencesController.h
View file @
0aec9cc4
...
@@ -83,12 +83,14 @@ class UBPreferencesController : public QObject
...
@@ -83,12 +83,14 @@ class UBPreferencesController : public QObject
void
toolbarOrientationHorizontal
(
bool
checked
);
void
toolbarOrientationHorizontal
(
bool
checked
);
void
onCommunityUsernameChanged
();
void
onCommunityUsernameChanged
();
void
onCommunityPasswordChanged
();
void
onCommunityPasswordChanged
();
void
onCommunityPersistenceChanged
();
private
:
private
:
static
qreal
sSliderRatio
;
static
qreal
sSliderRatio
;
static
qreal
sMinPenWidth
;
static
qreal
sMinPenWidth
;
static
qreal
sMaxPenWidth
;
static
qreal
sMaxPenWidth
;
void
persistanceCheckboxUpdate
();
};
};
...
...
src/core/UBSettings.cpp
View file @
0aec9cc4
...
@@ -173,7 +173,7 @@ void UBSettings::ValidateKeyboardPaletteKeyBtnSize()
...
@@ -173,7 +173,7 @@ void UBSettings::ValidateKeyboardPaletteKeyBtnSize()
{
{
// if boardKeyboardPaletteKeyBtnSize is not initialized, or supportedKeyboardSizes not initialized or empty
// if boardKeyboardPaletteKeyBtnSize is not initialized, or supportedKeyboardSizes not initialized or empty
if
(
!
boardKeyboardPaletteKeyBtnSize
||
if
(
!
boardKeyboardPaletteKeyBtnSize
||
!
supportedKeyboardSizes
||
!
supportedKeyboardSizes
||
supportedKeyboardSizes
->
size
()
==
0
)
return
;
supportedKeyboardSizes
->
size
()
==
0
)
return
;
// get original size value
// get original size value
...
@@ -243,7 +243,7 @@ void UBSettings::init()
...
@@ -243,7 +243,7 @@ void UBSettings::init()
pageSize
=
new
UBSetting
(
this
,
"Board"
,
"DefaultPageSize"
,
documentSizes
.
value
(
DocumentSizeRatio
::
Ratio4_3
));
pageSize
=
new
UBSetting
(
this
,
"Board"
,
"DefaultPageSize"
,
documentSizes
.
value
(
DocumentSizeRatio
::
Ratio4_3
));
pageDpi
=
new
UBSetting
(
this
,
"Board"
,
"pageDpi"
,
0
);
pageDpi
=
new
UBSetting
(
this
,
"Board"
,
"pageDpi"
,
0
);
QStringList
penLightBackgroundColors
;
QStringList
penLightBackgroundColors
;
penLightBackgroundColors
<<
"#000000"
<<
"#FF0000"
<<
"#004080"
<<
"#008000"
<<
"#C87400"
<<
"#800040"
<<
"#008080"
<<
"#5F2D0A"
;
penLightBackgroundColors
<<
"#000000"
<<
"#FF0000"
<<
"#004080"
<<
"#008000"
<<
"#C87400"
<<
"#800040"
<<
"#008080"
<<
"#5F2D0A"
;
boardPenLightBackgroundColors
=
new
UBColorListSetting
(
this
,
"Board"
,
"PenLightBackgroundColors"
,
penLightBackgroundColors
,
1.0
);
boardPenLightBackgroundColors
=
new
UBColorListSetting
(
this
,
"Board"
,
"PenLightBackgroundColors"
,
penLightBackgroundColors
,
1.0
);
...
@@ -357,6 +357,7 @@ void UBSettings::init()
...
@@ -357,6 +357,7 @@ void UBSettings::init()
communityUser
=
new
UBSetting
(
this
,
"Community"
,
"Username"
,
""
);
communityUser
=
new
UBSetting
(
this
,
"Community"
,
"Username"
,
""
);
communityPsw
=
new
UBSetting
(
this
,
"Community"
,
"Password"
,
""
);
communityPsw
=
new
UBSetting
(
this
,
"Community"
,
"Password"
,
""
);
communityDataPersistence
=
new
UBSetting
(
this
,
"Community"
,
"DataPeristence"
,
true
);
QStringList
uris
=
UBToolsManager
::
manager
()
->
allToolIDs
();
QStringList
uris
=
UBToolsManager
::
manager
()
->
allToolIDs
();
...
@@ -383,7 +384,7 @@ void UBSettings::init()
...
@@ -383,7 +384,7 @@ void UBSettings::init()
intranetPodcastPublishingUrl
=
new
UBSetting
(
this
,
"IntranetPodcast"
,
"PublishingUrl"
,
""
);
intranetPodcastPublishingUrl
=
new
UBSetting
(
this
,
"IntranetPodcast"
,
"PublishingUrl"
,
""
);
intranetPodcastAuthor
=
new
UBSetting
(
this
,
"IntranetPodcast"
,
"Author"
,
""
);
intranetPodcastAuthor
=
new
UBSetting
(
this
,
"IntranetPodcast"
,
"Author"
,
""
);
KeyboardLocale
=
new
UBSetting
(
this
,
"Board"
,
"StartupKeyboardLocale"
,
0
);
KeyboardLocale
=
new
UBSetting
(
this
,
"Board"
,
"StartupKeyboardLocale"
,
0
);
swapControlAndDisplayScreens
=
new
UBSetting
(
this
,
"App"
,
"SwapControlAndDisplayScreens"
,
false
);
swapControlAndDisplayScreens
=
new
UBSetting
(
this
,
"App"
,
"SwapControlAndDisplayScreens"
,
false
);
angleTolerance
=
new
UBSetting
(
this
,
"App"
,
"AngleTolerance"
,
4
);
angleTolerance
=
new
UBSetting
(
this
,
"App"
,
"AngleTolerance"
,
4
);
...
@@ -392,6 +393,8 @@ void UBSettings::init()
...
@@ -392,6 +393,8 @@ void UBSettings::init()
teacherGuideLessonPagesActivated
=
new
UBSetting
(
this
,
"DockPalette"
,
"TeacherGuideActivateLessonPages"
,
true
);
teacherGuideLessonPagesActivated
=
new
UBSetting
(
this
,
"DockPalette"
,
"TeacherGuideActivateLessonPages"
,
true
);
libIconSize
=
new
UBSetting
(
this
,
"Library"
,
"LibIconSize"
,
defaultLibraryIconSize
);
libIconSize
=
new
UBSetting
(
this
,
"Library"
,
"LibIconSize"
,
defaultLibraryIconSize
);
cleanNonPersistentSettings
();
}
}
...
@@ -401,7 +404,7 @@ QVariant UBSettings::value ( const QString & key, const QVariant & defaultValue)
...
@@ -401,7 +404,7 @@ QVariant UBSettings::value ( const QString & key, const QVariant & defaultValue)
{
{
sAppSettings
->
setValue
(
key
,
defaultValue
);
sAppSettings
->
setValue
(
key
,
defaultValue
);
}
}
return
mUserSettings
->
value
(
key
,
sAppSettings
->
value
(
key
,
defaultValue
));
return
mUserSettings
->
value
(
key
,
sAppSettings
->
value
(
key
,
defaultValue
));
}
}
...
@@ -944,7 +947,7 @@ QString UBSettings::applicationImageLibraryDirectory()
...
@@ -944,7 +947,7 @@ QString UBSettings::applicationImageLibraryDirectory()
{
{
QString
defaultRelativePath
=
QString
(
"./library/pictures"
);
QString
defaultRelativePath
=
QString
(
"./library/pictures"
);
QString
configPath
=
value
(
"Library/ImageDirectory"
,
QVariant
(
defaultRelativePath
)).
toString
();
QString
configPath
=
value
(
"Library/ImageDirectory"
,
QVariant
(
defaultRelativePath
)).
toString
();
if
(
configPath
.
startsWith
(
"."
))
{
if
(
configPath
.
startsWith
(
"."
))
{
return
UBPlatformUtils
::
applicationResourcesDirectory
()
+
configPath
.
right
(
configPath
.
size
()
-
1
);
return
UBPlatformUtils
::
applicationResourcesDirectory
()
+
configPath
.
right
(
configPath
.
size
()
-
1
);
...
@@ -1180,12 +1183,17 @@ void UBSettings::setCommunityPassword(const QString &password)
...
@@ -1180,12 +1183,17 @@ void UBSettings::setCommunityPassword(const QString &password)
communityPsw
->
set
(
QVariant
(
password
));
communityPsw
->
set
(
QVariant
(
password
));
}
}
void
UBSettings
::
setCommunityPersistence
(
const
bool
persistence
)
{
communityDataPersistence
->
set
(
QVariant
(
persistence
));
}
int
UBSettings
::
libraryIconSize
(){
int
UBSettings
::
libraryIconSize
(){
return
libIconSize
->
get
().
toInt
();
return
libIconSize
->
get
().
toInt
();
}
}
void
UBSettings
::
setLibraryIconsize
(
const
int
&
size
){
void
UBSettings
::
setLibraryIconsize
(
const
int
&
size
){
libIconSize
->
set
(
QVariant
(
size
));
libIconSize
->
set
(
QVariant
(
size
));
}
}
bool
UBSettings
::
checkDirectory
(
QString
&
dirPath
)
bool
UBSettings
::
checkDirectory
(
QString
&
dirPath
)
...
@@ -1218,3 +1226,15 @@ QString UBSettings::replaceWildcard(QString& path)
...
@@ -1218,3 +1226,15 @@ QString UBSettings::replaceWildcard(QString& path)
return
result
;
return
result
;
}
}
void
UBSettings
::
closing
()
{
cleanNonPersistentSettings
();
}
void
UBSettings
::
cleanNonPersistentSettings
()
{
if
(
!
communityDataPersistence
->
get
().
toBool
()){
communityPsw
->
set
(
QVariant
(
""
));
communityUser
->
set
(
QVariant
(
""
));
}
}
src/core/UBSettings.h
View file @
0aec9cc4
...
@@ -29,13 +29,14 @@ class UBSettings : public QObject
...
@@ -29,13 +29,14 @@ class UBSettings : public QObject
UBSettings
(
QObject
*
parent
=
0
);
UBSettings
(
QObject
*
parent
=
0
);
virtual
~
UBSettings
();
virtual
~
UBSettings
();
void
cleanNonPersistentSettings
();
public
:
public
:
QStringList
*
supportedKeyboardSizes
;
QStringList
*
supportedKeyboardSizes
;
void
InitKeyboardPaletteKeyBtnSizes
();
void
InitKeyboardPaletteKeyBtnSizes
();
void
ValidateKeyboardPaletteKeyBtnSize
();
void
ValidateKeyboardPaletteKeyBtnSize
();
void
closing
();
int
penWidthIndex
();
int
penWidthIndex
();
...
@@ -95,12 +96,14 @@ class UBSettings : public QObject
...
@@ -95,12 +96,14 @@ class UBSettings : public QObject
void
setCommunityUsername
(
const
QString
&
username
);
void
setCommunityUsername
(
const
QString
&
username
);
QString
communityPassword
();
QString
communityPassword
();
void
setCommunityPassword
(
const
QString
&
password
);
void
setCommunityPassword
(
const
QString
&
password
);
bool
getCommunityDataPersistence
(){
return
communityDataPersistence
->
get
().
toBool
();}
void
setCommunityPersistence
(
const
bool
persistence
);
int
libraryIconSize
();
int
libraryIconSize
();
void
setLibraryIconsize
(
const
int
&
size
);
void
setLibraryIconsize
(
const
int
&
size
);
void
init
();
void
init
();
//user directories
//user directories
static
QString
userDataDirectory
();
static
QString
userDataDirectory
();
static
QString
userDocumentDirectory
();
static
QString
userDocumentDirectory
();
...
@@ -115,9 +118,9 @@ class UBSettings : public QObject
...
@@ -115,9 +118,9 @@ class UBSettings : public QObject
static
QString
userInteractiveFavoritesDirectory
();
static
QString
userInteractiveFavoritesDirectory
();
static
QString
userPodcastRecordingDirectory
();
static
QString
userPodcastRecordingDirectory
();
QString
userGipLibraryDirectory
();
QString
userGipLibraryDirectory
();
//application directory
//application directory
QString
applicationShapeLibraryDirectory
();
QString
applicationShapeLibraryDirectory
();
QString
applicationImageLibraryDirectory
();
QString
applicationImageLibraryDirectory
();
QString
applicationApplicationsLibraryDirectory
();
QString
applicationApplicationsLibraryDirectory
();
...
@@ -337,6 +340,7 @@ class UBSettings : public QObject
...
@@ -337,6 +340,7 @@ class UBSettings : public QObject
UBSetting
*
communityUser
;
UBSetting
*
communityUser
;
UBSetting
*
communityPsw
;
UBSetting
*
communityPsw
;
UBSetting
*
communityDataPersistence
;
UBSetting
*
pageSize
;
UBSetting
*
pageSize
;
UBSetting
*
pageDpi
;
UBSetting
*
pageDpi
;
...
...
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