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 "notedialog.h"
0008 #include "gitmanager.h"
0009 #include <QPushButton>
0010 
0011 NoteDialog::NoteDialog(Git::Manager *git, const QString &branchName, QWidget *parent)
0012     : AppDialog(git, parent)
0013     , mBranchName{branchName}
0014 {
0015     setupUi(this);
0016 
0017     textEdit->setText(git->readNote(branchName));
0018     connect(buttonBox->button(QDialogButtonBox::Ok), &QPushButton::clicked, this, &NoteDialog::slotAccepted);
0019 }
0020 
0021 void NoteDialog::slotAccepted()
0022 {
0023     mGit->saveNote(mBranchName, textEdit->toPlainText());
0024     accept();
0025 }
0026 
0027 #include "moc_notedialog.cpp"