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
c227888c
Commit
c227888c
authored
Aug 17, 2012
by
Claudio Valerio
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:Sankore/Sankore-3.1
parents
77629223
dc4bb2eb
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
143 additions
and
11 deletions
+143
-11
UBCFFAdaptor.cpp
plugins/cffadaptor/src/UBCFFAdaptor.cpp
+15
-1
UBCFFAdaptor.h
plugins/cffadaptor/src/UBCFFAdaptor.h
+7
-0
UBCFFConstants.h
plugins/cffadaptor/src/UBCFFConstants.h
+1
-0
UBExportAdaptor.cpp
src/adaptors/UBExportAdaptor.cpp
+11
-0
UBExportAdaptor.h
src/adaptors/UBExportAdaptor.h
+2
-0
UBExportCFF.cpp
src/adaptors/UBExportCFF.cpp
+1
-0
UBBoardPaletteManager.cpp
src/board/UBBoardPaletteManager.cpp
+2
-0
UBGraphicsMediaItem.cpp
src/domain/UBGraphicsMediaItem.cpp
+6
-8
UBMessagesDialog.cpp
src/gui/UBMessagesDialog.cpp
+56
-0
UBMessagesDialog.h
src/gui/UBMessagesDialog.h
+37
-0
UBZoomPalette.cpp
src/gui/UBZoomPalette.cpp
+1
-0
gui.pri
src/gui/gui.pri
+4
-2
No files found.
plugins/cffadaptor/src/UBCFFAdaptor.cpp
View file @
c227888c
...
...
@@ -47,7 +47,12 @@ bool UBCFFAdaptor::convertUBZToIWB(const QString &from, const QString &to)
qDebug
()
<<
"The convertrer class is invalid, stopping conversion. Error message"
<<
tmpConvertrer
.
lastErrStr
();
return
false
;
}
if
(
!
tmpConvertrer
.
parse
())
{
bool
bParceRes
=
tmpConvertrer
.
parse
();
mConversionMessages
<<
tmpConvertrer
.
getMessages
();
if
(
!
bParceRes
)
{
return
false
;
}
...
...
@@ -299,6 +304,12 @@ bool UBCFFAdaptor::deleteDir(const QString& pDirPath) const
return
dir
.
rmdir
(
pDirPath
);
}
QList
<
QString
>
UBCFFAdaptor
::
getConversionMessages
()
{
return
mConversionMessages
;
}
bool
UBCFFAdaptor
::
freeDir
(
const
QString
&
dir
)
{
bool
result
=
true
;
...
...
@@ -1110,6 +1121,9 @@ bool UBCFFAdaptor::UBToCFFConverter::setContentFromUBZ(const QDomElement &ubzEle
}
}
else
{
addLastExportError
(
QObject
::
tr
(
"Element ID = "
)
+
QString
(
"%1
\r\n
"
).
arg
(
ubzElement
.
attribute
(
aUBZUuid
))
+
QString
(
"Source file = "
)
+
QString
(
"%1
\r\n
"
).
arg
(
ubzElement
.
attribute
(
aUBZSource
))
+
QObject
::
tr
(
"Content is not supported in destination format."
));
bRet
=
false
;
}
...
...
plugins/cffadaptor/src/UBCFFAdaptor.h
View file @
c227888c
...
...
@@ -20,6 +20,7 @@ public:
bool
convertUBZToIWB
(
const
QString
&
from
,
const
QString
&
to
);
bool
deleteDir
(
const
QString
&
pDirPath
)
const
;
QList
<
QString
>
getConversionMessages
();
private
:
QString
uncompressZip
(
const
QString
&
zipFile
);
...
...
@@ -33,6 +34,7 @@ private:
private
:
QStringList
tmpDirs
;
QList
<
QString
>
mConversionMessages
;
private
:
...
...
@@ -46,8 +48,12 @@ private:
bool
isValid
()
const
;
QString
lastErrStr
()
const
{
return
errorStr
;}
bool
parse
();
QList
<
QString
>
getMessages
()
{
return
mExportErrorList
;}
private
:
void
addLastExportError
(
QString
error
)
{
mExportErrorList
.
append
(
error
);}
void
fillNamespaces
();
bool
parseMetadata
();
...
...
@@ -119,6 +125,7 @@ private:
QString
contentIWBFileName
()
const
;
private
:
QList
<
QString
>
mExportErrorList
;
QMap
<
QString
,
QString
>
iwbSVGItemsAttributes
;
QDomDocument
*
mDataModel
;
//model for reading indata
QXmlStreamWriter
*
mIWBContentWriter
;
//stream to write outdata
...
...
plugins/cffadaptor/src/UBCFFConstants.h
View file @
c227888c
...
...
@@ -74,6 +74,7 @@ const QString aRef = "ref"; // as reference for applying additional attributes
const
QString
aSVGHref
=
"xlink:href"
;
// reference to file
const
QString
aIWBHref
=
"ref"
;
// reference to element ID
const
QString
aUBZHref
=
"href"
;
const
QString
aUBZSource
=
"source"
;
const
QString
aSrc
=
"src"
;
const
QString
aSVGRequiredExtension
=
"requiredExtensions"
;
...
...
src/adaptors/UBExportAdaptor.cpp
View file @
c227888c
...
...
@@ -24,6 +24,7 @@
#include "core/UBApplication.h"
#include "gui/UBMainWindow.h"
#include "gui/UBMessagesDialog.h"
#include "core/memcheck.h"
...
...
@@ -103,3 +104,13 @@ QString UBExportAdaptor::askForDirName(UBDocumentProxy* pDocument, const QString
return
dirname
;
}
void
UBExportAdaptor
::
showErrorsList
(
QList
<
QString
>
errorsList
)
{
if
(
errorsList
.
count
())
{
UBMessagesDialog
*
dialog
=
new
UBMessagesDialog
(
tr
(
"Warnings during export was appeared"
),
UBApplication
::
mainWindow
);
dialog
->
setMessages
(
errorsList
);
dialog
->
show
();
}
}
\ No newline at end of file
src/adaptors/UBExportAdaptor.h
View file @
c227888c
...
...
@@ -46,6 +46,8 @@ class UBExportAdaptor : public QObject
QString
askForFileName
(
UBDocumentProxy
*
pDocument
,
const
QString
&
pDialogTitle
);
QString
askForDirName
(
UBDocumentProxy
*
pDocument
,
const
QString
&
pDialogTitle
);
void
showErrorsList
(
QList
<
QString
>
errorsList
);
bool
mIsVerbose
;
};
...
...
src/adaptors/UBExportCFF.cpp
View file @
c227888c
...
...
@@ -52,6 +52,7 @@ void UBExportCFF::persist(UBDocumentProxy* pDocument)
if
(
mIsVerbose
)
UBApplication
::
showMessage
(
tr
(
"Export failed."
));
showErrorsList
(
toIWBExporter
.
getConversionMessages
());
QApplication
::
restoreOverrideCursor
();
...
...
src/board/UBBoardPaletteManager.cpp
View file @
c227888c
...
...
@@ -269,6 +269,8 @@ void UBBoardPaletteManager::setupPalettes()
mZoomPalette
=
new
UBZoomPalette
(
mContainer
);
mStylusPalette
->
stackUnder
(
mZoomPalette
);
QList
<
QAction
*>
backgroundsActions
;
backgroundsActions
<<
UBApplication
::
mainWindow
->
actionPlainLightBackground
;
...
...
src/domain/UBGraphicsMediaItem.cpp
View file @
c227888c
...
...
@@ -36,15 +36,13 @@ void UBAudioPresentationWidget::paintEvent(QPaintEvent *event)
{
QPainter
painter
(
this
);
painter
.
fillRect
(
rect
(),
QBrush
(
Qt
::
white
));
painter
.
drawRoundedRect
(
1
,
1
,
width
()
-
2
,
height
()
-
2
,
height
()
/
5
,
height
()
/
5
);
QImage
mask_img
(
size
(),
QImage
::
Format_Mono
);
mask_img
.
fill
(
0xff
);
QPainter
mask_painter
(
&
mask_img
);
mask_painter
.
setBrush
(
QBrush
(
QColor
(
0
,
0
,
0
)));
mask_painter
.
drawRoundedRect
(
1
,
1
,
width
()
-
2
,
height
()
-
2
,
height
()
/
5
,
height
()
/
5
);
QPen
borderPen
;
borderPen
.
setWidth
(
2
);
borderPen
.
setColor
(
QColor
(
Qt
::
black
));
setMask
(
QBitmap
::
fromImage
(
mask_img
));
painter
.
setPen
(
borderPen
);
painter
.
drawRect
(
0
,
0
,
width
(),
height
());
if
(
QString
()
!=
mTitle
)
{
...
...
src/gui/UBMessagesDialog.cpp
0 → 100644
View file @
c227888c
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "UBMessagesDialog.h"
UBMessagesDialog
::
UBMessagesDialog
(
QString
windowTitle
,
QWidget
*
parent
)
:
QWidget
(
parent
)
{
resize
(
400
,
0
);
setWindowTitle
(
windowTitle
);
setWindowFlags
(
Qt
::
Tool
|
Qt
::
WindowStaysOnTopHint
);
}
void
UBMessagesDialog
::
setMessages
(
const
QList
<
QString
>
messages
)
{
mMessages
=
messages
;
if
(
mMessages
.
count
())
{
QVBoxLayout
*
messagesLayout
=
new
QVBoxLayout
(
this
);
foreach
(
QString
message
,
mMessages
)
{
QTextEdit
*
messageBox
=
new
QTextEdit
(
this
);
messageBox
->
setMinimumHeight
(
55
);
messageBox
->
setReadOnly
(
true
);
messageBox
->
setFocusPolicy
(
Qt
::
NoFocus
);
messageBox
->
setText
(
message
);
messagesLayout
->
addWidget
(
messageBox
);
}
QPushButton
*
closeButton
=
new
QPushButton
(
tr
(
"Close"
),
this
);
connect
(
closeButton
,
SIGNAL
(
clicked
(
bool
)),
this
,
SLOT
(
dispose
()));
messagesLayout
->
addWidget
(
closeButton
);
setLayout
(
messagesLayout
);
}
}
void
UBMessagesDialog
::
dispose
()
{
delete
this
;
}
\ No newline at end of file
src/gui/UBMessagesDialog.h
0 → 100644
View file @
c227888c
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef UB_MESSAGES_DIALOG_H_
#define UB_MESSAGES_DIALOG_H_
#include <QtGui>
class
UBMessagesDialog
:
public
QWidget
{
Q_OBJECT
public
:
UBMessagesDialog
(
QString
windowTitle
,
QWidget
*
parent
=
NULL
);
void
setMessages
(
const
QList
<
QString
>
messages
);
private
slots
:
void
dispose
();
private
:
QList
<
QString
>
mMessages
;
int
mMessagesFontSize
;
};
#endif UB_MESSAGES_DIALOG_H_
\ No newline at end of file
src/gui/UBZoomPalette.cpp
View file @
c227888c
...
...
@@ -109,5 +109,6 @@ void UBZoomPalette::refreshPalette()
else
{
show
();
raise
();
}
}
src/gui/gui.pri
View file @
c227888c
...
...
@@ -50,7 +50,8 @@ HEADERS += src/gui/UBThumbnailView.h \
src/gui/UBFeaturesActionBar.h \
src/gui/UBDockTeacherGuideWidget.h \
src/gui/UBTeacherGuideWidget.h \
src/gui/UBTeacherGuideWidgetsTools.h
src/gui/UBTeacherGuideWidgetsTools.h \
src/gui/UBMessagesDialog.h
SOURCES += src/gui/UBThumbnailView.cpp \
src/gui/UBFloatingPalette.cpp \
...
...
@@ -103,7 +104,8 @@ SOURCES += src/gui/UBThumbnailView.cpp \
src/gui/UBFeaturesActionBar.cpp \
src/gui/UBDockTeacherGuideWidget.cpp \
src/gui/UBTeacherGuideWidget.cpp \
src/gui/UBTeacherGuideWidgetsTools.cpp
src/gui/UBTeacherGuideWidgetsTools.cpp \
src/gui/UBMessagesDialog.cpp
win32 {
...
...
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