1 /*****************************************************************************
2 * update.m: MacOS X Check-For-Update window
3 *****************************************************************************
4 * Copyright (C) 2005 the VideoLAN team
7 * Authors: Felix K
\9fhne <fkuehne@users.sf.net>
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., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
22 *****************************************************************************/
25 /*****************************************************************************
27 * the code used to bind with VLC's core and the download of files is heavily
28 * based upon ../wxwidgets/updatevlc.cpp, written by Antoine Cellerier.
29 * (he is a member of the VideoLAN team)
30 *****************************************************************************/
33 /*****************************************************************************
35 *****************************************************************************/
43 #import "vlc_stream.h"
46 #define UPDATE_VLC_OS "macosx"
47 #define UPDATE_VLC_ARCH "ppc"
50 /*****************************************************************************
51 * VLCExtended implementation
52 *****************************************************************************/
54 @implementation VLCUpdate
56 static VLCUpdate *_o_sharedInstance = nil;
58 + (VLCUpdate *)sharedInstance
60 return _o_sharedInstance ? _o_sharedInstance : [[self alloc] init];
65 if (_o_sharedInstance) {
68 _o_sharedInstance = [super init];
71 return _o_sharedInstance;
76 /* clean the interface */
77 [o_fld_userVersion setStringValue: [[[NSBundle mainBundle] infoDictionary] \
78 objectForKey:@"CFBundleVersion"]];
79 [o_fld_releaseNote setString: @""];
80 [o_fld_releasedOn setStringValue: @""];
81 [o_fld_size setStringValue: @""];
82 [o_fld_currentVersion setStringValue: @""];
89 /* translate strings to the user's language */
90 [o_btn_cancel setTitle: _NS("Cancel")];
91 [o_btn_DownloadNow setTitle: _NS("Download now")];
92 [o_btn_okay setTitle: _NS("OK")];
93 [o_lbl_currentVersion setStringValue: [_NS("Current version") \
94 stringByAppendingString: @":"]];
95 [o_lbl_releasedOn setStringValue: [_NS("Released on") \
96 stringByAppendingString: @":"]];
97 [o_lbl_size setStringValue: [_NS("Size") \
98 stringByAppendingString: @":"]];
99 [o_lbl_userVersion setStringValue: [_NS("Your version") \
100 stringByAppendingString: @":"]];
101 [o_lbl_mirror setStringValue: [_NS("Mirror") \
102 stringByAppendingString: @":"]];
103 [o_lbl_checkForUpdate setStringValue: _NS("Checking for update...")];
106 - (void)showUpdateWindow
108 /* show the window and check for a potential update */
109 [o_update_window center];
110 [o_update_window displayIfNeeded];
111 [o_update_window makeKeyAndOrderFront:nil];
114 - (IBAction)cancel:(id)sender
116 /* cancel the download and close the sheet */
119 - (IBAction)download:(id)sender
121 /* open the sheet and start the download */
124 - (IBAction)okay:(id)sender
126 /* just close the window */
127 [o_update_window close];