mirror of
https://github.com/TermiT/Flycut.git
synced 2024-11-10 09:32:29 +08:00
move pasted item to top of stack
This commit is contained in:
parent
00737bb66c
commit
d221961cc5
5 changed files with 302 additions and 220 deletions
|
@ -57,6 +57,8 @@
|
|||
@"removeDuplicates",
|
||||
[NSNumber numberWithBool:YES],
|
||||
@"popUpAnimation",
|
||||
[NSNumber numberWithBool:NO],
|
||||
@"pasteMovesToTop",
|
||||
nil]];
|
||||
return [super init];
|
||||
}
|
||||
|
@ -251,7 +253,7 @@
|
|||
- (void)pasteFromStack
|
||||
{
|
||||
if ( [clippingStore jcListCount] > stackPosition ) {
|
||||
[self addClipToPasteboardFromCount:stackPosition];
|
||||
[self pasteIndex: stackPosition];
|
||||
[self performSelector:@selector(hideApp) withObject:nil afterDelay:0.2];
|
||||
[self performSelector:@selector(fakeCommandV) withObject:nil afterDelay:0.2];
|
||||
} else {
|
||||
|
@ -259,6 +261,16 @@
|
|||
}
|
||||
}
|
||||
|
||||
- (void)pasteIndex:(int) position {
|
||||
[self addClipToPasteboardFromCount:position];
|
||||
|
||||
if ( [[DBUserDefaults standardUserDefaults] boolForKey:@"pasteMovesToTop"] ) {
|
||||
[clippingStore clippingMoveToTop:position];
|
||||
stackPosition = 0;
|
||||
[self updateMenu];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)metaKeysReleased
|
||||
{
|
||||
if ( ! isBezelPinned ) {
|
||||
|
@ -541,8 +553,9 @@
|
|||
|
||||
-(IBAction)processMenuClippingSelection:(id)sender
|
||||
{
|
||||
int index=[[sender menu] indexOfItem:sender];
|
||||
[self addClipToPasteboardFromCount:index];
|
||||
int index=[[sender menu] indexOfItem:sender];
|
||||
[self pasteIndex:index];
|
||||
|
||||
if ( [[DBUserDefaults standardUserDefaults] boolForKey:@"menuSelectionPastes"] ) {
|
||||
[self performSelector:@selector(hideApp) withObject:nil];
|
||||
[self performSelector:@selector(fakeCommandV) withObject:nil afterDelay:0.2];
|
||||
|
|
493
English.lproj/MainMenu.nib/designable.nib
generated
493
English.lproj/MainMenu.nib/designable.nib
generated
File diff suppressed because it is too large
Load diff
BIN
English.lproj/MainMenu.nib/keyedobjects.nib
generated
BIN
English.lproj/MainMenu.nib/keyedobjects.nib
generated
Binary file not shown.
|
@ -78,5 +78,8 @@
|
|||
// Delete all list clippings
|
||||
-(void) clearList;
|
||||
|
||||
// Move the clipping at index to the top
|
||||
-(void) clippingMoveToTop:(int)index;
|
||||
|
||||
// Delete all named clippings
|
||||
@end
|
||||
|
|
|
@ -89,6 +89,13 @@
|
|||
[jcList removeObjectAtIndex:index];
|
||||
}
|
||||
|
||||
-(void) clippingMoveToTop:(int)index
|
||||
{
|
||||
JumpcutClipping *clipping = [jcList objectAtIndex:index];
|
||||
[jcList insertObject:clipping atIndex:0];
|
||||
[jcList removeObjectAtIndex:index+1];
|
||||
}
|
||||
|
||||
// Set various values
|
||||
-(void) setRememberNum:(int)nowRemembering
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue