From 7dd7a3b81df6cc66e1c67f24f3606ad007942502 Mon Sep 17 00:00:00 2001 From: Johann Latocha Date: Tue, 30 Nov 2010 23:19:33 +0100 Subject: [PVSMGR] Selected clients become highlighted --- icons/online.png | Bin 1620 -> 719 bytes icons/source.png | Bin 1789 -> 922 bytes icons/target.png | Bin 1791 -> 911 bytes src/gui/connectionFrame.cpp | 28 ++++++++++++++++------------ src/gui/connectionFrame.h | 5 ++++- src/gui/frame.cpp | 8 ++++++-- 6 files changed, 26 insertions(+), 15 deletions(-) diff --git a/icons/online.png b/icons/online.png index e2a0018..5204729 100644 Binary files a/icons/online.png and b/icons/online.png differ diff --git a/icons/source.png b/icons/source.png index dc11ad7..e4a22bb 100644 Binary files a/icons/source.png and b/icons/source.png differ diff --git a/icons/target.png b/icons/target.png index faeeb61..c9e9407 100644 Binary files a/icons/target.png and b/icons/target.png 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 /** @@ -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; imodel->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 clients = MainWindow::getConnectionWindow()->getAllFrameOnWindow(); + foreach (ConnectionFrame *client, clients) + client->setStyleSheet(STYLE_DEFAULT); + _cFrame->setStyleSheet(STYLE_SELECTED); break; } } -- cgit v1.2.3-55-g7522