From: Derk-Jan Hartman Date: Sat, 27 Mar 2004 17:36:46 +0000 (+0000) Subject: * src/interface/interface.c X-Git-Tag: 0.7.2~571 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=d5c4e1bf28c22092fe75c82b79dd025b1f3e2719;p=vlc * src/interface/interface.c - spelling fix - added telnet intf to 'Add Interface' * modules/misc/logger.c: - on Mac OS X, use ~/Library/Logs to write logger intf output. * ALL - Added 'Add Interface' to Mac OS X build. Now you can finaly quicklaunch the SAP intf. --- diff --git a/extras/MacOSX/Resources/English.lproj/MainMenu.nib/classes.nib b/extras/MacOSX/Resources/English.lproj/MainMenu.nib/classes.nib index f55c9427ef..bdcf9eb56b 100644 --- a/extras/MacOSX/Resources/English.lproj/MainMenu.nib/classes.nib +++ b/extras/MacOSX/Resources/English.lproj/MainMenu.nib/classes.nib @@ -103,6 +103,7 @@ "o_info_window" = id; "o_messages" = id; "o_mi_about" = id; + "o_mi_add_intf" = id; "o_mi_audiotrack" = id; "o_mi_bring_atf" = id; "o_mi_bwd" = id; @@ -146,7 +147,6 @@ "o_mi_paste" = id; "o_mi_play" = id; "o_mi_playlist" = id; - "o_mi_position" = id; "o_mi_prefs" = id; "o_mi_previous" = id; "o_mi_program" = id; @@ -169,6 +169,7 @@ "o_mi_website" = id; "o_msgs_btn_crashlog" = id; "o_msgs_panel" = id; + "o_mu_add_intf" = id; "o_mu_audio" = id; "o_mu_audiotrack" = id; "o_mu_channels" = id; diff --git a/extras/MacOSX/Resources/English.lproj/MainMenu.nib/info.nib b/extras/MacOSX/Resources/English.lproj/MainMenu.nib/info.nib index 9a50eddc11..aff8af4683 100644 --- a/extras/MacOSX/Resources/English.lproj/MainMenu.nib/info.nib +++ b/extras/MacOSX/Resources/English.lproj/MainMenu.nib/info.nib @@ -3,26 +3,24 @@ IBDocumentLocation - -6 44 505 517 0 0 800 578 + 392 439 505 517 0 0 1280 1002 IBEditorPositions 1617 - 410 345 104 149 0 0 800 578 + 693 686 104 149 0 0 1280 1002 29 - 11 440 419 44 0 0 800 578 + 25 789 419 44 0 0 1280 1002 915 160 353 103 130 0 0 800 578 IBFramework Version - 362.0 + 349.0 IBLockedObjects IBOpenObjects 1617 29 - 636 - 21 IBSystem Version 7F44 diff --git a/extras/MacOSX/Resources/English.lproj/MainMenu.nib/objects.nib b/extras/MacOSX/Resources/English.lproj/MainMenu.nib/objects.nib index 0e31f7840b..50c3f45c1a 100644 Binary files a/extras/MacOSX/Resources/English.lproj/MainMenu.nib/objects.nib and b/extras/MacOSX/Resources/English.lproj/MainMenu.nib/objects.nib differ diff --git a/modules/gui/macosx/intf.h b/modules/gui/macosx/intf.h index 0ab06f054f..30f763d8eb 100644 --- a/modules/gui/macosx/intf.h +++ b/modules/gui/macosx/intf.h @@ -138,6 +138,8 @@ struct intf_sys_t IBOutlet id o_mi_about; IBOutlet id o_mi_prefs; + IBOutlet id o_mi_add_intf; + IBOutlet id o_mu_add_intf; IBOutlet id o_mi_hide; IBOutlet id o_mi_hide_others; IBOutlet id o_mi_show_all; diff --git a/modules/gui/macosx/intf.m b/modules/gui/macosx/intf.m index 18349dee8e..3e901f8f73 100644 --- a/modules/gui/macosx/intf.m +++ b/modules/gui/macosx/intf.m @@ -470,6 +470,8 @@ unsigned int VLCModifiersToCocoa( unsigned int i_key ) /* main menu */ [o_mi_about setTitle: _NS("About VLC media player")]; [o_mi_prefs setTitle: _NS("Preferences...")]; + [o_mi_add_intf setTitle: _NS("Add Interface")]; + [o_mu_add_intf setTitle: _NS("Add Interface")]; [o_mi_hide setTitle: _NS("Hide VLC")]; [o_mi_hide_others setTitle: _NS("Hide Others")]; [o_mi_show_all setTitle: _NS("Show All")]; @@ -601,6 +603,9 @@ unsigned int VLCModifiersToCocoa( unsigned int i_key ) [NSThread detachNewThreadSelector: @selector(manage) toTarget: self withObject: nil]; + + [o_controls setupVarMenuItem: o_mi_add_intf target: (vlc_object_t *)p_intf + var: "intf-add" selector: @selector(toggleVar:)]; vlc_thread_set_priority( p_intf, VLC_THREAD_PRIORITY_LOW ); } diff --git a/modules/misc/logger.c b/modules/misc/logger.c index f91299627c..345182a40d 100644 --- a/modules/misc/logger.c +++ b/modules/misc/logger.c @@ -36,7 +36,13 @@ #define MODE_TEXT 0 #define MODE_HTML 1 -#define LOG_FILE "vlc-log.txt" +#ifdef SYS_DARWIN +#define LOG_DIR "Library/Logs/" +#endif + +#define LOG_FILE_TEXT "vlc-log.txt" +#define LOG_FILE_HTML "vlc-log.html" + #define LOG_STRING( msg, file ) fwrite( msg, strlen( msg ), 1, file ); #define TEXT_HEADER "-- logger module started --\n" @@ -82,7 +88,7 @@ static void HtmlPrint ( const msg_item_t *, FILE * ); * Module descriptor *****************************************************************************/ static char *mode_list[] = { "text", "html" }; -static char *mode_list_text[] = { N_("Text"), N_("Html") }; +static char *mode_list_text[] = { N_("Text"), N_("HTML") }; #define LOGMODE_TEXT N_("Log format") #define LOGMODE_LONGTEXT N_("Specify the log format. Available choices are \"text\" (default) and \"html\".") @@ -146,17 +152,43 @@ static int Open( vlc_object_t *p_this ) psz_file = config_GetPsz( p_intf, "logfile" ); if( !psz_file ) { - switch( p_intf->p_sys->i_mode ) +#ifdef SYS_DARWIN + char *psz_homedir = p_this->p_vlc->psz_homedir; + + if( !psz_homedir ) + { + msg_Err( p_this, "psz_homedir is null" ); + return -1; + } + psz_file = (char *)malloc( sizeof("/" LOG_DIR "/" LOG_FILE_HTML) + + strlen(psz_homedir) ); + if( psz_file ) + { + switch( p_intf->p_sys->i_mode ) + { + case MODE_HTML: + sprintf( psz_file, "%s/" LOG_DIR "/" LOG_FILE_HTML, + psz_homedir ); + break; + case MODE_TEXT: + default: + sprintf( psz_file, "%s/" LOG_DIR "/" LOG_FILE_TEXT, + psz_homedir ); + break; + } + } +#else + switch( p_intf->p_sys->i_mode ) { case MODE_HTML: - psz_file = strdup( "vlc-log.html" ); + psz_file = strdup( LOG_FILE_HTML ); break; case MODE_TEXT: default: - psz_file = strdup( "vlc-log.txt" ); + psz_file = strdup( LOG_FILE_TEXT ); break; } - +#endif msg_Warn( p_intf, "no log filename provided, using `%s'", psz_file ); } diff --git a/src/interface/interface.c b/src/interface/interface.c index e42f1a86a9..c47ecd1141 100644 --- a/src/interface/interface.c +++ b/src/interface/interface.c @@ -75,7 +75,6 @@ static int AddIntfCallback( vlc_object_t *, char const *, intf_thread_t* __intf_Create( vlc_object_t *p_this, const char *psz_module ) { intf_thread_t * p_intf; - char *psz_intf; /* Allocate structure */ p_intf = vlc_object_create( p_this, VLC_OBJECT_INTF ); @@ -257,18 +256,20 @@ static void RunInterface( intf_thread_t *p_intf ) /* Variable used for interface spawning */ var_Create( p_intf, "intf-add", VLC_VAR_STRING | VLC_VAR_HASCHOICE | VLC_VAR_ISCOMMAND ); - text.psz_string = _("Add interface"); + text.psz_string = _("Add Interface"); var_Change( p_intf, "intf-add", VLC_VAR_SETTEXT, &text, NULL ); val.psz_string = "rc"; text.psz_string = "Console"; var_Change( p_intf, "intf-add", VLC_VAR_ADDCHOICE, &val, &text ); - val.psz_string = "logger"; text.psz_string = "Debug logging"; + val.psz_string = "telnet"; text.psz_string = "Telnet Interface"; + var_Change( p_intf, "intf-add", VLC_VAR_ADDCHOICE, &val, &text ); + val.psz_string = "http"; text.psz_string = "Web Interface"; var_Change( p_intf, "intf-add", VLC_VAR_ADDCHOICE, &val, &text ); - val.psz_string = "http"; text.psz_string = "HTTP remote control"; + val.psz_string = "logger"; text.psz_string = "Debug logging"; var_Change( p_intf, "intf-add", VLC_VAR_ADDCHOICE, &val, &text ); - val.psz_string = "sap"; text.psz_string = "SAP interface"; + val.psz_string = "sap"; text.psz_string = "SAP Playlist"; var_Change( p_intf, "intf-add", VLC_VAR_ADDCHOICE, &val, &text ); - val.psz_string = "gestures"; text.psz_string = "Mouse gestures control"; + val.psz_string = "gestures"; text.psz_string = "Mouse Gestures"; var_Change( p_intf, "intf-add", VLC_VAR_ADDCHOICE, &val, &text ); var_AddCallback( p_intf, "intf-add", AddIntfCallback, NULL );