Commit c1c20d43 authored by Wolthera van Hövell's avatar Wolthera van Hövell 🛍

Add 'Discard All' button to the autosave dialogue.

I was getting a little tired of the big stack of autosaved files everytime I
started Krita... This button allows you to discard all of them at once.
parent 6913f48f
......@@ -181,6 +181,8 @@ KisAutoSaveRecoveryDialog::KisAutoSaveRecoveryDialog(const QStringList &filename
KoDialog(parent)
{
setCaption(i18nc("@title:window", "Recover Files"));
setButtons( KoDialog::Ok | KoDialog::Cancel | KoDialog::User1 );
setButtonText(KoDialog::User1, i18n("Discard All"));
setMinimumSize(650, 500);
QWidget *page = new QWidget(this);
QVBoxLayout *layout = new QVBoxLayout(page);
......@@ -234,8 +236,18 @@ KisAutoSaveRecoveryDialog::KisAutoSaveRecoveryDialog(const QStringList &filename
layout->addWidget(m_listView);
layout->addWidget(new QLabel(i18n("If you select Cancel, all recoverable files will be kept.\nIf you press OK, selected files will be recovered, the unselected files discarded.")));
setMainWidget(page);
setAttribute(Qt::WA_DeleteOnClose, true);
connect( this, SIGNAL( user1Clicked() ), this, SLOT( slotDeleteAll() ) );
}
void KisAutoSaveRecoveryDialog::slotDeleteAll()
{
foreach(FileItem* fileItem, m_model->m_fileItems) {
fileItem->checked = false;
}
accept();
}
QStringList KisAutoSaveRecoveryDialog::recoverableFiles()
{
......
......@@ -38,6 +38,7 @@ public:
public Q_SLOTS:
void toggleFileItem(bool toggle);
void slotDeleteAll();
private:
......
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