Commit c133947b authored by Marcin Dłubakowski's avatar Marcin Dłubakowski Committed by Aleix Pol Gonzalez
Browse files

Show session name in the Delete Session confirmation dialog

Summary:
Updated the Delete Session confimation to include chosen session name. Revision D13444 has been abandoned so I finished it.
Related: BUG 393138

Reviewers: #kdevelop, apol

Reviewed By: #kdevelop, apol

Subscribers: apol, kdevelop-devel

Tags: #kdevelop

Differential Revision: https://phabricator.kde.org/D22456
parent a06faa19
......@@ -196,8 +196,10 @@ void SessionChooserDialog::deleteButtonPressed()
if(m_deleteCandidateRow == -1)
return;
QModelIndex index = m_model->index(m_deleteCandidateRow, 0);
const QString uuid = m_model->data(index, Qt::DisplayRole).toString();
QModelIndex uuidIndex = m_model->index(m_deleteCandidateRow, 0);
QModelIndex sessionNameIndex = m_model->index(m_deleteCandidateRow, 3);
const QString uuid = m_model->data(uuidIndex, Qt::DisplayRole).toString();
const QString sessionName = m_model->data(sessionNameIndex, Qt::DisplayRole).toString();
TryLockSessionResult result = SessionController::tryLockSession( uuid );
if( !result.lock ) {
......@@ -205,15 +207,15 @@ void SessionChooserDialog::deleteButtonPressed()
QString errText = i18nc("@info", "<p>Cannot delete a locked session.");
if( result.runInfo.holderPid != -1 ) {
errText += i18nc("@info", "<p>The session is locked by %1 on %2 (PID %3).",
result.runInfo.holderApp, result.runInfo.holderHostname, result.runInfo.holderPid);
errText += i18nc("@info", "<p>The session <b>%1</b> is locked by %2 on %3 (PID %4).",
sessionName, result.runInfo.holderApp, result.runInfo.holderHostname, result.runInfo.holderPid);
}
KMessageBox::error( this, errText, errCaption );
return;
}
const QString text = i18nc("@info", "The session and all contained settings will be deleted. The projects will stay unaffected. Do you really want to continue?");
const QString text = i18nc("@info", "The session <b>%1</b> and all contained settings will be deleted. The projects will stay unaffected. Do you really want to continue?", sessionName);
const QString caption = i18nc("@title", "Delete Session");
const KGuiItem deleteItem = KStandardGuiItem::del();
const KGuiItem cancelItem = KStandardGuiItem::cancel();
......
......@@ -599,10 +599,11 @@ QString SessionController::showSessionChooserDialog(const QString& headerText, b
layout.addWidget(heading);
}
model->setColumnCount(3);
model->setColumnCount(4);
model->setHeaderData(0, Qt::Horizontal,i18n("Identity"));
model->setHeaderData(1, Qt::Horizontal, i18n("Contents"));
model->setHeaderData(1, Qt::Horizontal,i18n("Contents"));
model->setHeaderData(2, Qt::Horizontal,i18n("State"));
model->setHeaderData(3, Qt::Horizontal,i18n("Name"));
view->setModel(proxy);
view->setModelColumn(1);
......@@ -628,10 +629,11 @@ QString SessionController::showSessionChooserDialog(const QString& headerText, b
if(onlyRunning && !running)
continue;
model->setItem(row, 0, new QStandardItem(si.uuid.toString()));
model->setItem(row, 1, new QStandardItem(si.description));
model->setItem(row, 2, new QStandardItem);
model->setItem(row, 3, new QStandardItem(si.name));
++row;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment