Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
f8cbff74
Commit
f8cbff74
authored
Feb 12, 2014
by
Felix Paul Kühne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macosx: iterate on the addon manager
parent
f7016207
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
305 additions
and
993 deletions
+305
-993
extras/package/macosx/Resources/English.lproj/AddonManager.xib
...s/package/macosx/Resources/English.lproj/AddonManager.xib
+250
-978
modules/gui/macosx/AddonManager.h
modules/gui/macosx/AddonManager.h
+7
-1
modules/gui/macosx/AddonManager.m
modules/gui/macosx/AddonManager.m
+48
-14
No files found.
extras/package/macosx/Resources/English.lproj/AddonManager.xib
View file @
f8cbff74
This diff is collapsed.
Click to expand it.
modules/gui/macosx/AddonManager.h
View file @
f8cbff74
...
...
@@ -28,12 +28,18 @@
IBOutlet
NSButton
*
_localAddonsOnlyCheckbox
;
IBOutlet
NSTableView
*
_addonsTable
;
IBOutlet
NSProgressIndicator
*
_spinner
;
IBOutlet
NSTextField
*
_name
;
IBOutlet
NSTextField
*
_author
;
IBOutlet
NSTextField
*
_version
;
IBOutlet
NSTextView
*
_description
;
}
+
(
VLCAddonManager
*
)
sharedInstance
;
-
(
void
)
showWindow
;
-
(
IBAction
)
switchType
:(
id
)
sender
;
-
(
IBAction
)
toggleLocalCheckbox
:(
id
)
sender
;
-
(
IBAction
)
tableAction
:(
id
)
sender
;
-
(
IBAction
)
installSelection
:(
id
)
sender
;
-
(
IBAction
)
uninstallSelection
:(
id
)
sender
;
-
(
IBAction
)
refresh
:(
id
)
sender
;
@end
\ No newline at end of file
modules/gui/macosx/AddonManager.m
View file @
f8cbff74
...
...
@@ -103,6 +103,10 @@ static VLCAddonManager *_o_sharedInstance = nil;
[
_localAddonsOnlyCheckbox
setState
:
NSOffState
];
[
_spinner
setUsesThreadedAnimation
:
YES
];
[
_name
setStringValue
:
@""
];
[
_author
setStringValue
:
@""
];
[
_version
setStringValue
:
@""
];
[
_description
setString
:
@""
];
[
_window
setTitle
:
_NS
(
"Addon Manager"
)];
[[[
_addonsTable
tableColumnWithIdentifier
:
@"installed"
]
headerCell
]
setStringValue
:
_NS
(
"Installed"
)];
...
...
@@ -123,7 +127,6 @@ static VLCAddonManager *_o_sharedInstance = nil;
-
(
void
)
showWindow
{
[
self
_findNewAddons
];
[
_spinner
startAnimation
:
nil
];
[
_window
makeKeyAndOrderFront
:
nil
];
}
...
...
@@ -137,18 +140,29 @@ static VLCAddonManager *_o_sharedInstance = nil;
[
self
_refactorDataModel
];
}
-
(
IBAction
)
tableAction
:(
id
)
sender
-
(
IBAction
)
installSelection
:(
id
)
sender
{
NSInteger
selectedRow
=
[
_addonsTable
selectedRow
];
if
(
selectedRow
>
_displayedAddons
.
count
-
1
||
selectedRow
<
0
)
return
;
NSDictionary
*
currentItem
=
_displayedAddons
[
selectedRow
];
[
self
_installAddonWithID
:[[
currentItem
objectForKey
:
@"uuid"
]
pointerValue
]];
}
-
(
IBAction
)
uninstallSelection
:(
id
)
sender
{
NSInteger
clickedRow
=
[
_addonsTable
click
edRow
];
if
(
clickedRow
>
_displayedAddons
.
count
-
1
||
click
edRow
<
0
)
NSInteger
selectedRow
=
[
_addonsTable
select
edRow
];
if
(
selectedRow
>
_displayedAddons
.
count
-
1
||
select
edRow
<
0
)
return
;
NSDictionary
*
currentItem
=
_displayedAddons
[
clickedRow
];
NSDictionary
*
currentItem
=
_displayedAddons
[
selectedRow
];
[
self
_removeAddonWithID
:[[
currentItem
objectForKey
:
@"uuid"
]
pointerValue
]];
}
if
([[
currentItem
objectForKey
:
@"state"
]
intValue
]
==
ADDON_INSTALLED
)
[
self
_removeAddonWithID
:[[
currentItem
objectForKey
:
@"uuid"
]
pointerValue
]];
else
[
self
_installAddonWithID
:[[
currentItem
objectForKey
:
@"uuid"
]
pointerValue
]];
-
(
IBAction
)
refresh
:(
id
)
sender
{
[
self
_findNewAddons
];
}
-
(
NSInteger
)
numberOfRowsInTableView
:(
NSTableView
*
)
aTableView
...
...
@@ -156,6 +170,24 @@ static VLCAddonManager *_o_sharedInstance = nil;
return
[
_displayedAddons
count
];
}
-
(
void
)
tableViewSelectionDidChange
:(
NSNotification
*
)
aNotification
{
NSInteger
selectedRow
=
[
_addonsTable
selectedRow
];
if
(
selectedRow
>
_displayedAddons
.
count
-
1
||
selectedRow
<
0
)
{
[
_name
setStringValue
:
@""
];
[
_author
setStringValue
:
@""
];
[
_version
setStringValue
:
@""
];
[
_description
setString
:
@""
];
return
;
}
NSDictionary
*
currentItem
=
_displayedAddons
[
selectedRow
];
[
_name
setStringValue
:[
currentItem
objectForKey
:
@"name"
]];
[
_author
setStringValue
:[
currentItem
objectForKey
:
@"author"
]];
[
_version
setStringValue
:[
currentItem
objectForKey
:
@"version"
]];
[
_description
setString
:[
currentItem
objectForKey
:
@"description"
]];
}
-
(
id
)
tableView
:(
NSTableView
*
)
aTableView
objectValueForTableColumn
:(
NSTableColumn
*
)
aTableColumn
row
:(
NSInteger
)
rowIndex
{
NSString
*
identifier
=
[
aTableColumn
identifier
];
...
...
@@ -180,11 +212,11 @@ static VLCAddonManager *_o_sharedInstance = nil;
NSDictionary
*
addonProperties
=
[
NSDictionary
dictionaryWithObjectsAndKeys
:
name
,
@"name"
,
[
NSString
stringWithUTF8String
:
p_entry
->
psz_description
?
p_entry
->
psz_description
:
""
]
,
@"description"
,
[
NSString
stringWithUTF8String
:
p_entry
->
psz_author
?
p_entry
->
psz_author
:
""
]
,
@"author"
,
[
NSString
stringWithUTF8String
:
p_entry
->
psz_source_uri
?
p_entry
->
psz_source_uri
:
""
]
,
@"uri"
,
[
NSString
stringWithUTF8String
:
p_entry
->
psz_version
?
p_entry
->
psz_version
:
""
]
,
@"version"
,
[
NSString
stringWithUTF8String
:
p_entry
->
psz_image_uri
?
p_entry
->
psz_image_uri
:
""
]
,
@"imageuri"
,
toNSStr
(
p_entry
->
psz_description
)
,
@"description"
,
toNSStr
(
p_entry
->
psz_author
)
,
@"author"
,
toNSStr
(
p_entry
->
psz_source_uri
)
,
@"uri"
,
toNSStr
(
p_entry
->
psz_version
)
,
@"version"
,
toNSStr
(
p_entry
->
psz_image_uri
)
,
@"imageuri"
,
[
NSNumber
numberWithInt
:
p_entry
->
e_state
],
@"state"
,
[
NSNumber
numberWithInt
:
p_entry
->
e_type
],
@"type"
,
[
NSValue
valueWithPointer
:
&
p_entry
->
uuid
],
@"uuid"
,
...
...
@@ -240,11 +272,13 @@ static VLCAddonManager *_o_sharedInstance = nil;
[
_displayedAddons
release
];
_displayedAddons
=
[
NSArray
arrayWithArray
:
filteredItems
];
[
_displayedAddons
retain
];
[
filteredItems
release
];
[
_addonsTable
reloadData
];
}
-
(
void
)
_findNewAddons
{
[
_spinner
startAnimation
:
nil
];
addons_manager_Gather
(
_manager
,
NULL
);
}
...
...
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