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
e114d8ad
Commit
e114d8ad
authored
Jan 06, 2012
by
shibakaneki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added the action preview in the teacher bar
parent
c7c931b9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
80 additions
and
3 deletions
+80
-3
UBTeacherBarWidget.cpp
src/gui/UBTeacherBarWidget.cpp
+58
-3
UBTeacherBarWidget.h
src/gui/UBTeacherBarWidget.h
+22
-0
No files found.
src/gui/UBTeacherBarWidget.cpp
View file @
e114d8ad
...
...
@@ -881,9 +881,10 @@ void UBTeacherBarPreviewWidget::setActions(QStringList actions)
if
(
2
<=
desc
.
size
()){
QString
owner
=
desc
.
at
(
0
);
QString
act
=
desc
.
at
(
1
);
// TODO : Create the action widget here and add it to mWidgets
mpTmpAction
=
new
UBActionPreview
(
this
);
mpTmpAction
->
setOwner
(
owner
);
mpTmpAction
->
setContent
(
act
);
mWidgets
<<
mpTmpAction
;
}
}
mMediaViewer
.
loadWidgets
(
mWidgets
);
...
...
@@ -967,3 +968,57 @@ void UBTeacherBarPreviewMedia::loadMedia(QStringList pMedias)
}
}
}
// -----------------------------------------------------------------------------------------------
UBActionPreview
::
UBActionPreview
(
QWidget
*
parent
,
const
char
*
name
)
:
QWidget
(
parent
)
,
mpOwner
(
NULL
)
,
mpContent
(
NULL
)
{
setObjectName
(
name
);
setLayout
(
&
mLayout
);
mpOwner
=
new
QLabel
(
this
);
mpOwner
->
setObjectName
(
"UBActionPreviewOwner"
);
mOwnerLayout
.
addWidget
(
mpOwner
,
0
);
mOwnerLayout
.
addStretch
(
1
);
mLayout
.
addLayout
(
&
mOwnerLayout
);
mpContent
=
new
QLabel
(
this
);
mpContent
->
setObjectName
(
"UBActionPreviewContent"
);
mpContent
->
setWordWrap
(
true
);
mLayout
.
addWidget
(
mpContent
);
}
UBActionPreview
::~
UBActionPreview
()
{
if
(
NULL
!=
mpOwner
){
delete
mpOwner
;
mpOwner
=
NULL
;
}
if
(
NULL
!=
mpContent
){
delete
mpContent
;
mpContent
=
NULL
;
}
}
void
UBActionPreview
::
setOwner
(
const
QString
&
owner
)
{
if
(
NULL
!=
mpOwner
&&
NULL
!=
mpContent
){
switch
(
owner
.
toInt
()){
case
eActionOwner_Teacher
:
mpOwner
->
setText
(
tr
(
"Teacher"
));
mpContent
->
setStyleSheet
(
"background:lightblue;"
);
break
;
case
eActionOwner_Student
:
mpOwner
->
setText
(
tr
(
"Student"
));
mpContent
->
setStyleSheet
(
"background:lightgreen;"
);
break
;
}
}
}
void
UBActionPreview
::
setContent
(
const
QString
&
content
)
{
if
(
NULL
!=
mpContent
){
mpContent
->
setText
(
content
);
}
}
src/gui/UBTeacherBarWidget.h
View file @
e114d8ad
...
...
@@ -27,6 +27,11 @@ typedef enum{
eDuration_ThreeQuarter
}
eDuration
;
typedef
enum
{
eActionOwner_Teacher
,
eActionOwner_Student
}
eActionOwner
;
class
UBTeacherStudentAction
:
public
QWidget
{
Q_OBJECT
...
...
@@ -107,6 +112,22 @@ private:
QLineEdit
*
mpUrl
;
};
class
UBActionPreview
:
public
QWidget
{
public
:
UBActionPreview
(
QWidget
*
parent
=
0
,
const
char
*
name
=
"UBActionPreview"
);
~
UBActionPreview
();
void
setOwner
(
const
QString
&
owner
);
void
setContent
(
const
QString
&
content
);
private
:
QLabel
*
mpOwner
;
QLabel
*
mpContent
;
QVBoxLayout
mLayout
;
QHBoxLayout
mOwnerLayout
;
};
class
UBTeacherBarPreviewWidget
:
public
QWidget
{
Q_OBJECT
...
...
@@ -145,6 +166,7 @@ private:
QLabel
*
mpComments
;
QLabel
*
mpLinksLabel
;
QLabel
*
mpTmpLink
;
UBActionPreview
*
mpTmpAction
;
};
class
UBTeacherBarWidget
:
public
UBDockPaletteWidget
...
...
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