Commit 80a8f04d authored by shibakaneki's avatar shibakaneki

Added an indication to inform the user that it has to reboot the application...

Added an indication to inform the user that it has to reboot the application in order to access the updated documents.
parent bd7f6c5a
...@@ -61,7 +61,7 @@ void UBUpdateDlg::onFilesUpdated(bool bResult) ...@@ -61,7 +61,7 @@ void UBUpdateDlg::onFilesUpdated(bool bResult)
if(bResult) if(bResult)
{ {
qsMsg = tr("Files update successful"); qsMsg = tr("Files update successful!\nPlease reboot the application to access the updated documents.");
} }
else else
{ {
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
#include "frameworks/UBDesktopServices.h" #include "frameworks/UBDesktopServices.h"
#include "frameworks/UBFileSystemUtils.h" #include "frameworks/UBFileSystemUtils.h"
#include "core/UBApplication.h" #include "core/UBApplication.h"
#include "core/UBPersistenceManager.h"
UniboardSankoreTransition::UniboardSankoreTransition(QObject *parent) : UniboardSankoreTransition::UniboardSankoreTransition(QObject *parent) :
QObject(parent) QObject(parent)
...@@ -13,6 +14,7 @@ UniboardSankoreTransition::UniboardSankoreTransition(QObject *parent) : ...@@ -13,6 +14,7 @@ UniboardSankoreTransition::UniboardSankoreTransition(QObject *parent) :
#else #else
mUniboardSourceDirectory.replace("Sankore/Sankore 3.1", "Mnemis/Uniboard"); mUniboardSourceDirectory.replace("Sankore/Sankore 3.1", "Mnemis/Uniboard");
#endif #endif
connect(this, SIGNAL(docAdded(UBDocumentProxy*)), UBPersistenceManager::persistenceManager(), SIGNAL(documentCreated(UBDocumentProxy*)));
} }
UniboardSankoreTransition::~UniboardSankoreTransition() UniboardSankoreTransition::~UniboardSankoreTransition()
{ {
...@@ -62,11 +64,14 @@ void UniboardSankoreTransition::startDocumentTransition() ...@@ -62,11 +64,14 @@ void UniboardSankoreTransition::startDocumentTransition()
QFileInfoList::iterator fileInfo; QFileInfoList::iterator fileInfo;
QString sankoreDocumentDirectory = UBSettings::uniboardDocumentDirectory(); QString sankoreDocumentDirectory = UBSettings::uniboardDocumentDirectory();
QStringList qslNewDocs;
for (fileInfo = fileInfoList.begin(); fileInfo != fileInfoList.end() && result; fileInfo += 1) { for (fileInfo = fileInfoList.begin(); fileInfo != fileInfoList.end() && result; fileInfo += 1) {
if (fileInfo->isDir() && fileInfo->fileName().startsWith("Uniboard Document ")){ if (fileInfo->isDir() && fileInfo->fileName().startsWith("Uniboard Document ")){
QString sankoreDocumentName = fileInfo->fileName(); QString sankoreDocumentName = fileInfo->fileName();
sankoreDocumentName.replace("Uniboard","Sankore"); sankoreDocumentName.replace("Uniboard","Sankore");
result = UBFileSystemUtils::copyDir(fileInfo->filePath(),sankoreDocumentDirectory + "/" + sankoreDocumentName); result = UBFileSystemUtils::copyDir(fileInfo->filePath(),sankoreDocumentDirectory + "/" + sankoreDocumentName);
qslNewDocs << sankoreDocumentName;
} }
} }
...@@ -75,8 +80,16 @@ void UniboardSankoreTransition::startDocumentTransition() ...@@ -75,8 +80,16 @@ void UniboardSankoreTransition::startDocumentTransition()
rollbackDocumentsTransition(fileInfoList); rollbackDocumentsTransition(fileInfoList);
UBFileSystemUtils::deleteDir(backupDestinationPath); UBFileSystemUtils::deleteDir(backupDestinationPath);
} }
else { else
{
UBFileSystemUtils::deleteDir(mUniboardSourceDirectory); UBFileSystemUtils::deleteDir(mUniboardSourceDirectory);
// Notify the application that new documents have been added
// foreach(QString qstr, qslNewDocs)
// {
// UBDocumentProxy* pDoc = new UBDocumentProxy();
// pDoc->setMetaData(UBSettings::documentName, qstr);
// emit docAdded(pDoc);
// }
} }
emit transitionFinished(result); emit transitionFinished(result);
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include <QObject> #include <QObject>
#include <QFileInfo> #include <QFileInfo>
#include "gui/UBUpdateDlg.h" #include "gui/UBUpdateDlg.h"
#include "document/UBDocumentProxy.h"
class UniboardSankoreTransition : public QObject class UniboardSankoreTransition : public QObject
{ {
...@@ -23,6 +24,7 @@ protected: ...@@ -23,6 +24,7 @@ protected:
signals: signals:
void transitionFinished(bool result); void transitionFinished(bool result);
void docAdded(UBDocumentProxy* doc);
private slots: private slots:
void startDocumentTransition(); void startDocumentTransition();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment