summaryrefslogtreecommitdiffstats
path: root/src/server/connectionframe
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/connectionframe')
-rw-r--r--src/server/connectionframe/connectionframe.cpp18
-rw-r--r--src/server/connectionframe/connectionframe.h5
2 files changed, 14 insertions, 9 deletions
diff --git a/src/server/connectionframe/connectionframe.cpp b/src/server/connectionframe/connectionframe.cpp
index b09139c..dbe408c 100644
--- a/src/server/connectionframe/connectionframe.cpp
+++ b/src/server/connectionframe/connectionframe.cpp
@@ -50,7 +50,7 @@ static QIcon *term = NULL, *cam = NULL, *eye = NULL, *lock = NULL;
* @param height
*/
ConnectionFrame::ConnectionFrame(QWidget *parent, int width, int height) :
- QGroupBox(parent), _client(NULL), _timerId(0), _timerCounter(0), _selected(false), _isTutor(false)
+ QGroupBox(parent), _client(NULL), _timerId(0), _timerCounter(0), _isSelected(false), _isTutor(false)
{
//defines the ui-stuff
@@ -101,7 +101,11 @@ ConnectionFrame::ConnectionFrame(QWidget *parent, int width, int height) :
ConnectionFrame::~ConnectionFrame()
{
- //
+ if (_client != NULL)
+ {
+ _client->deleteLater();
+ }
+ _iconLayout->deleteLater();
}
/**
@@ -295,9 +299,9 @@ void ConnectionFrame::timerEvent(QTimerEvent* event)
*/
void ConnectionFrame::setSelection(bool selected)
{
- if (_selected == selected)
+ if (_isSelected == selected)
return;
- _selected = selected;
+ _isSelected = selected;
this->updateAppearance();
}
@@ -322,7 +326,7 @@ void ConnectionFrame::updateAppearance()
if (_client == NULL)
{
// Unconnected Frame
- if (_selected)
+ if (_isSelected)
this->setStyleSheet(style_selectedStudent);
else
this->setStyleSheet(style_disconnected);
@@ -336,13 +340,13 @@ void ConnectionFrame::updateAppearance()
// Normal client, no special stuff active
- if (_selected && _isTutor){
+ if (_isSelected && _isTutor){
this->setStyleSheet(style_selectedTutor);
}
else if (_isTutor){
this->setStyleSheet(style_tutor);
}
- else if (_selected){
+ else if (_isSelected){
this->setStyleSheet(style_selectedStudent);
}
diff --git a/src/server/connectionframe/connectionframe.h b/src/server/connectionframe/connectionframe.h
index 72f641d..5a4e1df 100644
--- a/src/server/connectionframe/connectionframe.h
+++ b/src/server/connectionframe/connectionframe.h
@@ -32,7 +32,7 @@ private:
Client *_client;
int _timerId, _timerCounter;
- bool _selected;
+ bool _isSelected;
bool _isTutor;
static const int _startDragDistance = 40;
@@ -51,9 +51,10 @@ public:
const QPixmap& getFramePixmap() const { return _remoteScreen; }
void setSize(int width, int height);
+ const inline QPoint& getPreviousPosition() const { return _previousPosition; }
void assignClient(Client *client);
void setSelection(bool selected);
- const inline bool selected() const { return _selected; }
+ const inline bool isSelected() const { return _isSelected; }
const QString& computerId() const { return _computerId; }
Client* client() const { return _client; }