Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
dbd4ab8
Change inconsistent "SHA" uses to "OID"
tiennou Jul 12, 2014
86b0019
Just use the ref's OID directly.
tiennou Jul 12, 2014
56cd7a6
Use URLs for locating the working directory.
tiennou Jul 15, 2014
37db497
Private ivars go in class extensions.
tiennou Jul 15, 2014
af1c4b5
Property-fy PBGitIndex.
tiennou Jul 15, 2014
e05a628
Move some common actions up in the responder chain.
tiennou Jul 15, 2014
65ebec8
Show HEAD in the sidebar if it's detached
tiennou Feb 13, 2015
73cf163
added stashes property to PBGitRepository.
muhqu Aug 1, 2013
86801cf
add Stashes list to Sidebar.
muhqu Aug 1, 2013
5e950cb
keep stashes in sidebar updated when repository changes
muhqu Aug 6, 2013
650fbd9
wire-up stash actions: pop, apply, drop
muhqu Aug 6, 2013
3fdc4a3
added "Stash Changes" button and "Keep Index" checkbox to Commit View.
muhqu Aug 7, 2013
297d345
wire-up stash save, with keep index option
muhqu Aug 7, 2013
9d0767e
make "Stash Changes" button inactive if working copy is clean.
muhqu Aug 7, 2013
4402136
out-comment too verbose logging
muhqu Aug 11, 2013
3b38652
added App Menu items under "Repository"
muhqu Aug 11, 2013
88442a1
improve keyboard navigation in commit dialog
muhqu Aug 7, 2013
8e0615a
quick and dirty show stash error messages via showErrorSheet
muhqu Aug 21, 2013
381cc3d
Missing initialization
tiennou Feb 13, 2015
ba99cf3
Cosmetics
tiennou Feb 13, 2015
8440a3b
Silence the analyzer
tiennou Feb 13, 2015
1aa7aae
Prevents refs/stash from being deleted
tiennou Feb 13, 2015
90a07b1
Workaround because the commit controller isn't part of the responder …
tiennou Feb 13, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
make "Stash Changes" button inactive if working copy is clean.
- added IBOutlet for stashButton
- added a trackedFilesController to easily get a count of tracked files
  • Loading branch information
muhqu authored and tiennou committed Feb 13, 2015
commit 9d0767e1adec14b45e58cf040d86a1e662a033e6
2 changes: 2 additions & 0 deletions Classes/Controllers/PBGitCommitController.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@

IBOutlet NSArrayController *unstagedFilesController;
IBOutlet NSArrayController *cachedFilesController;
IBOutlet NSArrayController *trackedFilesController;

IBOutlet NSTabView *controlsTabView;
IBOutlet NSButton *commitButton;
IBOutlet NSButton *stashButton;

IBOutlet PBGitIndexController *indexController;
IBOutlet PBWebChangesController *webController;
Expand Down
13 changes: 7 additions & 6 deletions Classes/Controllers/PBGitCommitController.m
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ - (void)awakeFromNib

[unstagedFilesController setFilterPredicate:[NSPredicate predicateWithFormat:@"hasUnstagedChanges == 1"]];
[cachedFilesController setFilterPredicate:[NSPredicate predicateWithFormat:@"hasStagedChanges == 1"]];
[trackedFilesController setFilterPredicate:[NSPredicate predicateWithFormat:@"status > 0"]];

[unstagedFilesController setSortDescriptors:[NSArray arrayWithObjects:
[[NSSortDescriptor alloc] initWithKey:@"status" ascending:false],
Expand Down Expand Up @@ -240,12 +241,12 @@ - (void)indexChanged:(NSNotification *)notification
{
[cachedFilesController rearrangeObjects];
[unstagedFilesController rearrangeObjects];
if ([[cachedFilesController arrangedObjects] count]) {
[commitButton setEnabled:YES];
} else {
[commitButton setEnabled:NO];
}


NSUInteger tracked = [[trackedFilesController arrangedObjects] count];
NSUInteger staged = [[cachedFilesController arrangedObjects] count];

[commitButton setEnabled:(staged > 0)];
[stashButton setEnabled:(staged > 0 || tracked > 0)];
}

- (void)indexOperationFailed:(NSNotification *)notification
Expand Down
12 changes: 10 additions & 2 deletions Resources/XIBs/PBGitCommitView.xib
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<outlet property="commitSplitView" destination="186" id="314"/>
<outlet property="controlsTabView" destination="4Ld-Yb-msh" id="Ogf-eR-aMr"/>
<outlet property="indexController" destination="254" id="256"/>
<outlet property="trackedFilesController" destination="EmG-y5-6ms" id="mqT-Qm-7zo"/>
<outlet property="unstagedFilesController" destination="81" id="156"/>
<outlet property="view" destination="1" id="44"/>
<outlet property="webController" destination="96" id="253"/>
Expand All @@ -32,7 +33,9 @@
<webView id="125">
<rect key="frame" x="0.0" y="0.0" width="852" height="181"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<webPreferences key="preferences" defaultFontSize="12" defaultFixedFontSize="12"/>
<webPreferences key="preferences" defaultFontSize="12" defaultFixedFontSize="12">
<nil key="identifier"/>
</webPreferences>
<connections>
<outlet property="frameLoadDelegate" destination="96" id="137"/>
</connections>
Expand Down Expand Up @@ -119,7 +122,7 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<textView importsGraphics="NO" richText="NO" continuousSpellChecking="YES" allowsUndo="YES" verticallyResizable="YES" linkDetection="YES" spellingCorrection="YES" grammarChecking="YES" smartInsertDelete="YES" id="133" customClass="PBCommitMessageView">
<rect key="frame" x="0.0" y="0.0" width="437" height="188"/>
<rect key="frame" x="0.0" y="0.0" width="438" height="188"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<size key="minSize" width="436.5" height="188"/>
Expand Down Expand Up @@ -332,6 +335,11 @@ DQ
<binding destination="-2" name="contentArray" keyPath="index.indexChanges" id="282"/>
</connections>
</arrayController>
<arrayController id="EmG-y5-6ms" userLabel="Tracked Files">
<connections>
<binding destination="-2" name="contentArray" keyPath="index.indexChanges" id="WBE-vc-PuQ"/>
</connections>
</arrayController>
<customObject id="96" userLabel="Diff Controller" customClass="PBWebChangesController">
<connections>
<outlet property="cachedFilesController" destination="86" id="97"/>
Expand Down