forked from qt-creator/qt-creator
ProjectExplorer: Let users delete several sessions at once
Task-number: QTCREATORBUG-17668 Change-Id: I90dea6721ef8e7c1496f3a2c934f74edb62bbc96 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -792,11 +792,15 @@ bool SessionManager::renameSession(const QString &original, const QString &newNa
|
||||
/*!
|
||||
\brief Shows a dialog asking the user to confirm deleting the session \p session
|
||||
*/
|
||||
bool SessionManager::confirmSessionDelete(const QString &session)
|
||||
bool SessionManager::confirmSessionDelete(const QStringList &sessions)
|
||||
{
|
||||
const QString title = sessions.size() == 1 ? tr("Delete Session") : tr("Delete Sessions");
|
||||
const QString question = sessions.size() == 1
|
||||
? tr("Delete session %1?").arg(sessions.first())
|
||||
: tr("Delete these sessions?\n %1").arg(sessions.join("\n "));
|
||||
return QMessageBox::question(ICore::mainWindow(),
|
||||
tr("Delete Session"),
|
||||
tr("Delete session %1?").arg(session),
|
||||
title,
|
||||
question,
|
||||
QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes;
|
||||
}
|
||||
|
||||
@@ -814,6 +818,12 @@ bool SessionManager::deleteSession(const QString &session)
|
||||
return false;
|
||||
}
|
||||
|
||||
void SessionManager::deleteSessions(const QStringList &sessions)
|
||||
{
|
||||
for (const QString &session : sessions)
|
||||
deleteSession(session);
|
||||
}
|
||||
|
||||
bool SessionManager::cloneSession(const QString &original, const QString &clone)
|
||||
{
|
||||
if (!d->m_sessions.contains(original))
|
||||
|
||||
Reference in New Issue
Block a user