Fixed issue 962

preferencesAboutTextFull
shibakaneki 12 years ago
parent 58746c87e5
commit 23531e8488
  1. 5
      src/board/UBBoardController.cpp
  2. 11
      src/board/UBBoardPaletteManager.cpp
  3. 8
      src/core/UBDocumentManager.cpp
  4. 7
      src/document/UBDocumentContainer.cpp
  5. 1
      src/document/UBDocumentContainer.h
  6. 6
      src/document/UBDocumentController.cpp
  7. 1
      src/gui/UBDocumentNavigator.cpp
  8. 234
      src/gui/gui.pri

@ -453,7 +453,7 @@ void UBBoardController::addScene()
persistCurrentScene(); persistCurrentScene();
UBDocumentContainer::addPage(mActiveSceneIndex + 1); UBDocumentContainer::addPage(mActiveSceneIndex + 1);
selectedDocument()->setMetaData(UBSettings::documentUpdatedAt, UBStringUtils::toUtcIsoDateTime(QDateTime::currentDateTime())); selectedDocument()->setMetaData(UBSettings::documentUpdatedAt, UBStringUtils::toUtcIsoDateTime(QDateTime::currentDateTime()));
setActiveDocumentScene(mActiveSceneIndex + 1); setActiveDocumentScene(mActiveSceneIndex + 1);
@ -2282,10 +2282,9 @@ void UBBoardController::addItem()
void UBBoardController::importPage() void UBBoardController::importPage()
{ {
int pageCount = selectedDocument()->pageCount(); int pageCount = selectedDocument()->pageCount();
if (UBApplication::documentController->addFileToDocument(selectedDocument())) if (UBApplication::documentController->addFileToDocument(selectedDocument()))
{ {
setActiveDocumentScene(pageCount); setActiveDocumentScene(selectedDocument(), pageCount, true);
} }
} }

@ -347,14 +347,15 @@ void UBBoardPaletteManager::pagePaletteButtonReleased()
{ {
if( mPageButtonPressedTime.msecsTo(QTime::currentTime()) > 900) if( mPageButtonPressedTime.msecsTo(QTime::currentTime()) > 900)
{ {
// The palette is reinstanciate because the duplication depends on the current scene // The palette is reinstanciated because the duplication depends on the current scene
delete(mPagePalette); delete(mPagePalette);
mPagePalette = 0; mPagePalette = 0;
QList<QAction*>pageActions; QList<QAction*>pageActions;
pageActions << UBApplication::mainWindow->actionNewPage; pageActions << UBApplication::mainWindow->actionNewPage;
UBBoardController* boardController = UBApplication::boardController; UBBoardController* boardController = UBApplication::boardController;
if(UBApplication::documentController->pageCanBeDuplicated(UBDocumentContainer::pageFromSceneIndex(boardController->activeSceneIndex()))) if(UBApplication::documentController->pageCanBeDuplicated(UBDocumentContainer::pageFromSceneIndex(boardController->activeSceneIndex()))){
pageActions << UBApplication::mainWindow->actionDuplicatePage; pageActions << UBApplication::mainWindow->actionDuplicatePage;
}
pageActions << UBApplication::mainWindow->actionImportPage; pageActions << UBApplication::mainWindow->actionImportPage;
mPagePalette = new UBActionPalette(pageActions, Qt::Horizontal , mContainer); mPagePalette = new UBActionPalette(pageActions, Qt::Horizontal , mContainer);
@ -362,8 +363,12 @@ void UBBoardPaletteManager::pagePaletteButtonReleased()
mPagePalette->setToolButtonStyle(Qt::ToolButtonTextUnderIcon); mPagePalette->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
mPagePalette->groupActions(); mPagePalette->groupActions();
mPagePalette->setClosable(true); mPagePalette->setClosable(true);
mPagePalette->adjustSizeAndPosition();
// As we recreate the pagePalette every time, we must reconnect the slots
connect(UBApplication::mainWindow->actionNewPage, SIGNAL(triggered()), mPagePalette, SLOT(close()));
connect(UBApplication::mainWindow->actionDuplicatePage, SIGNAL(triggered()), mPagePalette, SLOT(close()));
connect(UBApplication::mainWindow->actionImportPage, SIGNAL(triggered()), mPagePalette, SLOT(close()));
connect(mPagePalette, SIGNAL(closed()), this, SLOT(pagePaletteClosed()));
togglePagePalette(true); togglePagePalette(true);
} }

@ -33,6 +33,8 @@
#include "domain/UBGraphicsPixmapItem.h" #include "domain/UBGraphicsPixmapItem.h"
#include "document/UBDocumentProxy.h" #include "document/UBDocumentProxy.h"
#include "document/UBDocumentController.h"
#include "board/UBBoardController.h"
#include "UBApplication.h" #include "UBApplication.h"
#include "UBSettings.h" #include "UBSettings.h"
@ -233,7 +235,10 @@ int UBDocumentManager::addFilesToDocument(UBDocumentProxy* document, QStringList
int pageIndex = document->pageCount(); int pageIndex = document->pageCount();
UBGraphicsScene* scene = UBPersistenceManager::persistenceManager()->createDocumentSceneAt(document, pageIndex); UBGraphicsScene* scene = UBPersistenceManager::persistenceManager()->createDocumentSceneAt(document, pageIndex);
importAdaptor->placeImportedItemToScene(scene, page); importAdaptor->placeImportedItemToScene(scene, page);
UBPersistenceManager::persistenceManager()->persistDocumentScene(document, scene, pageIndex); UBPersistenceManager::persistenceManager()->persistDocumentScene(document, scene, pageIndex);
// TODO: Add an empty pixmap for the thumbnail here
UBApplication::boardController->addEmptyThumbPage();
} }
UBPersistenceManager::persistenceManager()->persistDocumentMetadata(document); UBPersistenceManager::persistenceManager()->persistDocumentMetadata(document);
@ -297,7 +302,6 @@ QList<UBExportAdaptor*> UBDocumentManager::supportedExportAdaptors()
return mExportAdaptors; return mExportAdaptors;
} }
void UBDocumentManager::emitDocumentUpdated(UBDocumentProxy* pDocument) void UBDocumentManager::emitDocumentUpdated(UBDocumentProxy* pDocument)
{ {
emit documentUpdated(pDocument); emit documentUpdated(pDocument);

@ -114,6 +114,7 @@ void UBDocumentContainer::reloadThumbnails()
if (mCurrentDocument) if (mCurrentDocument)
{ {
UBThumbnailAdaptor::load(mCurrentDocument, mDocumentThumbs); UBThumbnailAdaptor::load(mCurrentDocument, mDocumentThumbs);
qDebug() << "Reloading Thumbnails. new mDocumentThumbs size: " << mDocumentThumbs.size();
emit documentThumbnailsUpdated(this); emit documentThumbnailsUpdated(this);
} }
} }
@ -131,3 +132,9 @@ int UBDocumentContainer::sceneIndexFromPage(int page)
return page; return page;
return page-1; return page-1;
} }
void UBDocumentContainer::addEmptyThumbPage()
{
const QPixmap* pThumb = new QPixmap();
mDocumentThumbs.append(pThumb);
}

@ -41,6 +41,7 @@ class UBDocumentContainer : public QObject
void deletePages(QList<int>& pageIndexes); void deletePages(QList<int>& pageIndexes);
void addPage(int index); void addPage(int index);
void updatePage(int index); void updatePage(int index);
void addEmptyThumbPage();
private: private:
void deleteThumbPage(int index); void deleteThumbPage(int index);

@ -992,8 +992,7 @@ void UBDocumentController::addFileToDocument()
bool UBDocumentController::addFileToDocument(UBDocumentProxy* document) bool UBDocumentController::addFileToDocument(UBDocumentProxy* document)
{ {
QString defaultPath = UBSettings::settings()->lastImportFilePath->get().toString(); QString defaultPath = UBSettings::settings()->lastImportFilePath->get().toString();
QString filePath = QFileDialog::getOpenFileName(mParentWidget, tr("Open Supported File") QString filePath = QFileDialog::getOpenFileName(mParentWidget, tr("Open Supported File"), defaultPath, UBDocumentManager::documentManager()->importFileFilter());
, defaultPath, UBDocumentManager::documentManager()->importFileFilter());
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
QApplication::processEvents(); QApplication::processEvents();
@ -1005,7 +1004,8 @@ bool UBDocumentController::addFileToDocument(UBDocumentProxy* document)
if (filePath.length() > 0) if (filePath.length() > 0)
{ {
QApplication::processEvents(); QApplication::processEvents(); // NOTE: We performed this just a few lines before. Is it really necessary to do it again here??
QFile selectedFile(filePath);
showMessage(tr("Importing file %1...").arg(fileInfo.baseName()), true); showMessage(tr("Importing file %1...").arg(fileInfo.baseName()), true);

@ -84,6 +84,7 @@ void UBDocumentNavigator::generateThumbnails(UBDocumentContainer* source)
for(int i = 0; i < source->selectedDocument()->pageCount(); i++) for(int i = 0; i < source->selectedDocument()->pageCount(); i++)
{ {
qDebug() << "source->selectedDocument()->pageCount: " << source->selectedDocument()->pageCount() << ", source->pageCount: " << source->pageCount() << ", source->pageAt(" << i << ")";
const QPixmap* pix = source->pageAt(i); const QPixmap* pix = source->pageAt(i);
UBSceneThumbnailNavigPixmap* pixmapItem = new UBSceneThumbnailNavigPixmap(*pix, source->selectedDocument(), i); UBSceneThumbnailNavigPixmap* pixmapItem = new UBSceneThumbnailNavigPixmap(*pix, source->selectedDocument(), i);
int pageIndex = UBDocumentContainer::pageFromSceneIndex(i); int pageIndex = UBDocumentContainer::pageFromSceneIndex(i);

@ -1,135 +1,111 @@
HEADERS += src/gui/UBThumbnailView.h \
HEADERS += src/gui/UBThumbnailView.h \ src/gui/UBFloatingPalette.h \
src/gui/UBFloatingPalette.h \ src/gui/UBToolbarButtonGroup.h \
src/gui/UBToolbarButtonGroup.h \ src/gui/UBStylusPalette.h \
src/gui/UBStylusPalette.h \ src/gui/UBIconButton.h \
src/gui/UBIconButton.h \ src/gui/UBThumbnailWidget.h \
src/gui/UBThumbnailWidget.h \ src/gui/UBCircleFrame.h \
src/gui/UBCircleFrame.h \ src/gui/UBColorPicker.h \
src/gui/UBColorPicker.h \ src/gui/UBWidgetMirror.h \
src/gui/UBWidgetMirror.h \ src/gui/UBScreenMirror.h \
src/gui/UBScreenMirror.h \ src/gui/UBResources.h \
src/gui/UBResources.h \ src/gui/UBMessageWindow.h \
src/gui/UBMessageWindow.h \ src/gui/UBDocumentThumbnailWidget.h \
src/gui/UBDocumentThumbnailWidget.h \ src/gui/UBDocumentTreeWidget.h \
src/gui/UBDocumentTreeWidget.h \ src/gui/UBMousePressFilter.h \
src/gui/UBMousePressFilter.h \ src/gui/UBBlackoutWidget.h \
src/gui/UBBlackoutWidget.h \ src/gui/UBMainWindow.h \
src/gui/UBMainWindow.h \ src/gui/UBToolWidget.h \
src/gui/UBToolWidget.h \ src/gui/UBSpinningWheel.h \
src/gui/UBSpinningWheel.h \ src/gui/UBZoomPalette.h \
src/gui/UBZoomPalette.h \ src/gui/UBRubberBand.h \
src/gui/UBRubberBand.h \ src/gui/UBDocumentToolsPalette.h \
src/gui/UBDocumentToolsPalette.h \ src/gui/UBWebToolsPalette.h \
src/gui/UBWebToolsPalette.h \ src/gui/UBVideoPlayer.h \
src/gui/UBVideoPlayer.h \ src/gui/UBActionPalette.h \
src/gui/UBActionPalette.h \ src/gui/UBFavoriteToolPalette.h \
src/gui/UBFavoriteToolPalette.h \ src/gui/UBKeyboardPalette.h \
src/gui/UBKeyboardPalette.h \ src/gui/UBNavigatorPalette.h \
src/gui/UBNavigatorPalette.h \ src/gui/UBDocumentNavigator.h \
src/gui/UBDocumentNavigator.h \ src/gui/UBDockPalette.h \
src/gui/UBDockPalette.h \ src/gui/UBPropertyPalette.h \
src/gui/UBPropertyPalette.h \ src/gui/UBLibNavigatorWidget.h \
src/gui/UBLibNavigatorWidget.h \ src/gui/UBLibItemProperties.h \
src/gui/UBLibItemProperties.h \ src/gui/UBLibActionBar.h \
src/gui/UBLibActionBar.h \ src/gui/UBLibraryWidget.h \
src/gui/UBLibraryWidget.h \ src/gui/UBLibPathViewer.h \
src/gui/UBLibPathViewer.h \ src/gui/UBUpdateDlg.h \
src/gui/UBUpdateDlg.h \ src/gui/UBDockPaletteWidget.h \
src/gui/UBDockPaletteWidget.h \ src/gui/UBLeftPalette.h \
src/gui/UBLeftPalette.h \ src/gui/UBRightPalette.h \
src/gui/UBRightPalette.h \ src/gui/UBPageNavigationWidget.h \
src/gui/UBPageNavigationWidget.h \ src/gui/UBLibWidget.h \
src/gui/UBLibWidget.h \ src/gui/UBMagnifer.h \
src/gui/UBMagnifer.h \ src/gui/UBCachePropertiesWidget.h \
src/gui/UBCachePropertiesWidget.h \ src/gui/UBLibWebView.h \
src/gui/UBLibWebView.h \ src/gui/UBDownloadWidget.h \
src/gui/UBDownloadWidget.h \ src/gui/UBDockDownloadWidget.h \
src/gui/UBDockDownloadWidget.h \ src/gui/UBFeaturesWidget.h \
src/gui/UBFeaturesWidget.h \ src/gui/UBFeaturesActionBar.h \
src/gui/UBFeaturesActionBar.h \
src/gui/UBDockTeacherGuideWidget.h \ src/gui/UBDockTeacherGuideWidget.h \
src/gui/UBTeacherGuideWidget.h \ src/gui/UBTeacherGuideWidget.h \
src/gui/UBTeacherGuideWidgetsTools.h \ src/gui/UBTeacherGuideWidgetsTools.h \
src/gui/UBMessagesDialog.h src/gui/UBMessagesDialog.h
SOURCES += src/gui/UBThumbnailView.cpp \
SOURCES += src/gui/UBThumbnailView.cpp \ src/gui/UBFloatingPalette.cpp \
src/gui/UBFloatingPalette.cpp \ src/gui/UBToolbarButtonGroup.cpp \
src/gui/UBToolbarButtonGroup.cpp \ src/gui/UBStylusPalette.cpp \
src/gui/UBStylusPalette.cpp \ src/gui/UBIconButton.cpp \
src/gui/UBIconButton.cpp \ src/gui/UBThumbnailWidget.cpp \
src/gui/UBThumbnailWidget.cpp \ src/gui/UBCircleFrame.cpp \
src/gui/UBCircleFrame.cpp \ src/gui/UBColorPicker.cpp \
src/gui/UBColorPicker.cpp \ src/gui/UBWidgetMirror.cpp \
src/gui/UBWidgetMirror.cpp \ src/gui/UBScreenMirror.cpp \
src/gui/UBScreenMirror.cpp \ src/gui/UBResources.cpp \
src/gui/UBResources.cpp \ src/gui/UBMessageWindow.cpp \
src/gui/UBMessageWindow.cpp \ src/gui/UBDocumentThumbnailWidget.cpp \
src/gui/UBDocumentThumbnailWidget.cpp \ src/gui/UBDocumentTreeWidget.cpp \
src/gui/UBDocumentTreeWidget.cpp \ src/gui/UBMousePressFilter.cpp \
src/gui/UBMousePressFilter.cpp \ src/gui/UBBlackoutWidget.cpp \
src/gui/UBBlackoutWidget.cpp \ src/gui/UBMainWindow.cpp \
src/gui/UBMainWindow.cpp \ src/gui/UBToolWidget.cpp \
src/gui/UBToolWidget.cpp \ src/gui/UBSpinningWheel.cpp \
src/gui/UBSpinningWheel.cpp \ src/gui/UBZoomPalette.cpp \
src/gui/UBZoomPalette.cpp \ src/gui/UBRubberBand.cpp \
src/gui/UBRubberBand.cpp \ src/gui/UBDocumentToolsPalette.cpp \
src/gui/UBDocumentToolsPalette.cpp \ src/gui/UBWebToolsPalette.cpp \
src/gui/UBWebToolsPalette.cpp \ src/gui/UBVideoPlayer.cpp \
src/gui/UBVideoPlayer.cpp \ src/gui/UBActionPalette.cpp \
src/gui/UBActionPalette.cpp \ src/gui/UBFavoriteToolPalette.cpp \
src/gui/UBFavoriteToolPalette.cpp \ src/gui/UBKeyboardPalette.cpp \
src/gui/UBKeyboardPalette.cpp \ src/gui/UBNavigatorPalette.cpp \
src/gui/UBNavigatorPalette.cpp \ src/gui/UBDocumentNavigator.cpp \
src/gui/UBDocumentNavigator.cpp \ src/gui/UBDockPalette.cpp \
src/gui/UBDockPalette.cpp \ src/gui/UBPropertyPalette.cpp \
src/gui/UBPropertyPalette.cpp \ src/gui/UBLibNavigatorWidget.cpp \
src/gui/UBLibNavigatorWidget.cpp \ src/gui/UBLibItemProperties.cpp \
src/gui/UBLibItemProperties.cpp \ src/gui/UBLibActionBar.cpp \
src/gui/UBLibActionBar.cpp \ src/gui/UBLibraryWidget.cpp \
src/gui/UBLibraryWidget.cpp \ src/gui/UBLibPathViewer.cpp \
src/gui/UBLibPathViewer.cpp \ src/gui/UBUpdateDlg.cpp \
src/gui/UBUpdateDlg.cpp \ src/gui/UBDockPaletteWidget.cpp \
src/gui/UBDockPaletteWidget.cpp \ src/gui/UBLeftPalette.cpp \
src/gui/UBLeftPalette.cpp \ src/gui/UBRightPalette.cpp \
src/gui/UBRightPalette.cpp \ src/gui/UBPageNavigationWidget.cpp \
src/gui/UBPageNavigationWidget.cpp \ src/gui/UBLibWidget.cpp \
src/gui/UBLibWidget.cpp \ src/gui/UBMagnifer.cpp \
src/gui/UBMagnifer.cpp \ src/gui/UBCachePropertiesWidget.cpp \
src/gui/UBCachePropertiesWidget.cpp \ src/gui/UBLibWebView.cpp \
src/gui/UBLibWebView.cpp \ src/gui/UBDownloadWidget.cpp \
src/gui/UBDownloadWidget.cpp \ src/gui/UBDockDownloadWidget.cpp \
src/gui/UBDockDownloadWidget.cpp \ src/gui/UBFeaturesWidget.cpp \
src/gui/UBFeaturesWidget.cpp \ src/gui/UBFeaturesActionBar.cpp \
src/gui/UBFeaturesActionBar.cpp \
src/gui/UBDockTeacherGuideWidget.cpp \ src/gui/UBDockTeacherGuideWidget.cpp \
src/gui/UBTeacherGuideWidget.cpp \ src/gui/UBTeacherGuideWidget.cpp \
src/gui/UBTeacherGuideWidgetsTools.cpp \ src/gui/UBTeacherGuideWidgetsTools.cpp \
src/gui/UBMessagesDialog.cpp src/gui/UBMessagesDialog.cpp
win32:SOURCES += src/gui/UBKeyboardPalette_win.cpp
win32 { macx:SOURCES += src/gui/UBKeyboardPalette_mac.cpp
linux-g++:SOURCES += src/gui/UBKeyboardPalette_linux.cpp
SOURCES += src/gui/UBKeyboardPalette_win.cpp linux-g++-32:SOURCES += src/gui/UBKeyboardPalette_linux.cpp
linux-g++-64:SOURCES += src/gui/UBKeyboardPalette_linux.cpp
}
macx {
SOURCES += src/gui/UBKeyboardPalette_mac.cpp
}
linux-g++ {
SOURCES += src/gui/UBKeyboardPalette_linux.cpp
}
linux-g++-32 {
SOURCES += src/gui/UBKeyboardPalette_linux.cpp
}
linux-g++-64 {
SOURCES += src/gui/UBKeyboardPalette_linux.cpp
}

Loading…
Cancel
Save