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

Method updateOptions

src/plugins/core/session/sessiondialog.cpp:152–171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

150}
151
152void SessionDialog::updateOptions(const QStringList &sessions)
153{
154 if (sessions.isEmpty()) {
155 openBtn->setEnabled(false);
156 renameBtn->setEnabled(false);
157 cloneBtn->setEnabled(false);
158 removeBtn->setEnabled(false);
159 return;
160 }
161
162 bool defaultIsSelected = sessions.contains("default");
163 bool activeIsSelected = std::any_of(sessions.cbegin(), sessions.cend(),
164 [](const QString &session) {
165 return session == SessionManager::instance()->currentSession();
166 });
167 openBtn->setEnabled(sessions.size() == 1);
168 renameBtn->setEnabled(sessions.size() == 1 && !defaultIsSelected);
169 cloneBtn->setEnabled(sessions.size() == 1);
170 removeBtn->setEnabled(!defaultIsSelected && !activeIsSelected);
171}
172
173SessionNameInputDialog::SessionNameInputDialog(QWidget *parent)
174 : DDialog(parent)

Callers

nothing calls this directly

Calls 7

cbeginMethod · 0.80
cendMethod · 0.80
isEmptyMethod · 0.45
setEnabledMethod · 0.45
containsMethod · 0.45
currentSessionMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected