Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpenBoard
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lifo
Nicolas Ollinger
OpenBoard
Commits
7823babd
Commit
7823babd
authored
May 06, 2011
by
shibakaneki
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:Sankore/Sankore-3.1
parents
71403b99
c97648a6
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
78 additions
and
36 deletions
+78
-36
Sankore_3.1.pro
Sankore_3.1.pro
+1
-6
UBLibraryController.cpp
src/board/UBLibraryController.cpp
+1
-1
UBApplication.cpp
src/core/UBApplication.cpp
+3
-3
UBApplication.h
src/core/UBApplication.h
+3
-0
UBDesktopServices_mac.cpp
src/frameworks/UBDesktopServices_mac.cpp
+1
-1
UBUpdateDlg.cpp
src/gui/UBUpdateDlg.cpp
+1
-1
UniboardSankoreTransition.cpp
src/transition/UniboardSankoreTransition.cpp
+52
-20
UniboardSankoreTransition.h
src/transition/UniboardSankoreTransition.h
+9
-2
transition.pri
src/transition/transition.pri
+5
-0
UBWebController.cpp
src/web/UBWebController.cpp
+2
-2
No files found.
Sankore_3.1.pro
View file @
7823babd
...
@@ -47,6 +47,7 @@ include(src/desktop/desktop.pri)
...
@@ -47,6 +47,7 @@ include(src/desktop/desktop.pri)
include
(
src
/
web
/
web
.
pri
)
include
(
src
/
web
/
web
.
pri
)
include
(
src
/
softwareupdate
/
softwareupdate
.
pri
)
include
(
src
/
softwareupdate
/
softwareupdate
.
pri
)
include
(
src
/
paraschool
/
paraschool
.
pri
)
include
(
src
/
paraschool
/
paraschool
.
pri
)
include
(
src
/
transition
/
transition
.
pri
)
DEPENDPATH
+=
thirdparty
/
mera
/
pdf
-
merger
DEPENDPATH
+=
thirdparty
/
mera
/
pdf
-
merger
INCLUDEPATH
+=
thirdparty
/
mera
/
pdf
-
merger
INCLUDEPATH
+=
thirdparty
/
mera
/
pdf
-
merger
...
@@ -346,9 +347,3 @@ INSTALLS = UB_ETC \
...
@@ -346,9 +347,3 @@ INSTALLS = UB_ETC \
UB_THIRDPARTY_INTERACTIVE
UB_THIRDPARTY_INTERACTIVE
OTHER_FILES +=
OTHER_FILES +=
HEADERS += \
src/transition/UniboardSankoreTransition.h
SOURCES += \
src/transition/UniboardSankoreTransition.cpp
src/board/UBLibraryController.cpp
View file @
7823babd
...
@@ -321,7 +321,7 @@ QImage* UBLibraryController::thumbnailForFile(UBLibElement* pElement)
...
@@ -321,7 +321,7 @@ QImage* UBLibraryController::thumbnailForFile(UBLibElement* pElement)
QList
<
UBLibElement
*>
UBLibraryController
::
addVirtualElementsForItemPath
(
const
QString
&
pPath
)
QList
<
UBLibElement
*>
UBLibraryController
::
addVirtualElementsForItemPath
(
const
QString
&
pPath
)
{
{
QList
<
UBLibElement
*>
content
;
QList
<
UBLibElement
*>
content
;
if
(
pPath
==
mInteractive
CategoryPath
.
toString
())
if
(
pPath
==
mInteractive
UserDirectoryPath
.
toLocalFile
())
content
<<
mInternalLibElements
;
content
<<
mInternalLibElements
;
else
if
(
pPath
==
mPicturesStandardDirectoryPath
.
toLocalFile
()){
else
if
(
pPath
==
mPicturesStandardDirectoryPath
.
toLocalFile
()){
QUrl
path
=
QUrl
::
fromLocalFile
(
UBSettings
::
settings
()
->
uniboardImageLibraryDirectory
());
QUrl
path
=
QUrl
::
fromLocalFile
(
UBSettings
::
settings
()
->
uniboardImageLibraryDirectory
());
...
...
src/core/UBApplication.cpp
View file @
7823babd
...
@@ -45,7 +45,6 @@
...
@@ -45,7 +45,6 @@
#include "ui_mainWindow.h"
#include "ui_mainWindow.h"
#include "transition/UniboardSankoreTransition.h"
QPointer
<
QUndoStack
>
UBApplication
::
undoStack
;
QPointer
<
QUndoStack
>
UBApplication
::
undoStack
;
...
@@ -54,6 +53,7 @@ UBBoardController* UBApplication::boardController = 0;
...
@@ -54,6 +53,7 @@ UBBoardController* UBApplication::boardController = 0;
UBWebController
*
UBApplication
::
webController
=
0
;
UBWebController
*
UBApplication
::
webController
=
0
;
UBDocumentController
*
UBApplication
::
documentController
=
0
;
UBDocumentController
*
UBApplication
::
documentController
=
0
;
UBSoftwareUpdateController
*
UBApplication
::
softwareUpdateController
=
0
;
UBSoftwareUpdateController
*
UBApplication
::
softwareUpdateController
=
0
;
UniboardSankoreTransition
*
UBApplication
::
mUniboardSankoreTransition
=
0
;
UBMainWindow
*
UBApplication
::
mainWindow
=
0
;
UBMainWindow
*
UBApplication
::
mainWindow
=
0
;
...
@@ -299,8 +299,8 @@ int UBApplication::exec(const QString& pFileToImport)
...
@@ -299,8 +299,8 @@ int UBApplication::exec(const QString& pFileToImport)
UBLibraryController
::
preloadFirstOnlineLibrary
();
UBLibraryController
::
preloadFirstOnlineLibrary
();
UniboardSankoreTransition
*
t
ransition
=
new
UniboardSankoreTransition
();
mUniboardSankoreT
ransition
=
new
UniboardSankoreTransition
();
transition
->
backupUniboardDirectory
();
mUniboardSankoreTransition
->
documentTransition
();
return
QApplication
::
exec
();
return
QApplication
::
exec
();
}
}
...
...
src/core/UBApplication.h
View file @
7823babd
...
@@ -12,12 +12,14 @@
...
@@ -12,12 +12,14 @@
#include "qtsingleapplication.h"
#include "qtsingleapplication.h"
#include "transition/UniboardSankoreTransition.h"
namespace
Ui
namespace
Ui
{
{
class
MainWindow
;
class
MainWindow
;
}
}
class
UBBoardController
;
class
UBBoardController
;
class
UBWebController
;
class
UBWebController
;
class
UBControlView
;
class
UBControlView
;
...
@@ -49,6 +51,7 @@ class UBApplication : public QtSingleApplication
...
@@ -49,6 +51,7 @@ class UBApplication : public QtSingleApplication
static
UBWebController
*
webController
;
static
UBWebController
*
webController
;
static
UBDocumentController
*
documentController
;
static
UBDocumentController
*
documentController
;
static
UBSoftwareUpdateController
*
softwareUpdateController
;
static
UBSoftwareUpdateController
*
softwareUpdateController
;
static
UniboardSankoreTransition
*
mUniboardSankoreTransition
;
static
UBMainWindow
*
mainWindow
;
static
UBMainWindow
*
mainWindow
;
...
...
src/frameworks/UBDesktopServices_mac.cpp
View file @
7823babd
...
@@ -82,7 +82,7 @@ QString UBDesktopServices::storageLocation(StandardLocation type)
...
@@ -82,7 +82,7 @@ QString UBDesktopServices::storageLocation(StandardLocation type)
QString
path
=
getFullPath
(
ref
);
QString
path
=
getFullPath
(
ref
);
if
(
QDesktopServices
::
DataLocation
==
type
||
QDesktopServices
::
CacheLocation
==
type
)
if
(
QDesktopServices
::
DataLocation
==
type
||
QDesktopServices
::
CacheLocation
==
type
)
path
+=
"/Sankore"
;
path
+=
"/Sankore
/Sankore 3.1
"
;
return
path
;
return
path
;
}
}
...
...
src/gui/UBUpdateDlg.cpp
View file @
7823babd
...
@@ -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
!
\n
Please reboot the application to access the updated documents.
"
);
}
}
else
else
{
{
...
...
src/transition/UniboardSankoreTransition.cpp
View file @
7823babd
...
@@ -2,28 +2,25 @@
...
@@ -2,28 +2,25 @@
#include "core/UBSettings.h"
#include "core/UBSettings.h"
#include "frameworks/UBDesktopServices.h"
#include "frameworks/UBDesktopServices.h"
#include "frameworks/UBFileSystemUtils.h"
#include "frameworks/UBFileSystemUtils.h"
#include "core/UBApplication.h"
#include "core/UBPersistenceManager.h"
UniboardSankoreTransition
::
UniboardSankoreTransition
(
QObject
*
parent
)
:
UniboardSankoreTransition
::
UniboardSankoreTransition
(
QObject
*
parent
)
:
QObject
(
parent
)
QObject
(
parent
)
{
{
mUniboardSourceDirectory
=
UBDesktopServices
::
storageLocation
(
QDesktopServices
::
DataLocation
);
mUniboardSourceDirectory
=
UBFileSystemUtils
::
normalizeFilePath
(
UBDesktopServices
::
storageLocation
(
QDesktopServices
::
DataLocation
));
mUniboardSourceDirectory
.
replace
(
"Sankore"
,
"Mnemis/Uniboard"
);
#if defined(Q_WS_MACX)
mUniboardSourceDirectory
.
replace
(
"Sankore/Sankore 3.1"
,
"Uniboard"
);
#else
mUniboardSourceDirectory
.
replace
(
"Sankore/Sankore 3.1"
,
"Mnemis/Uniboard"
);
#endif
connect
(
this
,
SIGNAL
(
docAdded
(
UBDocumentProxy
*
)),
UBPersistenceManager
::
persistenceManager
(),
SIGNAL
(
documentCreated
(
UBDocumentProxy
*
)));
}
}
UniboardSankoreTransition
::~
UniboardSankoreTransition
()
bool
UniboardSankoreTransition
::
backupUniboardDirectory
()
{
{
bool
result
=
false
;
delete
mTransitionDlg
;
QString
destinationDirectory
=
UBDesktopServices
::
storageLocation
(
QDesktopServices
::
DesktopLocation
);
if
(
QFileInfo
(
destinationDirectory
).
exists
()
&&
QFileInfo
(
mUniboardSourceDirectory
).
exists
()){
if
(
!
destinationDirectory
.
endsWith
(
"/"
))
destinationDirectory
+=
"/"
;
result
=
UBFileSystemUtils
::
copyDir
(
mUniboardSourceDirectory
,
destinationDirectory
+
QFileInfo
(
mUniboardSourceDirectory
).
fileName
()
+
"BackupData/"
);
if
(
result
)
documentTransition
();
}
return
result
;
}
}
void
UniboardSankoreTransition
::
rollbackDocumentsTransition
(
QFileInfoList
&
fileInfoList
)
void
UniboardSankoreTransition
::
rollbackDocumentsTransition
(
QFileInfoList
&
fileInfoList
)
{
{
QFileInfoList
::
iterator
fileInfo
;
QFileInfoList
::
iterator
fileInfo
;
...
@@ -41,26 +38,61 @@ void UniboardSankoreTransition::rollbackDocumentsTransition(QFileInfoList& fileI
...
@@ -41,26 +38,61 @@ void UniboardSankoreTransition::rollbackDocumentsTransition(QFileInfoList& fileI
void
UniboardSankoreTransition
::
documentTransition
()
void
UniboardSankoreTransition
::
documentTransition
()
{
{
if
(
QFileInfo
(
mUniboardSourceDirectory
).
exists
()){
QString
uniboardDocumentDirectory
=
mUniboardSourceDirectory
+
"/document"
;
QString
uniboardDocumentDirectory
=
mUniboardSourceDirectory
+
"/document"
;
QString
sankoreDocumentDirectory
=
UBSettings
::
uniboardDocumentDirectory
();
QFileInfoList
fileInfoList
=
UBFileSystemUtils
::
allElementsInDirectory
(
uniboardDocumentDirectory
);
QFileInfoList
fileInfoList
=
UBFileSystemUtils
::
allElementsInDirectory
(
uniboardDocumentDirectory
);
QString
backupDirectoryPath
=
UBFileSystemUtils
::
normalizeFilePath
(
UBDesktopServices
::
storageLocation
(
QDesktopServices
::
DesktopLocation
));
mTransitionDlg
=
new
UBUpdateDlg
(
0
,
fileInfoList
.
count
(),
backupDirectoryPath
);
connect
(
mTransitionDlg
,
SIGNAL
(
updateFiles
()),
this
,
SLOT
(
startDocumentTransition
()));
connect
(
this
,
SIGNAL
(
transitionFinished
(
bool
)),
mTransitionDlg
,
SLOT
(
onFilesUpdated
(
bool
)));
mTransitionDlg
->
show
();
}
}
void
UniboardSankoreTransition
::
startDocumentTransition
()
{
bool
result
=
false
;
QString
backupDestinationPath
=
mTransitionDlg
->
backupPath
()
+
"/UniboardBackup"
;
result
=
UBFileSystemUtils
::
copyDir
(
mUniboardSourceDirectory
,
backupDestinationPath
);
QString
uniboardDocumentDirectory
=
mUniboardSourceDirectory
+
"/document"
;
QFileInfoList
fileInfoList
=
UBFileSystemUtils
::
allElementsInDirectory
(
uniboardDocumentDirectory
);
QFileInfoList
::
iterator
fileInfo
;
QFileInfoList
::
iterator
fileInfo
;
bool
result
=
true
;
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
;
}
}
}
}
if
(
!
result
){
if
(
!
result
){
qWarning
()
<<
"The transaction has failed
during the copy of the "
+
fileInfo
->
filePath
()
+
" document.
"
;
qWarning
()
<<
"The transaction has failed"
;
rollbackDocumentsTransition
(
fileInfoList
);
rollbackDocumentsTransition
(
fileInfoList
);
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
);
mTransitionDlg
->
hide
();
}
}
src/transition/UniboardSankoreTransition.h
View file @
7823babd
...
@@ -3,24 +3,31 @@
...
@@ -3,24 +3,31 @@
#include <QObject>
#include <QObject>
#include <QFileInfo>
#include <QFileInfo>
#include "gui/UBUpdateDlg.h"
#include "document/UBDocumentProxy.h"
class
UniboardSankoreTransition
:
public
QObject
class
UniboardSankoreTransition
:
public
QObject
{
{
Q_OBJECT
Q_OBJECT
public
:
public
:
explicit
UniboardSankoreTransition
(
QObject
*
parent
=
0
);
explicit
UniboardSankoreTransition
(
QObject
*
parent
=
0
);
bool
backupUniboardDirectory
();
~
UniboardSankoreTransition
();
void
documentTransition
();
void
documentTransition
();
private
:
private
:
void
rollbackDocumentsTransition
(
QFileInfoList
&
fileInfoList
);
void
rollbackDocumentsTransition
(
QFileInfoList
&
fileInfoList
);
UBUpdateDlg
*
mTransitionDlg
;
protected
:
protected
:
QString
mUniboardSourceDirectory
;
QString
mUniboardSourceDirectory
;
signals
:
signals
:
void
transitionFinished
(
bool
result
);
void
docAdded
(
UBDocumentProxy
*
doc
);
public
slots
:
private
slots
:
void
startDocumentTransition
();
};
};
...
...
src/transition/transition.pri
0 → 100644
View file @
7823babd
HEADERS += src/transition/UniboardSankoreTransition.h
SOURCES += src/transition/UniboardSankoreTransition.cpp
src/web/UBWebController.cpp
View file @
7823babd
...
@@ -195,7 +195,7 @@ void UBWebController::tutorialWebInstance()
...
@@ -195,7 +195,7 @@ void UBWebController::tutorialWebInstance()
void
UBWebController
::
paraschoolWebInstance
()
void
UBWebController
::
paraschoolWebInstance
()
{
{
QUrl
currentUrl
(
"http://
apps.dev-paraschool.com/editor
"
);
QUrl
currentUrl
(
"http://
host9.paraschool.net/editor/#home
"
);
if
(
UBSettings
::
settings
()
->
webUseExternalBrowser
->
get
().
toBool
())
if
(
UBSettings
::
settings
()
->
webUseExternalBrowser
->
get
().
toBool
())
{
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment