[vlc-commits] macosx: use same translation dict for menu and column names
David Fuhrmann
git at videolan.org
Sun Aug 19 18:09:46 CEST 2012
vlc | branch: master | David Fuhrmann <david.fuhrmann at googlemail.com> | Sun Aug 19 16:58:40 2012 +0200| [1995b3009c61cfd91f6b5b0453661cf98f685751] | committer: David Fuhrmann
macosx: use same translation dict for menu and column names
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1995b3009c61cfd91f6b5b0453661cf98f685751
---
modules/gui/macosx/MainMenu.m | 5 +++--
modules/gui/macosx/playlist.h | 2 +-
modules/gui/macosx/playlist.m | 23 +++--------------------
3 files changed, 7 insertions(+), 23 deletions(-)
diff --git a/modules/gui/macosx/MainMenu.m b/modules/gui/macosx/MainMenu.m
index f5ad19f..3813a4d 100644
--- a/modules/gui/macosx/MainMenu.m
+++ b/modules/gui/macosx/MainMenu.m
@@ -69,7 +69,7 @@ static VLCMainMenu *_o_sharedInstance = nil;
o_ptc_translation_dict = [NSDictionary dictionaryWithObjectsAndKeys:
_NS("Track Number"), TRACKNUM_COLUMN,
_NS("Title"), TITLE_COLUMN,
- _NS("Artist"), ARTIST_COLUMN,
+ _NS("Author"), ARTIST_COLUMN,
_NS("Duration"), DURATION_COLUMN,
_NS("Genre"), GENRE_COLUMN,
_NS("Album"), ALBUM_COLUMN,
@@ -676,7 +676,7 @@ static VLCMainMenu *_o_sharedInstance = nil;
[[o_mu_playlistTableColumnsContextMenu itemWithTag: i_tag] setState: i_new_state];
NSString *o_column = [o_ptc_menuorder objectAtIndex: i_tag];
- [[[VLCMain sharedInstance] playlist] setColumn: o_column state: i_new_state];
+ [[[VLCMain sharedInstance] playlist] setColumn: o_column state: i_new_state translationDict: o_ptc_translation_dict];
}
- (void)setPlaylistColumnTableState:(NSInteger)i_state forColumn:(NSString *)o_column
@@ -684,6 +684,7 @@ static VLCMainMenu *_o_sharedInstance = nil;
NSInteger i_tag = [o_ptc_menuorder indexOfObject: o_column];
[[o_mu_playlistTableColumns itemWithTag: i_tag] setState: i_state];
[[o_mu_playlistTableColumnsContextMenu itemWithTag: i_tag] setState: i_state];
+ [[[VLCMain sharedInstance] playlist] setColumn: o_column state: i_state translationDict: o_ptc_translation_dict];
}
#pragma mark -
diff --git a/modules/gui/macosx/playlist.h b/modules/gui/macosx/playlist.h
index 8c6f9ff..77d7f4b 100644
--- a/modules/gui/macosx/playlist.h
+++ b/modules/gui/macosx/playlist.h
@@ -152,5 +152,5 @@
- (void)appendArray:(NSArray*)o_array atPos:(int)i_position enqueue:(BOOL)b_enqueue;
- (void)appendNodeArray:(NSArray*)o_array inNode:(playlist_item_t *)p_node atPos:(int)i_position enqueue:(BOOL)b_enqueue;
-- (void)setColumn: (NSString *)o_column state: (NSInteger)i_state;
+- (void)setColumn: (NSString *)o_column state: (NSInteger)i_state translationDict:(NSDictionary *)o_dict;
@end
diff --git a/modules/gui/macosx/playlist.m b/modules/gui/macosx/playlist.m
index 2ec7746..9f7ddf2 100644
--- a/modules/gui/macosx/playlist.m
+++ b/modules/gui/macosx/playlist.m
@@ -522,7 +522,6 @@
if ([o_column isEqualToString:@"status"])
continue;
- [self setColumn: o_column state: NSOnState];
[o_menu setPlaylistColumnTableState: NSOnState forColumn: o_column];
[[o_outline_view tableColumnWithIdentifier: o_column] setWidth: [[[o_columnArray objectAtIndex:i] objectAtIndex:1] floatValue]];
}
@@ -1487,7 +1486,7 @@
return [[o_nodes_array arrayByAddingObjectsFromArray: o_items_array] retain];
}
-- (void)setColumn: (NSString *)o_column state: (NSInteger)i_state
+- (void)setColumn: (NSString *)o_column state: (NSInteger)i_state translationDict:(NSDictionary *)o_dict
{
NSTableColumn * o_work_tc;
@@ -1497,7 +1496,8 @@
[o_work_tc setEditable: NO];
[[o_work_tc dataCell] setFont: [NSFont controlContentFontOfSize:11.]];
- /* we cannot use a makro here, because gettext isn't clever enough for that */
+ [[o_work_tc headerCell] setStringValue: [o_dict objectForKey:o_column]];
+
if ([o_column isEqualToString: TRACKNUM_COLUMN])
{
[o_work_tc setMaxWidth: 20.];
@@ -1505,25 +1505,8 @@
}
else if ([o_column isEqualToString: TITLE_COLUMN])
{
- [[o_work_tc headerCell] setStringValue: _NS("Name")];
[o_work_tc setResizingMask: NSTableColumnAutoresizingMask | NSTableColumnUserResizingMask];
}
- else if ([o_column isEqualToString: ARTIST_COLUMN])
- [[o_work_tc headerCell] setStringValue: _NS("Author")];
- else if ([o_column isEqualToString: DURATION_COLUMN])
- [[o_work_tc headerCell] setStringValue: _NS("Duration")];
- else if ([o_column isEqualToString: GENRE_COLUMN])
- [[o_work_tc headerCell] setStringValue: _NS("Genre")];
- else if ([o_column isEqualToString: ALBUM_COLUMN])
- [[o_work_tc headerCell] setStringValue: _NS("Album")];
- else if ([o_column isEqualToString: DESCRIPTION_COLUMN])
- [[o_work_tc headerCell] setStringValue: _NS("Description")];
- else if ([o_column isEqualToString: DATE_COLUMN])
- [[o_work_tc headerCell] setStringValue: _NS("Date")];
- else if ([o_column isEqualToString: LANGUAGE_COLUMN])
- [[o_work_tc headerCell] setStringValue: _NS("Language")];
- else if ([o_column isEqualToString: URI_COLUMN])
- [[o_work_tc headerCell] setStringValue: _NS("URI")];
[o_outline_view addTableColumn: o_work_tc];
[o_work_tc release];
More information about the vlc-commits
mailing list