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
43efc824
Commit
43efc824
authored
Jul 20, 2012
by
Anatoly Mihalchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge with actual code
parent
350fd8ff
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
18 additions
and
15 deletions
+18
-15
UBBoardController.cpp
src/board/UBBoardController.cpp
+2
-0
UBBoardController.h
src/board/UBBoardController.h
+3
-0
UBApplication.cpp
src/core/UBApplication.cpp
+0
-2
UBGraphicsMediaItem.cpp
src/domain/UBGraphicsMediaItem.cpp
+2
-2
UBTeacherGuideWidget.cpp
src/gui/UBTeacherGuideWidget.cpp
+7
-7
UBTeacherGuideWidgetsTools.cpp
src/gui/UBTeacherGuideWidgetsTools.cpp
+4
-4
No files found.
src/board/UBBoardController.cpp
View file @
43efc824
...
...
@@ -87,6 +87,7 @@ UBBoardController::UBBoardController(UBMainWindow* mainWindow)
,
mIsClosing
(
false
)
,
mSystemScaleFactor
(
1.0
)
,
mCleanupDone
(
false
)
,
mCacheWidgetIsEnabled
(
false
)
{
mZoomFactor
=
UBSettings
::
settings
()
->
boardZoomFactor
->
get
().
toDouble
();
...
...
@@ -1712,6 +1713,7 @@ void UBBoardController::notifyCache(bool visible)
{
emit
cacheDisabled
();
}
mCacheWidgetIsEnabled
=
visible
;
}
void
UBBoardController
::
updatePageSizeState
()
...
...
src/board/UBBoardController.h
View file @
43efc824
...
...
@@ -159,6 +159,8 @@ class UBBoardController : public UBDocumentContainer
void
duplicateScene
(
int
index
);
void
deleteScene
(
int
index
);
bool
cacheIsVisible
()
{
return
mCacheWidgetIsEnabled
;}
public
slots
:
void
showDocumentsDialog
();
void
showKeyboard
(
bool
show
);
...
...
@@ -277,6 +279,7 @@ class UBBoardController : public UBDocumentContainer
qreal
mSystemScaleFactor
;
bool
mCleanupDone
;
QMap
<
QAction
*
,
QPair
<
QString
,
QString
>
>
mActionTexts
;
bool
mCacheWidgetIsEnabled
;
private
slots
:
void
stylusToolDoubleClicked
(
int
tool
);
...
...
src/core/UBApplication.cpp
View file @
43efc824
...
...
@@ -317,8 +317,6 @@ int UBApplication::exec(const QString& pFileToImport)
connect
(
mainWindow
->
actionHideApplication
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
showMinimized
()));
#endif
connect
(
documentController
,
SIGNAL
(
movedToIndex
(
int
)),
boardController
,
SIGNAL
(
documentReorganized
(
int
)));
mPreferencesController
=
new
UBPreferencesController
(
mainWindow
);
connect
(
mainWindow
->
actionPreferences
,
SIGNAL
(
triggered
()),
mPreferencesController
,
SLOT
(
show
()));
...
...
src/domain/UBGraphicsMediaItem.cpp
View file @
43efc824
...
...
@@ -142,8 +142,8 @@ void UBGraphicsMediaItem::clearSource()
{
QString
path
=
mediaFileUrl
().
toLocalFile
();
//if path is absolute clean duplicated path string
if
(
!
path
.
contains
(
UBApplication
::
boardController
->
active
Document
()
->
persistencePath
()))
path
=
UBApplication
::
boardController
->
active
Document
()
->
persistencePath
()
+
"/"
+
path
;
if
(
!
path
.
contains
(
UBApplication
::
boardController
->
selected
Document
()
->
persistencePath
()))
path
=
UBApplication
::
boardController
->
selected
Document
()
->
persistencePath
()
+
"/"
+
path
;
if
(
!
UBFileSystemUtils
::
deleteFile
(
path
))
qDebug
()
<<
"cannot delete file: "
<<
path
;
...
...
src/gui/UBTeacherGuideWidget.cpp
View file @
43efc824
...
...
@@ -245,7 +245,7 @@ void UBTeacherGuideEditionWidget::onActiveSceneChanged()
cleanData
();
load
(
UBSvgSubsetAdaptor
::
readTeacherGuideNode
(
UBApplication
::
boardController
->
activeSceneIndex
()));
mpPageNumberLabel
->
setText
(
tr
(
"Page: %0"
).
arg
(
currentPage
));
UBDocumentProxy
*
documentProxy
=
UBApplication
::
boardController
->
active
Document
();
UBDocumentProxy
*
documentProxy
=
UBApplication
::
boardController
->
selected
Document
();
if
(
mpDocumentTitle
)
mpDocumentTitle
->
setText
(
documentProxy
->
metaData
(
UBSettings
::
sessionTitle
).
toString
());
}
...
...
@@ -483,7 +483,7 @@ void UBTeacherGuidePresentationWidget::onActiveSceneChanged()
{
cleanData
();
mpPageNumberLabel
->
setText
(
tr
(
"Page: %0"
).
arg
(
UBApplication
::
boardController
->
currentPage
()));
UBDocumentProxy
*
documentProxy
=
UBApplication
::
boardController
->
active
Document
();
UBDocumentProxy
*
documentProxy
=
UBApplication
::
boardController
->
selected
Document
();
if
(
mpDocumentTitle
)
mpDocumentTitle
->
setText
(
documentProxy
->
metaData
(
UBSettings
::
sessionTitle
).
toString
());
}
...
...
@@ -535,9 +535,9 @@ void UBTeacherGuidePresentationWidget::showData(QVector<tUBGEElementNode*> data)
newWidgetItem
->
setData
(
0
,
Qt
::
FontRole
,
QVariant
(
QFont
(
QApplication
::
font
().
family
(),
11
)));
QString
mimeTypeString
;
#ifdef Q_WS_WIN
mimeTypeString
=
QUrl
::
fromLocalFile
(
UBApplication
::
boardController
->
active
Document
()
->
persistencePath
()
+
"/"
+
element
->
attributes
.
value
(
"relativePath"
)).
toString
();
mimeTypeString
=
QUrl
::
fromLocalFile
(
UBApplication
::
boardController
->
selected
Document
()
->
persistencePath
()
+
"/"
+
element
->
attributes
.
value
(
"relativePath"
)).
toString
();
#else
mimeTypeString
=
UBApplication
::
boardController
->
active
Document
()
->
persistencePath
()
+
"/"
+
element
->
attributes
.
value
(
"relativePath"
);
mimeTypeString
=
UBApplication
::
boardController
->
selected
Document
()
->
persistencePath
()
+
"/"
+
element
->
attributes
.
value
(
"relativePath"
);
#endif
newWidgetItem
->
setData
(
0
,
TG_USER_ROLE_MIME_TYPE
,
mimeTypeString
);
newWidgetItem
->
setFlags
(
Qt
::
ItemIsDragEnabled
|
Qt
::
ItemIsEnabled
|
Qt
::
ItemIsSelectable
);
...
...
@@ -882,7 +882,7 @@ void UBTeacherGuidePageZeroWidget::onSchoolLevelChanged(QString schoolLevel)
void
UBTeacherGuidePageZeroWidget
::
onActiveSceneChanged
()
{
UBDocumentProxy
*
documentProxy
=
UBApplication
::
boardController
->
active
Document
();
UBDocumentProxy
*
documentProxy
=
UBApplication
::
boardController
->
selected
Document
();
if
(
documentProxy
&&
UBApplication
::
boardController
->
currentPage
()
==
0
){
QDateTime
creationDate
=
documentProxy
->
documentDate
();
mpCreationLabel
->
setText
(
tr
(
"Created the:
\n
"
)
+
creationDate
.
toString
(
Qt
::
DefaultLocaleShortDate
));
...
...
@@ -901,7 +901,7 @@ void UBTeacherGuidePageZeroWidget::hideEvent ( QHideEvent * event )
void
UBTeacherGuidePageZeroWidget
::
loadData
()
{
UBDocumentProxy
*
documentProxy
=
UBApplication
::
boardController
->
active
Document
();
UBDocumentProxy
*
documentProxy
=
UBApplication
::
boardController
->
selected
Document
();
mpSessionTitle
->
setText
(
documentProxy
->
metaData
(
UBSettings
::
sessionTitle
).
toString
());
mpAuthors
->
setText
(
documentProxy
->
metaData
(
UBSettings
::
sessionAuthors
).
toString
());
mpObjectives
->
setText
(
documentProxy
->
metaData
(
UBSettings
::
sessionObjectives
).
toString
());
...
...
@@ -925,7 +925,7 @@ void UBTeacherGuidePageZeroWidget::persistData()
// check necessary because at document closing hide event is send after boardcontroller set
// to NULL
if
(
UBApplication
::
boardController
){
UBDocumentProxy
*
documentProxy
=
UBApplication
::
boardController
->
active
Document
();
UBDocumentProxy
*
documentProxy
=
UBApplication
::
boardController
->
selected
Document
();
documentProxy
->
setMetaData
(
UBSettings
::
sessionTitle
,
mpSessionTitle
->
text
());
documentProxy
->
setMetaData
(
UBSettings
::
sessionAuthors
,
mpAuthors
->
text
());
documentProxy
->
setMetaData
(
UBSettings
::
sessionObjectives
,
mpObjectives
->
text
());
...
...
src/gui/UBTeacherGuideWidgetsTools.cpp
View file @
43efc824
...
...
@@ -316,7 +316,7 @@ UBTGMediaWidget::UBTGMediaWidget(QString mediaPath, QTreeWidgetItem* widget, QWi
,
mIsInitializationMode
(
false
)
{
setObjectName
(
name
);
mMediaPath
=
UBApplication
::
boardController
->
active
Document
()
->
persistencePath
()
+
"/"
+
mediaPath
;
mMediaPath
=
UBApplication
::
boardController
->
selected
Document
()
->
persistencePath
()
+
"/"
+
mediaPath
;
setAcceptDrops
(
false
);
createWorkWidget
();
setFixedHeight
(
200
);
...
...
@@ -340,7 +340,7 @@ void UBTGMediaWidget::initializeWithDom(QDomElement element)
{
mIsInitializationMode
=
true
;
setAcceptDrops
(
false
);
mMediaPath
=
UBApplication
::
boardController
->
active
Document
()
->
persistencePath
()
+
"/"
+
element
.
attribute
(
"relativePath"
);
mMediaPath
=
UBApplication
::
boardController
->
selected
Document
()
->
persistencePath
()
+
"/"
+
element
.
attribute
(
"relativePath"
);
qDebug
()
<<
mMediaPath
;
createWorkWidget
();
setFixedHeight
(
200
);
...
...
@@ -377,7 +377,7 @@ tUBGEElementNode* UBTGMediaWidget::saveData()
return
0
;
tUBGEElementNode
*
result
=
new
tUBGEElementNode
();
QString
relativePath
=
mMediaPath
;
relativePath
=
relativePath
.
replace
(
UBApplication
::
boardController
->
active
Document
()
->
persistencePath
()
+
"/"
,
""
);
relativePath
=
relativePath
.
replace
(
UBApplication
::
boardController
->
selected
Document
()
->
persistencePath
()
+
"/"
,
""
);
result
->
name
=
"media"
;
result
->
attributes
.
insert
(
"title"
,
mpTitle
->
text
());
result
->
attributes
.
insert
(
"relativePath"
,
relativePath
);
...
...
@@ -394,7 +394,7 @@ void UBTGMediaWidget::createWorkWidget()
{
QString
mimeType
=
UBFileSystemUtils
::
mimeTypeFromFileName
(
mMediaPath
);
bool
setMedia
=
true
;
UBDocumentProxy
*
proxyDocument
=
UBApplication
::
boardController
->
active
Document
();
UBDocumentProxy
*
proxyDocument
=
UBApplication
::
boardController
->
selected
Document
();
if
(
mimeType
.
contains
(
"audio"
)
||
mimeType
.
contains
(
"video"
)){
mMediaType
=
mimeType
.
contains
(
"audio"
)
?
"audio"
:
"movie"
;
mpMediaWidget
=
new
UBMediaWidget
(
mimeType
.
contains
(
"audio"
)
?
eMediaType_Audio
:
eMediaType_Video
);
...
...
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