Commit c2ec2634 authored by Felix Paul Kühne's avatar Felix Paul Kühne

* port of the wx-update-panel to OSX (GUI works, updating itself is not yet implemented, refs #310)

parent e67ac812
......@@ -174,6 +174,12 @@ EXTRA_DIST += \
extras/MacOSX/Resources/English.lproj/Bookmarks.nib/classes.nib \
extras/MacOSX/Resources/English.lproj/Bookmarks.nib/info.nib \
extras/MacOSX/Resources/English.lproj/Bookmarks.nib/keyedobjects.nib \
extras/MacOSX/Resources/English.lproj/Extended.nib/classes.nib \
extras/MacOSX/Resources/English.lproj/Extended.nib/info.nib \
extras/MacOSX/Resources/English.lproj/Extended.nib/keyedobjects.nib \
extras/MacOSX/Resources/English.lproj/Update.nib/classes.nib \
extras/MacOSX/Resources/English.lproj/Update.nib/info.nib \
extras/MacOSX/Resources/English.lproj/Update.nib/keyedobjects.nib \
extras/MacOSX/Resources/English.lproj/InfoPlist.strings \
extras/MacOSX/Resources/a52.icns \
extras/MacOSX/Resources/aac.icns \
......@@ -598,6 +604,8 @@ VLC-release.app: vlc
extended.m \
bookmarks.h \
bookmarks.m \
update.h \
update.m \
vout.m; do \
cp "$(srcdir)/modules/gui/macosx/$$i" \
$(top_builddir)/tmp/modules/gui/macosx; \
......@@ -712,6 +720,8 @@ VLC.app: vlc
extended.m \
bookmarks.h \
bookmarks.m \
update.h \
update.m \
vout.m; do \
cp "$(srcdir)/modules/gui/macosx/$$i" \
$(top_builddir)/tmp/modules/gui/macosx; \
......
......@@ -92,6 +92,7 @@
},
{
ACTIONS = {
checkForUpdate = id;
clearRecentItems = id;
closeError = id;
intfOpenDisc = id;
......@@ -149,6 +150,7 @@
"o_mi_bwd" = id;
"o_mi_channels" = id;
"o_mi_chapter" = id;
"o_mi_checkForUpdate" = id;
"o_mi_clear" = id;
"o_mi_close_window" = id;
"o_mi_controller" = id;
......
......@@ -22,8 +22,8 @@
<key>IBOpenObjects</key>
<array>
<integer>2029</integer>
<integer>21</integer>
<integer>29</integer>
<integer>21</integer>
</array>
<key>IBSystem Version</key>
<string>8C46</string>
......
{
IBClasses = (
{CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
{
ACTIONS = {cancel = id; download = id; okay = id; };
CLASS = VLCUpdate;
LANGUAGE = ObjC;
OUTLETS = {
"o_bar_checking" = id;
"o_bar_progress" = id;
"o_btn_DownloadNow" = id;
"o_btn_cancel" = id;
"o_btn_okay" = id;
"o_fld_currentVersion" = id;
"o_fld_dest" = id;
"o_fld_elpTime" = id;
"o_fld_releaseNote" = id;
"o_fld_releasedOn" = id;
"o_fld_remTime" = id;
"o_fld_size" = id;
"o_fld_source" = id;
"o_fld_userVersion" = id;
"o_lbl_checkForUpdate" = id;
"o_lbl_currentVersion" = id;
"o_lbl_mirror" = id;
"o_lbl_releasedOn" = id;
"o_lbl_size" = id;
"o_lbl_userVersion" = id;
"o_pop_mirror" = id;
"o_progress_window" = id;
"o_update_window" = id;
};
SUPERCLASS = NSObject;
}
);
IBVersion = 1;
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IBDocumentLocation</key>
<string>69 67 356 240 0 0 1440 878 </string>
<key>IBFramework Version</key>
<string>437.0</string>
<key>IBOpenObjects</key>
<array>
<integer>5</integer>
<integer>7</integer>
</array>
<key>IBSystem Version</key>
<string>8C46</string>
</dict>
</plist>
......@@ -827,6 +827,7 @@
DCFCCDB9085CE18F001E36AF,
DC7F46ED08A183FC0027DB24,
DCE7BD0508A56C8B007B10AE,
DCF49B4308B50FAF007E304F,
);
isa = PBXResourcesBuildPhase;
runOnlyForDeploymentPostprocessing = 0;
......@@ -913,6 +914,8 @@
DC7F46F108A187F60027DB24,
DCE7BD0708A5724D007B10AE,
DCE7BD0608A5724D007B10AE,
DCF49B4408B51992007E304F,
DCF49B4508B51992007E304F,
);
isa = PBXGroup;
name = Classes;
......@@ -2369,12 +2372,55 @@
DCFCCDB7085CE18F001E36AF,
DC7F46EB08A183FC0027DB24,
DCE7BD0308A56C8B007B10AE,
DCF49B4108B50FAF007E304F,
);
isa = PBXGroup;
name = nibs;
refType = 4;
sourceTree = "<group>";
};
DCF49B4108B50FAF007E304F = {
children = (
DCF49B4208B50FAF007E304F,
);
isa = PBXVariantGroup;
name = Update.nib;
path = "";
refType = 4;
sourceTree = "<group>";
};
DCF49B4208B50FAF007E304F = {
isa = PBXFileReference;
lastKnownFileType = wrapper.nib;
name = English;
path = Resources/English.lproj/Update.nib;
refType = 4;
sourceTree = "<group>";
};
DCF49B4308B50FAF007E304F = {
fileRef = DCF49B4108B50FAF007E304F;
isa = PBXBuildFile;
settings = {
};
};
DCF49B4408B51992007E304F = {
fileEncoding = 30;
isa = PBXFileReference;
lastKnownFileType = sourcecode.c.h;
name = update.h;
path = ../../modules/gui/macosx/update.h;
refType = 2;
sourceTree = SOURCE_ROOT;
};
DCF49B4508B51992007E304F = {
fileEncoding = 30;
isa = PBXFileReference;
lastKnownFileType = sourcecode.c.objc;
name = update.m;
path = ../../modules/gui/macosx/update.m;
refType = 2;
sourceTree = SOURCE_ROOT;
};
DCFCCDB7085CE18F001E36AF = {
children = (
DCFCCDB8085CE18F001E36AF,
......
......@@ -32,7 +32,9 @@ SOURCES_macosx = \
wizard.m \
extended.h \
extended.m \
bookmarks.h \
bookmarks.m \
bookmarks.h \
bookmarks.m \
update.h \
update.m \
$(NULL)
/*****************************************************************************
* update.h: MacOS X Check-For-Update window
*****************************************************************************
* Copyright (C) 2005 the VideoLAN team
* $Id$
*
* Authors: Felix Khne <fkuehne@users.sf.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#import <Cocoa/Cocoa.h>
@interface VLCUpdate : NSObject
{
IBOutlet id o_bar_progress;
IBOutlet id o_btn_cancel;
IBOutlet id o_btn_DownloadNow;
IBOutlet id o_btn_okay;
IBOutlet id o_fld_currentVersion;
IBOutlet id o_fld_dest;
IBOutlet id o_fld_elpTime;
IBOutlet id o_fld_releasedOn;
IBOutlet id o_fld_releaseNote;
IBOutlet id o_fld_remTime;
IBOutlet id o_fld_size;
IBOutlet id o_fld_source;
IBOutlet id o_fld_userVersion;
IBOutlet id o_lbl_currentVersion;
IBOutlet id o_lbl_mirror;
IBOutlet id o_lbl_releasedOn;
IBOutlet id o_lbl_size;
IBOutlet id o_lbl_userVersion;
IBOutlet id o_pop_mirror;
IBOutlet id o_progress_window;
IBOutlet id o_update_window;
IBOutlet id o_bar_checking;
IBOutlet id o_lbl_checkForUpdate;
}
- (IBAction)cancel:(id)sender;
- (IBAction)download:(id)sender;
- (IBAction)okay:(id)sender;
- (void)showUpdateWindow;
- (void)initStrings;
+ (VLCUpdate *)sharedInstance;
@end
/*****************************************************************************
* update.m: MacOS X Check-For-Update window
*****************************************************************************
* Copyright (C) 2005 the VideoLAN team
* $Id$
*
* Authors: Felix Khne <fkuehne@users.sf.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
/*****************************************************************************
* Note:
* the code used to bind with VLC's core and the download of files is heavily
* based upon ../wxwidgets/updatevlc.cpp, written by Antoine Cellerier.
* (he is a member of the VideoLAN team)
*****************************************************************************/
/*****************************************************************************
* Preamble
*****************************************************************************/
#import "update.h"
#import "intf.h"
#import <vlc/vlc.h>
#import <vlc/intf.h>
#import "vlc_block.h"
#import "vlc_stream.h"
#import "vlc_xml.h"
#define UPDATE_VLC_OS "macosx"
#define UPDATE_VLC_ARCH "ppc"
/*****************************************************************************
* VLCExtended implementation
*****************************************************************************/
@implementation VLCUpdate
static VLCUpdate *_o_sharedInstance = nil;
+ (VLCUpdate *)sharedInstance
{
return _o_sharedInstance ? _o_sharedInstance : [[self alloc] init];
}
- (id)init
{
if (_o_sharedInstance) {
[self dealloc];
} else {
_o_sharedInstance = [super init];
}
return _o_sharedInstance;
}
- (void)awakeFromNib
{
/* clean the interface */
[o_fld_userVersion setStringValue: [[[NSBundle mainBundle] infoDictionary] \
objectForKey:@"CFBundleVersion"]];
[o_fld_releaseNote setString: @""];
[o_fld_releasedOn setStringValue: @""];
[o_fld_size setStringValue: @""];
[o_fld_currentVersion setStringValue: @""];
[self initStrings];
}
- (void)initStrings
{
/* translate strings to the user's language */
[o_btn_cancel setTitle: _NS("Cancel")];
[o_btn_DownloadNow setTitle: _NS("Download now")];
[o_btn_okay setTitle: _NS("OK")];
[o_lbl_currentVersion setStringValue: [_NS("Current version") \
stringByAppendingString: @":"]];
[o_lbl_releasedOn setStringValue: [_NS("Released on") \
stringByAppendingString: @":"]];
[o_lbl_size setStringValue: [_NS("Size") \
stringByAppendingString: @":"]];
[o_lbl_userVersion setStringValue: [_NS("Your version") \
stringByAppendingString: @":"]];
[o_lbl_mirror setStringValue: [_NS("Mirror") \
stringByAppendingString: @":"]];
[o_lbl_checkForUpdate setStringValue: _NS("Checking for update...")];
}
- (void)showUpdateWindow
{
/* show the window and check for a potential update */
[o_update_window center];
[o_update_window displayIfNeeded];
[o_update_window makeKeyAndOrderFront:nil];
}
- (IBAction)cancel:(id)sender
{
/* cancel the download and close the sheet */
}
- (IBAction)download:(id)sender
{
/* open the sheet and start the download */
}
- (IBAction)okay:(id)sender
{
/* just close the window */
[o_update_window close];
}
@end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment