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

0001 /*
0002 SPDX-FileCopyrightText: 2021 Hamed Masafi <hamed.masfi@gmail.com>
0003 
0004 SPDX-License-Identifier: GPL-3.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include "appdialog.h"
0010 #include "libkommitwidgets_export.h"
0011 #include "ui_commitpushdialog.h"
0012 
0013 namespace Git
0014 {
0015 class Manager;
0016 }
0017 class ChangedFileActions;
0018 class ChangedFilesModel;
0019 class LIBKOMMITWIDGETS_EXPORT CommitPushDialog : public AppDialog, private Ui::CommitPushDialog
0020 {
0021     Q_OBJECT
0022 
0023 public:
0024     explicit CommitPushDialog(Git::Manager *git, QWidget *parent = nullptr);
0025     ~CommitPushDialog() override;
0026 
0027 private:
0028     void slotPushButtonCommitClicked();
0029     void slotPushButtonPushClicked();
0030     void slotToolButtonAddAllClicked();
0031     void slotToolButtonAddNoneClicked();
0032     void slotToolButtonAddIndexedClicked();
0033     void slotToolButtonAddAddedClicked();
0034     void slotToolButtonAddRemovedClicked();
0035     void slotToolButtonAddModifiedClicked();
0036     void slotListWidgetItemDoubleClicked(const QModelIndex &index);
0037     void slotGroupBoxMakeCommitToggled(bool);
0038     void slotListWidgetCustomContextMenuRequested(const QPoint &pos);
0039     void checkButtonsEnable();
0040 
0041     enum Roles { StatusRole = Qt::UserRole + 1 };
0042     void addFiles();
0043     void reload();
0044     void readConfig();
0045     void writeConfig();
0046     ChangedFileActions *mActions = nullptr;
0047     ChangedFilesModel *const mModel;
0048 };