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)
, mSystemScaleFactor(1.0)
, mCleanupDone(false)
, mCacheWidgetIsEnabled(false)
{
mZoomFactor = UBSettings::settings()->boardZoomFactor->get().toDouble();
@ -1712,6 +1713,7 @@ void UBBoardController::notifyCache(bool visible)
{
emit cacheDisabled();
}
mCacheWidgetIsEnabled = visible;
}
void UBBoardController::updatePageSizeState()

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

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

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

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

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

Loading…
Cancel
Save