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
388d7392
Commit
388d7392
authored
Aug 20, 2012
by
Aleksei Kanash
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:Sankore/Sankore-3.1
parents
d9cc7b6e
d72ae38b
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
26 additions
and
86 deletions
+26
-86
UBImportImage.cpp
src/adaptors/UBImportImage.cpp
+0
-18
UBImportPDF.cpp
src/adaptors/UBImportPDF.cpp
+0
-63
UBThumbnailAdaptor.cpp
src/adaptors/UBThumbnailAdaptor.cpp
+0
-3
UBDockPalette.cpp
src/gui/UBDockPalette.cpp
+12
-1
UBDockPalette.h
src/gui/UBDockPalette.h
+3
-0
UBLeftPalette.cpp
src/gui/UBLeftPalette.cpp
+8
-0
UBLeftPalette.h
src/gui/UBLeftPalette.h
+3
-0
UBTeacherGuideWidget.cpp
src/gui/UBTeacherGuideWidget.cpp
+0
-1
No files found.
src/adaptors/UBImportImage.cpp
View file @
388d7392
...
...
@@ -74,24 +74,6 @@ QString UBImportImage::importFileFilter()
return
filter
;
}
/*
bool UBImportImage::addFileToDocument(UBDocumentProxy* pDocument, const QFile& pFile)
{
int res = UBDocumentManager::documentManager()->addImageAsPageToDocument(QStringList(QFileInfo(pFile).absoluteFilePath()), pDocument);
if (res == 0)
{
UBApplication::showMessage(tr("Image import failed."));
return false;
}
else
{
UBApplication::showMessage(tr("Image import successful."));
return true;
}
}
*/
QList
<
UBGraphicsItem
*>
UBImportImage
::
import
(
const
QUuid
&
uuid
,
const
QString
&
filePath
)
{
QList
<
UBGraphicsItem
*>
result
;
...
...
src/adaptors/UBImportPDF.cpp
View file @
388d7392
...
...
@@ -91,66 +91,3 @@ const QString& UBImportPDF::folderToCopy()
{
return
UBPersistenceManager
::
objectDirectory
;
}
/*
bool UBImportPDF::addFileToDocument(UBDocumentProxy* pDocument, const QFile& pFile)
{
QString documentName = QFileInfo(pFile.fileName()).completeBaseName();
QUuid uuid = QUuid::createUuid();
QString filepath = UBPersistenceManager::persistenceManager()->addPdfFileToDocument(pDocument, pFile.fileName(), uuid);
PDFRenderer *pdfRenderer = PDFRenderer::rendererForUuid(uuid, pDocument->persistencePath() + "/" + filepath, true); // renderer is automatically deleted when not used anymore
if (!pdfRenderer->isValid())
{
UBApplication::showMessage(tr("PDF import failed."));
return false;
}
pdfRenderer->setDPI(this->dpi);
int documentPageCount = pDocument->pageCount();
if (documentPageCount == 1 && UBPersistenceManager::persistenceManager()->loadDocumentScene(pDocument, 0)->isEmpty())
{
documentPageCount = 0;
}
int pdfPageCount = pdfRenderer->pageCount();
for(int pdfPageNumber = 1; pdfPageNumber <= pdfPageCount; pdfPageNumber++)
{
int pageIndex = documentPageCount + pdfPageNumber;
UBApplication::showMessage(tr("Importing page %1 of %2").arg(pdfPageNumber).arg(pdfPageCount), true);
UBGraphicsScene* scene = 0;
if (pageIndex == 0)
{
scene = UBPersistenceManager::persistenceManager()->loadDocumentScene(pDocument, pageIndex);
}
else
{
scene = UBPersistenceManager::persistenceManager()->createDocumentSceneAt(pDocument, pageIndex);
}
scene->setBackground(false, false);
UBGraphicsPDFItem *pdfItem = new UBGraphicsPDFItem(pdfRenderer, pdfPageNumber); // deleted by the scene
scene->addItem(pdfItem);
pdfItem->setPos(-pdfItem->boundingRect().width() / 2, -pdfItem->boundingRect().height() / 2);
scene->setAsBackgroundObject(pdfItem, false, false);
scene->setNominalSize(pdfItem->boundingRect().width(), pdfItem->boundingRect().height());
UBPersistenceManager::persistenceManager()->persistDocumentScene(pDocument, scene, pageIndex);
}
UBApplication::showMessage(tr("PDF import successful."));
return true;
}
*/
\ No newline at end of file
src/adaptors/UBThumbnailAdaptor.cpp
View file @
388d7392
...
...
@@ -117,9 +117,6 @@ void UBThumbnailAdaptor::load(UBDocumentProxy* proxy, QList<const QPixmap*>& lis
void
UBThumbnailAdaptor
::
persistScene
(
UBDocumentProxy
*
proxy
,
UBGraphicsScene
*
pScene
,
int
pageIndex
,
bool
overrideModified
)
{
qDebug
()
<<
"Persist scene on path "
<<
proxy
->
persistencePath
()
<<
", index "
<<
pageIndex
;
QString
fileName
=
proxy
->
persistencePath
()
+
UBFileSystemUtils
::
digitFileFormat
(
"/page%1.thumbnail.jpg"
,
pageIndex
);
QFile
thumbFile
(
fileName
);
...
...
src/gui/UBDockPalette.cpp
View file @
388d7392
...
...
@@ -17,12 +17,16 @@
#include <QPainterPath>
#include "UBDockPalette.h"
#include "core/UBSettings.h"
#include "frameworks/UBPlatformUtils.h"
#include "core/UBSettings.h"
#include "core/UBApplication.h"
#include "core/UBPreferencesController.h"
#include "core/UBDownloadManager.h"
#include "board/UBBoardController.h"
#include "core/memcheck.h"
/**
...
...
@@ -79,6 +83,8 @@ UBDockPalette::UBDockPalette(eUBDockPaletteType paletteType, QWidget *parent, co
onToolbarPosUpdated
();
connect
(
UBSettings
::
settings
()
->
appToolBarPositionedAtTop
,
SIGNAL
(
changed
(
QVariant
)),
this
,
SLOT
(
onToolbarPosUpdated
()));
connect
(
UBDownloadManager
::
downloadManager
(),
SIGNAL
(
allDownloadsFinished
()),
this
,
SLOT
(
onAllDownloadsFinished
()));
connect
(
UBApplication
::
boardController
,
SIGNAL
(
documentSet
(
UBDocumentProxy
*
)),
this
,
SLOT
(
onDocumentSet
(
UBDocumentProxy
*
)));
}
/**
...
...
@@ -98,6 +104,11 @@ UBDockPalette::~UBDockPalette()
}
}
void
UBDockPalette
::
onDocumentSet
(
UBDocumentProxy
*
documentProxy
)
{
Q_UNUSED
(
documentProxy
);
}
/**
* \brief Get the current orientation
* @return the current orientation
...
...
src/gui/UBDockPalette.h
View file @
388d7392
...
...
@@ -15,6 +15,8 @@
#ifndef UBDOCKPALETTE_H
#define UBDOCKPALETTE_H
class
UBDocumentProxy
;
#include <QWidget>
#include <QMouseEvent>
#include <QBrush>
...
...
@@ -131,6 +133,7 @@ public slots:
void
onShowTabWidget
(
UBDockPaletteWidget
*
widget
);
void
onHideTabWidget
(
UBDockPaletteWidget
*
widget
);
void
onAllDownloadsFinished
();
virtual
void
onDocumentSet
(
UBDocumentProxy
*
documentProxy
);
protected
:
virtual
int
border
();
...
...
src/gui/UBLeftPalette.cpp
View file @
388d7392
...
...
@@ -51,6 +51,14 @@ UBLeftPalette::~UBLeftPalette()
}
void
UBLeftPalette
::
onDocumentSet
(
UBDocumentProxy
*
documentProxy
)
{
//This is necessary to force the teacher guide to be showed in priority each time a document is set
if
(
documentProxy
&&
UBSettings
::
settings
()
->
teacherGuidePageZeroActivated
->
get
().
toBool
())
mLastOpenedTabForMode
.
insert
(
eUBDockPaletteWidget_BOARD
,
1
);
}
/**
* \brief Update the maximum width
*/
...
...
src/gui/UBLeftPalette.h
View file @
388d7392
...
...
@@ -25,6 +25,9 @@ public:
bool
switchMode
(
eUBDockPaletteWidgetMode
mode
);
public
slots
:
void
onDocumentSet
(
UBDocumentProxy
*
documentProxy
);
protected
:
void
updateMaxWidth
();
void
resizeEvent
(
QResizeEvent
*
event
);
...
...
src/gui/UBTeacherGuideWidget.cpp
View file @
388d7392
...
...
@@ -1149,7 +1149,6 @@ void UBTeacherGuideWidget::onActiveSceneChanged()
mpPageZeroWidget
->
switchToMode
(
tUBTGZeroPageMode_EDITION
);
setCurrentWidget
(
mpPageZeroWidget
);
}
else
{
if
(
mpEditionWidget
->
isModified
()){
...
...
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