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
31e8bbd1
Commit
31e8bbd1
authored
Jul 24, 2012
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:Sankore/Sankore-3.1
parents
94318e95
fff44729
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
24 additions
and
101 deletions
+24
-101
UBSvgSubsetAdaptor.cpp
src/adaptors/UBSvgSubsetAdaptor.cpp
+4
-1
UBThumbnailAdaptor.cpp
src/adaptors/UBThumbnailAdaptor.cpp
+15
-73
UBThumbnailAdaptor.h
src/adaptors/UBThumbnailAdaptor.h
+1
-0
UBBoardController.cpp
src/board/UBBoardController.cpp
+0
-14
UBBoardPaletteManager.cpp
src/board/UBBoardPaletteManager.cpp
+1
-1
UBPersistenceManager.cpp
src/core/UBPersistenceManager.cpp
+1
-1
UBDocumentController.cpp
src/document/UBDocumentController.cpp
+0
-7
UBDocumentController.h
src/document/UBDocumentController.h
+0
-3
UBTeacherGuideWidget.cpp
src/gui/UBTeacherGuideWidget.cpp
+2
-1
No files found.
src/adaptors/UBSvgSubsetAdaptor.cpp
View file @
31e8bbd1
...
@@ -1405,7 +1405,10 @@ bool UBSvgSubsetAdaptor::UBSvgSubsetWriter::persistScene(int pageIndex)
...
@@ -1405,7 +1405,10 @@ bool UBSvgSubsetAdaptor::UBSvgSubsetWriter::persistScene(int pageIndex)
}
}
QMap
<
QString
,
IDataStorage
*>
elements
=
getAdditionalElementToStore
();
QMap
<
QString
,
IDataStorage
*>
elements
=
getAdditionalElementToStore
();
QVector
<
tIDataStorage
*>
dataStorageItems
=
elements
.
value
(
"teacherGuide"
)
->
save
(
pageIndex
);
QVector
<
tIDataStorage
*>
dataStorageItems
;
if
(
elements
.
value
(
"teacherGuide"
))
dataStorageItems
=
elements
.
value
(
"teacherGuide"
)
->
save
(
pageIndex
);
foreach
(
tIDataStorage
*
eachItem
,
dataStorageItems
){
foreach
(
tIDataStorage
*
eachItem
,
dataStorageItems
){
if
(
eachItem
->
type
==
eElementType_START
){
if
(
eachItem
->
type
==
eElementType_START
){
mXmlWriter
.
writeStartElement
(
eachItem
->
name
);
mXmlWriter
.
writeStartElement
(
eachItem
->
name
);
...
...
src/adaptors/UBThumbnailAdaptor.cpp
View file @
31e8bbd1
...
@@ -91,9 +91,22 @@ const QPixmap* UBThumbnailAdaptor::get(UBDocumentProxy* proxy, int pageIndex)
...
@@ -91,9 +91,22 @@ const QPixmap* UBThumbnailAdaptor::get(UBDocumentProxy* proxy, int pageIndex)
return
pix
;
return
pix
;
}
}
void
UBThumbnailAdaptor
::
updateDocumentToHandleZeroPage
(
UBDocumentProxy
*
proxy
)
{
if
(
UBSettings
::
settings
()
->
teacherGuidePageZeroActivated
->
get
().
toBool
()){
QString
fileName
=
proxy
->
persistencePath
()
+
UBFileSystemUtils
::
digitFileFormat
(
"/page%1.svg"
,
0
);
QFile
file
(
fileName
);
qDebug
()
<<
fileName
;
if
(
!
file
.
exists
()){
UBPersistenceManager
::
persistenceManager
()
->
persistDocumentScene
(
proxy
,
new
UBGraphicsScene
(
proxy
),
0
);
}
}
}
void
UBThumbnailAdaptor
::
load
(
UBDocumentProxy
*
proxy
,
QList
<
const
QPixmap
*>&
list
)
void
UBThumbnailAdaptor
::
load
(
UBDocumentProxy
*
proxy
,
QList
<
const
QPixmap
*>&
list
)
{
{
generateMissingThumbnails
(
proxy
);
updateDocumentToHandleZeroPage
(
proxy
);
generateMissingThumbnails
(
proxy
);
foreach
(
const
QPixmap
*
pm
,
list
)
foreach
(
const
QPixmap
*
pm
,
list
)
delete
pm
;
delete
pm
;
...
@@ -102,81 +115,10 @@ void UBThumbnailAdaptor::load(UBDocumentProxy* proxy, QList<const QPixmap*>& lis
...
@@ -102,81 +115,10 @@ void UBThumbnailAdaptor::load(UBDocumentProxy* proxy, QList<const QPixmap*>& lis
list
.
append
(
get
(
proxy
,
i
));
list
.
append
(
get
(
proxy
,
i
));
}
}
/*
QList<QPixmap> UBThumbnailAdaptor::load(UBDocumentProxy* proxy)
{
QList<QPixmap> thumbnails;
qDebug() << "Loadinf thumbnails for " << proxy->name();
if (!proxy || proxy->persistencePath().isEmpty())
return thumbnails;
//compatibility with older formats (<= 4.0.b.2.0) : generate missing thumbnails
generateMissingThumbnails(proxy);
//end compatibility with older format
bool moreToProcess = true;
int pageCount = UBApplication::boardController->sceneIndexFromPage(0);
while (moreToProcess) {
pageCount++;
QString fileName = proxy->persistencePath() + UBFileSystemUtils::digitFileFormat("/page%1.thumbnail.jpg", pageCount);
QFile file(fileName);
if (file.exists()) {
QPixmap pix;
//Warning. Works only with modified Qt
#ifdef Q_WS_X11
//pix.load(fileName, 0, Qt::AutoColor);
pix.load(fileName, 0);
#else
pix.load(fileName, 0, Qt::AutoColor, false);
#endif
thumbnails.append(pix);
} else {
moreToProcess = false;
}
}
return thumbnails;
}
QPixmap UBThumbnailAdaptor::load(UBDocumentProxy* proxy, int index)
{
qDebug() << "Loadinf thumbnails for " << proxy->name();
int existingPageCount = proxy->pageCount();
if (!proxy || proxy->persistencePath().size() == 0 || index < 0 || index > existingPageCount)
return QPixmap();
//compatibility with older formats (<= 4.0.b.2.0) : generate missing thumbnails
generateMissingThumbnails(proxy);
//end compatibility with older format
QString fileName = proxy->persistencePath() + UBFileSystemUtils::digitFileFormat("/page%1.thumbnail.jpg", index);
QFile file(fileName);
if (file.exists())
{
QPixmap pix;
//Warning. Works only with modified Qt
#ifdef Q_WS_X11
pix.load(fileName, 0, Qt::AutoColor);
#else
pix.load(fileName, 0, Qt::AutoColor, false);
#endif
return pix;
}
return QPixmap();
}
*/
void
UBThumbnailAdaptor
::
persistScene
(
UBDocumentProxy
*
proxy
,
UBGraphicsScene
*
pScene
,
int
pageIndex
,
bool
overrideModified
)
void
UBThumbnailAdaptor
::
persistScene
(
UBDocumentProxy
*
proxy
,
UBGraphicsScene
*
pScene
,
int
pageIndex
,
bool
overrideModified
)
{
{
qDebug
()
<<
"Persist
e
scene on path "
<<
proxy
->
persistencePath
()
<<
", index "
<<
pageIndex
;
qDebug
()
<<
"Persist scene on path "
<<
proxy
->
persistencePath
()
<<
", index "
<<
pageIndex
;
QString
fileName
=
proxy
->
persistencePath
()
+
UBFileSystemUtils
::
digitFileFormat
(
"/page%1.thumbnail.jpg"
,
pageIndex
);
QString
fileName
=
proxy
->
persistencePath
()
+
UBFileSystemUtils
::
digitFileFormat
(
"/page%1.thumbnail.jpg"
,
pageIndex
);
...
...
src/adaptors/UBThumbnailAdaptor.h
View file @
31e8bbd1
...
@@ -35,6 +35,7 @@ public:
...
@@ -35,6 +35,7 @@ public:
private
:
private
:
static
void
generateMissingThumbnails
(
UBDocumentProxy
*
proxy
);
static
void
generateMissingThumbnails
(
UBDocumentProxy
*
proxy
);
static
void
updateDocumentToHandleZeroPage
(
UBDocumentProxy
*
proxy
);
UBThumbnailAdaptor
()
{}
UBThumbnailAdaptor
()
{}
};
};
...
...
src/board/UBBoardController.cpp
View file @
31e8bbd1
...
@@ -69,7 +69,6 @@
...
@@ -69,7 +69,6 @@
#include "core/UBSettings.h"
#include "core/UBSettings.h"
#include "core/memcheck.h"
#include "core/memcheck.h"
//#include <typeinfo>
UBBoardController
::
UBBoardController
(
UBMainWindow
*
mainWindow
)
UBBoardController
::
UBBoardController
(
UBMainWindow
*
mainWindow
)
:
UBDocumentContainer
(
mainWindow
->
centralWidget
())
:
UBDocumentContainer
(
mainWindow
->
centralWidget
())
...
@@ -106,18 +105,6 @@ void UBBoardController::init()
...
@@ -106,18 +105,6 @@ void UBBoardController::init()
setupViews
();
setupViews
();
setupToolbar
();
setupToolbar
();
//connect(UBPersistenceManager::persistenceManager(), SIGNAL(documentWillBeDeleted(UBDocumentProxy*))
// , this, SLOT(documentWillBeDeleted(UBDocumentProxy*)));
//connect(UBPersistenceManager::persistenceManager(), SIGNAL(documentSceneCreated(UBDocumentProxy*, int))
// , this, SLOT(documentSceneChanged(UBDocumentProxy*, int)));
//connect(UBPersistenceManager::persistenceManager(), SIGNAL(documentSceneDeleted(UBDocumentProxy*, int))
// , this, SLOT(documentSceneChanged(UBDocumentProxy*, int)));
//connect(UBPersistenceManager::persistenceManager(), SIGNAL(documentSceneMoved(UBDocumentProxy*, int))
// , this, SLOT(documentSceneChanged(UBDocumentProxy*, int)));
connect
(
UBApplication
::
undoStack
,
SIGNAL
(
canUndoChanged
(
bool
))
connect
(
UBApplication
::
undoStack
,
SIGNAL
(
canUndoChanged
(
bool
))
,
this
,
SLOT
(
undoRedoStateChange
(
bool
)));
,
this
,
SLOT
(
undoRedoStateChange
(
bool
)));
...
@@ -468,7 +455,6 @@ void UBBoardController::addScene()
...
@@ -468,7 +455,6 @@ void UBBoardController::addScene()
QApplication
::
restoreOverrideCursor
();
QApplication
::
restoreOverrideCursor
();
}
}
void
UBBoardController
::
addScene
(
UBGraphicsScene
*
scene
,
bool
replaceActiveIfEmpty
)
void
UBBoardController
::
addScene
(
UBGraphicsScene
*
scene
,
bool
replaceActiveIfEmpty
)
{
{
if
(
scene
)
if
(
scene
)
...
...
src/board/UBBoardPaletteManager.cpp
View file @
31e8bbd1
...
@@ -150,7 +150,7 @@ void UBBoardPaletteManager::setupDockPaletteWidgets()
...
@@ -150,7 +150,7 @@ void UBBoardPaletteManager::setupDockPaletteWidgets()
mLeftPalette
->
registerWidget
(
mpPageNavigWidget
);
mLeftPalette
->
registerWidget
(
mpPageNavigWidget
);
mLeftPalette
->
addTab
(
mpPageNavigWidget
);
mLeftPalette
->
addTab
(
mpPageNavigWidget
);
if
(
UBSettings
::
settings
()
->
teacherGuidePageZeroActivated
||
UBSettings
::
settings
()
->
teacherGuideLessonPagesActivated
){
if
(
UBSettings
::
settings
()
->
teacherGuidePageZeroActivated
->
get
().
toBool
()
||
UBSettings
::
settings
()
->
teacherGuideLessonPagesActivated
->
get
().
toBool
()
){
mpTeacherGuideWidget
=
new
UBDockTeacherGuideWidget
();
mpTeacherGuideWidget
=
new
UBDockTeacherGuideWidget
();
mLeftPalette
->
registerWidget
(
mpTeacherGuideWidget
);
mLeftPalette
->
registerWidget
(
mpTeacherGuideWidget
);
mLeftPalette
->
addTab
(
mpTeacherGuideWidget
);
mLeftPalette
->
addTab
(
mpTeacherGuideWidget
);
...
...
src/core/UBPersistenceManager.cpp
View file @
31e8bbd1
...
@@ -676,7 +676,7 @@ int UBPersistenceManager::sceneCountInDir(const QString& pPath)
...
@@ -676,7 +676,7 @@ int UBPersistenceManager::sceneCountInDir(const QString& pPath)
}
}
else
else
{
{
if
(
UBSettings
::
settings
()
->
teacherGuidePageZeroActivated
&&
pageIndex
==
0
){
if
(
UBSettings
::
settings
()
->
teacherGuidePageZeroActivated
->
get
().
toBool
()
&&
pageIndex
==
0
){
// the document has no zero file but doesn't means that it hasn't any file
// the document has no zero file but doesn't means that it hasn't any file
// at all. Just importing a document without the first page using a configuartion
// at all. Just importing a document without the first page using a configuartion
// that enables zero page.
// that enables zero page.
...
...
src/document/UBDocumentController.cpp
View file @
31e8bbd1
...
@@ -74,15 +74,9 @@ UBDocumentController::UBDocumentController(UBMainWindow* mainWindow)
...
@@ -74,15 +74,9 @@ UBDocumentController::UBDocumentController(UBMainWindow* mainWindow)
setupToolbar
();
setupToolbar
();
this
->
selectDocument
(
UBApplication
::
boardController
->
selectedDocument
());
this
->
selectDocument
(
UBApplication
::
boardController
->
selectedDocument
());
connect
(
this
,
SIGNAL
(
exportDone
()),
mMainWindow
,
SLOT
(
onExportDone
()));
connect
(
this
,
SIGNAL
(
exportDone
()),
mMainWindow
,
SLOT
(
onExportDone
()));
//connect(mMainWindow->actionNewPage, SIGNAL(triggered()), this, SLOT(reloadThumbs()));
connect
(
this
,
SIGNAL
(
documentThumbnailsUpdated
(
UBDocumentContainer
*
)),
this
,
SLOT
(
refreshDocumentThumbnailsView
(
UBDocumentContainer
*
)));
connect
(
this
,
SIGNAL
(
documentThumbnailsUpdated
(
UBDocumentContainer
*
)),
this
,
SLOT
(
refreshDocumentThumbnailsView
(
UBDocumentContainer
*
)));
}
}
//void UBDocumentController::reloadThumbs()
//{
// UBThumbnailAdaptor::load(selectedDocumentProxy(), mDocumentThumbs);
//}
UBDocumentController
::~
UBDocumentController
()
UBDocumentController
::~
UBDocumentController
()
{
{
if
(
mDocumentUI
)
if
(
mDocumentUI
)
...
@@ -1654,6 +1648,5 @@ void UBDocumentController::refreshDocumentThumbnailsView(UBDocumentContainer*)
...
@@ -1654,6 +1648,5 @@ void UBDocumentController::refreshDocumentThumbnailsView(UBDocumentContainer*)
connect
(
mDocumentUI
->
thumbnailWidget
->
scene
(),
SIGNAL
(
selectionChanged
()),
this
,
SLOT
(
pageSelectionChanged
()));
connect
(
mDocumentUI
->
thumbnailWidget
->
scene
(),
SIGNAL
(
selectionChanged
()),
this
,
SLOT
(
pageSelectionChanged
()));
}
}
//emit refreshThumbnails();
QApplication
::
restoreOverrideCursor
();
QApplication
::
restoreOverrideCursor
();
}
}
src/document/UBDocumentController.h
View file @
31e8bbd1
...
@@ -57,9 +57,7 @@ class UBDocumentController : public UBDocumentContainer
...
@@ -57,9 +57,7 @@ class UBDocumentController : public UBDocumentContainer
bool
pageCanBeDeleted
(
int
page
);
bool
pageCanBeDeleted
(
int
page
);
signals
:
signals
:
//void refreshThumbnails();
void
exportDone
();
void
exportDone
();
//void movedToIndex(int index);
public
slots
:
public
slots
:
void
createNewDocument
();
void
createNewDocument
();
...
@@ -80,7 +78,6 @@ class UBDocumentController : public UBDocumentContainer
...
@@ -80,7 +78,6 @@ class UBDocumentController : public UBDocumentContainer
void
copy
();
void
copy
();
void
paste
();
void
paste
();
void
focusChanged
(
QWidget
*
old
,
QWidget
*
current
);
void
focusChanged
(
QWidget
*
old
,
QWidget
*
current
);
//void reloadThumbs();
protected
:
protected
:
virtual
void
setupViews
();
virtual
void
setupViews
();
...
...
src/gui/UBTeacherGuideWidget.cpp
View file @
31e8bbd1
...
@@ -135,7 +135,8 @@ UBTeacherGuideEditionWidget::UBTeacherGuideEditionWidget(QWidget *parent, const
...
@@ -135,7 +135,8 @@ UBTeacherGuideEditionWidget::UBTeacherGuideEditionWidget(QWidget *parent, const
if
(
UBSettings
::
settings
()
->
teacherGuideLessonPagesActivated
->
get
().
toBool
()){
if
(
UBSettings
::
settings
()
->
teacherGuideLessonPagesActivated
->
get
().
toBool
()){
UBSvgSubsetAdaptor
::
addElementToBeStored
(
QString
(
"teacherGuide"
),
this
);
UBSvgSubsetAdaptor
::
addElementToBeStored
(
QString
(
"teacherGuide"
),
this
);
connect
(
UBApplication
::
boardController
,
SIGNAL
(
activeDocumentChanged
()),
this
,
SLOT
(
onActiveDocumentChanged
()));
//connect(UBApplication::boardController,SIGNAL(activeDocumentChanged()),this,SLOT(onActiveDocumentChanged()));
connect
(
UBApplication
::
boardController
,
SIGNAL
(
documentSet
(
UBDocumentProxy
*
)),
this
,
SLOT
(
onActiveDocumentChanged
()));
}
}
}
}
...
...
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