Commit f3398a27 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

control: move CONSOLE_INTRO_MSG to a private header

parent 3c6db86c
...@@ -114,25 +114,6 @@ VLC_API void vlc_LogSet(libvlc_int_t *, vlc_log_cb cb, void *data); ...@@ -114,25 +114,6 @@ VLC_API void vlc_LogSet(libvlc_int_t *, vlc_log_cb cb, void *data);
/*@}*/ /*@}*/
#if defined( _WIN32 ) && !VLC_WINSTORE_APP
# define CONSOLE_INTRO_MSG \
if( !getenv( "PWD" ) ) /* detect Cygwin shell or Wine */ \
{ \
AllocConsole(); \
freopen( "CONOUT$", "w", stdout ); \
freopen( "CONOUT$", "w", stderr ); \
freopen( "CONIN$", "r", stdin ); \
} \
msg_Info( p_intf, "VLC media player - %s", VERSION_MESSAGE ); \
msg_Info( p_intf, "%s", COPYRIGHT_MESSAGE ); \
msg_Info( p_intf, _("\nWarning: if you cannot access the GUI " \
"anymore, open a command-line window, go to the " \
"directory where you installed VLC and run " \
"\"vlc -I qt\"\n") )
#else
# define CONSOLE_INTRO_MSG (void)0
#endif
/* Interface dialog ids for dialog providers */ /* Interface dialog ids for dialog providers */
typedef enum vlc_dialog { typedef enum vlc_dialog {
INTF_DIALOG_FILE_SIMPLE = 1, INTF_DIALOG_FILE_SIMPLE = 1,
......
controldir = $(pluginsdir)/control controldir = $(pluginsdir)/control
libdummy_plugin_la_SOURCES = control/dummy.c libdummy_plugin_la_SOURCES = control/dummy.c control/intromsg.h
libgestures_plugin_la_SOURCES = control/gestures.c libgestures_plugin_la_SOURCES = control/gestures.c
libhotkeys_plugin_la_SOURCES = control/hotkeys.c libhotkeys_plugin_la_SOURCES = control/hotkeys.c
libhotkeys_plugin_la_LIBADD = $(LIBM) libhotkeys_plugin_la_LIBADD = $(LIBM)
libnetsync_plugin_la_SOURCES = control/netsync.c libnetsync_plugin_la_SOURCES = control/netsync.c
libnetsync_plugin_la_LIBADD = $(SOCKET_LIBS) libnetsync_plugin_la_LIBADD = $(SOCKET_LIBS)
liboldrc_plugin_la_SOURCES = control/rc.c liboldrc_plugin_la_SOURCES = control/rc.c control/intromsg.h
liboldrc_plugin_la_LIBADD = $(SOCKET_LIBS) $(LIBM) liboldrc_plugin_la_LIBADD = $(SOCKET_LIBS) $(LIBM)
control_LTLIBRARIES = \ control_LTLIBRARIES = \
......
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
"Enabling the quiet mode will not bring this command box but can also " \ "Enabling the quiet mode will not bring this command box but can also " \
"be pretty annoying when you want to stop VLC and no video window is " \ "be pretty annoying when you want to stop VLC and no video window is " \
"open." ) "open." )
#include "intromsg.h"
#endif #endif
static int Open( vlc_object_t * ); static int Open( vlc_object_t * );
...@@ -65,7 +66,7 @@ static int Open( vlc_object_t *p_this ) ...@@ -65,7 +66,7 @@ static int Open( vlc_object_t *p_this )
bool b_quiet; bool b_quiet;
b_quiet = var_InheritBool( p_intf, "dummy-quiet" ); b_quiet = var_InheritBool( p_intf, "dummy-quiet" );
if( !b_quiet ) if( !b_quiet )
CONSOLE_INTRO_MSG; intf_consoleIntroMsg(p_intf);
#endif #endif
msg_Info( p_intf, "using the dummy interface module..." ); msg_Info( p_intf, "using the dummy interface module..." );
......
/*****************************************************************************
* intromsg.h
*****************************************************************************
* Copyright (C) 1999-2015 VLC authors and VideoLAN
* $Id$
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
static inline void intf_consoleIntroMsg(intf_thread_t *intf)
{
if (getenv( "PWD" ) == NULL) /* detect Cygwin shell or Wine */
{
AllocConsole();
freopen("CONOUT$", "w", stdout);
freopen("CONOUT$", "w", stderr);
freopen("CONIN$", "r", stdin);
}
msg_Info(intf, "VLC media player - %s", VERSION_MESSAGE);
msg_Info(intf, "%s", COPYRIGHT_MESSAGE);
msg_Info(intf, _("\nWarning: if you cannot access the GUI "
"anymore, open a command-line window, go to the "
"directory where you installed VLC and run "
"\"vlc -I qt\"\n"));
}
...@@ -178,6 +178,7 @@ static void msg_rc( intf_thread_t *p_intf, const char *psz_fmt, ... ) ...@@ -178,6 +178,7 @@ static void msg_rc( intf_thread_t *p_intf, const char *psz_fmt, ... )
"Enabling the quiet mode will not bring this command box but can also " \ "Enabling the quiet mode will not bring this command box but can also " \
"be pretty annoying when you want to stop VLC and no video window is " \ "be pretty annoying when you want to stop VLC and no video window is " \
"open." ) "open." )
#include "intromsg.h"
#endif #endif
vlc_module_begin () vlc_module_begin ()
...@@ -342,7 +343,7 @@ static int Activate( vlc_object_t *p_this ) ...@@ -342,7 +343,7 @@ static int Activate( vlc_object_t *p_this )
p_sys->b_quiet = var_InheritBool( p_intf, "rc-quiet" ); p_sys->b_quiet = var_InheritBool( p_intf, "rc-quiet" );
# if !VLC_WINSTORE_APP # if !VLC_WINSTORE_APP
if( !p_sys->b_quiet ) if( !p_sys->b_quiet )
CONSOLE_INTRO_MSG; intf_consoleIntroMsg( p_intf );
# endif # endif
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment