Changeset e34daedfae3bc4f23ddef242c3d3a41eb3655c29
- 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
| rfe087a3 |
re34daed |
|
| 158 | 158 | #define INTF_DIALOG_FILE_GENERIC 30 |
|---|
| 159 | 159 | |
|---|
| | 160 | #define INTF_DIALOG_UPDATEVLC 90 |
|---|
| | 161 | |
|---|
| 160 | 162 | #define INTF_DIALOG_EXIT 99 |
|---|
| 161 | 163 | |
|---|
| rab6cc32 |
re34daed |
|
| 18 | 18 | timer.cpp \ |
|---|
| 19 | 19 | fileinfo.cpp \ |
|---|
| | 20 | updatevlc.cpp \ |
|---|
| 20 | 21 | subtitles.cpp \ |
|---|
| 21 | 22 | bookmarks.cpp \ |
|---|
| rfe087a3 |
re34daed |
|
| 51 | 51 | |
|---|
| 52 | 52 | /* Event handlers (these functions should _not_ be virtual) */ |
|---|
| | 53 | void OnUpdateVLC( wxCommandEvent& event ); |
|---|
| 53 | 54 | void OnExit( wxCommandEvent& event ); |
|---|
| 54 | 55 | void OnPlaylist( wxCommandEvent& event ); |
|---|
| … | … | |
| 90 | 91 | wxWindow *p_bookmarks_dialog; |
|---|
| 91 | 92 | wxFileDialog *p_file_generic_dialog; |
|---|
| | 93 | UpdateVLC *p_updatevlc_dialog; |
|---|
| 92 | 94 | }; |
|---|
| 93 | 95 | |
|---|
| … | … | |
| 127 | 129 | EVT_COMMAND(INTF_DIALOG_EXIT, wxEVT_DIALOG, |
|---|
| 128 | 130 | DialogsProvider::OnExitThread) |
|---|
| | 131 | EVT_COMMAND(INTF_DIALOG_UPDATEVLC, wxEVT_DIALOG, |
|---|
| | 132 | DialogsProvider::OnUpdateVLC) |
|---|
| 129 | 133 | END_EVENT_TABLE() |
|---|
| 130 | 134 | |
|---|
| … | … | |
| 152 | 156 | p_bookmarks_dialog = NULL; |
|---|
| 153 | 157 | p_dir_dialog = NULL; |
|---|
| | 158 | p_updatevlc_dialog = NULL; |
|---|
| 154 | 159 | |
|---|
| 155 | 160 | /* Give our interface a nice little icon */ |
|---|
| … | … | |
| 220 | 225 | if( p_wizard_dialog ) delete p_wizard_dialog; |
|---|
| 221 | 226 | if( p_bookmarks_dialog ) delete p_bookmarks_dialog; |
|---|
| | 227 | if( p_updatevlc_dialog ) delete p_updatevlc_dialog; |
|---|
| 222 | 228 | |
|---|
| 223 | 229 | |
|---|
| … | … | |
| 480 | 486 | wxTheApp->ExitMainLoop(); |
|---|
| 481 | 487 | } |
|---|
| | 488 | |
|---|
| | 489 | void 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 | } |
|---|
| rfe087a3 |
re34daed |
|
| 157 | 157 | * (where it is special and put into the "Apple" menu) */ |
|---|
| 158 | 158 | About_Event = wxID_ABOUT, |
|---|
| | 159 | UpdateVLC_Event, |
|---|
| 159 | 160 | |
|---|
| 160 | 161 | Iconize_Event |
|---|
| … | … | |
| 165 | 166 | EVT_MENU(Exit_Event, Interface::OnExit) |
|---|
| 166 | 167 | EVT_MENU(About_Event, Interface::OnAbout) |
|---|
| | 168 | EVT_MENU(UpdateVLC_Event, Interface::OnShowDialog) |
|---|
| 167 | 169 | |
|---|
| 168 | 170 | EVT_MENU(Playlist_Event, Interface::OnShowDialog) |
|---|
| … | … | |
| 433 | 435 | wxMenu *help_menu = new wxMenu; |
|---|
| 434 | 436 | help_menu->Append( About_Event, wxU(_("About VLC media player")) ); |
|---|
| | 437 | help_menu->AppendSeparator(); |
|---|
| | 438 | help_menu->Append( UpdateVLC_Event, wxU(_("Check for updates ...")) ); |
|---|
| 435 | 439 | |
|---|
| 436 | 440 | /* Append the freshly created menus to the menu bar... */ |
|---|
| … | … | |
| 914 | 918 | i_id = INTF_DIALOG_BOOKMARKS; |
|---|
| 915 | 919 | break; |
|---|
| | 920 | case UpdateVLC_Event: |
|---|
| | 921 | i_id = INTF_DIALOG_UPDATEVLC; |
|---|
| | 922 | break; |
|---|
| 916 | 923 | default: |
|---|
| 917 | 924 | i_id = INTF_DIALOG_FILE; |
|---|
| re69d314 |
re34daed |
|
| 30 | 30 | #define WXINTL_NO_GETTEXT_MACRO |
|---|
| 31 | 31 | |
|---|
| | 32 | #include <list> |
|---|
| | 33 | |
|---|
| 32 | 34 | #include <wx/wxprec.h> |
|---|
| 33 | 35 | #include <wx/wx.h> |
|---|
| … | … | |
| 1048 | 1050 | }; |
|---|
| 1049 | 1051 | |
|---|
| | 1052 | /* Update VLC */ |
|---|
| | 1053 | class UpdateVLC: public wxFrame |
|---|
| | 1054 | { |
|---|
| | 1055 | public: |
|---|
| | 1056 | /* Constructor */ |
|---|
| | 1057 | UpdateVLC( intf_thread_t *p_intf, wxWindow *p_parent ); |
|---|
| | 1058 | virtual ~UpdateVLC(); |
|---|
| | 1059 | |
|---|
| | 1060 | private: |
|---|
| | 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 | |
|---|
| 1050 | 1113 | #if wxUSE_DRAG_AND_DROP |
|---|
| 1051 | 1114 | /* Drag and Drop class */ |
|---|