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 "abstractactions.h" 0010 #include "libkommitwidgets_export.h" 0011 0012 class LIBKOMMITWIDGETS_EXPORT FileActions : public AbstractActions 0013 { 0014 Q_OBJECT 0015 0016 public: 0017 explicit FileActions(Git::Manager *git, QWidget *parent = nullptr); 0018 void popup(const QPoint &pos); 0019 0020 Q_REQUIRED_RESULT const QString &place() const; 0021 void setPlace(const QString &newPlace); 0022 0023 Q_REQUIRED_RESULT const QString &filePath() const; 0024 void setFilePath(const QString &newFilePath); 0025 0026 private: 0027 void viewFile(); 0028 void openFile(); 0029 void saveAsFile(); 0030 void logFile(); 0031 void blameFile(); 0032 void search(); 0033 void openWith(); 0034 void diffWithHead(); 0035 void mergeWithHead(); 0036 0037 DEFINE_ACTION(actionSaveAs) 0038 0039 DEFINE_ACTION(actionView) 0040 DEFINE_ACTION(actionOpen) 0041 DEFINE_ACTION(actionHistory) 0042 DEFINE_ACTION(actionBlame) 0043 DEFINE_ACTION(actionSearch) 0044 DEFINE_ACTION(actionOpenWith) 0045 DEFINE_ACTION(actionDiffWithHead) 0046 DEFINE_ACTION(actionMergeWithHead) 0047 QString mPlace; 0048 QString mFilePath; 0049 QMenu *mOpenWithMenu = nullptr; 0050 };