Skip to content

Commit

Permalink
Adding userfriendly “too many files” message #165
Browse files Browse the repository at this point in the history
  • Loading branch information
melonamin committed Feb 14, 2021
1 parent 8ccfc86 commit 3075132
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions SwiftBar/Plugin/PluginManger.swift
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@ class PluginManager {

let pluginFiles = getPluginList()
guard pluginFiles.count < 50 else {
let alert = NSAlert()
alert.messageText = Localizable.App.FolderHasToManyFilesMessage.localized
alert.runModal()

AppShared.changePluginFolder()
return
}
Expand Down
1 change: 1 addition & 0 deletions SwiftBar/Resources/Localization/Localizable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ enum Localizable {
enum App: String {
case ChoosePluginFolderTitle = "APP_CHOOSE_PLUGIN_FOLDER_TITLE"
case FolderNotAllowedMessage = "APP_FOLDER_NOT_ALLOWED_MESSAGE"
case FolderHasToManyFilesMessage = "APP_FOLDER_HAS_TOO_MANY_FILES_MESSAGE"
case FolderNotAllowedAction = "APP_FOLDER_NOT_ALLOWED_ACTION"
case ChoosePluginFolderMessage = "APP_CHOOSE_PLUGIN_FOLDER_MESSAGE"
case ChoosePluginFolderInfo = "APP_CHOOSE_PLUGIN_FOLDER_INFO"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"APP_CHOOSE_PLUGIN_FOLDER_TITLE" = "Choose plugin folder";
"APP_FOLDER_NOT_ALLOWED_MESSAGE" = "Can't use this folder as SwiftBar plugins location";
"APP_FOLDER_NOT_ALLOWED_ACTION" = "Choose New Location";
"APP_FOLDER_HAS_TOO_MANY_FILES_MESSAGE" = "WOW! Looks like you chose a folder with a LOT OF FILES, please choose another one. If you have node_modules folder that you need for a plugin, please make it hidden.";
"APP_CHOOSE_PLUGIN_FOLDER_MESSAGE" = "Set SwiftBar Plugins Location";
"APP_CHOOSE_PLUGIN_FOLDER_INFO" = "Select a folder to store the plugins repository";
"APP_QUIT" = "Quit SwiftBar";
Expand Down

0 comments on commit 3075132

Please sign in to comment.