1 /*****************************************************************************
2 * updatevlc.cpp : VLC Update checker
3 *****************************************************************************
4 * Copyright (C) 2000-2004 the VideoLAN team
7 * Authors: Antoine Cellerier <dionoea@videolan.org>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22 *****************************************************************************/
25 /*****************************************************************************
27 *****************************************************************************/
28 #include "updatevlc.hpp"
31 #include <wx/imaglist.h>
33 #include "bitmaps/update_ascii.xpm"
34 #include "bitmaps/update_binary.xpm"
35 #include "bitmaps/update_document.xpm"
36 #include "bitmaps/update_info.xpm"
37 #include "bitmaps/update_source.xpm"
39 /*****************************************************************************
41 *****************************************************************************/
43 /* IDs for the controls and the menu commands */
51 BEGIN_EVENT_TABLE(UpdateVLC, wxFrame)
53 EVT_BUTTON(wxID_OK, UpdateVLC::OnButtonClose)
54 EVT_BUTTON(CheckForUpdate_Event, UpdateVLC::OnCheckForUpdate)
56 /* Hide the window when the user closes the window */
57 EVT_CLOSE(UpdateVLC::OnClose)
61 /*****************************************************************************
63 *****************************************************************************/
64 UpdateVLC::UpdateVLC( intf_thread_t *_p_intf, wxWindow *p_parent ):
65 wxFrame( p_parent, -1, wxU(_("Updates")),
66 wxDefaultPosition, wxDefaultSize,
67 wxSYSTEM_MENU|wxCLOSE_BOX|wxFRAME_FLOAT_ON_PARENT
68 |wxFRAME_TOOL_WINDOW|wxCAPTION )
72 SetIcon( *p_intf->p_sys->p_icon );
73 SetAutoLayout( TRUE );
75 wxBoxSizer *main_sizer = new wxBoxSizer( wxVERTICAL );
76 wxButton *update_button =
77 new wxButton( this, CheckForUpdate_Event,
78 wxU(_("Check for updates")) );
79 main_sizer->Add( update_button );
80 SetSizerAndFit( main_sizer );
82 p_update = update_New( p_intf );
86 UpdateVLC::~UpdateVLC()
88 update_Delete( p_update );
91 void UpdateVLC::OnButtonClose( wxCommandEvent& event )
97 void UpdateVLC::OnClose( wxCloseEvent& WXUNUSED(event) )
102 void UpdateVLC::OnCheckForUpdate( wxCommandEvent& event )
104 update_Check( p_update, NULL, this );
105 wxBoxSizer *main_sizer = new wxBoxSizer( wxVERTICAL );
109 /*list->InsertItem( list->GetItemCount(),
110 wxU(p_uit->file.psz_description)+wxU("\n")
111 + wxU(p_uit->release.psz_version)+wxU(" ")
115 if( update_NeedUpgrade( p_update ) )
116 main_sizer->Add( new wxStaticText( this, -1, wxU( p_update->release.psz_desc )
117 + wxU( "\nYou can download the latest version of VLC at the adress :\n" )
118 + wxU( p_update->release.psz_url ) ) );
120 main_sizer->Add( new wxStaticText( this, -1,
121 wxU( _( "\nYou have the latest version of VLC\n" ) ) ) );
123 SetSizerAndFit( main_sizer );