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
d6af845c
Commit
d6af845c
authored
Jan 27, 2012
by
shibakaneki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
src/adaptors
parent
5ce549f1
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
149 additions
and
37 deletions
+149
-37
sankore.qrc
resources/sankore.qrc
+6
-0
style.qss
resources/style.qss
+3
-2
UBTBDocumentEditWidget.cpp
src/gui/UBTBDocumentEditWidget.cpp
+23
-0
UBTBDocumentEditWidget.h
src/gui/UBTBDocumentEditWidget.h
+6
-0
UBTeacherBarDataMgr.cpp
src/gui/UBTeacherBarDataMgr.cpp
+63
-2
UBTeacherBarDataMgr.h
src/gui/UBTeacherBarDataMgr.h
+33
-3
UBTeacherBarPreviewWidget.cpp
src/gui/UBTeacherBarPreviewWidget.cpp
+10
-19
UBTeacherBarPreviewWidget.h
src/gui/UBTeacherBarPreviewWidget.h
+5
-11
No files found.
resources/sankore.qrc
View file @
d6af845c
...
...
@@ -341,5 +341,11 @@
<file>images/duration1.png</file>
<file>images/duration2.png</file>
<file>images/duration3.png</file>
<file>images/licenses/ccby.png</file>
<file>images/licenses/ccbync.png</file>
<file>images/licenses/ccbyncnd.png</file>
<file>images/licenses/ccbyncsa.png</file>
<file>images/licenses/ccbynd.png</file>
<file>images/licenses/ccbysa.png</file>
</qresource>
</RCC>
resources/style.qss
View file @
d6af845c
...
...
@@ -83,10 +83,11 @@ QWidget#UBTeacherBarTargetBox
background-color: white;
}
QWidget#UBActionPreviewContent
QWidget#UBActionPreviewContent,
QTextEdit#UBCommentPreview
{
border-radius : 10px;
border: 2px solid;
border: 2px solid
#999999
;
padding: 5px 5px 5px 5px;
}
...
...
src/gui/UBTBDocumentEditWidget.cpp
View file @
d6af845c
...
...
@@ -10,6 +10,7 @@ UBTBDocumentEditWidget::UBTBDocumentEditWidget(UBTeacherBarDataMgr* pDataMgr, QW
,
mpTarget
(
NULL
)
,
mpMetadataLabel
(
NULL
)
,
mpLicenseLabel
(
NULL
)
,
mpLicenseCombox
(
NULL
)
{
setObjectName
(
name
);
...
...
@@ -31,6 +32,7 @@ UBTBDocumentEditWidget::UBTBDocumentEditWidget(UBTeacherBarDataMgr* pDataMgr, QW
mpTitle
=
new
QLineEdit
(
mpContainer
);
mpTitle
->
setObjectName
(
"DockPaletteWidgetLineEdit"
);
mContainerLayout
.
addWidget
(
mpTitle
,
0
);
mContainerLayout
.
addWidget
(
&
mTitleSeparator
);
// Target
mpTargetLabel
=
new
QLabel
(
tr
(
"Session Target"
),
mpContainer
);
...
...
@@ -39,18 +41,31 @@ UBTBDocumentEditWidget::UBTBDocumentEditWidget(UBTeacherBarDataMgr* pDataMgr, QW
mpTarget
=
new
QTextEdit
(
mpContainer
);
mpTarget
->
setObjectName
(
"UBTeacherBarTargetBox"
);
mContainerLayout
.
addWidget
(
mpTarget
,
1
);
mContainerLayout
.
addWidget
(
&
mTargetSeparator
);
// Metadata
mpMetadataLabel
=
new
QLabel
(
tr
(
"Metadata"
),
mpContainer
);
mpMetadataLabel
->
setAlignment
(
Qt
::
AlignLeft
);
//mpMetadataLabel->setObjectName("UBTeacherBarPreviewSubtitle");
mContainerLayout
.
addWidget
(
mpMetadataLabel
,
0
);
mContainerLayout
.
addWidget
(
&
mLicenseSeparator
);
// License
mpLicenseLabel
=
new
QLabel
(
tr
(
"License"
),
mpContainer
);
mpLicenseLabel
->
setAlignment
(
Qt
::
AlignLeft
);
//mpLicenseLabel->setObjectName("UBTeacherBarPreviewSubtitle");
mContainerLayout
.
addWidget
(
mpLicenseLabel
,
0
);
mpLicenseCombox
=
new
QComboBox
(
this
);
mpLicenseCombox
->
setObjectName
(
"DockPaletteWidgetComboBox"
);
QStringList
qslLicenses
;
qslLicenses
<<
"CC BY"
;
qslLicenses
<<
"CC BY-ND"
;
qslLicenses
<<
"CC BY-NC-SA"
;
qslLicenses
<<
"CC BY-SA"
;
qslLicenses
<<
"CC BY-NC"
;
qslLicenses
<<
"CC BY-NC-ND"
;
mpLicenseCombox
->
addItems
(
qslLicenses
);
mContainerLayout
.
addWidget
(
mpLicenseCombox
);
mpPageViewButton
=
new
QPushButton
(
tr
(
"Page View"
),
this
);
mpPageViewButton
->
setObjectName
(
"DockPaletteWidgetButton"
);
...
...
@@ -65,6 +80,7 @@ UBTBDocumentEditWidget::UBTBDocumentEditWidget(UBTeacherBarDataMgr* pDataMgr, QW
connect
(
mpPreviewButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
onPreview
()));
connect
(
mpTitle
,
SIGNAL
(
textChanged
(
QString
)),
this
,
SLOT
(
onSessionTitleChanged
()));
connect
(
mpTarget
,
SIGNAL
(
textChanged
()),
this
,
SLOT
(
onSessionTargetChanged
()));
connect
(
mpLicenseCombox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
onLicenseCurrentIndexChanged
(
int
)));
}
UBTBDocumentEditWidget
::~
UBTBDocumentEditWidget
()
...
...
@@ -75,6 +91,7 @@ UBTBDocumentEditWidget::~UBTBDocumentEditWidget()
DELETEPTR
(
mpTarget
);
DELETEPTR
(
mpMetadataLabel
);
DELETEPTR
(
mpLicenseLabel
);
DELETEPTR
(
mpLicenseCombox
);
DELETEPTR
(
mpPageViewButton
);
DELETEPTR
(
mpPreviewButton
);
}
...
...
@@ -101,6 +118,12 @@ void UBTBDocumentEditWidget::onSessionTargetChanged()
emit
valueChanged
();
}
void
UBTBDocumentEditWidget
::
onLicenseCurrentIndexChanged
(
int
selection
)
{
mpDataMgr
->
setSessionLicence
((
eLicense
)
selection
);
emit
valueChanged
();
}
void
UBTBDocumentEditWidget
::
updateFields
()
{
mpTitle
->
setText
(
mpDataMgr
->
sessionTitle
());
...
...
src/gui/UBTBDocumentEditWidget.h
View file @
d6af845c
...
...
@@ -6,6 +6,7 @@
#include <QLabel>
#include <QLineEdit>
#include <QTextEdit>
#include <QComboBox>
#include "UBTeacherBarDataMgr.h"
...
...
@@ -27,6 +28,7 @@ private slots:
void
onPreview
();
void
onSessionTitleChanged
();
void
onSessionTargetChanged
();
void
onLicenseCurrentIndexChanged
(
int
selection
);
private
:
QVBoxLayout
mLayout
;
...
...
@@ -35,6 +37,9 @@ private:
QVBoxLayout
mContainerLayout
;
QPushButton
*
mpPageViewButton
;
QPushButton
*
mpPreviewButton
;
UBTBSeparator
mTitleSeparator
;
UBTBSeparator
mTargetSeparator
;
UBTBSeparator
mLicenseSeparator
;
QWidget
*
mpContainer
;
QLabel
*
mpTitleLabel
;
...
...
@@ -43,6 +48,7 @@ private:
QTextEdit
*
mpTarget
;
QLabel
*
mpMetadataLabel
;
QLabel
*
mpLicenseLabel
;
QComboBox
*
mpLicenseCombox
;
UBTeacherBarDataMgr
*
mpDataMgr
;
};
...
...
src/gui/UBTeacherBarDataMgr.cpp
View file @
d6af845c
...
...
@@ -58,7 +58,7 @@ void UBTeacherBarDataMgr::saveContent()
documentProxy
->
setSessionTitle
(
mSessionTitle
);
documentProxy
->
setSessionTarget
(
mSessionTarget
);
documentProxy
->
setSessionLicence
(
mSessionLicence
);
documentProxy
->
setSessionLicence
(
QString
(
"%0"
).
arg
(
mSessionLicence
)
);
UBMetadataDcSubsetAdaptor
::
persist
(
documentProxy
);
}
...
...
@@ -75,7 +75,7 @@ void UBTeacherBarDataMgr::loadContent(bool docChanged)
if
(
true
/*docChanged*/
){
mSessionTitle
=
documentProxy
->
sessionTitle
();
mSessionTarget
=
documentProxy
->
sessionTarget
();
mSessionLicence
=
documentProxy
->
sessionLicence
();
mSessionLicence
=
(
eLicense
)
documentProxy
->
sessionLicence
().
toInt
();
}
// Page Title
...
...
@@ -113,3 +113,64 @@ void UBTeacherBarDataMgr::loadContent(bool docChanged)
mComments
=
nextInfos
.
comments
;
}
// ------------------------------------------------------------------------------------
UBTBSeparator
::
UBTBSeparator
(
QWidget
*
parent
,
const
char
*
name
)
:
QFrame
(
parent
)
{
setObjectName
(
"UBTBSeparator"
);
setMinimumHeight
(
5
);
setMaximumHeight
(
5
);
}
UBTBSeparator
::~
UBTBSeparator
()
{
}
// ------------------------------------------------------------------------------------
UBTBLicenseWidget
::
UBTBLicenseWidget
(
QWidget
*
parent
,
const
char
*
name
)
:
QWidget
(
parent
)
{
setObjectName
(
name
);
setLayout
(
&
mLayout
);
mpIcon
=
new
QLabel
(
this
);
mpText
=
new
QLabel
(
this
);
mpText
->
setWordWrap
(
true
);
mLayout
.
addWidget
(
mpIcon
);
mLayout
.
addWidget
(
mpText
);
}
UBTBLicenseWidget
::~
UBTBLicenseWidget
()
{
DELETEPTR
(
mpIcon
);
DELETEPTR
(
mpText
);
}
void
UBTBLicenseWidget
::
setLicense
(
eLicense
lic
)
{
switch
(
lic
){
case
eLicense_CCBY
:
mpIcon
->
setPixmap
(
QPixmap
(
":images/licenses/ccby.png"
));
mpText
->
setText
(
tr
(
"Creative Common License %0"
).
arg
(
"CC BY"
));
break
;
case
eLicense_CCBYND
:
mpIcon
->
setPixmap
(
QPixmap
(
":images/licenses/ccbynd.png"
));
mpText
->
setText
(
tr
(
"Creative Common License %0"
).
arg
(
"CC BY-ND"
));
break
;
case
eLicense_CCBYNCSA
:
mpIcon
->
setPixmap
(
QPixmap
(
":images/licenses/ccbyncsa.png"
));
mpText
->
setText
(
tr
(
"Creative Common License %0"
).
arg
(
"CC BY-NC-SA"
));
break
;
case
eLicense_CCBYSA
:
mpIcon
->
setPixmap
(
QPixmap
(
":images/licenses/ccbysa.png"
));
mpText
->
setText
(
tr
(
"Creative Common License %0"
).
arg
(
"CC BY-SA"
));
break
;
case
eLicense_CCBYNC
:
mpIcon
->
setPixmap
(
QPixmap
(
":images/licenses/ccbync.png"
));
mpText
->
setText
(
tr
(
"Creative Common License %0"
).
arg
(
"CC BY-NC"
));
break
;
case
eLicense_CCBYNCND
:
mpIcon
->
setPixmap
(
QPixmap
(
":images/licenses/ccbyncnd.png"
));
mpText
->
setText
(
tr
(
"Creative Common License %0"
).
arg
(
"CC BY-NC-ND"
));
break
;
}
}
src/gui/UBTeacherBarDataMgr.h
View file @
d6af845c
...
...
@@ -9,6 +9,7 @@
#include <QHBoxLayout>
#include <QVBoxLayout>
#include <QComboBox>
#include <QFrame>
typedef
enum
{
eTeacherBarState_DocumentEdit
,
...
...
@@ -32,6 +33,35 @@ typedef struct{
QString
link
;
}
sLink
;
typedef
enum
{
eLicense_CCBY
,
eLicense_CCBYND
,
eLicense_CCBYNCSA
,
eLicense_CCBYSA
,
eLicense_CCBYNC
,
eLicense_CCBYNCND
}
eLicense
;
class
UBTBSeparator
:
public
QFrame
{
public
:
UBTBSeparator
(
QWidget
*
parent
=
0
,
const
char
*
name
=
"UBTBSeparator"
);
~
UBTBSeparator
();
};
class
UBTBLicenseWidget
:
public
QWidget
{
public
:
UBTBLicenseWidget
(
QWidget
*
parent
=
0
,
const
char
*
name
=
"UBTBLicenseWidget"
);
~
UBTBLicenseWidget
();
void
setLicense
(
eLicense
lic
);
private
:
QHBoxLayout
mLayout
;
QLabel
*
mpIcon
;
QLabel
*
mpText
;
};
class
UBTeacherBarDataMgr
{
public
:
...
...
@@ -47,8 +77,8 @@ public:
QString
sessionTarget
(){
return
mSessionTarget
;}
// Licence
void
setSessionLicence
(
const
QString
&
licence
){
mSessionLicence
=
licence
;}
QString
sessionLicence
(){
return
mSessionLicence
;}
void
setSessionLicence
(
eLicense
licence
){
mSessionLicence
=
licence
;}
eLicense
sessionLicence
(){
return
mSessionLicence
;}
// Page Title
void
setPageTitle
(
const
QString
&
title
){
mPageTitle
=
title
;}
...
...
@@ -77,7 +107,7 @@ public:
private
:
QString
mSessionTitle
;
QString
mSessionTarget
;
QString
mSessionLicence
;
eLicense
mSessionLicence
;
QString
mPageTitle
;
QString
mComments
;
...
...
src/gui/UBTeacherBarPreviewWidget.cpp
View file @
d6af845c
...
...
@@ -126,7 +126,7 @@ void UBActionPreview::setContent(const QString &content)
{
if
(
NULL
!=
mpContent
){
mpContent
->
setText
(
content
);
setMinimumHeight
(
mpOwner
->
height
()
+
mpContent
->
height
());
setMinimumHeight
(
mpOwner
->
height
()
+
mpContent
->
document
()
->
documentLayout
()
->
documentSize
().
toSize
().
height
());
}
}
...
...
@@ -139,18 +139,6 @@ UBTBPreviewContainer::UBTBPreviewContainer(QWidget *parent, const char *name):UB
UBTBPreviewContainer
::~
UBTBPreviewContainer
()
{
}
// ------------------------------------------------------------------------------------
UBTBPreviewSeparator
::
UBTBPreviewSeparator
(
QWidget
*
parent
,
const
char
*
name
)
:
QFrame
(
parent
)
{
setObjectName
(
"UBTBSeparator"
);
setMinimumHeight
(
5
);
setMaximumHeight
(
5
);
}
UBTBPreviewSeparator
::~
UBTBPreviewSeparator
()
{
}
// ------------------------------------------------------------------------------------
...
...
@@ -206,11 +194,8 @@ UBTeacherBarPreviewWidget::UBTeacherBarPreviewWidget(UBTeacherBarDataMgr* pDataM
// License
mLayout
.
addWidget
(
&
mLicenseSeparator
);
mpLicenseLabel
=
new
QLabel
(
tr
(
"License"
),
this
);
mpLicenseLabel
->
setObjectName
(
"UBTeacherBarPreviewSubtitle"
);
mpLicenseLabel
=
new
UBTBLicenseWidget
(
this
);
mLayout
.
addWidget
(
mpLicenseLabel
);
// TODO : Add the license field here
// Edit button
mpEditButton
=
new
QPushButton
(
tr
(
"Edit infos"
),
this
);
...
...
@@ -271,11 +256,14 @@ void UBTeacherBarPreviewWidget::updateFields()
// Media
generateMedias
();
// Comments
generateComments
();
// Links
generateLinks
();
//
Comments
generateComments
(
);
//
License
mpLicenseLabel
->
setLicense
(
mpDataMgr
->
sessionLicence
()
);
}
...
...
@@ -295,6 +283,9 @@ void UBTeacherBarPreviewWidget::clearFields()
}
mStoredWidgets
.
clear
();
}
// License
mpLicenseLabel
->
setLicense
(
eLicense_CCBY
);
}
void
UBTeacherBarPreviewWidget
::
generateActions
()
...
...
src/gui/UBTeacherBarPreviewWidget.h
View file @
d6af845c
...
...
@@ -4,7 +4,6 @@
#include <QLabel>
#include <QVBoxLayout>
#include <QPushButton>
#include <QFrame>
#include "core/UBPersistenceManager.h"
#include "customWidgets/UBWidgetList.h"
...
...
@@ -52,13 +51,6 @@ public:
~
UBTBPreviewContainer
();
};
class
UBTBPreviewSeparator
:
public
QFrame
{
public
:
UBTBPreviewSeparator
(
QWidget
*
parent
=
0
,
const
char
*
name
=
"UBTBPreviewSeparator"
);
~
UBTBPreviewSeparator
();
};
class
UBTeacherBarPreviewWidget
:
public
QWidget
{
Q_OBJECT
...
...
@@ -90,7 +82,7 @@ private:
// Titles
QVBoxLayout
mTitleLayout
;
UBTB
Preview
Separator
mTitleSeparator
;
UBTBSeparator
mTitleSeparator
;
QWidget
mTitleContainer
;
QLabel
*
mpSessionTitle
;
QLabel
*
mpTitle
;
...
...
@@ -102,8 +94,10 @@ private:
QLabel
*
mpScheduleLabel
;
// License
UBTBPreviewSeparator
mLicenseSeparator
;
QLabel
*
mpLicenseLabel
;
UBTBSeparator
mLicenseSeparator
;
// TODO : replace the QLabel of the license by a widget done for that!
UBTBLicenseWidget
*
mpLicenseLabel
;
/** Pointer to the datas */
UBTeacherBarDataMgr
*
mpDataMgr
;
...
...
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