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
30b87f02
Commit
30b87f02
authored
Jun 30, 2011
by
Claudio Valerio
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added web pubblication interface
parent
3bdc181c
Changes
11
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
301 additions
and
391 deletions
+301
-391
UBDocumentPublisher.cpp
src/adaptors/publishing/UBDocumentPublisher.cpp
+199
-323
UBDocumentPublisher.h
src/adaptors/publishing/UBDocumentPublisher.h
+32
-50
UBBoardPaletteManager.cpp
src/board/UBBoardPaletteManager.cpp
+2
-2
UBApplication.cpp
src/core/UBApplication.cpp
+11
-9
UBApplication.h
src/core/UBApplication.h
+1
-0
UBApplicationController.cpp
src/core/UBApplicationController.cpp
+27
-1
UBApplicationController.h
src/core/UBApplicationController.h
+3
-1
UBDocumentManager.cpp
src/core/UBDocumentManager.cpp
+4
-2
UBDocumentController.h
src/document/UBDocumentController.h
+3
-3
UBMainWindow.cpp
src/gui/UBMainWindow.cpp
+14
-0
UBMainWindow.h
src/gui/UBMainWindow.h
+5
-0
No files found.
src/adaptors/publishing/UBDocumentPublisher.cpp
View file @
30b87f02
This diff is collapsed.
Click to expand it.
src/adaptors/publishing/UBDocumentPublisher.h
View file @
30b87f02
...
...
@@ -10,74 +10,56 @@
class
UBDocumentProxy
;
class
UBServerXMLHttpRequest
;
class
UBGraphicsW3CWidgetItem
;
class
QWebView
;
class
UBDocumentPublisher
:
public
UBAbstractPublisher
{
Q_OBJECT
;
public
:
explicit
UBDocumentPublisher
(
UBDocumentProxy
*
sourceDocument
,
QObject
*
parent
=
0
);
virtual
~
UBDocumentPublisher
();
public
:
explicit
UBDocumentPublisher
(
UBDocumentProxy
*
sourceDocument
,
QObject
*
parent
=
0
);
virtual
~
UBDocumentPublisher
();
void
publish
();
void
publish
();
protected
:
signals
:
// not needed as we do not publish svg file anymore
//virtual void rasterizePDF();
//virtual void rasterizeSVGImages();
//virtual void updateSVGForWidget(int sceneIndex);
void
loginDone
();
virtual
void
updateGoogleMapApiKey
();
protected
:
virtual
void
rasterizeScenes
();
virtual
void
updateGoogleMapApiKey
();
virtual
void
rasterizeScenes
();
virtual
void
upgradeDocumentForPublishing
();
virtual
void
generateWidgetPropertyScript
(
UBGraphicsW3CWidgetItem
*
widgetItem
,
int
pageNumber
);
virtual
void
upgradeDocumentForPublishing
();
private
slots
:
virtual
void
generateWidgetPropertyScript
(
UBGraphicsW3CWidgetItem
*
widgetItem
,
int
pageNumber
);
void
onFinished
(
QNetworkReply
*
reply
);
void
onLinkClicked
(
const
QUrl
&
url
);
void
onLoadFinished
(
bool
result
);
void
sendZipToUniboardWeb
(
const
QString
&
zipFile
,
const
QUuid
&
publishingUuid
);
private
slots
:
private
:
void
postDocument
(
const
QUuid
&
tokenUuid
,
const
QString
&
encryptedBase64Token
);
void
uploadProgress
(
qint64
,
qint64
);
void
postZipUploadResponse
(
bool
,
const
QByteArray
&
);
void
init
(
);
void
sendUbw
(
);
QString
getBase64Of
(
QString
stringToEncode
);
private
:
QWebView
*
mpWebView
;
QHBoxLayout
*
mpLayout
;
QNetworkAccessManager
*
mpNetworkMgr
;
QNetworkCookieJar
*
mpCookieJar
;
QString
mUsername
;
QString
mPassword
;
QString
mCrlf
;
bool
bCookieSet
;
UBDocumentProxy
*
mSourceDocument
;
UBDocumentProxy
*
mPublishingDocument
;
void
buildUbwFile
()
;
QString
mTmpZipFile
;
UBServerXMLHttpRequest
*
mUploadRequest
;
QString
mTitle
;
QString
mAuthor
;
QString
mDescription
;
QString
mEMail
;
bool
mAttachPDF
;
bool
mAttachUBZ
;
QUrl
mPublishingUrl
;
QString
mPublishingServiceUrl
;
QUuid
mAuthenticationUuid
;
QString
mAuthenticationBase64Token
;
};
class
UBDocumentPublishingDialog
:
public
QDialog
,
public
Ui
::
documentPublishingDialog
{
Q_OBJECT
;
public
:
UBDocumentPublishingDialog
(
QWidget
*
parent
=
0
);
~
UBDocumentPublishingDialog
(){}
private
slots
:
void
updateUIState
(
const
QString
&
string
);
UBDocumentProxy
*
mSourceDocument
;
UBDocumentProxy
*
mPublishingDocument
;
};
#endif // UBDOCUMENTPUBLISHER_H
src/board/UBBoardPaletteManager.cpp
View file @
30b87f02
...
...
@@ -152,7 +152,7 @@ void UBBoardPaletteManager::setupPalettes()
addItemActions
<<
UBApplication
::
mainWindow
->
actionAddItemToCurrentPage
;
addItemActions
<<
UBApplication
::
mainWindow
->
actionAddItemToNewPage
;
addItemActions
<<
UBApplication
::
mainWindow
->
actionAddItemToLibrary
;
//
addItemActions << UBApplication::mainWindow->actionShareItemOnWeb;
addItemActions
<<
UBApplication
::
mainWindow
->
actionShareItemOnWeb
;
mAddItemPalette
=
new
UBActionPalette
(
addItemActions
,
Qt
::
Horizontal
,
0
);
mAddItemPalette
->
setButtonIconSize
(
QSize
(
128
,
128
));
...
...
@@ -306,7 +306,7 @@ void UBBoardPaletteManager::connectPalettes()
connect
(
UBApplication
::
mainWindow
->
actionAddItemToCurrentPage
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
addItemToCurrentPage
()));
connect
(
UBApplication
::
mainWindow
->
actionAddItemToNewPage
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
addItemToNewPage
()));
connect
(
UBApplication
::
mainWindow
->
actionAddItemToLibrary
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
addItemToLibrary
()));
//
connect(UBApplication::mainWindow->actionShareItemOnWeb, SIGNAL(triggered()), this, SLOT(shareItemOnWeb()));
connect
(
UBApplication
::
mainWindow
->
actionShareItemOnWeb
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
shareItemOnWeb
()));
connect
(
UBApplication
::
mainWindow
->
actionEraseItems
,
SIGNAL
(
triggered
()),
mErasePalette
,
SLOT
(
close
()));
connect
(
UBApplication
::
mainWindow
->
actionEraseAnnotations
,
SIGNAL
(
triggered
()),
mErasePalette
,
SLOT
(
close
()));
...
...
src/core/UBApplication.cpp
View file @
30b87f02
...
...
@@ -53,7 +53,6 @@ UBApplicationController* UBApplication::applicationController = 0;
UBBoardController
*
UBApplication
::
boardController
=
0
;
UBWebController
*
UBApplication
::
webController
=
0
;
UBDocumentController
*
UBApplication
::
documentController
=
0
;
//UBSoftwareUpdateController* UBApplication::softwareUpdateController = 0;
UniboardSankoreTransition
*
UBApplication
::
mUniboardSankoreTransition
=
0
;
UBMainWindow
*
UBApplication
::
mainWindow
=
0
;
...
...
@@ -91,9 +90,8 @@ static OSStatus ub_appleEventProcessor(const AppleEvent *ae, AppleEvent *event,
#endif
UBApplication
::
UBApplication
(
const
QString
&
id
,
int
&
argc
,
char
**
argv
)
:
QtSingleApplication
(
id
,
argc
,
argv
),
mPreferencesController
(
NULL
)
UBApplication
::
UBApplication
(
const
QString
&
id
,
int
&
argc
,
char
**
argv
)
:
QtSingleApplication
(
id
,
argc
,
argv
),
mPreferencesController
(
NULL
)
{
staticMemoryCleaner
=
new
QObject
(
0
);
// deleted in UBApplication destructor
...
...
@@ -186,11 +184,11 @@ UBApplication::~UBApplication()
delete
mUniboardSankoreTransition
;
mUniboardSankoreTransition
=
0
;
if
(
mPreferencesController
)
{
delete
mPreferencesController
;
mPreferencesController
=
0
;
}
if
(
mPreferencesController
)
{
delete
mPreferencesController
;
mPreferencesController
=
0
;
}
}
int
UBApplication
::
exec
(
const
QString
&
pFileToImport
)
...
...
@@ -343,6 +341,10 @@ void UBApplication::showDocument()
applicationController
->
showDocument
();
}
void
UBApplication
::
showSankoreWebDocument
()
{
applicationController
->
showSankoreWebDocument
();
}
int
UBApplication
::
toolBarHeight
()
{
...
...
src/core/UBApplication.h
View file @
30b87f02
...
...
@@ -88,6 +88,7 @@ class UBApplication : public QtSingleApplication
void
showBoard
();
void
showInternet
();
void
showDocument
();
void
showSankoreWebDocument
();
void
toolBarPositionChanged
(
QVariant
topOrBottom
);
void
toolBarDisplayTextChanged
(
QVariant
display
);
...
...
src/core/UBApplicationController.cpp
View file @
30b87f02
...
...
@@ -325,7 +325,7 @@ void UBApplicationController::showBoard()
if
(
UBApplication
::
boardController
)
UBApplication
::
boardController
->
show
();
UBPlatformUtils
::
setDesktopMode
(
false
);
UBPlatformUtils
::
setDesktopMode
(
false
);
mUninoteController
->
hideWindow
();
mMainWindow
->
show
();
...
...
@@ -396,6 +396,32 @@ void UBApplicationController::showDocument()
emit
mainModeChanged
(
Document
);
}
void
UBApplicationController
::
showSankoreWebDocument
()
{
mMainWindow
->
webToolBar
->
hide
();
mMainWindow
->
boardToolBar
->
hide
();
mMainWindow
->
tutorialToolBar
->
hide
();
mMainWindow
->
documentToolBar
->
show
();
mMainMode
=
WebDocument
;
adaptToolBar
();
mirroringEnabled
(
false
);
mMainWindow
->
switchToSankoreWebDocumentWidget
();
UBApplication
::
documentController
->
hide
();
mMainWindow
->
show
();
mUninoteController
->
hideWindow
();
emit
mainModeChanged
(
WebDocument
);
}
void
UBApplicationController
::
showDesktop
(
bool
dontSwitchFrontProcess
)
{
...
...
src/core/UBApplicationController.h
View file @
30b87f02
...
...
@@ -53,6 +53,8 @@ class UBApplicationController : public QObject
void
showDocument
();
void
showSankoreWebDocument
();
void
showMessage
(
const
QString
&
message
,
bool
showSpinningWheel
);
void
importFile
(
const
QString
&
pFilePath
);
...
...
@@ -69,7 +71,7 @@ class UBApplicationController : public QObject
enum
MainMode
{
Board
=
0
,
Internet
,
Document
,
Tutorial
,
ParaschoolEditor
Board
=
0
,
Internet
,
Document
,
Tutorial
,
ParaschoolEditor
,
WebDocument
};
MainMode
displayMode
()
...
...
src/core/UBDocumentManager.cpp
View file @
30b87f02
...
...
@@ -56,8 +56,10 @@ UBDocumentManager::UBDocumentManager(QObject *parent)
mExportAdaptors
.
append
(
exportFullPdf
);
UBExportDocument
*
exportDocument
=
new
UBExportDocument
(
this
);
mExportAdaptors
.
append
(
exportDocument
);
UBExportWeb
*
exportWeb
=
new
UBExportWeb
(
this
);
mExportAdaptors
.
append
(
exportWeb
);
// UBExportWeb* exportWeb = new UBExportWeb(this);
// mExportAdaptors.append(exportWeb);
UBWebPublisher
*
webPublished
=
new
UBWebPublisher
(
this
);
mExportAdaptors
.
append
(
webPublished
);
UBImportDocument
*
documentImport
=
new
UBImportDocument
(
this
);
mImportAdaptors
.
append
(
documentImport
);
...
...
src/document/UBDocumentController.h
View file @
30b87f02
...
...
@@ -33,10 +33,10 @@ class UBDocumentController : public QObject
QWidget
*
controlView
();
UBDocumentProxyTreeItem
*
findDocument
(
UBDocumentProxy
*
proxy
);
bool
addFileToDocument
(
UBDocumentProxy
*
document
);
UBDocumentProxy
*
getCurrentDocument
();
UBDocumentProxy
*
getCurrentDocument
();
signals
:
void
refreshThumbnails
();
void
refreshThumbnails
();
void
exportDone
();
public
slots
:
...
...
@@ -91,7 +91,7 @@ class UBDocumentController : public QObject
UBDocumentToolsPalette
*
mToolsPalette
;
bool
mToolsPalettePositionned
;
UBDocumentGroupTreeItem
*
mTrashTi
;
UBDocumentProxy
*
mCurrentDocument
;
UBDocumentProxy
*
mCurrentDocument
;
private
slots
:
void
documentZoomSliderValueChanged
(
int
value
);
...
...
src/gui/UBMainWindow.cpp
View file @
30b87f02
...
...
@@ -14,6 +14,7 @@ UBMainWindow::UBMainWindow(QWidget *parent, Qt::WindowFlags flags)
,
mBoardWidget
(
0
)
,
mWebWidget
(
0
)
,
mDocumentsWidget
(
0
)
,
mSankoreWebDocumentWidget
(
0
)
{
Ui
::
MainWindow
::
setupUi
(
this
);
...
...
@@ -91,6 +92,19 @@ void UBMainWindow::switchToDocumentsWidget()
}
}
void
UBMainWindow
::
addSankoreWebDocumentWidget
(
QWebView
*
pWidget
)
{
if
(
!
mSankoreWebDocumentWidget
){
mSankoreWebDocumentWidget
=
pWidget
;
mStackedLayout
->
addWidget
(
mSankoreWebDocumentWidget
);
}
}
void
UBMainWindow
::
switchToSankoreWebDocumentWidget
()
{
if
(
mSankoreWebDocumentWidget
)
mStackedLayout
->
setCurrentWidget
(
mSankoreWebDocumentWidget
);
}
void
UBMainWindow
::
keyPressEvent
(
QKeyEvent
*
event
)
{
QMainWindow
::
keyPressEvent
(
event
);
...
...
src/gui/UBMainWindow.h
View file @
30b87f02
...
...
@@ -5,6 +5,7 @@
#include <QMainWindow>
#include <QWidget>
#include <QWebView>
class
QStackedLayout
;
...
...
@@ -27,6 +28,9 @@ class UBMainWindow : public QMainWindow, public Ui::MainWindow
void
addDocumentsWidget
(
QWidget
*
pWidget
);
void
switchToDocumentsWidget
();
void
addSankoreWebDocumentWidget
(
QWebView
*
pWidget
);
void
switchToSankoreWebDocumentWidget
();
public
slots
:
void
onExportDone
();
...
...
@@ -45,6 +49,7 @@ class UBMainWindow : public QMainWindow, public Ui::MainWindow
QWidget
*
mBoardWidget
;
QWidget
*
mWebWidget
;
QWidget
*
mDocumentsWidget
;
QWebView
*
mSankoreWebDocumentWidget
;
};
...
...
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