File indexing completed on 2025-01-05 05:14:49

0001 /*
0002 SPDX-FileCopyrightText: 2021 Hamed Masafi <hamed.masfi@gmail.com>
0003 
0004 SPDX-License-Identifier: GPL-3.0-or-later
0005 */
0006 
0007 #include "initdialog.h"
0008 #include <QPushButton>
0009 
0010 InitDialog::InitDialog(Git::Manager *git, QWidget *parent, Qt::WindowFlags f)
0011     : AppDialog(git, parent, f)
0012 {
0013     setupUi(this);
0014     lineEditPath->setMode(KFile::Directory);
0015     connect(lineEditPath, &KUrlRequester::textChanged, this, [this](const QString &text) {
0016         buttonBox->button(QDialogButtonBox::Ok)->setEnabled(!text.trimmed().isEmpty());
0017     });
0018     buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);
0019 }
0020 
0021 QString InitDialog::path() const
0022 {
0023     return lineEditPath->text();
0024 }
0025 
0026 void InitDialog::setPath(const QString &path)
0027 {
0028     lineEditPath->setText(path);
0029 }
0030 
0031 #include "moc_initdialog.cpp"