1 /***************************************************************************
2 * Copyright (C) 2005-2009 by Rajko Albrecht *
3 * ral@alwins-world.de *
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
19 ***************************************************************************/
20
21 #include "deleteform.h"
22 #include "ui_deleteform.h"
23
DeleteForm(const QStringList & files,QWidget * parent)24 DeleteForm::DeleteForm(const QStringList &files, QWidget *parent)
25 : KSvnDialog(QLatin1String("delete_items_dialog"), parent)
26 , m_ui(new Ui::DeleteForm)
27 {
28 m_ui->setupUi(this);
29 m_ui->m_ItemsList->addItems(files);
30 setDefaultButton(m_ui->buttonBox->button(QDialogButtonBox::Yes));
31 connect(m_ui->buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
32 connect(m_ui->buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
33 }
34
~DeleteForm()35 DeleteForm::~DeleteForm()
36 {
37 delete m_ui;
38 }
39
showExtraButtons(bool show)40 void DeleteForm::showExtraButtons(bool show)
41 {
42 m_ui->m_keepLocal->setVisible(show);
43 m_ui->m_forceDelete->setVisible(show);
44 }
45
keep_local() const46 bool DeleteForm::keep_local() const
47 {
48 return m_ui->m_keepLocal->isChecked();
49 }
50
force_delete() const51 bool DeleteForm::force_delete() const
52 {
53 return m_ui->m_forceDelete->isChecked();
54 }
55