|
@@ -44,17 +44,17 @@ extension CCMain {
|
|
|
|
|
|
@objc func SetSortButtonText() {
|
|
|
|
|
|
- let orderSettings = CCUtility.getOrderSettings()
|
|
|
-
|
|
|
- if orderSettings == "fileName" {
|
|
|
- self.sortButton.setTitle((CCUtility.getAscendingSettings() ? NSLocalizedString("_order_by_name_a_z_", comment: "") : NSLocalizedString("_order_by_name_z_a_", comment: "")), for: .normal)
|
|
|
- } else if orderSettings == "date" {
|
|
|
- self.sortButton.setTitle((CCUtility.getAscendingSettings() ? NSLocalizedString("_order_by_date_less_recent_", comment: "") : NSLocalizedString("_order_by_date_more_recent_", comment: "")), for: .normal)
|
|
|
- } else if orderSettings == "size" {
|
|
|
- self.sortButton.setTitle((CCUtility.getAscendingSettings() ? NSLocalizedString("_order_by_size_largest_", comment: "") : NSLocalizedString("_order_by_size_smallest_", comment: "")), for: .normal)
|
|
|
+ switch CCUtility.getOrderSettings() {
|
|
|
+ case "fileName":
|
|
|
+ self.sortButton.setTitle((CCUtility.getAscendingSettings() ? NSLocalizedString("_sorted_by_name_a_z_", comment: "") : NSLocalizedString("_sorted_by_name_z_a_", comment: "")), for: .normal)
|
|
|
+ case "date":
|
|
|
+ self.sortButton.setTitle((CCUtility.getAscendingSettings() ? NSLocalizedString("_sorted_by_date_less_recent_", comment: "") : NSLocalizedString("_sorted_by_date_more_recent_", comment: "")), for: .normal)
|
|
|
+ case "size":
|
|
|
+ self.sortButton.setTitle((CCUtility.getAscendingSettings() ? NSLocalizedString("_sorted_by_size_largest_", comment: "") : NSLocalizedString("_sorted_by_size_smallest_", comment: "")), for: .normal)
|
|
|
+ default:
|
|
|
+ break
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
|
|
|
private func initSortMenu() -> [NCMenuAction] {
|
|
|
var actions = [NCMenuAction]()
|