summaryrefslogtreecommitdiffstats
path: root/macosx/HBChapterTitlesController.m
diff options
context:
space:
mode:
authorDamiano Galassi <[email protected]>2015-10-20 18:55:08 +0200
committerDamiano Galassi <[email protected]>2015-10-20 18:55:08 +0200
commit7f50c27989a63e87d2f17c6495d29e136ccfd837 (patch)
tree280036131fa6d7dd1a11ef84a55c4dfad3e96aca /macosx/HBChapterTitlesController.m
parentc32d5236135c6be0b4987fb74de511e3332d7396 (diff)
MacGui: added undo/redo support to the video, picture, filters, chapters and range parts of HBJob.
Diffstat (limited to 'macosx/HBChapterTitlesController.m')
-rw-r--r--macosx/HBChapterTitlesController.m45
1 files changed, 4 insertions, 41 deletions
diff --git a/macosx/HBChapterTitlesController.m b/macosx/HBChapterTitlesController.m
index 713f431fb..7f04a5139 100644
--- a/macosx/HBChapterTitlesController.m
+++ b/macosx/HBChapterTitlesController.m
@@ -31,54 +31,18 @@
{
_job = job;
self.chapterTitles = job.chapterTitles;
- [self.table reloadData];
-}
-
-- (NSInteger)numberOfRowsInTableView:(NSTableView *)aTableView
-{
- return self.chapterTitles.count;
-}
-
-- (void)tableView:(NSTableView *)aTableView
- setObjectValue:(id)anObject
- forTableColumn:(NSTableColumn *)aTableColumn
- row:(NSInteger)rowIndex
-{
- if ([aTableColumn.identifier isEqualToString:@"title"])
- {
- [(HBChapter *)self.chapterTitles[rowIndex] setTitle:anObject];
- }
-}
-
-- (id)tableView:(NSTableView *)aTableView
- objectValueForTableColumn:(NSTableColumn *)aTableColumn
- row:(NSInteger)rowIndex
-{
- if ([aTableColumn.identifier isEqualToString:@"index"])
- {
- return [NSString stringWithFormat:@"%ld", rowIndex + 1];
- }
- else if ([aTableColumn.identifier isEqualToString:@"duration"])
- {
- return [(HBChapter *)self.chapterTitles[rowIndex] duration];
- }
- else if ([aTableColumn.identifier isEqualToString:@"title"])
- {
- return [(HBChapter *)self.chapterTitles[rowIndex] title];
- }
- return @"__DATA ERROR__";
}
/**
* Method to edit the next chapter when the user presses Return.
- * We queue the actino on the runloop to avoid interfering
+ * We queue the action on the runloop to avoid interfering
* with the chain of events that handles the edit.
*/
- (void)controlTextDidEndEditing:(NSNotification *)notification
{
- NSTableView *chapterTable = [notification object];
- NSInteger column = [chapterTable editedColumn];
- NSInteger row = [chapterTable editedRow];
+ NSTableView *chapterTable = self.table;
+ NSInteger column = 2;
+ NSInteger row = [self.table rowForView:[notification object]];
NSInteger textMovement;
// Edit the cell in the next row, same column
@@ -173,7 +137,6 @@
break;
}
- [self.table reloadData];
}
}
}