|
|
@ -385,7 +385,12 @@ void UBDocumentController::setupViews() |
|
|
|
|
|
|
|
|
|
|
|
mDocumentUI->thumbnailWidget->setBackgroundBrush(UBSettings::documentViewLightColor); |
|
|
|
mDocumentUI->thumbnailWidget->setBackgroundBrush(UBSettings::documentViewLightColor); |
|
|
|
|
|
|
|
|
|
|
|
mMessageWindow = new UBMessageWindow(mDocumentUI->thumbnailWidget); |
|
|
|
#ifdef Q_WS_MACX |
|
|
|
|
|
|
|
mMessageWindow = new UBMessageWindow(NULL); |
|
|
|
|
|
|
|
#else |
|
|
|
|
|
|
|
mMessageWindow = new UBMessageWindow(mDocumentUI->thumbnailWidget); |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
mMessageWindow->hide(); |
|
|
|
mMessageWindow->hide(); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
@ -732,7 +737,7 @@ void UBDocumentController::exportDocument() |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
else |
|
|
|
{ |
|
|
|
{ |
|
|
|
UBApplication::showMessage(tr("No document selected!")); |
|
|
|
showMessage(tr("No document selected!")); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -917,7 +922,7 @@ void UBDocumentController::importFile() |
|
|
|
if (groupName == UBSettings::defaultDocumentGroupName || fileInfo.suffix() != "ubz") |
|
|
|
if (groupName == UBSettings::defaultDocumentGroupName || fileInfo.suffix() != "ubz") |
|
|
|
groupName = ""; |
|
|
|
groupName = ""; |
|
|
|
|
|
|
|
|
|
|
|
UBApplication::showMessage(tr("Importing file %1...").arg(fileInfo.baseName()), true); |
|
|
|
showMessage(tr("Importing file %1...").arg(fileInfo.baseName()), true); |
|
|
|
|
|
|
|
|
|
|
|
createdDocument = docManager->importFile(selectedFile, groupName); |
|
|
|
createdDocument = docManager->importFile(selectedFile, groupName); |
|
|
|
|
|
|
|
|
|
|
@ -927,7 +932,7 @@ void UBDocumentController::importFile() |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
else |
|
|
|
{ |
|
|
|
{ |
|
|
|
UBApplication::showMessage(tr("Failed to import file ... ")); |
|
|
|
showMessage(tr("Failed to import file ... ")); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -958,7 +963,7 @@ void UBDocumentController::addFolderOfImages() |
|
|
|
|
|
|
|
|
|
|
|
if (importedImageNumber == 0) |
|
|
|
if (importedImageNumber == 0) |
|
|
|
{ |
|
|
|
{ |
|
|
|
UBApplication::showMessage(tr("Folder does not contain any image files!")); |
|
|
|
showMessage(tr("Folder does not contain any image files!")); |
|
|
|
UBApplication::applicationController->showDocument(); |
|
|
|
UBApplication::applicationController->showDocument(); |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
else |
|
|
@ -1003,7 +1008,7 @@ bool UBDocumentController::addFileToDocument(UBDocumentProxy* document) |
|
|
|
QApplication::processEvents(); |
|
|
|
QApplication::processEvents(); |
|
|
|
QFile selectedFile(filePath); |
|
|
|
QFile selectedFile(filePath); |
|
|
|
|
|
|
|
|
|
|
|
UBApplication::showMessage(tr("Importing file %1...").arg(fileInfo.baseName()), true); |
|
|
|
showMessage(tr("Importing file %1...").arg(fileInfo.baseName()), true); |
|
|
|
|
|
|
|
|
|
|
|
success = UBDocumentManager::documentManager()->addFileToDocument(document, selectedFile); |
|
|
|
success = UBDocumentManager::documentManager()->addFileToDocument(document, selectedFile); |
|
|
|
|
|
|
|
|
|
|
@ -1014,7 +1019,7 @@ bool UBDocumentController::addFileToDocument(UBDocumentProxy* document) |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
else |
|
|
|
{ |
|
|
|
{ |
|
|
|
UBApplication::showMessage(tr("Failed to import file ... ")); |
|
|
|
showMessage(tr("Failed to import file ... ")); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -1382,13 +1387,19 @@ bool UBDocumentController::isOKToOpenDocument(UBDocumentProxy* proxy) |
|
|
|
|
|
|
|
|
|
|
|
void UBDocumentController::showMessage(const QString& message, bool showSpinningWheel) |
|
|
|
void UBDocumentController::showMessage(const QString& message, bool showSpinningWheel) |
|
|
|
{ |
|
|
|
{ |
|
|
|
int margin = UBSettings::boardMargin; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QRect newSize = mDocumentUI->thumbnailWidget->geometry(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (mMessageWindow) |
|
|
|
if (mMessageWindow) |
|
|
|
{ |
|
|
|
{ |
|
|
|
mMessageWindow->move(margin, newSize.height() - mMessageWindow->height() - margin); |
|
|
|
int margin = UBSettings::boardMargin; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QRect newSize = mDocumentUI->thumbnailWidget->geometry(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef Q_WS_MACX |
|
|
|
|
|
|
|
QPoint point(newSize.left() + margin, newSize.bottom() - mMessageWindow->height() - margin); |
|
|
|
|
|
|
|
mMessageWindow->move(mDocumentUI->thumbnailWidget->mapToGlobal(point)); |
|
|
|
|
|
|
|
#else |
|
|
|
|
|
|
|
mMessageWindow->move(margin, newSize.height() - mMessageWindow->height() - margin); |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
mMessageWindow->showMessage(message, showSpinningWheel); |
|
|
|
mMessageWindow->showMessage(message, showSpinningWheel); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|