Changeset e34daedfae3bc4f23ddef242c3d3a41eb3655c29

Show
Ignore:
Timestamp:
07/24/05 23:03:20 (3 years ago)
Author:
Antoine Cellerier <dionoea@videolan.org>
git-committer:
Antoine Cellerier <dionoea@videolan.org> 1122239000 +0000
git-parent:

[5bbb474823d50199337b9b090b62e69d048be8f7]

git-author:
Antoine Cellerier <dionoea@videolan.org> 1122239000 +0000
Message:

VLC update checker in the wxWidgets interface (in help menu)

xml files used for the updates are located at http://update.videolan.org

extensive testing ... code cleaning ... would be greatly appreciated

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • include/vlc_interface.h

    rfe087a3 re34daed  
    158158#define INTF_DIALOG_FILE_GENERIC 30 
    159159 
     160#define INTF_DIALOG_UPDATEVLC   90 
     161 
    160162#define INTF_DIALOG_EXIT       99 
    161163 
  • modules/gui/wxwindows/Modules.am

    rab6cc32 re34daed  
    1818    timer.cpp \ 
    1919    fileinfo.cpp \ 
     20    updatevlc.cpp \ 
    2021    subtitles.cpp \ 
    2122    bookmarks.cpp \ 
  • modules/gui/wxwindows/dialogs.cpp

    rfe087a3 re34daed  
    5151 
    5252    /* Event handlers (these functions should _not_ be virtual) */ 
     53    void OnUpdateVLC( wxCommandEvent& event ); 
    5354    void OnExit( wxCommandEvent& event ); 
    5455    void OnPlaylist( wxCommandEvent& event ); 
     
    9091    wxWindow            *p_bookmarks_dialog; 
    9192    wxFileDialog        *p_file_generic_dialog; 
     93    UpdateVLC           *p_updatevlc_dialog; 
    9294}; 
    9395 
     
    127129    EVT_COMMAND(INTF_DIALOG_EXIT, wxEVT_DIALOG, 
    128130                DialogsProvider::OnExitThread) 
     131    EVT_COMMAND(INTF_DIALOG_UPDATEVLC, wxEVT_DIALOG, 
     132                DialogsProvider::OnUpdateVLC) 
    129133END_EVENT_TABLE() 
    130134 
     
    152156    p_bookmarks_dialog = NULL; 
    153157    p_dir_dialog = NULL; 
     158    p_updatevlc_dialog = NULL; 
    154159 
    155160    /* Give our interface a nice little icon */ 
     
    220225    if( p_wizard_dialog ) delete p_wizard_dialog; 
    221226    if( p_bookmarks_dialog ) delete p_bookmarks_dialog; 
     227    if( p_updatevlc_dialog ) delete p_updatevlc_dialog; 
    222228 
    223229 
     
    480486    wxTheApp->ExitMainLoop(); 
    481487} 
     488 
     489void DialogsProvider::OnUpdateVLC( wxCommandEvent& WXUNUSED(event) ) 
     490{ 
     491    /* Show/hide the file info window */ 
     492    if( !p_updatevlc_dialog ) 
     493        p_updatevlc_dialog = new UpdateVLC( p_intf, this ); 
     494 
     495    if( p_updatevlc_dialog ) 
     496    { 
     497        p_updatevlc_dialog->Show( !p_updatevlc_dialog->IsShown() ); 
     498    } 
     499} 
  • modules/gui/wxwindows/interface.cpp

    rfe087a3 re34daed  
    157157     * (where it is special and put into the "Apple" menu) */ 
    158158    About_Event = wxID_ABOUT, 
     159    UpdateVLC_Event, 
    159160 
    160161    Iconize_Event 
     
    165166    EVT_MENU(Exit_Event, Interface::OnExit) 
    166167    EVT_MENU(About_Event, Interface::OnAbout) 
     168    EVT_MENU(UpdateVLC_Event, Interface::OnShowDialog) 
    167169 
    168170    EVT_MENU(Playlist_Event, Interface::OnShowDialog) 
     
    433435    wxMenu *help_menu = new wxMenu; 
    434436    help_menu->Append( About_Event, wxU(_("About VLC media player")) ); 
     437    help_menu->AppendSeparator(); 
     438    help_menu->Append( UpdateVLC_Event, wxU(_("Check for updates ...")) ); 
    435439 
    436440    /* Append the freshly created menus to the menu bar... */ 
     
    914918            i_id = INTF_DIALOG_BOOKMARKS; 
    915919            break; 
     920        case UpdateVLC_Event: 
     921            i_id = INTF_DIALOG_UPDATEVLC; 
     922            break; 
    916923        default: 
    917924            i_id = INTF_DIALOG_FILE; 
  • modules/gui/wxwindows/wxwindows.h

    re69d314 re34daed  
    3030#define WXINTL_NO_GETTEXT_MACRO 
    3131 
     32#include <list> 
     33 
    3234#include <wx/wxprec.h> 
    3335#include <wx/wx.h> 
     
    10481050}; 
    10491051 
     1052/* Update VLC */ 
     1053class UpdateVLC: public wxFrame 
     1054{ 
     1055public: 
     1056    /* Constructor */ 
     1057    UpdateVLC( intf_thread_t *p_intf, wxWindow *p_parent ); 
     1058    virtual ~UpdateVLC(); 
     1059 
     1060private: 
     1061    void OnButtonClose( wxCommandEvent& event ); 
     1062    void OnClose( wxCloseEvent& WXUNUSED(event) ); 
     1063    void GetData(); 
     1064    void OnCheckForUpdate( wxCommandEvent& event ); 
     1065    void OnMirrorChoice( wxCommandEvent& event ); 
     1066    void UpdateUpdatesTree(); 
     1067    void UpdateMirrorsChoice(); 
     1068    void OnUpdatesTreeActivate( wxTreeEvent& event ); 
     1069    void DownloadFile( wxString url, wxString dst ); 
     1070 
     1071    DECLARE_EVENT_TABLE(); 
     1072 
     1073    intf_thread_t *p_intf; 
     1074    wxTreeCtrl *updates_tree; 
     1075    wxTreeItemId updates_root; 
     1076 
     1077    wxChoice *mirrors_choice; 
     1078 
     1079    wxString release_type; /* could be "stable", "test", "nightly" ... */ 
     1080 
     1081    struct update_file_t 
     1082    { 
     1083        wxString type; 
     1084        wxString md5; 
     1085        wxString size; 
     1086        wxString url; 
     1087        wxString description; 
     1088    }; 
     1089 
     1090    struct update_version_t 
     1091    { 
     1092        wxString type; 
     1093        wxString major; 
     1094        wxString minor; 
     1095        wxString revision; 
     1096        wxString extra; 
     1097        std::list<update_file_t> m_files; 
     1098    }; 
     1099 
     1100    std::list<update_version_t> m_versions; 
     1101 
     1102    struct update_mirror_t 
     1103    { 
     1104        wxString name; 
     1105        wxString location; 
     1106        wxString type; 
     1107        wxString base_url; 
     1108    }; 
     1109 
     1110    std::list<update_mirror_t> m_mirrors; 
     1111}; 
     1112 
    10501113#if wxUSE_DRAG_AND_DROP 
    10511114/* Drag and Drop class */