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
9b470227
Commit
9b470227
authored
Jan 05, 2012
by
shibakaneki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added the actions
parent
89e16fde
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
111 deletions
+52
-111
UBTeacherBarWidget.cpp
src/gui/UBTeacherBarWidget.cpp
+42
-94
UBTeacherBarWidget.h
src/gui/UBTeacherBarWidget.h
+10
-17
No files found.
src/gui/UBTeacherBarWidget.cpp
View file @
9b470227
...
...
@@ -243,9 +243,7 @@ UBTeacherBarWidget::~UBTeacherBarWidget()
void
UBTeacherBarWidget
::
onValueChanged
()
{
if
(
mpTitle
->
text
()
==
""
&&
mpAction1
->
teacherText
()
==
""
&&
mpAction1
->
studentText
()
==
""
)
if
(
mpTitle
->
text
()
==
""
)
{
mIconToLeft
=
QPixmap
(
":images/teacher_open_disabled.png"
);
mIconToRight
=
QPixmap
(
":images/teacher_close_disabled.png"
);
...
...
@@ -279,7 +277,9 @@ void UBTeacherBarWidget::onTitleTextChanged(const QString& text)
void
UBTeacherBarWidget
::
onActionButton
()
{
UBTeacherStudentAction
*
pAction
=
new
UBTeacherStudentAction
(
this
);
mActionList
<<
pAction
;
mpActions
->
addWidget
(
pAction
);
}
void
UBTeacherBarWidget
::
onLinkButton
()
...
...
@@ -287,126 +287,74 @@ void UBTeacherBarWidget::onLinkButton()
}
UBTeacherStudentAction
::
UBTeacherStudentAction
(
int
actionNumber
,
QWidget
*
parent
,
const
char
*
name
)
:
QWidget
(
parent
)
,
mpActionLabel
(
NULL
)
,
mpTeacherLabel
(
NULL
)
,
mpStudentLabel
(
NULL
)
,
mpTeacher
(
NULL
)
,
mpStudent
(
NULL
)
,
mpLayout
(
NULL
)
,
mpTeacherLayout
(
NULL
)
,
mpStudentLayout
(
NULL
)
UBTeacherStudentAction
::
UBTeacherStudentAction
(
QWidget
*
parent
,
const
char
*
name
)
:
QWidget
(
parent
)
,
mpText
(
NULL
)
,
mpLayout
(
NULL
)
,
mpComboLayout
(
NULL
)
,
mpCombo
(
NULL
)
{
setObjectName
(
name
);
mActionNumber
=
actionNumber
;
setAttribute
(
Qt
::
WA_StyledBackground
,
true
);
setStyleSheet
(
UBApplication
::
globalStyleSheet
());
// Create the GUI
mpLayout
=
new
Q
V
BoxLayout
(
this
);
mpLayout
=
new
Q
H
BoxLayout
(
this
);
setLayout
(
mpLayout
);
mpActionLabel
=
new
QLabel
(
tr
(
"Action %0"
).
arg
(
mActionNumber
),
this
);
mpLayout
->
addWidget
(
mpActionLabel
,
0
);
mpComboLayout
=
new
QVBoxLayout
();
mpCombo
=
new
QComboBox
(
this
);
mpCombo
->
addItem
(
tr
(
"Teacher"
));
mpCombo
->
addItem
(
tr
(
"Student"
));
mpComboLayout
->
addWidget
(
0
);
mpComboLayout
->
addStretch
(
1
);
mpLayout
->
addLayout
(
mpComboLayout
,
0
);
mpText
=
new
QTextEdit
(
this
);
mpLayout
->
addWidget
(
mpText
,
1
);
mpTeacherLayout
=
new
QHBoxLayout
();
mpTeacherLabel
=
new
QLabel
(
tr
(
"Teacher"
),
this
);
mpTeacherLabel
->
setAlignment
(
Qt
::
AlignTop
);
mpTeacher
=
new
QTextEdit
(
this
);
mpTeacher
->
setObjectName
(
"TeacherStudentBox"
);
mpTeacher
->
setStyleSheet
(
"background-color:#FF9F6D"
);
mpTeacherLayout
->
addWidget
(
mpTeacherLabel
,
0
);
mpTeacherLayout
->
addWidget
(
mpTeacher
,
1
);
mpLayout
->
addLayout
(
mpTeacherLayout
,
1
);
mpStudentLayout
=
new
QHBoxLayout
();
mpStudentLabel
=
new
QLabel
(
tr
(
"Student"
),
this
);
mpStudentLabel
->
setAlignment
(
Qt
::
AlignTop
);
mpStudent
=
new
QTextEdit
(
this
);
mpStudent
->
setObjectName
(
"TeacherStudentBox"
);
mpStudent
->
setStyleSheet
(
"background-color:#06E983"
);
mpStudentLayout
->
addWidget
(
mpStudentLabel
,
0
);
mpStudentLayout
->
addWidget
(
mpStudent
,
1
);
mpLayout
->
addLayout
(
mpStudentLayout
,
1
);
}
UBTeacherStudentAction
::~
UBTeacherStudentAction
()
{
if
(
NULL
!=
mpActionLabel
)
{
delete
mpActionLabel
;
mpActionLabel
=
NULL
;
}
if
(
NULL
!=
mpTeacherLabel
)
{
delete
mpTeacherLabel
;
mpTeacherLabel
=
NULL
;
}
if
(
NULL
!=
mpTeacher
)
{
delete
mpTeacher
;
mpTeacher
=
NULL
;
}
if
(
NULL
!=
mpTeacherLayout
)
{
delete
mpTeacherLayout
;
mpTeacherLayout
=
NULL
;
}
if
(
NULL
!=
mpStudentLabel
)
{
delete
mpStudentLabel
;
mpStudentLabel
=
NULL
;
if
(
NULL
!=
mpCombo
){
delete
mpCombo
;
mpCombo
=
NULL
;
}
if
(
NULL
!=
mpStudent
)
{
delete
mpStudent
;
mpStudent
=
NULL
;
if
(
NULL
!=
mpText
){
delete
mpText
;
mpText
=
NULL
;
}
if
(
NULL
!=
mpStudentLayout
)
{
delete
mpStudentLayout
;
mpStudentLayout
=
NULL
;
if
(
NULL
!=
mpComboLayout
){
delete
mpComboLayout
;
mpComboLayout
=
NULL
;
}
if
(
NULL
!=
mpLayout
)
{
if
(
NULL
!=
mpLayout
){
delete
mpLayout
;
mpLayout
=
NULL
;
}
}
QString
UBTeacherStudentAction
::
te
acherTe
xt
()
QString
UBTeacherStudentAction
::
text
()
{
return
mpTeacher
->
document
()
->
toPlainText
();
}
QString
UBTeacherStudentAction
::
studentText
()
{
return
mpStudent
->
document
()
->
toPlainText
();
}
void
UBTeacherStudentAction
::
setTeacherText
(
QString
text
)
{
mpTeacher
->
setText
(
text
);
QString
str
;
if
(
NULL
!=
mpText
){
str
=
mpText
->
document
()
->
toPlainText
();
}
return
str
;
}
void
UBTeacherStudentAction
::
setStudentText
(
QString
text
)
QString
UBTeacherStudentAction
::
comboValue
(
)
{
mpStudent
->
setText
(
text
);
}
QString
str
;
QTextEdit
*
UBTeacherStudentAction
::
teacher
()
{
return
mpTeacher
;
}
// TODO : Implement this method
QTextEdit
*
UBTeacherStudentAction
::
student
()
{
return
mpStudent
;
return
str
;
}
UBTeacherBarDropMediaZone
::
UBTeacherBarDropMediaZone
(
QWidget
*
parent
,
const
char
*
name
)
:
QWidget
(
parent
)
{
...
...
src/gui/UBTeacherBarWidget.h
View file @
9b470227
...
...
@@ -13,7 +13,7 @@ class UBMediaPlayer;
#include <QTabWidget>
#include <QButtonGroup>
#include <QPushButton>
#include
"customWidgets/UBWidgetList.h"
#include
<QComboBox>
#include "UBDockPaletteWidget.h"
#include "customWidgets/UBWidgetList.h"
...
...
@@ -25,25 +25,16 @@ class UBTeacherStudentAction : public QWidget
Q_OBJECT
public
:
UBTeacherStudentAction
(
int
actionNumber
,
QWidget
*
parent
=
0
,
const
char
*
name
=
"UBTeacherStudentAction"
);
UBTeacherStudentAction
(
QWidget
*
parent
=
0
,
const
char
*
name
=
"UBTeacherStudentAction"
);
~
UBTeacherStudentAction
();
QString
teacherText
();
QString
studentText
();
void
setTeacherText
(
QString
text
);
void
setStudentText
(
QString
text
);
QTextEdit
*
teacher
();
QTextEdit
*
student
();
QString
comboValue
();
QString
text
();
private
:
int
mActionNumber
;
QLabel
*
mpActionLabel
;
QLabel
*
mpTeacherLabel
;
QLabel
*
mpStudentLabel
;
QTextEdit
*
mpTeacher
;
QTextEdit
*
mpStudent
;
QVBoxLayout
*
mpLayout
;
QHBoxLayout
*
mpTeacherLayout
;
QHBoxLayout
*
mpStudentLayout
;
QTextEdit
*
mpText
;
QHBoxLayout
*
mpLayout
;
QVBoxLayout
*
mpComboLayout
;
QComboBox
*
mpCombo
;
};
...
...
@@ -109,6 +100,8 @@ private:
QHBoxLayout
*
mpLinkLayout
;
QLabel
*
mpCommentLabel
;
QTextEdit
*
mpComments
;
QVector
<
UBTeacherStudentAction
*>
mActionList
;
};
#endif // UBTEACHERBARWIDGET_H
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