diff options
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; }; |