MCPcopy Create free account
hub / github.com/Codeya-IDE/deepin-ide / initButton

Method initButton

src/plugins/debugger/interface/attachinfodialog.cpp:65–98  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63}
64
65void AttachInfoDialog::initButton()
66{
67 auto buttonBox = new DWidget(this);
68 auto buttonLayout = new QHBoxLayout(buttonBox);
69
70 DPushButton *btnUpdate = new DPushButton(tr("Update"), this);
71 DPushButton *btnCancel = new DPushButton(tr("Cancel"), this);
72 DPushButton *btnAttaching = new DPushButton(tr("Attaching"), this);
73 btnAttaching->setEnabled(false);
74
75 buttonLayout->addWidget(btnUpdate);
76 buttonLayout->addWidget(btnCancel);
77 buttonLayout->addWidget(btnAttaching);
78
79 connect(view->selectionModel(), &QItemSelectionModel::selectionChanged, this, [=](){
80 if (view->selectionModel()->hasSelection())
81 btnAttaching->setEnabled(true);
82 else
83 btnAttaching->setEnabled(false);
84 });
85 connect(btnUpdate, &DPushButton::clicked, this, [=](){
86 updateProcess();
87 });
88 connect(btnCancel, &DPushButton::clicked, this, [=](){
89 reject();
90 });
91 connect(btnAttaching, &DPushButton::clicked, this, [=](){
92 auto selectedItem = view->selectionModel()->selectedRows(0).at(0);
93 emit attachToProcessId(selectedItem.data().toString());
94 accept();
95 });
96
97 addContent(buttonBox);
98}
99
100void AttachInfoDialog::updateProcess()
101{

Callers

nothing calls this directly

Calls 6

connectFunction · 0.85
atMethod · 0.80
setEnabledMethod · 0.45
addWidgetMethod · 0.45
toStringMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected