KiCad PCB EDA Suite
Loading...
Searching...
No Matches
git_ui_utils.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software: you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation, either version 3 of the License, or (at your
9 * option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#ifndef GIT_UI_UTILS_H
21#define GIT_UI_UTILS_H
22
23#include <mutex>
24#include <vector>
25
26class KIGIT_COMMON;
28class wxButton;
29class wxDateTime;
30class wxListCtrl;
31class wxSplitterWindow;
32class wxString;
33class wxWindow;
34
35namespace KIGIT
36{
37
39void ShowBusyMessage( wxWindow* aParent );
40
43[[nodiscard]] std::unique_lock<std::mutex> TryLockAction( KIGIT_COMMON& aCommon, wxWindow* aParent );
44
47void SortBranchesForDisplay( std::vector<KIGIT_BRANCH_INFO>& aBranches );
48
50wxString RelativeDate( const wxDateTime& aWhen );
51
53void UnsplitKeepingSash( wxSplitterWindow* aSplitter, wxWindow* aPane, int& aSashPos );
54
56void MarkDestructive( wxButton* aButton );
57
59wxString SelectedText( wxListCtrl* aList, int aColumn );
60
62bool ValidateIdentity( const wxString& aName, const wxString& aEmail, wxString& aError );
63
64} // namespace KIGIT
65
66#endif // GIT_UI_UTILS_H
The project's git session.
void SortBranchesForDisplay(std::vector< KIGIT_BRANCH_INFO > &aBranches)
Put the current branch first, then local and remote branches with the newest tips first.
void UnsplitKeepingSash(wxSplitterWindow *aSplitter, wxWindow *aPane, int &aSashPos)
Close a splitter's second pane, keeping the sash where the user left it for next time.
void ShowBusyMessage(wxWindow *aParent)
Show a busy message for a user action. UI thread only.
std::unique_lock< std::mutex > TryLockAction(KIGIT_COMMON &aCommon, wxWindow *aParent)
Try the action lock and show a busy message if it is unavailable.
bool ValidateIdentity(const wxString &aName, const wxString &aEmail, wxString &aError)
Check a name and email for recording commits. False leaves the reason in aError.
wxString SelectedText(wxListCtrl *aList, int aColumn)
The text of the selected row in a report list, or empty when nothing is selected.
wxString RelativeDate(const wxDateTime &aWhen)
"just now", "3 hours ago", or the ISO date once it is more than a month old.
void MarkDestructive(wxButton *aButton)
Paint a button's text the diff's red, for one that throws something away.