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
06a8d52c
Commit
06a8d52c
authored
Jun 24, 2013
by
Claudio Valerio
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changes due to rename
parent
9ac1fff0
Changes
21
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
317 additions
and
324 deletions
+317
-324
OpenBoard.pro
OpenBoard.pro
+1
-0
UBCFFConstants.h
plugins/cffadaptor/src/UBCFFConstants.h
+1
-3
OpenBoard.qrc
resources/OpenBoard.qrc
+1
-1
blackoutWidget.ui
resources/forms/blackoutWidget.ui
+1
-1
documents.ui
resources/forms/documents.ui
+1
-1
mainWindow.ui
resources/forms/mainWindow.ui
+4
-4
preferences.ui
resources/forms/preferences.ui
+110
-64
youTubePublishingDialog.ui
resources/forms/youTubePublishingDialog.ui
+1
-1
UBMetadataDcSubsetAdaptor.cpp
src/adaptors/UBMetadataDcSubsetAdaptor.cpp
+1
-1
UBSvgSubsetAdaptor.cpp
src/adaptors/UBSvgSubsetAdaptor.cpp
+1
-1
UBApplication.cpp
src/core/UBApplication.cpp
+1
-1
UBApplicationController.cpp
src/core/UBApplicationController.cpp
+1
-1
UBSettings.cpp
src/core/UBSettings.cpp
+4
-5
main.cpp
src/core/main.cpp
+2
-2
UBGraphicsScene.cpp
src/domain/UBGraphicsScene.cpp
+1
-1
UBPlatformUtils.h
src/frameworks/UBPlatformUtils.h
+2
-4
UBPlatformUtils_linux.cpp
src/frameworks/UBPlatformUtils_linux.cpp
+0
-7
UBPlatformUtils_mac.mm
src/frameworks/UBPlatformUtils_mac.mm
+0
-69
UBPlatformUtils_win.cpp
src/frameworks/UBPlatformUtils_win.cpp
+0
-16
UBVersion.cpp
src/frameworks/UBVersion.cpp
+169
-128
UBVersion.h
src/frameworks/UBVersion.h
+15
-13
No files found.
OpenBoard.pro
View file @
06a8d52c
...
@@ -22,6 +22,7 @@ macx:OSX_VERSION = "$${VERSION} (r$${SVN_VERSION})"
...
@@ -22,6 +22,7 @@ macx:OSX_VERSION = "$${VERSION} (r$${SVN_VERSION})"
VERSION_RC
=
$$
VERSION_MAJ
,
$$
VERSION_MIN
,
$$
VERSION_TYPE
,
$$
VERSION_PATCH
VERSION_RC
=
$$
VERSION_MAJ
,
$$
VERSION_MIN
,
$$
VERSION_TYPE
,
$$
VERSION_PATCH
VERSION_RC
=
$$
replace
(
VERSION_RC
,
"a"
,
"160"
)
#
0
xA0
VERSION_RC
=
$$
replace
(
VERSION_RC
,
"a"
,
"160"
)
#
0
xA0
VERSION_RC
=
$$
replace
(
VERSION_RC
,
"b"
,
"176"
)
#
0
xB0
VERSION_RC
=
$$
replace
(
VERSION_RC
,
"b"
,
"176"
)
#
0
xB0
VERSION_RC
=
$$
replace
(
VERSION_RC
,
"rc"
,
"192"
)
#
0
xC0
VERSION_RC
=
$$
replace
(
VERSION_RC
,
"r"
,
"240"
)
#
0
xF0
VERSION_RC
=
$$
replace
(
VERSION_RC
,
"r"
,
"240"
)
#
0
xF0
QT
+=
webkit
QT
+=
webkit
...
...
plugins/cffadaptor/src/UBCFFConstants.h
View file @
06a8d52c
...
@@ -118,7 +118,7 @@ const QString aIWBContent = "content";
...
@@ -118,7 +118,7 @@ const QString aIWBContent = "content";
// Attribute values
// Attribute values
const
QString
avIWBVersionNo
=
"1.0"
;
const
QString
avIWBVersionNo
=
"1.0"
;
const
QString
avUBZText
=
"text"
;
const
QString
avUBZText
=
"text"
;
const
QString
avFalse
=
"false"
;
const
QString
avFalse
=
"false"
;
const
QString
avTrue
=
"true"
;
const
QString
avTrue
=
"true"
;
...
@@ -126,7 +126,6 @@ const QString avTrue = "true";
...
@@ -126,7 +126,6 @@ const QString avTrue = "true";
// Namespaces and prefixes
// Namespaces and prefixes
const
QString
svgRequiredExtensionPrefix
=
"http://www.imsglobal.org/iwb/"
;
const
QString
svgRequiredExtensionPrefix
=
"http://www.imsglobal.org/iwb/"
;
const
QString
dcNS
=
"http://purl.org/dc/elements/1.1/"
;
const
QString
dcNS
=
"http://purl.org/dc/elements/1.1/"
;
const
QString
ubNS
=
"http://uniboard.mnemis.com/document"
;
const
QString
svgUBZNS
=
"http://www.imsglobal.org/xsd/iwb_v1p0"
;
const
QString
svgUBZNS
=
"http://www.imsglobal.org/xsd/iwb_v1p0"
;
const
QString
svgIWBNS
=
"http://www.w3.org/2000/svg"
;
const
QString
svgIWBNS
=
"http://www.w3.org/2000/svg"
;
const
QString
xlinkNS
=
"http://www.w3.org/1999/xlink"
;
const
QString
xlinkNS
=
"http://www.w3.org/1999/xlink"
;
...
@@ -138,7 +137,6 @@ http://www.imsglobal.org/profile/iwb/iwbv1p0_v1p0.xsd \
...
@@ -138,7 +137,6 @@ http://www.imsglobal.org/profile/iwb/iwbv1p0_v1p0.xsd \
http://www.w3.org/2000/svg http://www.imsglobal.org/profile/iwb/svgsubsetv1p0_v1p0.xsd \
http://www.w3.org/2000/svg http://www.imsglobal.org/profile/iwb/svgsubsetv1p0_v1p0.xsd \
http://www.w3.org/1999/xlink http://www.imsglobal.org/xsd/w3/1999/xlink.xsd"
;
http://www.w3.org/1999/xlink http://www.imsglobal.org/xsd/w3/1999/xlink.xsd"
;
const
QString
dcNSPrefix
=
"dc"
;
const
QString
dcNSPrefix
=
"dc"
;
const
QString
ubNSPrefix
=
"ub"
;
const
QString
svgIWBNSPrefix
=
"svg"
;
const
QString
svgIWBNSPrefix
=
"svg"
;
const
QString
xlinkNSPrefix
=
"xlink"
;
const
QString
xlinkNSPrefix
=
"xlink"
;
const
QString
iwbNsPrefix
=
"iwb"
;
const
QString
iwbNsPrefix
=
"iwb"
;
...
...
resources/OpenBoard.qrc
View file @
06a8d52c
<RCC>
<RCC>
<qresource prefix="/">
<qresource prefix="/">
<file>images/OpenBoard.png</file>
<file>images/OpenBoard.png</file>
<file>images/big
Unib
oard.png</file>
<file>images/big
OpenB
oard.png</file>
<file>images/close.svg</file>
<file>images/close.svg</file>
<file>images/increase.svg</file>
<file>images/increase.svg</file>
<file>images/decrease.svg</file>
<file>images/decrease.svg</file>
...
...
resources/forms/blackoutWidget.ui
View file @
06a8d52c
...
@@ -82,7 +82,7 @@
...
@@ -82,7 +82,7 @@
</size>
</size>
</property>
</property>
<property
name=
"styleSheet"
>
<property
name=
"styleSheet"
>
<string
notr=
"true"
>
background: url(:/images/big
Unib
oard.png); border: none;
</string>
<string
notr=
"true"
>
background: url(:/images/big
OpenB
oard.png); border: none;
</string>
</property>
</property>
<property
name=
"text"
>
<property
name=
"text"
>
<string
notr=
"true"
/>
<string
notr=
"true"
/>
...
...
resources/forms/documents.ui
View file @
06a8d52c
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
<enum>
Qt::DefaultContextMenu
</enum>
<enum>
Qt::DefaultContextMenu
</enum>
</property>
</property>
<property
name=
"windowTitle"
>
<property
name=
"windowTitle"
>
<string>
Unib
oard Documents
</string>
<string>
OpenB
oard Documents
</string>
</property>
</property>
<property
name=
"styleSheet"
>
<property
name=
"styleSheet"
>
<string
notr=
"true"
/>
<string
notr=
"true"
/>
...
...
resources/forms/mainWindow.ui
View file @
06a8d52c
...
@@ -590,10 +590,10 @@
...
@@ -590,10 +590,10 @@
<normaloff>
:/images/toolbar/menu.png
</normaloff>
:/images/toolbar/menu.png
</iconset>
<normaloff>
:/images/toolbar/menu.png
</normaloff>
:/images/toolbar/menu.png
</iconset>
</property>
</property>
<property
name=
"text"
>
<property
name=
"text"
>
<string>
Open
-Sankoré
</string>
<string>
Open
Board
</string>
</property>
</property>
<property
name=
"toolTip"
>
<property
name=
"toolTip"
>
<string>
Open
-Sankoré
</string>
<string>
Open
Board
</string>
</property>
</property>
</action>
</action>
<action
name=
"actionDesktop"
>
<action
name=
"actionDesktop"
>
...
@@ -1564,10 +1564,10 @@
...
@@ -1564,10 +1564,10 @@
<normaloff>
:/images/toolbar/hide.png
</normaloff>
:/images/toolbar/hide.png
</iconset>
<normaloff>
:/images/toolbar/hide.png
</normaloff>
:/images/toolbar/hide.png
</iconset>
</property>
</property>
<property
name=
"text"
>
<property
name=
"text"
>
<string>
Hide Open
-Sankoré
</string>
<string>
Hide Open
Board
</string>
</property>
</property>
<property
name=
"toolTip"
>
<property
name=
"toolTip"
>
<string>
Hide Open
-Sankoré
Application
</string>
<string>
Hide Open
Board
Application
</string>
</property>
</property>
<property
name=
"shortcut"
>
<property
name=
"shortcut"
>
<string>
Ctrl+H
</string>
<string>
Ctrl+H
</string>
...
...
resources/forms/preferences.ui
View file @
06a8d52c
This diff is collapsed.
Click to expand it.
resources/forms/youTubePublishingDialog.ui
View file @
06a8d52c
...
@@ -69,7 +69,7 @@
...
@@ -69,7 +69,7 @@
<item
row=
"4"
column=
"1"
>
<item
row=
"4"
column=
"1"
>
<widget
class=
"QLineEdit"
name=
"keywords"
>
<widget
class=
"QLineEdit"
name=
"keywords"
>
<property
name=
"text"
>
<property
name=
"text"
>
<string>
Unib
oard
</string>
<string>
OpenB
oard
</string>
</property>
</property>
</widget>
</widget>
</item>
</item>
...
...
src/adaptors/UBMetadataDcSubsetAdaptor.cpp
View file @
06a8d52c
...
@@ -222,7 +222,7 @@ QMap<QString, QVariant> UBMetadataDcSubsetAdaptor::load(QString pPath)
...
@@ -222,7 +222,7 @@ QMap<QString, QVariant> UBMetadataDcSubsetAdaptor::load(QString pPath)
if
(
xml
.
hasError
())
if
(
xml
.
hasError
())
{
{
qWarning
()
<<
"error parsing
sankore
metadata.rdf file "
<<
xml
.
errorString
();
qWarning
()
<<
"error parsing metadata.rdf file "
<<
xml
.
errorString
();
}
}
}
}
...
...
src/adaptors/UBSvgSubsetAdaptor.cpp
View file @
06a8d52c
...
@@ -830,7 +830,7 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
...
@@ -830,7 +830,7 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
if
(
mXmlReader
.
hasError
())
if
(
mXmlReader
.
hasError
())
{
{
qWarning
()
<<
"error parsing
Sankore
file "
<<
mXmlReader
.
errorString
();
qWarning
()
<<
"error parsing file "
<<
mXmlReader
.
errorString
();
}
}
qDebug
()
<<
"Number of detected strokes: "
<<
mStrokesList
.
count
();
qDebug
()
<<
"Number of detected strokes: "
<<
mStrokesList
.
count
();
...
...
src/core/UBApplication.cpp
View file @
06a8d52c
...
@@ -159,7 +159,7 @@ UBApplication::UBApplication(const QString &id, int &argc, char **argv) : QtSing
...
@@ -159,7 +159,7 @@ UBApplication::UBApplication(const QString &id, int &argc, char **argv) : QtSing
setStyle
(
new
UBStyle
());
// Style is owned and deleted by the application
setStyle
(
new
UBStyle
());
// Style is owned and deleted by the application
QString
css
=
UBFileSystemUtils
::
readTextFile
(
UBPlatformUtils
::
applicationResourcesDirectory
()
+
"/etc/
Uniboard
.css"
);
QString
css
=
UBFileSystemUtils
::
readTextFile
(
UBPlatformUtils
::
applicationResourcesDirectory
()
+
"/etc/
"
+
qApp
->
applicationName
()
+
"
.css"
);
if
(
css
.
length
()
>
0
)
if
(
css
.
length
()
>
0
)
setStyleSheet
(
css
);
setStyleSheet
(
css
);
...
...
src/core/UBApplicationController.cpp
View file @
06a8d52c
...
@@ -507,7 +507,7 @@ void UBApplicationController::downloadJsonFinished(QString currentJson)
...
@@ -507,7 +507,7 @@ void UBApplicationController::downloadJsonFinished(QString currentJson)
UBVersion
installedVersion
(
qApp
->
applicationVersion
().
left
(
4
));
UBVersion
installedVersion
(
qApp
->
applicationVersion
().
left
(
4
));
UBVersion
jsonVersion
(
scriptValue
.
property
(
"version"
).
toString
().
left
(
4
));
UBVersion
jsonVersion
(
scriptValue
.
property
(
"version"
).
toString
().
left
(
4
));
if
(
installedVersion
.
isValid
()
&&
jsonVersion
.
isValid
()
&&
jsonVersion
>
installedVersion
)
{
if
(
jsonVersion
>
installedVersion
)
{
if
(
UBApplication
::
mainWindow
->
yesNoQuestion
(
tr
(
"Update available"
),
tr
(
"New update available, would you go to the web page ?"
))){
if
(
UBApplication
::
mainWindow
->
yesNoQuestion
(
tr
(
"Update available"
),
tr
(
"New update available, would you go to the web page ?"
))){
QUrl
url
(
scriptValue
.
property
(
"url"
).
toString
());
QUrl
url
(
scriptValue
.
property
(
"url"
).
toString
());
QDesktopServices
::
openUrl
(
url
);
QDesktopServices
::
openUrl
(
url
);
...
...
src/core/UBSettings.cpp
View file @
06a8d52c
...
@@ -131,8 +131,8 @@ QSettings* UBSettings::getAppSettings()
...
@@ -131,8 +131,8 @@ QSettings* UBSettings::getAppSettings()
{
{
if
(
!
UBSettings
::
sAppSettings
)
if
(
!
UBSettings
::
sAppSettings
)
{
{
QString
tmpSettings
=
QDir
::
tempPath
()
+
"/
Uniboard
.config"
;
QString
tmpSettings
=
QDir
::
tempPath
()
+
"/
"
+
qApp
->
applicationName
()
+
"
.config"
;
QString
appSettings
=
UBPlatformUtils
::
applicationResourcesDirectory
()
+
"/etc/
Uniboard
.config"
;
QString
appSettings
=
UBPlatformUtils
::
applicationResourcesDirectory
()
+
"/etc/
"
+
qApp
->
applicationName
()
+
"
.config"
;
// tmpSettings exists when upgrading Uniboard on Mac (see UBPlatformUtils_mac.mm updater:willInstallUpdate:)
// tmpSettings exists when upgrading Uniboard on Mac (see UBPlatformUtils_mac.mm updater:willInstallUpdate:)
if
(
QFile
::
exists
(
tmpSettings
))
if
(
QFile
::
exists
(
tmpSettings
))
...
@@ -154,7 +154,7 @@ UBSettings::UBSettings(QObject *parent)
...
@@ -154,7 +154,7 @@ UBSettings::UBSettings(QObject *parent)
mAppSettings
=
UBSettings
::
getAppSettings
();
mAppSettings
=
UBSettings
::
getAppSettings
();
QString
userSettingsFile
=
UBSettings
::
userDataDirectory
()
+
"/
Uniboard
User.config"
;
QString
userSettingsFile
=
UBSettings
::
userDataDirectory
()
+
"/
"
+
qApp
->
applicationName
()
+
"
User.config"
;
mUserSettings
=
new
QSettings
(
userSettingsFile
,
QSettings
::
IniFormat
,
parent
);
mUserSettings
=
new
QSettings
(
userSettingsFile
,
QSettings
::
IniFormat
,
parent
);
...
@@ -761,7 +761,6 @@ void UBSettings::setItalicFont(bool italic)
...
@@ -761,7 +761,6 @@ void UBSettings::setItalicFont(bool italic)
QString
UBSettings
::
userDataDirectory
()
QString
UBSettings
::
userDataDirectory
()
{
{
static
QString
dataDirPath
=
""
;
static
QString
dataDirPath
=
""
;
if
(
dataDirPath
.
isEmpty
()){
if
(
dataDirPath
.
isEmpty
()){
if
(
sAppSettings
&&
getAppSettings
()
->
contains
(
"App/DataDirectory"
))
{
if
(
sAppSettings
&&
getAppSettings
()
->
contains
(
"App/DataDirectory"
))
{
...
@@ -775,7 +774,7 @@ QString UBSettings::userDataDirectory()
...
@@ -775,7 +774,7 @@ QString UBSettings::userDataDirectory()
}
}
dataDirPath
=
UBFileSystemUtils
::
normalizeFilePath
(
QDesktopServices
::
storageLocation
(
QDesktopServices
::
DataLocation
));
dataDirPath
=
UBFileSystemUtils
::
normalizeFilePath
(
QDesktopServices
::
storageLocation
(
QDesktopServices
::
DataLocation
));
dataDirPath
.
replace
(
qApp
->
organizationName
()
+
"/"
+
qApp
->
organizationDomain
()
,
""
);
dataDirPath
.
replace
(
qApp
->
organizationName
()
+
"/"
,
""
);
}
}
return
dataDirPath
;
return
dataDirPath
;
}
}
...
...
src/core/main.cpp
View file @
06a8d52c
...
@@ -59,7 +59,7 @@ void ub_message_output(QtMsgType type, const char *msg) {
...
@@ -59,7 +59,7 @@ void ub_message_output(QtMsgType type, const char *msg) {
#endif
#endif
if
(
UBApplication
::
app
()
&&
UBApplication
::
app
()
->
isVerbose
())
{
if
(
UBApplication
::
app
()
&&
UBApplication
::
app
()
->
isVerbose
())
{
QString
logFileNamePath
=
UBSettings
::
userDataDirectory
()
+
"/log/
uniboard
.log"
;
QString
logFileNamePath
=
UBSettings
::
userDataDirectory
()
+
"/log/
"
+
qApp
->
applicationName
()
+
"
.log"
;
QFile
logFile
(
logFileNamePath
);
QFile
logFile
(
logFileNamePath
);
if
(
logFile
.
exists
()
&&
logFile
.
size
()
>
10000000
)
if
(
logFile
.
exists
()
&&
logFile
.
size
()
>
10000000
)
...
@@ -99,7 +99,7 @@ int main(int argc, char *argv[])
...
@@ -99,7 +99,7 @@ int main(int argc, char *argv[])
UBApplication
app
(
"OpenBoard"
,
argc
,
argv
);
UBApplication
app
(
"OpenBoard"
,
argc
,
argv
);
//BUGFIX:
//BUGFIX:
//when importing a
sankore
file that contains a non standard character
//when importing a
OpenBoard
file that contains a non standard character
//the codecForLocale or the codecForCString is used to convert the file path
//the codecForLocale or the codecForCString is used to convert the file path
//into a const char*. This is why in french windows setup the codec name shouldn't be
//into a const char*. This is why in french windows setup the codec name shouldn't be
//set to UTF-8. For example, setting UTF-8, will convert "Haïti" into "HaÂ-ti.
//set to UTF-8. For example, setting UTF-8, will convert "Haïti" into "HaÂ-ti.
...
...
src/domain/UBGraphicsScene.cpp
View file @
06a8d52c
...
@@ -694,7 +694,7 @@ void UBGraphicsScene::DisposeMagnifierQWidgets()
...
@@ -694,7 +694,7 @@ void UBGraphicsScene::DisposeMagnifierQWidgets()
magniferDisplayViewWidget
=
NULL
;
magniferDisplayViewWidget
=
NULL
;
}
}
// some time have crash here on access to app (when call from destructor when close
sankore
app)
// some time have crash here on access to app (when call from destructor when close
OpenBoard
app)
// so i just add try/catch section here
// so i just add try/catch section here
try
try
{
{
...
...
src/frameworks/UBPlatformUtils.h
View file @
06a8d52c
...
@@ -127,8 +127,8 @@ struct KEYBT
...
@@ -127,8 +127,8 @@ struct KEYBT
~
KEYBT
()
~
KEYBT
()
{}
{}
};
};
class
UBKeyboardLocale
class
UBKeyboardLocale
{
{
...
@@ -191,8 +191,6 @@ public:
...
@@ -191,8 +191,6 @@ public:
static
QString
translationPath
(
QString
pFilePrefix
,
QString
pLanguage
);
static
QString
translationPath
(
QString
pFilePrefix
,
QString
pLanguage
);
static
QString
systemLanguage
();
static
QString
systemLanguage
();
static
bool
hasVirtualKeyboard
();
static
bool
hasVirtualKeyboard
();
//static void showVirtualKeyboard();
static
void
runInstaller
(
const
QString
&
installerFilePath
);
static
void
bringPreviousProcessToFront
();
static
void
bringPreviousProcessToFront
();
static
QString
osUserLoginName
();
static
QString
osUserLoginName
();
static
void
setDesktopMode
(
bool
desktop
);
static
void
setDesktopMode
(
bool
desktop
);
...
...
src/frameworks/UBPlatformUtils_linux.cpp
View file @
06a8d52c
...
@@ -86,13 +86,6 @@ QString UBPlatformUtils::systemLanguage()
...
@@ -86,13 +86,6 @@ QString UBPlatformUtils::systemLanguage()
return
QLocale
::
system
().
name
();
return
QLocale
::
system
().
name
();
}
}
void
UBPlatformUtils
::
runInstaller
(
const
QString
&
installerFilePath
)
{
// TODO UB 4.x - auto update & installer are deactivated on Linux
Q_UNUSED
(
installerFilePath
);
}
void
UBPlatformUtils
::
bringPreviousProcessToFront
()
void
UBPlatformUtils
::
bringPreviousProcessToFront
()
{
{
// Mac only
// Mac only
...
...
src/frameworks/UBPlatformUtils_mac.mm
View file @
06a8d52c
...
@@ -32,13 +32,6 @@
...
@@ -32,13 +32,6 @@
#import <Carbon/Carbon.h>
#import <Carbon/Carbon.h>
#import <APELite.h>
#import <APELite.h>
/*
// commented because Sankore crashes on Java Script. It seems to backends dependencies.
#import <WebKit/WebKit.h>
#import <AppKit/AppKit.h>
*/
NSString* bundleShortVersion(NSBundle *bundle)
NSString* bundleShortVersion(NSBundle *bundle)
{
{
return [bundle objectForInfoDictionaryKey:@"CFBundleShortVersionString"];
return [bundle objectForInfoDictionaryKey:@"CFBundleShortVersionString"];
...
@@ -237,60 +230,6 @@ QString UBPlatformUtils::systemLanguage()
...
@@ -237,60 +230,6 @@ QString UBPlatformUtils::systemLanguage()
return result;
return result;
}
}
void UBPlatformUtils::runInstaller(const QString &installerFilePath)
{
UBApplication::setDisabled(true);
// Save app config file to temp directory (will be restored at launch)
QString appSettings = UBPlatformUtils::applicationResourcesDirectory() + "/etc/Uniboard.config";
QString tmpSettings = QDir::tempPath() + "/Uniboard.config";
QFile::remove(tmpSettings);
QFile::copy(appSettings, tmpSettings);
QString updateFilePath = QDir::tempPath() + "/upgrade.sh";
QFile file(":/macx/upgrade.sh");
QFile updateFile(updateFilePath);
if (file.open(QIODevice::ReadOnly) && updateFile.open(QIODevice::WriteOnly))
{
QByteArray payload = file.readAll();
updateFile.write(payload);
updateFile.close();
QString uniboardAndVersion = QApplication::applicationName() + QString(" ") + QApplication::applicationVersion();
QFileInfo fi(installerFilePath);
uniboardAndVersion = fi.fileName().remove(".dmg");
QString bundlePath;
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSString *nssBundlePath = [[NSBundle mainBundle] bundlePath];
bundlePath = QString::fromUtf8([nssBundlePath fileSystemRepresentation], strlen([nssBundlePath fileSystemRepresentation]));
[pool drain];
QString escaped = QString("/bin/sh \"%1\" \"%2\" \"%3\" \"%4\"")
.arg(updateFilePath)
.arg(uniboardAndVersion)
.arg(installerFilePath)
.arg(bundlePath);
qDebug() << "Installing New Version" << escaped;
QProcess process;
bool success = process.startDetached(escaped);
if(success)
return;
}
// did not work .. lets load the dmg ...
QDesktopServices::openUrl(QUrl::fromLocalFile(installerFilePath));
}
void UBPlatformUtils::bringPreviousProcessToFront()
void UBPlatformUtils::bringPreviousProcessToFront()
{
{
ProcessSerialNumber previousProcessPSN = {0, kNoProcess};
ProcessSerialNumber previousProcessPSN = {0, kNoProcess};
...
@@ -580,15 +519,7 @@ void UBPlatformUtils::destroyKeyboardLayouts()
...
@@ -580,15 +519,7 @@ void UBPlatformUtils::destroyKeyboardLayouts()
QString UBPlatformUtils::urlFromClipboard()
QString UBPlatformUtils::urlFromClipboard()
{
{
QString qsRet;
QString qsRet;
/*
// commented because Sankore crashes on Java Script. It seems to backends dependencies.
NSPasteboard* pPasteboard = [NSPasteboard pasteboardWithName:@"Apple CFPasteboard drag"];
WebArchive* pArchive = [[WebArchive alloc] initWithData:[pPasteboard dataForType:@"com.apple.webarchive"]];
qsRet = [[[[pArchive mainResource] URL] absoluteString] UTF8String];
[pArchive release];
*/
return qsRet;
return qsRet;
}
}
...
...
src/frameworks/UBPlatformUtils_win.cpp
View file @
06a8d52c
...
@@ -88,22 +88,6 @@ QString UBPlatformUtils::systemLanguage()
...
@@ -88,22 +88,6 @@ QString UBPlatformUtils::systemLanguage()
return
QLocale
::
system
().
name
();
return
QLocale
::
system
().
name
();
}
}
void
UBPlatformUtils
::
runInstaller
(
const
QString
&
installerFilePath
)
{
QProcess
process
;
QString
escaped
=
QString
(
"
\"
"
)
+
installerFilePath
+
QString
(
"
\"
/SILENT"
);
bool
success
=
process
.
startDetached
(
escaped
);
if
(
!
success
)
{
qWarning
()
<<
"Running '"
<<
installerFilePath
<<
"' failed (error="
<<
process
.
error
()
<<
")"
;
QString
verb
=
"runas"
;
::
ShellExecute
(
NULL
,
verb
.
utf16
(),
installerFilePath
.
utf16
(),
NULL
,
NULL
,
SW_HIDE
);
}
}
void
UBPlatformUtils
::
bringPreviousProcessToFront
()
void
UBPlatformUtils
::
bringPreviousProcessToFront
()
{
{
// Mac only
// Mac only
...
...
src/frameworks/UBVersion.cpp
View file @
06a8d52c
...
@@ -29,159 +29,200 @@
...
@@ -29,159 +29,200 @@
#include "core/memcheck.h"
#include "core/memcheck.h"
UBVersion
::
UBVersion
()
//
UBVersion::UBVersion()
:
mIsValid
(
false
)
//
: mIsValid(false)
,
mPlatform
(
-
1
)
//
, mPlatform(-1)
,
mMajor
(
-
1
)
//
, mMajor(-1)
,
mMinor
(
-
1
)
//
, mMinor(-1)
{
//
{
// NOOP
//
// NOOP
}
//
}
UBVersion
::
UBVersion
(
const
QString
&
string
)
UBVersion
::
UBVersion
(
const
QString
&
string
)
{
{
setString
(
string
);
mString
=
string
;
}
UBVersion
::~
UBVersion
()
{
// NOOP
}
QString
UBVersion
::
toString
()
const
{
return
isValid
()
?
mString
:
"INVALID"
;
}
}
void
UBVersion
::
setString
(
const
QString
&
string
)
uint
UBVersion
::
toUInt
()
const
{
{
mIsValid
=
true
;
uint
result
=
0
;
mString
=
string
;
QStringList
list
=
mString
.
split
(
"."
);
QStringList
versionParts
=
string
.
split
(
"."
);
switch
(
list
.
count
())
{
int
count
=
versionParts
.
count
();
case
2
:
//short version 1.0
if
(
count
<
2
)
result
=
(
list
.
at
(
0
).
toUInt
()
*
1000000
)
+
(
list
.
at
(
1
).
toUInt
()
*
10000
);
{
break
;
mIsValid
=
false
;
case
3
:
return
;
//release version 1.0.0
result
=
(
list
.
at
(
0
).
toUInt
()
*
1000000
)
+
(
list
.
at
(
1
).
toUInt
()
*
10000
)
+
list
.
at
(
2
).
toUInt
();
break
;
case
4
:{
//standard version 1.0.a/b/r.0
uint
releaseStage
=
list
.
at
(
2
).
startsWith
(
"a"
)
?
Alpha
:
(
list
.
at
(
2
).
startsWith
(
"b"
)
?
Beta
:
ReleaseCandidate
);
result
=
(
list
.
at
(
0
).
toUInt
()
*
1000000
)
+
(
list
.
at
(
1
).
toUInt
()
*
10000
)
+
(
releaseStage
*
100
)
+
list
.
at
(
3
).
toUInt
();
break
;
}
}
default
:
mPlatform
=
versionParts
.
at
(
0
).
toInt
(
&
mIsValid
);
qWarning
()
<<
"Unknown version format."
;
if
(
!
isValid
())
return
;
break
;
mMajor
=
versionParts
.
at
(
1
).
toInt
(
&
mIsValid
);
if
(
!
isValid
())
return
;
if
(
count
==
2
)
{
mMinor
=
0
;
mReleaseStage
=
ReleaseCandidate
;
}
else
if
(
count
==
3
)
{
// Format 4.1.2 (implicitly release)
mMinor
=
versionParts
.
at
(
2
).
toInt
(
&
mIsValid
);
if
(
!
isValid
())
return
;
mReleaseStage
=
ReleaseCandidate
;
}
else
if
(
count
>=
4
)
{
// Format 4.1.x.2 (where x = a|b|r|<integer>)
if
(
"a"
==
versionParts
.
at
(
2
))
{
mReleaseStage
=
Alpha
;
}
else
if
(
"b"
==
versionParts
.
at
(
2
))
{
mReleaseStage
=
Beta
;
}
else
if
(
"r"
==
versionParts
.
at
(
2
))
{
mReleaseStage
=
ReleaseCandidate
;
}
else
{
mMinor
=
versionParts
.
at
(
2
).
toInt
(
&
mIsValid
);
if
(
!
isValid
())
return
;
mReleaseStage
=
ReleaseCandidate
;
return
;
}
QStringList
lastParts
=
versionParts
.
at
(
3
).
split
(
" "
);
mMinor
=
lastParts
.
at
(
0
).
toInt
();
}
}
return
result
;
}
}
bool
UBVersion
::
isValid
()
const
UBVersion
::~
UBVersion
()
{
return
mIsValid
;
}
int
UBVersion
::
platformNumber
()
const
{
{
Q_ASSERT
(
isValid
());
// NOOP
return
mPlatform
;
}
}
int
UBVersion
::
majorNumber
()
const
{
Q_ASSERT
(
isValid
());
return
mMajor
;
}
ReleaseStage
UBVersion
::
releaseStage
()
const
//QString UBVersion::toString() const
{
//{
Q_ASSERT
(
isValid
());
// return isValid() ? mString : "INVALID";
return
mReleaseStage
;
//}
}
//void UBVersion::setString(const QString &string)
//{
// mIsValid = true;
// mString = string;
// QStringList versionParts = string.split(".");
// int count = versionParts.count();
// if (count < 2)
// {
// mIsValid = false;
// return;
// }
// mPlatform = versionParts.at(0).toInt(&mIsValid);
// if (!isValid()) return;
// mMajor = versionParts.at(1).toInt(&mIsValid);
// if (!isValid()) return;
// if (count == 2)
// {
// mMinor = 0;
// mReleaseStage = ReleaseCandidate;
// }
// else if (count == 3)
// {
// // Format 4.1.2 (implicitly release)
// mMinor = versionParts.at(2).toInt(&mIsValid);
// if (!isValid()) return;
// mReleaseStage = ReleaseCandidate;
// }
// else if (count >= 4)
// {
// // Format 4.1.x.2 (where x = a|b|r|<integer>)
// if ("a" == versionParts.at(2))
// {
// mReleaseStage = Alpha;
// }
// else if ("b" == versionParts.at(2))
// {
// mReleaseStage = Beta;
// }
// else if ("r" == versionParts.at(2))
// {
// mReleaseStage = ReleaseCandidate;
// }
// else
// {
// mMinor = versionParts.at(2).toInt(&mIsValid);
// if (!isValid()) return;
// mReleaseStage = ReleaseCandidate;
// return;
// }
// QStringList lastParts = versionParts.at(3).split(" ");
// mMinor = lastParts.at(0).toInt();
// }
//}
//bool UBVersion::isValid() const
//{
// return mIsValid;
//}
//int UBVersion::platformNumber() const
//{
// Q_ASSERT(isValid());
// return mPlatform;
//}
//int UBVersion::majorNumber() const
//{
// Q_ASSERT(isValid());
// return mMajor;
//}
//ReleaseStage UBVersion::releaseStage() const
//{
// Q_ASSERT(isValid());
// return mReleaseStage;
//}
//int UBVersion::minorNumber() const
//{
// Q_ASSERT(isValid());
// return mMinor;
//}
//bool UBVersion::operator < (const UBVersion &otherVersion) const
//{
// Q_ASSERT(isValid());
// Q_ASSERT(otherVersion.isValid());
// if (platformNumber() != otherVersion.platformNumber())
// return platformNumber() < otherVersion.platformNumber();
// if (majorNumber() != otherVersion.majorNumber())
// return majorNumber() < otherVersion.majorNumber();
// if (releaseStage() != otherVersion.releaseStage())
// return releaseStage() < otherVersion.releaseStage();
// if (minorNumber() != otherVersion.minorNumber())
// return minorNumber() < otherVersion.minorNumber();
// return false;
//}
//bool UBVersion::operator == (const UBVersion &otherVersion) const
//{
// Q_ASSERT(isValid());
// Q_ASSERT(otherVersion.isValid());
// return (platformNumber() == otherVersion.platformNumber() &&
// majorNumber() == otherVersion.majorNumber() &&
// releaseStage() == otherVersion.releaseStage() &&
// minorNumber() == otherVersion.minorNumber());
//}
//bool UBVersion::operator > (const UBVersion &otherVersion) const
//{
// Q_ASSERT(isValid());
// Q_ASSERT(otherVersion.isValid());
// if (platformNumber() != otherVersion.platformNumber())
// return platformNumber() > otherVersion.platformNumber();
// if (majorNumber() != otherVersion.majorNumber())
// return majorNumber() > otherVersion.majorNumber();
// if (releaseStage() != otherVersion.releaseStage())
// return releaseStage() > otherVersion.releaseStage();
// if (minorNumber() != otherVersion.minorNumber())
// return minorNumber() > otherVersion.minorNumber();
// return false;
//}
int
UBVersion
::
minorNumber
()
const
{
Q_ASSERT
(
isValid
());
return
mMinor
;
}
bool
UBVersion
::
operator
<
(
const
UBVersion
&
otherVersion
)
const
bool
UBVersion
::
operator
<
(
const
UBVersion
&
otherVersion
)
const
{
{
Q_ASSERT
(
isValid
());
return
toUInt
()
<
otherVersion
.
toUInt
();
Q_ASSERT
(
otherVersion
.
isValid
());
if
(
platformNumber
()
!=
otherVersion
.
platformNumber
())
return
platformNumber
()
<
otherVersion
.
platformNumber
();
if
(
majorNumber
()
!=
otherVersion
.
majorNumber
())
return
majorNumber
()
<
otherVersion
.
majorNumber
();
if
(
releaseStage
()
!=
otherVersion
.
releaseStage
())
return
releaseStage
()
<
otherVersion
.
releaseStage
();
if
(
minorNumber
()
!=
otherVersion
.
minorNumber
())
return
minorNumber
()
<
otherVersion
.
minorNumber
();
return
false
;
}
}
bool
UBVersion
::
operator
==
(
const
UBVersion
&
otherVersion
)
const
bool
UBVersion
::
operator
==
(
const
UBVersion
&
otherVersion
)
const
{
{
Q_ASSERT
(
isValid
());
return
toUInt
()
==
otherVersion
.
toUInt
();
Q_ASSERT
(
otherVersion
.
isValid
());
return
(
platformNumber
()
==
otherVersion
.
platformNumber
()
&&
majorNumber
()
==
otherVersion
.
majorNumber
()
&&
releaseStage
()
==
otherVersion
.
releaseStage
()
&&
minorNumber
()
==
otherVersion
.
minorNumber
());
}
}
bool
UBVersion
::
operator
>
(
const
UBVersion
&
otherVersion
)
const
bool
UBVersion
::
operator
>
(
const
UBVersion
&
otherVersion
)
const
{
{
Q_ASSERT
(
isValid
());
return
toUInt
()
>
otherVersion
.
toUInt
();
Q_ASSERT
(
otherVersion
.
isValid
());
if
(
platformNumber
()
!=
otherVersion
.
platformNumber
())
return
platformNumber
()
>
otherVersion
.
platformNumber
();
if
(
majorNumber
()
!=
otherVersion
.
majorNumber
())
return
majorNumber
()
>
otherVersion
.
majorNumber
();
if
(
releaseStage
()
!=
otherVersion
.
releaseStage
())
return
releaseStage
()
>
otherVersion
.
releaseStage
();
if
(
minorNumber
()
!=
otherVersion
.
minorNumber
())
return
minorNumber
()
>
otherVersion
.
minorNumber
();
return
false
;
}
}
src/frameworks/UBVersion.h
View file @
06a8d52c
...
@@ -31,18 +31,20 @@ enum ReleaseStage { Alpha = 10, Beta = 11, ReleaseCandidate = 15 };
...
@@ -31,18 +31,20 @@ enum ReleaseStage { Alpha = 10, Beta = 11, ReleaseCandidate = 15 };
class
UBVersion
class
UBVersion
{
{
public
:
public
:
UBVersion
();
//
UBVersion();
UBVersion
(
const
QString
&
string
);
UBVersion
(
const
QString
&
string
);
virtual
~
UBVersion
();
virtual
~
UBVersion
();
void
setString
(
const
QString
&
string
);
uint
toUInt
()
const
;
QString
toString
()
const
;
bool
isValid
()
const
;
// void setString(const QString &string);
int
platformNumber
()
const
;
// QString toString() const;
int
majorNumber
()
const
;
ReleaseStage
releaseStage
()
const
;
// bool isValid() const;
int
minorNumber
()
const
;
// int platformNumber() const;
// int majorNumber() const;
// ReleaseStage releaseStage() const;
// int minorNumber() const;
bool
operator
<
(
const
UBVersion
&
otherVersion
)
const
;
bool
operator
<
(
const
UBVersion
&
otherVersion
)
const
;
bool
operator
==
(
const
UBVersion
&
otherVersion
)
const
;
bool
operator
==
(
const
UBVersion
&
otherVersion
)
const
;
...
@@ -51,11 +53,11 @@ class UBVersion
...
@@ -51,11 +53,11 @@ class UBVersion
private
:
private
:
QString
mString
;
QString
mString
;
bool
mIsValid
;
//
bool mIsValid;
int
mPlatform
;
//
int mPlatform;
int
mMajor
;
//
int mMajor;
int
mMinor
;
//
int mMinor;
ReleaseStage
mReleaseStage
;
//
ReleaseStage mReleaseStage;
};
};
#endif // UBVERSION_H_
#endif // UBVERSION_H_
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