summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohann Latocha2010-11-30 23:19:33 +0100
committerJohann Latocha2010-11-30 23:19:33 +0100
commit7dd7a3b81df6cc66e1c67f24f3606ad007942502 (patch)
treedd92a672cafe75be7592e8e709150eeea3568bec
parent[PVSMGRTOUCH] ProfileDialog close bug fixed (diff)
downloadpvs-7dd7a3b81df6cc66e1c67f24f3606ad007942502.tar.gz
pvs-7dd7a3b81df6cc66e1c67f24f3606ad007942502.tar.xz
pvs-7dd7a3b81df6cc66e1c67f24f3606ad007942502.zip
[PVSMGR] Selected clients become highlighted
-rw-r--r--icons/online.pngbin1620 -> 719 bytes
-rw-r--r--icons/source.pngbin1789 -> 922 bytes
-rw-r--r--icons/target.pngbin1791 -> 911 bytes
-rw-r--r--src/gui/connectionFrame.cpp28
-rw-r--r--src/gui/connectionFrame.h5
-rw-r--r--src/gui/frame.cpp8
6 files changed, 26 insertions, 15 deletions
diff --git a/icons/online.png b/icons/online.png
index e2a0018..5204729 100644
--- a/icons/online.png
+++ b/icons/online.png
Binary files differ
diff --git a/icons/source.png b/icons/source.png
index dc11ad7..e4a22bb 100644
--- a/icons/source.png
+++ b/icons/source.png
Binary files differ
diff --git a/icons/target.png b/icons/target.png
index faeeb61..c9e9407 100644
--- a/icons/target.png
+++ b/icons/target.png
Binary files differ
diff --git a/src/gui/connectionFrame.cpp b/src/gui/connectionFrame.cpp
index e889991..bedd29b 100644
--- a/src/gui/connectionFrame.cpp
+++ b/src/gui/connectionFrame.cpp
@@ -51,11 +51,11 @@ ConnectionFrame::ConnectionFrame(QWidget *parent) :
_hLayoutInCfTaskbar = new QHBoxLayout();
- _username = new QLabel(_conFrameTaskbar);
- _username->setStyleSheet(QString::fromUtf8("background-color: rgb(150, 150, 168);"));
- _username->setAlignment(Qt::AlignLeft);
+ _ip = new QLabel(_conFrameTaskbar);
+ _ip->setStyleSheet(QString::fromUtf8("background-color: rgb(150, 150, 168);"));
+ _ip->setAlignment(Qt::AlignCenter);
- _hLayoutInCfTaskbar->addWidget(_username);
+ _hLayoutInCfTaskbar->addWidget(_ip);
_dozentContaimner = new QLabel(_conFrameTaskbar);
_dozentContaimner->setStyleSheet(QString::fromUtf8("background-color: rgb(150, 150, 168);"));
@@ -141,6 +141,7 @@ ConnectionFrame::ConnectionFrame(QWidget *parent) :
menu->addAction(uproject);
//menu->addAction(rHelp);
+ this->setStyleSheet(STYLE_DEFAULT);
this->show();
}
@@ -162,15 +163,15 @@ void ConnectionFrame::setTheTitle(QString title) // set frame title
QString ConnectionFrame::getTaskbarTitle() // get taskbar title
{
- if (!_username->text().isNull())
- return _username->text();
+ if (!_ip->text().isNull())
+ return _ip->text();
else
return _myConnection->getIp();
}
void ConnectionFrame::setTaskbarTitle(QString title) // set taskbar title
{
- _username->setText(title);
+ _ip->setText(title);
_frame->ip = title;
}
@@ -193,7 +194,8 @@ void ConnectionFrame::Resize(int w, int h)
void ConnectionFrame::initFrame()
{
- _clientStatus = QPixmap(":/offline");
+ _clientStatus = QPixmap(":/online");
+ _status->setDisabled(true);
_clientDozent = QPixmap(":/dozent2");
_dozentContaimner->setPixmap(_clientDozent.scaled(3*_dozentContaimner->size()/4,
Qt::KeepAspectRatio, Qt::SmoothTransformation));
@@ -372,7 +374,8 @@ void ConnectionFrame::setDummy(bool dummy)
{
_clientStatus = QPixmap(0, 0); //ein leeres Pixmap erstellen
_clientStatus.fill(Qt::white); // benöigt bevor man drin zeichen
- _clientStatus = QPixmap(":/offline");
+ _clientStatus = QPixmap(":/online");
+ _status->setDisabled(true);
_status->setMaximumSize(QSize(30, 30));
_status->setPixmap(_clientStatus.scaled(29,27,
Qt::KeepAspectRatio, Qt::SmoothTransformation));
@@ -385,6 +388,7 @@ void ConnectionFrame::setDummy(bool dummy)
_clientStatus = QPixmap(0, 0); //ein leeres Pixmap erstellen
_clientStatus.fill(Qt::white); // benöigt bevor man drin zeichen
_clientStatus = QPixmap(":/online");
+ _status->setDisabled(false);
_status->setMaximumSize(QSize(30, 30));
_status->setPixmap(_clientStatus.scaled(29,27,
Qt::KeepAspectRatio, Qt::SmoothTransformation));
@@ -490,11 +494,11 @@ void ConnectionFrame::paintCloseUp(int w, int h)
void ConnectionFrame::resizeComponent(int w, int h)
{
int th = (h*_conFrameTaskbar->width())/w;
- int uh = (h*_username->width())/w;
+ int uh = (h*_ip->width())/w;
_conFrameTaskbar->setMaximumSize(w, th);
_conFrameTaskbar->resize(w, th);
- _username->setMaximumSize(w, uh);
- _username->resize(w,uh);
+ _ip->setMaximumSize(w, uh);
+ _ip->resize(w,uh);
}
void ConnectionFrame::setSource()
diff --git a/src/gui/connectionFrame.h b/src/gui/connectionFrame.h
index a199102..9e8bd7e 100644
--- a/src/gui/connectionFrame.h
+++ b/src/gui/connectionFrame.h
@@ -16,6 +16,9 @@ extern "C"
}
#define PROFILE
+#define STYLE_DEFAULT "QGroupBox{margin: 2px; border: 1px solid black; border-radius: 8px; padding: 2px; padding-top: 1.5em;}"
+#define STYLE_SELECTED "QGroupBox{margin: 2px; border: 1px solid red; border-radius: 8px; padding: 2px; padding-top: 1.5em;}"
+
#include <src/util/timeUtil.h>
/**
@@ -154,7 +157,7 @@ private:
//clickableLabel *frame;
QSplitter *_split;
QGridLayout* _gL;
- QLabel* _username;
+ QLabel* _ip;
QLabel* _status;
QLabel* _dozentContaimner;
QWidget* _conFrameTaskbar;
diff --git a/src/gui/frame.cpp b/src/gui/frame.cpp
index 561f3ce..aa6b0cb 100644
--- a/src/gui/frame.cpp
+++ b/src/gui/frame.cpp
@@ -224,8 +224,6 @@ void Frame::paintEvent(QPaintEvent *event)
void Frame::slotClicked()
{
- //qDebug() << "clickableLabel :: Clicked, searching for" << ip;
-
if (ip != "") {
for (int i=0; i<MainWindow::getConnectionList()->model->rowCount(QModelIndex()); i++)
{
@@ -234,6 +232,12 @@ void Frame::slotClicked()
{
MainWindow::getConnectionList()->selectRow(i);
MainWindow::getConnectionList()->setCurrentIndex(MainWindow::getConnectionList()->currentIndex());
+
+ // red border for selected client
+ QList<ConnectionFrame*> clients = MainWindow::getConnectionWindow()->getAllFrameOnWindow();
+ foreach (ConnectionFrame *client, clients)
+ client->setStyleSheet(STYLE_DEFAULT);
+ _cFrame->setStyleSheet(STYLE_SELECTED);
break;
}
}