|
52 | 52 | #include "client/ui/sys_info/sys_info_widget_video_adapters.h" |
53 | 53 | #include "client/ui/sys_info/tree_to_html.h" |
54 | 54 | #include "common/system_info_constants.h" |
| 55 | +#include "common/ui/session_type.h" |
55 | 56 | #include "ui_system_info_window.h" |
56 | 57 |
|
57 | 58 | namespace { |
@@ -295,6 +296,21 @@ SystemInfoWindow::SystemInfoWindow(QWidget* parent) |
295 | 296 | layout_ = new QHBoxLayout(ui->widget); |
296 | 297 | layout_->setContentsMargins(0, 0, 0, 0); |
297 | 298 | layout_->addWidget(sys_info_widgets_[current_widget_]); |
| 299 | + |
| 300 | + auto make_action = [this](proto::peer::SessionType type) |
| 301 | + { |
| 302 | + QAction* action = new QAction(sessionIcon(type), sessionName(type), this); |
| 303 | + connect(action, &QAction::triggered, this, [this, type]() |
| 304 | + { |
| 305 | + const ComputerConfig& computer = sessionState()->computer(); |
| 306 | + emit sig_connectRequested(computer.id, computer, type); |
| 307 | + }); |
| 308 | + return action; |
| 309 | + }; |
| 310 | + |
| 311 | + action_desktop_ = make_action(proto::peer::SESSION_TYPE_DESKTOP); |
| 312 | + action_file_transfer_ = make_action(proto::peer::SESSION_TYPE_FILE_TRANSFER); |
| 313 | + action_text_chat_ = make_action(proto::peer::SESSION_TYPE_TEXT_CHAT); |
298 | 314 | } |
299 | 315 |
|
300 | 316 | //-------------------------------------------------------------------------------------------------- |
@@ -332,7 +348,8 @@ QList<QPair<Tab::ActionRole, QList<QAction*>>> SystemInfoWindow::tabActionGroups |
332 | 348 | { |
333 | 349 | return { |
334 | 350 | { Tab::ActionRole::FILE, { ui->action_save, ui->action_print } }, |
335 | | - { Tab::ActionRole::VIEW, { ui->action_refresh } } |
| 351 | + { Tab::ActionRole::VIEW, { ui->action_refresh } }, |
| 352 | + { Tab::ActionRole::ACTION, { action_desktop_, action_file_transfer_, action_text_chat_ } } |
336 | 353 | }; |
337 | 354 | } |
338 | 355 |
|
|
0 commit comments