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
13 years ago
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()
...
@@ -243,9 +243,7 @@ UBTeacherBarWidget::~UBTeacherBarWidget()
void
UBTeacherBarWidget
::
onValueChanged
()
void
UBTeacherBarWidget
::
onValueChanged
()
{
{
if
(
mpTitle
->
text
()
==
""
if
(
mpTitle
->
text
()
==
""
)
&&
mpAction1
->
teacherText
()
==
""
&&
mpAction1
->
studentText
()
==
""
)
{
{
mIconToLeft
=
QPixmap
(
":images/teacher_open_disabled.png"
);
mIconToLeft
=
QPixmap
(
":images/teacher_open_disabled.png"
);
mIconToRight
=
QPixmap
(
":images/teacher_close_disabled.png"
);
mIconToRight
=
QPixmap
(
":images/teacher_close_disabled.png"
);
...
@@ -279,7 +277,9 @@ void UBTeacherBarWidget::onTitleTextChanged(const QString& text)
...
@@ -279,7 +277,9 @@ void UBTeacherBarWidget::onTitleTextChanged(const QString& text)
void
UBTeacherBarWidget
::
onActionButton
()
void
UBTeacherBarWidget
::
onActionButton
()
{
{
UBTeacherStudentAction
*
pAction
=
new
UBTeacherStudentAction
(
this
);
mActionList
<<
pAction
;
mpActions
->
addWidget
(
pAction
);
}
}
void
UBTeacherBarWidget
::
onLinkButton
()
void
UBTeacherBarWidget
::
onLinkButton
()
...
@@ -287,126 +287,74 @@ void UBTeacherBarWidget::onLinkButton()
...
@@ -287,126 +287,74 @@ void UBTeacherBarWidget::onLinkButton()
}
}
UBTeacherStudentAction
::
UBTeacherStudentAction
(
int
actionNumber
,
QWidget
*
parent
,
const
char
*
name
)
:
QWidget
(
parent
)
UBTeacherStudentAction
::
UBTeacherStudentAction
(
QWidget
*
parent
,
const
char
*
name
)
:
QWidget
(
parent
)
,
mpActionLabel
(
NULL
)
,
mpText
(
NULL
)
,
mpTeacherLabel
(
NULL
)
,
mpLayout
(
NULL
)
,
mpStudentLabel
(
NULL
)
,
mpComboLayout
(
NULL
)
,
mpTeacher
(
NULL
)
,
mpCombo
(
NULL
)
,
mpStudent
(
NULL
)
,
mpLayout
(
NULL
)
,
mpTeacherLayout
(
NULL
)
,
mpStudentLayout
(
NULL
)
{
{
setObjectName
(
name
);
setObjectName
(
name
);
mActionNumber
=
actionNumber
;
setAttribute
(
Qt
::
WA_StyledBackground
,
true
);
setAttribute
(
Qt
::
WA_StyledBackground
,
true
);
setStyleSheet
(
UBApplication
::
globalStyleSheet
());
setStyleSheet
(
UBApplication
::
globalStyleSheet
());
// Create the GUI
// Create the GUI
mpLayout
=
new
Q
V
BoxLayout
(
this
);
mpLayout
=
new
Q
H
BoxLayout
(
this
);
setLayout
(
mpLayout
);
setLayout
(
mpLayout
);
mpActionLabel
=
new
QLabel
(
tr
(
"Action %0"
).
arg
(
mActionNumber
),
this
);
mpComboLayout
=
new
QVBoxLayout
();
mpLayout
->
addWidget
(
mpActionLabel
,
0
);
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
()
UBTeacherStudentAction
::~
UBTeacherStudentAction
()
{
{
if
(
NULL
!=
mpActionLabel
)
if
(
NULL
!=
mpCombo
){
{
delete
mpCombo
;
delete
mpActionLabel
;
mpCombo
=
NULL
;
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
!=
mpStudent
)
if
(
NULL
!=
mpText
){
{
delete
mpText
;
delete
mpStudent
;
mpText
=
NULL
;
mpStudent
=
NULL
;
}
}
if
(
NULL
!=
mpStudentLayout
)
if
(
NULL
!=
mpComboLayout
){
{
delete
mpComboLayout
;
delete
mpStudentLayout
;
mpComboLayout
=
NULL
;
mpStudentLayout
=
NULL
;
}
}
if
(
NULL
!=
mpLayout
)
if
(
NULL
!=
mpLayout
){
{
delete
mpLayout
;
delete
mpLayout
;
mpLayout
=
NULL
;
mpLayout
=
NULL
;
}
}
}
}
QString
UBTeacherStudentAction
::
te
acherTe
xt
()
QString
UBTeacherStudentAction
::
text
()
{
{
return
mpTeacher
->
document
()
->
toPlainText
();
QString
str
;
}
if
(
NULL
!=
mpText
){
str
=
mpText
->
document
()
->
toPlainText
();
QString
UBTeacherStudentAction
::
studentText
()
}
{
return
str
;
return
mpStudent
->
document
()
->
toPlainText
();
}
void
UBTeacherStudentAction
::
setTeacherText
(
QString
text
)
{
mpTeacher
->
setText
(
text
);
}
}
void
UBTeacherStudentAction
::
setStudentText
(
QString
text
)
QString
UBTeacherStudentAction
::
comboValue
(
)
{
{
mpStudent
->
setText
(
text
);
QString
str
;
}
QTextEdit
*
UBTeacherStudentAction
::
teacher
()
// TODO : Implement this method
{
return
mpTeacher
;
}
QTextEdit
*
UBTeacherStudentAction
::
student
()
return
str
;
{
return
mpStudent
;
}
}
UBTeacherBarDropMediaZone
::
UBTeacherBarDropMediaZone
(
QWidget
*
parent
,
const
char
*
name
)
:
QWidget
(
parent
)
UBTeacherBarDropMediaZone
::
UBTeacherBarDropMediaZone
(
QWidget
*
parent
,
const
char
*
name
)
:
QWidget
(
parent
)
{
{
...
...
This diff is collapsed.
Click to expand it.
src/gui/UBTeacherBarWidget.h
View file @
9b470227
...
@@ -13,7 +13,7 @@ class UBMediaPlayer;
...
@@ -13,7 +13,7 @@ class UBMediaPlayer;
#include <QTabWidget>
#include <QTabWidget>
#include <QButtonGroup>
#include <QButtonGroup>
#include <QPushButton>
#include <QPushButton>
#include
"customWidgets/UBWidgetList.h"
#include
<QComboBox>
#include "UBDockPaletteWidget.h"
#include "UBDockPaletteWidget.h"
#include "customWidgets/UBWidgetList.h"
#include "customWidgets/UBWidgetList.h"
...
@@ -25,25 +25,16 @@ class UBTeacherStudentAction : public QWidget
...
@@ -25,25 +25,16 @@ class UBTeacherStudentAction : public QWidget
Q_OBJECT
Q_OBJECT
public
:
public
:
UBTeacherStudentAction
(
int
actionNumber
,
QWidget
*
parent
=
0
,
const
char
*
name
=
"UBTeacherStudentAction"
);
UBTeacherStudentAction
(
QWidget
*
parent
=
0
,
const
char
*
name
=
"UBTeacherStudentAction"
);
~
UBTeacherStudentAction
();
~
UBTeacherStudentAction
();
QString
teacherText
();
QString
comboValue
();
QString
studentText
();
QString
text
();
void
setTeacherText
(
QString
text
);
void
setStudentText
(
QString
text
);
QTextEdit
*
teacher
();
QTextEdit
*
student
();
private
:
private
:
int
mActionNumber
;
QTextEdit
*
mpText
;
QLabel
*
mpActionLabel
;
QHBoxLayout
*
mpLayout
;
QLabel
*
mpTeacherLabel
;
QVBoxLayout
*
mpComboLayout
;
QLabel
*
mpStudentLabel
;
QComboBox
*
mpCombo
;
QTextEdit
*
mpTeacher
;
QTextEdit
*
mpStudent
;
QVBoxLayout
*
mpLayout
;
QHBoxLayout
*
mpTeacherLayout
;
QHBoxLayout
*
mpStudentLayout
;
};
};
...
@@ -109,6 +100,8 @@ private:
...
@@ -109,6 +100,8 @@ private:
QHBoxLayout
*
mpLinkLayout
;
QHBoxLayout
*
mpLinkLayout
;
QLabel
*
mpCommentLabel
;
QLabel
*
mpCommentLabel
;
QTextEdit
*
mpComments
;
QTextEdit
*
mpComments
;
QVector
<
UBTeacherStudentAction
*>
mActionList
;
};
};
#endif // UBTEACHERBARWIDGET_H
#endif // UBTEACHERBARWIDGET_H
This diff is collapsed.
Click to expand it.
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