diff options
author | Damiano Galassi <[email protected]> | 2017-11-12 10:56:38 +0100 |
---|---|---|
committer | Damiano Galassi <[email protected]> | 2017-11-12 10:56:38 +0100 |
commit | 914ce0fe91daa503a9d8ddf7152a8792f2b522b9 (patch) | |
tree | 0688b3a6468b8878ab0823281301c7c85e4b248c /macosx/HBChapterTitlesController.m | |
parent | 31ac8ffcb8758fea8cb98835f402c004af1efc5d (diff) |
MacGui: add a double click action to start editing a chapter title. Align things in the xib.
Diffstat (limited to 'macosx/HBChapterTitlesController.m')
-rw-r--r-- | macosx/HBChapterTitlesController.m | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/macosx/HBChapterTitlesController.m b/macosx/HBChapterTitlesController.m index 4c40ad58a..83e3786a6 100644 --- a/macosx/HBChapterTitlesController.m +++ b/macosx/HBChapterTitlesController.m @@ -6,8 +6,7 @@ #import "HBChapterTitlesController.h" -@import HandBrakeKit.HBChapter; -@import HandBrakeKit.HBJob; +@import HandBrakeKit; @interface NSArray (HBCSVAdditions) @@ -181,6 +180,12 @@ self.chapterTitles = job.chapterTitles; } +- (void)loadView +{ + [super loadView]; + self.table.doubleAction = @selector(doubleClickAction:); +} + /** * Method to edit the next chapter when the user presses Return. * We queue the action on the runloop to avoid interfering @@ -218,6 +223,20 @@ } } +- (IBAction)doubleClickAction:(NSTableView *)sender +{ + if (sender.clickedRow > -1) { + NSTableColumn *column = sender.tableColumns[sender.clickedColumn]; + if ([column.identifier isEqualToString:@"title"]) { + // edit the cell + [sender editColumn:sender.clickedColumn + row:sender.clickedRow + withEvent:nil + select:YES]; + } + } +} + #pragma mark - Chapter Files Import / Export - (BOOL)importChaptersFromURL:(NSURL *)URL error:(NSError **)outError |