* playlist.cpp : wxWindows plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
- * $Id: messages.cpp,v 1.1 2002/12/15 22:45:09 ipkiss Exp $
+ * $Id: messages.cpp,v 1.6 2003/05/12 17:33:19 gbazin Exp $
*
* Authors: Olivier Teulière <ipkiss@via.ecp.fr>
*
#include <vlc/intf.h>
+#if defined MODULE_NAME_IS_skins
+# include "../skins/src/skin_common.h"
+#endif
+
#include "wxwindows.h"
/*****************************************************************************
/* IDs for the controls and the menu commands */
enum
{
- Close_Event
+ Close_Event,
+ Verbose_Event
};
BEGIN_EVENT_TABLE(Messages, wxFrame)
/* Button events */
EVT_BUTTON(wxID_OK, Messages::OnClose)
+ EVT_CHECKBOX(Verbose_Event, Messages::OnVerbose)
/* Special events : we don't want to destroy the window when the user
* clicks on (X) */
* Constructor.
*****************************************************************************/
Messages::Messages( intf_thread_t *_p_intf, Interface *_p_main_interface ):
- wxFrame( _p_main_interface, -1, "Messages", wxDefaultPosition,
+ wxFrame( _p_main_interface, -1, wxU(_("Messages")), wxDefaultPosition,
wxDefaultSize, wxDEFAULT_FRAME_STYLE )
{
/* Initializations */
p_intf = _p_intf;
p_main_interface = _p_main_interface;
+ b_verbose = VLC_FALSE;
+ SetIcon( *p_intf->p_sys->p_icon );
/* Create a panel to put everything in */
wxPanel *messages_panel = new wxPanel( this, -1 );
messages_panel->SetAutoLayout( TRUE );
/* Create the textctrl and some text attributes */
- textctrl = new wxTextCtrl( messages_panel, -1, "", wxDefaultPosition,
+ textctrl = new wxTextCtrl( messages_panel, -1, wxT(""), wxDefaultPosition,
wxSize::wxSize( 400, 500 ), wxTE_MULTILINE | wxTE_READONLY |
wxTE_RICH | wxTE_NOHIDESEL );
info_attr = new wxTextAttr( wxColour::wxColour( 0, 128, 0 ) );
dbg_attr = new wxTextAttr( *wxBLACK );
/* Create the OK button */
- ok_button = new wxButton( messages_panel, wxID_OK, _("OK") );
+ wxButton *ok_button = new wxButton( messages_panel, wxID_OK, wxU(_("OK")));
ok_button->SetDefault();
+ /* Create the Verbose checkbox */
+ wxCheckBox *verbose_checkbox =
+ new wxCheckBox( messages_panel, Verbose_Event, wxU(_("Verbose")) );
+
/* Place everything in sizers */
- wxBoxSizer *ok_button_sizer = new wxBoxSizer( wxHORIZONTAL );
- ok_button_sizer->Add( ok_button, 0, wxALL, 5 );
- ok_button_sizer->Layout();
+ wxBoxSizer *buttons_sizer = new wxBoxSizer( wxHORIZONTAL );
+ buttons_sizer->Add( ok_button, 0, wxEXPAND |wxALIGN_LEFT| wxALL, 5 );
+ buttons_sizer->Add( new wxPanel( this, -1 ), 1, wxALL, 5 );
+ buttons_sizer->Add( verbose_checkbox, 0, wxEXPAND |wxALIGN_RIGHT | wxALL, 5 );
+ buttons_sizer->Layout();
wxBoxSizer *main_sizer = new wxBoxSizer( wxVERTICAL );
wxBoxSizer *panel_sizer = new wxBoxSizer( wxVERTICAL );
panel_sizer->Add( textctrl, 1, wxEXPAND | wxALL, 5 );
- panel_sizer->Add( ok_button_sizer, 0, wxALIGN_CENTRE );
+ panel_sizer->Add( buttons_sizer, 0, wxEXPAND | wxALL, 5 );
panel_sizer->Layout();
messages_panel->SetSizerAndFit( panel_sizer );
main_sizer->Add( messages_panel, 1, wxGROW, 0 );
i_start != i_stop;
i_start = (i_start+1) % VLC_MSG_QSIZE )
{
+
+ if( !b_verbose &&
+ VLC_MSG_ERR != p_sub->p_msg[i_start].i_type &&
+ VLC_MSG_INFO != p_sub->p_msg[i_start].i_type )
+ continue;
+
/* Append all messages to log window */
textctrl->SetDefaultStyle( *dbg_attr );
- (*textctrl) << p_sub->p_msg[i_start].psz_module;
+ (*textctrl) << wxU(p_sub->p_msg[i_start].psz_module);
switch( p_sub->p_msg[i_start].i_type )
{
case VLC_MSG_INFO:
- (*textctrl) << ": ";
+ (*textctrl) << wxT(": ");
textctrl->SetDefaultStyle( *info_attr );
break;
case VLC_MSG_ERR:
- (*textctrl) << " error: ";
+ (*textctrl) << wxT(" error: ");
textctrl->SetDefaultStyle( *err_attr );
break;
case VLC_MSG_WARN:
- (*textctrl) << " warning: ";
+ (*textctrl) << wxT(" warning: ");
textctrl->SetDefaultStyle( *warn_attr );
break;
case VLC_MSG_DBG:
default:
- (*textctrl) << " debug: ";
+ (*textctrl) << wxT(" debug: ");
break;
}
/* Add message */
- (*textctrl) << p_sub->p_msg[i_start].psz_msg << "\n";
+ (*textctrl) << wxU(p_sub->p_msg[i_start].psz_msg) << wxT("\n");
}
vlc_mutex_lock( p_sub->p_lock );
Hide();
}
+void Messages::OnVerbose( wxCommandEvent& event )
+{
+ b_verbose = event.IsChecked();
+}