Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
2f57ccdf
Commit
2f57ccdf
authored
Apr 25, 2011
by
Felix Paul Kühne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macosx: disable the open button if we don't have a valid MRL
fixes #4679
parent
bfe08d36
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12945 additions
and
10607 deletions
+12945
-10607
extras/package/macosx/Resources/English.lproj/Open.nib/designable.nib
...ge/macosx/Resources/English.lproj/Open.nib/designable.nib
+12877
-10567
extras/package/macosx/Resources/English.lproj/Open.nib/keyedobjects.nib
.../macosx/Resources/English.lproj/Open.nib/keyedobjects.nib
+0
-0
modules/gui/macosx/open.h
modules/gui/macosx/open.h
+6
-2
modules/gui/macosx/open.m
modules/gui/macosx/open.m
+62
-38
No files found.
extras/package/macosx/Resources/English.lproj/Open.nib/designable.nib
View file @
2f57ccdf
This diff is collapsed.
Click to expand it.
extras/package/macosx/Resources/English.lproj/Open.nib/keyedobjects.nib
View file @
2f57ccdf
No preview for this file type
modules/gui/macosx/open.h
View file @
2f57ccdf
/*****************************************************************************
* open.h: Open dialogues for VLC's MacOS X port
*****************************************************************************
* Copyright (C) 2002-20
09
the VideoLAN team
* Copyright (C) 2002-20
11
the VideoLAN team
* $Id$
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
...
...
@@ -35,7 +35,7 @@ NSArray *GetEjectableMediaOfClass( const char *psz_class );
IBOutlet
id
o_panel
;
IBOutlet
id
o_mrl
;
IBOutlet
id
o_mrl
_fld
;
IBOutlet
id
o_mrl_lbl
;
IBOutlet
id
o_mrl_view
;
IBOutlet
id
o_mrl_btn
;
...
...
@@ -162,11 +162,15 @@ NSArray *GetEjectableMediaOfClass( const char *psz_class );
BOOL
b_autoplay
;
id
o_currentCaptureView
;
NSString
*
o_file_slave_path
;
NSString
*
o_mrl
;
intf_thread_t
*
p_intf
;
}
+
(
VLCOpen
*
)
sharedInstance
;
-
(
void
)
setMRL
:(
NSString
*
)
mrl
;
-
(
NSString
*
)
MRL
;
-
(
void
)
setSubPanel
;
-
(
void
)
openTarget
:(
int
)
i_type
;
-
(
void
)
tabView
:(
NSTabView
*
)
o_tv
didSelectTabViewItem
:(
NSTabViewItem
*
)
o_tvi
;
...
...
modules/gui/macosx/open.m
View file @
2f57ccdf
...
...
@@ -164,6 +164,7 @@ static VLCOpen *_o_sharedMainInstance = nil;
{
if
(
o_file_slave_path
)
[
o_file_slave_path
release
];
[
o_mrl
release
];
[
super
dealloc
];
}
...
...
@@ -296,6 +297,25 @@ static VLCOpen *_o_sharedMainInstance = nil;
selector:
@selector
(
textFieldWasClicked
:)
name:
@"VLCOpenTextFieldWasClicked"
object:
nil
];
[
self
setMRL
:
@""
];
}
-
(
void
)
setMRL
:(
NSString
*
)
newMRL
{
[
o_mrl
release
];
o_mrl
=
newMRL
;
[
o_mrl
retain
];
[
o_mrl_fld
setStringValue
:
newMRL
];
if
([
o_mrl
length
]
>
0
)
[
o_btn_ok
setEnabled
:
YES
];
else
[
o_btn_ok
setEnabled
:
NO
];
}
-
(
NSString
*
)
MRL
{
return
o_mrl
;
}
-
(
void
)
setSubPanel
...
...
@@ -383,7 +403,7 @@ static VLCOpen *_o_sharedMainInstance = nil;
NSMutableArray
*
o_options
=
[
NSMutableArray
array
];
unsigned
int
i
;
o_dic
=
[
NSMutableDictionary
dictionaryWithObject
:
[
o_mrl
stringValue
]
forKey
:
@"ITEM_URL"
];
o_dic
=
[
NSMutableDictionary
dictionaryWithObject
:
[
self
MRL
]
forKey
:
@"ITEM_URL"
];
if
(
[
o_file_sub_ckbox
state
]
==
NSOnState
)
{
module_config_t
*
p_item
;
...
...
@@ -556,27 +576,29 @@ static VLCOpen *_o_sharedMainInstance = nil;
-
(
void
)
openFilePathChanged
:(
NSNotification
*
)
o_notification
{
NSString
*
o_filename
=
[
o_file_path
stringValue
];
bool
b_stream
=
[
o_file_stream
state
];
BOOL
b_dir
=
NO
;
[[
NSFileManager
defaultManager
]
fileExistsAtPath
:
o_filename
isDirectory
:
&
b_dir
];
if
(
o_filename
&&
[
o_filename
>
0
]
)
{
bool
b_stream
=
[
o_file_stream
state
];
BOOL
b_dir
=
NO
;
char
*
psz_uri
=
make_URI
([
o_filename
UTF8String
],
"file"
);
if
(
!
psz_uri
)
return
;
[[
NSFileManager
defaultManager
]
fileExistsAtPath
:
o_filename
isDirectory
:
&
b_dir
];
NSMutableString
*
o_mrl_string
=
[
NSMutableString
stringWithUTF8String
:
psz_uri
];
NSRange
offile
=
[
o_mrl_string
rangeOfString
:
@"file"
];
free
(
psz_uri
);
char
*
psz_uri
=
make_URI
([
o_filename
UTF8String
],
"file"
);
if
(
!
psz_uri
)
return
;
if
(
b_dir
)
{
[
o_mrl_string
replaceCharactersInRange
:
offile
withString
:
@"directory"
];
}
else
if
(
b_stream
)
{
[
o_mrl_string
replaceCharactersInRange
:
offile
withString
:
@"stream"
];
NSMutableString
*
o_mrl_string
=
[
NSMutableString
stringWithUTF8String
:
psz_uri
];
NSRange
offile
=
[
o_mrl_string
rangeOfString
:
@"file"
];
free
(
psz_uri
);
if
(
b_dir
)
[
o_mrl_string
replaceCharactersInRange
:
offile
withString
:
@"directory"
];
else
if
(
b_stream
)
[
o_mrl_string
replaceCharactersInRange
:
offile
withString
:
@"stream"
];
[
self
setMRL
:
o_mrl_string
];
}
[
o_mrl
setStringValue
:
o_mrl_string
];
[
self
setMRL
:
@""
];
}
-
(
IBAction
)
openFileBrowse
:(
id
)
sender
...
...
@@ -752,15 +774,21 @@ static VLCOpen *_o_sharedMainInstance = nil;
}
else
/* VIDEO_TS folder */
{
if
(
b_no_menus
)
o_mrl_string
=
[
NSString
stringWithFormat
:
@"dvdread://%@@%i:%i"
,
o_videots
,
i_title
,
i_chapter
];
if
([
o_videots
length
]
>
0
)
{
if
(
b_no_menus
)
o_mrl_string
=
[
NSString
stringWithFormat
:
@"dvdread://%@@%i:%i"
,
o_videots
,
i_title
,
i_chapter
];
else
o_mrl_string
=
[
NSString
stringWithFormat
:
@"dvdnav://%@"
,
o_videots
];
}
else
o_mrl_string
=
[
NSString
stringWithFormat
:
@"dvdnav://%@"
,
o_videots
];
o_mrl_string
=
@""
;
}
[
o_mrl
setStringValue
:
o_mrl_string
];
if
([
o_device
length
]
>
0
)
[
self
setMRL
:
o_mrl_string
];
else
[
self
setMRL
:
@""
];
}
-
(
IBAction
)
openDiscMenusChanged
:(
id
)
sender
...
...
@@ -882,7 +910,7 @@ static VLCOpen *_o_sharedMainInstance = nil;
{
o_mrl_string
=
[
o_net_http_url
stringValue
];
}
[
o_mrl
setStringValue
:
o_mrl_string
];
[
self
setMRL
:
o_mrl_string
];
}
-
(
IBAction
)
openNetUDPButtonAction
:(
id
)
sender
...
...
@@ -935,7 +963,7 @@ static VLCOpen *_o_sharedMainInstance = nil;
[
o_mrl_string
stringByAppendingFormat
:
@":%i"
,
i_port
];
}
}
[
o_mrl
setStringValue
:
o_mrl_string
];
[
self
setMRL
:
o_mrl_string
];
[
o_net_http_url
setStringValue
:
o_mrl_string
];
[
o_net_udp_panel
orderOut
:
sender
];
[
NSApp
endSheet
:
o_net_udp_panel
];
...
...
@@ -1015,12 +1043,12 @@ static VLCOpen *_o_sharedMainInstance = nil;
}
else
[
self
showCaptureView
:
o_eyetv_notLaunched_view
];
[
o_mrl
setStringValue
:
@""
];
[
self
setMRL
:
@""
];
}
else
if
(
[[[
o_capture_mode_pop
selectedItem
]
title
]
isEqualToString
:
_NS
(
"Screen"
)]
)
{
[
self
showCaptureView
:
o_screen_view
];
[
o_mrl
setStringValue
:
@"screen://"
];
[
self
setMRL
:
@"screen://"
];
[
o_screen_height_fld
setIntValue
:
config_GetInt
(
p_intf
,
"screen-height"
)];
[
o_screen_width_fld
setIntValue
:
config_GetInt
(
p_intf
,
"screen-width"
)];
[
o_screen_fps_fld
setFloatValue
:
config_GetFloat
(
p_intf
,
"screen-fps"
)];
...
...
@@ -1036,7 +1064,7 @@ static VLCOpen *_o_sharedMainInstance = nil;
[
o_capture_long_lbl
displayIfNeeded
];
[
self
showCaptureView
:
o_capture_label_view
];
[
o_mrl
setStringValue
:
@"qtcapture://"
];
[
self
setMRL
:
@"qtcapture://"
];
}
}
...
...
@@ -1044,7 +1072,7 @@ static VLCOpen *_o_sharedMainInstance = nil;
{
[
o_screen_fps_fld
setFloatValue
:
[
o_screen_fps_stp
floatValue
]];
[
o_panel
makeFirstResponder
:
o_screen_fps_fld
];
[
o_mrl
setStringValue
:
@"screen://"
];
[
self
setMRL
:
@"screen://"
];
}
-
(
void
)
screenFPSfieldChanged
:(
NSNotification
*
)
o_notification
...
...
@@ -1052,7 +1080,7 @@ static VLCOpen *_o_sharedMainInstance = nil;
[
o_screen_fps_stp
setFloatValue
:
[
o_screen_fps_fld
floatValue
]];
if
(
[[
o_screen_fps_fld
stringValue
]
isEqualToString
:
@""
]
)
[
o_screen_fps_fld
setFloatValue
:
1
.
0
];
[
o_mrl
setStringValue
:
@"screen://"
];
[
self
setMRL
:
@"screen://"
];
}
-
(
IBAction
)
eyetvSwitchChannel
:(
id
)
sender
...
...
@@ -1061,19 +1089,19 @@ static VLCOpen *_o_sharedMainInstance = nil;
{
int
chanNum
=
[[[
VLCMain
sharedInstance
]
eyeTVController
]
switchChannelUp
:
YES
];
[
o_eyetv_channels_pop
selectItemWithTag
:
chanNum
];
[
o_mrl
setStringValue
:
[
NSString
stringWithFormat
:
@"eyetv:// :eyetv-channel=%d"
,
chanNum
]];
[
self
setMRL
:
[
NSString
stringWithFormat
:
@"eyetv:// :eyetv-channel=%d"
,
chanNum
]];
}
else
if
(
sender
==
o_eyetv_previousProgram_btn
)
{
int
chanNum
=
[[[
VLCMain
sharedInstance
]
eyeTVController
]
switchChannelUp
:
NO
];
[
o_eyetv_channels_pop
selectItemWithTag
:
chanNum
];
[
o_mrl
setStringValue
:
[
NSString
stringWithFormat
:
@"eyetv:// :eyetv-channel=%d"
,
chanNum
]];
[
self
setMRL
:
[
NSString
stringWithFormat
:
@"eyetv:// :eyetv-channel=%d"
,
chanNum
]];
}
else
if
(
sender
==
o_eyetv_channels_pop
)
{
int
chanNum
=
[[
sender
selectedItem
]
tag
];
[[[
VLCMain
sharedInstance
]
eyeTVController
]
selectChannel
:
chanNum
];
[
o_mrl
setStringValue
:
[
NSString
stringWithFormat
:
@"eyetv:// :eyetv-channel=%d"
,
chanNum
]];
[
self
setMRL
:
[
NSString
stringWithFormat
:
@"eyetv:// :eyetv-channel=%d"
,
chanNum
]];
}
else
msg_Err
(
VLCIntf
,
"eyetvSwitchChannel sent by unknown object"
);
...
...
@@ -1228,14 +1256,10 @@ static VLCOpen *_o_sharedMainInstance = nil;
-
(
IBAction
)
panelOk
:(
id
)
sender
{
if
(
[[
o_mrl
stringValue
]
length
]
)
{
if
(
[[
self
MRL
]
length
]
)
[
NSApp
stopModalWithCode
:
1
];
}
else
{
NSBeep
();
}
}
@end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment