Merge with actual code

preferencesAboutTextFull
Anatoly Mihalchenko 13 years ago
parent 350fd8ff79
commit 43efc82477
  1. 2
      src/board/UBBoardController.cpp
  2. 3
      src/board/UBBoardController.h
  3. 2
      src/core/UBApplication.cpp
  4. 4
      src/domain/UBGraphicsMediaItem.cpp
  5. 14
      src/gui/UBTeacherGuideWidget.cpp
  6. 8
      src/gui/UBTeacherGuideWidgetsTools.cpp

@ -87,6 +87,7 @@ UBBoardController::UBBoardController(UBMainWindow* mainWindow)
, mIsClosing(false) , mIsClosing(false)
, mSystemScaleFactor(1.0) , mSystemScaleFactor(1.0)
, mCleanupDone(false) , mCleanupDone(false)
, mCacheWidgetIsEnabled(false)
{ {
mZoomFactor = UBSettings::settings()->boardZoomFactor->get().toDouble(); mZoomFactor = UBSettings::settings()->boardZoomFactor->get().toDouble();
@ -1712,6 +1713,7 @@ void UBBoardController::notifyCache(bool visible)
{ {
emit cacheDisabled(); emit cacheDisabled();
} }
mCacheWidgetIsEnabled = visible;
} }
void UBBoardController::updatePageSizeState() void UBBoardController::updatePageSizeState()

@ -159,6 +159,8 @@ class UBBoardController : public UBDocumentContainer
void duplicateScene(int index); void duplicateScene(int index);
void deleteScene(int index); void deleteScene(int index);
bool cacheIsVisible() {return mCacheWidgetIsEnabled;}
public slots: public slots:
void showDocumentsDialog(); void showDocumentsDialog();
void showKeyboard(bool show); void showKeyboard(bool show);
@ -277,6 +279,7 @@ class UBBoardController : public UBDocumentContainer
qreal mSystemScaleFactor; qreal mSystemScaleFactor;
bool mCleanupDone; bool mCleanupDone;
QMap<QAction*, QPair<QString, QString> > mActionTexts; QMap<QAction*, QPair<QString, QString> > mActionTexts;
bool mCacheWidgetIsEnabled;
private slots: private slots:
void stylusToolDoubleClicked(int tool); void stylusToolDoubleClicked(int tool);

@ -317,8 +317,6 @@ int UBApplication::exec(const QString& pFileToImport)
connect(mainWindow->actionHideApplication, SIGNAL(triggered()), this, SLOT(showMinimized())); connect(mainWindow->actionHideApplication, SIGNAL(triggered()), this, SLOT(showMinimized()));
#endif #endif
connect(documentController, SIGNAL(movedToIndex(int)), boardController, SIGNAL(documentReorganized(int)));
mPreferencesController = new UBPreferencesController(mainWindow); mPreferencesController = new UBPreferencesController(mainWindow);
connect(mainWindow->actionPreferences, SIGNAL(triggered()), mPreferencesController, SLOT(show())); connect(mainWindow->actionPreferences, SIGNAL(triggered()), mPreferencesController, SLOT(show()));

@ -142,8 +142,8 @@ void UBGraphicsMediaItem::clearSource()
{ {
QString path = mediaFileUrl().toLocalFile(); QString path = mediaFileUrl().toLocalFile();
//if path is absolute clean duplicated path string //if path is absolute clean duplicated path string
if (!path.contains(UBApplication::boardController->activeDocument()->persistencePath())) if (!path.contains(UBApplication::boardController->selectedDocument()->persistencePath()))
path = UBApplication::boardController->activeDocument()->persistencePath() + "/" + path; path = UBApplication::boardController->selectedDocument()->persistencePath() + "/" + path;
if (!UBFileSystemUtils::deleteFile(path)) if (!UBFileSystemUtils::deleteFile(path))
qDebug() << "cannot delete file: " << path; qDebug() << "cannot delete file: " << path;

@ -245,7 +245,7 @@ void UBTeacherGuideEditionWidget::onActiveSceneChanged()
cleanData(); cleanData();
load(UBSvgSubsetAdaptor::readTeacherGuideNode(UBApplication::boardController->activeSceneIndex())); load(UBSvgSubsetAdaptor::readTeacherGuideNode(UBApplication::boardController->activeSceneIndex()));
mpPageNumberLabel->setText(tr("Page: %0").arg(currentPage)); mpPageNumberLabel->setText(tr("Page: %0").arg(currentPage));
UBDocumentProxy* documentProxy = UBApplication::boardController->activeDocument(); UBDocumentProxy* documentProxy = UBApplication::boardController->selectedDocument();
if(mpDocumentTitle) if(mpDocumentTitle)
mpDocumentTitle->setText(documentProxy->metaData(UBSettings::sessionTitle).toString()); mpDocumentTitle->setText(documentProxy->metaData(UBSettings::sessionTitle).toString());
} }
@ -483,7 +483,7 @@ void UBTeacherGuidePresentationWidget::onActiveSceneChanged()
{ {
cleanData(); cleanData();
mpPageNumberLabel->setText(tr("Page: %0").arg(UBApplication::boardController->currentPage())); mpPageNumberLabel->setText(tr("Page: %0").arg(UBApplication::boardController->currentPage()));
UBDocumentProxy* documentProxy = UBApplication::boardController->activeDocument(); UBDocumentProxy* documentProxy = UBApplication::boardController->selectedDocument();
if(mpDocumentTitle) if(mpDocumentTitle)
mpDocumentTitle->setText(documentProxy->metaData(UBSettings::sessionTitle).toString()); 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))); newWidgetItem->setData(0,Qt::FontRole, QVariant(QFont(QApplication::font().family(),11)));
QString mimeTypeString; QString mimeTypeString;
#ifdef Q_WS_WIN #ifdef Q_WS_WIN
mimeTypeString = QUrl::fromLocalFile(UBApplication::boardController->activeDocument()->persistencePath()+ "/" + element->attributes.value("relativePath")).toString(); mimeTypeString = QUrl::fromLocalFile(UBApplication::boardController->selectedDocument()->persistencePath()+ "/" + element->attributes.value("relativePath")).toString();
#else #else
mimeTypeString = UBApplication::boardController->activeDocument()->persistencePath()+ "/" + element->attributes.value("relativePath"); mimeTypeString = UBApplication::boardController->selectedDocument()->persistencePath()+ "/" + element->attributes.value("relativePath");
#endif #endif
newWidgetItem->setData(0, TG_USER_ROLE_MIME_TYPE, mimeTypeString); newWidgetItem->setData(0, TG_USER_ROLE_MIME_TYPE, mimeTypeString);
newWidgetItem->setFlags(Qt::ItemIsDragEnabled | Qt::ItemIsEnabled | Qt::ItemIsSelectable); newWidgetItem->setFlags(Qt::ItemIsDragEnabled | Qt::ItemIsEnabled | Qt::ItemIsSelectable);
@ -882,7 +882,7 @@ void UBTeacherGuidePageZeroWidget::onSchoolLevelChanged(QString schoolLevel)
void UBTeacherGuidePageZeroWidget::onActiveSceneChanged() void UBTeacherGuidePageZeroWidget::onActiveSceneChanged()
{ {
UBDocumentProxy* documentProxy = UBApplication::boardController->activeDocument(); UBDocumentProxy* documentProxy = UBApplication::boardController->selectedDocument();
if(documentProxy && UBApplication::boardController->currentPage() == 0){ if(documentProxy && UBApplication::boardController->currentPage() == 0){
QDateTime creationDate = documentProxy->documentDate(); QDateTime creationDate = documentProxy->documentDate();
mpCreationLabel->setText(tr("Created the:\n") + creationDate.toString(Qt::DefaultLocaleShortDate)); mpCreationLabel->setText(tr("Created the:\n") + creationDate.toString(Qt::DefaultLocaleShortDate));
@ -901,7 +901,7 @@ void UBTeacherGuidePageZeroWidget::hideEvent ( QHideEvent * event )
void UBTeacherGuidePageZeroWidget::loadData() void UBTeacherGuidePageZeroWidget::loadData()
{ {
UBDocumentProxy* documentProxy = UBApplication::boardController->activeDocument(); UBDocumentProxy* documentProxy = UBApplication::boardController->selectedDocument();
mpSessionTitle->setText(documentProxy->metaData(UBSettings::sessionTitle).toString()); mpSessionTitle->setText(documentProxy->metaData(UBSettings::sessionTitle).toString());
mpAuthors->setText(documentProxy->metaData(UBSettings::sessionAuthors).toString()); mpAuthors->setText(documentProxy->metaData(UBSettings::sessionAuthors).toString());
mpObjectives->setText(documentProxy->metaData(UBSettings::sessionObjectives).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 // check necessary because at document closing hide event is send after boardcontroller set
// to NULL // to NULL
if(UBApplication::boardController){ if(UBApplication::boardController){
UBDocumentProxy* documentProxy = UBApplication::boardController->activeDocument(); UBDocumentProxy* documentProxy = UBApplication::boardController->selectedDocument();
documentProxy->setMetaData(UBSettings::sessionTitle,mpSessionTitle->text()); documentProxy->setMetaData(UBSettings::sessionTitle,mpSessionTitle->text());
documentProxy->setMetaData(UBSettings::sessionAuthors, mpAuthors->text()); documentProxy->setMetaData(UBSettings::sessionAuthors, mpAuthors->text());
documentProxy->setMetaData(UBSettings::sessionObjectives,mpObjectives->text()); documentProxy->setMetaData(UBSettings::sessionObjectives,mpObjectives->text());

@ -316,7 +316,7 @@ UBTGMediaWidget::UBTGMediaWidget(QString mediaPath, QTreeWidgetItem* widget, QWi
, mIsInitializationMode(false) , mIsInitializationMode(false)
{ {
setObjectName(name); setObjectName(name);
mMediaPath = UBApplication::boardController->activeDocument()->persistencePath()+ "/" + mediaPath; mMediaPath = UBApplication::boardController->selectedDocument()->persistencePath()+ "/" + mediaPath;
setAcceptDrops(false); setAcceptDrops(false);
createWorkWidget(); createWorkWidget();
setFixedHeight(200); setFixedHeight(200);
@ -340,7 +340,7 @@ void UBTGMediaWidget::initializeWithDom(QDomElement element)
{ {
mIsInitializationMode = true; mIsInitializationMode = true;
setAcceptDrops(false); setAcceptDrops(false);
mMediaPath = UBApplication::boardController->activeDocument()->persistencePath() + "/" + element.attribute("relativePath"); mMediaPath = UBApplication::boardController->selectedDocument()->persistencePath() + "/" + element.attribute("relativePath");
qDebug() << mMediaPath; qDebug() << mMediaPath;
createWorkWidget(); createWorkWidget();
setFixedHeight(200); setFixedHeight(200);
@ -377,7 +377,7 @@ tUBGEElementNode* UBTGMediaWidget::saveData()
return 0; return 0;
tUBGEElementNode* result = new tUBGEElementNode(); tUBGEElementNode* result = new tUBGEElementNode();
QString relativePath = mMediaPath; QString relativePath = mMediaPath;
relativePath = relativePath.replace(UBApplication::boardController->activeDocument()->persistencePath()+"/",""); relativePath = relativePath.replace(UBApplication::boardController->selectedDocument()->persistencePath()+"/","");
result->name = "media"; result->name = "media";
result->attributes.insert("title",mpTitle->text()); result->attributes.insert("title",mpTitle->text());
result->attributes.insert("relativePath",relativePath); result->attributes.insert("relativePath",relativePath);
@ -394,7 +394,7 @@ void UBTGMediaWidget::createWorkWidget()
{ {
QString mimeType = UBFileSystemUtils::mimeTypeFromFileName(mMediaPath); QString mimeType = UBFileSystemUtils::mimeTypeFromFileName(mMediaPath);
bool setMedia = true; bool setMedia = true;
UBDocumentProxy* proxyDocument = UBApplication::boardController->activeDocument(); UBDocumentProxy* proxyDocument = UBApplication::boardController->selectedDocument();
if(mimeType.contains("audio") || mimeType.contains("video")){ if(mimeType.contains("audio") || mimeType.contains("video")){
mMediaType = mimeType.contains("audio")? "audio":"movie"; mMediaType = mimeType.contains("audio")? "audio":"movie";
mpMediaWidget = new UBMediaWidget(mimeType.contains("audio")?eMediaType_Audio:eMediaType_Video); mpMediaWidget = new UBMediaWidget(mimeType.contains("audio")?eMediaType_Audio:eMediaType_Video);

Loading…
Cancel
Save