Commit 2adf9ed0 authored by Felix Paul Kühne's avatar Felix Paul Kühne

* complete clean-up

parent 19f724fc
...@@ -5,13 +5,14 @@ ...@@ -5,13 +5,14 @@
<key>IBDocumentLocation</key> <key>IBDocumentLocation</key>
<string>97 142 356 240 0 0 1440 878 </string> <string>97 142 356 240 0 0 1440 878 </string>
<key>IBFramework Version</key> <key>IBFramework Version</key>
<string>443.0</string> <string>446.1</string>
<key>IBOpenObjects</key> <key>IBOpenObjects</key>
<array> <array>
<integer>79</integer> <integer>5</integer>
<integer>55</integer> <integer>55</integer>
<integer>79</integer>
</array> </array>
<key>IBSystem Version</key> <key>IBSystem Version</key>
<string>8I127</string> <string>8J135</string>
</dict> </dict>
</plist> </plist>
...@@ -59,6 +59,7 @@ ...@@ -59,6 +59,7 @@
interaction_dialog_t * p_dialog; interaction_dialog_t * p_dialog;
intf_thread_t * p_intf; intf_thread_t * p_intf;
NSProgressIndicator * o_mainIntfPgbar;
BOOL nib_interact_loaded; BOOL nib_interact_loaded;
} }
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/ *****************************************************************************/
#include "intf.h" #import "intf.h"
#import "interaction.h" #import "interaction.h"
/***************************************************************************** /*****************************************************************************
...@@ -125,6 +125,7 @@ ...@@ -125,6 +125,7 @@
[o_auth_ok_btn setTitle: _NS("OK")]; [o_auth_ok_btn setTitle: _NS("OK")];
[o_input_ok_btn setTitle: _NS("OK")]; [o_input_ok_btn setTitle: _NS("OK")];
[o_input_cancel_btn setTitle: _NS("Cancel")]; [o_input_cancel_btn setTitle: _NS("Cancel")];
o_mainIntfPgbar = [[VLCMain sharedInstance] getMainIntfPgbar];
} }
NSString *o_title = [NSString stringWithUTF8String:p_dialog->psz_title ? p_dialog->psz_title : "title"]; NSString *o_title = [NSString stringWithUTF8String:p_dialog->psz_title ? p_dialog->psz_title : "title"];
...@@ -149,9 +150,12 @@ ...@@ -149,9 +150,12 @@
{ {
o_window = [NSApp mainWindow]; o_window = [NSApp mainWindow];
} }
#if 0
msg_Dbg( p_intf, "Title: %s", [o_title UTF8String] ); msg_Dbg( p_intf, "Title: %s", [o_title UTF8String] );
msg_Dbg( p_intf, "Description: %s", [o_description UTF8String] ); msg_Dbg( p_intf, "Description: %s", [o_description UTF8String] );
#endif
if( p_dialog->i_id == DIALOG_ERRORS ) 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 );
...@@ -190,14 +194,14 @@ ...@@ -190,14 +194,14 @@
msg_Dbg( p_intf, "user progress dialog requested" ); msg_Dbg( p_intf, "user progress dialog requested" );
[o_prog_title setStringValue: o_title]; [o_prog_title setStringValue: o_title];
[o_prog_description setStringValue: o_description]; [o_prog_description setStringValue: o_description];
[o_prog_bar setFloatValue: p_dialog->val.f_float]; [o_prog_bar setDoubleValue: (double)p_dialog->val.f_float];
[NSApp beginSheet: o_prog_win modalForWindow: o_window [NSApp beginSheet: o_prog_win modalForWindow: o_window
modalDelegate: self didEndSelector: nil contextInfo: nil]; modalDelegate: self didEndSelector: nil contextInfo: nil];
[o_prog_win makeKeyWindow]; [o_prog_win makeKeyWindow];
} }
else if( p_dialog->i_flags & DIALOG_PSZ_INPUT_OK_CANCEL ) else if( p_dialog->i_flags & DIALOG_PSZ_INPUT_OK_CANCEL )
{ {
msg_Dbg( p_intf, "text input requested" ); msg_Dbg( p_intf, "text input from user requested" );
[o_input_title setStringValue: o_title]; [o_input_title setStringValue: o_title];
[o_input_description setStringValue: o_description]; [o_input_description setStringValue: o_description];
[o_input_fld setStringValue: @""]; [o_input_fld setStringValue: @""];
...@@ -208,15 +212,15 @@ ...@@ -208,15 +212,15 @@
else if( p_dialog->i_flags & DIALOG_INTF_PROGRESS ) else if( p_dialog->i_flags & DIALOG_INTF_PROGRESS )
{ {
msg_Dbg( p_intf, "progress-bar in main intf requested" ); msg_Dbg( p_intf, "progress-bar in main intf requested" );
[[[VLCMain sharedInstance] getMainScrollField] [[VLCMain sharedInstance] setScrollField: o_description stopAfter: -1];
setStringValue: o_description]; [o_mainIntfPgbar setDoubleValue: (double)p_dialog->val.f_float];
[[[VLCMain sharedInstance] getMainIntfPgbar] [o_mainIntfPgbar setHidden: NO];
setFloatValue: p_dialog->val.f_float];
[[[VLCMain sharedInstance] getMainIntfPgbar] setHidden: NO];
[[[VLCMain sharedInstance] getControllerWindow] makeKeyWindow]; [[[VLCMain sharedInstance] getControllerWindow] makeKeyWindow];
[o_mainIntfPgbar setIndeterminate: NO];
} }
else else
msg_Warn( p_intf, "requested dialog type unknown" ); msg_Err( p_intf, "requested dialog type unknown (%i)",
p_dialog->i_flags );
} }
} }
...@@ -250,28 +254,28 @@ ...@@ -250,28 +254,28 @@
{ {
[o_prog_description setStringValue: \ [o_prog_description setStringValue: \
[NSString stringWithUTF8String: p_dialog->psz_description]]; [NSString stringWithUTF8String: p_dialog->psz_description]];
[o_prog_bar setFloatValue: p_dialog->val.f_float]; [o_prog_bar setDoubleValue: (double)p_dialog->val.f_float];
if( [o_prog_bar doubleValue] == 100.0 ) if( [o_prog_bar doubleValue] == 100.0 )
{ {
/* we are done, let's hide */ /* we are done, let's hide */
[self hideDialog]; [self hideDialog];
return;
} }
return;
} }
if( p_dialog->i_flags & DIALOG_INTF_PROGRESS ) if( p_dialog->i_flags & DIALOG_INTF_PROGRESS )
{ {
[[[VLCMain sharedInstance] getMainScrollField] setStringValue: \ [[VLCMain sharedInstance] setScrollField:
[NSString stringWithUTF8String: p_dialog->psz_description]]; [NSString stringWithUTF8String: p_dialog->psz_description]
[[[VLCMain sharedInstance] getMainIntfPgbar] setFloatValue: \ stopAfter: -1];
p_dialog->val.f_float]; [o_mainIntfPgbar setDoubleValue: (double)p_dialog->val.f_float];
if( [[[VLCMain sharedInstance] getMainIntfPgbar] doubleValue] == 100.0 ) if( [o_mainIntfPgbar doubleValue] == 100.0 )
{ {
/* we are done, let's hide */ /* we are done, let's hide */
[self hideDialog]; [self hideDialog];
return;
} }
return;
} }
} }
...@@ -295,15 +299,17 @@ ...@@ -295,15 +299,17 @@
} }
if( p_dialog->i_flags & DIALOG_INTF_PROGRESS ) if( p_dialog->i_flags & DIALOG_INTF_PROGRESS )
{ {
[[[VLCMain sharedInstance] getMainIntfPgbar] setIndeterminate: YES]; [o_mainIntfPgbar setIndeterminate: YES];
[[[VLCMain sharedInstance] getMainScrollField] setStringValue: @""]; [o_mainIntfPgbar setHidden: YES];
[[[VLCMain sharedInstance] getMainIntfPgbar] setHidden: YES]; [[VLCMain sharedInstance] resetScrollField];
} }
} }
-(void)destroyDialog -(void)destroyDialog
{ {
msg_Dbg( p_intf, "destroy event" ); msg_Dbg( p_intf, "destroy event" );
if( o_mainIntfPgbar )
[o_mainIntfPgbar release];
} }
- (IBAction)cancelAndClose:(id)sender - (IBAction)cancelAndClose:(id)sender
...@@ -318,7 +324,6 @@ ...@@ -318,7 +324,6 @@
- (IBAction)okayAndClose:(id)sender - (IBAction)okayAndClose:(id)sender
{ {
msg_Dbg( p_intf, "dialog's okay btn pressed, returning values" );
vlc_mutex_lock( &p_dialog->p_interaction->object_lock ); vlc_mutex_lock( &p_dialog->p_interaction->object_lock );
if( p_dialog->i_flags == DIALOG_LOGIN_PW_OK_CANCEL ) if( p_dialog->i_flags == DIALOG_LOGIN_PW_OK_CANCEL )
{ {
...@@ -330,6 +335,7 @@ ...@@ -330,6 +335,7 @@
p_dialog->i_return = DIALOG_OK_YES; p_dialog->i_return = DIALOG_OK_YES;
p_dialog->i_status = ANSWERED_DIALOG; p_dialog->i_status = ANSWERED_DIALOG;
vlc_mutex_unlock( &p_dialog->p_interaction->object_lock ); vlc_mutex_unlock( &p_dialog->p_interaction->object_lock );
msg_Dbg( p_intf, "dialog acknowledged" );
} }
@end @end
...@@ -294,7 +294,6 @@ struct intf_sys_t ...@@ -294,7 +294,6 @@ struct intf_sys_t
- (id)getEmbeddedList; - (id)getEmbeddedList;
- (id)getInteractionList; - (id)getInteractionList;
- (id)getMainIntfPgbar; - (id)getMainIntfPgbar;
- (id)getMainScrollField;
- (id)getControllerWindow; - (id)getControllerWindow;
- (void)terminate; - (void)terminate;
- (NSString *)localizedString:(char *)psz; - (NSString *)localizedString:(char *)psz;
......
...@@ -922,15 +922,6 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -922,15 +922,6 @@ static VLCMain *_o_sharedMainInstance = nil;
return nil; return nil;
} }
- (id)getMainScrollField
{
if( o_scrollfield )
return o_scrollfield;
msg_Err( p_intf, "main scroll field item wasn't found" );
return nil;
}
- (id)getControllerWindow - (id)getControllerWindow
{ {
if( o_window ) if( o_window )
......
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