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
f6c6c2b4
Commit
f6c6c2b4
authored
Sep 28, 2011
by
ivan.ilyin
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:Sankore/Sankore-3.1
parents
fb952f6c
c0089c9f
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
197 additions
and
171 deletions
+197
-171
UBLibraryController.cpp
src/board/UBLibraryController.cpp
+6
-1
UBLibraryController.h
src/board/UBLibraryController.h
+3
-0
UBApplicationController.cpp
src/core/UBApplicationController.cpp
+24
-8
UBApplicationController.h
src/core/UBApplicationController.h
+3
-0
UBNetworkAccessManager.cpp
src/network/UBNetworkAccessManager.cpp
+161
-162
No files found.
src/board/UBLibraryController.cpp
View file @
f6c6c2b4
...
...
@@ -72,7 +72,9 @@ UBLibraryController::UBLibraryController(QWidget *pParentWidget) :
bool
UBLibraryController
::
canItemsOnElementBeDeleted
(
UBLibElement
*
pElement
)
{
return
!
pElement
->
path
().
toLocalFile
().
startsWith
(
UBSettings
::
settings
()
->
uniboardShapeLibraryDirectory
());
return
!
pElement
->
path
().
toLocalFile
().
startsWith
(
UBSettings
::
settings
()
->
uniboardShapeLibraryDirectory
())
&&
!
pElement
->
path
().
toLocalFile
().
startsWith
(
UBSettings
::
settings
()
->
sankoreDistributedInteractiveDirectory
())
&&
pElement
->
isDeletable
();
}
void
UBLibraryController
::
createInternalWidgetItems
()
...
...
@@ -696,6 +698,7 @@ UBLibElement::UBLibElement() {
mType
=
eUBLibElementType_Category
;
mName
=
QObject
::
tr
(
"/Home"
,
"Category list label on navigation tool bar"
);
mbMoveable
=
false
;
mbDeletable
=
true
;
}
UBLibElement
::
UBLibElement
(
UBLibElement
*
element
)
...
...
@@ -707,6 +710,7 @@ UBLibElement::UBLibElement(UBLibElement* element)
mName
=
element
->
name
();
mExtension
=
element
->
extension
();
mbMoveable
=
element
->
isMoveable
();
mbDeletable
=
element
->
isDeletable
();
}
...
...
@@ -717,6 +721,7 @@ UBLibElement::UBLibElement(eUBLibElementType type, const QUrl &path, const QStri
mName
=
name
;
mInfo
=
""
;
mbMoveable
=
true
;
mbDeletable
=
true
;
if
(
type
==
eUBLibElementType_Folder
)
mThumbnail
=
QImage
(
":images/libpalette/folder.svg"
);
...
...
src/board/UBLibraryController.h
View file @
f6c6c2b4
...
...
@@ -61,6 +61,8 @@ public:
void
setExtension
(
QString
&
extension
){
mExtension
=
extension
;}
bool
isMoveable
(){
return
mbMoveable
;}
void
setMoveable
(
bool
bState
){
mbMoveable
=
bState
;}
bool
isDeletable
()
const
{
return
mbDeletable
;}
void
setDeletable
(
bool
mState
)
{
mbDeletable
=
mState
;}
private
:
eUBLibElementType
mType
;
...
...
@@ -70,6 +72,7 @@ private:
QString
mName
;
QString
mExtension
;
bool
mbMoveable
;
bool
mbDeletable
;
};
class
UBChainedLibElement
...
...
src/core/UBApplicationController.cpp
View file @
f6c6c2b4
...
...
@@ -49,6 +49,8 @@
#include "podcast/UBPodcastController.h"
#include "network/UBNetworkAccessManager.h"
#include "ui_mainWindow.h"
#ifdef Q_WS_MAC
...
...
@@ -70,6 +72,7 @@ UBApplicationController::UBApplicationController(UBBoardView *pControlView, UBBo
,
mAutomaticCheckForUpdates
(
false
)
,
mCheckingForUpdates
(
false
)
,
mIsShowingDesktop
(
false
)
,
mHttp
(
0
)
{
mDisplayManager
=
new
UBDisplayManager
(
this
);
...
...
@@ -121,6 +124,7 @@ UBApplicationController::~UBApplicationController()
delete
mBlackScene
;
delete
mMirror
;
if
(
mFtp
)
delete
mFtp
;
if
(
mHttp
)
delete
mHttp
;
}
...
...
@@ -499,17 +503,29 @@ void UBApplicationController::showSankoreEditor()
emit
mainModeChanged
(
mMainMode
);
}
void
UBApplicationController
::
runCheckUpdate
(
int
id
,
bool
error
)
{
if
(
!
error
){
if
(
mFtp
!=
NULL
)
delete
mFtp
;
mFtp
=
new
QFtp
(
this
);
connect
(
mFtp
,
SIGNAL
(
commandFinished
(
int
,
bool
)),
this
,
SLOT
(
ftpCommandFinished
(
int
,
bool
)));
mFtp
->
connectToHost
(
"91.121.248.138"
,
21
);
mFtp
->
login
(
"anonymous"
,
"anonymous"
);
mFtp
->
get
(
"update.json"
,
0
);
}
}
void
UBApplicationController
::
checkUpdate
()
{
if
(
mFtp
!=
NULL
)
delete
mFtp
;
mFtp
=
new
QFtp
(
this
);
connect
(
mFtp
,
SIGNAL
(
commandFinished
(
int
,
bool
)),
this
,
SLOT
(
ftpCommandFinished
(
int
,
bool
)))
;
m
Ftp
->
connectToHost
(
"91.121.248.138"
,
21
);
mFtp
->
login
(
"anonymous"
,
"anonymous"
);
m
Ftp
->
get
(
"update.json"
,
0
);
//TODO change this when upgrade the qt version
// networkAccessible : NetworkAccessibility not yet available
if
(
mHttp
)
delete
mHttp
;
QUrl
url
(
"http://www.google.com"
);
m
Http
=
new
QHttp
(
url
.
host
()
);
connect
(
mHttp
,
SIGNAL
(
requestFinished
(
int
,
bool
)),
this
,
SLOT
(
runCheckUpdate
(
int
,
bool
))
);
m
Http
->
get
(
url
.
path
()
);
}
void
UBApplicationController
::
ftpCommandFinished
(
int
id
,
bool
error
)
...
...
src/core/UBApplicationController.h
View file @
f6c6c2b4
...
...
@@ -30,6 +30,7 @@ class UBVersion;
class
UBSoftwareUpdate
;
class
QNetworkAccessManager
;
class
QNetworkReply
;
class
QHttp
;
class
UBApplicationController
:
public
QObject
...
...
@@ -135,6 +136,7 @@ class UBApplicationController : public QObject
private
slots
:
void
ftpCommandFinished
(
int
id
,
bool
error
);
void
runCheckUpdate
(
int
id
,
bool
error
);
protected
:
...
...
@@ -171,6 +173,7 @@ class UBApplicationController : public QObject
QNetworkAccessManager
*
networkAccessManager
;
void
downloadJsonFinished
(
QString
updateString
);
QHttp
*
mHttp
;
};
#endif
/* UBAPPLICATIONCONTROLLER_H_ */
src/network/UBNetworkAccessManager.cpp
View file @
f6c6c2b4
This diff is collapsed.
Click to expand it.
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