diff options
author | Damiano Galassi <[email protected]> | 2015-10-09 12:34:42 +0200 |
---|---|---|
committer | Damiano Galassi <[email protected]> | 2015-10-09 12:34:42 +0200 |
commit | f6920d0dbbc70e16cd016ab9d809532fa5db5521 (patch) | |
tree | d62071ed285145a946e20614bed73f44a9f8731b /macosx/HBChapterTitlesController.m | |
parent | f9c5593978ccc7f214dff75f01f59ebda91d8102 (diff) |
MacGui: add a duration column to the chapters table
Diffstat (limited to 'macosx/HBChapterTitlesController.m')
-rw-r--r-- | macosx/HBChapterTitlesController.m | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/macosx/HBChapterTitlesController.m b/macosx/HBChapterTitlesController.m index 633e3fad6..6c05f2b16 100644 --- a/macosx/HBChapterTitlesController.m +++ b/macosx/HBChapterTitlesController.m @@ -5,6 +5,7 @@ It may be used under the terms of the GNU General Public License. */ #import "HBChapterTitlesController.h" +#import "HBChapter.h" #import "HBJob.h" @interface HBChapterTitlesController () <NSTableViewDataSource, NSTableViewDelegate> @@ -13,7 +14,7 @@ IBOutlet NSTableColumn * fChapterTableNameColumn; } -@property (nonatomic, readwrite, strong) NSMutableArray *chapterTitles; +@property (nonatomic, readwrite, strong) NSArray *chapterTitles; @end @@ -46,10 +47,9 @@ forTableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)rowIndex { - if (aTableColumn != nil && [[aTableColumn identifier] intValue] == 2) + if ([aTableColumn.identifier isEqualToString:@"title"]) { - (self.chapterTitles)[rowIndex] = [NSString - stringWithString:anObject]; + [(HBChapter *)self.chapterTitles[rowIndex] setTitle:anObject]; } } @@ -57,13 +57,17 @@ objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)rowIndex { - if ([[aTableColumn identifier] intValue] == 1) + if ([aTableColumn.identifier isEqualToString:@"index"]) { return [NSString stringWithFormat:@"%ld", rowIndex + 1]; } - else + else if ([aTableColumn.identifier isEqualToString:@"duration"]) { - return [NSString stringWithString:(self.chapterTitles)[rowIndex]]; + return [(HBChapter *)self.chapterTitles[rowIndex] duration]; + } + else if ([aTableColumn.identifier isEqualToString:@"title"]) + { + return [(HBChapter *)self.chapterTitles[rowIndex] title]; } return @"__DATA ERROR__"; } |