]> git.sesse.net Git - vlc/commitdiff
* ask for the name of the new node through the interaction framework (node creation...
authorFelix Paul Kühne <fkuehne@videolan.org>
Tue, 16 May 2006 19:22:02 +0000 (19:22 +0000)
committerFelix Paul Kühne <fkuehne@videolan.org>
Tue, 16 May 2006 19:22:02 +0000 (19:22 +0000)
extras/MacOSX/Resources/English.lproj/Interaction.nib/keyedobjects.nib
modules/gui/macosx/interaction.m
modules/gui/macosx/playlist.h
modules/gui/macosx/playlist.m

index 926546adf28b12c6ec3a90c5fd2f32c916d45d99..64b69dfbfb84c075de39e5cfa9820fbaa71cdf07 100644 (file)
Binary files a/extras/MacOSX/Resources/English.lproj/Interaction.nib/keyedobjects.nib and b/extras/MacOSX/Resources/English.lproj/Interaction.nib/keyedobjects.nib differ
index 4a03f9cbd7633ceadbeda6ac90994c5ca89bff15..83676a8c55c17b118889b18ec7ab7b58d0213f29 100644 (file)
     msg_Dbg( p_intf, "Description: %s", [o_description UTF8String] );
     if( p_dialog->i_id == DIALOG_ERRORS )
     {
-        msg_Err( p_intf, "Error: %s", p_dialog->psz_description );
+        //msg_Err( p_intf, "Error: %s", p_dialog->psz_description );
+        int myInt;
+        myInt = NSRunCriticalAlertPanel( _NS("Error"), o_description, _NS("OK"),
+            _NS("Report..."), nil );
+        if( myInt == NSCancelButton )
+        {
+            NSURL * o_url = [NSURL URLWithString:
+                @"http://www.videolan.org/support/bug-reporting.html"];
+            [[NSWorkspace sharedWorkspace] openURL: o_url];
+        }
     }
     else
     {
         }
         else if( p_dialog->i_flags & DIALOG_PSZ_INPUT_OK_CANCEL )
         {
-            msg_Dbg( p_intf, "requested flag: DIALOG_STRING_INPUT_OK" );
+            msg_Dbg( p_intf, "requested flag: DIALOG_PSZ_INPUT_OK_CANCEL" );
             [o_input_title setStringValue: o_title];
             [o_input_description setStringValue: o_description];
             [o_input_fld setStringValue: @""];
index 18ef164fcaf6d53c88ee1835a34111aff696ba10..31d33e9c59900a7ae125114ba59667b124a13819 100644 (file)
 - (IBAction)recursiveExpandNode:(id)sender;
 
 - (IBAction)addNode:(id)sender;
+- (void)addNodeThreadedly;
 
 - (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;
index ed84eb5efb564b731e5ebaacf326954b02056f07..ec4dbac0eeb4d70e9f5ab320e50abc7ba4362d39 100644 (file)
@@ -50,6 +50,7 @@
 #include "controls.h"
 #include "vlc_osd.h"
 #include "misc.h"
+#import <vlc_interaction.h>
 
 /*****************************************************************************
  * VLCPlaylistView implementation 
@@ -1471,22 +1472,45 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
 
 - (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 = vlc_object_find( VLCIntf, VLC_OBJECT_PLAYLIST,
                                           FIND_ANYWHERE );
+    vlc_thread_set_priority( p_playlist, VLC_THREAD_PRIORITY_LOW );
+
     if( !p_playlist )
     {
         return;
     }
 
-    playlist_item_t * p_item = playlist_NodeCreate( p_playlist,
-                                _("Empty Folder"), p_playlist->p_local_category );
+    int ret_v;
+    char *psz_name = NULL;
+    playlist_item_t * p_item;
+    ret_v = intf_UserStringInput( p_playlist, _("New Node"), 
+        _("Please enter a name for the new node."), &psz_name );
+    if( psz_name != NULL && psz_name != "" )
+        p_item = playlist_NodeCreate( p_playlist, psz_name, 
+                                            p_playlist->p_local_category );
+    else
+        p_item = playlist_NodeCreate( p_playlist, _("Empty Folder"), 
+                                            p_playlist->p_local_category );
 
     if(! p_item )
         msg_Warn( VLCIntf, "node creation failed" );
 
     vlc_object_release( p_playlist );
-    [self playlistUpdated];
+    [ourPool release];
 }
 
 @end