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
0f2640ef
Commit
0f2640ef
authored
Sep 28, 2012
by
Claudio Valerio
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/claudio-dev' into develop
parents
862bb62c
7688ab7e
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
15 deletions
+22
-15
UBApplication.cpp
src/core/UBApplication.cpp
+9
-8
UBTeacherGuideWidget.cpp
src/gui/UBTeacherGuideWidget.cpp
+4
-2
UBTeacherGuideWidgetsTools.cpp
src/gui/UBTeacherGuideWidgetsTools.cpp
+9
-5
No files found.
src/core/UBApplication.cpp
View file @
0f2640ef
...
...
@@ -216,14 +216,17 @@ QString UBApplication::checkLanguageAvailabilityForSankore(QString &language)
void
UBApplication
::
setupTranslators
(
QStringList
args
)
{
QString
forcedLanguage
;
QString
forcedLanguage
(
""
)
;
if
(
args
.
contains
(
"-lang"
))
forcedLanguage
=
args
.
at
(
args
.
indexOf
(
"-lang"
)
+
1
);
else
{
QString
setLanguage
=
UBSettings
::
settings
()
->
appPreferredLanguage
->
get
().
toString
();
if
(
!
setLanguage
.
isEmpty
())
forcedLanguage
=
setLanguage
;
}
// TODO claudio: this has been commented because some of the translation seem to be loaded at this time
// especially tools name. This is a workaround and we have to be able to load settings without
// impacting the translations
// else{
// QString setLanguage = UBSettings::settings()->appPreferredLanguage->get().toString();
// if(!setLanguage.isEmpty())
// forcedLanguage = setLanguage;
// }
QString
language
(
""
);
...
...
@@ -242,7 +245,6 @@ void UBApplication::setupTranslators(QStringList args)
else
{
mApplicationTranslator
=
new
QTranslator
(
this
);
mQtGuiTranslator
=
new
QTranslator
(
this
);
mApplicationTranslator
->
load
(
UBPlatformUtils
::
translationPath
(
QString
(
"sankore_"
),
language
));
installTranslator
(
mApplicationTranslator
);
...
...
@@ -256,7 +258,6 @@ void UBApplication::setupTranslators(QStringList args)
}
if
(
!
qtGuiTranslationPath
.
isEmpty
()){
qDebug
()
<<
"qtGuiTranslationPath "
<<
qtGuiTranslationPath
;
mQtGuiTranslator
->
load
(
qtGuiTranslationPath
);
installTranslator
(
mQtGuiTranslator
);
}
...
...
src/gui/UBTeacherGuideWidget.cpp
View file @
0f2640ef
...
...
@@ -551,9 +551,9 @@ void UBTeacherGuidePresentationWidget::showData( QVector<tUBGEElementNode*> data
else
if
(
element
->
name
==
"comment"
)
mpComment
->
showText
(
element
->
attributes
.
value
(
"value"
));
else
if
(
element
->
name
==
"action"
)
{
QTreeWidgetItem
*
newWidgetItem
=
new
QTreeWidgetItem
(
mpRootWidgetItem
);
QTreeWidgetItem
*
newWidgetItem
=
new
QTreeWidgetItem
(
mpRootWidgetItem
);
newWidgetItem
->
setText
(
0
,
element
->
attributes
.
value
(
"task"
));
newWidgetItem
->
setFlags
(
Qt
::
ItemIsEnabled
|
Qt
::
ItemIsSelectable
);
newWidgetItem
->
setFlags
(
Qt
::
ItemIsEnabled
/*| Qt::ItemIsSelectable*/
);
QString
colorString
=
element
->
attributes
.
value
(
"owner"
).
toInt
()
==
0
?
"blue"
:
"green"
;
UBTGAdaptableText
*
textWidget
=
new
UBTGAdaptableText
(
newWidgetItem
,
0
);
textWidget
->
bottomMargin
(
14
);
...
...
@@ -679,7 +679,9 @@ UBTeacherGuidePageZeroWidget::UBTeacherGuidePageZeroWidget(QWidget* parent, cons
mpLayout
->
addWidget
(
mpPageNumberLabel
);
mpScrollArea
=
new
QScrollArea
();
mpScrollArea
->
setFocusPolicy
(
Qt
::
NoFocus
);
mpContainerWidget
=
new
QWidget
();
mpContainerWidget
->
setFocusPolicy
(
Qt
::
NoFocus
);
mpContainerWidgetLayout
=
new
QVBoxLayout
();
mpLayout
->
addWidget
(
mpScrollArea
);
...
...
src/gui/UBTeacherGuideWidgetsTools.cpp
View file @
0f2640ef
...
...
@@ -164,7 +164,7 @@ void UBTGAdaptableText::keyReleaseEvent(QKeyEvent* e)
void
UBTGAdaptableText
::
showEvent
(
QShowEvent
*
e
)
{
Q_UNUSED
(
e
);
if
(
!
mIsUpdatingSize
&&
mHasPlaceHolder
&&
toPlainText
().
isEmpty
()
&&
!
isReadOnly
()){
if
(
!
mIsUpdatingSize
&&
!
hasFocus
()
&&
mHasPlaceHolder
&&
toPlainText
().
isEmpty
()
&&
!
isReadOnly
()){
setTextColor
(
QColor
(
Qt
::
lightGray
));
setPlainText
(
mPlaceHolderText
);
}
...
...
@@ -193,7 +193,8 @@ void UBTGAdaptableText::onTextChanged()
if
(
documentSize
<
mMinimumHeight
){
setFixedHeight
(
mMinimumHeight
);
}
else
{
}
else
{
setFixedHeight
(
documentSize
+
mBottomMargin
);
}
...
...
@@ -237,12 +238,14 @@ void UBTGAdaptableText::focusInEvent(QFocusEvent* e)
QTextEdit
::
focusInEvent
(
e
);
}
void
UBTGAdaptableText
::
focusOutEvent
(
QFocusEvent
*
e
){
void
UBTGAdaptableText
::
focusOutEvent
(
QFocusEvent
*
e
)
{
managePlaceholder
(
false
);
QTextEdit
::
focusOutEvent
(
e
);
}
void
UBTGAdaptableText
::
managePlaceholder
(
bool
focus
){
void
UBTGAdaptableText
::
managePlaceholder
(
bool
focus
)
{
if
(
focus
){
if
(
toPlainText
()
==
mPlaceHolderText
){
setTextColor
(
QColor
(
Qt
::
black
));
...
...
@@ -258,7 +261,8 @@ void UBTGAdaptableText::managePlaceholder(bool focus){
}
}
void
UBTGAdaptableText
::
setCursorToTheEnd
(){
void
UBTGAdaptableText
::
setCursorToTheEnd
()
{
QTextDocument
*
doc
=
document
();
if
(
NULL
!=
doc
){
QTextBlock
block
=
doc
->
lastBlock
();
...
...
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