Merge branch 'OEFUniboard' of github.com:stayonshadow/PrivateBoard into OEFUniboard

preferencesAboutTextFull
Didier Clerc 12 years ago
commit a8ed676683
  1. 2
      OpenBoard.pro
  2. 2
      src/adaptors/UBSvgSubsetAdaptor.cpp
  3. 13
      src/board/UBBoardController.cpp
  4. 10
      src/document/UBDocumentContainer.h
  5. 6
      src/gui/UBDocumentNavigator.cpp
  6. 14
      src/gui/UBDocumentTreeWidget.cpp
  7. 3
      src/gui/UBPageNavigationWidget.cpp

@ -11,7 +11,7 @@ CONFIG += debug_and_release \
VERSION_MAJ = 0
VERSION_MIN = 08
VERSION_TYPE = b # a = alpha, b = beta, r = release, other => error
VERSION_PATCH = 02
VERSION_PATCH = 03
VERSION = "$${VERSION_MAJ}.$${VERSION_MIN}.$${VERSION_TYPE}.$${VERSION_PATCH}"
VERSION = $$replace(VERSION, "\\.r", "")

@ -64,8 +64,6 @@
#include "core/UBApplication.h"
#include "core/UBTextTools.h"
#include "document/UBDocumentContainer.h"
#include "pdf/PDFRenderer.h"
#include "core/memcheck.h"

@ -485,11 +485,14 @@ void UBBoardController::addScene(UBGraphicsScene* scene, bool replaceActiveIfEmp
QString source = scene->document()->persistencePath() + "/" + relativeFile.toString();
QString target = selectedDocument()->persistencePath() + "/" + relativeFile.toString();
QFileInfo fi(target);
QDir d = fi.dir();
d.mkpath(d.absolutePath());
QFile::copy(source, target);
if(QFileInfo(source).isDir())
Q_ASSERT(UBFileSystemUtils::copyDir(source,target));
else{
QFileInfo fi(target);
QDir d = fi.dir();
d.mkpath(d.absolutePath());
Q_ASSERT(QFile::copy(source, target));
}
}
}

@ -41,8 +41,8 @@ class UBDocumentContainer : public QObject
int pageCount(){return mDocumentThumbs.size();}
const QPixmap* pageAt(int index){return mDocumentThumbs[index];}
static int pageFromSceneIndex(int sceneIndex);
static int sceneIndexFromPage(int sceneIndex);
static int pageFromSceneIndex(int sceneIndex);
static int sceneIndexFromPage(int sceneIndex);
void duplicatePages(QList<int>& pageIndexes);
bool movePageToIndex(int source, int target);
@ -51,15 +51,17 @@ class UBDocumentContainer : public QObject
void updatePage(int index);
void addEmptyThumbPage();
void insertThumbPage(int index);
private:
UBDocumentProxy* mCurrentDocument;
QList<const QPixmap*> mDocumentThumbs;
protected:
void deleteThumbPage(int index);
void updateThumbPage(int index);
void insertThumbPage(int index);
void reloadThumbnails();
signals:

@ -85,7 +85,6 @@ UBDocumentNavigator::~UBDocumentNavigator()
void UBDocumentNavigator::generateThumbnails(UBDocumentContainer* source)
{
mThumbsWithLabels.clear();
// foreach(QGraphicsItem* it, mScene->items())
int selectedIndex = -1;
QList<QGraphicsItem*> graphicsItemList = mScene->items();
for(int i = 0; i < graphicsItemList.size(); i+=1)
@ -100,6 +99,11 @@ void UBDocumentNavigator::generateThumbnails(UBDocumentContainer* source)
for(int i = 0; i < source->selectedDocument()->pageCount(); i++)
{
//claudio This is a very bad hack and shows a architectural problem
// source->selectedDocument()->pageCount() != source->pageCount()
if(i>=source->pageCount())
source->insertThumbPage(i);
const QPixmap* pix = source->pageAt(i);
Q_ASSERT(!pix->isNull());
int pageIndex = UBDocumentContainer::pageFromSceneIndex(i);

@ -24,6 +24,7 @@
#include "UBDocumentTreeWidget.h"
#include "document/UBDocumentProxy.h"
//#include "document/UBDocumentContainer.h"
#include "core/UBSettings.h"
#include "core/UBApplication.h"
@ -326,11 +327,14 @@ void UBDocumentTreeWidget::dropEvent(QDropEvent *event)
QString source = scene->document()->persistencePath() + "/" + relativeFile.toString();
QString target = targetDocProxy->persistencePath() + "/" + relativeFile.toString();
QFileInfo fi(target);
QDir d = fi.dir();
d.mkpath(d.absolutePath());
QFile::copy(source, target);
if(QFileInfo(source).isDir())
Q_ASSERT(UBFileSystemUtils::copyDir(source,target));
else{
QFileInfo fi(target);
QDir d = fi.dir();
d.mkpath(d.absolutePath());
Q_ASSERT(QFile::copy(source, target));
}
}
UBPersistenceManager::persistenceManager()->insertDocumentSceneAt(targetDocProxy, sceneClone, targetDocProxy->pageCount());

@ -25,9 +25,6 @@
#include "core/UBApplication.h"
#include "board/UBBoardController.h"
#include "document/UBDocumentContainer.h"
#include "globals/UBGlobals.h"
#include "core/memcheck.h"

Loading…
Cancel
Save