Skip to content

Commit

Permalink
Merge branch 'release/v0.11.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
gee1k committed Sep 1, 2019
2 parents c32a08b + 61df69a commit 586c339
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 4 deletions.
9 changes: 9 additions & 0 deletions uPic/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@
<customObject id="YLy-65-1bz" customClass="NSFontManager"/>
<customObject id="veO-oa-UPB" customClass="StatusMenuController" customModule="uPic" customModuleProvider="target">
<connections>
<outlet property="cancelUploadMenuItem" destination="Gxh-8r-tsq" id="hE4-jQ-xwi"/>
<outlet property="cancelUploadMenuSeparator" destination="ggN-TB-JZW" id="V4H-J4-ftj"/>
<outlet property="checkUpdateMenuItem" destination="yai-4F-Btp" id="klG-hy-GGO"/>
<outlet property="compressFactorMenuItem" destination="eIU-EA-uQZ" id="uMq-Nm-vXy"/>
<outlet property="helpMenuItem" destination="2Jw-ET-3eH" id="Ubq-wz-L3N"/>
Expand All @@ -119,6 +121,13 @@
<customObject id="Oqi-DG-w38" customClass="SUUpdater"/>
<menu id="fqV-BN-CNE">
<items>
<menuItem title="取消上传" id="Gxh-8r-tsq">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="cancelUploadMenuItemClicked:" target="veO-oa-UPB" id="rRC-ge-OFt"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="ggN-TB-JZW"/>
<menuItem title="选择文件" id="p0A-6d-cAU">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
Expand Down
4 changes: 2 additions & 2 deletions uPic/Supporting Files/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>0.11.1</string>
<string>0.11.2</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
Expand All @@ -32,7 +32,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>20190826</string>
<string>20190901</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.utilities</string>
<key>LSMinimumSystemVersion</key>
Expand Down
29 changes: 27 additions & 2 deletions uPic/Views/StatusMenuController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ class StatusMenuController: NSObject, NSMenuDelegate {

@IBOutlet weak var statusMenu: NSMenu!

@IBOutlet weak var cancelUploadMenuItem: NSMenuItem!
@IBOutlet weak var cancelUploadMenuSeparator: NSMenuItem!
@IBOutlet weak var selectFileMenuItem: NSMenuItem!
@IBOutlet weak var uploadPasteboardMenuItem: NSMenuItem!
@IBOutlet weak var screenshotMenuItem: NSMenuItem!
Expand All @@ -32,7 +34,8 @@ class StatusMenuController: NSObject, NSMenuDelegate {
override func awakeFromNib() {

statusMenu.delegate = self


cancelUploadMenuItem.title = NSLocalizedString("status-menu.cancel-upload", comment: "Select file")
selectFileMenuItem.title = NSLocalizedString("status-menu.select-file", comment: "Select file")
uploadPasteboardMenuItem.title = NSLocalizedString("status-menu.pasteboard", comment: "Upload with pasteboard")
screenshotMenuItem.title = NSLocalizedString("status-menu.screenshot", comment: "Upload with pasteboard")
Expand All @@ -53,7 +56,29 @@ class StatusMenuController: NSObject, NSMenuDelegate {
resetCompressFactor()
addObserver()
}


func menuWillOpen(_ menu: NSMenu) {

refreshOutputFormat()
resetCompressFactor()

// 正在上传
if (NSApplication.shared.delegate as? AppDelegate)?.uploding ?? false {
self.cancelUploadMenuItem.isHidden = false
self.cancelUploadMenuSeparator.isHidden = false
} else {
self.cancelUploadMenuItem.isHidden = true
self.cancelUploadMenuSeparator.isHidden = true
}
}

// cancel upload
@IBAction func cancelUploadMenuItemClicked(_ sender: Any) {
(NSApplication.shared.delegate as? AppDelegate)?.uploadCancel()
self.cancelUploadMenuItem.isHidden = true
self.cancelUploadMenuSeparator.isHidden = true
}

// select files
@IBAction func selectFileMenuItemClicked(_ sender: NSMenuItem) {
(NSApplication.shared.delegate as? AppDelegate)?.selectFile()
Expand Down
2 changes: 2 additions & 0 deletions uPic/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@
"status-menu.help" = "Help";
"status-menu.tutorial" = "Tutorial";
"status-menu.sponsor" = "Sponsor";
/* cancel upload */
"status-menu.cancel-upload" = "Cancel upload";

"alert.reset_preferences_title" = "Reset User Preferences?";
"alert.reset_preferences_description" = "⚠️ Note that this will reset all user preferences";
Expand Down
2 changes: 2 additions & 0 deletions uPic/zh-Hans.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@
"status-menu.help" = "帮助";
"status-menu.tutorial" = "使用教程";
"status-menu.sponsor" = "赞助(打赏)";
/* cancel upload */
"status-menu.cancel-upload" = "取消上传";

"alert.reset_preferences_title" = "重置用户偏好设置?";
"alert.reset_preferences_description" = "⚠️ 注意这将会重置所有用户偏好设置";
Expand Down

0 comments on commit 586c339

Please sign in to comment.