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

macosx: implemented 'dialog-login' and cleaned up most dead code

parent b9537dd6
...@@ -120,9 +120,9 @@ EXTRA_DIST += \ ...@@ -120,9 +120,9 @@ EXTRA_DIST += \
extras/package/macosx/Resources/English.lproj/Update.nib/classes.nib \ extras/package/macosx/Resources/English.lproj/Update.nib/classes.nib \
extras/package/macosx/Resources/English.lproj/Update.nib/info.nib \ extras/package/macosx/Resources/English.lproj/Update.nib/info.nib \
extras/package/macosx/Resources/English.lproj/Update.nib/keyedobjects.nib \ extras/package/macosx/Resources/English.lproj/Update.nib/keyedobjects.nib \
extras/package/macosx/Resources/English.lproj/Interaction.nib/classes.nib \ extras/package/macosx/Resources/English.lproj/CoreDialogs.nib/classes.nib \
extras/package/macosx/Resources/English.lproj/Interaction.nib/info.nib \ extras/package/macosx/Resources/English.lproj/CoreDialogs.nib/info.nib \
extras/package/macosx/Resources/English.lproj/Interaction.nib/keyedobjects.nib \ extras/package/macosx/Resources/English.lproj/CoreDialogs.nib/keyedobjects.nib \
extras/package/macosx/Resources/English.lproj/InteractionErrorPanel.nib/classes.nib \ extras/package/macosx/Resources/English.lproj/InteractionErrorPanel.nib/classes.nib \
extras/package/macosx/Resources/English.lproj/InteractionErrorPanel.nib/info.nib \ extras/package/macosx/Resources/English.lproj/InteractionErrorPanel.nib/info.nib \
extras/package/macosx/Resources/English.lproj/InteractionErrorPanel.nib/keyedobjects.nib \ extras/package/macosx/Resources/English.lproj/InteractionErrorPanel.nib/keyedobjects.nib \
......
{
IBClasses = (
{CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
{
ACTIONS = {cancelAndClose = id; cancelDialog = id; okayAndClose = id; };
CLASS = VLCInteraction;
LANGUAGE = ObjC;
OUTLETS = {
"o_auth_cancel_btn" = id;
"o_auth_description" = id;
"o_auth_login_fld" = id;
"o_auth_login_txt" = id;
"o_auth_ok_btn" = id;
"o_auth_pw_fld" = id;
"o_auth_pw_txt" = id;
"o_auth_title" = id;
"o_auth_win" = id;
"o_input_cancel_btn" = id;
"o_input_description" = id;
"o_input_fld" = id;
"o_input_ok_btn" = id;
"o_input_title" = id;
"o_input_win" = id;
"o_prog_bar" = id;
"o_prog_cancel_btn" = id;
"o_prog_description" = id;
"o_prog_timeToGo" = id;
"o_prog_title" = id;
"o_prog_win" = id;
};
SUPERCLASS = NSObject;
},
{CLASS = VLCInteractionList; LANGUAGE = ObjC; 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>97 142 356 240 0 0 1440 878 </string>
<key>IBFramework Version</key>
<string>446.1</string>
<key>IBOpenObjects</key>
<array>
<integer>55</integer>
<integer>79</integer>
<integer>5</integer>
</array>
<key>IBSystem Version</key>
<string>8J135</string>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?> {
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> IBClasses = (
<plist version="1.0"> {
<dict> CLASS = FirstResponder;
<key>IBClasses</key> LANGUAGE = ObjC;
<array> SUPERCLASS = NSObject;
<dict> },
<key>CLASS</key> {
<string>NSApplication</string> CLASS = NSApplication;
<key>LANGUAGE</key> LANGUAGE = ObjC;
<string>ObjC</string> SUPERCLASS = NSResponder;
<key>SUPERCLASS</key> },
<string>NSResponder</string> {
</dict> CLASS = NSObject;
<dict> LANGUAGE = ObjC;
<key>ACTIONS</key> },
<dict> {
<key>cleanupTable</key> ACTIONS = {
<string>id</string> loginDialogAction = id;
<key>showMessages</key> };
<string>id</string> CLASS = VLCCoreDialogSupport;
</dict> LANGUAGE = ObjC;
<key>CLASS</key> OUTLETS = {
<string>VLCErrorInteractionPanel</string> "o_auth_cancel_btn" = id;
<key>LANGUAGE</key> "o_auth_description_txt" = id;
<string>ObjC</string> "o_auth_login_fld" = id;
<key>OUTLETS</key> "o_auth_login_txt" = id;
<dict> "o_auth_ok_btn" = id;
<key>o_cleanup_button</key> "o_auth_pw_fld" = id;
<string>id</string> "o_auth_pw_txt" = id;
<key>o_error_table</key> "o_auth_title_txt" = id;
<string>id</string> "o_auth_win" = id;
<key>o_messages_btn</key> };
<string>id</string> SUPERCLASS = NSObject;
<key>o_window</key> },
<string>id</string> {
</dict> ACTIONS = {
<key>SUPERCLASS</key> cleanupTable = id;
<string>NSObject</string> showMessages = id;
</dict> };
<dict> CLASS = VLCErrorPanel;
<key>CLASS</key> LANGUAGE = ObjC;
<string>FirstResponder</string> OUTLETS = {
<key>LANGUAGE</key> "o_cleanup_button" = id;
<string>ObjC</string> "o_error_table" = id;
<key>SUPERCLASS</key> "o_messages_btn" = id;
<string>NSObject</string> "o_window" = id;
</dict> };
<dict> SUPERCLASS = NSObject;
<key>CLASS</key> }
<string>NSObject</string> );
<key>LANGUAGE</key> IBVersion = 1;
<string>ObjC</string> }
</dict> \ No newline at end of file
</array>
<key>IBVersion</key>
<string>1</string>
</dict>
</plist>
...@@ -2,18 +2,20 @@ ...@@ -2,18 +2,20 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>IBDocumentLocation</key>
<string>296 102 421 299 0 0 1280 778 </string>
<key>IBFramework Version</key> <key>IBFramework Version</key>
<string>644</string> <string>489.0</string>
<key>IBLastKnownRelativeProjectPath</key> <key>IBLastKnownRelativeProjectPath</key>
<string>../../vlc.xcodeproj</string> <string>../../vlc.xcodeproj</string>
<key>IBOldestOS</key> <key>IBOldestOS</key>
<integer>5</integer> <integer>5</integer>
<key>IBOpenObjects</key> <key>IBOpenObjects</key>
<array> <array>
<integer>6</integer> <integer>32</integer>
</array> </array>
<key>IBSystem Version</key> <key>IBSystem Version</key>
<string>9C31</string> <string>9G55</string>
<key>targetFramework</key> <key>targetFramework</key>
<string>IBCocoaFramework</string> <string>IBCocoaFramework</string>
</dict> </dict>
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
objects = { objects = {
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
CC0FB34C0F8BED1100F057F7 /* CoreDialogs.nib in Resources */ = {isa = PBXBuildFile; fileRef = CC0FB34A0F8BED1100F057F7 /* CoreDialogs.nib */; };
CC402EB00E00ABBB006A4BA4 /* vlc.icns in Resources */ = {isa = PBXBuildFile; fileRef = F74F13DF02C2A53401EE194C /* vlc.icns */; }; CC402EB00E00ABBB006A4BA4 /* vlc.icns in Resources */ = {isa = PBXBuildFile; fileRef = F74F13DF02C2A53401EE194C /* vlc.icns */; };
CC402EB10E00ABBB006A4BA4 /* MainMenu.nib in Resources */ = {isa = PBXBuildFile; fileRef = F74F13EA02C2A79C01EE194C /* MainMenu.nib */; }; CC402EB10E00ABBB006A4BA4 /* MainMenu.nib in Resources */ = {isa = PBXBuildFile; fileRef = F74F13EA02C2A79C01EE194C /* MainMenu.nib */; };
CC402EB20E00ABBB006A4BA4 /* divx.icns in Resources */ = {isa = PBXBuildFile; fileRef = F6E4F90A02D2648B01A80112 /* divx.icns */; }; CC402EB20E00ABBB006A4BA4 /* divx.icns in Resources */ = {isa = PBXBuildFile; fileRef = F6E4F90A02D2648B01A80112 /* divx.icns */; };
...@@ -84,7 +85,6 @@ ...@@ -84,7 +85,6 @@
CC402EFB0E00ABBB006A4BA4 /* skip_forward_embedded_blue.png in Resources */ = {isa = PBXBuildFile; fileRef = C2F2A704095AE51600018C74 /* skip_forward_embedded_blue.png */; }; CC402EFB0E00ABBB006A4BA4 /* skip_forward_embedded_blue.png in Resources */ = {isa = PBXBuildFile; fileRef = C2F2A704095AE51600018C74 /* skip_forward_embedded_blue.png */; };
CC402EFC0E00ABBB006A4BA4 /* skip_previous_embedded_blue.png in Resources */ = {isa = PBXBuildFile; fileRef = C2F2A705095AE51600018C74 /* skip_previous_embedded_blue.png */; }; CC402EFC0E00ABBB006A4BA4 /* skip_previous_embedded_blue.png in Resources */ = {isa = PBXBuildFile; fileRef = C2F2A705095AE51600018C74 /* skip_previous_embedded_blue.png */; };
CC402EFD0E00ABBB006A4BA4 /* Update.nib in Resources */ = {isa = PBXBuildFile; fileRef = CC26BF2A09A7A05000E94D62 /* Update.nib */; }; CC402EFD0E00ABBB006A4BA4 /* Update.nib in Resources */ = {isa = PBXBuildFile; fileRef = CC26BF2A09A7A05000E94D62 /* Update.nib */; };
CC402EFE0E00ABBB006A4BA4 /* Interaction.nib in Resources */ = {isa = PBXBuildFile; fileRef = CC1B4B4B09A8CF9E0078AD2E /* Interaction.nib */; };
CC402EFF0E00ABBB006A4BA4 /* InteractionErrorPanel.nib in Resources */ = {isa = PBXBuildFile; fileRef = CC1AC1BA0A7BDA41002478C3 /* InteractionErrorPanel.nib */; }; CC402EFF0E00ABBB006A4BA4 /* InteractionErrorPanel.nib in Resources */ = {isa = PBXBuildFile; fileRef = CC1AC1BA0A7BDA41002478C3 /* InteractionErrorPanel.nib */; };
CC402F000E00ABBB006A4BA4 /* add_embedded_blue.png in Resources */ = {isa = PBXBuildFile; fileRef = CC4ED9AC0ABE07C800CA4CC5 /* add_embedded_blue.png */; }; CC402F000E00ABBB006A4BA4 /* add_embedded_blue.png in Resources */ = {isa = PBXBuildFile; fileRef = CC4ED9AC0ABE07C800CA4CC5 /* add_embedded_blue.png */; };
CC402F010E00ABBB006A4BA4 /* add_embedded.png in Resources */ = {isa = PBXBuildFile; fileRef = CC4ED9AD0ABE07C800CA4CC5 /* add_embedded.png */; }; CC402F010E00ABBB006A4BA4 /* add_embedded.png in Resources */ = {isa = PBXBuildFile; fileRef = CC4ED9AD0ABE07C800CA4CC5 /* add_embedded.png */; };
...@@ -260,9 +260,9 @@ ...@@ -260,9 +260,9 @@
CC0B723A0D54F2B000448E00 /* spref_cone_Interface_64.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = spref_cone_Interface_64.png; path = Resources/spref_cone_Interface_64.png; sourceTree = "<group>"; }; CC0B723A0D54F2B000448E00 /* spref_cone_Interface_64.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = spref_cone_Interface_64.png; path = Resources/spref_cone_Interface_64.png; sourceTree = "<group>"; };
CC0B723B0D54F2B000448E00 /* spref_cone_Subtitles_64.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = spref_cone_Subtitles_64.png; path = Resources/spref_cone_Subtitles_64.png; sourceTree = "<group>"; }; CC0B723B0D54F2B000448E00 /* spref_cone_Subtitles_64.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = spref_cone_Subtitles_64.png; path = Resources/spref_cone_Subtitles_64.png; sourceTree = "<group>"; };
CC0B723C0D54F2B000448E00 /* spref_cone_Video_64.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = spref_cone_Video_64.png; path = Resources/spref_cone_Video_64.png; sourceTree = "<group>"; }; CC0B723C0D54F2B000448E00 /* spref_cone_Video_64.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = spref_cone_Video_64.png; path = Resources/spref_cone_Video_64.png; sourceTree = "<group>"; };
CC0FB34B0F8BED1100F057F7 /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = Resources/English.lproj/CoreDialogs.nib; sourceTree = "<group>"; };
CC1941240B9C1F8400635F6B /* QTKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QTKit.framework; path = /System/Library/Frameworks/QTKit.framework; sourceTree = "<absolute>"; }; CC1941240B9C1F8400635F6B /* QTKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QTKit.framework; path = /System/Library/Frameworks/QTKit.framework; sourceTree = "<absolute>"; };
CC1AC1BB0A7BDA41002478C3 /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = Resources/English.lproj/InteractionErrorPanel.nib; sourceTree = "<group>"; }; CC1AC1BB0A7BDA41002478C3 /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = Resources/English.lproj/InteractionErrorPanel.nib; sourceTree = "<group>"; };
CC1B4B4C09A8CF9E0078AD2E /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = Resources/English.lproj/Interaction.nib; sourceTree = "<group>"; };
CC1B4C1409A8EC690078AD2E /* interaction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = interaction.h; path = ../../../modules/gui/macosx/interaction.h; sourceTree = "<group>"; }; CC1B4C1409A8EC690078AD2E /* interaction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = interaction.h; path = ../../../modules/gui/macosx/interaction.h; sourceTree = "<group>"; };
CC1B4C1509A8EC690078AD2E /* interaction.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = interaction.m; path = ../../../modules/gui/macosx/interaction.m; sourceTree = "<group>"; }; CC1B4C1509A8EC690078AD2E /* interaction.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = interaction.m; path = ../../../modules/gui/macosx/interaction.m; sourceTree = "<group>"; };
CC1C41D00D9BAD7F002728FA /* noart.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = noart.png; path = Resources/noart.png; sourceTree = "<group>"; }; CC1C41D00D9BAD7F002728FA /* noart.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = noart.png; path = Resources/noart.png; sourceTree = "<group>"; };
...@@ -755,6 +755,7 @@ ...@@ -755,6 +755,7 @@
DCF358BC077F1236007DB450 /* nibs */ = { DCF358BC077F1236007DB450 /* nibs */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
CC0FB34A0F8BED1100F057F7 /* CoreDialogs.nib */,
CCB60A400E6E5E3F00407004 /* VLM.nib */, CCB60A400E6E5E3F00407004 /* VLM.nib */,
CCC896B80D9AA9E8005AE59C /* MediaInfo.nib */, CCC896B80D9AA9E8005AE59C /* MediaInfo.nib */,
DCA00AA7075F948800E6BF46 /* About.nib */, DCA00AA7075F948800E6BF46 /* About.nib */,
...@@ -765,7 +766,6 @@ ...@@ -765,7 +766,6 @@
DC7F46EB08A183FC0027DB24 /* Extended.nib */, DC7F46EB08A183FC0027DB24 /* Extended.nib */,
DCE7BD0308A56C8B007B10AE /* Bookmarks.nib */, DCE7BD0308A56C8B007B10AE /* Bookmarks.nib */,
CC26BF2A09A7A05000E94D62 /* Update.nib */, CC26BF2A09A7A05000E94D62 /* Update.nib */,
CC1B4B4B09A8CF9E0078AD2E /* Interaction.nib */,
CC1AC1BA0A7BDA41002478C3 /* InteractionErrorPanel.nib */, CC1AC1BA0A7BDA41002478C3 /* InteractionErrorPanel.nib */,
); );
name = nibs; name = nibs;
...@@ -891,7 +891,6 @@ ...@@ -891,7 +891,6 @@
CC402EFB0E00ABBB006A4BA4 /* skip_forward_embedded_blue.png in Resources */, CC402EFB0E00ABBB006A4BA4 /* skip_forward_embedded_blue.png in Resources */,
CC402EFC0E00ABBB006A4BA4 /* skip_previous_embedded_blue.png in Resources */, CC402EFC0E00ABBB006A4BA4 /* skip_previous_embedded_blue.png in Resources */,
CC402EFD0E00ABBB006A4BA4 /* Update.nib in Resources */, CC402EFD0E00ABBB006A4BA4 /* Update.nib in Resources */,
CC402EFE0E00ABBB006A4BA4 /* Interaction.nib in Resources */,
CC402EFF0E00ABBB006A4BA4 /* InteractionErrorPanel.nib in Resources */, CC402EFF0E00ABBB006A4BA4 /* InteractionErrorPanel.nib in Resources */,
CC402F000E00ABBB006A4BA4 /* add_embedded_blue.png in Resources */, CC402F000E00ABBB006A4BA4 /* add_embedded_blue.png in Resources */,
CC402F010E00ABBB006A4BA4 /* add_embedded.png in Resources */, CC402F010E00ABBB006A4BA4 /* add_embedded.png in Resources */,
...@@ -961,6 +960,7 @@ ...@@ -961,6 +960,7 @@
CCD90F4E0E87C86D0034564A /* add_schedule.png in Resources */, CCD90F4E0E87C86D0034564A /* add_schedule.png in Resources */,
CCD90F4F0E87C86D0034564A /* add_vod.png in Resources */, CCD90F4F0E87C86D0034564A /* add_vod.png in Resources */,
CCD90F500E87C86D0034564A /* add_broadcast.png in Resources */, CCD90F500E87C86D0034564A /* add_broadcast.png in Resources */,
CC0FB34C0F8BED1100F057F7 /* CoreDialogs.nib in Resources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
...@@ -977,20 +977,20 @@ ...@@ -977,20 +977,20 @@
/* End PBXRezBuildPhase section */ /* End PBXRezBuildPhase section */
/* Begin PBXVariantGroup section */ /* Begin PBXVariantGroup section */
CC1AC1BA0A7BDA41002478C3 /* InteractionErrorPanel.nib */ = { CC0FB34A0F8BED1100F057F7 /* CoreDialogs.nib */ = {
isa = PBXVariantGroup; isa = PBXVariantGroup;
children = ( children = (
CC1AC1BB0A7BDA41002478C3 /* English */, CC0FB34B0F8BED1100F057F7 /* English */,
); );
name = InteractionErrorPanel.nib; name = CoreDialogs.nib;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
CC1B4B4B09A8CF9E0078AD2E /* Interaction.nib */ = { CC1AC1BA0A7BDA41002478C3 /* InteractionErrorPanel.nib */ = {
isa = PBXVariantGroup; isa = PBXVariantGroup;
children = ( children = (
CC1B4B4C09A8CF9E0078AD2E /* English */, CC1AC1BB0A7BDA41002478C3 /* English */,
); );
name = Interaction.nib; name = InteractionErrorPanel.nib;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
CC26BF2A09A7A05000E94D62 /* Update.nib */ = { CC26BF2A09A7A05000E94D62 /* Update.nib */ = {
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
NSMutableArray * o_errors; NSMutableArray * o_errors;
NSMutableArray * o_icons; NSMutableArray * o_icons;
BOOL nib_interact_errpanel_loaded; BOOL nib_loaded;
} }
- (IBAction)cleanupTable:(id)sender; - (IBAction)cleanupTable:(id)sender;
- (IBAction)showMessages:(id)sender; - (IBAction)showMessages:(id)sender;
...@@ -52,67 +52,40 @@ ...@@ -52,67 +52,40 @@
/***************************************************************************** /*****************************************************************************
* VLCCoreDialogSupport interface * VLCCoreDialogProvider interface
*****************************************************************************/ *****************************************************************************/
@interface VLCCoreDialogSupport : NSObject @interface VLCCoreDialogProvider : NSObject
{ {
NSMutableArray *o_interaction_list;
VLCErrorPanel *o_error_panel; VLCErrorPanel *o_error_panel;
}
-(void)newInteractionEvent: (NSNotification *)o_notification;
#if 0
-(void)addInteraction: (interaction_dialog_t *)p_dialog;
-(void)removeInteraction: (VLCInteraction *)p_interaction;
#endif
-(void)showFatalDialog: (NSValue *)o_value;
-(void)showQuestionDialog: (NSValue *)o_value;
-(id)getErrorPanel;
@end
/*****************************************************************************
* VLCInteraction interface
*****************************************************************************/
#if 0
@interface VLCInteraction : NSObject
{
/* progress dialogue */
IBOutlet id o_prog_bar;
IBOutlet id o_prog_cancel_btn;
IBOutlet id o_prog_description;
IBOutlet id o_prog_title;
IBOutlet id o_prog_win;
IBOutlet id o_prog_timeToGo;
/* authentication dialogue */ /* authentication dialogue */
IBOutlet id o_auth_cancel_btn; IBOutlet id o_auth_cancel_btn;
IBOutlet id o_auth_description; IBOutlet id o_auth_description_txt;
IBOutlet id o_auth_login_fld; IBOutlet id o_auth_login_fld;
IBOutlet id o_auth_login_txt; IBOutlet id o_auth_login_txt;
IBOutlet id o_auth_ok_btn; IBOutlet id o_auth_ok_btn;
IBOutlet id o_auth_pw_fld; IBOutlet id o_auth_pw_fld;
IBOutlet id o_auth_pw_txt; IBOutlet id o_auth_pw_txt;
IBOutlet id o_auth_title; IBOutlet id o_auth_title_txt;
IBOutlet id o_auth_win; IBOutlet id o_auth_win;
vlc_object_t * p_dialog; /* progress dialogue */
intf_thread_t * p_intf; IBOutlet id o_prog_bar;
NSProgressIndicator * o_mainIntfPgbar; IBOutlet id o_prog_cancel_btn;
BOOL nib_interact_loaded; IBOutlet id o_prog_description;
IBOutlet id o_prog_title;
IBOutlet id o_prog_win;
IBOutlet id o_prog_timeToGo;
} }
+ (VLCCoreDialogProvider *)sharedInstance;
-(void)performDialogEvent: (NSNotification *)o_notification;
- (IBAction)okayAndClose:(id)sender; -(void)showFatalDialog: (NSValue *)o_value;
- (IBAction)cancelDialog:(id)sender; -(void)showQuestionDialog: (NSValue *)o_value;
-(void)showLoginDialog: (NSValue *)o_value;
-(IBAction)loginDialogAction:(id)sender;
-(id)initDialog: (vlc_object_t *)_p_dialog; -(id)getErrorPanel;
-(void)runDialog;
-(void)updateDialog;
-(void)hideDialog;
-(void)destroyDialog;
@end @end
#endif \ No newline at end of file
...@@ -30,25 +30,47 @@ ...@@ -30,25 +30,47 @@
#import <ApplicationServices/ApplicationServices.h> #import <ApplicationServices/ApplicationServices.h>
/***************************************************************************** /*****************************************************************************
* VLCCoreDialogSupport implementation * VLCCoreDialogProvider implementation
*****************************************************************************/ *****************************************************************************/
@implementation VLCCoreDialogSupport @implementation VLCCoreDialogProvider
static VLCCoreDialogProvider *_o_sharedInstance = nil;
+ (VLCCoreDialogProvider *)sharedInstance
{
return _o_sharedInstance ? _o_sharedInstance : [[self alloc] init];
}
-(id)init -(id)init
{ {
[super init]; if( _o_sharedInstance )
o_interaction_list = [[NSMutableArray alloc] initWithCapacity:1]; [self dealloc];
[[NSNotificationCenter defaultCenter] addObserver:self else
selector:@selector(newInteractionEvent:) {
name: @"VLCNewCoreDialogEventNotification" _o_sharedInstance = [super init];
object:self]; [[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(performDialogEvent:)
name: @"VLCNewCoreDialogEventNotification"
object:self];
o_error_panel = [[VLCErrorPanel alloc] init];
}
return _o_sharedInstance;
}
o_error_panel = [[VLCErrorPanel alloc] init]; -(void)awakeFromNib
{
[o_auth_login_txt setStringValue: _NS("User name")];
[o_auth_pw_txt setStringValue: _NS("Password")];
[o_auth_cancel_btn setTitle: _NS("Cancel")];
[o_auth_ok_btn setTitle: _NS("OK")];
[o_prog_cancel_btn setTitle: _NS("Cancel")];
[o_prog_bar setUsesThreadedAnimation: YES];
return self; }
}
-(void)newInteractionEvent: (NSNotification *)o_notification -(void)performDialogEvent: (NSNotification *)o_notification
{ {
NSValue *o_value = [[o_notification userInfo] objectForKey:@"VLCDialogPointer"]; NSValue *o_value = [[o_notification userInfo] objectForKey:@"VLCDialogPointer"];
NSString *o_type = [[o_notification userInfo] objectForKey:@"VLCDialogType"]; NSString *o_type = [[o_notification userInfo] objectForKey:@"VLCDialogType"];
...@@ -57,31 +79,10 @@ ...@@ -57,31 +79,10 @@
[self showFatalDialog: o_value]; [self showFatalDialog: o_value];
else if( [o_type isEqualToString: @"dialog-question"] ) else if( [o_type isEqualToString: @"dialog-question"] )
[self showQuestionDialog: o_value]; [self showQuestionDialog: o_value];
else if( [o_type isEqualToString: @"dialog-login"] )
[self showLoginDialog: o_value];
else else
msg_Err( VLCIntf, "unhandled dialog type: '%s'", [o_type UTF8String] ); msg_Err( VLCIntf, "unhandled dialog type: '%s'", [o_type UTF8String] );
#if 0
switch( p_dialog->i_action )
{
case INTERACT_NEW:
[self addInteraction: p_dialog];
break;
case INTERACT_UPDATE:
o_interaction = (VLCInteraction *)p_dialog->p_private;
[o_interaction updateDialog];
break;
case INTERACT_HIDE:
o_interaction = (VLCInteraction *)p_dialog->p_private;
[o_interaction hideDialog];
break;
case INTERACT_DESTROY:
o_interaction = (VLCInteraction *)p_dialog->p_private;
[o_interaction destroyDialog];
[self removeInteraction:o_interaction];
p_dialog->i_status = DESTROYED_DIALOG;
break;
}
#endif
} }
-(void)showFatalDialog: (NSValue *)o_value -(void)showFatalDialog: (NSValue *)o_value
...@@ -128,21 +129,38 @@ ...@@ -128,21 +129,38 @@
p_dialog->answer = 3; p_dialog->answer = 3;
} }
#if 0 -(void)showLoginDialog: (NSValue *)o_value
-(void)addInteraction: (interaction_dialog_t *)p_dialog
{ {
VLCInteraction *o_interaction = [[VLCInteraction alloc] initDialog: p_dialog]; dialog_login_t *p_dialog = [o_value pointerValue];
NSInteger i_returnValue = 0;
p_dialog->p_private = (void *)o_interaction;
[o_interaction_list addObject:[o_interaction autorelease]]; [o_auth_title_txt setStringValue: [NSString stringWithUTF8String: p_dialog->title]];
[o_interaction runDialog]; [o_auth_win setTitle: [NSString stringWithUTF8String: p_dialog->title]];
[o_auth_description_txt setStringValue: [NSString stringWithUTF8String: p_dialog->message]];
[o_auth_login_fld setStringValue: @""];
[o_auth_pw_fld setStringValue: @""];
[o_auth_win center];
i_returnValue = [NSApp runModalForWindow: o_auth_win];
[o_auth_win close];
if( i_returnValue )
{
*p_dialog->username = strdup( [[o_auth_login_fld stringValue] UTF8String] );
*p_dialog->password = strdup( [[o_auth_pw_fld stringValue] UTF8String] );
}
else
{
*p_dialog->username = *p_dialog->password = NULL;
}
} }
-(void)removeInteraction: (VLCInteraction *)o_interaction -(IBAction)loginDialogAction:(id)sender
{ {
[o_interaction_list removeObject:o_interaction]; if( [[sender title] isEqualToString: _NS("OK")] )
[NSApp stopModalWithCode: 1];
else
[NSApp stopModalWithCode: 0];
} }
#endif
-(id)getErrorPanel -(id)getErrorPanel
{ {
...@@ -152,95 +170,11 @@ ...@@ -152,95 +170,11 @@
-(void)dealloc -(void)dealloc
{ {
[[NSNotificationCenter defaultCenter] removeObserver:self]; [[NSNotificationCenter defaultCenter] removeObserver:self];
[o_interaction_list removeAllObjects];
[o_interaction_list release];
[super dealloc]; [super dealloc];
} }
@end @end
/*****************************************************************************
* VLCInteraction implementation
*****************************************************************************/
#if 0 #if 0
@implementation VLCInteraction
-(id)initDialog: (vlc_object_t *)_p_dialog
{
p_intf = VLCIntf;
[super init];
p_dialog = _p_dialog;
return self;
}
-(void)runDialog
{
id o_window = NULL;
if( !p_dialog )
msg_Err( p_intf, "no available interaction framework" );
if( !nib_interact_loaded )
{
nib_interact_loaded = [NSBundle loadNibNamed:@"Interaction" owner:self];
[o_prog_cancel_btn setTitle: _NS("Cancel")];
[o_prog_bar setUsesThreadedAnimation: YES];
[o_auth_login_txt setStringValue: _NS("Login:")];
[o_auth_pw_txt setStringValue: _NS("Password:")];
[o_auth_cancel_btn setTitle: _NS("Cancel")];
[o_auth_ok_btn setTitle: _NS("OK")];
o_mainIntfPgbar = [[VLCMain sharedInstance] getMainIntfPgbar];
}
NSString *o_title = [NSString stringWithUTF8String:p_dialog->psz_title ? p_dialog->psz_title : _("Error")];
NSString *o_description = [NSString stringWithUTF8String:p_dialog->psz_description ? p_dialog->psz_description : ""];
NSString *o_defaultButton = p_dialog->psz_default_button ? [NSString stringWithUTF8String:p_dialog->psz_default_button] : nil;
NSString *o_alternateButton = p_dialog->psz_alternate_button ? [NSString stringWithUTF8String:p_dialog->psz_alternate_button] : nil;
NSString *o_otherButton = p_dialog->psz_other_button ? [NSString stringWithUTF8String:p_dialog->psz_other_button] : nil;
vout_thread_t *p_vout = vlc_object_find( VLCIntf, VLC_OBJECT_VOUT, FIND_ANYWHERE );
if( p_vout != NULL )
{
NSEnumerator * o_enum = [[NSApp orderedWindows] objectEnumerator];
while( ( o_window = [o_enum nextObject] ) )
{
if( [[o_window className] isEqualToString: @"VLCVoutWindow"] )
{
vlc_object_release( (vlc_object_t *)p_vout );
break;
}
}
vlc_object_release( (vlc_object_t *)p_vout );
}
else
{
o_window = [NSApp mainWindow];
}
msg_Dbg( p_intf, "Title: %s", [o_title UTF8String] );
msg_Dbg( p_intf, "Description: %s", [o_description UTF8String] );
#if 0
dialog_question_t
{
msg_Dbg( p_intf, "yes-no-cancel-dialog requested" );
NSBeginInformationalAlertSheet( o_title, o_defaultButton,
o_alternateButton, o_otherButton, o_window, self,
@selector(sheetDidEnd: returnCode: contextInfo:), NULL, nil,
o_description );
}
dialog_login_t
{
msg_Dbg( p_intf, "dialog for login and pw requested" );
[o_auth_title setStringValue: o_title];
[o_auth_description setStringValue: o_description];
[o_auth_login_fld setStringValue: @""];
[o_auth_pw_fld setStringValue: @""];
[NSApp beginSheet: o_auth_win modalForWindow: o_window
modalDelegate: self didEndSelector: nil contextInfo: nil];
[o_auth_win makeKeyWindow];
}
dialog_progress_bar_t dialog_progress_bar_t
{ {
msg_Dbg( p_intf, "user progress dialog requested" ); msg_Dbg( p_intf, "user progress dialog requested" );
...@@ -256,19 +190,6 @@ ...@@ -256,19 +190,6 @@
modalDelegate: self didEndSelector: nil contextInfo: nil]; modalDelegate: self didEndSelector: nil contextInfo: nil];
[o_prog_win makeKeyWindow]; [o_prog_win makeKeyWindow];
} }
DIALOG_INTF_PROGRESS
{
msg_Dbg( p_intf, "progress-bar in main intf requested" );
[[VLCMain sharedInstance] setScrollField: o_description stopAfter: -1];
[o_mainIntfPgbar setDoubleValue: (double)p_dialog->val.f_float];
[o_mainIntfPgbar setHidden: NO];
[[[VLCMain sharedInstance] getControllerWindow] makeKeyWindow];
[o_mainIntfPgbar setIndeterminate: NO];
}
#endif
}
-(void)updateDialog -(void)updateDialog
{ {
if( p_dialog->i_flags & DIALOG_USER_PROGRESS ) if( p_dialog->i_flags & DIALOG_USER_PROGRESS )
...@@ -292,56 +213,8 @@ ...@@ -292,56 +213,8 @@
return; return;
} }
} }
-(void)hideDialog
{
msg_Dbg( p_intf, "hide event %p", self );
if( p_dialog->i_flags & DIALOG_USER_PROGRESS )
{
if([o_prog_win isVisible])
{
[NSApp endSheet: o_prog_win];
[o_prog_win close];
}
}
}
-(void)destroyDialog
{
msg_Dbg( p_intf, "destroy event" );
if( o_mainIntfPgbar )
[o_mainIntfPgbar release];
}
- (IBAction)cancelDialog:(id)sender
{
/* tell core that the user wishes to cancel the dialogue
* Use this function if cancelling is optionally like in the progress-dialogue */
vlc_mutex_lock( p_dialog->p_lock );
p_dialog->b_cancelled = true;
vlc_mutex_unlock( p_dialog->p_lock );
msg_Dbg( p_intf, "cancelling dialog, will close it later on" );
}
- (IBAction)okayAndClose:(id)sender
{
msg_Dbg( p_intf, "running okayAndClose" );
vlc_mutex_lock( p_dialog->p_lock );
if( p_dialog->i_flags == DIALOG_LOGIN_PW_OK_CANCEL )
{
p_dialog->psz_returned[0] = strdup( [[o_auth_login_fld stringValue] UTF8String] );
p_dialog->psz_returned[1] = strdup( [[o_auth_pw_fld stringValue] UTF8String] );
}
else if( p_dialog->i_flags == DIALOG_PSZ_INPUT_OK_CANCEL )
p_dialog->psz_returned[0] = strdup( [[o_input_fld stringValue] UTF8String] );
p_dialog->i_return = DIALOG_OK_YES;
p_dialog->i_status = ANSWERED_DIALOG;
vlc_mutex_unlock( p_dialog->p_lock );
msg_Dbg( p_intf, "dialog acknowledged" );
}
@end
#endif #endif
/***************************************************************************** /*****************************************************************************
* VLCErrorPanel implementation * VLCErrorPanel implementation
*****************************************************************************/ *****************************************************************************/
...@@ -350,8 +223,7 @@ ...@@ -350,8 +223,7 @@
{ {
[super init]; [super init];
/* load the nib */ nib_loaded = [NSBundle loadNibNamed:@"InteractionErrorPanel" owner:self];
nib_interact_errpanel_loaded = [NSBundle loadNibNamed:@"InteractionErrorPanel" owner:self];
/* init strings */ /* init strings */
[o_window setTitle: _NS("Errors and Warnings")]; [o_window setTitle: _NS("Errors and Warnings")];
......
...@@ -106,7 +106,7 @@ static void MsgCallback( msg_cb_data_t *, msg_item_t *, unsigned ); ...@@ -106,7 +106,7 @@ static void MsgCallback( msg_cb_data_t *, msg_item_t *, unsigned );
id o_bookmarks; /* VLCBookmarks */ id o_bookmarks; /* VLCBookmarks */
id o_vlm; /* VLCVLMController */ id o_vlm; /* VLCVLMController */
id o_embedded_list; /* VLCEmbeddedList*/ id o_embedded_list; /* VLCEmbeddedList*/
id o_interaction_list; /* VLCInteractionList*/ id o_coredialogs; /* VLCCoreDialogProvider */
VLCInformation * o_info; /* VLCInformation */ VLCInformation * o_info; /* VLCInformation */
#ifdef UPDATE_CHECK #ifdef UPDATE_CHECK
id o_update; /* VLCUpdate */ id o_update; /* VLCUpdate */
...@@ -122,6 +122,7 @@ static void MsgCallback( msg_cb_data_t *, msg_item_t *, unsigned ); ...@@ -122,6 +122,7 @@ static void MsgCallback( msg_cb_data_t *, msg_item_t *, unsigned );
BOOL nib_update_loaded; /* update nibfile */ BOOL nib_update_loaded; /* update nibfile */
BOOL nib_info_loaded; /* information panel nibfile */ BOOL nib_info_loaded; /* information panel nibfile */
BOOL nib_vlm_loaded; /* VLM Panel nibfile */ BOOL nib_vlm_loaded; /* VLM Panel nibfile */
BOOL nib_coredialogs_loaded; /* CoreDialogs nibfile */
IBOutlet VLControllerWindow * o_window; /* main window */ IBOutlet VLControllerWindow * o_window; /* main window */
IBOutlet NSView * o_playlist_view; /* playlist view */ IBOutlet NSView * o_playlist_view; /* playlist view */
...@@ -354,7 +355,7 @@ static void MsgCallback( msg_cb_data_t *, msg_item_t *, unsigned ); ...@@ -354,7 +355,7 @@ static void MsgCallback( msg_cb_data_t *, msg_item_t *, unsigned );
- (id)getWizard; - (id)getWizard;
- (id)getBookmarks; - (id)getBookmarks;
- (id)getEmbeddedList; - (id)getEmbeddedList;
- (id)getInteractionList; - (id)getCoreDialogProvider;
- (id)getMainIntfPgbar; - (id)getMainIntfPgbar;
- (id)getControllerWindow; - (id)getControllerWindow;
- (id)getVoutMenu; - (id)getVoutMenu;
......
...@@ -234,7 +234,7 @@ static int DialogCallback( vlc_object_t *p_this, const char *type, vlc_value_t p ...@@ -234,7 +234,7 @@ static int DialogCallback( vlc_object_t *p_this, const char *type, vlc_value_t p
NSLog( @"dialog callback triggered; type of dialogue is '%s'", type ); NSLog( @"dialog callback triggered; type of dialogue is '%s'", type );
NSValue *o_value = [NSValue valueWithPointer:p_dialog]; NSValue *o_value = [NSValue valueWithPointer:p_dialog];
[[NSNotificationCenter defaultCenter] postNotificationName: @"VLCNewCoreDialogEventNotification" object:[interface getInteractionList] userInfo:[NSDictionary dictionaryWithObjectsAndKeys: o_value, @"VLCDialogPointer", [NSString stringWithUTF8String: type], @"VLCDialogType", nil]]; [[NSNotificationCenter defaultCenter] postNotificationName: @"VLCNewCoreDialogEventNotification" object:[interface getCoreDialogProvider] userInfo:[NSDictionary dictionaryWithObjectsAndKeys: o_value, @"VLCDialogPointer", [NSString stringWithUTF8String: type], @"VLCDialogType", nil]];
[o_pool release]; [o_pool release];
return VLC_SUCCESS; return VLC_SUCCESS;
...@@ -285,7 +285,7 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -285,7 +285,7 @@ static VLCMain *_o_sharedMainInstance = nil;
o_extended = nil; o_extended = nil;
o_bookmarks = [[VLCBookmarks alloc] init]; o_bookmarks = [[VLCBookmarks alloc] init];
o_embedded_list = [[VLCEmbeddedList alloc] init]; o_embedded_list = [[VLCEmbeddedList alloc] init];
o_interaction_list = [[VLCCoreDialogSupport alloc] init]; o_coredialogs = [[VLCCoreDialogProvider alloc] init];
o_info = [[VLCInfo alloc] init]; o_info = [[VLCInfo alloc] init];
#ifdef UPDATE_CHECK #ifdef UPDATE_CHECK
o_update = [[VLCUpdate alloc] init]; o_update = [[VLCUpdate alloc] init];
...@@ -463,6 +463,9 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -463,6 +463,9 @@ static VLCMain *_o_sharedMainInstance = nil;
pl_Release( p_intf ); pl_Release( p_intf );
/* load our Core Dialogs nib */
nib_coredialogs_loaded = [NSBundle loadNibNamed:@"CoreDialogs" owner: NSApp];
/* subscribe to various interactive dialogues */ /* subscribe to various interactive dialogues */
var_Create( p_intf, "dialog-fatal", VLC_VAR_ADDRESS ); var_Create( p_intf, "dialog-fatal", VLC_VAR_ADDRESS );
var_AddCallback( p_intf, "dialog-fatal", DialogCallback, self ); var_AddCallback( p_intf, "dialog-fatal", DialogCallback, self );
...@@ -792,7 +795,7 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -792,7 +795,7 @@ static VLCMain *_o_sharedMainInstance = nil;
[crashLogURLConnection release]; [crashLogURLConnection release];
[o_embedded_list release]; [o_embedded_list release];
[o_interaction_list release]; [o_coredialogs release];
[o_eyetv release]; [o_eyetv release];
[o_img_pause_pressed release]; [o_img_pause_pressed release];
...@@ -1388,10 +1391,10 @@ static unsigned int VLCModifiersToCocoa( unsigned int i_key ) ...@@ -1388,10 +1391,10 @@ static unsigned int VLCModifiersToCocoa( unsigned int i_key )
return nil; return nil;
} }
- (id)getInteractionList - (id)getCoreDialogProvider
{ {
if( o_interaction_list ) if( o_coredialogs )
return o_interaction_list; return o_coredialogs;
return nil; return nil;
} }
...@@ -2121,8 +2124,7 @@ end: ...@@ -2121,8 +2124,7 @@ end:
- (IBAction)showBookmarks:(id)sender - (IBAction)showBookmarks:(id)sender
{ {
dialog_Question( p_intf, _("Video Settings not saved"), dialog_Fatal( p_intf, "Title", "Message" );
_("An error occured while saving your settings via SimplePrefs."), "Yes", "No", "Cancel" );
/* we need the wizard-nib for the bookmarks's extract functionality */ /* we need the wizard-nib for the bookmarks's extract functionality */
if( !nib_wizard_loaded ) if( !nib_wizard_loaded )
...@@ -2431,7 +2433,7 @@ end: ...@@ -2431,7 +2433,7 @@ end:
- (IBAction)viewErrorsAndWarnings:(id)sender - (IBAction)viewErrorsAndWarnings:(id)sender
{ {
[[[self getInteractionList] getErrorPanel] showPanel]; [[[self getCoreDialogProvider] getErrorPanel] showPanel];
} }
- (IBAction)showMessagesPanel:(id)sender - (IBAction)showMessagesPanel:(id)sender
......
...@@ -141,7 +141,6 @@ ...@@ -141,7 +141,6 @@
- (IBAction)recursiveExpandNode:(id)sender; - (IBAction)recursiveExpandNode:(id)sender;
- (IBAction)addNode:(id)sender; - (IBAction)addNode:(id)sender;
- (void)addNodeThreadedly;
- (void)appendArray:(NSArray*)o_array atPos:(int)i_position enqueue:(BOOL)b_enqueue; - (void)appendArray:(NSArray*)o_array atPos:(int)i_position enqueue:(BOOL)b_enqueue;
- (void)appendNodeArray:(NSArray*)o_array inNode:(playlist_item_t *)p_node atPos:(int)i_position enqueue:(BOOL)b_enqueue; - (void)appendNodeArray:(NSArray*)o_array inNode:(playlist_item_t *)p_node atPos:(int)i_position enqueue:(BOOL)b_enqueue;
......
...@@ -1442,19 +1442,6 @@ ...@@ -1442,19 +1442,6 @@
- (IBAction)addNode:(id)sender - (IBAction)addNode:(id)sender
{ {
/* we have to create a new thread here because otherwise we would block the
* interface since the interaction-stuff and this code would run in the same
* thread */
[NSThread detachNewThreadSelector: @selector(addNodeThreadedly)
toTarget: self withObject:nil];
[self playlistUpdated];
}
- (void)addNodeThreadedly
{
NSAutoreleasePool * ourPool = [[NSAutoreleasePool alloc] init];
/* simply adds a new node to the end of the playlist */
playlist_t * p_playlist = pl_Hold( VLCIntf ); playlist_t * p_playlist = pl_Hold( VLCIntf );
vlc_thread_set_priority( p_playlist, VLC_THREAD_PRIORITY_LOW ); vlc_thread_set_priority( p_playlist, VLC_THREAD_PRIORITY_LOW );
...@@ -1463,11 +1450,10 @@ ...@@ -1463,11 +1450,10 @@
p_playlist->p_local_category, 0, NULL ); p_playlist->p_local_category, 0, NULL );
PL_UNLOCK; PL_UNLOCK;
free( psz_name );
pl_Release( VLCIntf ); pl_Release( VLCIntf );
[ourPool release];
}
[self playlistUpdated];
}
@end @end
@implementation VLCPlaylist (NSOutlineViewDataSource) @implementation VLCPlaylist (NSOutlineViewDataSource)
......
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