diff options
author | Gluzskiy Alexandr <sss@sss.chaoslab.ru> | 2013-02-16 18:26:39 +0200 |
---|---|---|
committer | Gluzskiy Alexandr <sss@sss.chaoslab.ru> | 2013-02-16 18:26:39 +0200 |
commit | bb24a98491fbc656db26d9b12b2ed4c26f531334 (patch) | |
tree | 89abde047b0dba87b1cf7805983f61a159f09e15 /client/mainwindow.cpp | |
parent | 8350c401327c8f3766acf7ee9615442ea3211640 (diff) |
command reply handling
basic positioning
Diffstat (limited to 'client/mainwindow.cpp')
-rw-r--r-- | client/mainwindow.cpp | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/client/mainwindow.cpp b/client/mainwindow.cpp index d7070a6..04cd930 100644 --- a/client/mainwindow.cpp +++ b/client/mainwindow.cpp @@ -121,7 +121,7 @@ void MainWindow::handle_data() { service_ui *u = new service_ui; u->group = new QGroupBox(i->service.c_str(), this); - u->group->resize(this->size().width() - 10, 25); + u->group->resize(this->size().width() - 10, 50); u->layout = new QHBoxLayout(u->group); for(std::list<service_s::cmd>::iterator ii = i->cmds.begin(), eend = i->cmds.end(); ii != eend; ++ii) { @@ -129,10 +129,11 @@ void MainWindow::handle_data() connect(u->commands.back(), SIGNAL(clicked()), SLOT(handle_button_click())); u->commands.back()->setToolTip(QString::fromUtf8(ii->description.c_str())); u->layout->addWidget(u->commands.back()); - //u->commands.back()->show(); + u->commands.back()->show(); svc_ui_list.push_back(u); } u->group->setLayout(u->layout); + u->layout->activate(); u->group->show(); } } @@ -150,6 +151,21 @@ void MainWindow::handle_data() } break; + case TYPE_COMMAND: + { + std::string ret = packet::cli_parse_command_reply(p); + QMessageBox msg; + if(!ret.empty()) + msg.setText(QString::fromUtf8(ret.c_str())); + else + msg.setText(tr("no text in command reply")); + if(p.get_status() == STATUS_SUCCESS) + msg.setIcon(QMessageBox::Information); + else + msg.setIcon(QMessageBox::Critical); + msg.exec(); + } + break; default: break; }; |