File indexing completed on 2023-05-30 11:30:46

0001 /**
0002  * Copyright (C) 2004 Michael Pyne <mpyne@kde.org>
0003  * Copyright (C) 2003 Frerich Raabe <raabe@kde.org>
0004  *
0005  * This program is free software; you can redistribute it and/or modify it under
0006  * the terms of the GNU General Public License as published by the Free Software
0007  * Foundation; either version 2 of the License, or (at your option) any later
0008  * version.
0009  *
0010  * This program is distributed in the hope that it will be useful, but WITHOUT ANY
0011  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
0012  * PARTICULAR PURPOSE. See the GNU General Public License for more details.
0013  *
0014  * You should have received a copy of the GNU General Public License along with
0015  * this program.  If not, see <http://www.gnu.org/licenses/>.
0016  */
0017 
0018 #include "filerenamerconfigdlg.h"
0019 #include "filerenamer.h"
0020 
0021 #include <KLocalizedString>
0022 
0023 FileRenamerConfigDlg::FileRenamerConfigDlg(QWidget *parent)
0024   : QDialog(parent)
0025   , m_renamerWidget(new FileRenamerWidget(this))
0026 {
0027     setObjectName(QLatin1String("file renamer dialog"));
0028     setModal(true);
0029     setWindowTitle(i18n("File Renamer Options"));
0030 
0031     // TODO: HiDPI?  Is this even still needed today?
0032     m_renamerWidget->setMinimumSize(400, 300);
0033 
0034     connect(m_renamerWidget, &FileRenamerWidget::accepted, this, &QDialog::accept);
0035     connect(m_renamerWidget, &FileRenamerWidget::rejected, this, &QDialog::reject);
0036 
0037     auto vboxLayout = new QVBoxLayout(this);
0038     vboxLayout->addWidget(m_renamerWidget);
0039 }
0040 
0041 void FileRenamerConfigDlg::accept()
0042 {
0043     m_renamerWidget->saveConfig();
0044     QDialog::accept();
0045 }
0046 
0047 // vim: set et sw=4 tw=0 sta: