Browse Source

macosx/coredialogs: fix compilation by removing virtually all the legacy code

pull/39/head
Felix Paul Kühne 10 years ago
parent
commit
e3f2ec3e00
  1. 1
      Makefile.am
  2. 1340
      extras/package/macosx/Resources/English.lproj/CoreDialogs.xib
  3. 718
      extras/package/macosx/Resources/English.lproj/ErrorPanel.xib
  4. 11
      extras/package/macosx/Resources/English.lproj/MainMenu.xib
  5. 12
      extras/package/macosx/vlc.xcodeproj/project.pbxproj
  6. 1
      modules/gui/macosx/MainMenu.h
  7. 8
      modules/gui/macosx/MainMenu.m
  8. 76
      modules/gui/macosx/coredialogs.h
  9. 327
      modules/gui/macosx/coredialogs.m

1
Makefile.am

@ -141,7 +141,6 @@ EXTRA_DIST += \
extras/package/macosx/Resources/English.lproj/CoreDialogs.xib \
extras/package/macosx/Resources/English.lproj/DebugMessageVisualizer.xib \
extras/package/macosx/Resources/English.lproj/DetachedVideoWindow.xib \
extras/package/macosx/Resources/English.lproj/ErrorPanel.xib \
extras/package/macosx/Resources/English.lproj/FSPanel.xib \
extras/package/macosx/Resources/English.lproj/InfoPlist.strings.in \
extras/package/macosx/Resources/English.lproj/Help.xib \

1340
extras/package/macosx/Resources/English.lproj/CoreDialogs.xib

File diff suppressed because it is too large

718
extras/package/macosx/Resources/English.lproj/ErrorPanel.xib

@ -1,718 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="8.00">
<data>
<int key="IBDocument.SystemTarget">1060</int>
<string key="IBDocument.SystemVersion">14D136</string>
<string key="IBDocument.InterfaceBuilderVersion">7702</string>
<string key="IBDocument.AppKitVersion">1347.57</string>
<string key="IBDocument.HIToolboxVersion">758.70</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="NS.object.0">7702</string>
</object>
<array key="IBDocument.IntegratedClassDependencies">
<string>NSButton</string>
<string>NSButtonCell</string>
<string>NSCustomObject</string>
<string>NSImageCell</string>
<string>NSScrollView</string>
<string>NSScroller</string>
<string>NSTableColumn</string>
<string>NSTableView</string>
<string>NSTextFieldCell</string>
<string>NSView</string>
<string>NSWindowTemplate</string>
</array>
<array key="IBDocument.PluginDependencies">
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
</array>
<object class="NSMutableDictionary" key="IBDocument.Metadata">
<string key="NS.key.0">PluginDependencyRecalculationVersion</string>
<integer value="1" key="NS.object.0"/>
</object>
<array class="NSMutableArray" key="IBDocument.RootObjects" id="638050510">
<object class="NSCustomObject" id="923016430">
<string key="NSClassName">ErrorWindowController</string>
</object>
<object class="NSCustomObject" id="159526500">
<string key="NSClassName">FirstResponder</string>
</object>
<object class="NSCustomObject" id="604394034">
<string key="NSClassName">NSApplication</string>
</object>
<object class="NSWindowTemplate" id="883469087">
<int key="NSWindowStyleMask">31</int>
<int key="NSWindowBacking">2</int>
<string key="NSWindowRect">{{304, 373}, {397, 209}}</string>
<int key="NSWTFlags">-260571136</int>
<string key="NSWindowTitle">Errors and Warnings</string>
<object class="NSMutableString" key="NSWindowClass">
<characters key="NS.bytes">NSPanel</characters>
</object>
<object class="NSMutableString" key="NSViewClass">
<characters key="NS.bytes">View</characters>
</object>
<nil key="NSUserInterfaceItemIdentifier"/>
<string key="NSWindowContentMinSize">{260, 120}</string>
<object class="NSView" key="NSWindowView" id="927381863">
<reference key="NSNextResponder"/>
<int key="NSvFlags">256</int>
<array class="NSMutableArray" key="NSSubviews">
<object class="NSScrollView" id="921986171">
<reference key="NSNextResponder" ref="927381863"/>
<int key="NSvFlags">274</int>
<array class="NSMutableArray" key="NSSubviews">
<object class="NSClipView" id="502587650">
<reference key="NSNextResponder" ref="921986171"/>
<int key="NSvFlags">2322</int>
<array class="NSMutableArray" key="NSSubviews">
<object class="NSTableView" id="523335037">
<reference key="NSNextResponder" ref="502587650"/>
<int key="NSvFlags">256</int>
<string key="NSFrameSize">{396, 168}</string>
<reference key="NSSuperview" ref="502587650"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="106880244"/>
<bool key="NSEnabled">YES</bool>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
<bool key="NSControlAllowsExpansionToolTips">YES</bool>
<object class="_NSCornerView" key="NSCornerView">
<nil key="NSNextResponder"/>
<int key="NSvFlags">-2147483392</int>
<string key="NSFrame">{{-26, 0}, {16, 17}}</string>
</object>
<array class="NSMutableArray" key="NSTableColumns">
<object class="NSTableColumn" id="903607660">
<string key="NSIdentifier">icon</string>
<double key="NSWidth">45</double>
<double key="NSMinWidth">32</double>
<double key="NSMaxWidth">1000</double>
<object class="NSTableHeaderCell" key="NSHeaderCell">
<int key="NSCellFlags">75497536</int>
<int key="NSCellFlags2">134219776</int>
<string key="NSContents">icons</string>
<object class="NSFont" key="NSSupport" id="26">
<bool key="IBIsSystemFont">YES</bool>
<double key="NSSize">11</double>
<int key="NSfFlags">3100</int>
</object>
<object class="NSColor" key="NSBackgroundColor" id="88476785">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MC4zMzMzMzI5OQA</bytes>
</object>
<object class="NSColor" key="NSTextColor" id="327673337">
<int key="NSColorSpace">6</int>
<string key="NSCatalogName">System</string>
<string key="NSColorName">headerTextColor</string>
<object class="NSColor" key="NSColor" id="440089055">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MAA</bytes>
</object>
</object>
</object>
<object class="NSImageCell" key="NSDataCell" id="300340057">
<int key="NSCellFlags">134217728</int>
<int key="NSCellFlags2">33554432</int>
<int key="NSAlign">0</int>
<int key="NSScale">0</int>
<int key="NSStyle">0</int>
<bool key="NSAnimates">YES</bool>
</object>
<int key="NSResizingMask">3</int>
<bool key="NSIsResizeable">YES</bool>
<reference key="NSTableView" ref="523335037"/>
</object>
<object class="NSTableColumn" id="532063799">
<string key="NSIdentifier">error_msg</string>
<double key="NSWidth">344.99560000000002</double>
<double key="NSMinWidth">39.995609999999999</double>
<double key="NSMaxWidth">1000</double>
<object class="NSTableHeaderCell" key="NSHeaderCell">
<int key="NSCellFlags">75497536</int>
<int key="NSCellFlags2">2048</int>
<string key="NSContents">errors</string>
<reference key="NSSupport" ref="26"/>
<reference key="NSBackgroundColor" ref="88476785"/>
<reference key="NSTextColor" ref="327673337"/>
</object>
<object class="NSTextFieldCell" key="NSDataCell" id="761678192">
<int key="NSCellFlags">337641472</int>
<int key="NSCellFlags2">0</int>
<reference key="NSSupport" ref="26"/>
<reference key="NSControlView" ref="523335037"/>
<object class="NSColor" key="NSBackgroundColor">
<int key="NSColorSpace">6</int>
<string key="NSCatalogName">System</string>
<string key="NSColorName">textBackgroundColor</string>
<object class="NSColor" key="NSColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
</object>
</object>
<object class="NSColor" key="NSTextColor">
<int key="NSColorSpace">6</int>
<string key="NSCatalogName">System</string>
<string key="NSColorName">controlTextColor</string>
<reference key="NSColor" ref="440089055"/>
</object>
</object>
<int key="NSResizingMask">3</int>
<bool key="NSIsResizeable">YES</bool>
<bool key="NSIsEditable">YES</bool>
<reference key="NSTableView" ref="523335037"/>
</object>
</array>
<double key="NSIntercellSpacingWidth">3</double>
<double key="NSIntercellSpacingHeight">2</double>
<object class="NSColor" key="NSBackgroundColor" id="50310571">
<int key="NSColorSpace">6</int>
<string key="NSCatalogName">System</string>
<string key="NSColorName">controlBackgroundColor</string>
<object class="NSColor" key="NSColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MC42NjY2NjY2NjY3AA</bytes>
</object>
</object>
<object class="NSColor" key="NSGridColor">
<int key="NSColorSpace">6</int>
<string key="NSCatalogName">System</string>
<string key="NSColorName">gridColor</string>
<object class="NSColor" key="NSColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MC41AA</bytes>
</object>
</object>
<double key="NSRowHeight">45</double>
<int key="NSTvFlags">1388314624</int>
<reference key="NSDelegate"/>
<reference key="NSDataSource"/>
<int key="NSColumnAutoresizingStyle">4</int>
<int key="NSDraggingSourceMaskForLocal">15</int>
<int key="NSDraggingSourceMaskForNonLocal">0</int>
<bool key="NSAllowsTypeSelect">YES</bool>
<int key="NSTableViewDraggingDestinationStyle">0</int>
<int key="NSTableViewGroupRowStyle">1</int>
</object>
</array>
<string key="NSFrame">{{1, 1}, {396, 168}}</string>
<reference key="NSSuperview" ref="921986171"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="523335037"/>
<reference key="NSDocView" ref="523335037"/>
<reference key="NSBGColor" ref="50310571"/>
<int key="NScvFlags">4</int>
<bool key="NSAutomaticallyAdjustsContentInsets">YES</bool>
</object>
<object class="NSScroller" id="671740945">
<reference key="NSNextResponder" ref="921986171"/>
<int key="NSvFlags">-2147483392</int>
<string key="NSFrame">{{-30, 1}, {15, 168}}</string>
<reference key="NSSuperview" ref="921986171"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="502587650"/>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
<string key="NSControlAction">_doScroller:</string>
<reference key="NSControlTarget" ref="921986171"/>
<reference key="NSTarget" ref="921986171"/>
<string key="NSAction">_doScroller:</string>
<double key="NSPercent">0.35744680000000001</double>
</object>
<object class="NSScroller" id="584787219">
<reference key="NSNextResponder" ref="921986171"/>
<int key="NSvFlags">-2147483392</int>
<string key="NSFrame">{{1, -30}, {381, 15}}</string>
<reference key="NSSuperview" ref="921986171"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="671740945"/>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
<string key="NSControlAction">_doScroller:</string>
<reference key="NSControlTarget" ref="921986171"/>
<int key="NSsFlags">1</int>
<reference key="NSTarget" ref="921986171"/>
<string key="NSAction">_doScroller:</string>
<double key="NSPercent">0.96212120000000001</double>
</object>
</array>
<string key="NSFrame">{{0, 39}, {398, 170}}</string>
<reference key="NSSuperview" ref="927381863"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="584787219"/>
<int key="NSsFlags">133682</int>
<reference key="NSVScroller" ref="671740945"/>
<reference key="NSHScroller" ref="584787219"/>
<reference key="NSContentView" ref="502587650"/>
<bytes key="NSScrollAmts">QSAAAEEgAABCPAAAQjwAAA</bytes>
<double key="NSMinMagnification">0.25</double>
<double key="NSMaxMagnification">4</double>
<double key="NSMagnification">1</double>
</object>
<object class="NSButton" id="106880244">
<reference key="NSNextResponder" ref="927381863"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{15, 7}, {94, 28}}</string>
<reference key="NSSuperview" ref="927381863"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="488199561">
<int key="NSCellFlags">67108864</int>
<int key="NSCellFlags2">134348800</int>
<string key="NSContents">Clean up</string>
<reference key="NSSupport" ref="26"/>
<reference key="NSControlView" ref="106880244"/>
<int key="NSButtonFlags">-2038284288</int>
<int key="NSButtonFlags2">1</int>
<reference key="NSAlternateImage" ref="26"/>
<string key="NSAlternateContents"/>
<object class="NSMutableString" key="NSKeyEquivalent">
<characters key="NS.bytes"/>
</object>
<int key="NSPeriodicDelay">200</int>
<int key="NSPeriodicInterval">25</int>
</object>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
</object>
</array>
<string key="NSFrameSize">{397, 209}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="921986171"/>
</object>
<string key="NSScreenRect">{{0, 0}, {1680, 1027}}</string>
<string key="NSMinSize">{213, 129}</string>
<string key="NSMaxSize">{10000000000000, 10000000000000}</string>
<string key="NSFrameAutosaveName">ErrorsAndWarnings</string>
<bool key="NSWindowIsRestorable">YES</bool>
</object>
</array>
<object class="IBObjectContainer" key="IBDocument.Objects">
<array key="connectionRecords">
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">o_error_table</string>
<reference key="source" ref="923016430"/>
<reference key="destination" ref="523335037"/>
</object>
<int key="connectionID">12</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">o_cleanup_button</string>
<reference key="source" ref="923016430"/>
<reference key="destination" ref="106880244"/>
</object>
<int key="connectionID">13</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">cleanupTable:</string>
<reference key="source" ref="923016430"/>
<reference key="destination" ref="106880244"/>
</object>
<int key="connectionID">15</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">window</string>
<reference key="source" ref="923016430"/>
<reference key="destination" ref="883469087"/>
</object>
<int key="connectionID">75</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">dataSource</string>
<reference key="source" ref="523335037"/>
<reference key="destination" ref="923016430"/>
</object>
<int key="connectionID">16</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">delegate</string>
<reference key="source" ref="523335037"/>
<reference key="destination" ref="923016430"/>
</object>
<int key="connectionID">17</int>
</object>
</array>
<object class="IBMutableOrderedSet" key="objectRecords">
<array key="orderedObjects">
<object class="IBObjectRecord">
<int key="objectID">0</int>
<array key="object" id="0"/>
<reference key="children" ref="638050510"/>
<nil key="parent"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">-2</int>
<reference key="object" ref="923016430"/>
<reference key="parent" ref="0"/>
<string key="objectName">File's Owner</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">-1</int>
<reference key="object" ref="159526500"/>
<reference key="parent" ref="0"/>
<string key="objectName">First Responder</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">-3</int>
<reference key="object" ref="604394034"/>
<reference key="parent" ref="0"/>
<string key="objectName">Application</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">5</int>
<reference key="object" ref="883469087"/>
<array class="NSMutableArray" key="children">
<reference ref="927381863"/>
</array>
<reference key="parent" ref="0"/>
<string key="objectName">Non-Blocking errors</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">6</int>
<reference key="object" ref="927381863"/>
<array class="NSMutableArray" key="children">
<reference ref="921986171"/>
<reference ref="106880244"/>
</array>
<reference key="parent" ref="883469087"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">7</int>
<reference key="object" ref="921986171"/>
<array class="NSMutableArray" key="children">
<reference ref="523335037"/>
<reference ref="671740945"/>
<reference ref="584787219"/>
</array>
<reference key="parent" ref="927381863"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">8</int>
<reference key="object" ref="523335037"/>
<array class="NSMutableArray" key="children">
<reference ref="903607660"/>
<reference ref="532063799"/>
</array>
<reference key="parent" ref="921986171"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">9</int>
<reference key="object" ref="903607660"/>
<array class="NSMutableArray" key="children">
<reference ref="300340057"/>
</array>
<reference key="parent" ref="523335037"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">18</int>
<reference key="object" ref="300340057"/>
<reference key="parent" ref="903607660"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">10</int>
<reference key="object" ref="532063799"/>
<array class="NSMutableArray" key="children">
<reference ref="761678192"/>
</array>
<reference key="parent" ref="523335037"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">23</int>
<reference key="object" ref="761678192"/>
<reference key="parent" ref="532063799"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">11</int>
<reference key="object" ref="106880244"/>
<array class="NSMutableArray" key="children">
<reference ref="488199561"/>
</array>
<reference key="parent" ref="927381863"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">71</int>
<reference key="object" ref="488199561"/>
<reference key="parent" ref="106880244"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">73</int>
<reference key="object" ref="671740945"/>
<reference key="parent" ref="921986171"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">74</int>
<reference key="object" ref="584787219"/>
<reference key="parent" ref="921986171"/>
</object>
</array>
</object>
<dictionary class="NSMutableDictionary" key="flattenedProperties">
<string key="-1.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="-2.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="-3.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="10.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="11.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="18.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="23.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="5.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="5.IBWindowTemplateEditedContentRect">{{96, 455}, {397, 209}}</string>
<string key="6.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="7.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="71.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="73.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="YES" key="73.IBShouldRemoveOnLegacySave"/>
<string key="74.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="YES" key="74.IBShouldRemoveOnLegacySave"/>
<string key="8.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="9.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
<nil key="activeLocalization"/>
<dictionary class="NSMutableDictionary" key="localizations"/>
<nil key="sourceID"/>
<int key="maxID">75</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
<object class="IBPartialClassDescription">
<string key="className">ErrorWindowController</string>
<string key="superclassName">NSWindowController</string>
<object class="NSMutableDictionary" key="actions">
<string key="NS.key.0">cleanupTable:</string>
<string key="NS.object.0">id</string>
</object>
<object class="NSMutableDictionary" key="actionInfosByName">
<string key="NS.key.0">cleanupTable:</string>
<object class="IBActionInfo" key="NS.object.0">
<string key="name">cleanupTable:</string>
<string key="candidateClassName">id</string>
</object>
</object>
<dictionary class="NSMutableDictionary" key="outlets">
<string key="o_cleanup_button">id</string>
<string key="o_error_table">id</string>
<string key="o_window">id</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
<object class="IBToOneOutletInfo" key="o_cleanup_button">
<string key="name">o_cleanup_button</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo" key="o_error_table">
<string key="name">o_error_table</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo" key="o_window">
<string key="name">o_window</string>
<string key="candidateClassName">id</string>
</object>
</dictionary>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">../../../../modules/gui/macosx/coredialogs.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">ErrorWindowController</string>
<object class="NSMutableDictionary" key="actions">
<string key="NS.key.0">cleanupTable:</string>
<string key="NS.object.0">id</string>
</object>
<object class="NSMutableDictionary" key="actionInfosByName">
<string key="NS.key.0">cleanupTable:</string>
<object class="IBActionInfo" key="NS.object.0">
<string key="name">cleanupTable:</string>
<string key="candidateClassName">id</string>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">../../../../modules/gui/macosx/coredialogs.m</string>
</object>
</object>
</array>
<array class="NSMutableArray" key="referencedPartialClassDescriptionsV3.2+">
<object class="IBPartialClassDescription">
<string key="className">NSActionCell</string>
<string key="superclassName">NSCell</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSActionCell.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSApplication</string>
<string key="superclassName">NSResponder</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSApplication.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSButton</string>
<string key="superclassName">NSControl</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSButton.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSButtonCell</string>
<string key="superclassName">NSActionCell</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSButtonCell.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSCell</string>
<string key="superclassName">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSCell.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSControl</string>
<string key="superclassName">NSView</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSControl.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSFormatter</string>
<string key="superclassName">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSFormatter.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSImageCell</string>
<string key="superclassName">NSCell</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSImageCell.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSMenu</string>
<string key="superclassName">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSMenu.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSPanel</string>
<string key="superclassName">NSWindow</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSPanel.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSResponder</string>
<string key="superclassName">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSResponder.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSScrollView</string>
<string key="superclassName">NSView</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSScrollView.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSScroller</string>
<string key="superclassName">NSControl</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSScroller.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSTableColumn</string>
<string key="superclassName">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSTableColumn.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSTableView</string>
<string key="superclassName">NSControl</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSTableView.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSTextFieldCell</string>
<string key="superclassName">NSActionCell</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSTextFieldCell.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSView</string>
<string key="superclassName">NSResponder</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSView.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSWindow</string>
<string key="superclassName">NSResponder</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSWindow.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSWindowController</string>
<string key="superclassName">NSResponder</string>
<object class="NSMutableDictionary" key="actions">
<string key="NS.key.0">showWindow:</string>
<string key="NS.object.0">id</string>
</object>
<object class="NSMutableDictionary" key="actionInfosByName">
<string key="NS.key.0">showWindow:</string>
<object class="IBActionInfo" key="NS.object.0">
<string key="name">showWindow:</string>
<string key="candidateClassName">id</string>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSWindowController.h</string>
</object>
</object>
</array>
</object>
<int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string>
<bool key="IBDocument.previouslyAttemptedUpgradeToXcode5">NO</bool>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencies">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string>
<integer value="1060" key="NS.object.0"/>
</object>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3</string>
<integer value="4600" key="NS.object.0"/>
</object>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
</data>
</archive>

11
extras/package/macosx/Resources/English.lproj/MainMenu.xib

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="9531" systemVersion="15C50" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="10102" systemVersion="15D21" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
<dependencies>
<deployment version="1070" identifier="macosx"/>
<development version="5100" identifier="xcode"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="9531"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="10102"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="VLCMainMenu">
@ -50,7 +50,6 @@
<outlet property="donation" destination="2298" id="ZzJ-yC-jOi"/>
<outlet property="double_window" destination="1171" id="DIg-sW-WS6"/>
<outlet property="editMenu" destination="205" id="6Mt-eK-QAx"/>
<outlet property="errorsAndWarnings" destination="2756" id="omK-pm-N3C"/>
<outlet property="extensions" destination="4942" id="qSU-2W-Chy"/>
<outlet property="extensionsMenu" destination="4943" id="IAw-5Z-Wvo"/>
<outlet property="fileMenu" destination="81" id="lbA-s5-6qj"/>
@ -764,12 +763,6 @@
<menuItem isSeparatorItem="YES" id="2394">
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
</menuItem>
<menuItem title="Errors and Warnings..." keyEquivalent="m" id="2756">
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
<connections>
<action selector="showErrorsAndWarnings:" target="-2" id="ayP-Wq-8xj"/>
</connections>
</menuItem>
<menuItem title="Messages..." keyEquivalent="M" id="1003">
<connections>
<action selector="showMessagesPanel:" target="-2" id="Suq-dt-QZE"/>

12
extras/package/macosx/vlc.xcodeproj/project.pbxproj

@ -849,7 +849,6 @@
CCD83E4513FEA143004F1652 /* AudioEffects.xib in Resources */ = {isa = PBXBuildFile; fileRef = CCD83E3013FEA143004F1652 /* AudioEffects.xib */; };
CCD83E4613FEA143004F1652 /* Bookmarks.xib in Resources */ = {isa = PBXBuildFile; fileRef = CCD83E3213FEA143004F1652 /* Bookmarks.xib */; };
CCD83E4713FEA143004F1652 /* CoreDialogs.xib in Resources */ = {isa = PBXBuildFile; fileRef = CCD83E3413FEA143004F1652 /* CoreDialogs.xib */; };
CCD83E4813FEA143004F1652 /* ErrorPanel.xib in Resources */ = {isa = PBXBuildFile; fileRef = CCD83E3613FEA143004F1652 /* ErrorPanel.xib */; };
CCD83E4913FEA143004F1652 /* MediaInfo.xib in Resources */ = {isa = PBXBuildFile; fileRef = CCD83E3813FEA143004F1652 /* MediaInfo.xib */; };
CCD83E4A13FEA143004F1652 /* Open.xib in Resources */ = {isa = PBXBuildFile; fileRef = CCD83E3A13FEA143004F1652 /* Open.xib */; };
CCD83E4B13FEA143004F1652 /* Preferences.xib in Resources */ = {isa = PBXBuildFile; fileRef = CCD83E3C13FEA143004F1652 /* Preferences.xib */; };
@ -1738,7 +1737,6 @@
CCD83E3113FEA143004F1652 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = Resources/English.lproj/AudioEffects.xib; sourceTree = "<group>"; };
CCD83E3313FEA143004F1652 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = Resources/English.lproj/Bookmarks.xib; sourceTree = "<group>"; };
CCD83E3513FEA143004F1652 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = Resources/English.lproj/CoreDialogs.xib; sourceTree = "<group>"; };
CCD83E3713FEA143004F1652 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = Resources/English.lproj/ErrorPanel.xib; sourceTree = "<group>"; };
CCD83E3913FEA143004F1652 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = Resources/English.lproj/MediaInfo.xib; sourceTree = "<group>"; };
CCD83E3B13FEA143004F1652 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = Resources/English.lproj/Open.xib; sourceTree = "<group>"; };
CCD83E3D13FEA143004F1652 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = Resources/English.lproj/Preferences.xib; sourceTree = "<group>"; };
@ -2928,7 +2926,6 @@
CCD83E3013FEA143004F1652 /* AudioEffects.xib */,
CCD83E3213FEA143004F1652 /* Bookmarks.xib */,
CCD83E3413FEA143004F1652 /* CoreDialogs.xib */,
CCD83E3613FEA143004F1652 /* ErrorPanel.xib */,
CCD83E3813FEA143004F1652 /* MediaInfo.xib */,
CCD83E3A13FEA143004F1652 /* Open.xib */,
CCD83E3C13FEA143004F1652 /* Preferences.xib */,
@ -3386,7 +3383,6 @@
CCD83E4613FEA143004F1652 /* Bookmarks.xib in Resources */,
CCD83E4713FEA143004F1652 /* CoreDialogs.xib in Resources */,
1C88BB3619DC7C7800645190 /* ys-play.png in Resources */,
CCD83E4813FEA143004F1652 /* ErrorPanel.xib in Resources */,
1C88BCA419DC7CB300645190 /* ys-fs_skip_next.png in Resources */,
1C88BA7919DC7B2200645190 /* yosemite-window-zoom-graphite@2x.png in Resources */,
1C88BC0E19DC7C8100645190 /* ys-next-6btns-dark@2x.png in Resources */,
@ -4160,14 +4156,6 @@
name = CoreDialogs.xib;
sourceTree = "<group>";
};
CCD83E3613FEA143004F1652 /* ErrorPanel.xib */ = {
isa = PBXVariantGroup;
children = (
CCD83E3713FEA143004F1652 /* English */,
);
name = ErrorPanel.xib;
sourceTree = "<group>";
};
CCD83E3813FEA143004F1652 /* MediaInfo.xib */ = {
isa = PBXVariantGroup;
children = (

1
modules/gui/macosx/MainMenu.h

@ -278,7 +278,6 @@
- (IBAction)openWebsite:(id)sender;
- (IBAction)openForum:(id)sender;
- (IBAction)openDonate:(id)sender;
- (IBAction)showErrorsAndWarnings:(id)sender;
- (IBAction)showMessagesPanel:(id)showMessagesPanel;
- (IBAction)showMainWindow:(id)sender;
- (IBAction)showPlaylist:(id)sender;

8
modules/gui/macosx/MainMenu.m

@ -35,7 +35,6 @@
#import "VideoEffects.h"
#import "bookmarks.h"
#import "simple_prefs.h"
#import "coredialogs.h"
#import "VLCPlaylist.h"
#import "VLCPlaylistInfo.h"
#import "VideoView.h"
@ -1271,13 +1270,6 @@
[[NSWorkspace sharedWorkspace] openURL: url];
}
#pragma mark - Errors, warnings and messages
- (IBAction)showErrorsAndWarnings:(id)sender
{
[[[[VLCMain sharedInstance] coreDialogProvider] errorPanel] showWindow:self];
}
- (IBAction)showInformationPanel:(id)sender
{
[[[VLCMain sharedInstance] currentMediaInfoPanel] toggleWindow:sender];

76
modules/gui/macosx/coredialogs.h

@ -1,7 +1,7 @@
/*****************************************************************************
* coredialogs.h: Mac OS X Core Dialogs
*****************************************************************************
* Copyright (C) 2005-2012 VLC authors and VideoLAN
* Copyright (C) 2005-2016 VLC authors and VideoLAN
* $Id$
*
* Authors: Derk-Jan Hartman <hartman at videolan dot org>
@ -21,6 +21,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#import <vlc_common.h>
#import <vlc_dialog.h>
#import <Cocoa/Cocoa.h>
@ -29,66 +30,31 @@
* VLCCoreDialogProvider interface
*****************************************************************************/
@class ErrorWindowController;
@interface VLCCoreDialogProvider : NSObject
{
/* authentication dialogue */
IBOutlet id o_auth_cancel_btn;
IBOutlet id o_auth_description_txt;
IBOutlet id o_auth_login_fld;
IBOutlet id o_auth_login_txt;
IBOutlet id o_auth_ok_btn;
IBOutlet id o_auth_pw_fld;
IBOutlet id o_auth_pw_txt;
IBOutlet id o_auth_title_txt;
IBOutlet id o_auth_win;
/* progress dialogue */
IBOutlet NSProgressIndicator * o_prog_bar;
IBOutlet id o_prog_cancel_btn;
IBOutlet id o_prog_description_txt;
IBOutlet id o_prog_title_txt;
IBOutlet id o_prog_win;
/* authentication dialog */
IBOutlet id authenticationCancelButton;
IBOutlet id authenticationDescriptionLabel;
IBOutlet id authenticationLoginTextField;
IBOutlet id authenticationLoginLabel;
IBOutlet id authenticationOkButton;
IBOutlet id authenticationPasswordTextField;
IBOutlet id authenticationPasswordLabel;
IBOutlet id authenticationTitleLabel;
IBOutlet id authenticationWindow;
/* progress dialog */
IBOutlet NSProgressIndicator * progressIndicator;
IBOutlet id progressCancelButton;
IBOutlet id progressDescriptionLabel;
IBOutlet id progressTitleLabel;
IBOutlet id progressWindow;
}
@property (atomic,readwrite) BOOL progressCancelled;
-(void)performEventWithObject: (NSValue *)o_value ofType: (const char*)type;
-(void)showFatalDialog: (NSValue *)o_value;
-(void)showFatalWaitDialog: (NSValue *)o_value;
-(void)showQuestionDialog: (NSValue *)o_value;
-(void)showLoginDialog: (NSValue *)o_value;
-(IBAction)loginDialogAction:(id)sender;
-(void)showProgressDialogOnMainThread: (NSValue *)o_value;
-(void)showProgressDialog: (NSValue *)o_value;
-(IBAction)progDialogAction:(id)sender;
-(void)updateProgressPanelWithText: (NSString *)string andNumber: (double)d_number;
-(void)destroyProgressPanel;
-(id)errorPanel;
@end
/*****************************************************************************
* VLCErrorPanel interface
*****************************************************************************/
@interface ErrorWindowController : NSWindowController
{
IBOutlet id o_cleanup_button;
IBOutlet id o_error_table;
NSMutableArray *o_errors;
NSMutableArray *o_icons;
}
- (IBAction)cleanupTable:(id)sender;
- (IBAction)authenticationDialogAction:(id)sender;
-(void)addError:(NSString *)o_error withMsg:(NSString *)o_msg;
- (IBAction)progressDialogAction:(id)sender;
@end

327
modules/gui/macosx/coredialogs.m

@ -1,7 +1,7 @@
/*****************************************************************************
* coredialogs.m: Mac OS X Core Dialogs
*****************************************************************************
* Copyright (C) 2005-2015 VLC authors and VideoLAN
* Copyright (C) 2005-2016 VLC authors and VideoLAN
* $Id$
*
* Authors: Derk-Jan Hartman <hartman at videolan dot org>
@ -29,63 +29,16 @@
/* for the icon in our custom error panel */
#import <ApplicationServices/ApplicationServices.h>
void updateProgressPanel (void *data, const char *text, float value)
{
@autoreleasepool {
VLCCoreDialogProvider *dialogProvider = (__bridge VLCCoreDialogProvider *)data;
NSString *o_txt = toNSStr(text);
dispatch_async(dispatch_get_main_queue(), ^{
[dialogProvider updateProgressPanelWithText: o_txt andNumber: (double)(value * 1000.)];
});
}
}
void destroyProgressPanel (void *data)
{
@autoreleasepool {
VLCCoreDialogProvider *dialogProvider = (__bridge VLCCoreDialogProvider *)data;
if ([[NSApplication sharedApplication] isRunning])
[dialogProvider performSelectorOnMainThread:@selector(destroyProgressPanel) withObject:nil waitUntilDone:YES];
}
}
bool checkProgressPanel (void *data)
{
@autoreleasepool {
VLCCoreDialogProvider *dialogProvider = (__bridge VLCCoreDialogProvider *)data;
return [dialogProvider progressCancelled];
}
}
static int DialogCallback(vlc_object_t *p_this, const char *type, vlc_value_t previous, vlc_value_t value, void *data)
static void displayErrorCallback(const char *psz_title, const char *psz_text, void * p_data)
{
@autoreleasepool {
VLCCoreDialogProvider *dialogProvider = (__bridge VLCCoreDialogProvider *)data;
if ([toNSStr(type) isEqualToString: @"dialog-progress-bar"]) {
/* the progress panel needs to update itself and therefore wants special treatment within this context */
dialog_progress_bar_t *p_dialog = (dialog_progress_bar_t *)value.p_address;
p_dialog->pf_update = updateProgressPanel;
p_dialog->pf_check = checkProgressPanel;
p_dialog->pf_destroy = destroyProgressPanel;
p_dialog->p_sys = (__bridge void *)dialogProvider;
}
NSValue *o_value = [NSValue valueWithPointer:value.p_address];
[dialogProvider performEventWithObject: o_value ofType: type];
return VLC_SUCCESS;
VLCCoreDialogProvider *dialogProvider = (__bridge VLCCoreDialogProvider *)p_data;
NSAlert *alert = [NSAlert alertWithMessageText: toNSStr(psz_title) defaultButton: _NS("OK") alternateButton: nil otherButton: nil informativeTextWithFormat: @"%@", toNSStr(psz_text)];
[alert setAlertStyle: NSCriticalAlertStyle];
[alert runModal];
}
}
@interface VLCCoreDialogProvider()
{
ErrorWindowController *o_error_panel;
}
@end
@implementation VLCCoreDialogProvider
- (instancetype)init
@ -98,17 +51,26 @@ static int DialogCallback(vlc_object_t *p_this, const char *type, vlc_value_t pr
intf_thread_t *p_intf = getIntf();
/* subscribe to various interactive dialogues */
var_Create(p_intf, "dialog-error", VLC_VAR_ADDRESS);
var_AddCallback(p_intf, "dialog-error", DialogCallback, (__bridge void *)self);
var_Create(p_intf, "dialog-critical", VLC_VAR_ADDRESS);
var_AddCallback(p_intf, "dialog-critical", DialogCallback, (__bridge void *)self);
var_Create(p_intf, "dialog-login", VLC_VAR_ADDRESS);
var_AddCallback(p_intf, "dialog-login", DialogCallback, (__bridge void *)self);
var_Create(p_intf, "dialog-question", VLC_VAR_ADDRESS);
var_AddCallback(p_intf, "dialog-question", DialogCallback, (__bridge void *)self);
var_Create(p_intf, "dialog-progress-bar", VLC_VAR_ADDRESS);
var_AddCallback(p_intf, "dialog-progress-bar", DialogCallback, (__bridge void *)self);
dialog_Register(p_intf);
/* const vlc_dialog_cbs cbs = {
displayErrorCallback,
displayLoginCallback,
displayQuestionCallback,
displayProgressCallback,
cancelCallback,
updateProgressCallback
};*/
const vlc_dialog_cbs cbs = {
displayErrorCallback,
NULL,
NULL,
NULL,
NULL,
NULL
};
vlc_dialog_provider_set_callbacks(p_intf, &cbs, (__bridge void *)self);
}
return self;
@ -119,246 +81,27 @@ static int DialogCallback(vlc_object_t *p_this, const char *type, vlc_value_t pr
msg_Dbg(getIntf(), "Deinitializing dialog provider");
intf_thread_t *p_intf = getIntf();
var_DelCallback(p_intf, "dialog-error", DialogCallback, (__bridge void *)self);
var_DelCallback(p_intf, "dialog-critical", DialogCallback, (__bridge void *)self);
var_DelCallback(p_intf, "dialog-login", DialogCallback, (__bridge void *)self);
var_DelCallback(p_intf, "dialog-question", DialogCallback, (__bridge void *)self);
var_DelCallback(p_intf, "dialog-progress-bar", DialogCallback, (__bridge void *)self);
dialog_Unregister(p_intf);
vlc_dialog_provider_set_callbacks(p_intf, NULL, NULL);
}
-(void)awakeFromNib
{
_progressCancelled = NO;
[o_auth_login_txt setStringValue: _NS("Username")];
[o_auth_pw_txt setStringValue: _NS("Password")];
[o_auth_cancel_btn setTitle: _NS("Cancel")];
[o_auth_ok_btn setTitle: _NS("OK")];
[o_prog_cancel_btn setTitle: _NS("Cancel")];
[o_prog_bar setUsesThreadedAnimation: YES];
}
[authenticationLoginLabel setStringValue: _NS("Username")];
[authenticationPasswordLabel setStringValue: _NS("Password")];
[authenticationCancelButton setTitle: _NS("Cancel")];
[authenticationOkButton setTitle: _NS("OK")];
-(void)performEventWithObject: (NSValue *)o_value ofType: (const char*)type
{
NSString *o_type = toNSStr(type);
if ([o_type isEqualToString: @"dialog-error"])
[self performSelectorOnMainThread:@selector(showFatalDialog:) withObject:o_value waitUntilDone:YES];
else if ([o_type isEqualToString: @"dialog-critical"])
[self performSelectorOnMainThread:@selector(showFatalWaitDialog:) withObject:o_value waitUntilDone:YES];
else if ([o_type isEqualToString: @"dialog-question"])
[self performSelectorOnMainThread:@selector(showQuestionDialog:) withObject:o_value waitUntilDone:YES];
else if ([o_type isEqualToString: @"dialog-login"])
[self performSelectorOnMainThread:@selector(showLoginDialog:) withObject:o_value waitUntilDone:YES];
else if ([o_type isEqualToString: @"dialog-progress-bar"])
[self performSelectorOnMainThread:@selector(showProgressDialogOnMainThread:) withObject: o_value waitUntilDone:YES];
else
msg_Err(getIntf(), "unhandled dialog type: '%s'", type);
[progressCancelButton setTitle: _NS("Cancel")];
[progressIndicator setUsesThreadedAnimation: YES];
}
-(void)showFatalDialog: (NSValue *)o_value
- (IBAction)authenticationDialogAction:(id)sender
{
dialog_fatal_t *p_dialog = [o_value pointerValue];
[[self errorPanel] addError: toNSStr(p_dialog->title) withMsg: toNSStr(p_dialog->message)];
[[self errorPanel] showWindow:self];
}
-(void)showFatalWaitDialog: (NSValue *)o_value
{
dialog_fatal_t *p_dialog = [o_value pointerValue];
NSAlert *o_alert;
o_alert = [NSAlert alertWithMessageText: toNSStr(p_dialog->title) defaultButton: _NS("OK") alternateButton: nil otherButton: nil informativeTextWithFormat: @"%@", toNSStr(p_dialog->message)];
[o_alert setAlertStyle: NSCriticalAlertStyle];
[o_alert runModal];
}
-(void)showQuestionDialog: (NSValue *)o_value
- (IBAction)progressDialogAction:(id)sender
{
dialog_question_t *p_dialog = [o_value pointerValue];
NSAlert *o_alert;
NSInteger i_returnValue = 0;
o_alert = [NSAlert alertWithMessageText: toNSStr(p_dialog->title) defaultButton: toNSStr(p_dialog->yes) alternateButton: toNSStr(p_dialog->no) otherButton: toNSStr(p_dialog->cancel) informativeTextWithFormat:@"%@", toNSStr(p_dialog->message)];
[o_alert setAlertStyle: NSInformationalAlertStyle];
i_returnValue = [o_alert runModal];
if (i_returnValue == NSAlertDefaultReturn)
p_dialog->answer = 1;
if (i_returnValue == NSAlertAlternateReturn)
p_dialog->answer = 2;
if (i_returnValue == NSAlertOtherReturn)
p_dialog->answer = 3;
}
-(void)showLoginDialog: (NSValue *)o_value
{
dialog_login_t *p_dialog = [o_value pointerValue];
NSInteger i_returnValue = 0;
[o_auth_title_txt setStringValue: toNSStr(p_dialog->title)];
[o_auth_win setTitle: toNSStr(p_dialog->title)];
[o_auth_description_txt setStringValue: toNSStr(p_dialog->message)];
[o_auth_login_fld setStringValue: @""];
[o_auth_pw_fld setStringValue: @""];
[o_auth_win center];
i_returnValue = [NSApp runModalForWindow: o_auth_win];
[o_auth_win close];
if (i_returnValue)
{
*p_dialog->username = strdup([[o_auth_login_fld stringValue] UTF8String]);
*p_dialog->password = strdup([[o_auth_pw_fld stringValue] UTF8String]);
} else
*p_dialog->username = *p_dialog->password = NULL;
}
-(IBAction)loginDialogAction:(id)sender
{
if ([[sender title] isEqualToString: _NS("OK")])
[NSApp stopModalWithCode: 1];
else
[NSApp stopModalWithCode: 0];
}
-(void)showProgressDialogOnMainThread: (NSValue *)o_value
{
/* we work-around a Cocoa limitation here, since you cannot delay an execution
* on the main thread within a single call */
[self setProgressCancelled:NO];
dialog_progress_bar_t *p_dialog = [o_value pointerValue];
if (!p_dialog)
return;
[o_prog_win setTitle: toNSStr(p_dialog->title)];
[o_prog_title_txt setStringValue: toNSStr(p_dialog->title)];
if (p_dialog->cancel != NULL)
[o_prog_cancel_btn setTitle: toNSStr(p_dialog->cancel)];
else
[o_prog_cancel_btn setTitle: _NS("Cancel")];
[o_prog_description_txt setStringValue: toNSStr(p_dialog->message)];
if (getIntf())
[self performSelector:@selector(showProgressDialog:) withObject: o_value afterDelay:3.00];
}
-(void)showProgressDialog: (NSValue *)o_value
{
dialog_progress_bar_t *p_dialog = [o_value pointerValue];
if (!p_dialog || [self progressCancelled])
return;
[o_prog_bar setDoubleValue: 0];
[o_prog_bar setIndeterminate: YES];
[o_prog_bar startAnimation: self];
[o_prog_win makeKeyAndOrderFront: self];
}
-(void)updateProgressPanelWithText: (NSString *)string andNumber: (double)d_number
{
[o_prog_description_txt setStringValue: string];
if (d_number > 0)
[o_prog_bar setIndeterminate: NO];
[o_prog_bar setDoubleValue: d_number];
}
-(void)destroyProgressPanel
{
[self setProgressCancelled:YES];
[o_prog_bar performSelectorOnMainThread:@selector(stopAnimation:) withObject:self waitUntilDone:YES];
[o_prog_win performSelectorOnMainThread:@selector(close) withObject:nil waitUntilDone:YES];
}
-(IBAction)progDialogAction:(id)sender
{
[self setProgressCancelled:YES];
}
-(id)errorPanel
{
if (!o_error_panel)
o_error_panel = [[ErrorWindowController alloc] init];
return o_error_panel;
}
@end
/*****************************************************************************
* VLCErrorPanel implementation
*****************************************************************************/
@implementation ErrorWindowController
- (id)init
{
self = [super initWithWindowNibName:@"ErrorPanel"];
if (self) {
/* init data sources */
o_errors = [[NSMutableArray alloc] init];
o_icons = [[NSMutableArray alloc] init];
}
return self;
}
- (void)windowDidLoad
{
/* init strings */
[[self window] setTitle: _NS("Errors and Warnings")];
[o_cleanup_button setTitle: _NS("Clean up")];
}
-(void)addError: (NSString *)o_error withMsg:(NSString *)o_msg
{
/* format our string as desired */
NSMutableAttributedString * ourError;
ourError = [[NSMutableAttributedString alloc] initWithString:
[NSString stringWithFormat:@"%@\n%@", o_error, o_msg]
attributes:
[NSDictionary dictionaryWithObject: [NSFont systemFontOfSize:11] forKey: NSFontAttributeName]];
[ourError
addAttribute: NSFontAttributeName
value: [NSFont boldSystemFontOfSize:11]
range: NSMakeRange(0, [o_error length])];
[o_errors addObject: ourError];
[o_icons addObject: [[NSWorkspace sharedWorkspace] iconForFileType:NSFileTypeForHFSTypeCode(kAlertStopIcon)]];
[o_error_table reloadData];
}
-(IBAction)cleanupTable:(id)sender
{
[o_errors removeAllObjects];
[o_icons removeAllObjects];
[o_error_table reloadData];
}
/*----------------------------------------------------------------------------
* data source methods
*---------------------------------------------------------------------------*/
- (NSInteger)numberOfRowsInTableView:(NSTableView *)theDataTable
{
return [o_errors count];
}
- (id)tableView:(NSTableView *)theDataTable objectValueForTableColumn:
(NSTableColumn *)theTableColumn row: (NSInteger)row
{
if ([[theTableColumn identifier] isEqualToString: @"error_msg"])
return [o_errors objectAtIndex:row];
if ([[theTableColumn identifier] isEqualToString: @"icon"])
return [o_icons objectAtIndex:row];
return @"unknown identifier";
}
@end

Loading…
Cancel
Save