mirror of
https://code.videolan.org/videolan/vlc
synced 2024-08-18 23:45:06 +02:00
macosx/core dialog provider: cosmetics
This commit is contained in:
parent
739e12441e
commit
63b9ae0971
@ -21,8 +21,6 @@
|
|||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
#import <vlc_common.h>
|
|
||||||
#import <vlc_dialog.h>
|
|
||||||
#import <Cocoa/Cocoa.h>
|
#import <Cocoa/Cocoa.h>
|
||||||
|
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
@ -54,11 +52,8 @@
|
|||||||
@property (readwrite, weak) IBOutlet NSTextField *progressDescriptionLabel;
|
@property (readwrite, weak) IBOutlet NSTextField *progressDescriptionLabel;
|
||||||
@property (readwrite, weak) IBOutlet NSTextField *progressTitleLabel;
|
@property (readwrite, weak) IBOutlet NSTextField *progressTitleLabel;
|
||||||
|
|
||||||
|
|
||||||
@property (readonly) VLCErrorWindowController* errorPanel;
|
@property (readonly) VLCErrorWindowController* errorPanel;
|
||||||
|
|
||||||
@property (atomic,readwrite) BOOL progressCancelled;
|
|
||||||
|
|
||||||
- (IBAction)authenticationDialogAction:(id)sender;
|
- (IBAction)authenticationDialogAction:(id)sender;
|
||||||
|
|
||||||
- (IBAction)progressDialogAction:(id)sender;
|
- (IBAction)progressDialogAction:(id)sender;
|
||||||
|
@ -27,12 +27,13 @@
|
|||||||
#import "main/VLCMain.h"
|
#import "main/VLCMain.h"
|
||||||
#import "windows/VLCErrorWindowController.h"
|
#import "windows/VLCErrorWindowController.h"
|
||||||
|
|
||||||
/* for the icon in our custom error panel */
|
#import <vlc_common.h>
|
||||||
#import <ApplicationServices/ApplicationServices.h>
|
#import <vlc_dialog.h>
|
||||||
|
|
||||||
@interface VLCCoreDialogProvider ()
|
@interface VLCCoreDialogProvider ()
|
||||||
|
|
||||||
- (void)displayErrorWithTitle:(NSString *)title text:(NSString *)text;
|
- (void)displayErrorWithTitle:(NSString *)title
|
||||||
|
text:(NSString *)text;
|
||||||
|
|
||||||
- (void)displayLoginDialog:(vlc_dialog_id *)dialogID
|
- (void)displayLoginDialog:(vlc_dialog_id *)dialogID
|
||||||
title:(NSString *)title
|
title:(NSString *)title
|
||||||
@ -61,7 +62,6 @@
|
|||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|
||||||
static void displayErrorCallback(void *p_data,
|
static void displayErrorCallback(void *p_data,
|
||||||
const char *psz_title,
|
const char *psz_title,
|
||||||
const char *psz_text)
|
const char *psz_text)
|
||||||
@ -210,7 +210,6 @@ static void updateProgressCallback(void *p_data,
|
|||||||
|
|
||||||
-(void)awakeFromNib
|
-(void)awakeFromNib
|
||||||
{
|
{
|
||||||
_progressCancelled = NO;
|
|
||||||
[_authenticationLoginLabel setStringValue: _NS("Username")];
|
[_authenticationLoginLabel setStringValue: _NS("Username")];
|
||||||
[_authenticationPasswordLabel setStringValue: _NS("Password")];
|
[_authenticationPasswordLabel setStringValue: _NS("Password")];
|
||||||
[_authenticationCancelButton setTitle: _NS("Cancel")];
|
[_authenticationCancelButton setTitle: _NS("Cancel")];
|
||||||
|
@ -28,7 +28,6 @@
|
|||||||
@property (readwrite, weak) IBOutlet NSButton *cleanupButton;
|
@property (readwrite, weak) IBOutlet NSButton *cleanupButton;
|
||||||
@property (readwrite, weak) IBOutlet NSTableView *errorTable;
|
@property (readwrite, weak) IBOutlet NSTableView *errorTable;
|
||||||
|
|
||||||
|
|
||||||
- (IBAction)cleanupTable:(id)sender;
|
- (IBAction)cleanupTable:(id)sender;
|
||||||
|
|
||||||
- (void)addError:(NSString *)title withMsg:(NSString *)message;
|
- (void)addError:(NSString *)title withMsg:(NSString *)message;
|
||||||
|
@ -30,7 +30,6 @@
|
|||||||
NSMutableArray *_errors;
|
NSMutableArray *_errors;
|
||||||
NSMutableArray *_icons;
|
NSMutableArray *_icons;
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation VLCErrorWindowController
|
@implementation VLCErrorWindowController
|
||||||
@ -64,12 +63,10 @@
|
|||||||
NSMutableAttributedString * ourError;
|
NSMutableAttributedString * ourError;
|
||||||
ourError = [[NSMutableAttributedString alloc] initWithString:
|
ourError = [[NSMutableAttributedString alloc] initWithString:
|
||||||
[NSString stringWithFormat:@"%@\n%@", title, message]
|
[NSString stringWithFormat:@"%@\n%@", title, message]
|
||||||
attributes:
|
attributes:@{NSFontAttributeName : [NSFont systemFontOfSize:11]}];
|
||||||
[NSDictionary dictionaryWithObject: [NSFont systemFontOfSize:11] forKey: NSFontAttributeName]];
|
[ourError addAttribute: NSFontAttributeName
|
||||||
[ourError
|
value: [NSFont boldSystemFontOfSize:11]
|
||||||
addAttribute: NSFontAttributeName
|
range: NSMakeRange(0, [title length])];
|
||||||
value: [NSFont boldSystemFontOfSize:11]
|
|
||||||
range: NSMakeRange(0, [title length])];
|
|
||||||
[_errors addObject: ourError];
|
[_errors addObject: ourError];
|
||||||
|
|
||||||
[_icons addObject: [[NSWorkspace sharedWorkspace] iconForFileType:NSFileTypeForHFSTypeCode(kAlertStopIcon)]];
|
[_icons addObject: [[NSWorkspace sharedWorkspace] iconForFileType:NSFileTypeForHFSTypeCode(kAlertStopIcon)]];
|
||||||
@ -92,8 +89,8 @@
|
|||||||
return [_errors count];
|
return [_errors count];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id)tableView:(NSTableView *)theDataTable objectValueForTableColumn:
|
- (id)tableView:(NSTableView *)theDataTable objectValueForTableColumn:(NSTableColumn *)theTableColumn
|
||||||
(NSTableColumn *)theTableColumn row: (NSInteger)row
|
row: (NSInteger)row
|
||||||
{
|
{
|
||||||
if ([[theTableColumn identifier] isEqualToString: @"error_msg"])
|
if ([[theTableColumn identifier] isEqualToString: @"error_msg"])
|
||||||
return [_errors objectAtIndex:row];
|
return [_errors objectAtIndex:row];
|
||||||
|
Loading…
Reference in New Issue
Block a user