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
Expand all
Show 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 @@
<file>images/teacherGuide/pencil.svg</file>
<file>images/duplicateDisabled.svg</file>
<file>images/teacherGuide/flash_24x24.svg</file>
<file>images/toque.png</file>
</qresource>
</RCC>
src/document/UBDocumentController.cpp
View file @
62e5308f
...
...
@@ -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
(
resized
()),
this
,
SLOT
(
thumbnailViewResized
()));
connect
(
mDocumentUI
->
thumbnailWidget
,
SIGNAL
(
mouseDoubleClick
(
QGraphicsItem
*
,
int
)),
this
,
SLOT
(
pageDoubleClicked
(
QGraphicsItem
*
,
int
)));
connect
(
mDocumentUI
->
thumbnailWidget
,
SIGNAL
(
mouseClick
(
QGraphicsItem
*
,
int
)),
this
,
SLOT
(
pageClicked
(
QGraphicsItem
*
,
int
)));
connect
(
mDocumentUI
->
thumbnailWidget
,
SIGNAL
(
mouseDoubleClick
(
QGraphicsItem
*
,
int
)),
this
,
SLOT
(
pageDoubleClicked
(
QGraphicsItem
*
,
int
)));
connect
(
mDocumentUI
->
thumbnailWidget
,
SIGNAL
(
mouseClick
(
QGraphicsItem
*
,
int
)),
this
,
SLOT
(
pageClicked
(
QGraphicsItem
*
,
int
)));
connect
(
mDocumentUI
->
thumbnailWidget
->
scene
(),
SIGNAL
(
selectionChanged
()),
this
,
SLOT
(
pageSelectionChanged
()));
connect
(
mDocumentUI
->
thumbnailWidget
->
scene
(),
SIGNAL
(
selectionChanged
()),
this
,
SLOT
(
pageSelectionChanged
()));
connect
(
UBPersistenceManager
::
persistenceManager
(),
SIGNAL
(
documentCreated
(
UBDocumentProxy
*
)),
this
,
SLOT
(
addDocumentInTree
(
UBDocumentProxy
*
)));
connect
(
UBPersistenceManager
::
persistenceManager
(),
SIGNAL
(
documentCreated
(
UBDocumentProxy
*
)),
this
,
SLOT
(
addDocumentInTree
(
UBDocumentProxy
*
)));
connect
(
UBPersistenceManager
::
persistenceManager
(),
SIGNAL
(
documentMetadataChanged
(
UBDocumentProxy
*
)),
this
,
SLOT
(
updateDocumentInTree
(
UBDocumentProxy
*
)));
connect
(
UBPersistenceManager
::
persistenceManager
(),
SIGNAL
(
documentMetadataChanged
(
UBDocumentProxy
*
)),
this
,
SLOT
(
updateDocumentInTree
(
UBDocumentProxy
*
)));
connect
(
UBPersistenceManager
::
persistenceManager
(),
SIGNAL
(
documentSceneCreated
(
UBDocumentProxy
*
,
int
)),
this
,
SLOT
(
documentSceneChanged
(
UBDocumentProxy
*
,
int
)));
connect
(
UBPersistenceManager
::
persistenceManager
(),
SIGNAL
(
documentSceneCreated
(
UBDocumentProxy
*
,
int
)),
this
,
SLOT
(
documentSceneChanged
(
UBDocumentProxy
*
,
int
)));
connect
(
UBPersistenceManager
::
persistenceManager
(),
SIGNAL
(
documentSceneWillBeDeleted
(
UBDocumentProxy
*
,
int
)),
this
,
SLOT
(
documentSceneChanged
(
UBDocumentProxy
*
,
int
)));
connect
(
UBPersistenceManager
::
persistenceManager
(),
SIGNAL
(
documentSceneWillBeDeleted
(
UBDocumentProxy
*
,
int
)),
this
,
SLOT
(
documentSceneChanged
(
UBDocumentProxy
*
,
int
)));
mDocumentUI
->
thumbnailWidget
->
setBackgroundBrush
(
UBSettings
::
documentViewLightColor
);
...
...
@@ -1006,7 +999,7 @@ void UBDocumentController::addFolderOfImages()
if
(
importedImageNumber
==
0
)
{
showMessage
(
tr
(
"Folder does not contain any image files
!
"
));
showMessage
(
tr
(
"Folder does not contain any image files"
));
UBApplication
::
applicationController
->
showDocument
();
}
else
...
...
src/gui/UBDocumentNavigator.cpp
View file @
62e5308f
...
...
@@ -69,6 +69,9 @@ UBDocumentNavigator::~UBDocumentNavigator()
}
}
#include "gui/UBDockTeacherGuideWidget.h"
#include "gui/UBTeacherGuideWidget.h"
/**
* \brief Generate the thumbnails
*/
...
...
@@ -84,9 +87,30 @@ void UBDocumentNavigator::generateThumbnails(UBDocumentContainer* source)
for
(
int
i
=
0
;
i
<
source
->
selectedDocument
()
->
pageCount
();
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
);
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
);
...
...
@@ -104,7 +128,7 @@ void UBDocumentNavigator::generateThumbnails(UBDocumentContainer* source)
void
UBDocumentNavigator
::
onScrollToSelectedPage
(
int
index
)
{
qDebug
()
<<
"Selection in widet: "
<<
index
;
qDebug
()
<<
"Selection in wid
g
et: "
<<
index
;
int
c
=
0
;
foreach
(
UBImgTextThumbnailElement
el
,
mThumbsWithLabels
)
{
...
...
@@ -118,7 +142,6 @@ void UBDocumentNavigator::onScrollToSelectedPage(int index)
}
c
++
;
}
// centerOn(mThumbsWithLabels[index].getThumbnail());
}
/**
...
...
@@ -131,8 +154,7 @@ void UBDocumentNavigator::updateSpecificThumbnail(int iPage)
//UBGraphicsScene* pScene = UBApplication::boardController->activeScene();
const
QPixmap
*
pix
=
UBApplication
::
boardController
->
pageAt
(
iPage
);
UBSceneThumbnailNavigPixmap
*
newItem
=
new
UBSceneThumbnailNavigPixmap
(
*
pix
,
UBApplication
::
boardController
->
selectedDocument
(),
iPage
);
UBSceneThumbnailNavigPixmap
*
newItem
=
new
UBSceneThumbnailNavigPixmap
(
*
pix
,
UBApplication
::
boardController
->
selectedDocument
(),
iPage
);
// Get the old thumbnail
UBSceneThumbnailNavigPixmap
*
oldItem
=
mThumbsWithLabels
.
at
(
iPage
).
getThumbnail
();
...
...
src/gui/UBTeacherGuideWidget.cpp
View file @
62e5308f
This diff is collapsed.
Click to expand it.
src/gui/UBTeacherGuideWidget.h
View file @
62e5308f
...
...
@@ -23,7 +23,7 @@ class QVBoxLayout;
class
QPushButton
;
class
UBDocumentProxy
;
class
UBGraphicsTextItem
;
class
QScrollArea
;
#include "UBTeacherGuideWidgetsTools.h"
...
...
@@ -35,6 +35,8 @@ typedef enum
tUBTGZeroPageMode_PRESENTATION
}
tUBTGZeroPageMode
;
#define LOWER_RESIZE_WIDTH 50
/***************************************************************************
* class UBTeacherGuideEditionWidget *
***************************************************************************/
...
...
@@ -155,8 +157,13 @@ private:
QVBoxLayout
*
mpLayout
;
QHBoxLayout
*
mpButtonTitleLayout
;
QVBoxLayout
*
mpContainerWidgetLayout
;
QPushButton
*
mpModePushButton
;
QLabel
*
mpPageNumberLabel
;
QScrollArea
*
mpScrollArea
;
QWidget
*
mpContainerWidget
;
UBTGAdaptableText
*
mpSessionTitle
;
QFrame
*
mpSeparatorSessionTitle
;
...
...
src/gui/UBTeacherGuideWidgetsTools.cpp
View file @
62e5308f
...
...
@@ -120,6 +120,7 @@ UBTGAdaptableText::UBTGAdaptableText(QTreeWidgetItem* widget, QWidget* parent, c
,
mMinimumHeight
(
0
)
,
mHasPlaceHolder
(
false
)
,
mIsUpdatingSize
(
false
)
,
mMaximumLength
(
0
)
{
setObjectName
(
name
);
connect
(
this
,
SIGNAL
(
textChanged
()),
this
,
SLOT
(
onTextChanged
()));
...
...
@@ -131,6 +132,11 @@ UBTGAdaptableText::UBTGAdaptableText(QTreeWidgetItem* widget, QWidget* parent, c
}
void
UBTGAdaptableText
::
setMaximumLength
(
int
length
)
{
mMaximumLength
=
length
;
}
void
UBTGAdaptableText
::
setPlaceHolderText
(
QString
text
)
{
mHasPlaceHolder
=
true
;
...
...
@@ -166,6 +172,12 @@ void UBTGAdaptableText::keyReleaseEvent(QKeyEvent* e)
setTextColor
(
QColor
(
Qt
::
lightGray
));
setPlainText
(
mPlaceHolderText
);
}
if
(
mMaximumLength
&&
toPlainText
().
length
()
>
mMaximumLength
){
setPlainText
(
toPlainText
().
left
(
mMaximumLength
));
QTextCursor
tc
(
document
());
tc
.
setPosition
(
mMaximumLength
);
setTextCursor
(
tc
);
}
}
void
UBTGAdaptableText
::
showEvent
(
QShowEvent
*
e
)
...
...
@@ -213,7 +225,9 @@ void UBTGAdaptableText::onTextChanged()
}
mIsUpdatingSize
=
false
;
}
void
UBTGAdaptableText
::
setInitialText
(
const
QString
&
text
)
{
setText
(
text
);
...
...
src/gui/UBTeacherGuideWidgetsTools.h
View file @
62e5308f
...
...
@@ -97,6 +97,7 @@ public:
void
setPlaceHolderText
(
QString
text
);
QString
text
();
void
setInitialText
(
const
QString
&
text
);
void
setMaximumLength
(
int
length
);
public
slots
:
void
onTextChanged
();
...
...
@@ -113,6 +114,7 @@ private:
bool
mHasPlaceHolder
;
QString
mPlaceHolderText
;
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