Set progress label to "Optimizing…" when optimising.

This commit is contained in:
Damiano Galassi committed 2018-02-10 19:28:04 +01:00
1 parent 3cc367a00d
commit 43a74932d3
6 files changed
+39 -11

No files matched your search

+2 -2
View File
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14087.3" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14092" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14087.3"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14092"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
File renamed without changes.
+4 -1
View File
@@ -159,7 +159,10 @@ import IOKit.pwr_mgt
}
if optimize {
// TODO: Update progress string
DispatchQueue.main.async {
let docController = self.windowControllers.first as? DocumentWindowController
docController?.setProgress(title: NSLocalizedString("Optimizing…", comment: "Document Optimize sheet."))
}
mp4.optimize()
}
}
+7
View File
@@ -244,6 +244,13 @@ class DocumentWindowController: NSWindowController, TracksViewControllerDelegate
}
}
func setProgress(title: String) {
if let progressController = self.progressController {
progressController.progressString.stringValue = title
}
}
func endProgressReporting() {
if let progressController = self.progressController {
contentViewController?.dismissViewController(progressController)