]> git.sesse.net Git - vlc/commitdiff
* port of the wx-update-panel to OSX (GUI works, updating itself is not yet implement...
authorFelix Paul Kühne <fkuehne@videolan.org>
Sun, 21 Aug 2005 17:45:05 +0000 (17:45 +0000)
committerFelix Paul Kühne <fkuehne@videolan.org>
Sun, 21 Aug 2005 17:45:05 +0000 (17:45 +0000)
Makefile.am
extras/MacOSX/Resources/English.lproj/MainMenu.nib/classes.nib
extras/MacOSX/Resources/English.lproj/MainMenu.nib/info.nib
extras/MacOSX/Resources/English.lproj/MainMenu.nib/keyedobjects.nib
extras/MacOSX/Resources/English.lproj/Update.nib/classes.nib [new file with mode: 0644]
extras/MacOSX/Resources/English.lproj/Update.nib/info.nib [new file with mode: 0644]
extras/MacOSX/Resources/English.lproj/Update.nib/keyedobjects.nib [new file with mode: 0644]
extras/MacOSX/vlc.pbproj/project.pbxproj
modules/gui/macosx/Modules.am
modules/gui/macosx/update.h [new file with mode: 0644]
modules/gui/macosx/update.m [new file with mode: 0644]

index 23d56c994a60b9ab7125993e406556edfc5f03b3..905de86d21ac55272e09890adb5b09a5c9cdac25 100644 (file)
@@ -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; \
index c1955a7c811347e8879c662f6067fa2030ec6cec..cbbc108fee2c19318d0e06f3766a8eee488e67d4 100644 (file)
@@ -92,6 +92,7 @@
         }, 
         {
             ACTIONS = {
+                checkForUpdate = id; 
                 clearRecentItems = id; 
                 closeError = id; 
                 intfOpenDisc = id; 
                 "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; 
index fe95db48ecc2f896f81bcaacd2deb21fdebf309a..11e5056bef5532b6449978f141742e36ad4fc577 100644 (file)
@@ -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>
index 59589ecd891a9ac60d817e721b784abab0647770..8ee234930918b836e9b76e69b1336d4a14c183c5 100644 (file)
Binary files a/extras/MacOSX/Resources/English.lproj/MainMenu.nib/keyedobjects.nib and b/extras/MacOSX/Resources/English.lproj/MainMenu.nib/keyedobjects.nib differ
diff --git a/extras/MacOSX/Resources/English.lproj/Update.nib/classes.nib b/extras/MacOSX/Resources/English.lproj/Update.nib/classes.nib
new file mode 100644 (file)
index 0000000..a64036c
--- /dev/null
@@ -0,0 +1,37 @@
+{
+    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
diff --git a/extras/MacOSX/Resources/English.lproj/Update.nib/info.nib b/extras/MacOSX/Resources/English.lproj/Update.nib/info.nib
new file mode 100644 (file)
index 0000000..2cca7ef
--- /dev/null
@@ -0,0 +1,17 @@
+<?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>
diff --git a/extras/MacOSX/Resources/English.lproj/Update.nib/keyedobjects.nib b/extras/MacOSX/Resources/English.lproj/Update.nib/keyedobjects.nib
new file mode 100644 (file)
index 0000000..63f4317
Binary files /dev/null and b/extras/MacOSX/Resources/English.lproj/Update.nib/keyedobjects.nib differ
index 30777a619bc6f8ca8ea47a346ebc74887ac53f21..e9338a07f69b95fc75c63ba07f78a2ab47e8e3d8 100644 (file)
                                DCFCCDB9085CE18F001E36AF,
                                DC7F46ED08A183FC0027DB24,
                                DCE7BD0508A56C8B007B10AE,
+                               DCF49B4308B50FAF007E304F,
                        );
                        isa = PBXResourcesBuildPhase;
                        runOnlyForDeploymentPostprocessing = 0;
                                DC7F46F108A187F60027DB24,
                                DCE7BD0708A5724D007B10AE,
                                DCE7BD0608A5724D007B10AE,
+                               DCF49B4408B51992007E304F,
+                               DCF49B4508B51992007E304F,
                        );
                        isa = PBXGroup;
                        name = Classes;
                                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,
index 79c60f666a487416a438451520e851eca20bdc85..02fbb9953fd5853027dfb755a1eca03b47b92465 100644 (file)
@@ -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)
 
diff --git a/modules/gui/macosx/update.h b/modules/gui/macosx/update.h
new file mode 100644 (file)
index 0000000..41d2d8d
--- /dev/null
@@ -0,0 +1,63 @@
+/*****************************************************************************
+ * update.h: MacOS X Check-For-Update window
+ *****************************************************************************
+ * Copyright (C) 2005 the VideoLAN team
+ * $Id$
+ *
+ * Authors: Felix K\9fhne <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
diff --git a/modules/gui/macosx/update.m b/modules/gui/macosx/update.m
new file mode 100644 (file)
index 0000000..425b5a7
--- /dev/null
@@ -0,0 +1,130 @@
+/*****************************************************************************
+ * update.m: MacOS X Check-For-Update window
+ *****************************************************************************
+ * Copyright (C) 2005 the VideoLAN team
+ * $Id$
+ *
+ * Authors: Felix K\9fhne <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