diff options
Diffstat (limited to 'src/gui/dialog.cpp')
| -rw-r--r-- | src/gui/dialog.cpp | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/src/gui/dialog.cpp b/src/gui/dialog.cpp new file mode 100644 index 0000000..3c9b7a2 --- /dev/null +++ b/src/gui/dialog.cpp @@ -0,0 +1,74 @@ +/* +# Copyright (c) 2009 - OpenSLX Project, Computer Center University of Freiburg +# +# This program is free software distributed under the GPL version 2. +# See http://openslx.org/COPYING +# +# If you have any feedback please consult http://openslx.org/feedback and +# send your suggestions, praise, or complaints to feedback@openslx.org +# +# General information about OpenSLX can be found at http://openslx.org/ +# ----------------------------------------------------------------------------- +# dialog.cpp + Dialog to get message to send to client +# ----------------------------------------------------------------------------- +*/ + +#include "dialog.h" +#include "ui_dialog.h" +#include <src/gui/mainWindow.h> + +Dialog::Dialog(QWidget *parent) : + QDialog(parent), + dui(new Ui::MsgDialog) +{ + dui->setupUi(this); + + dui->send->setDisabled(true); + + setWindowTitle(tr("Enter the Text for the client(s)")); + + connect( dui->send, SIGNAL( clicked()), this, SLOT( send())); + connect( dui->cancel, SIGNAL( clicked()), this, SLOT( NotSend())); + connect(dui->message, SIGNAL(textChanged()), this, SLOT(textchange())); +} + +Dialog::~Dialog() +{ + delete dui; +} + +void Dialog::send() +{ + QString mesge = dui->message->toPlainText(); + MainWindow::getWindow()->setMsgDialog(mesge); + dui->message->clear(); + emit accept(); +} + +void Dialog::NotSend() +{ + dui->message->clear(); + emit reject(); +} + +void Dialog::textchange() +{ + QString message = dui->message->toPlainText(); + if(message.length()>0) + dui->send->setDisabled(false); + else + dui->send->setDisabled(true); +} + +void Dialog::changeEvent(QEvent *e) +{ + QDialog::changeEvent(e); + switch (e->type()) { + case QEvent::LanguageChange: + dui->retranslateUi(this); + break; + default: + break; + } +} |
