Merge branch 'master' of github.com:Sankore/Sankore-3.1

preferencesAboutTextFull
Claudio Valerio 14 years ago
commit c97648a644
  1. 2
      src/gui/UBUpdateDlg.cpp
  2. 15
      src/transition/UniboardSankoreTransition.cpp
  3. 2
      src/transition/UniboardSankoreTransition.h

@ -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 @@
#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) :
#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()
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()
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 @@
#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:
signals: signals:
void transitionFinished(bool result); void transitionFinished(bool result);
void docAdded(UBDocumentProxy* doc);
private slots: private slots:
void startDocumentTransition(); void startDocumentTransition();

Loading…
Cancel
Save