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
62e5308f
Commit
62e5308f
authored
Sep 07, 2012
by
Claudio Valerio
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/claudio-dev' into develop
parents
a0ee4650
a726171f
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
120 additions
and
57 deletions
+120
-57
toque.png
resources/images/toque.png
+0
-0
sankore.qrc
resources/sankore.qrc
+1
-0
UBDocumentController.cpp
src/document/UBDocumentController.cpp
+8
-15
UBDocumentNavigator.cpp
src/gui/UBDocumentNavigator.cpp
+28
-6
UBTeacherGuideWidget.cpp
src/gui/UBTeacherGuideWidget.cpp
+59
-35
UBTeacherGuideWidget.h
src/gui/UBTeacherGuideWidget.h
+8
-1
UBTeacherGuideWidgetsTools.cpp
src/gui/UBTeacherGuideWidgetsTools.cpp
+14
-0
UBTeacherGuideWidgetsTools.h
src/gui/UBTeacherGuideWidgetsTools.h
+2
-0
No files found.
resources/images/toque.png
0 → 100644
View file @
62e5308f
3.34 KB
resources/sankore.qrc
View file @
62e5308f
...
@@ -365,5 +365,6 @@
...
@@ -365,5 +365,6 @@
<file>images/teacherGuide/pencil.svg</file>
<file>images/teacherGuide/pencil.svg</file>
<file>images/duplicateDisabled.svg</file>
<file>images/duplicateDisabled.svg</file>
<file>images/teacherGuide/flash_24x24.svg</file>
<file>images/teacherGuide/flash_24x24.svg</file>
<file>images/toque.png</file>
</qresource>
</qresource>
</RCC>
</RCC>
src/document/UBDocumentController.cpp
View file @
62e5308f
...
@@ -366,25 +366,18 @@ void UBDocumentController::setupViews()
...
@@ -366,25 +366,18 @@ void UBDocumentController::setupViews()
connect
(
mDocumentUI
->
thumbnailWidget
,
SIGNAL
(
sceneDropped
(
UBDocumentProxy
*
,
int
,
int
)),
this
,
SLOT
(
moveSceneToIndex
(
UBDocumentProxy
*
,
int
,
int
)));
connect
(
mDocumentUI
->
thumbnailWidget
,
SIGNAL
(
sceneDropped
(
UBDocumentProxy
*
,
int
,
int
)),
this
,
SLOT
(
moveSceneToIndex
(
UBDocumentProxy
*
,
int
,
int
)));
connect
(
mDocumentUI
->
thumbnailWidget
,
SIGNAL
(
resized
()),
this
,
SLOT
(
thumbnailViewResized
()));
connect
(
mDocumentUI
->
thumbnailWidget
,
SIGNAL
(
resized
()),
this
,
SLOT
(
thumbnailViewResized
()));
connect
(
mDocumentUI
->
thumbnailWidget
,
SIGNAL
(
mouseDoubleClick
(
QGraphicsItem
*
,
int
)),
connect
(
mDocumentUI
->
thumbnailWidget
,
SIGNAL
(
mouseDoubleClick
(
QGraphicsItem
*
,
int
)),
this
,
SLOT
(
pageDoubleClicked
(
QGraphicsItem
*
,
int
)));
this
,
SLOT
(
pageDoubleClicked
(
QGraphicsItem
*
,
int
)));
connect
(
mDocumentUI
->
thumbnailWidget
,
SIGNAL
(
mouseClick
(
QGraphicsItem
*
,
int
)),
this
,
SLOT
(
pageClicked
(
QGraphicsItem
*
,
int
)));
connect
(
mDocumentUI
->
thumbnailWidget
,
SIGNAL
(
mouseClick
(
QGraphicsItem
*
,
int
)),
this
,
SLOT
(
pageClicked
(
QGraphicsItem
*
,
int
)));
connect
(
mDocumentUI
->
thumbnailWidget
->
scene
(),
SIGNAL
(
selectionChanged
()),
connect
(
mDocumentUI
->
thumbnailWidget
->
scene
(),
SIGNAL
(
selectionChanged
()),
this
,
SLOT
(
pageSelectionChanged
()));
this
,
SLOT
(
pageSelectionChanged
()));
connect
(
UBPersistenceManager
::
persistenceManager
(),
SIGNAL
(
documentCreated
(
UBDocumentProxy
*
)),
connect
(
UBPersistenceManager
::
persistenceManager
(),
SIGNAL
(
documentCreated
(
UBDocumentProxy
*
)),
this
,
SLOT
(
addDocumentInTree
(
UBDocumentProxy
*
)));
this
,
SLOT
(
addDocumentInTree
(
UBDocumentProxy
*
)));
connect
(
UBPersistenceManager
::
persistenceManager
(),
SIGNAL
(
documentMetadataChanged
(
UBDocumentProxy
*
)),
connect
(
UBPersistenceManager
::
persistenceManager
(),
SIGNAL
(
documentMetadataChanged
(
UBDocumentProxy
*
)),
this
,
SLOT
(
updateDocumentInTree
(
UBDocumentProxy
*
)));
this
,
SLOT
(
updateDocumentInTree
(
UBDocumentProxy
*
)));
connect
(
UBPersistenceManager
::
persistenceManager
(),
SIGNAL
(
documentSceneCreated
(
UBDocumentProxy
*
,
int
)),
connect
(
UBPersistenceManager
::
persistenceManager
(),
SIGNAL
(
documentSceneCreated
(
UBDocumentProxy
*
,
int
)),
this
,
SLOT
(
documentSceneChanged
(
UBDocumentProxy
*
,
int
)));
this
,
SLOT
(
documentSceneChanged
(
UBDocumentProxy
*
,
int
)));
connect
(
UBPersistenceManager
::
persistenceManager
(),
SIGNAL
(
documentSceneWillBeDeleted
(
UBDocumentProxy
*
,
int
)),
connect
(
UBPersistenceManager
::
persistenceManager
(),
SIGNAL
(
documentSceneWillBeDeleted
(
UBDocumentProxy
*
,
int
)),
this
,
SLOT
(
documentSceneChanged
(
UBDocumentProxy
*
,
int
)));
this
,
SLOT
(
documentSceneChanged
(
UBDocumentProxy
*
,
int
)));
mDocumentUI
->
thumbnailWidget
->
setBackgroundBrush
(
UBSettings
::
documentViewLightColor
);
mDocumentUI
->
thumbnailWidget
->
setBackgroundBrush
(
UBSettings
::
documentViewLightColor
);
...
@@ -1006,7 +999,7 @@ void UBDocumentController::addFolderOfImages()
...
@@ -1006,7 +999,7 @@ void UBDocumentController::addFolderOfImages()
if
(
importedImageNumber
==
0
)
if
(
importedImageNumber
==
0
)
{
{
showMessage
(
tr
(
"Folder does not contain any image files
!
"
));
showMessage
(
tr
(
"Folder does not contain any image files"
));
UBApplication
::
applicationController
->
showDocument
();
UBApplication
::
applicationController
->
showDocument
();
}
}
else
else
...
...
src/gui/UBDocumentNavigator.cpp
View file @
62e5308f
...
@@ -69,6 +69,9 @@ UBDocumentNavigator::~UBDocumentNavigator()
...
@@ -69,6 +69,9 @@ UBDocumentNavigator::~UBDocumentNavigator()
}
}
}
}
#include "gui/UBDockTeacherGuideWidget.h"
#include "gui/UBTeacherGuideWidget.h"
/**
/**
* \brief Generate the thumbnails
* \brief Generate the thumbnails
*/
*/
...
@@ -84,10 +87,31 @@ void UBDocumentNavigator::generateThumbnails(UBDocumentContainer* source)
...
@@ -84,10 +87,31 @@ void UBDocumentNavigator::generateThumbnails(UBDocumentContainer* source)
for
(
int
i
=
0
;
i
<
source
->
selectedDocument
()
->
pageCount
();
i
++
)
for
(
int
i
=
0
;
i
<
source
->
selectedDocument
()
->
pageCount
();
i
++
)
{
{
const
QPixmap
*
pix
=
source
->
pageAt
(
i
);
const
QPixmap
*
pix
=
source
->
pageAt
(
i
);
UBSceneThumbnailNavigPixmap
*
pixmapItem
=
new
UBSceneThumbnailNavigPixmap
(
*
pix
,
source
->
selectedDocument
(),
i
);
QPixmap
result
(
pix
->
width
(),
pix
->
height
()
);
int
pageIndex
=
UBDocumentContainer
::
pageFromSceneIndex
(
i
);
int
pageIndex
=
UBDocumentContainer
::
pageFromSceneIndex
(
i
);
QString
label
=
pageIndex
==
0
?
tr
(
"Title page"
)
:
tr
(
"Page %0"
).
arg
(
pageIndex
);
QPainter
composePainter
;
composePainter
.
begin
(
&
result
);
composePainter
.
drawPixmap
(
QPoint
(
0
,
0
),
*
pix
);
if
(
pageIndex
==
UBApplication
::
boardController
->
currentPage
()
&&
((
pageIndex
==
0
&&
UBSettings
::
settings
()
->
teacherGuidePageZeroActivated
->
get
().
toBool
())
||
(
pageIndex
&&
UBSettings
::
settings
()
->
teacherGuideLessonPagesActivated
->
get
().
toBool
()))
)
{
if
(
UBApplication
::
boardController
->
paletteManager
()
->
teacherGuideDockWidget
()
->
teacherGuideWidget
()
->
isModified
()){
QPixmap
toque
(
":images/toque.png"
);
composePainter
.
setOpacity
(
0.6
);
composePainter
.
drawPixmap
(
QPoint
(
pix
->
width
()
-
toque
.
width
(),
0
),
toque
);
}
}
composePainter
.
end
();
UBSceneThumbnailNavigPixmap
*
pixmapItem
=
new
UBSceneThumbnailNavigPixmap
(
result
,
source
->
selectedDocument
(),
i
);
QString
label
=
pageIndex
==
0
?
tr
(
"Title page"
)
:
tr
(
"Page %0"
).
arg
(
pageIndex
);
UBThumbnailTextItem
*
labelItem
=
new
UBThumbnailTextItem
(
label
);
UBThumbnailTextItem
*
labelItem
=
new
UBThumbnailTextItem
(
label
);
UBImgTextThumbnailElement
thumbWithText
(
pixmapItem
,
labelItem
);
UBImgTextThumbnailElement
thumbWithText
(
pixmapItem
,
labelItem
);
...
@@ -104,7 +128,7 @@ void UBDocumentNavigator::generateThumbnails(UBDocumentContainer* source)
...
@@ -104,7 +128,7 @@ void UBDocumentNavigator::generateThumbnails(UBDocumentContainer* source)
void
UBDocumentNavigator
::
onScrollToSelectedPage
(
int
index
)
void
UBDocumentNavigator
::
onScrollToSelectedPage
(
int
index
)
{
{
qDebug
()
<<
"Selection in widet: "
<<
index
;
qDebug
()
<<
"Selection in wid
g
et: "
<<
index
;
int
c
=
0
;
int
c
=
0
;
foreach
(
UBImgTextThumbnailElement
el
,
mThumbsWithLabels
)
foreach
(
UBImgTextThumbnailElement
el
,
mThumbsWithLabels
)
{
{
...
@@ -118,7 +142,6 @@ void UBDocumentNavigator::onScrollToSelectedPage(int index)
...
@@ -118,7 +142,6 @@ void UBDocumentNavigator::onScrollToSelectedPage(int index)
}
}
c
++
;
c
++
;
}
}
// centerOn(mThumbsWithLabels[index].getThumbnail());
}
}
/**
/**
...
@@ -131,8 +154,7 @@ void UBDocumentNavigator::updateSpecificThumbnail(int iPage)
...
@@ -131,8 +154,7 @@ void UBDocumentNavigator::updateSpecificThumbnail(int iPage)
//UBGraphicsScene* pScene = UBApplication::boardController->activeScene();
//UBGraphicsScene* pScene = UBApplication::boardController->activeScene();
const
QPixmap
*
pix
=
UBApplication
::
boardController
->
pageAt
(
iPage
);
const
QPixmap
*
pix
=
UBApplication
::
boardController
->
pageAt
(
iPage
);
UBSceneThumbnailNavigPixmap
*
newItem
=
new
UBSceneThumbnailNavigPixmap
(
*
pix
,
UBSceneThumbnailNavigPixmap
*
newItem
=
new
UBSceneThumbnailNavigPixmap
(
*
pix
,
UBApplication
::
boardController
->
selectedDocument
(),
iPage
);
UBApplication
::
boardController
->
selectedDocument
(),
iPage
);
// Get the old thumbnail
// Get the old thumbnail
UBSceneThumbnailNavigPixmap
*
oldItem
=
mThumbsWithLabels
.
at
(
iPage
).
getThumbnail
();
UBSceneThumbnailNavigPixmap
*
oldItem
=
mThumbsWithLabels
.
at
(
iPage
).
getThumbnail
();
...
...
src/gui/UBTeacherGuideWidget.cpp
View file @
62e5308f
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
#include <QTreeWidget>
#include <QTreeWidget>
#include <QPushButton>
#include <QPushButton>
#include <QDomDocument>
#include <QDomDocument>
#include <QScrollArea>
#include "UBTeacherGuideWidget.h"
#include "UBTeacherGuideWidget.h"
...
@@ -632,8 +632,11 @@ UBTeacherGuidePageZeroWidget::UBTeacherGuidePageZeroWidget(QWidget* parent, cons
...
@@ -632,8 +632,11 @@ UBTeacherGuidePageZeroWidget::UBTeacherGuidePageZeroWidget(QWidget* parent, cons
QWidget
(
parent
)
QWidget
(
parent
)
,
mpLayout
(
NULL
)
,
mpLayout
(
NULL
)
,
mpButtonTitleLayout
(
NULL
)
,
mpButtonTitleLayout
(
NULL
)
,
mpContainerWidgetLayout
(
NULL
)
,
mpModePushButton
(
NULL
)
,
mpModePushButton
(
NULL
)
,
mpPageNumberLabel
(
NULL
)
,
mpPageNumberLabel
(
NULL
)
,
mpScrollArea
(
NULL
)
,
mpContainerWidget
(
NULL
)
,
mpSessionTitle
(
NULL
)
,
mpSessionTitle
(
NULL
)
,
mpSeparatorSessionTitle
(
NULL
)
,
mpSeparatorSessionTitle
(
NULL
)
,
mpAuthorsLabel
(
NULL
)
,
mpAuthorsLabel
(
NULL
)
...
@@ -673,6 +676,16 @@ UBTeacherGuidePageZeroWidget::UBTeacherGuidePageZeroWidget(QWidget* parent, cons
...
@@ -673,6 +676,16 @@ UBTeacherGuidePageZeroWidget::UBTeacherGuidePageZeroWidget(QWidget* parent, cons
mpPageNumberLabel
->
setText
(
tr
(
"Title page"
));
mpPageNumberLabel
->
setText
(
tr
(
"Title page"
));
mpLayout
->
addWidget
(
mpPageNumberLabel
);
mpLayout
->
addWidget
(
mpPageNumberLabel
);
mpScrollArea
=
new
QScrollArea
();
mpContainerWidget
=
new
QWidget
();
mpContainerWidgetLayout
=
new
QVBoxLayout
();
mpLayout
->
addWidget
(
mpScrollArea
);
mpScrollArea
->
setWidget
(
mpContainerWidget
);
mpScrollArea
->
setWidgetResizable
(
true
);
mpScrollArea
->
setHorizontalScrollBarPolicy
(
Qt
::
ScrollBarAlwaysOff
);
mpContainerWidget
->
setLayout
(
mpContainerWidgetLayout
);
mpButtonTitleLayout
=
new
QHBoxLayout
(
0
);
mpButtonTitleLayout
=
new
QHBoxLayout
(
0
);
mpModePushButton
=
new
QPushButton
(
this
);
mpModePushButton
=
new
QPushButton
(
this
);
...
@@ -684,132 +697,139 @@ UBTeacherGuidePageZeroWidget::UBTeacherGuidePageZeroWidget(QWidget* parent, cons
...
@@ -684,132 +697,139 @@ UBTeacherGuidePageZeroWidget::UBTeacherGuidePageZeroWidget(QWidget* parent, cons
mpSessionTitle
=
new
UBTGAdaptableText
(
0
,
this
,
"UBTGSessionTitle"
);
mpSessionTitle
=
new
UBTGAdaptableText
(
0
,
this
,
"UBTGSessionTitle"
);
mpSessionTitle
->
setPlaceHolderText
(
tr
(
"Type session title here ..."
));
mpSessionTitle
->
setPlaceHolderText
(
tr
(
"Type session title here ..."
));
mpSessionTitle
->
setMaximumLength
(
1000
);
mpButtonTitleLayout
->
addWidget
(
mpSessionTitle
);
mpButtonTitleLayout
->
addWidget
(
mpSessionTitle
);
connect
(
this
,
SIGNAL
(
resized
()),
mpSessionTitle
,
SLOT
(
onTextChanged
()));
connect
(
this
,
SIGNAL
(
resized
()),
mpSessionTitle
,
SLOT
(
onTextChanged
()));
mpLayout
->
addLayout
(
mpButtonTitleLayout
);
mp
ContainerWidget
Layout
->
addLayout
(
mpButtonTitleLayout
);
mpSeparatorSessionTitle
=
new
QFrame
(
this
);
mpSeparatorSessionTitle
=
new
QFrame
(
this
);
mpSeparatorSessionTitle
->
setFixedHeight
(
UBTG_SEPARATOR_FIXED_HEIGHT
);
mpSeparatorSessionTitle
->
setFixedHeight
(
UBTG_SEPARATOR_FIXED_HEIGHT
);
mpSeparatorSessionTitle
->
setObjectName
(
"UBTGSeparator"
);
mpSeparatorSessionTitle
->
setObjectName
(
"UBTGSeparator"
);
mpLayout
->
addWidget
(
mpSeparatorSessionTitle
);
mp
ContainerWidget
Layout
->
addWidget
(
mpSeparatorSessionTitle
);
mpAuthorsLabel
=
new
QLabel
(
this
);
mpAuthorsLabel
=
new
QLabel
(
this
);
mpAuthorsLabel
->
setObjectName
(
"UBTGZeroPageEditionModeTitle"
);
mpAuthorsLabel
->
setObjectName
(
"UBTGZeroPageEditionModeTitle"
);
mpAuthorsLabel
->
setText
(
tr
(
"Author(s)"
));
mpAuthorsLabel
->
setText
(
tr
(
"Author(s)"
));
mpAuthorsLabel
->
setStyleSheet
(
chapterStyle
);
mpAuthorsLabel
->
setStyleSheet
(
chapterStyle
);
mpLayout
->
addWidget
(
mpAuthorsLabel
);
mp
ContainerWidget
Layout
->
addWidget
(
mpAuthorsLabel
);
mpAuthors
=
new
UBTGAdaptableText
(
0
,
this
);
mpAuthors
=
new
UBTGAdaptableText
(
0
,
this
);
mpAuthors
->
setObjectName
(
"UBTGZeroPageInputText"
);
mpAuthors
->
setObjectName
(
"UBTGZeroPageInputText"
);
mpAuthors
->
setPlaceHolderText
(
tr
(
"Type authors here ..."
));
mpAuthors
->
setPlaceHolderText
(
tr
(
"Type authors here ..."
));
mpLayout
->
addWidget
(
mpAuthors
);
mp
ContainerWidget
Layout
->
addWidget
(
mpAuthors
);
connect
(
this
,
SIGNAL
(
resized
()),
mpAuthors
,
SLOT
(
onTextChanged
()));
connect
(
this
,
SIGNAL
(
resized
()),
mpAuthors
,
SLOT
(
onTextChanged
()));
mpCreationLabel
=
new
QLabel
(
this
);
mpCreationLabel
=
new
QLabel
(
this
);
mpCreationLabel
->
setObjectName
(
"UBTGZeroPageDateLabel"
);
mpCreationLabel
->
setObjectName
(
"UBTGZeroPageDateLabel"
);
mpLayout
->
addWidget
(
mpCreationLabel
);
mp
ContainerWidget
Layout
->
addWidget
(
mpCreationLabel
);
mpLastModifiedLabel
=
new
QLabel
(
this
);
mpLastModifiedLabel
=
new
QLabel
(
this
);
mpLastModifiedLabel
->
setObjectName
(
"UBTGZeroPageDateLabel"
);
mpLastModifiedLabel
->
setObjectName
(
"UBTGZeroPageDateLabel"
);
mpLayout
->
addWidget
(
mpLastModifiedLabel
);
mp
ContainerWidget
Layout
->
addWidget
(
mpLastModifiedLabel
);
mpSeparatorAuthors
=
new
QFrame
(
this
);
mpSeparatorAuthors
=
new
QFrame
(
this
);
mpSeparatorAuthors
->
setFixedHeight
(
UBTG_SEPARATOR_FIXED_HEIGHT
);
mpSeparatorAuthors
->
setFixedHeight
(
UBTG_SEPARATOR_FIXED_HEIGHT
);
mpSeparatorAuthors
->
setObjectName
(
"UBTGSeparator"
);
mpSeparatorAuthors
->
setObjectName
(
"UBTGSeparator"
);
mpLayout
->
addWidget
(
mpSeparatorAuthors
);
mp
ContainerWidget
Layout
->
addWidget
(
mpSeparatorAuthors
);
mpObjectivesLabel
=
new
QLabel
(
this
);
mpObjectivesLabel
=
new
QLabel
(
this
);
mpObjectivesLabel
->
setObjectName
(
"UBTGZeroPageEditionModeTitle"
);
mpObjectivesLabel
->
setObjectName
(
"UBTGZeroPageEditionModeTitle"
);
mpObjectivesLabel
->
setText
(
tr
(
"Objective(s)"
));
mpObjectivesLabel
->
setText
(
tr
(
"Objective(s)"
));
mpObjectivesLabel
->
setStyleSheet
(
chapterStyle
);
mpObjectivesLabel
->
setStyleSheet
(
chapterStyle
);
mpLayout
->
addWidget
(
mpObjectivesLabel
);
mp
ContainerWidget
Layout
->
addWidget
(
mpObjectivesLabel
);
mpObjectives
=
new
UBTGAdaptableText
(
0
,
this
);
mpObjectives
=
new
UBTGAdaptableText
(
0
,
this
);
mpObjectives
->
setObjectName
(
"UBTGZeroPageInputText"
);
mpObjectives
->
setObjectName
(
"UBTGZeroPageInputText"
);
mpObjectives
->
setPlaceHolderText
(
tr
(
"Type objectives here..."
));
mpObjectives
->
setPlaceHolderText
(
tr
(
"Type objectives here..."
));
mpLayout
->
addWidget
(
mpObjectives
);
mp
ContainerWidget
Layout
->
addWidget
(
mpObjectives
);
connect
(
this
,
SIGNAL
(
resized
()),
mpObjectives
,
SLOT
(
onTextChanged
()));
connect
(
this
,
SIGNAL
(
resized
()),
mpObjectives
,
SLOT
(
onTextChanged
()));
mpSeparatorObjectives
=
new
QFrame
(
this
);
mpSeparatorObjectives
=
new
QFrame
(
this
);
mpSeparatorObjectives
->
setFixedHeight
(
UBTG_SEPARATOR_FIXED_HEIGHT
);
mpSeparatorObjectives
->
setFixedHeight
(
UBTG_SEPARATOR_FIXED_HEIGHT
);
mpSeparatorObjectives
->
setObjectName
(
"UBTGSeparator"
);
mpSeparatorObjectives
->
setObjectName
(
"UBTGSeparator"
);
mpLayout
->
addWidget
(
mpSeparatorObjectives
);
mp
ContainerWidget
Layout
->
addWidget
(
mpSeparatorObjectives
);
mpIndexLabel
=
new
QLabel
(
this
);
mpIndexLabel
=
new
QLabel
(
this
);
mpIndexLabel
->
setObjectName
(
"UBTGZeroPageEditionModeTitle"
);
mpIndexLabel
->
setObjectName
(
"UBTGZeroPageEditionModeTitle"
);
mpIndexLabel
->
setText
(
tr
(
"Resource indexing"
));
mpIndexLabel
->
setText
(
tr
(
"Resource indexing"
));
mpIndexLabel
->
setStyleSheet
(
chapterStyle
);
mpIndexLabel
->
setStyleSheet
(
chapterStyle
);
mpLayout
->
addWidget
(
mpIndexLabel
);
mp
ContainerWidget
Layout
->
addWidget
(
mpIndexLabel
);
mpKeywordsLabel
=
new
QLabel
(
this
);
mpKeywordsLabel
=
new
QLabel
(
this
);
mpKeywordsLabel
->
setObjectName
(
"UBTGZeroPageItemLabel"
);
mpKeywordsLabel
->
setObjectName
(
"UBTGZeroPageItemLabel"
);
mpKeywordsLabel
->
setText
(
tr
(
"Keywords:"
));
mpKeywordsLabel
->
setText
(
tr
(
"Keywords:"
));
mpKeywordsLabel
->
setStyleSheet
(
chapterStyle
);
mpKeywordsLabel
->
setStyleSheet
(
chapterStyle
);
mpLayout
->
addWidget
(
mpKeywordsLabel
);
mp
ContainerWidget
Layout
->
addWidget
(
mpKeywordsLabel
);
mpKeywords
=
new
UBTGAdaptableText
(
0
,
this
);
mpKeywords
=
new
UBTGAdaptableText
(
0
,
this
);
mpKeywords
->
setPlaceHolderText
(
tr
(
"Type keywords here ..."
));
mpKeywords
->
setPlaceHolderText
(
tr
(
"Type keywords here ..."
));
mpLayout
->
addWidget
(
mpKeywords
);
mp
ContainerWidget
Layout
->
addWidget
(
mpKeywords
);
connect
(
this
,
SIGNAL
(
resized
()),
mpKeywords
,
SLOT
(
onTextChanged
()));
connect
(
this
,
SIGNAL
(
resized
()),
mpKeywords
,
SLOT
(
onTextChanged
()));
mpSchoolLevelItemLabel
=
new
QLabel
(
this
);
mpSchoolLevelItemLabel
=
new
QLabel
(
this
);
mpSchoolLevelItemLabel
->
setObjectName
(
"UBTGZeroPageItemLabel"
);
mpSchoolLevelItemLabel
->
setObjectName
(
"UBTGZeroPageItemLabel"
);
mpSchoolLevelItemLabel
->
setText
(
tr
(
"Level:"
));
mpSchoolLevelItemLabel
->
setText
(
tr
(
"Level:"
));
mpSchoolLevelItemLabel
->
setStyleSheet
(
chapterStyle
);
mpSchoolLevelItemLabel
->
setStyleSheet
(
chapterStyle
);
mpLayout
->
addWidget
(
mpSchoolLevelItemLabel
);
mp
ContainerWidget
Layout
->
addWidget
(
mpSchoolLevelItemLabel
);
mpSchoolLevelBox
=
new
QComboBox
(
this
);
mpSchoolLevelBox
=
new
QComboBox
(
this
);
mpSchoolLevelBox
->
setMinimumHeight
(
22
);
mpSchoolLevelBox
->
setMinimumHeight
(
22
);
mpSchoolLevelBox
->
setMinimumWidth
(
LOWER_RESIZE_WIDTH
);
mpSchoolLevelBox
->
setObjectName
(
"DockPaletteWidgetComboBox"
);
mpSchoolLevelBox
->
setObjectName
(
"DockPaletteWidgetComboBox"
);
connect
(
mpSchoolLevelBox
,
SIGNAL
(
currentIndexChanged
(
QString
)),
this
,
SLOT
(
onSchoolLevelChanged
(
QString
)));
connect
(
mpSchoolLevelBox
,
SIGNAL
(
currentIndexChanged
(
QString
)),
this
,
SLOT
(
onSchoolLevelChanged
(
QString
)));
mpLayout
->
addWidget
(
mpSchoolLevelBox
);
mp
ContainerWidget
Layout
->
addWidget
(
mpSchoolLevelBox
);
mpSchoolLevelValueLabel
=
new
QLabel
(
this
);
mpSchoolLevelValueLabel
=
new
QLabel
(
this
);
mpLayout
->
addWidget
(
mpSchoolLevelValueLabel
);
mp
ContainerWidget
Layout
->
addWidget
(
mpSchoolLevelValueLabel
);
mpSchoolSubjectsItemLabel
=
new
QLabel
(
this
);
mpSchoolSubjectsItemLabel
=
new
QLabel
(
this
);
mpSchoolSubjectsItemLabel
->
setObjectName
(
"UBTGZeroPageItemLabel"
);
mpSchoolSubjectsItemLabel
->
setObjectName
(
"UBTGZeroPageItemLabel"
);
mpSchoolSubjectsItemLabel
->
setText
(
tr
(
"Subjects:"
));
mpSchoolSubjectsItemLabel
->
setText
(
tr
(
"Subjects:"
));
mpSchoolSubjectsItemLabel
->
setStyleSheet
(
chapterStyle
);
mpSchoolSubjectsItemLabel
->
setStyleSheet
(
chapterStyle
);
mpLayout
->
addWidget
(
mpSchoolSubjectsItemLabel
);
mp
ContainerWidget
Layout
->
addWidget
(
mpSchoolSubjectsItemLabel
);
mpSchoolSubjectsBox
=
new
QComboBox
(
this
);
mpSchoolSubjectsBox
=
new
QComboBox
(
this
);
mpSchoolSubjectsBox
->
setMinimumHeight
(
22
);
mpSchoolSubjectsBox
->
setMinimumHeight
(
22
);
mpSchoolSubjectsBox
->
setMinimumWidth
(
LOWER_RESIZE_WIDTH
);
mpSchoolSubjectsBox
->
setObjectName
(
"DockPaletteWidgetComboBox"
);
mpSchoolSubjectsBox
->
setObjectName
(
"DockPaletteWidgetComboBox"
);
mpLayout
->
addWidget
(
mpSchoolSubjectsBox
);
mp
ContainerWidget
Layout
->
addWidget
(
mpSchoolSubjectsBox
);
mpSchoolSubjectsValueLabel
=
new
QLabel
(
this
);
mpSchoolSubjectsValueLabel
=
new
QLabel
(
this
);
mpLayout
->
addWidget
(
mpSchoolSubjectsValueLabel
);
mp
ContainerWidget
Layout
->
addWidget
(
mpSchoolSubjectsValueLabel
);
mpSchoolTypeItemLabel
=
new
QLabel
(
this
);
mpSchoolTypeItemLabel
=
new
QLabel
(
this
);
mpSchoolTypeItemLabel
->
setObjectName
(
"UBTGZeroPageItemLabel"
);
mpSchoolTypeItemLabel
->
setObjectName
(
"UBTGZeroPageItemLabel"
);
mpSchoolTypeItemLabel
->
setText
(
tr
(
"Type:"
));
mpSchoolTypeItemLabel
->
setText
(
tr
(
"Type:"
));
mpSchoolTypeItemLabel
->
setStyleSheet
(
chapterStyle
);
mpSchoolTypeItemLabel
->
setStyleSheet
(
chapterStyle
);
mpLayout
->
addWidget
(
mpSchoolTypeItemLabel
);
mp
ContainerWidget
Layout
->
addWidget
(
mpSchoolTypeItemLabel
);
mpSchoolTypeBox
=
new
QComboBox
(
this
);
mpSchoolTypeBox
=
new
QComboBox
(
this
);
mpSchoolTypeBox
->
setMinimumHeight
(
22
);
mpSchoolTypeBox
->
setMinimumHeight
(
22
);
mpSchoolTypeBox
->
setMinimumWidth
(
LOWER_RESIZE_WIDTH
);
mpSchoolTypeBox
->
setObjectName
(
"DockPaletteWidgetComboBox"
);
mpSchoolTypeBox
->
setObjectName
(
"DockPaletteWidgetComboBox"
);
mpLayout
->
addWidget
(
mpSchoolTypeBox
);
mp
ContainerWidget
Layout
->
addWidget
(
mpSchoolTypeBox
);
mpSchoolTypeValueLabel
=
new
QLabel
(
this
);
mpSchoolTypeValueLabel
=
new
QLabel
(
this
);
mpLayout
->
addWidget
(
mpSchoolTypeValueLabel
);
mp
ContainerWidget
Layout
->
addWidget
(
mpSchoolTypeValueLabel
);
mpSeparatorIndex
=
new
QFrame
(
this
);
mpSeparatorIndex
=
new
QFrame
(
this
);
mpSeparatorIndex
->
setFixedHeight
(
UBTG_SEPARATOR_FIXED_HEIGHT
);
mpSeparatorIndex
->
setFixedHeight
(
UBTG_SEPARATOR_FIXED_HEIGHT
);
mpSeparatorIndex
->
setObjectName
(
"UBTGSeparator"
);
mpSeparatorIndex
->
setObjectName
(
"UBTGSeparator"
);
mpLayout
->
addWidget
(
mpSeparatorIndex
);
mp
ContainerWidget
Layout
->
addWidget
(
mpSeparatorIndex
);
mpLicenceLabel
=
new
QLabel
(
this
);
mpLicenceLabel
=
new
QLabel
(
this
);
mpLicenceLabel
->
setObjectName
(
"UBTGZeroPageItemLabel"
);
mpLicenceLabel
->
setObjectName
(
"UBTGZeroPageItemLabel"
);
mpLicenceLabel
->
setText
(
tr
(
"Licence"
));
mpLicenceLabel
->
setText
(
tr
(
"Licence"
));
mpLicenceLabel
->
setStyleSheet
(
chapterStyle
);
mpLicenceLabel
->
setStyleSheet
(
chapterStyle
);
mpLayout
->
addWidget
(
mpLicenceLabel
);
mp
ContainerWidget
Layout
->
addWidget
(
mpLicenceLabel
);
mpLicenceBox
=
new
QComboBox
(
this
);
mpLicenceBox
=
new
QComboBox
(
this
);
mpLicenceBox
->
setMinimumHeight
(
22
);
mpLicenceBox
->
setMinimumHeight
(
22
);
mpLicenceBox
->
setMinimumWidth
(
LOWER_RESIZE_WIDTH
);
mpLicenceBox
->
setObjectName
(
"DockPaletteWidgetComboBox"
);
mpLicenceBox
->
setObjectName
(
"DockPaletteWidgetComboBox"
);
mpLayout
->
addWidget
(
mpLicenceBox
);
mp
ContainerWidget
Layout
->
addWidget
(
mpLicenceBox
);
mpLicenceLayout
=
new
QHBoxLayout
(
0
);
mpLicenceLayout
=
new
QHBoxLayout
(
0
);
mpLicenceIcon
=
new
QLabel
(
this
);
mpLicenceIcon
=
new
QLabel
(
this
);
mpLicenceIcon
->
setMinimumWidth
(
LOWER_RESIZE_WIDTH
/
2
);
mpLicenceLayout
->
addWidget
(
mpLicenceIcon
);
mpLicenceLayout
->
addWidget
(
mpLicenceIcon
);
mpLicenceValueLabel
=
new
QLabel
(
this
);
mpLicenceValueLabel
=
new
QLabel
(
this
);
mpLicenceValueLabel
->
setMinimumWidth
(
LOWER_RESIZE_WIDTH
/
2
);
mpLicenceLayout
->
addWidget
(
mpLicenceValueLabel
);
mpLicenceLayout
->
addWidget
(
mpLicenceValueLabel
);
mpLayout
->
addLayout
(
mpLicenceLayout
);
mp
ContainerWidget
Layout
->
addLayout
(
mpLicenceLayout
);
mpLayout
->
addStretch
(
1
);
mp
ContainerWidget
Layout
->
addStretch
(
1
);
connect
(
UBApplication
::
boardController
,
SIGNAL
(
activeSceneChanged
()),
this
,
SLOT
(
onActiveSceneChanged
()));
connect
(
UBApplication
::
boardController
,
SIGNAL
(
activeSceneChanged
()),
this
,
SLOT
(
onActiveSceneChanged
()));
fillComboBoxes
();
fillComboBoxes
();
...
@@ -845,6 +865,9 @@ UBTeacherGuidePageZeroWidget::~UBTeacherGuidePageZeroWidget()
...
@@ -845,6 +865,9 @@ UBTeacherGuidePageZeroWidget::~UBTeacherGuidePageZeroWidget()
DELETEPTR
(
mpModePushButton
);
DELETEPTR
(
mpModePushButton
);
DELETEPTR
(
mpLicenceLayout
);
DELETEPTR
(
mpLicenceLayout
);
DELETEPTR
(
mpButtonTitleLayout
);
DELETEPTR
(
mpButtonTitleLayout
);
DELETEPTR
(
mpContainerWidgetLayout
);
DELETEPTR
(
mpContainerWidget
);
DELETEPTR
(
mpScrollArea
);
DELETEPTR
(
mpLayout
);
DELETEPTR
(
mpLayout
);
}
}
...
@@ -895,9 +918,9 @@ void UBTeacherGuidePageZeroWidget::fillComboBoxes()
...
@@ -895,9 +918,9 @@ void UBTeacherGuidePageZeroWidget::fillComboBoxes()
parametersFile
.
close
();
parametersFile
.
close
();
QStringList
licences
;
QStringList
licences
;
licences
<<
tr
(
"Attribution CC BY"
)
licences
<<
tr
(
"Attribution-ShareAlike CC BY-SA"
)
<<
tr
(
"Attribution CC BY"
)
<<
tr
(
"Attribution-NoDerivs CC BY-ND"
)
<<
tr
(
"Attribution-NoDerivs CC BY-ND"
)
<<
tr
(
"Attribution-ShareAlike CC BY-SA"
)
<<
tr
(
"Attribution-NonCommercial CC BY-NC"
)
<<
tr
(
"Attribution-NonCommercial CC BY-NC"
)
<<
tr
(
"Attribution-NonCommercial-NoDerivs CC BY-NC-ND"
)
<<
tr
(
"Attribution-NonCommercial-NoDerivs CC BY-NC-ND"
)
<<
tr
(
"Attribution-NonCommercial-ShareAlike CC BY-NC-SA"
)
<<
tr
(
"Attribution-NonCommercial-ShareAlike CC BY-NC-SA"
)
...
@@ -905,9 +928,9 @@ void UBTeacherGuidePageZeroWidget::fillComboBoxes()
...
@@ -905,9 +928,9 @@ void UBTeacherGuidePageZeroWidget::fillComboBoxes()
<<
tr
(
"Copyright"
);
<<
tr
(
"Copyright"
);
mpLicenceBox
->
addItems
(
licences
);
mpLicenceBox
->
addItems
(
licences
);
QStringList
licenceIconList
;
QStringList
licenceIconList
;
licenceIconList
<<
":images/licenses/ccby.png"
licenceIconList
<<
":images/licenses/ccbysa.png"
<<
":images/licenses/ccby.png"
<<
":images/licenses/ccbynd.png"
<<
":images/licenses/ccbynd.png"
<<
":images/licenses/ccbysa.png"
<<
":images/licenses/ccbync.png"
<<
":images/licenses/ccbync.png"
<<
":images/licenses/ccbyncnd.png"
<<
":images/licenses/ccbyncnd.png"
<<
":images/licenses/ccbyncsa.png"
;
<<
":images/licenses/ccbyncsa.png"
;
...
@@ -923,7 +946,8 @@ void UBTeacherGuidePageZeroWidget::onSchoolLevelChanged(QString schoolLevel)
...
@@ -923,7 +946,8 @@ void UBTeacherGuidePageZeroWidget::onSchoolLevelChanged(QString schoolLevel)
mpSchoolSubjectsItemLabel
->
setEnabled
(
true
);
mpSchoolSubjectsItemLabel
->
setEnabled
(
true
);
mpSchoolSubjectsBox
->
setEnabled
(
true
);
mpSchoolSubjectsBox
->
setEnabled
(
true
);
mpSchoolSubjectsBox
->
addItems
(
subjects
);
mpSchoolSubjectsBox
->
addItems
(
subjects
);
}
else
{
}
else
{
mpSchoolSubjectsItemLabel
->
setDisabled
(
true
);
mpSchoolSubjectsItemLabel
->
setDisabled
(
true
);
mpSchoolSubjectsBox
->
setDisabled
(
true
);
mpSchoolSubjectsBox
->
setDisabled
(
true
);
}
}
...
@@ -1126,9 +1150,9 @@ bool UBTeacherGuidePageZeroWidget::isModified()
...
@@ -1126,9 +1150,9 @@ bool UBTeacherGuidePageZeroWidget::isModified()
return
result
;
return
result
;
}
}
void
UBTeacherGuidePageZeroWidget
::
resizeEvent
(
QResizeEvent
*
ev
){
void
UBTeacherGuidePageZeroWidget
::
resizeEvent
(
QResizeEvent
*
ev
)
{
emit
resized
();
emit
resized
();
QWidget
::
resizeEvent
(
ev
);
QWidget
::
resizeEvent
(
ev
);
}
}
...
...
src/gui/UBTeacherGuideWidget.h
View file @
62e5308f
...
@@ -23,7 +23,7 @@ class QVBoxLayout;
...
@@ -23,7 +23,7 @@ class QVBoxLayout;
class
QPushButton
;
class
QPushButton
;
class
UBDocumentProxy
;
class
UBDocumentProxy
;
class
UBGraphicsTextItem
;
class
UBGraphicsTextItem
;
class
QScrollArea
;
#include "UBTeacherGuideWidgetsTools.h"
#include "UBTeacherGuideWidgetsTools.h"
...
@@ -35,6 +35,8 @@ typedef enum
...
@@ -35,6 +35,8 @@ typedef enum
tUBTGZeroPageMode_PRESENTATION
tUBTGZeroPageMode_PRESENTATION
}
tUBTGZeroPageMode
;
}
tUBTGZeroPageMode
;
#define LOWER_RESIZE_WIDTH 50
/***************************************************************************
/***************************************************************************
* class UBTeacherGuideEditionWidget *
* class UBTeacherGuideEditionWidget *
***************************************************************************/
***************************************************************************/
...
@@ -155,8 +157,13 @@ private:
...
@@ -155,8 +157,13 @@ private:
QVBoxLayout
*
mpLayout
;
QVBoxLayout
*
mpLayout
;
QHBoxLayout
*
mpButtonTitleLayout
;
QHBoxLayout
*
mpButtonTitleLayout
;
QVBoxLayout
*
mpContainerWidgetLayout
;
QPushButton
*
mpModePushButton
;
QPushButton
*
mpModePushButton
;
QLabel
*
mpPageNumberLabel
;
QLabel
*
mpPageNumberLabel
;
QScrollArea
*
mpScrollArea
;
QWidget
*
mpContainerWidget
;
UBTGAdaptableText
*
mpSessionTitle
;
UBTGAdaptableText
*
mpSessionTitle
;
QFrame
*
mpSeparatorSessionTitle
;
QFrame
*
mpSeparatorSessionTitle
;
...
...
src/gui/UBTeacherGuideWidgetsTools.cpp
View file @
62e5308f
...
@@ -120,6 +120,7 @@ UBTGAdaptableText::UBTGAdaptableText(QTreeWidgetItem* widget, QWidget* parent, c
...
@@ -120,6 +120,7 @@ UBTGAdaptableText::UBTGAdaptableText(QTreeWidgetItem* widget, QWidget* parent, c
,
mMinimumHeight
(
0
)
,
mMinimumHeight
(
0
)
,
mHasPlaceHolder
(
false
)
,
mHasPlaceHolder
(
false
)
,
mIsUpdatingSize
(
false
)
,
mIsUpdatingSize
(
false
)
,
mMaximumLength
(
0
)
{
{
setObjectName
(
name
);
setObjectName
(
name
);
connect
(
this
,
SIGNAL
(
textChanged
()),
this
,
SLOT
(
onTextChanged
()));
connect
(
this
,
SIGNAL
(
textChanged
()),
this
,
SLOT
(
onTextChanged
()));
...
@@ -131,6 +132,11 @@ UBTGAdaptableText::UBTGAdaptableText(QTreeWidgetItem* widget, QWidget* parent, c
...
@@ -131,6 +132,11 @@ UBTGAdaptableText::UBTGAdaptableText(QTreeWidgetItem* widget, QWidget* parent, c
}
}
void
UBTGAdaptableText
::
setMaximumLength
(
int
length
)
{
mMaximumLength
=
length
;
}
void
UBTGAdaptableText
::
setPlaceHolderText
(
QString
text
)
void
UBTGAdaptableText
::
setPlaceHolderText
(
QString
text
)
{
{
mHasPlaceHolder
=
true
;
mHasPlaceHolder
=
true
;
...
@@ -166,6 +172,12 @@ void UBTGAdaptableText::keyReleaseEvent(QKeyEvent* e)
...
@@ -166,6 +172,12 @@ void UBTGAdaptableText::keyReleaseEvent(QKeyEvent* e)
setTextColor
(
QColor
(
Qt
::
lightGray
));
setTextColor
(
QColor
(
Qt
::
lightGray
));
setPlainText
(
mPlaceHolderText
);
setPlainText
(
mPlaceHolderText
);
}
}
if
(
mMaximumLength
&&
toPlainText
().
length
()
>
mMaximumLength
){
setPlainText
(
toPlainText
().
left
(
mMaximumLength
));
QTextCursor
tc
(
document
());
tc
.
setPosition
(
mMaximumLength
);
setTextCursor
(
tc
);
}
}
}
void
UBTGAdaptableText
::
showEvent
(
QShowEvent
*
e
)
void
UBTGAdaptableText
::
showEvent
(
QShowEvent
*
e
)
...
@@ -212,8 +224,10 @@ void UBTGAdaptableText::onTextChanged()
...
@@ -212,8 +224,10 @@ void UBTGAdaptableText::onTextChanged()
setFocus
();
setFocus
();
}
}
mIsUpdatingSize
=
false
;
mIsUpdatingSize
=
false
;
}
}
void
UBTGAdaptableText
::
setInitialText
(
const
QString
&
text
)
void
UBTGAdaptableText
::
setInitialText
(
const
QString
&
text
)
{
{
setText
(
text
);
setText
(
text
);
...
...
src/gui/UBTeacherGuideWidgetsTools.h
View file @
62e5308f
...
@@ -97,6 +97,7 @@ public:
...
@@ -97,6 +97,7 @@ public:
void
setPlaceHolderText
(
QString
text
);
void
setPlaceHolderText
(
QString
text
);
QString
text
();
QString
text
();
void
setInitialText
(
const
QString
&
text
);
void
setInitialText
(
const
QString
&
text
);
void
setMaximumLength
(
int
length
);
public
slots
:
public
slots
:
void
onTextChanged
();
void
onTextChanged
();
...
@@ -113,6 +114,7 @@ private:
...
@@ -113,6 +114,7 @@ private:
bool
mHasPlaceHolder
;
bool
mHasPlaceHolder
;
QString
mPlaceHolderText
;
QString
mPlaceHolderText
;
bool
mIsUpdatingSize
;
bool
mIsUpdatingSize
;
int
mMaximumLength
;
};
};
...
...
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