* fileinfo.cpp : wxWindows plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
- * $Id: fileinfo.cpp,v 1.16 2003/06/09 19:08:33 asmax Exp $
+ * $Id: fileinfo.cpp,v 1.17 2003/07/12 13:33:10 gbazin Exp $
*
* Authors: Sigmund Augdal <sigmunau@idi.ntnu.no>
*
fileinfo_root_label = wxT("");
/* Create the OK button */
- wxButton *ok_button = new wxButton( panel, wxID_OK, wxU(_("OK")) );
+ wxButton *ok_button = new wxButton( panel, wxID_OK, wxU(_("Close")) );
ok_button->SetDefault();
/* Place everything in sizers */
* interface.cpp : wxWindows plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
- * $Id: interface.cpp,v 1.44 2003/07/09 21:42:28 gbazin Exp $
+ * $Id: interface.cpp,v 1.45 2003/07/12 13:33:10 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
{
/* menu items */
Exit_Event = wxID_HIGHEST,
+ OpenFileSimple_Event,
OpenFile_Event,
OpenDisc_Event,
OpenNet_Event,
EVT_RIGHT_UP(Interface::OnContextMenu)
/* Toolbar events */
+ EVT_MENU(OpenFileSimple_Event, Interface::OnOpenFileSimple)
EVT_MENU(OpenFile_Event, Interface::OnOpenFile)
EVT_MENU(OpenDisc_Event, Interface::OnOpenDisc)
EVT_MENU(OpenNet_Event, Interface::OnOpenNet)
p_prefs_dialog = NULL;
i_old_playing_status = PAUSE_S;
p_open_dialog = NULL;
+ p_file_dialog = NULL;
/* Give our interface a nice little icon */
p_intf->p_sys->p_icon = new wxIcon( vlc_xpm );
/* Clean up */
if( p_open_dialog ) delete p_open_dialog;
if( p_prefs_dialog ) p_prefs_dialog->Destroy();
+ if( p_file_dialog ) delete p_file_dialog;
if( p_intf->p_sys->p_icon ) delete p_intf->p_sys->p_icon;
}
/* Create the "File" menu */
wxMenu *file_menu = new wxMenu;
- file_menu->Append( OpenFile_Event, wxU(_("&Open File...")),
+ file_menu->Append( OpenFileSimple_Event, wxU(_("Simple &Open ...")),
+ wxU(_(HELP_FILE)) );
+ file_menu->Append( OpenFile_Event, wxU(_("Open &File...")),
wxU(_(HELP_FILE)) );
file_menu->Append( OpenDisc_Event, wxU(_("Open &Disc...")),
wxU(_(HELP_DISC)) );
- file_menu->Append( OpenNet_Event, wxU(_("&Network Stream...")),
+ file_menu->Append( OpenNet_Event, wxU(_("Open &Network Stream...")),
wxU(_(HELP_NET)) );
#if 0
- file_menu->Append( OpenSat_Event, wxU(_("&Satellite Stream...")),
+ file_menu->Append( OpenSat_Event, wxU(_("Open &Satellite Stream...")),
wxU(_(HELP_NET)) );
#endif
#if 0
}
}
+void Interface::OnOpenFileSimple( wxCommandEvent& WXUNUSED(event) )
+{
+ playlist_t *p_playlist =
+ (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
+ FIND_ANYWHERE );
+ if( p_playlist == NULL )
+ {
+ return;
+ }
+
+ if( p_file_dialog == NULL )
+ p_file_dialog = new wxFileDialog( this, wxU(_("Open file")),
+ wxT(""), wxT(""), wxT("*"), wxOPEN | wxMULTIPLE );
+
+ if( p_file_dialog && p_file_dialog->ShowModal() == wxID_OK )
+ {
+ wxArrayString paths;
+
+ p_file_dialog->GetPaths( paths );
+
+ for( size_t i = 0; i < paths.GetCount(); i++ )
+ playlist_Add( p_playlist, (const char *)paths[i].mb_str(),
+ PLAYLIST_APPEND | (i ? 0 : PLAYLIST_GO),
+ PLAYLIST_END );
+ }
+
+ vlc_object_release( p_playlist );
+}
+
void Interface::OnOpenFile( wxCommandEvent& WXUNUSED(event) )
{
Open( FILE_ACCESS );
* playlist.cpp : wxWindows plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
- * $Id: messages.cpp,v 1.11 2003/07/11 23:14:03 gbazin Exp $
+ * $Id: messages.cpp,v 1.12 2003/07/12 13:33:10 gbazin Exp $
*
* Authors: Olivier Teulière <ipkiss@via.ecp.fr>
*
dbg_attr = new wxTextAttr( *wxBLACK );
/* Create the OK button */
- wxButton *ok_button = new wxButton( messages_panel, wxID_OK, wxU(_("OK")));
+ wxButton *ok_button = new wxButton( messages_panel, wxID_OK,
+ wxU(_("Close")));
ok_button->SetDefault();
/* Create the Clear button */
- wxButton *clear_button = new wxButton( messages_panel, wxID_CLEAR, wxU(_("Clear")));
+ wxButton *clear_button = new wxButton( messages_panel, wxID_CLEAR,
+ wxU(_("Clear")));
clear_button->SetDefault();
/* Create the Save Log button */
- wxButton *save_log_button = new wxButton( messages_panel, wxID_SAVEAS, wxU(_("Save As...")));
+ wxButton *save_log_button = new wxButton( messages_panel, wxID_SAVEAS,
+ wxU(_("Save As...")));
save_log_button->SetDefault();
/* Create the Verbose checkbox */
wxBoxSizer *buttons_sizer = new wxBoxSizer( wxHORIZONTAL );
buttons_sizer->Add( ok_button, 0, wxEXPAND |wxALIGN_LEFT| wxALL, 5 );
buttons_sizer->Add( clear_button, 0, wxEXPAND |wxALIGN_LEFT| wxALL, 5 );
- buttons_sizer->Add( save_log_button, 0, wxEXPAND |wxALIGN_LEFT| wxALL, 5 );
+ buttons_sizer->Add( save_log_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->Add( verbose_checkbox, 0, wxEXPAND|wxALIGN_RIGHT|wxALL, 5 );
buttons_sizer->Layout();
wxBoxSizer *main_sizer = new wxBoxSizer( wxVERTICAL );
wxBoxSizer *panel_sizer = new wxBoxSizer( wxVERTICAL );
void Messages::OnSaveLog( wxCommandEvent& WXUNUSED(event) )
{
if( save_log_dialog == NULL )
- save_log_dialog = new wxFileDialog( this, wxU(_("Save Messages As a file...")),
+ save_log_dialog = new wxFileDialog( this,
+ wxU(_("Save Messages As a file...")),
wxT(""), wxT("messages"), wxT("*"), wxSAVE | wxOVERWRITE_PROMPT );
if( save_log_dialog && save_log_dialog->ShowModal() == wxID_OK )
{
- if( !textctrl->SaveFile( save_log_dialog->GetPath() ) )
- {
- // [FIX ME] should print an error message
- }
+ if( !textctrl->SaveFile( save_log_dialog->GetPath() ) )
+ {
+ // [FIX ME] should print an error message
+ }
}
}
* playlist.cpp : wxWindows plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
- * $Id: playlist.cpp,v 1.11 2003/05/20 23:17:59 gbazin Exp $
+ * $Id: playlist.cpp,v 1.12 2003/07/12 13:33:10 gbazin Exp $
*
* Authors: Olivier Teulière <ipkiss@via.ecp.fr>
*
enum
{
/* menu items */
- AddMRL_Event = 1,
+ AddFile_Event = 1,
+ AddMRL_Event,
Close_Event,
Open_Event,
Save_Event,
BEGIN_EVENT_TABLE(Playlist, wxFrame)
/* Menu events */
+ EVT_MENU(AddFile_Event, Playlist::OnAddFile)
EVT_MENU(AddMRL_Event, Playlist::OnAddMRL)
EVT_MENU(Close_Event, Playlist::OnClose)
EVT_MENU(Open_Event, Playlist::OnOpen)
/* Create our "Manage" menu */
wxMenu *manage_menu = new wxMenu;
+ manage_menu->Append( AddFile_Event, wxU(_("&Simple Add...")) );
manage_menu->Append( AddMRL_Event, wxU(_("&Add MRL...")) );
manage_menu->Append( Open_Event, wxU(_("&Open Playlist...")) );
manage_menu->Append( Save_Event, wxU(_("&Save Playlist...")) );
vlc_object_release( p_playlist );
}
+void Playlist::OnAddFile( wxCommandEvent& WXUNUSED(event) )
+{
+ playlist_t *p_playlist =
+ (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
+ FIND_ANYWHERE );
+ if( p_playlist == NULL )
+ {
+ return;
+ }
+
+ if( p_main_interface->p_file_dialog == NULL )
+ p_main_interface->p_file_dialog =
+ new wxFileDialog( this, wxU(_("Open file")), wxT(""), wxT(""),
+ wxT("*"), wxOPEN | wxMULTIPLE );
+
+ if( p_main_interface->p_file_dialog &&
+ p_main_interface->p_file_dialog->ShowModal() == wxID_OK )
+ {
+ wxArrayString paths;
+
+ p_main_interface->p_file_dialog->GetPaths( paths );
+
+ for( size_t i = 0; i < paths.GetCount(); i++ )
+ playlist_Add( p_playlist, (const char *)paths[i].mb_str(),
+ PLAYLIST_APPEND, PLAYLIST_END );
+ }
+
+ vlc_object_release( p_playlist );
+
+ Rebuild();
+}
+
void Playlist::OnAddMRL( wxCommandEvent& WXUNUSED(event) )
{
playlist_t *p_playlist =
* streamout.cpp : wxWindows plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
- * $Id: streamout.cpp,v 1.23 2003/07/11 23:36:01 gbazin Exp $
+ * $Id: streamout.cpp,v 1.24 2003/07/12 13:33:10 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
void SoutDialog::OnFileBrowse( wxCommandEvent& WXUNUSED(event) )
{
- wxFileDialog dialog( this, wxU(_("Save file")),
- wxT(""), wxT(""), wxT("*"), wxSAVE );
+ wxFileDialog dialog( this, wxU(_("Save file")), wxT(""), wxT(""), wxT("*"),
+ wxSAVE | wxOVERWRITE_PROMPT );
if( dialog.ShowModal() == wxID_OK )
{
* wxwindows.h: private wxWindows interface description
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: wxwindows.h,v 1.41 2003/07/11 23:36:01 gbazin Exp $
+ * $Id: wxwindows.h,v 1.42 2003/07/12 13:33:10 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
* (and keep the last settings) */
OpenDialog *p_open_dialog;
+ /* idem for the simple open file dialog */
+ wxFileDialog *p_file_dialog;
+
private:
void CreateOurMenuBar();
void CreateOurToolBar();
void OnFileInfo( wxCommandEvent& event );
void OnPreferences( wxCommandEvent& event );
+ void OnOpenFileSimple( wxCommandEvent& event );
void OnOpenFile( wxCommandEvent& event );
void OnOpenDisc( wxCommandEvent& event );
void OnOpenNet( wxCommandEvent& event );
FILE_ACCESS = 0,
DISC_ACCESS,
NET_ACCESS,
- SAT_ACCESS
+ SAT_ACCESS,
+ FILE_SIMPLE_ACCESS
};
/* Stream output Dialog */
void DeleteItem( int item );
/* Event handlers (these functions should _not_ be virtual) */
+ void OnAddFile( wxCommandEvent& event );
void OnAddMRL( wxCommandEvent& event );
void OnClose( wxCommandEvent& event );
void OnOpen( wxCommandEvent& event );