├── GitQlientApp.pro ├── docs ├── assets │ ├── 3_amend.png │ ├── 3_tags.png │ ├── 3_branches.png │ ├── 3_stashes.png │ ├── 3_wip_view.png │ ├── GitQlient.png │ ├── 1_clone_repo.png │ ├── 1_init_repo.png │ ├── 1_open_repo.png │ ├── 4_diff_view.png │ ├── 4c_diff_view.png │ ├── 5_blame_view.png │ ├── 6_merge_view.png │ ├── 1_open_repo_2.png │ ├── 2_pull_options.png │ ├── 2_repo_config.png │ ├── 2_stash_options.png │ ├── 3_options_View.png │ ├── 3_stashes_view.png │ ├── 3_submodule_add.png │ ├── 3_the_tree_view.png │ ├── 3_wip_options.png │ ├── 4_diff_buttons.png │ ├── 4_wip_diff_view.png │ ├── 5_commits_view.png │ ├── 6_merge_warning.png │ ├── 1_initial_screen.png │ ├── 3_branch_options.png │ ├── 3_current_options.png │ ├── 5_edit_view_file.png │ ├── 5_file_blame_view.png │ ├── 2_gitserver_options.png │ ├── 3_commit_info_view.png │ ├── 3_submodule_options.png │ ├── 4_diff_color_schema.png │ ├── 5_edit_view_options.png │ ├── 2_quick_access_actions.png │ ├── 3_local_branches_other.png │ ├── 4_commit_diff_filelist.png │ ├── 2b_quick_access_actions.png │ ├── 3_local_branches_current.png │ ├── 6_branches_widget_minimal.png │ ├── 6_merge_conflict_button.png │ ├── 6_branches_widget_minimal_menu.png │ └── style.css ├── _config.yml ├── dist │ ├── changes-2.0.0.md │ └── changes-1.0.0.md ├── _layouts │ └── default.html └── _includes │ └── sidebar.html ├── src ├── resources │ ├── icon.icns │ ├── dmg_bg.png │ ├── DejaVuSans.ttf │ ├── DejaVuSansMono.ttf │ ├── images │ │ ├── hunkPage.png │ │ ├── pluginsPage.png │ │ ├── branchesPage.png │ │ ├── shortcutsPage.png │ │ └── terminalPage01.png │ ├── icons │ │ ├── GitQlientLogo.ico │ │ ├── GitQlientLogo128.png │ │ ├── GitQlientLogo16.png │ │ ├── GitQlientLogo24.png │ │ ├── GitQlientLogo256.png │ │ ├── GitQlientLogo32.png │ │ ├── GitQlientLogo48.png │ │ ├── GitQlientLogo512.png │ │ ├── GitQlientLogo64.png │ │ ├── GitQlientLogo96.png │ │ ├── GitQlientLogoLarge.png │ │ └── GitQlientLogoMedium.png │ ├── translations │ │ ├── gitqlient_en.qm │ │ └── gitqlient_zh_CN.qm │ ├── gitqlient.desktop │ ├── font_sizes.css │ ├── Info.plist │ └── resources.rc ├── jenkins │ ├── Jenkins.pri │ ├── jenkinsplugin_global.h │ └── IJenkinsWidget.h ├── git_server │ ├── gitserverplugin_global.h │ ├── GitServer.pri │ ├── ConfigData.h │ └── IGitServerCache.h ├── diff │ ├── IDiffWidget.cpp │ ├── CMakeLists.txt │ ├── Diff.pri │ ├── IDiffWidget.h │ ├── FileDiffEditor.cpp │ ├── FileDiffEditor.h │ └── FileEditor.h ├── config │ ├── Config.pri │ ├── CMakeLists.txt │ ├── GitConfigDlg.cpp │ ├── GitConfigDlg.ui │ ├── GeneralConfigDlg.h │ └── GitConfigDlg.h ├── cache │ ├── CMakeLists.txt │ ├── LaneType.h │ ├── Cache.pri │ ├── References.cpp │ ├── Lane.cpp │ ├── WipHelper.h │ ├── Lane.h │ ├── References.h │ ├── lanes.h │ └── GitRepoLoader.h ├── commits │ ├── CMakeLists.txt │ ├── Commits.pri │ ├── GitQlientRole.h │ ├── FileWidget.cpp │ ├── FileListDelegate.h │ ├── FileListDelegate.cpp │ ├── AmendWidget.h │ ├── WipWidget.h │ ├── FileContextMenu.h │ ├── FileWidget.h │ ├── UnstagedMenu.h │ ├── FileListWidget.h │ ├── CommitInfoWidget.cpp │ ├── CommitInfoWidget.h │ └── FileContextMenu.cpp ├── history │ ├── CMakeLists.txt │ ├── History.pri │ ├── ShaFilterProxyModel.cpp │ └── CommitHistoryColumns.h ├── branches │ ├── CMakeLists.txt │ ├── Branches.pri │ ├── AddSubmoduleDlg.cpp │ ├── TagDlg.cpp │ ├── GitQlientBranchItemRole.h │ ├── BranchesWidgetMinimal.h │ ├── RefTreeWidget.cpp │ ├── TagDlg.ui │ ├── AddSubmoduleDlg.ui │ ├── RefTreeWidget.h │ ├── StashesContextMenu.cpp │ ├── AddRemoteDlg.cpp │ ├── AddRemoteDlg.h │ ├── AddSubmoduleDlg.h │ ├── BranchesViewDelegate.h │ ├── SubmodulesContextMenu.h │ ├── TagDlg.h │ ├── StashesContextMenu.h │ ├── AddSubtreeDlg.ui │ └── BranchesViewDelegate.cpp ├── aux_widgets │ ├── CMakeLists.txt │ ├── UpstreamDlg.h │ ├── PomodoroConfigDlg.h │ ├── NewVersionInfoDlg.h │ ├── CredentialsDlg.cpp │ ├── SquashDlg.h │ ├── PullDlg.h │ ├── WaitingDlg.cpp │ ├── ProgressDlg.cpp │ ├── HunkWidget.h │ ├── InputShaDlg.cpp │ ├── AuxiliarWidgets.pri │ ├── UpstreamDlg.cpp │ ├── CredentialsDlg.h │ ├── GitQlientUpdater.h │ ├── PullDlg.cpp │ ├── InitialRepoConfig.h │ ├── PullDlg.ui │ ├── PomodoroConfigDlg.cpp │ ├── ConflictButton.cpp │ ├── InitialRepoConfig.cpp │ ├── PluginsDownloader.h │ ├── InputShaDlg.ui │ ├── CommitInfoPanel.h │ ├── WaitingDlg.h │ ├── CredentialsDlg.ui │ └── ProgressDlg.h ├── big_widgets │ ├── CMakeLists.txt │ ├── BigWidgets.pri │ └── ConfigWidget.h ├── App.pri ├── main.cpp └── GitQlient.qrc ├── .github ├── ISSUE_TEMPLATE │ ├── custom.md │ ├── improvement-request.md │ ├── feature_request.md │ └── bug.md ├── workflows │ ├── release.yaml │ ├── master.yaml │ ├── push.yaml │ ├── build_mac.yaml │ ├── build_win.yaml │ ├── build_deb.yaml │ ├── build_appimg.yaml │ └── build_rpm.yaml └── PULL_REQUEST_TEMPLATE.md ├── .gitignore ├── .gitmodules └── .clang-format /GitQlientApp.pro: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/assets/3_amend.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/francescmaestre/GitQlient/HEAD/docs/assets/3_amend.png -------------------------------------------------------------------------------- /docs/assets/3_tags.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/francescmaestre/GitQlient/HEAD/docs/assets/3_tags.png -------------------------------------------------------------------------------- /src/resources/icon.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/francescmaestre/GitQlient/HEAD/src/resources/icon.icns -------------------------------------------------------------------------------- /docs/assets/3_branches.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/francescmaestre/GitQlient/HEAD/docs/assets/3_branches.png -------------------------------------------------------------------------------- /docs/assets/3_stashes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/francescmaestre/GitQlient/HEAD/docs/assets/3_stashes.png -------------------------------------------------------------------------------- /docs/assets/3_wip_view.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/francescmaestre/GitQlient/HEAD/docs/assets/3_wip_view.png -------------------------------------------------------------------------------- /docs/assets/GitQlient.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/francescmaestre/GitQlient/HEAD/docs/assets/GitQlient.png -------------------------------------------------------------------------------- /src/resources/dmg_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/francescmaestre/GitQlient/HEAD/src/resources/dmg_bg.png -------------------------------------------------------------------------------- /docs/assets/1_clone_repo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/francescmaestre/GitQlient/HEAD/docs/assets/1_clone_repo.png -------------------------------------------------------------------------------- /docs/assets/1_init_repo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/francescmaestre/GitQlient/HEAD/docs/assets/1_init_repo.png -------------------------------------------------------------------------------- /docs/assets/1_open_repo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/francescmaestre/GitQlient/HEAD/docs/assets/1_open_repo.png -------------------------------------------------------------------------------- /docs/assets/4_diff_view.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/francescmaestre/GitQlient/HEAD/docs/assets/4_diff_view.png -------------------------------------------------------------------------------- /docs/assets/4c_diff_view.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/francescmaestre/GitQlient/HEAD/docs/assets/4c_diff_view.png -------------------------------------------------------------------------------- /docs/assets/5_blame_view.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/francescmaestre/GitQlient/HEAD/docs/assets/5_blame_view.png -------------------------------------------------------------------------------- /docs/assets/6_merge_view.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/francescmaestre/GitQlient/HEAD/docs/assets/6_merge_view.png -------------------------------------------------------------------------------- /src/resources/DejaVuSans.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/francescmaestre/GitQlient/HEAD/src/resources/DejaVuSans.ttf -------------------------------------------------------------------------------- /docs/assets/1_open_repo_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/francescmaestre/GitQlient/HEAD/docs/assets/1_open_repo_2.png -------------------------------------------------------------------------------- /docs/assets/2_pull_options.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/francescmaestre/GitQlient/HEAD/docs/assets/2_pull_options.png -------------------------------------------------------------------------------- /docs/assets/2_repo_config.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/francescmaestre/GitQlient/HEAD/docs/assets/2_repo_config.png -------------------------------------------------------------------------------- /docs/assets/2_stash_options.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/francescmaestre/GitQlient/HEAD/docs/assets/2_stash_options.png -------------------------------------------------------------------------------- /docs/assets/3_options_View.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/francescmaestre/GitQlient/HEAD/docs/assets/3_options_View.png -------------------------------------------------------------------------------- /docs/assets/3_stashes_view.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/francescmaestre/GitQlient/HEAD/docs/assets/3_stashes_view.png -------------------------------------------------------------------------------- /docs/assets/3_submodule_add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/francescmaestre/GitQlient/HEAD/docs/assets/3_submodule_add.png -------------------------------------------------------------------------------- /docs/assets/3_the_tree_view.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/francescmaestre/GitQlient/HEAD/docs/assets/3_the_tree_view.png -------------------------------------------------------------------------------- /docs/assets/3_wip_options.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/francescmaestre/GitQlient/HEAD/docs/assets/3_wip_options.png -------------------------------------------------------------------------------- /docs/assets/4_diff_buttons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/francescmaestre/GitQlient/HEAD/docs/assets/4_diff_buttons.png -------------------------------------------------------------------------------- /docs/assets/4_wip_diff_view.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/francescmaestre/GitQlient/HEAD/docs/assets/4_wip_diff_view.png -------------------------------------------------------------------------------- /docs/assets/5_commits_view.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/francescmaestre/GitQlient/HEAD/docs/assets/5_commits_view.png -------------------------------------------------------------------------------- /docs/assets/6_merge_warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/francescmaestre/GitQlient/HEAD/docs/assets/6_merge_warning.png -------------------------------------------------------------------------------- /docs/assets/1_initial_screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/francescmaestre/GitQlient/HEAD/docs/assets/1_initial_screen.png -------------------------------------------------------------------------------- /docs/assets/3_branch_options.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/francescmaestre/GitQlient/HEAD/docs/assets/3_branch_options.png -------------------------------------------------------------------------------- /docs/assets/3_current_options.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/francescmaestre/GitQlient/HEAD/docs/assets/3_current_options.png -------------------------------------------------------------------------------- /docs/assets/5_edit_view_file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/francescmaestre/GitQlient/HEAD/docs/assets/5_edit_view_file.png -------------------------------------------------------------------------------- /docs/assets/5_file_blame_view.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/francescmaestre/GitQlient/HEAD/docs/assets/5_file_blame_view.png -------------------------------------------------------------------------------- /src/resources/DejaVuSansMono.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/francescmaestre/GitQlient/HEAD/src/resources/DejaVuSansMono.ttf -------------------------------------------------------------------------------- /src/resources/images/hunkPage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/francescmaestre/GitQlient/HEAD/src/resources/images/hunkPage.png -------------------------------------------------------------------------------- /docs/assets/2_gitserver_options.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/francescmaestre/GitQlient/HEAD/docs/assets/2_gitserver_options.png -------------------------------------------------------------------------------- /docs/assets/3_commit_info_view.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/francescmaestre/GitQlient/HEAD/docs/assets/3_commit_info_view.png -------------------------------------------------------------------------------- /docs/assets/3_submodule_options.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/francescmaestre/GitQlient/HEAD/docs/assets/3_submodule_options.png -------------------------------------------------------------------------------- /docs/assets/4_diff_color_schema.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/francescmaestre/GitQlient/HEAD/docs/assets/4_diff_color_schema.png -------------------------------------------------------------------------------- /docs/assets/5_edit_view_options.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/francescmaestre/GitQlient/HEAD/docs/assets/5_edit_view_options.png -------------------------------------------------------------------------------- /src/resources/images/pluginsPage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/francescmaestre/GitQlient/HEAD/src/resources/images/pluginsPage.png -------------------------------------------------------------------------------- /docs/assets/2_quick_access_actions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/francescmaestre/GitQlient/HEAD/docs/assets/2_quick_access_actions.png -------------------------------------------------------------------------------- /docs/assets/3_local_branches_other.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/francescmaestre/GitQlient/HEAD/docs/assets/3_local_branches_other.png -------------------------------------------------------------------------------- /docs/assets/4_commit_diff_filelist.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/francescmaestre/GitQlient/HEAD/docs/assets/4_commit_diff_filelist.png -------------------------------------------------------------------------------- /src/resources/icons/GitQlientLogo.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/francescmaestre/GitQlient/HEAD/src/resources/icons/GitQlientLogo.ico -------------------------------------------------------------------------------- /src/resources/images/branchesPage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/francescmaestre/GitQlient/HEAD/src/resources/images/branchesPage.png -------------------------------------------------------------------------------- /src/resources/images/shortcutsPage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/francescmaestre/GitQlient/HEAD/src/resources/images/shortcutsPage.png -------------------------------------------------------------------------------- /docs/assets/2b_quick_access_actions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/francescmaestre/GitQlient/HEAD/docs/assets/2b_quick_access_actions.png -------------------------------------------------------------------------------- /docs/assets/3_local_branches_current.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/francescmaestre/GitQlient/HEAD/docs/assets/3_local_branches_current.png -------------------------------------------------------------------------------- /docs/assets/6_branches_widget_minimal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/francescmaestre/GitQlient/HEAD/docs/assets/6_branches_widget_minimal.png -------------------------------------------------------------------------------- /docs/assets/6_merge_conflict_button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/francescmaestre/GitQlient/HEAD/docs/assets/6_merge_conflict_button.png -------------------------------------------------------------------------------- /src/jenkins/Jenkins.pri: -------------------------------------------------------------------------------- 1 | INCLUDEPATH += $$PWD 2 | 3 | HEADERS += \ 4 | $$PWD/IJenkinsWidget.h \ 5 | $$PWD/jenkinsplugin_global.h 6 | -------------------------------------------------------------------------------- /src/resources/icons/GitQlientLogo128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/francescmaestre/GitQlient/HEAD/src/resources/icons/GitQlientLogo128.png -------------------------------------------------------------------------------- /src/resources/icons/GitQlientLogo16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/francescmaestre/GitQlient/HEAD/src/resources/icons/GitQlientLogo16.png -------------------------------------------------------------------------------- /src/resources/icons/GitQlientLogo24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/francescmaestre/GitQlient/HEAD/src/resources/icons/GitQlientLogo24.png -------------------------------------------------------------------------------- /src/resources/icons/GitQlientLogo256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/francescmaestre/GitQlient/HEAD/src/resources/icons/GitQlientLogo256.png -------------------------------------------------------------------------------- /src/resources/icons/GitQlientLogo32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/francescmaestre/GitQlient/HEAD/src/resources/icons/GitQlientLogo32.png -------------------------------------------------------------------------------- /src/resources/icons/GitQlientLogo48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/francescmaestre/GitQlient/HEAD/src/resources/icons/GitQlientLogo48.png -------------------------------------------------------------------------------- /src/resources/icons/GitQlientLogo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/francescmaestre/GitQlient/HEAD/src/resources/icons/GitQlientLogo512.png -------------------------------------------------------------------------------- /src/resources/icons/GitQlientLogo64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/francescmaestre/GitQlient/HEAD/src/resources/icons/GitQlientLogo64.png -------------------------------------------------------------------------------- /src/resources/icons/GitQlientLogo96.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/francescmaestre/GitQlient/HEAD/src/resources/icons/GitQlientLogo96.png -------------------------------------------------------------------------------- /src/resources/images/terminalPage01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/francescmaestre/GitQlient/HEAD/src/resources/images/terminalPage01.png -------------------------------------------------------------------------------- /src/resources/icons/GitQlientLogoLarge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/francescmaestre/GitQlient/HEAD/src/resources/icons/GitQlientLogoLarge.png -------------------------------------------------------------------------------- /src/resources/icons/GitQlientLogoMedium.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/francescmaestre/GitQlient/HEAD/src/resources/icons/GitQlientLogoMedium.png -------------------------------------------------------------------------------- /src/resources/translations/gitqlient_en.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/francescmaestre/GitQlient/HEAD/src/resources/translations/gitqlient_en.qm -------------------------------------------------------------------------------- /docs/assets/6_branches_widget_minimal_menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/francescmaestre/GitQlient/HEAD/docs/assets/6_branches_widget_minimal_menu.png -------------------------------------------------------------------------------- /src/resources/translations/gitqlient_zh_CN.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/francescmaestre/GitQlient/HEAD/src/resources/translations/gitqlient_zh_CN.qm -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/custom.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Custom issue template 3 | about: Describe this issue template's purpose here. 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/resources/gitqlient.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Type=Application 3 | Name=GitQlient 4 | Comment=A multi-platform Git client made with Qt 5 | Exec=gitqlient 6 | Icon=gitqlient 7 | Categories=Development; 8 | -------------------------------------------------------------------------------- /src/jenkins/jenkinsplugin_global.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #if defined(JENKINSPLUGIN_LIBRARY) 4 | # define JENKINSPLUGIN_EXPORT Q_DECL_EXPORT 5 | #else 6 | # define JENKINSPLUGIN_EXPORT Q_DECL_IMPORT 7 | #endif 8 | -------------------------------------------------------------------------------- /src/git_server/gitserverplugin_global.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #if defined(GITSERVERPLUGIN_LIBRARY) 4 | # define GITSERVERPLUGIN_EXPORT Q_DECL_EXPORT 5 | #else 6 | # define GITSERVERPLUGIN_EXPORT Q_DECL_IMPORT 7 | #endif 8 | -------------------------------------------------------------------------------- /src/git_server/GitServer.pri: -------------------------------------------------------------------------------- 1 | INCLUDEPATH += $$PWD 2 | 3 | HEADERS += \ 4 | $$PWD/ConfigData.h \ 5 | $$PWD/GitServerTypes.h \ 6 | $$PWD/gitserverplugin_global.h \ 7 | $$PWD/IGitServerCache.h \ 8 | $$PWD/IGitServerWidget.h 9 | -------------------------------------------------------------------------------- /src/diff/IDiffWidget.cpp: -------------------------------------------------------------------------------- 1 | #include "IDiffWidget.h" 2 | 3 | IDiffWidget::IDiffWidget(const QSharedPointer &git, QSharedPointer cache, QWidget *parent) 4 | : QFrame(parent) 5 | , mGit(git) 6 | , mCache(cache) 7 | { 8 | } 9 | -------------------------------------------------------------------------------- /src/config/Config.pri: -------------------------------------------------------------------------------- 1 | INCLUDEPATH += $$PWD 2 | 3 | FORMS += \ 4 | $$PWD/GitConfigDlg.ui 5 | 6 | HEADERS += \ 7 | $$PWD/GeneralConfigDlg.h \ 8 | $$PWD/GitConfigDlg.h \ 9 | $$PWD/InitScreen.h 10 | 11 | SOURCES += \ 12 | $$PWD/GeneralConfigDlg.cpp \ 13 | $$PWD/GitConfigDlg.cpp \ 14 | $$PWD/InitScreen.cpp 15 | -------------------------------------------------------------------------------- /src/cache/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB SRC_FILES 2 | *.cpp 3 | *.h 4 | *.ui 5 | ) 6 | 7 | 8 | add_library(cache STATIC 9 | ${SRC_FILES} 10 | ) 11 | 12 | target_link_libraries(cache 13 | PUBLIC 14 | Qt::Core 15 | git 16 | big_widget 17 | ) 18 | target_include_directories(cache PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) 19 | -------------------------------------------------------------------------------- /src/commits/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB SRC_FILES 2 | *.cpp 3 | *.h 4 | *.ui 5 | ) 6 | 7 | 8 | add_library(commits STATIC 9 | ${SRC_FILES} 10 | ) 11 | 12 | target_link_libraries(commits 13 | PUBLIC 14 | Qt::Core 15 | Qt::Widgets 16 | cache 17 | ) 18 | target_include_directories(commits PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) 19 | -------------------------------------------------------------------------------- /src/history/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB SRC_FILES 2 | *.cpp 3 | *.h 4 | *.ui 5 | ) 6 | 7 | 8 | add_library(history STATIC 9 | ${SRC_FILES} 10 | ) 11 | 12 | target_link_libraries(history 13 | PUBLIC 14 | Qt::Core 15 | Qt::Widgets 16 | cache 17 | ) 18 | target_include_directories(history PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) 19 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.DS_Store 2 | **/.DS_Store 3 | *.autosave 4 | *.user 5 | *.patch 6 | *.swp 7 | *.AppImage 8 | usr/* 9 | build/* 10 | debug/ 11 | release/ 12 | /*.o 13 | /GitQlient 14 | /logs 15 | /Makefile 16 | /moc_*.* 17 | /qrc_resources.cpp 18 | /ui_*.h 19 | 20 | /.* 21 | !/.github 22 | !/.clang-format 23 | !/.gitignore 24 | !/.gitmodules 25 | !/.travis.yml 26 | -------------------------------------------------------------------------------- /src/branches/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB SRC_FILES 2 | *.cpp 3 | *.h 4 | *.ui 5 | ) 6 | 7 | 8 | add_library(branches STATIC 9 | ${SRC_FILES} 10 | ) 11 | 12 | target_link_libraries(branches 13 | PUBLIC 14 | Qt::Core 15 | Qt::Widgets 16 | aux_widgets 17 | ) 18 | target_include_directories(branches PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) 19 | -------------------------------------------------------------------------------- /src/diff/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB SRC_FILES 2 | *.cpp 3 | *.h 4 | *.ui 5 | ) 6 | 7 | 8 | add_library(diff STATIC 9 | ${SRC_FILES} 10 | ) 11 | 12 | target_link_libraries(diff 13 | PUBLIC 14 | Qt::Core 15 | Qt::Widgets 16 | AuxiliarCustomWidgets 17 | cache 18 | ) 19 | target_include_directories(diff PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) 20 | -------------------------------------------------------------------------------- /docs/_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-minimal 2 | google_analytics: UA-3598915-3 3 | title: GitQlient User Manual! 4 | description: GitQlient, pronounced as git+client (/gɪtˈklaɪənt/) is a multi-platform Git client originally forked from QGit. Nowadays it just keeps some old functionality to store the data that is used to later paint the repo tree. 5 | include: [UserManual.md] 6 | 7 | -------------------------------------------------------------------------------- /.github/workflows/release.yaml: -------------------------------------------------------------------------------- 1 | name: Release 2 | run-name: Release ${{ github.ref_name }} 3 | 4 | on: 5 | push: 6 | tags: v* 7 | 8 | permissions: 9 | contents: write 10 | 11 | jobs: 12 | BuildProject: 13 | name: Build 🧱 14 | uses: ./.github/workflows/build.yaml 15 | secrets: inherit 16 | permissions: 17 | actions: write 18 | contents: write 19 | -------------------------------------------------------------------------------- /src/config/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB SRC_FILES 2 | *.cpp 3 | *.h 4 | *.ui 5 | ) 6 | 7 | 8 | add_library(config STATIC 9 | ${SRC_FILES} 10 | ) 11 | 12 | target_link_libraries(config 13 | PUBLIC 14 | Qt::Core 15 | Qt::Widgets 16 | AuxiliarCustomWidgets 17 | aux_widgets 18 | ) 19 | target_include_directories(config PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) 20 | -------------------------------------------------------------------------------- /docs/dist/changes-2.0.0.md: -------------------------------------------------------------------------------- 1 | The GitQlient 2.0.0 release contains a deep refactor and new features. 2 | 3 | A more detailed list of changes follows below. 4 | 5 | Big features: 6 | - **Merge manager**: Added support to manage merge with conflict resolution and updated view. 7 | 8 | Minor features: 9 | - **Long path readability**: Improved readability for long paths in the WIP widget. 10 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "src/QPinnableTabWidget"] 2 | path = src/QPinnableTabWidget 3 | url = ../QPinnableTabWidget.git 4 | [submodule "src/QLogger"] 5 | path = src/QLogger 6 | url = ../QLogger.git 7 | [submodule "src/AuxiliarCustomWidgets"] 8 | path = src/AuxiliarCustomWidgets 9 | url = ../AuxiliarCustomWidgets.git 10 | [submodule "src/git"] 11 | path = src/git 12 | url = ../git.git 13 | -------------------------------------------------------------------------------- /src/cache/LaneType.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | enum class LaneType 4 | { 5 | EMPTY, 6 | ACTIVE, 7 | NOT_ACTIVE, 8 | MERGE_FORK, 9 | MERGE_FORK_R, 10 | MERGE_FORK_L, 11 | JOIN, 12 | JOIN_R, 13 | JOIN_L, 14 | HEAD, 15 | HEAD_R, 16 | HEAD_L, 17 | TAIL, 18 | TAIL_R, 19 | TAIL_L, 20 | CROSS, 21 | CROSS_EMPTY, 22 | INITIAL, 23 | BRANCH, 24 | LANE_TYPES_NUM 25 | }; 26 | -------------------------------------------------------------------------------- /docs/assets/style.css: -------------------------------------------------------------------------------- 1 | 2 | header li{ 3 | list-style-type: decimal; 4 | width: 100%; 5 | height: 20px; 6 | margin-bottom: 0; 7 | line-height: 0; 8 | padding: 0; 9 | background: none !important; 10 | border-radius: 0; 11 | border: 0; 12 | -webkit-box-shadow: none; 13 | box-shadow: none; 14 | } 15 | 16 | header li:hover{ 17 | background: none !important; 18 | font-weight:normal; 19 | text-shadow: 0; 20 | padding: 0; 21 | height: 20px; 22 | } 23 | -------------------------------------------------------------------------------- /src/aux_widgets/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB SRC_FILES 2 | *.cpp 3 | *.h 4 | *.ui 5 | ) 6 | 7 | 8 | add_library(aux_widgets STATIC 9 | ${SRC_FILES} 10 | ) 11 | 12 | target_link_libraries(aux_widgets 13 | PUBLIC 14 | Qt::Core 15 | Qt::Widgets 16 | Qt::Network 17 | AuxiliarCustomWidgets 18 | git 19 | big_widget 20 | cache 21 | ) 22 | target_include_directories(aux_widgets PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) 23 | -------------------------------------------------------------------------------- /src/big_widgets/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB SRC_FILES 2 | *.cpp 3 | *.h 4 | *.ui 5 | ) 6 | 7 | 8 | add_library(big_widget STATIC 9 | ${SRC_FILES} 10 | ) 11 | 12 | target_link_libraries(big_widget 13 | PUBLIC 14 | Qt::Core 15 | Qt::Widgets 16 | aux_widgets 17 | branches 18 | diff 19 | commits 20 | history 21 | config 22 | QPinnableTabWidget 23 | ) 24 | target_include_directories(big_widget PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) 25 | -------------------------------------------------------------------------------- /src/diff/Diff.pri: -------------------------------------------------------------------------------- 1 | INCLUDEPATH += $$PWD 2 | 3 | HEADERS += \ 4 | $$PWD/FileBlameWidget.h \ 5 | $$PWD/FileDiffEditor.h \ 6 | $$PWD/FileDiffWidget.h \ 7 | $$PWD/FileEditor.h \ 8 | $$PWD/FullDiffWidget.h \ 9 | $$PWD/IDiffWidget.h 10 | 11 | SOURCES += \ 12 | $$PWD/FileBlameWidget.cpp \ 13 | $$PWD/FileDiffEditor.cpp \ 14 | $$PWD/FileDiffWidget.cpp \ 15 | $$PWD/FileEditor.cpp \ 16 | $$PWD/FullDiffWidget.cpp \ 17 | $$PWD/IDiffWidget.cpp 18 | -------------------------------------------------------------------------------- /src/cache/Cache.pri: -------------------------------------------------------------------------------- 1 | INCLUDEPATH += $$PWD 2 | 3 | HEADERS += \ 4 | $$PWD/CommitInfo.h \ 5 | $$PWD/GitCache.h \ 6 | $$PWD/GitRepoLoader.h \ 7 | $$PWD/Lane.h \ 8 | $$PWD/LaneType.h \ 9 | $$PWD/References.h \ 10 | $$PWD/WipHelper.h \ 11 | $$PWD/lanes.h 12 | 13 | SOURCES += \ 14 | $$PWD/CommitInfo.cpp \ 15 | $$PWD/GitCache.cpp \ 16 | $$PWD/GitRepoLoader.cpp \ 17 | $$PWD/Lane.cpp \ 18 | $$PWD/References.cpp \ 19 | $$PWD/lanes.cpp 20 | -------------------------------------------------------------------------------- /src/aux_widgets/UpstreamDlg.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Ui 6 | { 7 | class PullDlg; 8 | } 9 | 10 | class GitBase; 11 | 12 | class UpstreamDlg : public QDialog 13 | { 14 | Q_OBJECT 15 | 16 | public: 17 | UpstreamDlg(QSharedPointer git, const QString &text, QWidget *parent = nullptr); 18 | ~UpstreamDlg() override; 19 | 20 | void accept() override; 21 | 22 | private: 23 | Ui::PullDlg *ui; 24 | QSharedPointer mGit; 25 | }; 26 | -------------------------------------------------------------------------------- /src/aux_widgets/PomodoroConfigDlg.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Ui 6 | { 7 | class PomodoroConfigDlg; 8 | } 9 | 10 | class GitBase; 11 | 12 | class PomodoroConfigDlg : public QDialog 13 | { 14 | Q_OBJECT 15 | 16 | public: 17 | explicit PomodoroConfigDlg(const QSharedPointer &git, QWidget *parent = nullptr); 18 | ~PomodoroConfigDlg(); 19 | 20 | void accept() override; 21 | 22 | private: 23 | Ui::PomodoroConfigDlg *ui; 24 | QSharedPointer mGit; 25 | }; 26 | -------------------------------------------------------------------------------- /src/history/History.pri: -------------------------------------------------------------------------------- 1 | INCLUDEPATH += $$PWD 2 | 3 | HEADERS += \ 4 | $$PWD/CommitHistoryColumns.h \ 5 | $$PWD/CommitHistoryContextMenu.h \ 6 | $$PWD/CommitHistoryModel.h \ 7 | $$PWD/CommitHistoryView.h \ 8 | $$PWD/RepositoryViewDelegate.h \ 9 | $$PWD/ShaFilterProxyModel.h 10 | 11 | SOURCES += \ 12 | $$PWD/CommitHistoryContextMenu.cpp \ 13 | $$PWD/CommitHistoryModel.cpp \ 14 | $$PWD/CommitHistoryView.cpp \ 15 | $$PWD/RepositoryViewDelegate.cpp \ 16 | $$PWD/ShaFilterProxyModel.cpp 17 | -------------------------------------------------------------------------------- /src/history/ShaFilterProxyModel.cpp: -------------------------------------------------------------------------------- 1 | #include "ShaFilterProxyModel.h" 2 | 3 | #include 4 | 5 | ShaFilterProxyModel::ShaFilterProxyModel(QObject *parent) 6 | : QSortFilterProxyModel(parent) 7 | { 8 | } 9 | 10 | bool ShaFilterProxyModel::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const 11 | { 12 | const auto shaIndex = sourceModel()->index(sourceRow, static_cast(CommitHistoryColumns::Sha), sourceParent); 13 | const auto sha = sourceModel()->data(shaIndex).toString(); 14 | return mAcceptedShas.contains(sha); 15 | } 16 | -------------------------------------------------------------------------------- /src/aux_widgets/NewVersionInfoDlg.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Ui 6 | { 7 | class NewVersionInfoDlg; 8 | } 9 | 10 | class NewVersionInfoDlg : public QDialog 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | explicit NewVersionInfoDlg(QWidget *parent = nullptr); 16 | ~NewVersionInfoDlg(); 17 | 18 | private: 19 | Ui::NewVersionInfoDlg *ui; 20 | 21 | void goPreviousPage(); 22 | void goNextPage(); 23 | 24 | void createAddPage(const QString &title, const QStringList &imgsSrc, const QString &desc); 25 | void saveConfig(); 26 | }; 27 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/improvement-request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Improvement request 3 | about: Improve GitQlient! 4 | title: '' 5 | labels: Improvement 6 | assignees: '' 7 | 8 | --- 9 | 10 | **What current behavior doesn't fully fit your needs? Why?** 11 | A clear and concise description of what you want to happen. 12 | 13 | **What you'd like to see? Propose a solution** 14 | 15 | **Describe alternatives you've considered** 16 | A clear and concise description of any alternative solutions or features you've considered. 17 | 18 | **Additional context** 19 | Add any other context or screenshots about the feature request here. 20 | -------------------------------------------------------------------------------- /src/App.pri: -------------------------------------------------------------------------------- 1 | include($$PWD/AuxiliarCustomWidgets/AuxiliarCustomWidgets.pri) 2 | include($$PWD/aux_widgets/AuxiliarWidgets.pri) 3 | include($$PWD/big_widgets/BigWidgets.pri) 4 | include($$PWD/branches/Branches.pri) 5 | include($$PWD/commits/Commits.pri) 6 | include($$PWD/config/Config.pri) 7 | include($$PWD/diff/Diff.pri) 8 | include($$PWD/git/Git.pri) 9 | include($$PWD/cache/Cache.pri) 10 | include($$PWD/history/History.pri) 11 | include($$PWD/git_server/GitServer.pri) 12 | include($$PWD/QLogger/QLogger.pri) 13 | include($$PWD/QPinnableTabWidget/QPinnableTabWidget.pri) 14 | include($$PWD/jenkins/Jenkins.pri) 15 | 16 | RESOURCES += \ 17 | $$PWD/GitQlient.qrc 18 | -------------------------------------------------------------------------------- /src/resources/font_sizes.css: -------------------------------------------------------------------------------- 1 | base-font: 10pt; 2 | 3 | QPushButton, QToolButton 4 | { 5 | font-size: 10pt; 6 | } 7 | 8 | PomodoroButton > QLabel 9 | { 10 | font-size: 7pt; 11 | } 12 | 13 | QLabel 14 | { 15 | font-size: 10pt; 16 | } 17 | 18 | #lCounter 19 | { 20 | font-size: 9pt; 21 | } 22 | 23 | #labelSha 24 | { 25 | font-size: 14pt; 26 | } 27 | 28 | #labelAuthor 29 | { 30 | font-size: 12pt; 31 | } 32 | 33 | #labelDateTime 34 | { 35 | font-size: 9pt; 36 | } 37 | 38 | #normalLabel 39 | { 40 | font-size: 9pt; 41 | } 42 | 43 | QLabel#numberLabel 44 | { 45 | font-size: 9pt; 46 | } 47 | 48 | QLabel#title 49 | { 50 | font-size: 24pt; 51 | } 52 | -------------------------------------------------------------------------------- /src/cache/References.cpp: -------------------------------------------------------------------------------- 1 | #include "References.h" 2 | 3 | void References::addReference(Type type, const QString &value) 4 | { 5 | const auto references = mReferences.value(type, QStringList()); 6 | 7 | if (!references.contains(value)) 8 | mReferences[type].append(value); 9 | } 10 | 11 | QStringList References::getReferences(Type type) const 12 | { 13 | return mReferences.value(type, QStringList()); 14 | } 15 | 16 | int References::removeReference(References::Type type, const QString &value) 17 | { 18 | const auto removedItems = mReferences[type].removeAll(value); 19 | 20 | if (mReferences[type].isEmpty()) 21 | mReferences.remove(type); 22 | 23 | return removedItems; 24 | } 25 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Add a new feature for GitQlient 4 | title: '' 5 | labels: Feature 6 | assignees: '' 7 | 8 | --- 9 | 10 | Notice that in case GitQlient already has a similar or close behavior to the one you would like to suggest, you should use the **Improvement request** template. 11 | 12 | **Describe the solution you'd like** 13 | A clear and concise description of what you want to happen. 14 | 15 | **Describe alternatives you've considered** 16 | A clear and concise description of any alternative solutions or features you've considered. 17 | 18 | **Additional context** 19 | Add any other context or screenshots about the feature request here. 20 | -------------------------------------------------------------------------------- /src/aux_widgets/CredentialsDlg.cpp: -------------------------------------------------------------------------------- 1 | #include "CredentialsDlg.h" 2 | #include "ui_CredentialsDlg.h" 3 | 4 | #include 5 | 6 | CredentialsDlg::CredentialsDlg(const QSharedPointer &git, QWidget *parent) 7 | : QDialog(parent) 8 | , ui(new Ui::CredentialsDlg) 9 | , mGit(git) 10 | { 11 | ui->setupUi(this); 12 | } 13 | 14 | CredentialsDlg::~CredentialsDlg() 15 | { 16 | delete ui; 17 | } 18 | 19 | void CredentialsDlg::accept() 20 | { 21 | const auto username = ui->leUser->text(); 22 | const auto password = ui->lePass->text(); 23 | 24 | if (!username.isEmpty() && !password.isEmpty()) 25 | GitCredentials::configureStorage(username, password, mGit); 26 | 27 | QDialog::accept(); 28 | } 29 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug 3 | about: Huston, GitQlient has a problem! 4 | title: "[BUG]" 5 | labels: Bug 6 | assignees: francescmm 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. ... 16 | 17 | **Expected behavior** 18 | A clear and concise description of what you expected to happen. 19 | 20 | **Screenshots** 21 | If applicable, add screenshots to help explain your problem. 22 | 23 | **Desktop (please complete the following information):** 24 | - OS: 25 | - Release version or SHA: 26 | - If manually compiled, compiler version: 27 | 28 | **Additional context** 29 | Add any other context about the problem here. 30 | -------------------------------------------------------------------------------- /src/big_widgets/BigWidgets.pri: -------------------------------------------------------------------------------- 1 | INCLUDEPATH += $$PWD 2 | 3 | HEADERS += \ 4 | $$PWD/BlameWidget.h \ 5 | $$PWD/ConfigWidget.h \ 6 | $$PWD/Controls.h \ 7 | $$PWD/DiffWidget.h \ 8 | $$PWD/GitQlient.h \ 9 | $$PWD/GitQlientRepo.h \ 10 | $$PWD/GitQlientSettings.h \ 11 | $$PWD/GitQlientStyles.h \ 12 | $$PWD/HistoryWidget.h \ 13 | $$PWD/MergeWidget.h 14 | 15 | SOURCES += \ 16 | $$PWD/BlameWidget.cpp \ 17 | $$PWD/ConfigWidget.cpp \ 18 | $$PWD/Controls.cpp \ 19 | $$PWD/DiffWidget.cpp \ 20 | $$PWD/GitQlient.cpp \ 21 | $$PWD/GitQlientRepo.cpp \ 22 | $$PWD/GitQlientSettings.cpp \ 23 | $$PWD/GitQlientStyles.cpp \ 24 | $$PWD/HistoryWidget.cpp \ 25 | $$PWD/MergeWidget.cpp 26 | 27 | FORMS += \ 28 | $$PWD/ConfigWidget.ui 29 | -------------------------------------------------------------------------------- /src/commits/Commits.pri: -------------------------------------------------------------------------------- 1 | INCLUDEPATH += $$PWD 2 | 3 | FORMS += \ 4 | $$PWD/CommitChangesWidget.ui 5 | 6 | HEADERS += \ 7 | $$PWD/AmendWidget.h \ 8 | $$PWD/CommitChangesWidget.h \ 9 | $$PWD/CommitInfoWidget.h \ 10 | $$PWD/FileContextMenu.h \ 11 | $$PWD/FileListDelegate.h \ 12 | $$PWD/FileListWidget.h \ 13 | $$PWD/FileWidget.h \ 14 | $$PWD/GitQlientRole.h \ 15 | $$PWD/UnstagedMenu.h \ 16 | $$PWD/WipWidget.h 17 | 18 | SOURCES += \ 19 | $$PWD/AmendWidget.cpp \ 20 | $$PWD/CommitChangesWidget.cpp \ 21 | $$PWD/CommitInfoWidget.cpp \ 22 | $$PWD/FileContextMenu.cpp \ 23 | $$PWD/FileListDelegate.cpp \ 24 | $$PWD/FileListWidget.cpp \ 25 | $$PWD/FileWidget.cpp \ 26 | $$PWD/UnstagedMenu.cpp \ 27 | $$PWD/WipWidget.cpp 28 | -------------------------------------------------------------------------------- /src/aux_widgets/SquashDlg.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Ui 6 | { 7 | class SquashDlg; 8 | } 9 | 10 | class GitCache; 11 | class GitBase; 12 | 13 | class SquashDlg : public QDialog 14 | { 15 | Q_OBJECT 16 | 17 | signals: 18 | void changesCommitted(); 19 | 20 | public: 21 | explicit SquashDlg(const QSharedPointer git, const QSharedPointer &cache, const QStringList &shas, 22 | QWidget *parent = nullptr); 23 | ~SquashDlg() override; 24 | 25 | void accept() override; 26 | 27 | private: 28 | QSharedPointer mGit; 29 | QSharedPointer mCache; 30 | QStringList mShas; 31 | Ui::SquashDlg *ui; 32 | int mTitleMaxLength = 50; 33 | 34 | void updateCounter(const QString &text); 35 | bool checkMsg(QString &msg); 36 | }; 37 | -------------------------------------------------------------------------------- /src/resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundlePackageType 6 | APPL 7 | CFBundleName 8 | GitQlient 9 | CFBundleIdentifier 10 | org.gitqlient.gitqlient 11 | CFBundleExecutable 12 | GitQlient 13 | 14 | CFBundleVersion 15 | 1.6.2 16 | CFBundleShortVersionString 17 | 1.6.2 18 | 19 | LSMinimumSystemVersion 20 | 10.13 21 | 22 | CFBundleIconFile 23 | icon.icns 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/aux_widgets/PullDlg.h: -------------------------------------------------------------------------------- 1 | #ifndef PULLDLG_H 2 | #define PULLDLG_H 3 | 4 | #include 5 | 6 | namespace Ui 7 | { 8 | class PullDlg; 9 | } 10 | 11 | class GitBase; 12 | 13 | class PullDlg : public QDialog 14 | { 15 | Q_OBJECT 16 | 17 | signals: 18 | /*! 19 | \brief Signal triggered when the user manually forces a refresh of the repository data. 20 | */ 21 | void signalRepositoryUpdated(); 22 | /*! 23 | * \brief Signal triggered when trying to pull and a conflict happens. 24 | */ 25 | void signalPullConflict(); 26 | 27 | public: 28 | explicit PullDlg(QSharedPointer git, const QString &text, QWidget *parent = nullptr); 29 | ~PullDlg() override; 30 | 31 | void accept() override; 32 | 33 | private: 34 | Ui::PullDlg *ui; 35 | QSharedPointer mGit; 36 | }; 37 | 38 | #endif // PULLDLG_H 39 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ## Description 6 | 7 | 8 | ## Change Type 9 | 10 | - [ ] Bugfix 11 | - [ ] Feature 12 | - [ ] Improvement 13 | 14 | ## Reason 15 | 16 | 17 | ## Related Issue 18 | 19 | 20 | ## Tests 21 | 22 | -------------------------------------------------------------------------------- /src/resources/resources.rc: -------------------------------------------------------------------------------- 1 | IDI_ICON1 ICON DISCARDABLE resources/icons/GitQlientLogo.ico 2 | 3 | VS_VERSION_INFO VERSIONINFO 4 | FILEVERSION 1,0,0,0 5 | PRODUCTVERSION 1,0,0,0 6 | FILEFLAGSMASK 0x17L 7 | FILEFLAGS 0x0L 8 | FILEOS 0x4L 9 | FILETYPE 0x1L 10 | FILESUBTYPE 0x0L 11 | BEGIN 12 | BLOCK "StringFileInfo" 13 | BEGIN 14 | BLOCK "040304b0" 15 | BEGIN 16 | VALUE "FileDescription", "GitQilent" 17 | VALUE "FileVersion", "1.0.0.0" 18 | VALUE "InternalName", "GitQlient" 19 | VALUE "LegalCopyright", "Copyright (C) 2025 Francesc M." 20 | VALUE "OriginalFilename", "GitQlient.exe" 21 | VALUE "ProductName", "GitQlient" 22 | VALUE "ProductVersion", "1.0.0.0" 23 | END 24 | END 25 | BLOCK "VarFileInfo" 26 | BEGIN 27 | VALUE "Translation", 0x403, 1200 28 | END 29 | END 30 | -------------------------------------------------------------------------------- /src/aux_widgets/WaitingDlg.cpp: -------------------------------------------------------------------------------- 1 | #include "WaitingDlg.h" 2 | 3 | #include 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | WaitingDlg::WaitingDlg(const QString &labelText) 10 | : QDialog() 11 | { 12 | const auto layout = new QHBoxLayout(this); 13 | layout->addWidget(new QLabel(labelText)); 14 | 15 | setAttribute(Qt::WA_DeleteOnClose); 16 | setWindowModality(Qt::ApplicationModal); 17 | setWindowFlags(Qt::FramelessWindowHint); 18 | 19 | setStyleSheet(GitQlientStyles::getStyles()); 20 | } 21 | 22 | void WaitingDlg::keyPressEvent(QKeyEvent *e) 23 | { 24 | if (e->key() == Qt::Key_Escape) 25 | return; 26 | 27 | QDialog::keyPressEvent(e); 28 | } 29 | 30 | void WaitingDlg::closeEvent(QCloseEvent *e) 31 | { 32 | if (!mPrepareToClose) 33 | e->ignore(); 34 | else 35 | QDialog::closeEvent(e); 36 | } 37 | 38 | void WaitingDlg::close() 39 | { 40 | mPrepareToClose = true; 41 | 42 | QDialog::close(); 43 | } 44 | -------------------------------------------------------------------------------- /src/cache/Lane.cpp: -------------------------------------------------------------------------------- 1 | #include "Lane.h" 2 | 3 | #include 4 | 5 | Lane::Lane(LaneType type) 6 | : mType(type) 7 | { 8 | } 9 | 10 | bool Lane::isHead() const 11 | { 12 | return mType == LaneType::HEAD || mType == LaneType::HEAD_R || mType == LaneType::HEAD_L; 13 | } 14 | 15 | bool Lane::isTail() const 16 | { 17 | return mType == LaneType::TAIL || mType == LaneType::TAIL_R || mType == LaneType::TAIL_L; 18 | } 19 | 20 | bool Lane::isJoin() const 21 | { 22 | return mType == LaneType::JOIN || mType == LaneType::JOIN_R || mType == LaneType::JOIN_L; 23 | } 24 | 25 | bool Lane::isFreeLane() const 26 | { 27 | return mType == LaneType::NOT_ACTIVE || mType == LaneType::CROSS || isJoin(); 28 | } 29 | 30 | bool Lane::isMerge() const 31 | { 32 | return mType == LaneType::MERGE_FORK || mType == LaneType::MERGE_FORK_R || mType == LaneType::MERGE_FORK_L; 33 | } 34 | 35 | bool Lane::isActive() const 36 | { 37 | return mType == LaneType::ACTIVE || mType == LaneType::INITIAL || mType == LaneType::BRANCH || isMerge(); 38 | } 39 | -------------------------------------------------------------------------------- /src/aux_widgets/ProgressDlg.cpp: -------------------------------------------------------------------------------- 1 | #include "ProgressDlg.h" 2 | 3 | #include 4 | 5 | #include 6 | 7 | ProgressDlg::ProgressDlg(const QString &labelText, const QString &cancelButtonText, int maximum, bool autoClose) 8 | : QProgressDialog(labelText, cancelButtonText, 0, maximum) 9 | { 10 | setAutoClose(autoClose); 11 | setAutoReset(false); 12 | setAttribute(Qt::WA_DeleteOnClose); 13 | setWindowModality(Qt::ApplicationModal); 14 | setWindowFlags(Qt::FramelessWindowHint); 15 | 16 | setStyleSheet(GitQlientStyles::getStyles()); 17 | } 18 | 19 | void ProgressDlg::keyPressEvent(QKeyEvent *e) 20 | { 21 | const auto key = e->key(); 22 | 23 | if (key == Qt::Key_Escape) 24 | return; 25 | 26 | QProgressDialog::keyPressEvent(e); 27 | } 28 | 29 | void ProgressDlg::closeEvent(QCloseEvent *e) 30 | { 31 | if (!mPrepareToClose) 32 | e->ignore(); 33 | else 34 | QProgressDialog::closeEvent(e); 35 | } 36 | 37 | void ProgressDlg::close() 38 | { 39 | mPrepareToClose = true; 40 | 41 | QProgressDialog::close(); 42 | } 43 | -------------------------------------------------------------------------------- /src/aux_widgets/HunkWidget.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | class FileDiffView; 6 | class GitBase; 7 | class GitCache; 8 | class QTemporaryFile; 9 | 10 | class HunkWidget : public QFrame 11 | { 12 | Q_OBJECT 13 | 14 | signals: 15 | void hunkStaged(); 16 | 17 | public: 18 | explicit HunkWidget(QSharedPointer git, QSharedPointer cache, const QString &fileName, 19 | const QString &header, const QString &hunk, bool isCached = false, bool isEditable = false, 20 | QWidget *parent = nullptr); 21 | 22 | private: 23 | QSharedPointer mGit; 24 | QSharedPointer mCache; 25 | QString mFileName; 26 | QString mHeader; 27 | QString mHunk; 28 | bool mIsCached = false; 29 | FileDiffView *mHunkView = nullptr; 30 | int mLineToDiscard {}; 31 | 32 | QTemporaryFile *createPatchFile(); 33 | 34 | void discardHunk(); 35 | void stageHunk(); 36 | void stageLine(); 37 | void discardLine(); 38 | void revertLine(); 39 | 40 | void showContextMenu(const QPoint &pos); 41 | }; 42 | -------------------------------------------------------------------------------- /src/branches/Branches.pri: -------------------------------------------------------------------------------- 1 | INCLUDEPATH += $$PWD 2 | 3 | FORMS += \ 4 | $$PWD/AddSubmoduleDlg.ui \ 5 | $$PWD/AddSubtreeDlg.ui \ 6 | $$PWD/TagDlg.ui 7 | 8 | HEADERS += \ 9 | $$PWD/AddRemoteDlg.h \ 10 | $$PWD/AddSubmoduleDlg.h \ 11 | $$PWD/AddSubtreeDlg.h \ 12 | $$PWD/BranchContextMenu.h \ 13 | $$PWD/BranchTreeWidget.h \ 14 | $$PWD/BranchesViewDelegate.h \ 15 | $$PWD/BranchesWidget.h \ 16 | $$PWD/BranchesWidgetMinimal.h \ 17 | $$PWD/GitQlientBranchItemRole.h \ 18 | $$PWD/RefTreeWidget.h \ 19 | $$PWD/StashesContextMenu.h \ 20 | $$PWD/SubmodulesContextMenu.h \ 21 | $$PWD/TagDlg.h 22 | 23 | SOURCES += \ 24 | $$PWD/AddRemoteDlg.cpp \ 25 | $$PWD/AddSubmoduleDlg.cpp \ 26 | $$PWD/AddSubtreeDlg.cpp \ 27 | $$PWD/BranchContextMenu.cpp \ 28 | $$PWD/BranchTreeWidget.cpp \ 29 | $$PWD/BranchesViewDelegate.cpp \ 30 | $$PWD/BranchesWidget.cpp \ 31 | $$PWD/BranchesWidgetMinimal.cpp \ 32 | $$PWD/RefTreeWidget.cpp \ 33 | $$PWD/StashesContextMenu.cpp \ 34 | $$PWD/SubmodulesContextMenu.cpp \ 35 | $$PWD/TagDlg.cpp 36 | -------------------------------------------------------------------------------- /.github/workflows/master.yaml: -------------------------------------------------------------------------------- 1 | name: Master 2 | run-name: Latest master run 3 | 4 | on: 5 | push: 6 | branches: 7 | - master 8 | 9 | permissions: 10 | contents: write 11 | 12 | jobs: 13 | Clean: 14 | name: Clean old workflows 15 | runs-on: ubuntu-latest 16 | permissions: 17 | actions: write 18 | contents: read 19 | steps: 20 | - name: Prune previous runs 21 | uses: Mattraks/delete-workflow-runs@v2 22 | with: 23 | token: ${{ github.token }} 24 | keep_minimum_runs: 2 25 | repository: ${{ github.repository }} 26 | retain_days: 0 27 | 28 | CancelPrevious: 29 | name: Cancel previous builds 30 | runs-on: ubuntu-latest 31 | steps: 32 | - name: Cancel Previous Runs 33 | uses: styfle/cancel-workflow-action@0.12.1 34 | with: 35 | access_token: ${{ secrets.GITHUB_TOKEN }} 36 | 37 | BuildProject: 38 | name: Build 🧱 39 | uses: ./.github/workflows/build.yaml 40 | secrets: inherit 41 | permissions: 42 | actions: write 43 | contents: write 44 | -------------------------------------------------------------------------------- /src/jenkins/IJenkinsWidget.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | #define IJenkinsWidget_iid "francescmm.JenkinsPlugin/0.1.0" 10 | 11 | namespace JenkinsPlugin 12 | { 13 | struct ConfigData 14 | { 15 | QString user; 16 | QString token; 17 | QString endPoint; 18 | }; 19 | } 20 | 21 | class IJenkinsWidget : public QWidget 22 | { 23 | Q_OBJECT 24 | 25 | signals: 26 | void gotoPullRequest(int prNumber); 27 | void gotoBranch(const QString &branchName); 28 | 29 | public: 30 | virtual ~IJenkinsWidget() = default; 31 | 32 | virtual bool configure(JenkinsPlugin::ConfigData config, const QString &styles) = 0; 33 | virtual bool isConfigured() const { return mConfigured; } 34 | virtual void start() = 0; 35 | virtual void update() const = 0; 36 | virtual IJenkinsWidget *createWidget() = 0; 37 | 38 | protected: 39 | bool mConfigured = false; 40 | }; 41 | 42 | Q_DECLARE_INTERFACE(IJenkinsWidget, IJenkinsWidget_iid) 43 | 44 | JENKINSPLUGIN_EXPORT IJenkinsWidget *createWidget(); 45 | -------------------------------------------------------------------------------- /src/branches/AddSubmoduleDlg.cpp: -------------------------------------------------------------------------------- 1 | #include "AddSubmoduleDlg.h" 2 | #include "ui_AddSubmoduleDlg.h" 3 | 4 | #include 5 | #include 6 | 7 | AddSubmoduleDlg::AddSubmoduleDlg(const QSharedPointer &git, QWidget *parent) 8 | : QDialog(parent) 9 | , ui(new Ui::AddSubmoduleDlg) 10 | , mGit(git) 11 | { 12 | setStyleSheet(GitQlientStyles::getStyles()); 13 | 14 | ui->setupUi(this); 15 | 16 | connect(ui->lePath, &QLineEdit::returnPressed, this, &AddSubmoduleDlg::accept); 17 | connect(ui->leUrl, &QLineEdit::returnPressed, this, &AddSubmoduleDlg::accept); 18 | connect(ui->pbAccept, &QPushButton::clicked, this, &AddSubmoduleDlg::accept); 19 | connect(ui->pbCancel, &QPushButton::clicked, this, &QDialog::reject); 20 | } 21 | 22 | AddSubmoduleDlg::~AddSubmoduleDlg() 23 | { 24 | delete ui; 25 | } 26 | 27 | void AddSubmoduleDlg::accept() 28 | { 29 | const auto submodulePath = ui->lePath->text(); 30 | const auto submoduleUrl = ui->leUrl->text(); 31 | 32 | const auto ret = mGit->submoduleAdd(submoduleUrl, submodulePath); 33 | 34 | if (ret) 35 | QDialog::accept(); 36 | } 37 | -------------------------------------------------------------------------------- /.github/workflows/push.yaml: -------------------------------------------------------------------------------- 1 | name: Push 2 | run-name: ${{ github.ref_name }} push run 3 | 4 | on: 5 | push: 6 | tags-ignore: 7 | - '*' 8 | branches-ignore: 9 | - master 10 | branches: 11 | 12 | permissions: 13 | contents: write 14 | 15 | jobs: 16 | Clean: 17 | name: Clean old workflows 18 | runs-on: ubuntu-latest 19 | permissions: 20 | actions: write 21 | contents: read 22 | steps: 23 | - name: Prune previous runs 24 | uses: Mattraks/delete-workflow-runs@v2 25 | with: 26 | token: ${{ github.token }} 27 | keep_minimum_runs: 2 28 | repository: ${{ github.repository }} 29 | retain_days: 0 30 | 31 | CancelPrevious: 32 | name: Cancel previous builds 33 | runs-on: ubuntu-latest 34 | steps: 35 | - name: Cancel Previous Runs 36 | uses: styfle/cancel-workflow-action@0.12.1 37 | with: 38 | access_token: ${{ secrets.GITHUB_TOKEN }} 39 | 40 | BuildProject: 41 | needs: [Clean, CancelPrevious] 42 | uses: ./.github/workflows/build.yaml 43 | secrets: inherit 44 | permissions: 45 | actions: write 46 | contents: read 47 | -------------------------------------------------------------------------------- /src/diff/IDiffWidget.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | class GitBase; 6 | class GitCache; 7 | 8 | class IDiffWidget : public QFrame 9 | { 10 | Q_OBJECT 11 | signals: 12 | 13 | public: 14 | explicit IDiffWidget(const QSharedPointer &git, QSharedPointer cache, QWidget *parent = nullptr); 15 | 16 | /** 17 | * @brief Reloads the current diff in case the user loaded the work in progress as base commit. 18 | * 19 | */ 20 | virtual bool reload() = 0; 21 | 22 | /** 23 | * @brief Changes the font size (in points) for the widgets used to show the diff. 24 | */ 25 | virtual void updateFontSize() = 0; 26 | 27 | /** 28 | * @brief Gets the current SHA. 29 | * 30 | * @return QString The current SHA. 31 | */ 32 | QString getCurrentSha() const { return mCurrentSha; } 33 | /** 34 | * @brief Gets the SHA against the diff is comparing to. 35 | * 36 | * @return QString The SHA that the diff is compared to. 37 | */ 38 | QString getPreviousSha() const { return mPreviousSha; } 39 | 40 | protected: 41 | QSharedPointer mGit; 42 | QSharedPointer mCache; 43 | QString mCurrentSha; 44 | QString mPreviousSha; 45 | }; 46 | -------------------------------------------------------------------------------- /src/diff/FileDiffEditor.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | 6 | FileDiffEditor::FileDiffEditor(QWidget *parent) 7 | : FileDiffView(parent) 8 | { 9 | setReadOnly(false); 10 | 11 | addNumberArea(new LineNumberArea(this)); 12 | 13 | connect(this, &FileDiffView::cursorPositionChanged, this, &FileDiffEditor::highlightCurrentLine); 14 | 15 | highlightCurrentLine(); 16 | } 17 | 18 | void FileDiffEditor::highlightCurrentLine() 19 | { 20 | QList extraSelections; 21 | 22 | if (!isReadOnly()) 23 | { 24 | prevSelection.format.setBackground(QBrush("transparent")); 25 | prevSelection.format.setProperty(QTextFormat::FullWidthSelection, true); 26 | prevSelection.cursor.clearSelection(); 27 | 28 | QTextEdit::ExtraSelection selection; 29 | 30 | selection.format.setBackground(GitQlientStyles::getGraphSelectionColor()); 31 | selection.format.setProperty(QTextFormat::FullWidthSelection, true); 32 | selection.cursor = textCursor(); 33 | selection.cursor.clearSelection(); 34 | 35 | extraSelections.append(prevSelection); 36 | extraSelections.append(selection); 37 | 38 | prevSelection = selection; 39 | } 40 | 41 | setExtraSelections(extraSelections); 42 | 43 | viewport()->update(); 44 | } 45 | -------------------------------------------------------------------------------- /src/branches/TagDlg.cpp: -------------------------------------------------------------------------------- 1 | #include "TagDlg.h" 2 | #include "ui_TagDlg.h" 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | TagDlg::TagDlg(const QSharedPointer &git, const QString &sha, QWidget *parent) 10 | : QDialog(parent) 11 | , ui(new Ui::TagDlg) 12 | , mGit(git) 13 | , mSha(sha) 14 | { 15 | setStyleSheet(GitQlientStyles::getStyles()); 16 | 17 | ui->setupUi(this); 18 | 19 | connect(ui->leTagName, &QLineEdit::returnPressed, this, &TagDlg::accept); 20 | connect(ui->leTagMessage, &QLineEdit::returnPressed, this, &TagDlg::accept); 21 | 22 | connect(ui->pbAccept, &QPushButton::clicked, this, &TagDlg::accept); 23 | connect(ui->pbCancel, &QPushButton::clicked, this, &QDialog::reject); 24 | } 25 | 26 | TagDlg::~TagDlg() 27 | { 28 | delete ui; 29 | } 30 | 31 | void TagDlg::accept() 32 | { 33 | auto tagName = ui->leTagName->text(); 34 | auto tagMessage = ui->leTagMessage->text(); 35 | 36 | if (!tagName.isEmpty() && !tagMessage.isEmpty()) 37 | { 38 | tagName = tagName.trimmed(); 39 | tagName = tagName.replace(" ", "_"); 40 | 41 | tagMessage = tagMessage.trimmed(); 42 | 43 | QScopedPointer git(new GitTags(mGit)); 44 | auto ret = git->addTag(tagName, tagMessage, mSha); 45 | 46 | if (ret.success) 47 | QDialog::accept(); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | using namespace QLogger; 12 | 13 | int main(int argc, char *argv[]) 14 | { 15 | QApplication::setAttribute(Qt::AA_ShareOpenGLContexts); 16 | 17 | QApplication app(argc, argv); 18 | 19 | QApplication::setOrganizationName("CescSoftware"); 20 | QApplication::setOrganizationDomain("francescmm.com"); 21 | QApplication::setApplicationName("GitQlient"); 22 | QApplication::setApplicationVersion(VER); 23 | QApplication::setWindowIcon(QIcon(":/icons/GitQlientLogoIco")); 24 | 25 | QFontDatabase::addApplicationFont(":/DejaVuSans"); 26 | QFontDatabase::addApplicationFont(":/DejaVuSansMono"); 27 | 28 | const auto languageFile = GitQlientSettings().globalValue("UILanguage", "gitqlient_en").toString(); 29 | QTranslator qtTranslator; 30 | 31 | if (qtTranslator.load(languageFile, QString::fromUtf8(":/translations/"))) 32 | app.installTranslator(&qtTranslator); 33 | 34 | QStringList repos; 35 | if (GitQlient::parseArguments(app.arguments(), &repos)) 36 | { 37 | GitQlient mainWin; 38 | mainWin.setRepositories(repos); 39 | mainWin.restorePinnedRepos(); 40 | mainWin.show(); 41 | 42 | return app.exec(); 43 | } 44 | 45 | return 0; 46 | } 47 | -------------------------------------------------------------------------------- /src/aux_widgets/InputShaDlg.cpp: -------------------------------------------------------------------------------- 1 | #include "InputShaDlg.h" 2 | #include "ui_InputShaDlg.h" 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | #include 12 | #include 13 | 14 | #include 15 | 16 | InputShaDlg::InputShaDlg(const QString &branch, QSharedPointer git, QWidget *parent) 17 | : QDialog(parent) 18 | , ui(new Ui::InputShaDlg) 19 | , mGit(git) 20 | , mBranch(branch) 21 | { 22 | setStyleSheet(GitQlientStyles::getStyles()); 23 | 24 | ui->setupUi(this); 25 | 26 | connect(ui->pbAccept, &QPushButton::clicked, this, &InputShaDlg::accept); 27 | connect(ui->pbCancel, &QPushButton::clicked, this, &InputShaDlg::reject); 28 | } 29 | 30 | InputShaDlg::~InputShaDlg() 31 | { 32 | delete ui; 33 | } 34 | 35 | void InputShaDlg::accept() 36 | { 37 | if (!ui->leSha->text().isEmpty()) 38 | { 39 | QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); 40 | QScopedPointer git(new GitBranches(mGit)); 41 | const auto ret = git->resetToSha(mBranch, ui->leSha->text()); 42 | QApplication::restoreOverrideCursor(); 43 | 44 | if (ret.success) 45 | QDialog::accept(); 46 | else 47 | QMessageBox::critical(this, tr("Reset failed"), 48 | tr("There were some problems while fetching. Please try again.")); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/commits/GitQlientRole.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /**************************************************************************************** 4 | ** GitQlient is an application to manage and operate one or several Git repositories. With 5 | ** GitQlient you will be able to add commits, branches and manage all the options Git provides. 6 | ** Copyright (C) 2021 Francesc Martinez 7 | ** 8 | ** LinkedIn: www.linkedin.com/in/cescmm/ 9 | ** Web: www.francescmm.com 10 | ** 11 | ** This program is free software; you can redistribute it and/or 12 | ** modify it under the terms of the GNU Lesser General Public 13 | ** License as published by the Free Software Foundation; either 14 | ** version 2 of the License, or (at your option) any later version. 15 | ** 16 | ** This program is distributed in the hope that it will be useful, 17 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 | ** Lesser General Public License for more details. 20 | ** 21 | ** You should have received a copy of the GNU Lesser General Public 22 | ** License along with this library; if not, write to the Free Software 23 | ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 24 | ***************************************************************************************/ 25 | 26 | #include 27 | 28 | enum GitQlientRole 29 | { 30 | U_ListRole = Qt::UserRole, 31 | U_IsConflict, 32 | U_Name 33 | }; 34 | -------------------------------------------------------------------------------- /src/commits/FileWidget.cpp: -------------------------------------------------------------------------------- 1 | #include "FileWidget.h" 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | FileWidget::FileWidget(const QIcon &icon, const QString &text, QWidget *parent) 8 | : QFrame(parent) 9 | , mButton(new QPushButton(icon, "")) 10 | , mText(new QLabel(text)) 11 | { 12 | const auto itemLayout = new QHBoxLayout(this); 13 | itemLayout->setContentsMargins(QMargins()); 14 | mButton->setStyleSheet("max-width: 15px; min-width: 15px; max-height: 15px; min-height: 15px;"); 15 | 16 | itemLayout->addWidget(mButton); 17 | itemLayout->addWidget(mText); 18 | 19 | if (!icon.isNull()) 20 | connect(mButton, &QPushButton::clicked, this, &FileWidget::clicked); 21 | } 22 | 23 | FileWidget::FileWidget(const QString &icon, const QString &text, QWidget *parent) 24 | : FileWidget(QIcon(icon), text, parent) 25 | { 26 | } 27 | 28 | void FileWidget::setIcon(const QString &icon) 29 | { 30 | mButton->setIcon(QIcon(icon)); 31 | } 32 | 33 | QString FileWidget::text() const 34 | { 35 | return mText->text(); 36 | } 37 | 38 | void FileWidget::setText(const QString &text) 39 | { 40 | mText->setText(text); 41 | } 42 | 43 | QSize FileWidget::sizeHint() const 44 | { 45 | auto size = QFrame::sizeHint(); 46 | size.setWidth(size.width() + layout()->spacing()); 47 | 48 | return size; 49 | } 50 | 51 | void FileWidget::setTextColor(const QColor &color) 52 | { 53 | mColor = color; 54 | mText->setStyleSheet(QString("color: %1").arg(mColor.name())); 55 | } 56 | -------------------------------------------------------------------------------- /docs/_layouts/default.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | {% seo %} 8 | 9 | 10 | 11 | 12 | 15 | 16 | 17 |
18 | {% include sidebar.html %} 19 | 20 |
21 | {{ content }} 22 |
23 | 24 |
25 |
26 |
27 | 28 | {% if site.google_analytics %} 29 | 37 | {% endif %} 38 | 39 | 40 | -------------------------------------------------------------------------------- /src/branches/GitQlientBranchItemRole.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /**************************************************************************************** 4 | ** GitQlient is an application to manage and operate one or several Git repositories. With 5 | ** GitQlient you will be able to add commits, branches and manage all the options Git provides. 6 | ** Copyright (C) 2021 Francesc Martinez 7 | ** 8 | ** LinkedIn: www.linkedin.com/in/cescmm/ 9 | ** Web: www.francescmm.com 10 | ** 11 | ** This program is free software; you can redistribute it and/or 12 | ** modify it under the terms of the GNU Lesser General Public 13 | ** License as published by the Free Software Foundation; either 14 | ** version 2 of the License, or (at your option) any later version. 15 | ** 16 | ** This program is distributed in the hope that it will be useful, 17 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 | ** Lesser General Public License for more details. 20 | ** 21 | ** You should have received a copy of the GNU Lesser General Public 22 | ** License along with this library; if not, write to the Free Software 23 | ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 24 | ***************************************************************************************/ 25 | 26 | #include 27 | 28 | namespace GitQlient 29 | { 30 | enum GitQlientBranchItemRole 31 | { 32 | IsCurrentBranchRole = Qt::UserRole, 33 | FullNameRole, 34 | LocalBranchRole, 35 | ShaRole, 36 | IsLeaf, 37 | IsRoot 38 | }; 39 | } 40 | -------------------------------------------------------------------------------- /src/git_server/ConfigData.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /**************************************************************************************** 4 | ** GitQlient is an application to manage and operate one or several Git repositories. With 5 | ** GitQlient you will be able to add commits, branches and manage all the options Git provides. 6 | ** Copyright (C) 2021 Francesc Martinez 7 | ** 8 | ** LinkedIn: www.linkedin.com/in/cescmm/ 9 | ** Web: www.francescmm.com 10 | ** 11 | ** This program is free software; you can redistribute it and/or 12 | ** modify it under the terms of the GNU Lesser General Public 13 | ** License as published by the Free Software Foundation; either 14 | ** version 2 of the License, or (at your option) any later version. 15 | ** 16 | ** This program is distributed in the hope that it will be useful, 17 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 | ** Lesser General Public License for more details. 20 | ** 21 | ** You should have received a copy of the GNU Lesser General Public 22 | ** License along with this library; if not, write to the Free Software 23 | ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 24 | ***************************************************************************************/ 25 | 26 | #include 27 | #include 28 | 29 | namespace GitServerPlugin 30 | { 31 | struct ConfigData 32 | { 33 | QString user; 34 | QString token; 35 | QString serverUrl; 36 | QString endPoint; 37 | QString repoName; 38 | QString repoOwner; 39 | }; 40 | } 41 | -------------------------------------------------------------------------------- /src/aux_widgets/AuxiliarWidgets.pri: -------------------------------------------------------------------------------- 1 | INCLUDEPATH += $$PWD 2 | 3 | FORMS += \ 4 | $$PWD/BranchDlg.ui \ 5 | $$PWD/CreateRepoDlg.ui \ 6 | $$PWD/CredentialsDlg.ui \ 7 | $$PWD/InitialRepoConfig.ui \ 8 | $$PWD/InputShaDlg.ui \ 9 | $$PWD/PomodoroConfigDlg.ui \ 10 | $$PWD/PullDlg.ui \ 11 | $$PWD/SquashDlg.ui \ 12 | $$PWD/NewVersionInfoDlg.ui 13 | 14 | HEADERS += \ 15 | $$PWD/BranchDlg.h \ 16 | $$PWD/CommitInfoPanel.h \ 17 | $$PWD/ConflictButton.h \ 18 | $$PWD/CreateRepoDlg.h \ 19 | $$PWD/CredentialsDlg.h \ 20 | $$PWD/GitQlientUpdater.h \ 21 | $$PWD/Highlighter.h \ 22 | $$PWD/HunkWidget.h \ 23 | $$PWD/InitialRepoConfig.h \ 24 | $$PWD/InputShaDlg.h \ 25 | $$PWD/PluginsDownloader.h \ 26 | $$PWD/PomodoroButton.h \ 27 | $$PWD/PomodoroConfigDlg.h \ 28 | $$PWD/ProgressDlg.h \ 29 | $$PWD/PullDlg.h \ 30 | $$PWD/SquashDlg.h \ 31 | $$PWD/UpstreamDlg.h \ 32 | $$PWD/WaitingDlg.h \ 33 | $$PWD/NewVersionInfoDlg.h 34 | 35 | SOURCES += \ 36 | $$PWD/BranchDlg.cpp \ 37 | $$PWD/CommitInfoPanel.cpp \ 38 | $$PWD/ConflictButton.cpp \ 39 | $$PWD/CreateRepoDlg.cpp \ 40 | $$PWD/CredentialsDlg.cpp \ 41 | $$PWD/GitQlientUpdater.cpp \ 42 | $$PWD/Highlighter.cpp \ 43 | $$PWD/HunkWidget.cpp \ 44 | $$PWD/InitialRepoConfig.cpp \ 45 | $$PWD/InputShaDlg.cpp \ 46 | $$PWD/PluginsDownloader.cpp \ 47 | $$PWD/PomodoroButton.cpp \ 48 | $$PWD/PomodoroConfigDlg.cpp \ 49 | $$PWD/ProgressDlg.cpp \ 50 | $$PWD/PullDlg.cpp \ 51 | $$PWD/SquashDlg.cpp \ 52 | $$PWD/UpstreamDlg.cpp \ 53 | $$PWD/WaitingDlg.cpp \ 54 | $$PWD/NewVersionInfoDlg.cpp 55 | -------------------------------------------------------------------------------- /src/branches/BranchesWidgetMinimal.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | class GitCache; 6 | class GitBase; 7 | class QPushButton; 8 | class QToolButton; 9 | class QMenu; 10 | 11 | class BranchesWidgetMinimal : public QFrame 12 | { 13 | Q_OBJECT 14 | signals: 15 | void showFullBranchesView(); 16 | void commitSelected(const QString &sha); 17 | void stashSelected(const QString &stashId); 18 | 19 | public: 20 | explicit BranchesWidgetMinimal(const QSharedPointer &cache, const QSharedPointer git, 21 | QWidget *parent = nullptr); 22 | 23 | void configureLocalMenu(const QString &sha, const QString &branch); 24 | void configureRemoteMenu(const QString &sha, const QString &branch); 25 | void configureTagsMenu(const QString &sha, const QString &tag); 26 | void configureStashesMenu(const QString &stashId, const QString &name); 27 | void configureSubmodulesMenu(const QString &name); 28 | 29 | void clearActions(); 30 | 31 | private: 32 | QSharedPointer mGit; 33 | QSharedPointer mCache; 34 | QPushButton *mBack = nullptr; 35 | QToolButton *mLocal = nullptr; 36 | QMenu *mLocalMenu = nullptr; 37 | QToolButton *mRemote = nullptr; 38 | QMenu *mRemoteMenu = nullptr; 39 | QToolButton *mTags = nullptr; 40 | QMenu *mTagsMenu = nullptr; 41 | QToolButton *mStashes = nullptr; 42 | QMenu *mStashesMenu = nullptr; 43 | QToolButton *mSubmodules = nullptr; 44 | QMenu *mSubmodulesMenu = nullptr; 45 | QMenu *mCurrentMenuShown = nullptr; 46 | 47 | bool eventFilter(QObject *obj, QEvent *event); 48 | void addActionToMenu(const QString &sha, const QString &name, QMenu *menu); 49 | }; 50 | -------------------------------------------------------------------------------- /src/commits/FileListDelegate.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /**************************************************************************************** 4 | ** GitQlient is an application to manage and operate one or several Git repositories. With 5 | ** GitQlient you will be able to add commits, branches and manage all the options Git provides. 6 | ** Copyright (C) 2021 Francesc Martinez 7 | ** 8 | ** LinkedIn: www.linkedin.com/in/cescmm/ 9 | ** Web: www.francescmm.com 10 | ** 11 | ** This program is free software; you can redistribute it and/or 12 | ** modify it under the terms of the GNU Lesser General Public 13 | ** License as published by the Free Software Foundation; either 14 | ** version 2 of the License, or (at your option) any later version. 15 | ** 16 | ** This program is distributed in the hope that it will be useful, 17 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 | ** Lesser General Public License for more details. 20 | ** 21 | ** You should have received a copy of the GNU Lesser General Public 22 | ** License along with this library; if not, write to the Free Software 23 | ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 24 | ***************************************************************************************/ 25 | 26 | #include 27 | 28 | class FileListDelegate : public QItemDelegate 29 | { 30 | public: 31 | explicit FileListDelegate(QObject *parent = nullptr); 32 | 33 | void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override; 34 | 35 | QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override; 36 | }; 37 | -------------------------------------------------------------------------------- /src/commits/FileListDelegate.cpp: -------------------------------------------------------------------------------- 1 | #include "FileListDelegate.h" 2 | 3 | #include 4 | 5 | #include 6 | 7 | constexpr auto Offset = 10; 8 | constexpr auto DefaultHeight = 30.0; 9 | constexpr auto HeightIncrement = 15.0; 10 | 11 | FileListDelegate::FileListDelegate(QObject *parent) 12 | : QItemDelegate(parent) 13 | { 14 | } 15 | 16 | void FileListDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const 17 | { 18 | painter->save(); 19 | 20 | if (option.state & QStyle::State_Selected) 21 | painter->fillRect(option.rect, GitQlientStyles::getGraphSelectionColor()); 22 | else if (option.state & QStyle::State_MouseOver) 23 | painter->fillRect(option.rect, GitQlientStyles::getGraphHoverColor()); 24 | 25 | painter->setPen(qvariant_cast(index.data(Qt::ForegroundRole))); 26 | 27 | auto newOpt = option; 28 | newOpt.rect.setX(newOpt.rect.x() + Offset); 29 | 30 | painter->drawText(newOpt.rect, index.data().toString(), QTextOption(Qt::AlignLeft | Qt::AlignVCenter)); 31 | 32 | painter->restore(); 33 | } 34 | 35 | QSize FileListDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const 36 | { 37 | auto rect = option.rect; 38 | rect.setWidth(rect.width() - Offset); 39 | 40 | const auto text = index.model()->data(index, Qt::DisplayRole).toString(); 41 | QFontMetrics fm(option.font); 42 | QRect neededsize = fm.boundingRect(rect, Qt::TextWordWrap, text); 43 | 44 | if (neededsize.height() < DefaultHeight) 45 | neededsize.setHeight(DefaultHeight); 46 | else 47 | neededsize.setHeight((neededsize.height() / DefaultHeight) * HeightIncrement + DefaultHeight); 48 | 49 | return QSize(option.rect.width(), neededsize.height()); 50 | } 51 | -------------------------------------------------------------------------------- /src/aux_widgets/UpstreamDlg.cpp: -------------------------------------------------------------------------------- 1 | #include "UpstreamDlg.h" 2 | #include "ui_PullDlg.h" 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | 11 | UpstreamDlg::UpstreamDlg(QSharedPointer git, const QString &text, QWidget *parent) 12 | : QDialog(parent) 13 | , ui(new Ui::PullDlg) 14 | , mGit(git) 15 | { 16 | ui->setupUi(this); 17 | 18 | ui->lText->setText(text); 19 | ui->lQuestion->setText(tr("Would you like to reconfigure the upstream and push the branch?")); 20 | 21 | setStyleSheet(GitQlientStyles::getStyles()); 22 | } 23 | 24 | UpstreamDlg::~UpstreamDlg() 25 | { 26 | delete ui; 27 | } 28 | 29 | void UpstreamDlg::accept() 30 | { 31 | QScopedPointer git(new GitBranches(mGit)); 32 | 33 | QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); 34 | const auto ret = git->unsetUpstream(); 35 | QApplication::restoreOverrideCursor(); 36 | 37 | if (ret.success) 38 | { 39 | QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); 40 | const auto ret = git->pushUpstream(mGit->getCurrentBranch(), "origin", mGit->getCurrentBranch()); 41 | QApplication::restoreOverrideCursor(); 42 | 43 | QDialog::accept(); 44 | } 45 | else 46 | { 47 | QMessageBox msgBox(QMessageBox::Critical, tr("Error while pulling"), 48 | QString(tr("There were problems during the pull operation. Please, see the detailed " 49 | "description for more information.")), 50 | QMessageBox::Ok, this); 51 | msgBox.setDetailedText(ret.output); 52 | msgBox.setStyleSheet(GitQlientStyles::getStyles()); 53 | msgBox.exec(); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/aux_widgets/CredentialsDlg.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /**************************************************************************************** 4 | ** GitQlient is an application to manage and operate one or several Git repositories. With 5 | ** GitQlient you will be able to add commits, branches and manage all the options Git provides. 6 | ** Copyright (C) 2021 Francesc Martinez 7 | ** 8 | ** LinkedIn: www.linkedin.com/in/cescmm/ 9 | ** Web: www.francescmm.com 10 | ** 11 | ** This library is free software; you can redistribute it and/or 12 | ** modify it under the terms of the GNU Lesser General Public 13 | ** License as published by the Free Software Foundation; either 14 | ** version 2 of the License, or (at your option) any later version. 15 | ** 16 | ** This program is distributed in the hope that it will be useful, 17 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 | ** Lesser General Public License for more details. 20 | ** 21 | ** You should have received a copy of the GNU Lesser General Public 22 | ** License along with this library; if not, write to the Free Software 23 | ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 24 | ***************************************************************************************/ 25 | 26 | #include 27 | 28 | namespace Ui 29 | { 30 | class CredentialsDlg; 31 | } 32 | 33 | class GitBase; 34 | 35 | class CredentialsDlg : public QDialog 36 | { 37 | Q_OBJECT 38 | 39 | public: 40 | explicit CredentialsDlg(const QSharedPointer &git, QWidget *parent = nullptr); 41 | ~CredentialsDlg(); 42 | 43 | void accept() override; 44 | 45 | private: 46 | Ui::CredentialsDlg *ui; 47 | QSharedPointer mGit; 48 | }; 49 | -------------------------------------------------------------------------------- /docs/dist/changes-1.0.0.md: -------------------------------------------------------------------------------- 1 | The GitQlient 1.0.0 release contains a deep refactor and new features. 2 | 3 | A more detailed list of changes follows below. 4 | 5 | Big features: 6 | - **Multi-repository support**: Added support to have multiple repositories opened at the same time. 7 | - **Submodules**: Added support for opening, adding and updating the submodules in a repository. The submodules can be opened as a normal repository to work with them. 8 | - **Blame & History**: There is a whole new screen where one can review the history of a file and blame it. 9 | 10 | Minor features: 11 | - **Branches**: The branches are shown in a tree structure, more easy to follow. 12 | - **Diffs**: Between files, between random commits, etc. 13 | - **Patches**: I took back the patches but with some improvements: Multi-selection of commits to export them. Possibility of applying patches or import them. 14 | - **Cloning/Init repositories**: Progress dialogs when cloning or opening really big repos. 15 | - **Refactor**: The old backend has been reworked in a 97%. There are some pending changes that will be done on the v2.0.0. 16 | 17 | Other technical improvements from the version available in GitQlientPlugin v1.0.0: 18 | - Re-organization of the project structure for a more intuitive architecture 19 | - Controls: 20 | - Main view buttons display the current view. 21 | - Added Diff as option 22 | - Repository view re-structure (aka HistoryWidget): 23 | - "Go to SHA" featured integrated in the repository view 24 | - Blame improvements: 25 | - Adding tabs to have several blames and improving navigation between the commit history and the blames 26 | - New Diff view: 27 | - Adding options to switch between different diffs (buttons list) 28 | - Added information about the commits that are compared and the files that are modified 29 | - Added option to reset staged files 30 | -------------------------------------------------------------------------------- /src/diff/FileDiffEditor.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /**************************************************************************************** 4 | ** GitQlient is an application to manage and operate one or several Git repositories. With 5 | ** GitQlient you will be able to add commits, branches and manage all the options Git provides. 6 | ** Copyright (C) 2021 Francesc Martinez 7 | ** 8 | ** LinkedIn: www.linkedin.com/in/cescmm/ 9 | ** Web: www.francescmm.com 10 | ** 11 | ** This program is free software; you can redistribute it and/or 12 | ** modify it under the terms of the GNU Lesser General Public 13 | ** License as published by the Free Software Foundation; either 14 | ** version 2 of the License, or (at your option) any later version. 15 | ** 16 | ** This program is distributed in the hope that it will be useful, 17 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 | ** Lesser General Public License for more details. 20 | ** 21 | ** You should have received a copy of the GNU Lesser General Public 22 | ** License along with this library; if not, write to the Free Software 23 | ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 24 | ***************************************************************************************/ 25 | 26 | #include 27 | 28 | class FileDiffEditor : public FileDiffView 29 | { 30 | public: 31 | /** 32 | * @brief FileDiffEditor Default constructor 33 | * @param parent The parent widget 34 | */ 35 | explicit FileDiffEditor(QWidget *parent = nullptr); 36 | 37 | private: 38 | /** 39 | * @brief highlightCurrentLine Highlights the current line where the cursor is placed. 40 | */ 41 | void highlightCurrentLine(); 42 | 43 | QTextEdit::ExtraSelection prevSelection; 44 | }; 45 | -------------------------------------------------------------------------------- /src/GitQlient.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | resources/icons/GitQlientLogoMedium.png 4 | resources/icons/GitQlientLogoLarge.png 5 | resources/icons/GitQlientLogo32.png 6 | resources/icons/GitQlientLogo.svg 7 | resources/icons/GitQlientLogo.ico 8 | 9 | 10 | resources/stylesheet.css 11 | resources/stylesheet_colors_bright.css 12 | resources/stylesheet_colors_dark.css 13 | resources/DejaVuSans.ttf 14 | resources/DejaVuSansMono.ttf 15 | resources/font_sizes.css 16 | 17 | 18 | resources/translations/gitqlient_en.qm 19 | resources/translations/gitqlient_en.ts 20 | resources/translations/gitqlient_zh_CN.qm 21 | resources/translations/gitqlient_zh_CN.ts 22 | 23 | 24 | resources/images/hunkPage.png 25 | resources/images/pluginsPage.png 26 | resources/images/terminalPage01.png 27 | resources/images/branchesPage.png 28 | resources/images/shortcutsPage.png 29 | 30 | 31 | -------------------------------------------------------------------------------- /.github/workflows/build_mac.yaml: -------------------------------------------------------------------------------- 1 | name: Build 2 | on: 3 | workflow_call: 4 | 5 | jobs: 6 | MacOS: 7 | name: ${{ matrix.env.name }} 8 | runs-on: ${{ matrix.env.os }} 9 | strategy: 10 | matrix: 11 | env: 12 | - name: MacOS 13 | os: macos-latest 14 | qtplatform: mac 15 | steps: 16 | - name: Checking out the code 17 | uses: actions/checkout@v4 18 | with: 19 | submodules: 'true' 20 | fetch-depth: 0 21 | 22 | - name: Installing Qt 23 | uses: jurplel/install-qt-action@v3 24 | env: 25 | ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true' 26 | timeout-minutes: 10 27 | with: 28 | version: 6.6.* 29 | target: desktop 30 | host: mac 31 | install-deps: true 32 | aqtversion: '==3.1.*' 33 | 34 | - name: Installing dependencies 35 | id: vars 36 | run: | 37 | brew install glew 38 | brew install create-dmg 39 | brew uninstall --force --ignore-dependencies java 40 | 41 | - name: Generate project 42 | run: | 43 | cmake -S . -B build -G "Ninja" -DVERSION="`git describe --always`" -DCMAKE_BUILD_TYPE=Release 44 | 45 | - name: Compile and deploy 46 | run: | 47 | cmake --build build --target GitQlient -j4 48 | 49 | - name: Build DMG 50 | run: | 51 | macdeployqt build/*.app 52 | /opt/homebrew/bin/create-dmg --volname "GitQlient" --volicon "src/resources/icon.icns" --background "src/resources/dmg_bg.png" --icon "GitQlient.app" 125 220 --icon-size 100 --window-size 600 450 --app-drop-link 475 220 "GitQlient-`git describe --always`-arm64.dmg" "build/GitQlient.app" 53 | 54 | - name: Upload DMG 55 | uses: actions/upload-artifact@v4 56 | with: 57 | name: macos 58 | path: GitQlient-*.dmg 59 | -------------------------------------------------------------------------------- /src/branches/RefTreeWidget.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | 5 | #include 6 | 7 | using namespace GitQlient; 8 | 9 | RefTreeWidget::RefTreeWidget(QWidget *parent) 10 | : QTreeWidget(parent) 11 | 12 | { 13 | setContextMenuPolicy(Qt::CustomContextMenu); 14 | setAttribute(Qt::WA_DeleteOnClose); 15 | header()->setHidden(true); 16 | } 17 | 18 | int RefTreeWidget::focusOnBranch(const QString &itemText, int startSearchPos) 19 | { 20 | const auto items = findChildItem(itemText); 21 | 22 | if (startSearchPos + 1 >= items.count()) 23 | return -1; 24 | 25 | if (startSearchPos != -1) 26 | { 27 | auto itemToUnselect = items.at(startSearchPos); 28 | itemToUnselect->setSelected(false); 29 | } 30 | 31 | ++startSearchPos; 32 | 33 | auto itemToExpand = items.at(startSearchPos); 34 | 35 | if (itemToExpand->isSelected()) 36 | return -1; 37 | 38 | itemToExpand->setExpanded(true); 39 | setCurrentItem(itemToExpand); 40 | setCurrentIndex(indexFromItem(itemToExpand)); 41 | 42 | while (itemToExpand->parent()) 43 | { 44 | itemToExpand->setExpanded(true); 45 | itemToExpand = itemToExpand->parent(); 46 | } 47 | 48 | itemToExpand->setExpanded(true); 49 | 50 | return startSearchPos; 51 | } 52 | 53 | QVector RefTreeWidget::findChildItem(const QString &text) const 54 | { 55 | QModelIndexList indexes = model()->match(model()->index(0, 0, QModelIndex()), GitQlient::FullNameRole, text, -1, 56 | Qt::MatchContains | Qt::MatchRecursive); 57 | QVector items; 58 | const int indexesSize = indexes.size(); 59 | items.reserve(indexesSize); 60 | 61 | for (int i = 0; i < indexesSize; ++i) 62 | items.append(static_cast(indexes.at(i).internalPointer())); 63 | 64 | return items; 65 | } 66 | -------------------------------------------------------------------------------- /src/cache/WipHelper.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /**************************************************************************************** 4 | ** GitQlient is an application to manage and operate one or several Git repositories. With 5 | ** GitQlient you will be able to add commits, branches and manage all the options Git provides. 6 | ** Copyright (C) 2022 Francesc Martinez 7 | ** 8 | ** LinkedIn: www.linkedin.com/in/cescmm/ 9 | ** Web: www.francescmm.com 10 | ** 11 | ** This program is free software; you can redistribute it and/or 12 | ** modify it under the terms of the GNU Lesser General Public 13 | ** License as published by the Free Software Foundation; either 14 | ** version 2 of the License, or (at your option) any later version. 15 | ** 16 | ** This program is distributed in the hope that it will be useful, 17 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 | ** Lesser General Public License for more details. 20 | ** 21 | ** You should have received a copy of the GNU Lesser General Public 22 | ** License along with this library; if not, write to the Free Software 23 | ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 24 | ***************************************************************************************/ 25 | 26 | #include 27 | #include 28 | #include 29 | 30 | #include 31 | 32 | namespace WipHelper 33 | { 34 | inline bool update(const QSharedPointer &git, const QSharedPointer cache) 35 | { 36 | GitWip wip(git); 37 | 38 | const auto files = wip.getUntrackedFiles(); 39 | cache->setUntrackedFilesList(std::move(files)); 40 | 41 | if (const auto info = wip.getWipInfo(); info->second.isValid()) 42 | return cache->updateWipCommit(info->first, info->second); 43 | 44 | return false; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/cache/Lane.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /**************************************************************************************** 4 | ** GitQlient is an application to manage and operate one or several Git repositories. With 5 | ** GitQlient you will be able to add commits, branches and manage all the options Git provides. 6 | ** Copyright (C) 2021 Francesc Martinez 7 | ** 8 | ** LinkedIn: www.linkedin.com/in/cescmm/ 9 | ** Web: www.francescmm.com 10 | ** 11 | ** This program is free software; you can redistribute it and/or 12 | ** modify it under the terms of the GNU Lesser General Public 13 | ** License as published by the Free Software Foundation; either 14 | ** version 2 of the License, or (at your option) any later version. 15 | ** 16 | ** This program is distributed in the hope that it will be useful, 17 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 | ** Lesser General Public License for more details. 20 | ** 21 | ** You should have received a copy of the GNU Lesser General Public 22 | ** License along with this library; if not, write to the Free Software 23 | ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 24 | ***************************************************************************************/ 25 | 26 | enum class LaneType; 27 | 28 | class Lane 29 | { 30 | public: 31 | Lane() = default; 32 | Lane(LaneType type); 33 | 34 | bool operator==(const Lane &lane) const { return mType == lane.mType; } 35 | 36 | bool isHead() const; 37 | bool isTail() const; 38 | bool isJoin() const; 39 | bool isFreeLane() const; 40 | bool isMerge() const; 41 | bool isActive() const; 42 | bool equals(LaneType type) const { return mType == type; } 43 | 44 | LaneType getType() const { return mType; } 45 | void setType(LaneType type) { mType = type; } 46 | 47 | private: 48 | LaneType mType; 49 | }; 50 | -------------------------------------------------------------------------------- /src/cache/References.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /**************************************************************************************** 4 | ** GitQlient is an application to manage and operate one or several Git repositories. With 5 | ** GitQlient you will be able to add commits, branches and manage all the options Git provides. 6 | ** Copyright (C) 2021 Francesc Martinez 7 | ** 8 | ** LinkedIn: www.linkedin.com/in/cescmm/ 9 | ** Web: www.francescmm.com 10 | ** 11 | ** This program is free software; you can redistribute it and/or 12 | ** modify it under the terms of the GNU Lesser General Public 13 | ** License as published by the Free Software Foundation; either 14 | ** version 2 of the License, or (at your option) any later version. 15 | ** 16 | ** This program is distributed in the hope that it will be useful, 17 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 | ** Lesser General Public License for more details. 20 | ** 21 | ** You should have received a copy of the GNU Lesser General Public 22 | ** License along with this library; if not, write to the Free Software 23 | ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 24 | ***************************************************************************************/ 25 | 26 | #include 27 | #include 28 | 29 | class References 30 | { 31 | public: 32 | enum class Type 33 | { 34 | LocalTag, 35 | RemoteTag, 36 | LocalBranch, 37 | RemoteBranches, 38 | }; 39 | 40 | void addReference(Type type, const QString &value); 41 | 42 | QStringList getReferences(Type type) const; 43 | 44 | int removeReference(Type type, const QString &value); 45 | 46 | bool isEmpty() const { return mReferences.isEmpty(); } 47 | 48 | void clear() { mReferences.clear(); } 49 | 50 | private: 51 | QMap mReferences; 52 | }; 53 | -------------------------------------------------------------------------------- /src/commits/AmendWidget.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /**************************************************************************************** 4 | ** GitQlient is an application to manage and operate one or several Git repositories. With 5 | ** GitQlient you will be able to add commits, branches and manage all the options Git provides. 6 | ** Copyright (C) 2021 Francesc Martinez 7 | ** 8 | ** LinkedIn: www.linkedin.com/in/cescmm/ 9 | ** Web: www.francescmm.com 10 | ** 11 | ** This program is free software; you can redistribute it and/or 12 | ** modify it under the terms of the GNU Lesser General Public 13 | ** License as published by the Free Software Foundation; either 14 | ** version 2 of the License, or (at your option) any later version. 15 | ** 16 | ** This program is distributed in the hope that it will be useful, 17 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 | ** Lesser General Public License for more details. 20 | ** 21 | ** You should have received a copy of the GNU Lesser General Public 22 | ** License along with this library; if not, write to the Free Software 23 | ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 24 | ***************************************************************************************/ 25 | 26 | #include 27 | 28 | namespace Ui 29 | { 30 | class CommitChangesWidget; 31 | } 32 | 33 | class AmendWidget : public CommitChangesWidget 34 | { 35 | Q_OBJECT 36 | 37 | public: 38 | explicit AmendWidget(const QSharedPointer &cache, const QSharedPointer &git, 39 | QWidget *parent = nullptr); 40 | 41 | ~AmendWidget() = default; 42 | 43 | void configure(const QString &sha) override; 44 | 45 | private: 46 | void commitChanges() override; 47 | 48 | static QString lastMsgBeforeError; 49 | static const int kMaxTitleChars; 50 | }; 51 | -------------------------------------------------------------------------------- /src/history/CommitHistoryColumns.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /**************************************************************************************** 4 | ** GitQlient is an application to manage and operate one or several Git repositories. With 5 | ** GitQlient you will be able to add commits, branches and manage all the options Git provides. 6 | ** Copyright (C) 2021 Francesc Martinez 7 | ** 8 | ** LinkedIn: www.linkedin.com/in/cescmm/ 9 | ** Web: www.francescmm.com 10 | ** 11 | ** This program is free software; you can redistribute it and/or 12 | ** modify it under the terms of the GNU Lesser General Public 13 | ** License as published by the Free Software Foundation; either 14 | ** version 2 of the License, or (at your option) any later version. 15 | ** 16 | ** This program is distributed in the hope that it will be useful, 17 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 | ** Lesser General Public License for more details. 20 | ** 21 | ** You should have received a copy of the GNU Lesser General Public 22 | ** License along with this library; if not, write to the Free Software 23 | ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 24 | ***************************************************************************************/ 25 | 26 | /** 27 | * @brief The CommitHistoryColumns enum configures the columns and its order in the CommitHistoryView. 28 | * 29 | * It defines the first column as TreeViewIcon since this column is used in a QTreeView to show the tree indicator. It's 30 | * not used by the CommitHistoryView since the graph is not shown as a tree. 31 | * 32 | * The main reason it's using a QTreeView is because the better custom styles management it does compared to QTableView. 33 | */ 34 | enum class CommitHistoryColumns 35 | { 36 | TreeViewIcon, 37 | Graph, 38 | Log, 39 | Author, 40 | Date, 41 | Sha 42 | }; 43 | -------------------------------------------------------------------------------- /src/branches/TagDlg.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | TagDlg 4 | 5 | 6 | 7 | 0 8 | 0 9 | 363 10 | 102 11 | 12 | 13 | 14 | Create tag 15 | 16 | 17 | 18 | 19 | 20 | Tag name 21 | 22 | 23 | 24 | 25 | 26 | 27 | Tag message 28 | 29 | 30 | 31 | 32 | 33 | 34 | Cancel 35 | 36 | 37 | 38 | 39 | 40 | 41 | Qt::Horizontal 42 | 43 | 44 | 45 | 170 46 | 20 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | Accept 55 | 56 | 57 | 58 | 59 | 60 | 61 | leTagName 62 | leTagMessage 63 | pbAccept 64 | pbCancel 65 | 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /docs/_includes/sidebar.html: -------------------------------------------------------------------------------- 1 |
2 |

{{ site.title | default: site.github.repository_name }}

3 |

{{ site.description | default: site.github.project_tagline }}

4 |
    5 |
  1. Home
  2. 6 |
  3. Initial screen
  4. 7 |
  5. Quick access actions
  6. 8 |
  7. The Tree view
  8. 9 |
  9. The Diff view
  10. 10 |
  11. The Blame & History view
  12. 11 |
  13. The Merge view
  14. 12 |
  15. Appendix A: Releases
  16. 13 |
  17. Appendix B: Build
  18. 14 |
  19. Appendix C: Contributing
  20. 15 |
  21. Appendix D: Recognition
  22. 16 |
  23. Appendix E: License
  24. 17 |
18 | 19 |

Go to the repo

20 | {% if site.github.is_project_page %} 21 |

GitQlient is maintained by {{ site.github.owner_name }}

22 | {% endif %} 23 | {% if site.github.is_user_page %} 24 | 27 | {% endif %} 28 |
29 | -------------------------------------------------------------------------------- /src/branches/AddSubmoduleDlg.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | AddSubmoduleDlg 4 | 5 | 6 | 7 | 0 8 | 0 9 | 363 10 | 105 11 | 12 | 13 | 14 | Add new submodule 15 | 16 | 17 | 18 | 19 | 20 | Set URL 21 | 22 | 23 | 24 | 25 | 26 | 27 | Set name 28 | 29 | 30 | 31 | 32 | 33 | 34 | Cancel 35 | 36 | 37 | 38 | 39 | 40 | 41 | Qt::Horizontal 42 | 43 | 44 | 45 | 170 46 | 20 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | Accept 55 | 56 | 57 | 58 | 59 | 60 | 61 | leUrl 62 | lePath 63 | pbCancel 64 | pbAccept 65 | 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /src/commits/WipWidget.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /**************************************************************************************** 4 | ** GitQlient is an application to manage and operate one or several Git repositories. With 5 | ** GitQlient you will be able to add commits, branches and manage all the options Git provides. 6 | ** Copyright (C) 2021 Francesc Martinez 7 | ** 8 | ** LinkedIn: www.linkedin.com/in/cescmm/ 9 | ** Web: www.francescmm.com 10 | ** 11 | ** This program is free software; you can redistribute it and/or 12 | ** modify it under the terms of the GNU Lesser General Public 13 | ** License as published by the Free Software Foundation; either 14 | ** version 2 of the License, or (at your option) any later version. 15 | ** 16 | ** This program is distributed in the hope that it will be useful, 17 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 | ** Lesser General Public License for more details. 20 | ** 21 | ** You should have received a copy of the GNU Lesser General Public 22 | ** License along with this library; if not, write to the Free Software 23 | ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 24 | ***************************************************************************************/ 25 | 26 | #include 27 | 28 | class QListWidget; 29 | class QListWidgetItem; 30 | class GitCache; 31 | class GitBase; 32 | class RevisionFiles; 33 | 34 | namespace Ui 35 | { 36 | class CommitChangesWidget; 37 | } 38 | 39 | class WipWidget : public CommitChangesWidget 40 | { 41 | Q_OBJECT 42 | 43 | public: 44 | explicit WipWidget(const QSharedPointer &cache, const QSharedPointer &git, 45 | QWidget *parent = nullptr); 46 | 47 | ~WipWidget() = default; 48 | 49 | private: 50 | void configure(const QString &sha) override; 51 | void commitChanges() override; 52 | }; 53 | -------------------------------------------------------------------------------- /src/commits/FileContextMenu.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /**************************************************************************************** 4 | ** GitQlient is an application to manage and operate one or several Git repositories. With 5 | ** GitQlient you will be able to add commits, branches and manage all the options Git provides. 6 | ** Copyright (C) 2021 Francesc Martinez 7 | ** 8 | ** LinkedIn: www.linkedin.com/in/cescmm/ 9 | ** Web: www.francescmm.com 10 | ** 11 | ** This program is free software; you can redistribute it and/or 12 | ** modify it under the terms of the GNU Lesser General Public 13 | ** License as published by the Free Software Foundation; either 14 | ** version 2 of the License, or (at your option) any later version. 15 | ** 16 | ** This program is distributed in the hope that it will be useful, 17 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 | ** Lesser General Public License for more details. 20 | ** 21 | ** You should have received a copy of the GNU Lesser General Public 22 | ** License along with this library; if not, write to the Free Software 23 | ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 24 | ***************************************************************************************/ 25 | 26 | #include 27 | 28 | class FileContextMenu : public QMenu 29 | { 30 | Q_OBJECT 31 | 32 | signals: 33 | void signalOpenFileDiff(); 34 | void signalShowFileHistory(); 35 | 36 | /** 37 | * @brief signalEditFile Signal triggered when the user wants to edit a file and is running GitQlient from QtCreator. 38 | */ 39 | void signalEditFile(); 40 | 41 | public: 42 | explicit FileContextMenu(const QString gitProject, const QString &file, bool editionAllowed = false, QWidget *parent = nullptr); 43 | 44 | private: 45 | QString mFile; 46 | QString mGitProject; 47 | 48 | void openFileExplorer(); 49 | }; 50 | -------------------------------------------------------------------------------- /src/aux_widgets/GitQlientUpdater.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /**************************************************************************************** 4 | ** GitQlient is an application to manage and operate one or several Git repositories. With 5 | ** GitQlient you will be able to add commits, branches and manage all the options Git provides. 6 | ** Copyright (C) 2022 Francesc Martinez 7 | ** 8 | ** LinkedIn: www.linkedin.com/in/cescmm/ 9 | ** Web: www.francescmm.com 10 | ** 11 | ** This program is free software; you can redistribute it and/or 12 | ** modify it under the terms of the GNU Lesser General Public 13 | ** License as published by the Free Software Foundation; either 14 | ** version 2 of the License, or (at your option) any later version. 15 | ** 16 | ** This program is distributed in the hope that it will be useful, 17 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 | ** Lesser General Public License for more details. 20 | ** 21 | ** You should have received a copy of the GNU Lesser General Public 22 | ** License along with this library; if not, write to the Free Software 23 | ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 24 | ***************************************************************************************/ 25 | 26 | #include 27 | 28 | class QNetworkAccessManager; 29 | class QProgressDialog; 30 | 31 | class GitQlientUpdater : public QObject 32 | { 33 | Q_OBJECT 34 | signals: 35 | void newVersionAvailable(); 36 | 37 | public: 38 | explicit GitQlientUpdater(QObject *parent = nullptr); 39 | ~GitQlientUpdater(); 40 | 41 | void checkNewGitQlientVersion(); 42 | void showInfoMessage(); 43 | 44 | private: 45 | QNetworkAccessManager *mManager = nullptr; 46 | QProgressDialog *mDownloadLog = nullptr; 47 | QString mLatestGitQlient; 48 | QString mChangeLog; 49 | 50 | void processUpdateFile(); 51 | void processChangeLog(); 52 | }; 53 | -------------------------------------------------------------------------------- /src/aux_widgets/PullDlg.cpp: -------------------------------------------------------------------------------- 1 | #include "PullDlg.h" 2 | #include "ui_PullDlg.h" 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #include 10 | #include 11 | 12 | PullDlg::PullDlg(QSharedPointer git, const QString &text, QWidget *parent) 13 | : QDialog(parent) 14 | , ui(new Ui::PullDlg) 15 | , mGit(git) 16 | { 17 | ui->setupUi(this); 18 | 19 | ui->lText->setText(text); 20 | ui->lQuestion->setText(tr("Would you like to pull the last changes?")); 21 | ui->buttonBox->button(QDialogButtonBox::Ok)->setText("Pull"); 22 | 23 | setStyleSheet(GitQlientStyles::getStyles()); 24 | } 25 | 26 | PullDlg::~PullDlg() 27 | { 28 | delete ui; 29 | } 30 | 31 | void PullDlg::accept() 32 | { 33 | GitQlientSettings settings(mGit->getGitDir()); 34 | const auto updateOnPull = settings.localValue("UpdateOnPull", true).toBool(); 35 | 36 | QScopedPointer git(new GitRemote(mGit)); 37 | 38 | QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); 39 | const auto ret = git->pull(updateOnPull); 40 | QApplication::restoreOverrideCursor(); 41 | 42 | if (ret.success) 43 | { 44 | emit signalRepositoryUpdated(); 45 | 46 | QDialog::accept(); 47 | } 48 | else 49 | { 50 | if (ret.output.contains("error: could not apply", Qt::CaseInsensitive) 51 | && ret.output.contains("causing a conflict", Qt::CaseInsensitive)) 52 | { 53 | emit signalPullConflict(); 54 | } 55 | else 56 | { 57 | QMessageBox msgBox(QMessageBox::Critical, tr("Error while pulling"), 58 | QString(tr("There were problems during the pull operation. Please, see the detailed " 59 | "description for more information.")), 60 | QMessageBox::Ok, this); 61 | msgBox.setDetailedText(ret.output); 62 | msgBox.setStyleSheet(GitQlientStyles::getStyles()); 63 | msgBox.exec(); 64 | } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /src/aux_widgets/InitialRepoConfig.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /**************************************************************************************** 4 | ** GitQlient is an application to manage and operate one or several Git repositories. With 5 | ** GitQlient you will be able to add commits, branches and manage all the options Git provides. 6 | ** Copyright (C) 2021 Francesc Martinez 7 | ** 8 | ** LinkedIn: www.linkedin.com/in/cescmm/ 9 | ** Web: www.francescmm.com 10 | ** 11 | ** This library is free software; you can redistribute it and/or 12 | ** modify it under the terms of the GNU Lesser General Public 13 | ** License as published by the Free Software Foundation; either 14 | ** version 2 of the License, or (at your option) any later version. 15 | ** 16 | ** This program is distributed in the hope that it will be useful, 17 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 | ** Lesser General Public License for more details. 20 | ** 21 | ** You should have received a copy of the GNU Lesser General Public 22 | ** License along with this library; if not, write to the Free Software 23 | ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 24 | ***************************************************************************************/ 25 | 26 | #include 27 | 28 | namespace Ui 29 | { 30 | class InitialRepoConfig; 31 | } 32 | 33 | class GitQlientSettings; 34 | class GitBase; 35 | class QAbstractButton; 36 | 37 | class InitialRepoConfig : public QDialog 38 | { 39 | Q_OBJECT 40 | 41 | public: 42 | explicit InitialRepoConfig(const QSharedPointer &git, const QSharedPointer &settings, 43 | QWidget *parent = nullptr); 44 | ~InitialRepoConfig(); 45 | 46 | void accept() override; 47 | 48 | private: 49 | Ui::InitialRepoConfig *ui; 50 | QSharedPointer mGit; 51 | QSharedPointer mSettings; 52 | 53 | private slots: 54 | void onCredentialsOptionChanged(QAbstractButton *button); 55 | }; 56 | -------------------------------------------------------------------------------- /src/commits/FileWidget.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /**************************************************************************************** 4 | ** GitQlient is an application to manage and operate one or several Git repositories. With 5 | ** GitQlient you will be able to add commits, branches and manage all the options Git provides. 6 | ** Copyright (C) 2021 Francesc Martinez 7 | ** 8 | ** LinkedIn: www.linkedin.com/in/cescmm/ 9 | ** Web: www.francescmm.com 10 | ** 11 | ** This program is free software; you can redistribute it and/or 12 | ** modify it under the terms of the GNU Lesser General Public 13 | ** License as published by the Free Software Foundation; either 14 | ** version 2 of the License, or (at your option) any later version. 15 | ** 16 | ** This program is distributed in the hope that it will be useful, 17 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 | ** Lesser General Public License for more details. 20 | ** 21 | ** You should have received a copy of the GNU Lesser General Public 22 | ** License along with this library; if not, write to the Free Software 23 | ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 24 | ***************************************************************************************/ 25 | 26 | #include 27 | #include 28 | 29 | class QPushButton; 30 | class QLabel; 31 | 32 | class FileWidget : public QFrame 33 | { 34 | Q_OBJECT 35 | 36 | signals: 37 | void clicked(); 38 | 39 | public: 40 | explicit FileWidget(const QIcon &icon, const QString &text, QWidget *parent = nullptr); 41 | explicit FileWidget(const QString &icon, const QString &text, QWidget *parent = nullptr); 42 | void setIcon(const QString &icon); 43 | QString text() const; 44 | void setText(const QString &text); 45 | QSize sizeHint() const override; 46 | void setTextColor(const QColor &color); 47 | QColor getTextColor() const { return mColor; } 48 | 49 | private: 50 | QPushButton *mButton = nullptr; 51 | QLabel *mText = nullptr; 52 | QColor mColor; 53 | }; 54 | -------------------------------------------------------------------------------- /src/cache/lanes.h: -------------------------------------------------------------------------------- 1 | /* 2 | Author: Marco Costalba (C) 2005-2007 3 | 4 | Copyright: See COPYING file that comes with this distribution 5 | 6 | */ 7 | #ifndef LANES_H 8 | #define LANES_H 9 | 10 | #include 11 | #include 12 | 13 | #include 14 | #include 15 | 16 | // 17 | // At any given time, the Lanes class represents a single revision (row) of the history graph. 18 | // The Lanes class contains a vector of the sha1 hashes of the next commit to appear in each lane (column). 19 | // The Lanes class also contains a vector used to decide which glyph to draw on the history graph. 20 | // 21 | // For each revision (row) (from recent (top) to ancient past (bottom)), the Lanes class is updated, and the 22 | // current revision (row) of glyphs is saved elsewhere (via getLanes()). 23 | // 24 | // The ListView class is responsible for rendering the glyphs. 25 | // 26 | 27 | class Lanes 28 | { 29 | public: 30 | Lanes() = default; 31 | bool isEmpty() { return typeVec.empty(); } 32 | void init(const QString &expectedSha); 33 | void clear(); 34 | bool isFork(const QString &sha, bool &isDiscontinuity); 35 | void setFork(const QString &sha); 36 | void setMerge(const QStringList &parents); 37 | void setInitial(); 38 | void changeActiveLane(const QString &sha); 39 | void afterMerge(); 40 | void afterFork(); 41 | bool isBranch(); 42 | void afterBranch(); 43 | void nextParent(const QString &sha); 44 | void setLanes(QVector &ln) { ln = typeVec; } // O(1) vector is implicitly shared 45 | QVector getLanes() const { return typeVec; } 46 | 47 | private: 48 | int findNextSha(const QString &next, int pos); 49 | int findType(LaneType type, int pos); 50 | int add(LaneType type, const QString &next, int pos); 51 | bool isNode(Lane lane) const; 52 | 53 | int activeLane; 54 | QVector typeVec; // Describes which glyphs should be drawn. 55 | QVector nextShaVec; // The sha1 hashes of the next commit to appear in each lane (column). 56 | LaneType NODE = LaneType::MERGE_FORK; 57 | LaneType NODE_R = LaneType::MERGE_FORK_R; 58 | LaneType NODE_L = LaneType::MERGE_FORK_L; 59 | }; 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /src/commits/UnstagedMenu.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /**************************************************************************************** 4 | ** GitQlient is an application to manage and operate one or several Git repositories. With 5 | ** GitQlient you will be able to add commits, branches and manage all the options Git provides. 6 | ** Copyright (C) 2021 Francesc Martinez 7 | ** 8 | ** LinkedIn: www.linkedin.com/in/cescmm/ 9 | ** Web: www.francescmm.com 10 | ** 11 | ** This program is free software; you can redistribute it and/or 12 | ** modify it under the terms of the GNU Lesser General Public 13 | ** License as published by the Free Software Foundation; either 14 | ** version 2 of the License, or (at your option) any later version. 15 | ** 16 | ** This program is distributed in the hope that it will be useful, 17 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 | ** Lesser General Public License for more details. 20 | ** 21 | ** You should have received a copy of the GNU Lesser General Public 22 | ** License along with this library; if not, write to the Free Software 23 | ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 24 | ***************************************************************************************/ 25 | 26 | #include 27 | 28 | class GitBase; 29 | 30 | class UnstagedMenu : public QMenu 31 | { 32 | Q_OBJECT 33 | 34 | signals: 35 | void signalShowDiff(const QString &fileName); 36 | void signalCommitAll(); 37 | void changeReverted(const QString &revertedFile); 38 | void signalRevertAll(); 39 | void signalCheckedOut(); 40 | void signalShowFileHistory(const QString &fileName); 41 | void signalStageFile(); 42 | void untrackedDeleted(); 43 | 44 | public: 45 | explicit UnstagedMenu(const QSharedPointer &git, const QString &fileName, QWidget *parent = nullptr); 46 | 47 | private: 48 | QSharedPointer mGit; 49 | QString mFileName; 50 | 51 | bool addEntryToGitIgnore(const QString &entry); 52 | void onDeleteFile(); 53 | void openFileExplorer(); 54 | void openExternalEditor(); 55 | void deleteUntracked(); 56 | }; 57 | -------------------------------------------------------------------------------- /src/aux_widgets/PullDlg.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | PullDlg 4 | 5 | 6 | 7 | 0 8 | 0 9 | 496 10 | 140 11 | 12 | 13 | 14 | Dialog 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | true 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | true 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | Qt::Horizontal 43 | 44 | 45 | QDialogButtonBox::Cancel|QDialogButtonBox::Ok 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | buttonBox 55 | accepted() 56 | PullDlg 57 | accept() 58 | 59 | 60 | 248 61 | 254 62 | 63 | 64 | 157 65 | 274 66 | 67 | 68 | 69 | 70 | buttonBox 71 | rejected() 72 | PullDlg 73 | reject() 74 | 75 | 76 | 316 77 | 260 78 | 79 | 80 | 286 81 | 274 82 | 83 | 84 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /src/branches/RefTreeWidget.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /**************************************************************************************** 4 | ** GitQlient is an application to manage and operate one or several Git repositories. With 5 | ** GitQlient you will be able to add commits, branches and manage all the options Git provides. 6 | ** Copyright (C) 2021 Francesc Martinez 7 | ** 8 | ** LinkedIn: www.linkedin.com/in/cescmm/ 9 | ** Web: www.francescmm.com 10 | ** 11 | ** This program is free software; you can redistribute it and/or 12 | ** modify it under the terms of the GNU Lesser General Public 13 | ** License as published by the Free Software Foundation; either 14 | ** version 2 of the License, or (at your option) any later version. 15 | ** 16 | ** This program is distributed in the hope that it will be useful, 17 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 | ** Lesser General Public License for more details. 20 | ** 21 | ** You should have received a copy of the GNU Lesser General Public 22 | ** License along with this library; if not, write to the Free Software 23 | ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 24 | ***************************************************************************************/ 25 | 26 | #include 27 | 28 | class RefTreeWidget : public QTreeWidget 29 | { 30 | Q_OBJECT 31 | 32 | public: 33 | /** 34 | * @brief Default constructor 35 | * @param cache The GitQlient cache. 36 | * @param git The git object to perform Git operations. 37 | * @param parentThe parent widget if needed. 38 | */ 39 | explicit RefTreeWidget(QWidget *parent = nullptr); 40 | /** 41 | * @brief focusOnBranch Sets the focus of the three in the item specified in @p branch starting from the position @p 42 | * lastPos. 43 | * @param item The text to search in the tree and set the focus. 44 | * @param lastPos Starting position for the search. 45 | * @return 46 | */ 47 | int focusOnBranch(const QString &itemText, int startSearchPos = -1); 48 | 49 | protected: 50 | QVector findChildItem(const QString &text) const; 51 | }; 52 | -------------------------------------------------------------------------------- /src/aux_widgets/PomodoroConfigDlg.cpp: -------------------------------------------------------------------------------- 1 | #include "PomodoroConfigDlg.h" 2 | #include "ui_PomodoroConfigDlg.h" 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | PomodoroConfigDlg::PomodoroConfigDlg(const QSharedPointer &git, QWidget *parent) 9 | : QDialog(parent) 10 | , ui(new Ui::PomodoroConfigDlg) 11 | , mGit(git) 12 | { 13 | ui->setupUi(this); 14 | 15 | connect(ui->pomodoroDur, &QSlider::valueChanged, this, 16 | [this](int value) { ui->pomodoroDurLabel->setText(QString::number(value)); }); 17 | connect(ui->breakDur, &QSlider::valueChanged, this, 18 | [this](int value) { ui->pomodoroBreakDurLabel->setText(QString::number(value)); }); 19 | connect(ui->longBreakDur, &QSlider::valueChanged, this, 20 | [this](int value) { ui->pomodoroLongBreakLabel->setText(QString::number(value)); }); 21 | 22 | GitQlientSettings settings(mGit->getGitDir()); 23 | ui->cbAlarmSound->setChecked(settings.localValue("Pomodoro/Alarm", false).toBool()); 24 | ui->cbStopResets->setChecked(settings.localValue("Pomodoro/StopResets", true).toBool()); 25 | ui->pomodoroDur->setValue(settings.localValue("Pomodoro/Duration", 25).toInt()); 26 | ui->breakDur->setValue(settings.localValue("Pomodoro/Break", 5).toInt()); 27 | ui->longBreakDur->setValue(settings.localValue("Pomodoro/LongBreak", 15).toInt()); 28 | ui->sbLongBreakCount->setValue(settings.localValue("Pomodoro/LongBreakTrigger", 4).toInt()); 29 | 30 | setStyleSheet(GitQlientStyles::getInstance()->getStyles()); 31 | } 32 | 33 | PomodoroConfigDlg::~PomodoroConfigDlg() 34 | { 35 | delete ui; 36 | } 37 | 38 | void PomodoroConfigDlg::accept() 39 | { 40 | GitQlientSettings settings(mGit->getGitDir()); 41 | settings.setLocalValue("Pomodoro/Alarm", ui->cbAlarmSound->isChecked()); 42 | settings.setLocalValue("Pomodoro/StopResets", ui->cbStopResets->isChecked()); 43 | settings.setLocalValue("Pomodoro/Duration", ui->pomodoroDur->value()); 44 | settings.setLocalValue("Pomodoro/Break", ui->breakDur->value()); 45 | settings.setLocalValue("Pomodoro/LongBreak", ui->longBreakDur->value()); 46 | settings.setLocalValue("Pomodoro/LongBreakTrigger", ui->sbLongBreakCount->value()); 47 | 48 | QDialog::accept(); 49 | } 50 | -------------------------------------------------------------------------------- /.github/workflows/build_win.yaml: -------------------------------------------------------------------------------- 1 | name: Build 2 | on: 3 | workflow_call: 4 | 5 | jobs: 6 | Windows: 7 | name: ${{ matrix.env.name }} 8 | strategy: 9 | matrix: 10 | env: 11 | - name: Windows 12 | os: windows-2025 13 | runs-on: ${{ matrix.env.os }} 14 | steps: 15 | - name: Checking out the code 16 | uses: actions/checkout@v4 17 | with: 18 | submodules: 'true' 19 | fetch-depth: 0 20 | 21 | - name: Install Qt 22 | uses: jurplel/install-qt-action@v3 23 | env: 24 | ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true' 25 | timeout-minutes: 10 26 | with: 27 | version: 6.6.* 28 | target: desktop 29 | host: windows 30 | install-deps: true 31 | arch: win64_mingw 32 | aqtversion: '==3.1.*' 33 | 34 | - name: Install NSIS 35 | shell: powershell 36 | run: | 37 | choco install nsis -y 38 | 39 | - name: Store version 40 | run: | 41 | $version = git describe --always 42 | echo "VERSION_TAG=$version" >> $env:GITHUB_ENV 43 | 44 | - name: Generate project 45 | run: | 46 | cmake -S . -B build -G "MinGW Makefiles" -DVERSION="${{ env.VERSION_TAG }}" -DCMAKE_BUILD_TYPE=Release 47 | 48 | - name: Compile and deploy 49 | run: | 50 | cmake --build build --target GitQlient -j4 51 | cmake --build build --target install 52 | 53 | - name: Generate installer 54 | run: | 55 | windeployqt --release --dir build/install build/install/GitQlient.exe 56 | cmake --build build --target package 57 | 58 | # - name: Sign Executable 59 | # run: | 60 | # $certPath = "cert.pfx" 61 | # [IO.File]::WriteAllBytes($certPath, [Convert]::FromBase64String("${{ secrets.SIGN_CERTIFICATE }}")) 62 | # & "C:\Program Files (x86)\Windows Kits\10\bin\x64\signtool.exe" sign /f "$certPath" /p "${{ secrets.SIGN_PASSWORD }}" /tr http://timestamp.digicert.com /td sha256 /fd sha256 "build\GitQlient.exe" 63 | 64 | - name: Upload installer 65 | uses: actions/upload-artifact@v4 66 | with: 67 | name: win 68 | path: build/packages/GitQlient*.exe 69 | -------------------------------------------------------------------------------- /.github/workflows/build_deb.yaml: -------------------------------------------------------------------------------- 1 | name: Build 2 | on: 3 | workflow_call: 4 | 5 | jobs: 6 | Ubuntu: 7 | name: ${{ matrix.config.name }} 8 | strategy: 9 | matrix: 10 | config: 11 | - { 12 | name: "Ubuntu x86_64", 13 | os: ubuntu-22.04, 14 | platform: amd64 15 | } 16 | - { 17 | name: "Ubuntu ARM64", 18 | os: ubuntu-22.04-arm, 19 | platform: arm64 20 | } 21 | runs-on: ${{ matrix.config.os }} 22 | defaults: 23 | run: 24 | shell: bash 25 | steps: 26 | - name: Checking out the code 27 | uses: actions/checkout@v4 28 | with: 29 | submodules: 'true' 30 | fetch-depth: 0 31 | 32 | - name: Install dependencies 33 | id: vars 34 | run: | 35 | sudo apt-get -qq update 36 | sudo apt-get -qq install libxkbcommon-x11-0 build-essential libgl1-mesa-dev mesa-common-dev libgles2-mesa-dev libxcb-icccm4-dev libxcb-xinerama0 libxcb-image0 libxcb-keysyms1 libxcb-* fakeroot 37 | sudo apt-get -qq install qt6-base-dev qt6-tools-dev qmake6 38 | sudo pip install git-archive-all 39 | sudo qtchooser -install qt6 $(which qmake6) 40 | export QT_SELECT=qt6 41 | QT6_CONFIG_PATH=$(dpkg -L qt6-base-dev | grep 'Qt6Config.cmake' | head -n1) 42 | QT6_DIR=$(dirname "$QT6_CONFIG_PATH") 43 | echo "Qt6_DIR=$QT6_DIR" >> "$GITHUB_ENV" 44 | 45 | - name: Generate project 46 | run: | 47 | sudo cmake -S . -B build -G "Unix Makefiles" -DVERSION=`git describe --always` -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=$Qt6_DIR 48 | 49 | - name: Compile and deploy 50 | run: | 51 | sudo cmake --build build --target GitQlient -j4 52 | sudo cmake --build build --target install 53 | 54 | - name: Build DEB package 55 | run: | 56 | sudo cmake --build build --target package 57 | 58 | - name: Test install 59 | run: | 60 | sudo dpkg -i build/packages/gitqlient*.deb 61 | sudo apt-get install -f 62 | 63 | - name: Upload DEB package 64 | uses: actions/upload-artifact@v4 65 | with: 66 | name: linux_deb_${{ matrix.config.platform }} 67 | path: | 68 | build/packages/gitqlient*.deb 69 | -------------------------------------------------------------------------------- /src/aux_widgets/ConflictButton.cpp: -------------------------------------------------------------------------------- 1 | #include "ConflictButton.h" 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | using namespace QLogger; 12 | 13 | ConflictButton::ConflictButton(const QString &filename, bool inConflict, const QSharedPointer &git, 14 | QWidget *parent) 15 | : QFrame(parent) 16 | , mGit(git) 17 | , mFileName(filename) 18 | , mFile(new QPushButton(mFileName)) 19 | , mEdit(new QPushButton()) 20 | , mResolve(new QPushButton()) 21 | , mUpdate(new QPushButton()) 22 | { 23 | mFile->setCheckable(true); 24 | mFile->setChecked(inConflict); 25 | 26 | mEdit->setIcon(QIcon(":/icons/edit")); 27 | mEdit->setFixedSize(30, 30); 28 | mResolve->setIcon(QIcon(":/icons/check")); 29 | mResolve->setFixedSize(30, 30); 30 | mUpdate->setIcon(QIcon(":/icons/refresh")); 31 | mUpdate->setFixedSize(30, 30); 32 | 33 | const auto layout = new QHBoxLayout(this); 34 | layout->setSpacing(0); 35 | layout->setContentsMargins(QMargins()); 36 | layout->addWidget(mFile); 37 | layout->addWidget(mEdit); 38 | layout->addWidget(mUpdate); 39 | layout->addWidget(mResolve); 40 | 41 | mUpdate->setVisible(inConflict); 42 | mResolve->setVisible(inConflict); 43 | 44 | connect(mFile, &QPushButton::clicked, this, &ConflictButton::clicked); 45 | connect(mEdit, &QPushButton::clicked, this, [this] { emit signalEditFile(getFileName(), 0, 0); }); 46 | connect(mResolve, &QPushButton::clicked, this, &ConflictButton::resolveConflict); 47 | connect(mUpdate, &QPushButton::clicked, this, [this]() { emit updateRequested(); }); 48 | } 49 | 50 | void ConflictButton::setChecked(bool checked) 51 | { 52 | mFile->setChecked(checked); 53 | } 54 | 55 | QString ConflictButton::getFileName() const 56 | { 57 | return mGit->getWorkingDir() + "/" + mFileName; 58 | } 59 | 60 | void ConflictButton::setInConflict(bool inConflict) 61 | { 62 | mUpdate->setVisible(inConflict); 63 | mResolve->setVisible(inConflict); 64 | } 65 | 66 | void ConflictButton::resolveConflict() 67 | { 68 | QScopedPointer git(new GitLocal(mGit)); 69 | const auto ret = git->stageFile(mFileName); 70 | 71 | if (ret.success) 72 | { 73 | setInConflict(false); 74 | emit resolved(); 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /.github/workflows/build_appimg.yaml: -------------------------------------------------------------------------------- 1 | name: Build 2 | on: 3 | workflow_call: 4 | 5 | jobs: 6 | Appimage: 7 | name: AppImage 8 | strategy: 9 | matrix: 10 | os: [ubuntu-22.04] 11 | runs-on: ${{ matrix.os }} 12 | defaults: 13 | run: 14 | shell: bash 15 | steps: 16 | - name: Checking out the code 17 | uses: actions/checkout@v4 18 | with: 19 | submodules: 'true' 20 | fetch-depth: 0 21 | 22 | - name: Install dependencies 23 | id: vars 24 | run: | 25 | sudo apt-get -qq update 26 | sudo apt-get -qq install libxkbcommon-x11-0 libc6-i386 build-essential libgl1-mesa-dev mesa-common-dev libgles2-mesa-dev libxkbcommon-x11-0 libxcb-icccm4-dev libxcb-xinerama0 libxcb-image0 libxcb-keysyms1 libxcb-* fakeroot 27 | sudo apt-get -qq install libfuse2 28 | sudo pip install git-archive-all 29 | 30 | - name: Install Qt 31 | uses: jurplel/install-qt-action@v3 32 | env: 33 | ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true' 34 | timeout-minutes: 10 35 | with: 36 | version: 6.6.* 37 | target: desktop 38 | host: linux 39 | install-deps: true 40 | aqtversion: '==3.1.*' 41 | 42 | - name: Generate project 43 | run: | 44 | cmake -S . -B build -G "Ninja" -DVERSION=`git describe --always` -DCMAKE_BUILD_TYPE=Release 45 | 46 | - name: Compile and deploy 47 | run: | 48 | cmake --build build --target GitQlient -j4 49 | cmake --build build --target install 50 | 51 | - name: Build AppImage 52 | run: | 53 | export VERSION=`git describe --always` 54 | chmod +x build/install/usr/bin/gitqlient 55 | wget -q -O linuxdeployqt https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage 56 | chmod +x linuxdeployqt 57 | ./linuxdeployqt build/install/usr/share/applications/*.desktop -appimage -no-translations -extra-plugins=iconengines,imageformats 58 | chmod +x GitQlient-* 59 | 60 | - name: Upload AppImage 61 | uses: actions/upload-artifact@v4 62 | with: 63 | name: appimage 64 | path: GitQlient-*.AppImage 65 | -------------------------------------------------------------------------------- /src/config/GitConfigDlg.cpp: -------------------------------------------------------------------------------- 1 | #include "GitConfigDlg.h" 2 | #include "ui_GitConfigDlg.h" 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | 11 | GitConfigDlg::GitConfigDlg(const QSharedPointer &gitBase, QWidget *parent) 12 | : QDialog(parent) 13 | , ui(new Ui::GitConfigDlg) 14 | , mGit(gitBase) 15 | { 16 | ui->setupUi(this); 17 | 18 | setWindowFlags(Qt::FramelessWindowHint); 19 | setStyleSheet(GitQlientStyles::getStyles()); 20 | 21 | QScopedPointer git(new GitConfig(mGit)); 22 | 23 | const auto globalConfig = git->getGlobalUserInfo(); 24 | ui->leGlobalEmail->setText(globalConfig.mUserEmail); 25 | ui->leGlobalName->setText(globalConfig.mUserName); 26 | 27 | const auto localConfig = git->getLocalUserInfo(); 28 | ui->leLocalEmail->setText(localConfig.mUserEmail); 29 | ui->leLocalName->setText(localConfig.mUserName); 30 | 31 | connect(ui->checkBox, &CheckBox::stateChanged, this, &GitConfigDlg::copyGlobalSettings); 32 | connect(ui->buttonBox, &QDialogButtonBox::accepted, this, &GitConfigDlg::accept); 33 | } 34 | 35 | GitConfigDlg::~GitConfigDlg() 36 | { 37 | delete ui; 38 | } 39 | 40 | void GitConfigDlg::keyPressEvent(QKeyEvent *e) 41 | { 42 | const auto key = e->key(); 43 | 44 | if (key == Qt::Key_Escape) 45 | return; 46 | 47 | QDialog::keyPressEvent(e); 48 | } 49 | 50 | void GitConfigDlg::closeEvent(QCloseEvent *e) 51 | { 52 | if (!mPrepareToClose) 53 | e->ignore(); 54 | else 55 | QDialog::closeEvent(e); 56 | } 57 | 58 | void GitConfigDlg::close() 59 | { 60 | mPrepareToClose = true; 61 | 62 | QDialog::close(); 63 | } 64 | 65 | void GitConfigDlg::accept() 66 | { 67 | QScopedPointer git(new GitConfig(mGit)); 68 | 69 | git->setGlobalUserInfo({ ui->leGlobalEmail->text(), ui->leGlobalName->text() }); 70 | git->setLocalUserInfo({ ui->leLocalEmail->text(), ui->leLocalName->text() }); 71 | 72 | close(); 73 | } 74 | 75 | void GitConfigDlg::copyGlobalSettings(int checkState) 76 | { 77 | ui->leLocalEmail->setReadOnly(checkState == Qt::Checked); 78 | ui->leLocalName->setReadOnly(checkState == Qt::Checked); 79 | 80 | if (checkState == Qt::Checked) 81 | { 82 | ui->leLocalEmail->setText(ui->leGlobalEmail->text()); 83 | ui->leLocalName->setText(ui->leGlobalName->text()); 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /src/branches/StashesContextMenu.cpp: -------------------------------------------------------------------------------- 1 | #include "StashesContextMenu.h" 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | StashesContextMenu::StashesContextMenu(const QSharedPointer &git, const QString &stashId, QWidget *parent) 10 | : QMenu(parent) 11 | , mGit(git) 12 | , mStashId(stashId) 13 | { 14 | setAttribute(Qt::WA_DeleteOnClose); 15 | 16 | connect(addAction(tr("Branch")), &QAction::triggered, this, &StashesContextMenu::branch); 17 | connect(addAction(tr("Drop")), &QAction::triggered, this, &StashesContextMenu::drop); 18 | connect(addAction(tr("Clear all")), &QAction::triggered, this, &StashesContextMenu::clear); 19 | } 20 | 21 | void StashesContextMenu::branch() 22 | { 23 | BranchDlg dlg({ mStashId, BranchDlgMode::STASH_BRANCH, nullptr, mGit }); 24 | const auto ret = dlg.exec(); 25 | 26 | if (ret == QDialog::Accepted) 27 | emit signalUpdateView(); 28 | } 29 | 30 | void StashesContextMenu::drop() 31 | { 32 | QScopedPointer git(new GitStashes(mGit)); 33 | const auto ret = git->stashDrop(mStashId); 34 | 35 | if (ret.success) 36 | emit signalUpdateView(); 37 | else 38 | { 39 | QMessageBox msgBox(QMessageBox::Critical, tr("Error while dropping stash"), 40 | tr("There were problems during the stash drop operation. Please, see the detailed " 41 | "description for more information."), 42 | QMessageBox::Ok, parentWidget()); 43 | msgBox.setDetailedText(ret.output); 44 | msgBox.setStyleSheet(GitQlientStyles::getStyles()); 45 | msgBox.exec(); 46 | } 47 | } 48 | 49 | void StashesContextMenu::clear() 50 | { 51 | QScopedPointer git(new GitStashes(mGit)); 52 | const auto ret = git->stashClear(); 53 | 54 | if (ret.success) 55 | emit signalUpdateView(); 56 | else 57 | { 58 | QMessageBox msgBox(QMessageBox::Critical, tr("Error while branch stash"), 59 | tr("There were problems during the branch stash operation. Please, see the detailed " 60 | "description for more information."), 61 | QMessageBox::Ok, parentWidget()); 62 | msgBox.setDetailedText(ret.output); 63 | msgBox.setStyleSheet(GitQlientStyles::getStyles()); 64 | msgBox.exec(); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /src/branches/AddRemoteDlg.cpp: -------------------------------------------------------------------------------- 1 | #include "AddRemoteDlg.h" 2 | #include "ui_AddSubmoduleDlg.h" 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #include 10 | 11 | AddRemoteDlg::AddRemoteDlg(const QSharedPointer &git, QWidget *parent) 12 | : QDialog(parent) 13 | , ui(new Ui::AddSubmoduleDlg) 14 | , mGit(git) 15 | { 16 | setStyleSheet(GitQlientStyles::getStyles()); 17 | 18 | ui->setupUi(this); 19 | 20 | setWindowTitle("Add remote repository"); 21 | 22 | connect(ui->lePath, &QLineEdit::returnPressed, this, &AddRemoteDlg::accept); 23 | connect(ui->leUrl, &QLineEdit::returnPressed, this, &AddRemoteDlg::accept); 24 | connect(ui->leUrl, &QLineEdit::editingFinished, this, &AddRemoteDlg::proposeName); 25 | connect(ui->pbAccept, &QPushButton::clicked, this, &AddRemoteDlg::accept); 26 | connect(ui->pbCancel, &QPushButton::clicked, this, &QDialog::reject); 27 | } 28 | 29 | AddRemoteDlg::~AddRemoteDlg() 30 | { 31 | delete ui; 32 | } 33 | 34 | void AddRemoteDlg::accept() 35 | { 36 | const auto remoteName = ui->lePath->text(); 37 | const auto remoteUrl = ui->leUrl->text(); 38 | 39 | QScopedPointer git(new GitRemote(mGit)); 40 | 41 | if (remoteName.isEmpty() || remoteUrl.isEmpty()) 42 | { 43 | QMessageBox::warning( 44 | this, tr("Invalid fields"), 45 | tr("The information provided is incorrect. Please fix the URL and/or the name and submit again.")); 46 | } 47 | else if (const auto ret = git->addRemote(remoteUrl, remoteName); ret.success) 48 | { 49 | GitQlientSettings settings(mGit->getGitDir()); 50 | const auto pruneOnFetch = settings.localValue("PruneOnFetch", true).toBool(); 51 | 52 | git->fetch(pruneOnFetch); 53 | 54 | QDialog::accept(); 55 | } 56 | } 57 | 58 | void AddRemoteDlg::proposeName() 59 | { 60 | auto url = ui->leUrl->text(); 61 | QString proposedName; 62 | 63 | if (url.startsWith("https")) 64 | { 65 | url.remove("https://"); 66 | const auto fields = url.split("/"); 67 | 68 | if (fields.count() > 1) 69 | proposedName = fields.at(1); 70 | } 71 | else if (url.contains("@")) 72 | { 73 | const auto fields = url.split(":"); 74 | 75 | if (fields.count() > 0) 76 | proposedName = fields.constFirst(); 77 | } 78 | 79 | ui->lePath->setText(proposedName); 80 | } 81 | -------------------------------------------------------------------------------- /src/aux_widgets/InitialRepoConfig.cpp: -------------------------------------------------------------------------------- 1 | #include "InitialRepoConfig.h" 2 | #include "ui_InitialRepoConfig.h" 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | InitialRepoConfig::InitialRepoConfig(const QSharedPointer &git, 11 | const QSharedPointer &settings, QWidget *parent) 12 | : QDialog(parent) 13 | , ui(new Ui::InitialRepoConfig) 14 | , mGit(git) 15 | , mSettings(settings) 16 | { 17 | setAttribute(Qt::WA_DeleteOnClose); 18 | 19 | ui->setupUi(this); 20 | 21 | setStyleSheet(GitQlientStyles::getInstance()->getStyles()); 22 | 23 | ui->autoFetch->setValue(mSettings->localValue("AutoFetch", 5).toInt()); 24 | ui->pruneOnFetch->setChecked(settings->localValue("PruneOnFetch", true).toBool()); 25 | ui->updateOnPull->setChecked(settings->localValue("UpdateOnPull", false).toBool()); 26 | ui->sbMaxCommits->setValue(settings->localValue("MaxCommits", 0).toInt()); 27 | 28 | QScopedPointer gitConfig(new GitConfig(git)); 29 | 30 | const auto url = gitConfig->getServerUrl(); 31 | ui->credentialsFrames->setVisible(url.startsWith("https")); 32 | 33 | connect(ui->buttonGroup, qOverload(&QButtonGroup::buttonClicked), this, 34 | &InitialRepoConfig::onCredentialsOptionChanged); 35 | } 36 | 37 | InitialRepoConfig::~InitialRepoConfig() 38 | { 39 | mSettings->setLocalValue("AutoFetch", ui->autoFetch->value()); 40 | mSettings->setLocalValue("PruneOnFetch", ui->pruneOnFetch->isChecked()); 41 | mSettings->setLocalValue("UpdateOnPull", ui->updateOnPull->isChecked()); 42 | mSettings->setLocalValue("MaxCommits", ui->sbMaxCommits->value()); 43 | 44 | delete ui; 45 | } 46 | 47 | void InitialRepoConfig::accept() 48 | { 49 | // Store credentials if allowed and the user checked the box 50 | if (ui->credentialsFrames->isVisible() && ui->chbCredentials->isChecked()) 51 | { 52 | if (ui->rbCache->isChecked()) 53 | GitCredentials::configureCache(ui->sbTimeout->value(), mGit); 54 | else 55 | { 56 | CredentialsDlg dlg(mGit, this); 57 | dlg.exec(); 58 | } 59 | } 60 | 61 | QDialog::accept(); 62 | } 63 | 64 | void InitialRepoConfig::onCredentialsOptionChanged(QAbstractButton *button) 65 | { 66 | ui->sbTimeout->setEnabled(button == ui->rbCache); 67 | } 68 | -------------------------------------------------------------------------------- /src/aux_widgets/PluginsDownloader.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /**************************************************************************************** 4 | ** GitQlient is an application to manage and operate one or several Git repositories. With 5 | ** GitQlient you will be able to add commits, branches and manage all the options Git provides. 6 | ** Copyright (C) 2022 Francesc Martinez 7 | ** 8 | ** LinkedIn: www.linkedin.com/in/cescmm/ 9 | ** Web: www.francescmm.com 10 | ** 11 | ** This program is free software; you can redistribute it and/or 12 | ** modify it under the terms of the GNU Lesser General Public 13 | ** License as published by the Free Software Foundation; either 14 | ** version 2 of the License, or (at your option) any later version. 15 | ** 16 | ** This program is distributed in the hope that it will be useful, 17 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 | ** Lesser General Public License for more details. 20 | ** 21 | ** You should have received a copy of the GNU Lesser General Public 22 | ** License along with this library; if not, write to the Free Software 23 | ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 24 | ***************************************************************************************/ 25 | 26 | #include 27 | #include 28 | #include 29 | 30 | #include 31 | 32 | class QNetworkAccessManager; 33 | class QProgressDialog; 34 | class QNetworkReply; 35 | 36 | struct PluginInfo 37 | { 38 | QString name; 39 | QString version; 40 | QString url; 41 | QStringList dependencies; 42 | }; 43 | 44 | class PluginsDownloader : public QObject 45 | { 46 | Q_OBJECT 47 | 48 | signals: 49 | void availablePlugins(const QVector &pluginsInfo); 50 | void pluginStored(); 51 | 52 | public: 53 | explicit PluginsDownloader(QObject *parent = nullptr); 54 | 55 | void checkAvailablePlugins(); 56 | void downloadPlugin(const QString &url); 57 | 58 | private: 59 | QNetworkAccessManager *mManager = nullptr; 60 | QProgressDialog *mDownloadLog = nullptr; 61 | QMap> mDownloads; 62 | uint64_t mTotal = 0U; 63 | QVector mPluginsInfo; 64 | 65 | void processPluginsFile(); 66 | void onDownloadProgress(qint64 read, qint64 total); 67 | void onDownloadFinished(); 68 | }; 69 | -------------------------------------------------------------------------------- /src/git_server/IGitServerCache.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /**************************************************************************************** 4 | ** GitQlient is an application to manage and operate one or several Git repositories. With 5 | ** GitQlient you will be able to add commits, branches and manage all the options Git provides. 6 | ** Copyright (C) 2021 Francesc Martinez 7 | ** 8 | ** LinkedIn: www.linkedin.com/in/cescmm/ 9 | ** Web: www.francescmm.com 10 | ** 11 | ** This program is free software; you can redistribute it and/or 12 | ** modify it under the terms of the GNU Lesser General Public 13 | ** License as published by the Free Software Foundation; either 14 | ** version 2 of the License, or (at your option) any later version. 15 | ** 16 | ** This program is distributed in the hope that it will be useful, 17 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 | ** Lesser General Public License for more details. 20 | ** 21 | ** You should have received a copy of the GNU Lesser General Public 22 | ** License along with this library; if not, write to the Free Software 23 | ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 24 | ***************************************************************************************/ 25 | 26 | #include 27 | 28 | namespace GitServerPlugin 29 | { 30 | enum class Platform; 31 | class IRestApi; 32 | struct Issue; 33 | struct Label; 34 | struct Milestone; 35 | struct PullRequest; 36 | } 37 | 38 | class IGitServerCache 39 | { 40 | public: 41 | virtual ~IGitServerCache() = default; 42 | 43 | virtual bool init(GitServerPlugin::ConfigData data) = 0; 44 | virtual QString getUserName() const = 0; 45 | virtual QVector getPullRequests() const = 0; 46 | virtual GitServerPlugin::PullRequest getPullRequest(int number) const = 0; 47 | virtual GitServerPlugin::PullRequest getPullRequest(const QString &sha) const = 0; 48 | virtual QVector getIssues() const = 0; 49 | virtual GitServerPlugin::Issue getIssue(int number) const = 0; 50 | virtual QVector getLabels() const = 0; 51 | virtual QVector getMilestones() const = 0; 52 | 53 | virtual GitServerPlugin::Platform getPlatform() const = 0; 54 | virtual GitServerPlugin::IRestApi *getApi() const = 0; 55 | }; 56 | -------------------------------------------------------------------------------- /src/aux_widgets/InputShaDlg.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | InputShaDlg 4 | 5 | 6 | 7 | 0 8 | 0 9 | 450 10 | 150 11 | 12 | 13 | 14 | 15 | 450 16 | 150 17 | 18 | 19 | 20 | 21 | 450 22 | 150 23 | 24 | 25 | 26 | Dialog 27 | 28 | 29 | 30 | 31 | 32 | Reset 33 | 34 | 35 | 36 | 37 | 38 | 39 | Commit SHA to reset the branch 40 | 41 | 42 | 43 | 44 | 45 | 46 | Qt::Vertical 47 | 48 | 49 | QSizePolicy::Fixed 50 | 51 | 52 | 53 | 10 54 | 10 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | Qt::Horizontal 63 | 64 | 65 | 66 | 207 67 | 20 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | Cancel 76 | 77 | 78 | 79 | 80 | 81 | 82 | leSha 83 | pbAccept 84 | pbCancel 85 | 86 | 87 | 88 | 89 | -------------------------------------------------------------------------------- /src/branches/AddRemoteDlg.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /**************************************************************************************** 4 | ** GitQlient is an application to manage and operate one or several Git repositories. With 5 | ** GitQlient you will be able to add commits, branches and manage all the options Git provides. 6 | ** Copyright (C) 2021 Francesc Martinez 7 | ** 8 | ** LinkedIn: www.linkedin.com/in/cescmm/ 9 | ** Web: www.francescmm.com 10 | ** 11 | ** This program is free software; you can redistribute it and/or 12 | ** modify it under the terms of the GNU Lesser General Public 13 | ** License as published by the Free Software Foundation; either 14 | ** version 2 of the License, or (at your option) any later version. 15 | ** 16 | ** This program is distributed in the hope that it will be useful, 17 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 | ** Lesser General Public License for more details. 20 | ** 21 | ** You should have received a copy of the GNU Lesser General Public 22 | ** License along with this library; if not, write to the Free Software 23 | ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 24 | ***************************************************************************************/ 25 | 26 | #include 27 | 28 | namespace Ui 29 | { 30 | class AddSubmoduleDlg; 31 | } 32 | 33 | class GitBase; 34 | 35 | /** 36 | * @brief AddRemoteDlg creates a dialog for the user to add a new remote in the current repository. 37 | * 38 | */ 39 | class AddRemoteDlg : public QDialog 40 | { 41 | Q_OBJECT 42 | 43 | public: 44 | /** 45 | * @brief Default constructor. 46 | * 47 | * @param git The git object to execute Git commands. 48 | * @param parent The parent widget if needed. 49 | */ 50 | explicit AddRemoteDlg(const QSharedPointer &git, QWidget *parent = nullptr); 51 | /** 52 | * @brief Destructor. 53 | * 54 | */ 55 | ~AddRemoteDlg() override; 56 | 57 | /** 58 | * @brief When the user clicks the Ok/Accept button, it triggers the \ref accept method that validates the data and 59 | * tries to perform the Git action. If it's successfully executed, it will close the dialog. 60 | * 61 | */ 62 | void accept() override; 63 | 64 | private: 65 | Ui::AddSubmoduleDlg *ui; 66 | QSharedPointer mGit; 67 | 68 | void proposeName(); 69 | }; 70 | -------------------------------------------------------------------------------- /src/branches/AddSubmoduleDlg.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /**************************************************************************************** 4 | ** GitQlient is an application to manage and operate one or several Git repositories. With 5 | ** GitQlient you will be able to add commits, branches and manage all the options Git provides. 6 | ** Copyright (C) 2021 Francesc Martinez 7 | ** 8 | ** LinkedIn: www.linkedin.com/in/cescmm/ 9 | ** Web: www.francescmm.com 10 | ** 11 | ** This program is free software; you can redistribute it and/or 12 | ** modify it under the terms of the GNU Lesser General Public 13 | ** License as published by the Free Software Foundation; either 14 | ** version 2 of the License, or (at your option) any later version. 15 | ** 16 | ** This program is distributed in the hope that it will be useful, 17 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 | ** Lesser General Public License for more details. 20 | ** 21 | ** You should have received a copy of the GNU Lesser General Public 22 | ** License along with this library; if not, write to the Free Software 23 | ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 24 | ***************************************************************************************/ 25 | 26 | #include 27 | 28 | class GitSubmodules; 29 | 30 | namespace Ui 31 | { 32 | class AddSubmoduleDlg; 33 | } 34 | 35 | /** 36 | * @brief AddSubmoduleDlg creates a dialog for the user to add a new submodule in the current repository. 37 | * 38 | */ 39 | class AddSubmoduleDlg : public QDialog 40 | { 41 | Q_OBJECT 42 | 43 | public: 44 | /** 45 | * @brief Default constructor. 46 | * 47 | * @param git The git object to execute Git commands. 48 | * @param parent The parent widget if needed. 49 | */ 50 | explicit AddSubmoduleDlg(const QSharedPointer &git, QWidget *parent = nullptr); 51 | /** 52 | * @brief Destructor. 53 | * 54 | */ 55 | ~AddSubmoduleDlg() override; 56 | 57 | /** 58 | * @brief When the user clicks the Ok/Accept button, it triggers the \ref accept method that validates the data and 59 | * tries to perform the Git action.If it's successfully executed, it will close the dialog. 60 | * 61 | */ 62 | void accept() override; 63 | 64 | private: 65 | Ui::AddSubmoduleDlg *ui; 66 | QSharedPointer mGit; 67 | }; 68 | -------------------------------------------------------------------------------- /src/branches/BranchesViewDelegate.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /**************************************************************************************** 4 | ** GitQlient is an application to manage and operate one or several Git repositories. With 5 | ** GitQlient you will be able to add commits, branches and manage all the options Git provides. 6 | ** Copyright (C) 2021 Francesc Martinez 7 | ** 8 | ** LinkedIn: www.linkedin.com/in/cescmm/ 9 | ** Web: www.francescmm.com 10 | ** 11 | ** This program is free software; you can redistribute it and/or 12 | ** modify it under the terms of the GNU Lesser General Public 13 | ** License as published by the Free Software Foundation; either 14 | ** version 2 of the License, or (at your option) any later version. 15 | ** 16 | ** This program is distributed in the hope that it will be useful, 17 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 | ** Lesser General Public License for more details. 20 | ** 21 | ** You should have received a copy of the GNU Lesser General Public 22 | ** License along with this library; if not, write to the Free Software 23 | ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 24 | ***************************************************************************************/ 25 | 26 | #include 27 | 28 | class QPainter; 29 | 30 | /*! 31 | \brief BranchesViewDelegate is the delegate in charge of painting how the branches are display in the BranchTreeWidget. 32 | 33 | */ 34 | class BranchesViewDelegate : public QStyledItemDelegate 35 | { 36 | public: 37 | /*! 38 | \brief Default constructor. 39 | 40 | \param parent The parent widget if needed. 41 | */ 42 | explicit BranchesViewDelegate(bool isTag = false, QObject *parent = nullptr); 43 | 44 | /*! 45 | \brief Overridden paint method used to display different colors when mouse actions happen. 46 | 47 | \param p The painter device. 48 | \param o The style options of the item. 49 | \param i The item data 50 | */ 51 | void paint(QPainter *p, const QStyleOptionViewItem &o, const QModelIndex &i) const override; 52 | /*! 53 | \brief Overridden method that returns the size of the row, both height and width. 54 | 55 | \return QSize The width and height of the row. 56 | */ 57 | QSize sizeHint(const QStyleOptionViewItem &, const QModelIndex &) const override; 58 | 59 | private: 60 | bool mIsTag = false; 61 | }; 62 | -------------------------------------------------------------------------------- /src/commits/FileListWidget.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /**************************************************************************************** 4 | ** GitQlient is an application to manage and operate one or several Git repositories. With 5 | ** GitQlient you will be able to add commits, branches and manage all the options Git provides. 6 | ** Copyright (C) 2021 Francesc Martinez 7 | ** 8 | ** LinkedIn: www.linkedin.com/in/cescmm/ 9 | ** Web: www.francescmm.com 10 | ** 11 | ** This program is free software; you can redistribute it and/or 12 | ** modify it under the terms of the GNU Lesser General Public 13 | ** License as published by the Free Software Foundation; either 14 | ** version 2 of the License, or (at your option) any later version. 15 | ** 16 | ** This program is distributed in the hope that it will be useful, 17 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 | ** Lesser General Public License for more details. 20 | ** 21 | ** You should have received a copy of the GNU Lesser General Public 22 | ** License along with this library; if not, write to the Free Software 23 | ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 24 | ***************************************************************************************/ 25 | 26 | #include 27 | 28 | class GitBase; 29 | class GitCache; 30 | class FileListDelegate; 31 | 32 | class FileListWidget : public QListWidget 33 | { 34 | Q_OBJECT 35 | 36 | signals: 37 | void signalShowFileHistory(const QString &fileName); 38 | 39 | /** 40 | * @brief signalEditFile Signal triggered when the user wants to edit a file and is running GitQlient from QtCreator. 41 | * @param fileName The file name 42 | * @param line The line 43 | * @param column The column 44 | */ 45 | void signalEditFile(const QString &fileName, int line, int column); 46 | 47 | public: 48 | explicit FileListWidget(const QSharedPointer &git, QSharedPointer cache, 49 | QWidget *parent = nullptr); 50 | ~FileListWidget() override; 51 | 52 | void insertFiles(const QString ¤tSha, const QString &compareToSha); 53 | 54 | private: 55 | QSharedPointer mGit; 56 | QSharedPointer mCache; 57 | FileListDelegate *mFileDelegate = nullptr; 58 | QString mCurrentSha; 59 | 60 | void showContextMenu(const QPoint &); 61 | void addItem(const QString &label, const QColor &clr); 62 | }; 63 | -------------------------------------------------------------------------------- /src/big_widgets/ConfigWidget.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | class GitBase; 10 | class QTimer; 11 | class FileEditor; 12 | class QPushButton; 13 | class QLabel; 14 | class QAbstractButton; 15 | 16 | namespace Ui 17 | { 18 | class ConfigWidget; 19 | } 20 | 21 | class ConfigWidget : public QWidget 22 | { 23 | Q_OBJECT 24 | 25 | signals: 26 | void reloadView(); 27 | void reloadDiffFont(); 28 | void buildSystemEnabled(bool enabled); 29 | void gitServerEnabled(bool enabled); 30 | void terminalEnabled(bool enabled); 31 | void commitTitleMaxLenghtChanged(); 32 | void panelsVisibilityChanged(); 33 | void pomodoroVisibilityChanged(); 34 | void moveLogsAndClose(); 35 | void autoFetchChanged(int minutes); 36 | void autoRefreshChanged(int seconds); 37 | 38 | public: 39 | explicit ConfigWidget(const QSharedPointer &git, QWidget *parent = nullptr); 40 | ~ConfigWidget(); 41 | 42 | void onPanelsVisibilityChanged(); 43 | void loadPlugins(QMap plugins); 44 | 45 | private: 46 | Ui::ConfigWidget *ui; 47 | QSharedPointer mGit; 48 | int mOriginalRepoOrder = 0; 49 | bool mShowResetMsg = false; 50 | QTimer *mFeedbackTimer = nullptr; 51 | QPushButton *mSave = nullptr; 52 | FileEditor *mLocalGit = nullptr; 53 | FileEditor *mGlobalGit = nullptr; 54 | PluginsDownloader *mPluginsDownloader = nullptr; 55 | QButtonGroup *mDownloadButtons = nullptr; 56 | QVector mPluginWidgets; 57 | QVector mPluginsInfo; 58 | QMap mPluginDataMap; 59 | QStringList mPluginNames; 60 | QPushButton *mPbFeaturesTour; 61 | 62 | void clearCache(); 63 | void clearLogs(); 64 | void clearFolder(const QString &folder, QLabel *label); 65 | void calculateLogsSize(); 66 | uint64_t calculateDirSize(const QString &dirPath); 67 | void enableWidgets(); 68 | void saveFile(); 69 | void showCredentialsDlg(); 70 | void selectFolder(); 71 | void selectPluginsFolder(); 72 | void selectEditor(); 73 | void useDefaultLogsFolder(); 74 | void readRemotePluginsInfo(); 75 | void showFeaturesTour(); 76 | void fillLanguageBox() const; 77 | 78 | private slots: 79 | void saveConfig(); 80 | void onCredentialsOptionChanged(QAbstractButton *button); 81 | void onPullStrategyChanged(int index); 82 | void onPluginsInfoReceived(const QVector &pluginsInfo); 83 | void onPluginStored(); 84 | }; 85 | -------------------------------------------------------------------------------- /src/branches/SubmodulesContextMenu.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /**************************************************************************************** 4 | ** GitQlient is an application to manage and operate one or several Git repositories. With 5 | ** GitQlient you will be able to add commits, branches and manage all the options Git provides. 6 | ** Copyright (C) 2021 Francesc Martinez 7 | ** 8 | ** LinkedIn: www.linkedin.com/in/cescmm/ 9 | ** Web: www.francescmm.com 10 | ** 11 | ** This program is free software; you can redistribute it and/or 12 | ** modify it under the terms of the GNU Lesser General Public 13 | ** License as published by the Free Software Foundation; either 14 | ** version 2 of the License, or (at your option) any later version. 15 | ** 16 | ** This program is distributed in the hope that it will be useful, 17 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 | ** Lesser General Public License for more details. 20 | ** 21 | ** You should have received a copy of the GNU Lesser General Public 22 | ** License along with this library; if not, write to the Free Software 23 | ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 24 | ***************************************************************************************/ 25 | 26 | #include 27 | 28 | class GitBase; 29 | 30 | /*! 31 | \brief The SubmodulesContextMenu shows the different options that can be performed to the stashes. 32 | 33 | */ 34 | class SubmodulesContextMenu : public QMenu 35 | { 36 | Q_OBJECT 37 | 38 | signals: 39 | /*! 40 | \brief Signal triggered if a submodule wants to be opened. 41 | 42 | */ 43 | void openSubmodule(const QString &path); 44 | /*! 45 | \brief Signal triggered when the main GitQlient UI needs to be updated because of a change in the stashes. 46 | 47 | */ 48 | void infoUpdated(); 49 | 50 | public: 51 | /*! 52 | \brief Default constructor. 53 | 54 | \param git The git object to perform Git operations. 55 | \param index The QModelIndex refering to the submodule if available. 56 | \param parent The parent widget if needed. 57 | */ 58 | explicit SubmodulesContextMenu(const QSharedPointer &git, const QModelIndex &index, int totalSubmodules, 59 | QWidget *parent = nullptr); 60 | 61 | explicit SubmodulesContextMenu(const QSharedPointer &git, const QString &name, QWidget *parent = nullptr); 62 | 63 | private: 64 | QSharedPointer mGit; 65 | }; 66 | -------------------------------------------------------------------------------- /src/config/GitConfigDlg.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | GitConfigDlg 4 | 5 | 6 | 7 | 0 8 | 0 9 | 400 10 | 300 11 | 12 | 13 | 14 | Git Config 15 | 16 | 17 | 18 | 10 19 | 20 | 21 | 10 22 | 23 | 24 | 10 25 | 26 | 27 | 10 28 | 29 | 30 | 10 31 | 32 | 33 | 34 | 35 | Global Git name 36 | 37 | 38 | 39 | 40 | 41 | 42 | Global Git email 43 | 44 | 45 | 46 | 47 | 48 | 49 | User global settings 50 | 51 | 52 | 53 | 54 | 55 | 56 | Local Git name 57 | 58 | 59 | 60 | 61 | 62 | 63 | Local Git email 64 | 65 | 66 | 67 | 68 | 69 | 70 | Qt::Horizontal 71 | 72 | 73 | QDialogButtonBox::Ok 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | CheckBox 82 | QCheckBox 83 |
CheckBox.h
84 |
85 |
86 | 87 | 88 | 89 | copyGlobalSettings(int) 90 | 91 |
92 | -------------------------------------------------------------------------------- /src/branches/TagDlg.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /**************************************************************************************** 4 | ** GitQlient is an application to manage and operate one or several Git repositories. With 5 | ** GitQlient you will be able to add commits, branches and manage all the options Git provides. 6 | ** Copyright (C) 2021 Francesc Martinez 7 | ** 8 | ** LinkedIn: www.linkedin.com/in/cescmm/ 9 | ** Web: www.francescmm.com 10 | ** 11 | ** This program is free software; you can redistribute it and/or 12 | ** modify it under the terms of the GNU Lesser General Public 13 | ** License as published by the Free Software Foundation; either 14 | ** version 2 of the License, or (at your option) any later version. 15 | ** 16 | ** This program is distributed in the hope that it will be useful, 17 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 | ** Lesser General Public License for more details. 20 | ** 21 | ** You should have received a copy of the GNU Lesser General Public 22 | ** License along with this library; if not, write to the Free Software 23 | ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 24 | ***************************************************************************************/ 25 | 26 | #include 27 | 28 | class GitBase; 29 | 30 | namespace Ui 31 | { 32 | class TagDlg; 33 | } 34 | 35 | /*! 36 | \brief The TagDlg class helps the user to create both local and remote tags in the repository. 37 | 38 | */ 39 | class TagDlg : public QDialog 40 | { 41 | Q_OBJECT 42 | 43 | public: 44 | /*! 45 | \brief The default constructor. 46 | 47 | \param git The git object to perform Git operations. 48 | \param sha The sha where the tag will be created. 49 | \param parent The parent widget if needed. 50 | */ 51 | explicit TagDlg(const QSharedPointer &git, const QString &sha, QWidget *parent = nullptr); 52 | /*! 53 | \brief Deleted copy constructor 54 | 55 | */ 56 | TagDlg(const TagDlg &) = delete; 57 | /*! 58 | \brief Deleted assignment operator. 59 | 60 | \return TagDlg &operator A new TagDlg object. 61 | */ 62 | TagDlg &operator=(const TagDlg &) = delete; 63 | /*! 64 | \brief Destructor. 65 | 66 | */ 67 | ~TagDlg() override; 68 | 69 | /*! 70 | \brief Validates the data input by the user and performs the git add tag action. 71 | 72 | */ 73 | void accept() override; 74 | 75 | private: 76 | Ui::TagDlg *ui; 77 | QSharedPointer mGit; 78 | QString mSha; 79 | }; 80 | -------------------------------------------------------------------------------- /src/aux_widgets/CommitInfoPanel.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /**************************************************************************************** 4 | ** GitQlient is an application to manage and operate one or several Git repositories. With 5 | ** GitQlient you will be able to add commits, branches and manage all the options Git provides. 6 | ** Copyright (C) 2021 Francesc Martinez 7 | ** 8 | ** LinkedIn: www.linkedin.com/in/cescmm/ 9 | ** Web: www.francescmm.com 10 | ** 11 | ** This program is free software; you can redistribute it and/or 12 | ** modify it under the terms of the GNU Lesser General Public 13 | ** License as published by the Free Software Foundation; either 14 | ** version 2 of the License, or (at your option) any later version. 15 | ** 16 | ** This program is distributed in the hope that it will be useful, 17 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 | ** Lesser General Public License for more details. 20 | ** 21 | ** You should have received a copy of the GNU Lesser General Public 22 | ** License along with this library; if not, write to the Free Software 23 | ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 24 | ***************************************************************************************/ 25 | 26 | #include 27 | 28 | class CommitInfo; 29 | class QLabel; 30 | class QScrollArea; 31 | class ButtonLink; 32 | 33 | /** 34 | * @brief The CommitInfoPanel class represents the basic information of a commit. It's presented in the form of a simple 35 | * UI frame with a heading on top that shows the commit SHA and followed by the commit title and description. Later on, 36 | * the information about the commiteer is presented. 37 | */ 38 | class CommitInfoPanel : public QFrame 39 | { 40 | Q_OBJECT 41 | 42 | public: 43 | /** 44 | * @brief CommitInfoPanel Default constructor. 45 | * @param parent The parent widget. 46 | */ 47 | explicit CommitInfoPanel(QWidget *parent = nullptr); 48 | 49 | /** 50 | * @brief configure Configures the panel with the information of the given @p commit. 51 | * @param commit The commit to get the data from. 52 | */ 53 | void configure(const CommitInfo &commit); 54 | /** 55 | * @brief clear Clears all the widgets data. 56 | */ 57 | void clear(); 58 | 59 | private: 60 | ButtonLink *mLabelSha = nullptr; 61 | QLabel *mLabelTitle = nullptr; 62 | QLabel *mLabelDescription = nullptr; 63 | QScrollArea *mScrollArea = nullptr; 64 | QLabel *mLabelAuthor = nullptr; 65 | QLabel *mLabelDateTime = nullptr; 66 | }; 67 | -------------------------------------------------------------------------------- /src/commits/CommitInfoWidget.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | #include 12 | 13 | using namespace QLogger; 14 | 15 | CommitInfoWidget::CommitInfoWidget(const QSharedPointer &cache, const QSharedPointer &git, 16 | QWidget *parent) 17 | : QFrame(parent) 18 | , mCache(cache) 19 | , mGit(git) 20 | , mInfoPanel(new CommitInfoPanel()) 21 | , mFileListWidget(new FileListWidget(mGit, mCache)) 22 | { 23 | setAttribute(Qt::WA_DeleteOnClose); 24 | 25 | mFileListWidget->setObjectName("fileListWidget"); 26 | 27 | const auto wipSeparator = new QFrame(); 28 | wipSeparator->setObjectName("separator"); 29 | 30 | const auto mainLayout = new QGridLayout(this); 31 | mainLayout->setSpacing(0); 32 | mainLayout->setContentsMargins(0, 0, 0, 0); 33 | mainLayout->addWidget(mInfoPanel, 0, 0); 34 | mainLayout->addWidget(wipSeparator, 1, 0); 35 | mainLayout->addWidget(mFileListWidget, 2, 0); 36 | mainLayout->setRowStretch(1, 0); 37 | mainLayout->setRowStretch(2, 0); 38 | mainLayout->setRowStretch(2, 1); 39 | 40 | connect(mFileListWidget, &FileListWidget::itemDoubleClicked, this, 41 | [this](QListWidgetItem *item) { emit signalOpenFileCommit(mCurrentSha, mParentSha, item->text()); }); 42 | connect(mFileListWidget, &FileListWidget::signalShowFileHistory, this, &CommitInfoWidget::signalShowFileHistory); 43 | connect(mFileListWidget, &FileListWidget::signalEditFile, this, &CommitInfoWidget::signalEditFile); 44 | } 45 | 46 | void CommitInfoWidget::configure(const QString &sha) 47 | { 48 | if (sha == mCurrentSha) 49 | return; 50 | 51 | clear(); 52 | 53 | mCurrentSha = sha; 54 | mParentSha = sha; 55 | 56 | if (sha != ZERO_SHA && !sha.isEmpty()) 57 | { 58 | const auto commit = mCache->commitInfo(sha); 59 | 60 | if (!commit.sha.isEmpty()) 61 | { 62 | QLog_Info("UI", QString("Loading information of the commit {%1}").arg(sha)); 63 | mCurrentSha = commit.sha; 64 | mParentSha = commit.firstParent(); 65 | 66 | mInfoPanel->configure(commit); 67 | 68 | mFileListWidget->insertFiles(mCurrentSha, mParentSha); 69 | } 70 | } 71 | } 72 | 73 | QString CommitInfoWidget::getCurrentCommitSha() const 74 | { 75 | return mCurrentSha; 76 | } 77 | 78 | void CommitInfoWidget::clear() 79 | { 80 | mCurrentSha = QString(); 81 | mParentSha = QString(); 82 | 83 | mFileListWidget->clear(); 84 | } 85 | -------------------------------------------------------------------------------- /src/branches/StashesContextMenu.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /**************************************************************************************** 4 | ** GitQlient is an application to manage and operate one or several Git repositories. With 5 | ** GitQlient you will be able to add commits, branches and manage all the options Git provides. 6 | ** Copyright (C) 2021 Francesc Martinez 7 | ** 8 | ** LinkedIn: www.linkedin.com/in/cescmm/ 9 | ** Web: www.francescmm.com 10 | ** 11 | ** This program is free software; you can redistribute it and/or 12 | ** modify it under the terms of the GNU Lesser General Public 13 | ** License as published by the Free Software Foundation; either 14 | ** version 2 of the License, or (at your option) any later version. 15 | ** 16 | ** This program is distributed in the hope that it will be useful, 17 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 | ** Lesser General Public License for more details. 20 | ** 21 | ** You should have received a copy of the GNU Lesser General Public 22 | ** License along with this library; if not, write to the Free Software 23 | ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 24 | ***************************************************************************************/ 25 | 26 | #include 27 | 28 | class GitBase; 29 | 30 | /*! 31 | \brief The StashesContextMenu shows the different options that can be performed to the stashes. 32 | 33 | */ 34 | class StashesContextMenu : public QMenu 35 | { 36 | Q_OBJECT 37 | 38 | signals: 39 | /*! 40 | \brief Signal triggered if a stash was removed. 41 | 42 | */ 43 | void signalContentRemoved(); 44 | /*! 45 | \brief Signal triggered when the main GitQlient UI needs to be updated because of a change in the stashes. 46 | 47 | */ 48 | void signalUpdateView(); 49 | 50 | public: 51 | /*! 52 | \brief Default constructor. 53 | 54 | \param git The git object to perform Git operations. 55 | \param stashId The stash ID that will be used to perform operations into. 56 | \param parent The parent widget if needed. 57 | */ 58 | explicit StashesContextMenu(const QSharedPointer &git, const QString &stashId, QWidget *parent = nullptr); 59 | 60 | private: 61 | QSharedPointer mGit; 62 | QString mStashId; 63 | 64 | /*! 65 | \brief Drops a stash. 66 | 67 | */ 68 | void drop(); 69 | /*! 70 | \brief Clears the stash. 71 | 72 | */ 73 | void clear(); 74 | /*! 75 | \brief Creates a branch where the stash is located. 76 | 77 | */ 78 | void branch(); 79 | }; 80 | -------------------------------------------------------------------------------- /src/branches/AddSubtreeDlg.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | AddSubtreeDlg 4 | 5 | 6 | 7 | 0 8 | 0 9 | 363 10 | 160 11 | 12 | 13 | 14 | Add new subtree 15 | 16 | 17 | 18 | 19 | 20 | Accept 21 | 22 | 23 | 24 | 25 | 26 | 27 | Qt::Horizontal 28 | 29 | 30 | 31 | 170 32 | 20 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | Set URL 41 | 42 | 43 | 44 | 45 | 46 | 47 | Set prefix 48 | 49 | 50 | 51 | 52 | 53 | 54 | Cancel 55 | 56 | 57 | 58 | 59 | 60 | 61 | Set reference 62 | 63 | 64 | 65 | 66 | 67 | 68 | Squash commits 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | CheckBox 77 | QCheckBox 78 |
CheckBox.h
79 |
80 |
81 | 82 | leUrl 83 | leReference 84 | lePath 85 | chSquash 86 | pbCancel 87 | pbAccept 88 | 89 | 90 | 91 |
92 | -------------------------------------------------------------------------------- /src/commits/CommitInfoWidget.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /**************************************************************************************** 4 | ** GitQlient is an application to manage and operate one or several Git repositories. With 5 | ** GitQlient you will be able to add commits, branches and manage all the options Git provides. 6 | ** Copyright (C) 2021 Francesc Martinez 7 | ** 8 | ** LinkedIn: www.linkedin.com/in/cescmm/ 9 | ** Web: www.francescmm.com 10 | ** 11 | ** This program is free software; you can redistribute it and/or 12 | ** modify it under the terms of the GNU Lesser General Public 13 | ** License as published by the Free Software Foundation; either 14 | ** version 2 of the License, or (at your option) any later version. 15 | ** 16 | ** This program is distributed in the hope that it will be useful, 17 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 | ** Lesser General Public License for more details. 20 | ** 21 | ** You should have received a copy of the GNU Lesser General Public 22 | ** License along with this library; if not, write to the Free Software 23 | ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 24 | ***************************************************************************************/ 25 | 26 | #include 27 | 28 | class GitCache; 29 | class GitBase; 30 | class QLabel; 31 | class FileListWidget; 32 | class CommitInfoPanel; 33 | 34 | class CommitInfoWidget : public QFrame 35 | { 36 | Q_OBJECT 37 | 38 | signals: 39 | void signalOpenFileCommit(const QString ¤tSha, const QString &previousSha, const QString &file); 40 | void signalOpenFileContextMenu(const QString &, int); 41 | void signalShowFileHistory(const QString &fileName); 42 | 43 | /** 44 | * @brief signalEditFile Signal triggered when the user wants to edit a file and is running GitQlient from QtCreator. 45 | * @param fileName The file name 46 | * @param line The line 47 | * @param column The column 48 | */ 49 | void signalEditFile(const QString &fileName, int line, int column); 50 | 51 | public: 52 | explicit CommitInfoWidget(const QSharedPointer &cache, const QSharedPointer &git, 53 | QWidget *parent = nullptr); 54 | 55 | void configure(const QString &sha); 56 | QString getCurrentCommitSha() const; 57 | void clear(); 58 | 59 | private: 60 | QSharedPointer mCache; 61 | QSharedPointer mGit; 62 | QString mCurrentSha; 63 | QString mParentSha; 64 | CommitInfoPanel *mInfoPanel = nullptr; 65 | FileListWidget *mFileListWidget = nullptr; 66 | }; 67 | -------------------------------------------------------------------------------- /.github/workflows/build_rpm.yaml: -------------------------------------------------------------------------------- 1 | name: Build 2 | on: 3 | workflow_call: 4 | 5 | jobs: 6 | Fedora: 7 | name: Fedora 8 | runs-on: ubuntu-latest 9 | strategy: 10 | fail-fast: false 11 | matrix: 12 | fedora_version: [ '41', '42', '43' ] 13 | container: 14 | image: fedora:${{matrix.fedora_version}} 15 | steps: 16 | - name: Update repositories 17 | run: dnf -y update 18 | - name: Upgrade packages 19 | run: dnf -y upgrade 20 | - name: Install dependencies 21 | run: > 22 | dnf -y install --skip-unavailable 23 | @development-tools 24 | which 25 | git 26 | glibc 27 | gcc-c++ 28 | rpmdevtools 29 | make 30 | cmake 31 | pkgconfig 32 | glib 33 | man 34 | tar 35 | gettext 36 | openssh 37 | rsync 38 | boost-devel 39 | sqlite-devel 40 | alsa-lib-devel 41 | pulseaudio-libs-devel 42 | libnotify-devel 43 | libicu-devel 44 | qt6-qtbase-devel 45 | qt6-qtbase-private-devel 46 | qt6-qttools-devel 47 | gstreamer1-devel 48 | gstreamer1-plugins-base-devel 49 | taglib-devel 50 | libcdio-devel 51 | libgpod-devel 52 | libmtp-devel 53 | libchromaprint-devel 54 | libebur128-devel 55 | fftw-devel 56 | desktop-file-utils 57 | libappstream-glib 58 | hicolor-icon-theme 59 | kdsingleapplication-qt6-devel 60 | ninja-build 61 | 62 | - name: Checkout 63 | uses: actions/checkout@v4 64 | with: 65 | fetch-depth: 0 66 | submodules: recursive 67 | 68 | - name: Add safe git directory 69 | run: git config --global --add safe.directory ${GITHUB_WORKSPACE} 70 | 71 | - name: Generate project 72 | run: | 73 | sudo cmake -S . -B build -G "Ninja" -DVERSION=`git describe --always` -DCMAKE_BUILD_TYPE=Release 74 | 75 | - name: Compile and deploy 76 | run: | 77 | sudo cmake --build build --target GitQlient -j4 78 | sudo cmake --build build --target install 79 | sudo cmake --build build --target package 80 | for f in build/packages/*.rpm;do 81 | mv "$f" "${f%.*}-fedora${{matrix.fedora_version}}.${f##*.}" 82 | done 83 | 84 | - name: Upload artifacts 85 | uses: actions/upload-artifact@v4 86 | with: 87 | name: fedora-${{matrix.fedora_version}} 88 | path: | 89 | build/packages/*.rpm 90 | -------------------------------------------------------------------------------- /src/aux_widgets/WaitingDlg.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /**************************************************************************************** 4 | ** GitQlient is an application to manage and operate one or several Git repositories. With 5 | ** GitQlient you will be able to add commits, branches and manage all the options Git provides. 6 | ** Copyright (C) 2021 Francesc Martinez 7 | ** 8 | ** LinkedIn: www.linkedin.com/in/cescmm/ 9 | ** Web: www.francescmm.com 10 | ** 11 | ** This program is free software; you can redistribute it and/or 12 | ** modify it under the terms of the GNU Lesser General Public 13 | ** License as published by the Free Software Foundation; either 14 | ** version 2 of the License, or (at your option) any later version. 15 | ** 16 | ** This program is distributed in the hope that it will be useful, 17 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 | ** Lesser General Public License for more details. 20 | ** 21 | ** You should have received a copy of the GNU Lesser General Public 22 | ** License along with this library; if not, write to the Free Software 23 | ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 24 | ***************************************************************************************/ 25 | 26 | #include 27 | 28 | /** 29 | * @brief This is a re-implementation of the QDialog to better suite styles and special behaviour flags. 30 | * 31 | * @class WaitingDlg WaitingDlg.h "WaitingDlg.h" 32 | */ 33 | class WaitingDlg : public QDialog 34 | { 35 | public: 36 | /** 37 | * @brief Default constructor of the class. 38 | * 39 | * @param labelText The text that will be shown. 40 | * @param cancelButtonText Cancel button text. 41 | * @param minimum Minimum value. 42 | * @param maximum Maximum value. 43 | * @param autoReset Tells the progress dialog if it should automatically reset. 44 | * @param autoClose Tells the progress dialog if it should automatically close. 45 | */ 46 | explicit WaitingDlg(const QString &labelText); 47 | 48 | /** 49 | * @brief Closes the dialog by user's action. 50 | */ 51 | void close(); 52 | 53 | protected: 54 | /** 55 | * @brief Detects the press event to avoid closing the dialog when the Esc key is pressed. 56 | * 57 | * @param e The press event 58 | */ 59 | void keyPressEvent(QKeyEvent *e) override; 60 | /** 61 | * @brief Detects the close event to filter the close event and only close the dialog if the user clicked on the 62 | * button. 63 | * 64 | * @param e The close event 65 | */ 66 | void closeEvent(QCloseEvent *e) override; 67 | 68 | private: 69 | bool mPrepareToClose = false; 70 | }; 71 | -------------------------------------------------------------------------------- /src/aux_widgets/CredentialsDlg.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | CredentialsDlg 4 | 5 | 6 | 7 | 0 8 | 0 9 | 400 10 | 125 11 | 12 | 13 | 14 | 15 | 400 16 | 125 17 | 18 | 19 | 20 | 21 | 400 22 | 125 23 | 24 | 25 | 26 | Credentials 27 | 28 | 29 | 30 | 10 31 | 32 | 33 | 10 34 | 35 | 36 | 10 37 | 38 | 39 | 10 40 | 41 | 42 | 10 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | Qt::Horizontal 54 | 55 | 56 | QDialogButtonBox::Cancel|QDialogButtonBox::Ok 57 | 58 | 59 | 60 | 61 | 62 | 63 | leUser 64 | lePass 65 | 66 | 67 | 68 | 69 | buttonBox 70 | accepted() 71 | CredentialsDlg 72 | accept() 73 | 74 | 75 | 248 76 | 254 77 | 78 | 79 | 157 80 | 274 81 | 82 | 83 | 84 | 85 | buttonBox 86 | rejected() 87 | CredentialsDlg 88 | reject() 89 | 90 | 91 | 316 92 | 260 93 | 94 | 95 | 286 96 | 274 97 | 98 | 99 | 100 | 101 | 102 | -------------------------------------------------------------------------------- /src/diff/FileEditor.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /**************************************************************************************** 4 | ** GitQlient is an application to manage and operate one or several Git repositories. With 5 | ** GitQlient you will be able to add commits, branches and manage all the options Git provides. 6 | ** Copyright (C) 2021 Francesc Martinez 7 | ** 8 | ** LinkedIn: www.linkedin.com/in/cescmm/ 9 | ** Web: www.francescmm.com 10 | ** 11 | ** This program is free software; you can redistribute it and/or 12 | ** modify it under the terms of the GNU Lesser General Public 13 | ** License as published by the Free Software Foundation; either 14 | ** version 2 of the License, or (at your option) any later version. 15 | ** 16 | ** This program is distributed in the hope that it will be useful, 17 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 | ** Lesser General Public License for more details. 20 | ** 21 | ** You should have received a copy of the GNU Lesser General Public 22 | ** License along with this library; if not, write to the Free Software 23 | ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 24 | ***************************************************************************************/ 25 | 26 | #include 27 | 28 | class FileDiffEditor; 29 | class Highlighter; 30 | 31 | class FileEditor : public QFrame 32 | { 33 | Q_OBJECT 34 | 35 | signals: 36 | void signalEditionClosed(); 37 | 38 | public: 39 | explicit FileEditor(bool highlighter = true, QWidget *parent = nullptr); 40 | 41 | ~FileEditor(); 42 | 43 | /** 44 | * @brief editFile Shows the file edition window with the content of 45 | * @p fileName loaded on it. 46 | * @param fileName The full path of the file that will be opened. 47 | */ 48 | void editFile(const QString &fileName); 49 | 50 | /** 51 | * @brief finishEdition Tells the widget to finish the edition. If there are changes the widget asks the user if they 52 | * want to save them. 53 | */ 54 | void finishEdition(); 55 | 56 | /** 57 | * @brief saveFile Saves the current state of the file. 58 | */ 59 | void saveFile(); 60 | 61 | /** 62 | * @brief changeFontSize Updates the font size of the view. 63 | */ 64 | void changeFontSize(); 65 | 66 | private: 67 | FileDiffEditor *mFileEditor = nullptr; 68 | Highlighter *mHighlighter = nullptr; 69 | QString mFileName; 70 | QString mLoadedContent; 71 | bool isEditing = false; 72 | 73 | /** 74 | * @brief saveTextInFile Saves the current file. 75 | * @param content The content of the editor to be stored in the file. 76 | */ 77 | void saveTextInFile(const QString &content) const; 78 | }; 79 | -------------------------------------------------------------------------------- /src/aux_widgets/ProgressDlg.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /**************************************************************************************** 4 | ** GitQlient is an application to manage and operate one or several Git repositories. With 5 | ** GitQlient you will be able to add commits, branches and manage all the options Git provides. 6 | ** Copyright (C) 2021 Francesc Martinez 7 | ** 8 | ** LinkedIn: www.linkedin.com/in/cescmm/ 9 | ** Web: www.francescmm.com 10 | ** 11 | ** This program is free software; you can redistribute it and/or 12 | ** modify it under the terms of the GNU Lesser General Public 13 | ** License as published by the Free Software Foundation; either 14 | ** version 2 of the License, or (at your option) any later version. 15 | ** 16 | ** This program is distributed in the hope that it will be useful, 17 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 | ** Lesser General Public License for more details. 20 | ** 21 | ** You should have received a copy of the GNU Lesser General Public 22 | ** License along with this library; if not, write to the Free Software 23 | ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 24 | ***************************************************************************************/ 25 | 26 | #include 27 | 28 | /** 29 | * @brief This is a re-implementation of the QProgressDialog to better suite styles and special behaviour flags. 30 | * 31 | * @class ProgressDlg ProgressDlg.h "ProgressDlg.h" 32 | */ 33 | class ProgressDlg : public QProgressDialog 34 | { 35 | public: 36 | /** 37 | * @brief Default constructor of the class. 38 | * 39 | * @param labelText The text that will be shown. 40 | * @param cancelButtonText Cancel button text. 41 | * @param minimum Minimum value. 42 | * @param maximum Maximum value. 43 | * @param autoReset Tells the progress dialog if it should automatically reset. 44 | * @param autoClose Tells the progress dialog if it should automatically close. 45 | */ 46 | explicit ProgressDlg(const QString &labelText, const QString &cancelButtonText, int maximum, bool autoClose); 47 | 48 | /** 49 | * @brief Detects the press event to avoid closing the dialog when the Esc key is pressed. 50 | * 51 | * @param e The press event 52 | */ 53 | void keyPressEvent(QKeyEvent *e) override; 54 | /** 55 | * @brief Detects the close event to filter the close event and only close the dialog if the user clicked on the 56 | * button. 57 | * 58 | * @param e The close event 59 | */ 60 | void closeEvent(QCloseEvent *e) override; 61 | /** 62 | * @brief Closes the dialog by user's action. 63 | */ 64 | void close(); 65 | 66 | private: 67 | bool mPrepareToClose = false; 68 | }; 69 | -------------------------------------------------------------------------------- /src/commits/FileContextMenu.cpp: -------------------------------------------------------------------------------- 1 | #include "FileContextMenu.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | FileContextMenu::FileContextMenu(const QString gitProject, const QString &file, bool editionAllowed, QWidget *parent) 11 | : QMenu(parent) 12 | , mFile(file) 13 | , mGitProject(gitProject.endsWith("/") ? gitProject : gitProject + QString("/")) 14 | { 15 | setAttribute(Qt::WA_DeleteOnClose); 16 | 17 | const auto fileHistoryAction = addAction(tr("History")); 18 | fileHistoryAction->setEnabled(false); 19 | 20 | connect(addAction(tr("Blame")), &QAction::triggered, this, &FileContextMenu::signalShowFileHistory); 21 | 22 | const auto fileDiffAction = addAction(tr("Diff")); 23 | connect(fileDiffAction, &QAction::triggered, this, &FileContextMenu::signalOpenFileDiff); 24 | 25 | addSeparator(); 26 | 27 | if (editionAllowed) 28 | { 29 | connect(addAction(tr("Edit file")), &QAction::triggered, this, &FileContextMenu::signalEditFile); 30 | 31 | addSeparator(); 32 | } 33 | 34 | connect(addAction(tr("Open containing folder")), &QAction::triggered, this, &FileContextMenu::openFileExplorer); 35 | connect(addAction(tr("Copy path")), &QAction::triggered, this, 36 | [this]() { QApplication::clipboard()->setText(mFile); }); 37 | } 38 | 39 | void FileContextMenu::openFileExplorer() 40 | { 41 | QString absoluteFilePath = mGitProject + mFile; 42 | absoluteFilePath = absoluteFilePath.left(absoluteFilePath.lastIndexOf("/")); 43 | QString app; 44 | QStringList arguments; 45 | #ifdef Q_OS_LINUX 46 | GitQlientSettings settings; 47 | const auto fileExplorer = settings.globalValue("FileBrowser", "xdg-open").toString(); 48 | 49 | if (fileExplorer.isEmpty()) 50 | { 51 | QMessageBox::critical(parentWidget(), tr("Error opening file explorer"), 52 | tr("The file explorer value in the settings is invalid. Please define what file explorer " 53 | "you want to use to open file locations.")); 54 | return; 55 | } 56 | 57 | arguments = fileExplorer.split(" "); 58 | arguments.append(absoluteFilePath); 59 | app = arguments.takeFirst(); 60 | #elif defined(Q_OS_WIN) 61 | app = QString::fromUtf8("explorer.ext"); 62 | arguments = QStringList { "/select", QDir::toNativeSeparators(absoluteFilePath) }; 63 | #elif defined(Q_OS_MACOS) 64 | app = QString::fromUtf8("/usr/bin/open"); 65 | arguments = QStringList { "-R", absoluteFilePath }; 66 | #endif 67 | 68 | auto ret = QProcess::startDetached(app, arguments); 69 | 70 | if (!ret) 71 | { 72 | QMessageBox::critical(parentWidget(), tr("Error opening file explorer"), 73 | tr("There was a problem opening the file explorer.")); 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /src/branches/BranchesViewDelegate.cpp: -------------------------------------------------------------------------------- 1 | #include "BranchesViewDelegate.h" 2 | 3 | #include 4 | #include 5 | 6 | #include 7 | 8 | using namespace GitQlient; 9 | 10 | constexpr auto DefaultHeight = 30.0; 11 | 12 | BranchesViewDelegate::BranchesViewDelegate(bool isTag, QObject *parent) 13 | : QStyledItemDelegate(parent) 14 | , mIsTag(isTag) 15 | { 16 | } 17 | 18 | void BranchesViewDelegate::paint(QPainter *p, const QStyleOptionViewItem &o, const QModelIndex &i) const 19 | { 20 | p->setRenderHints(QPainter::Antialiasing); 21 | 22 | QStyleOptionViewItem newOpt(o); 23 | 24 | if (newOpt.state & QStyle::State_Selected) 25 | { 26 | p->fillRect(newOpt.rect, GitQlientStyles::getGraphSelectionColor()); 27 | 28 | if (i.column() == 0) 29 | { 30 | QRect rect(0, newOpt.rect.y(), newOpt.rect.x(), newOpt.rect.height()); 31 | p->fillRect(rect, GitQlientStyles::getGraphSelectionColor()); 32 | } 33 | } 34 | else if (newOpt.state & QStyle::State_MouseOver) 35 | { 36 | p->fillRect(newOpt.rect, GitQlientStyles::getGraphHoverColor()); 37 | 38 | if (i.column() == 0) 39 | { 40 | QRect rect(0, newOpt.rect.y(), newOpt.rect.x(), newOpt.rect.height()); 41 | p->fillRect(rect, GitQlientStyles::getGraphHoverColor()); 42 | } 43 | } 44 | else 45 | p->fillRect(newOpt.rect, GitQlientStyles::getBackgroundColor()); 46 | 47 | static const auto iconSize = 20; 48 | static const auto offset = 5; 49 | 50 | if (i.column() == 0) 51 | { 52 | if (i.data(IsLeaf).toBool()) 53 | { 54 | const auto width = newOpt.rect.x(); 55 | QRect rectIcon(width - offset, newOpt.rect.y(), iconSize, newOpt.rect.height()); 56 | QIcon icon(QString::fromUtf8(mIsTag ? ":/icons/tag_indicator" : ":/icons/repo_indicator")); 57 | icon.paint(p, rectIcon); 58 | } 59 | else 60 | { 61 | const auto width = newOpt.rect.x(); 62 | QRect rectIcon(width - offset, newOpt.rect.y(), iconSize, newOpt.rect.height()); 63 | QIcon icon(QString::fromUtf8(":/icons/folder_indicator")); 64 | icon.paint(p, rectIcon); 65 | } 66 | } 67 | 68 | p->setPen(GitQlientStyles::getTextColor()); 69 | 70 | newOpt.font.setBold(i.data(Qt::UserRole).toBool()); 71 | 72 | if (i.data().toString() == "detached") 73 | newOpt.font.setItalic(true); 74 | 75 | if (i.column() == 0) 76 | newOpt.rect.setX(newOpt.rect.x() + iconSize + offset); 77 | else 78 | newOpt.rect.setX(newOpt.rect.x() + iconSize - offset); 79 | 80 | p->setFont(newOpt.font); 81 | p->drawText(newOpt.rect, i.data().toString(), QTextOption(Qt::AlignLeft | Qt::AlignVCenter)); 82 | } 83 | 84 | QSize BranchesViewDelegate::sizeHint(const QStyleOptionViewItem &, const QModelIndex &) const 85 | { 86 | return QSize(0, DefaultHeight); 87 | } 88 | -------------------------------------------------------------------------------- /.clang-format: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2016 Olivier Goffart 2 | # 3 | # You may use this file under the terms of the 3-clause BSD license. 4 | # See the file LICENSE from this package for details. 5 | 6 | # This is the clang-format configuration style to be used by Qt, 7 | # based on the rules from https://wiki.qt.io/Qt_Coding_Style and 8 | # https://wiki.qt.io/Coding_Conventions 9 | 10 | --- 11 | # Webkit style was loosely based on the Qt style 12 | BasedOnStyle: WebKit 13 | 14 | Standard: Cpp11 15 | 16 | # Leave the line breaks up to the user. 17 | # Note that this may be changed at some point in the future. 18 | ColumnLimit: 0 19 | # How much weight do extra characters after the line length limit have. 20 | # PenaltyExcessCharacter: 4 21 | 22 | # Disable reflow of qdoc comments: indentation rules are different. 23 | # Translation comments are also excluded. 24 | CommentPragmas: "^!|^:" 25 | 26 | # We want a space between the type and the star for pointer types. 27 | PointerBindsToType: false 28 | 29 | # We use template< without space. 30 | SpaceAfterTemplateKeyword: false 31 | 32 | # We want to break before the operators, but not before a '='. 33 | BreakBeforeBinaryOperators: All 34 | 35 | # Braces are usually attached, but not after functions or class declarations. 36 | BreakBeforeBraces: Custom 37 | BraceWrapping: 38 | AfterClass: true 39 | AfterControlStatement: true 40 | AfterEnum: true 41 | AfterFunction: true 42 | AfterNamespace: true 43 | AfterObjCDeclaration: true 44 | AfterStruct: true 45 | AfterUnion: true 46 | BeforeCatch: true 47 | BeforeElse: true 48 | IndentBraces: false 49 | 50 | BreakBeforeTernaryOperators: true 51 | 52 | BreakConstructorInitializers: BeforeComma 53 | 54 | # Indent initializers by 3 spaces 55 | ConstructorInitializerIndentWidth: 3 56 | 57 | # No indentation for namespaces. 58 | NamespaceIndentation: None 59 | 60 | # Horizontally align arguments after an open bracket. 61 | # The coding style does not specify the following, but this is what gives 62 | # results closest to the existing code. 63 | AlignAfterOpenBracket: true 64 | AlwaysBreakTemplateDeclarations: true 65 | 66 | # Ideally we should also allow less short function in a single line, but 67 | # clang-format does not handle that. 68 | AllowShortFunctionsOnASingleLine: Inline 69 | 70 | # The coding style specifies some include order categories, but also tells to 71 | # separate categories with an empty line. It does not specify the order within 72 | # the categories. Since the SortInclude feature of clang-format does not 73 | # re-order includes separated by empty lines, the feature is not used. 74 | SortIncludes: true 75 | 76 | # macros for which the opening brace stays attached. 77 | ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH, forever, Q_FOREVER, QBENCHMARK, QBENCHMARK_ONCE ] 78 | 79 | IndentCaseLabels: true 80 | 81 | IndentPPDirectives: AfterHash 82 | 83 | AccessModifierOffset: -3 84 | 85 | IndentWidth: 3 86 | -------------------------------------------------------------------------------- /src/config/GeneralConfigDlg.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /**************************************************************************************** 4 | ** GitQlient is an application to manage and operate one or several Git repositories. With 5 | ** GitQlient you will be able to add commits, branches and manage all the options Git provides. 6 | ** Copyright (C) 2021 Francesc Martinez 7 | ** 8 | ** LinkedIn: www.linkedin.com/in/cescmm/ 9 | ** Web: www.francescmm.com 10 | ** 11 | ** This library is free software; you can redistribute it and/or 12 | ** modify it under the terms of the GNU Lesser General Public 13 | ** License as published by the Free Software Foundation; either 14 | ** version 2 of the License, or (at your option) any later version. 15 | ** 16 | ** This program is distributed in the hope that it will be useful, 17 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 | ** Lesser General Public License for more details. 20 | ** 21 | ** You should have received a copy of the GNU Lesser General Public 22 | ** License along with this library; if not, write to the Free Software 23 | ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 24 | ***************************************************************************************/ 25 | 26 | #include 27 | 28 | class QSpinBox; 29 | class CheckBox; 30 | class QComboBox; 31 | class QLabel; 32 | class QPushButton; 33 | class QLineEdit; 34 | class GitQlientSettings; 35 | 36 | /*! 37 | \brief The GeneralConfigPage shows the available configuration for GitQlient. The configurable options are the 38 | following: 39 | - Disable logs: The user can enable or disable logs. 40 | - Log level: The user can configure the level of the logs for GitQlient. 41 | 42 | */ 43 | class GeneralConfigDlg : public QDialog 44 | { 45 | Q_OBJECT 46 | 47 | public: 48 | /*! 49 | \brief Default constructor. 50 | 51 | \param parent The parent widget if needed. 52 | */ 53 | explicit GeneralConfigDlg(QWidget *parent = nullptr); 54 | 55 | private: 56 | QSharedPointer mSettings; 57 | CheckBox *mDisableLogs = nullptr; 58 | QComboBox *mLevelCombo = nullptr; 59 | QComboBox *mStylesSchema = nullptr; 60 | QLineEdit *mGitLocation = nullptr; 61 | bool mShowResetMsg = false; 62 | QPushButton *mClose = nullptr; 63 | QPushButton *mReset = nullptr; 64 | QPushButton *mApply = nullptr; 65 | 66 | /*! 67 | \brief Reset the changes to its default value. 68 | 69 | */ 70 | void resetChanges(); 71 | /*! 72 | \brief Applies the changes into the settings system. 73 | 74 | */ 75 | void accept() override; 76 | 77 | /** 78 | * @brief importConfig Imports an external configuration. 79 | */ 80 | void importConfig(); 81 | 82 | /** 83 | * @brief exportConfig Exports the configuration to an external file. 84 | */ 85 | void exportConfig(); 86 | }; 87 | -------------------------------------------------------------------------------- /src/config/GitConfigDlg.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /**************************************************************************************** 4 | ** GitQlient is an application to manage and operate one or several Git repositories. With 5 | ** GitQlient you will be able to add commits, branches and manage all the options Git provides. 6 | ** Copyright (C) 2021 Francesc Martinez 7 | ** 8 | ** LinkedIn: www.linkedin.com/in/cescmm/ 9 | ** Web: www.francescmm.com 10 | ** 11 | ** This library is free software; you can redistribute it and/or 12 | ** modify it under the terms of the GNU Lesser General Public 13 | ** License as published by the Free Software Foundation; either 14 | ** version 2 of the License, or (at your option) any later version. 15 | ** 16 | ** This program is distributed in the hope that it will be useful, 17 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 | ** Lesser General Public License for more details. 20 | ** 21 | ** You should have received a copy of the GNU Lesser General Public 22 | ** License along with this library; if not, write to the Free Software 23 | ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 24 | ***************************************************************************************/ 25 | 26 | #include 27 | 28 | namespace Ui 29 | { 30 | class GitConfigDlg; 31 | } 32 | 33 | class GitBase; 34 | 35 | /*! 36 | \brief The GitConfigDlg allows the user to configure the local and global user and email. 37 | 38 | */ 39 | class GitConfigDlg : public QDialog 40 | { 41 | Q_OBJECT 42 | 43 | public: 44 | /*! 45 | \brief Default constructor. 46 | 47 | \param git The git object to perform Git operations. 48 | \param parent The parent widget if needed. 49 | */ 50 | explicit GitConfigDlg(const QSharedPointer &git, QWidget *parent = nullptr); 51 | /*! 52 | \brief Destructor. 53 | 54 | */ 55 | ~GitConfigDlg() override; 56 | 57 | /** 58 | * @brief Detects the press event to avoid closing the dialog when the Esc key is pressed. 59 | * 60 | * @param e The press event 61 | */ 62 | void keyPressEvent(QKeyEvent *e) override; 63 | /** 64 | * @brief Detects the close event to filter the close event and only close the dialog if the user clicked on the 65 | * button. 66 | * 67 | * @param e The close event 68 | */ 69 | void closeEvent(QCloseEvent *e) override; 70 | /** 71 | * @brief Closes the dialog by user's action. 72 | */ 73 | void close(); 74 | 75 | private: 76 | Ui::GitConfigDlg *ui; 77 | QSharedPointer mGit; 78 | bool mPrepareToClose = false; 79 | 80 | /*! 81 | \brief Validates the data input by the user and stores it if correct. 82 | 83 | */ 84 | void accept() override; 85 | /*! 86 | \brief Copies the global settings into the local ones. 87 | 88 | \param checkState The check state. 89 | */ 90 | void copyGlobalSettings(int checkState); 91 | }; 92 | -------------------------------------------------------------------------------- /src/cache/GitRepoLoader.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /**************************************************************************************** 4 | ** GitQlient is an application to manage and operate one or several Git repositories. With 5 | ** GitQlient you will be able to add commits, branches and manage all the options Git provides. 6 | ** Copyright (C) 2021 Francesc Martinez 7 | ** 8 | ** LinkedIn: www.linkedin.com/in/cescmm/ 9 | ** Web: www.francescmm.com 10 | ** 11 | ** This program is free software; you can redistribute it and/or 12 | ** modify it under the terms of the GNU Lesser General Public 13 | ** License as published by the Free Software Foundation; either 14 | ** version 2 of the License, or (at your option) any later version. 15 | ** 16 | ** This program is distributed in the hope that it will be useful, 17 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 | ** Lesser General Public License for more details. 20 | ** 21 | ** You should have received a copy of the GNU Lesser General Public 22 | ** License along with this library; if not, write to the Free Software 23 | ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 24 | ***************************************************************************************/ 25 | 26 | #include 27 | #include 28 | 29 | #include 30 | #include 31 | #include 32 | 33 | struct WipRevisionInfo; 34 | class GitBase; 35 | class GitCache; 36 | class GitQlientSettings; 37 | class GitTags; 38 | class GitRequestorProcess; 39 | 40 | class GitRepoLoader : public QObject 41 | { 42 | Q_OBJECT 43 | 44 | signals: 45 | void signalLoadingStarted(); 46 | void signalLoadingFinished(bool full); 47 | void cancelAllProcesses(QPrivateSignal); 48 | 49 | public slots: 50 | void loadLogHistory(); 51 | void loadReferences(); 52 | void loadAll(); 53 | 54 | public: 55 | explicit GitRepoLoader(QSharedPointer gitBase, QSharedPointer cache, 56 | const QSharedPointer &settings, QObject *parent = nullptr); 57 | void cancelAll(); 58 | void setShowAll(bool showAll = true) { mShowAll = showAll; } 59 | 60 | private: 61 | bool mShowAll = true; 62 | bool mLocked = false; 63 | bool mRefreshReferences = true; 64 | std::atomic mSteps { 0 }; 65 | QSharedPointer mGitBase; 66 | QSharedPointer mRevCache; 67 | QSharedPointer mSettings; 68 | QSharedPointer mGitTags; 69 | GitRequestorProcess *mRevRequestor = nullptr; 70 | GitRequestorProcess *mRefRequestor = nullptr; 71 | 72 | bool configureRepoDirectory(); 73 | void requestReferences(); 74 | void processReferences(QByteArray ba); 75 | void requestRevisions(); 76 | void processRevisions(QByteArray ba); 77 | QVector processUnsignedLog(QByteArray &log) const; 78 | QVector processSignedLog(QByteArray &log) const; 79 | void notifyLoadingFinished(); 80 | }; 81 | --------------------------------------------------------------------------------