diff --git a/Stats.xcodeproj/project.pbxproj b/Stats.xcodeproj/project.pbxproj index 04ca3883..f104e896 100644 --- a/Stats.xcodeproj/project.pbxproj +++ b/Stats.xcodeproj/project.pbxproj @@ -16,6 +16,7 @@ 5C0A9CAF2C46838F00EE6A89 /* RAM.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9A81C7562449A41400825D92 /* RAM.framework */; }; 5C0A9CB42C46839500EE6A89 /* Disk.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9AF9EE0224648751005D2270 /* Disk.framework */; }; 5C1E45562D11D66A00525864 /* libIOReport.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 5C1E45552D11D66200525864 /* libIOReport.tbd */; }; + 5C2016432D36D0EF0049C788 /* Support.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C2016422D36D0EF0049C788 /* Support.swift */; }; 5C21D80B296C7B81005BA16D /* CombinedView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C21D80A296C7B81005BA16D /* CombinedView.swift */; }; 5C2229A329CCB3C400F00E69 /* Clock.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5C22299D29CCB3C400F00E69 /* Clock.framework */; }; 5C2229A429CCB3C400F00E69 /* Clock.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 5C22299D29CCB3C400F00E69 /* Clock.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; @@ -499,6 +500,7 @@ 5C0E550A2B5D545A00FFF1FB /* ar */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ar; path = ar.lproj/Localizable.strings; sourceTree = ""; }; 5C1E45552D11D66200525864 /* libIOReport.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libIOReport.tbd; path = usr/lib/libIOReport.tbd; sourceTree = SDKROOT; }; 5C1E45572D11D67600525864 /* bridge.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = bridge.h; sourceTree = ""; }; + 5C2016422D36D0EF0049C788 /* Support.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Support.swift; sourceTree = ""; }; 5C21D80A296C7B81005BA16D /* CombinedView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CombinedView.swift; sourceTree = ""; }; 5C22299D29CCB3C400F00E69 /* Clock.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Clock.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 5C2229A829CCB41900F00E69 /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = ""; }; @@ -1111,6 +1113,7 @@ 9A81C74B24499C7000825D92 /* AppSettings.swift */, 9A9EA9442476D34500E3B883 /* Update.swift */, 9A83526E2889A03100791BAC /* Setup.swift */, + 5C2016422D36D0EF0049C788 /* Support.swift */, 5C21D80A296C7B81005BA16D /* CombinedView.swift */, ); path = Views; @@ -2056,6 +2059,7 @@ 5C21D80B296C7B81005BA16D /* CombinedView.swift in Sources */, 9A83526F2889A03100791BAC /* Setup.swift in Sources */, 9AD33AC624BCD3EE007E8820 /* helpers.swift in Sources */, + 5C2016432D36D0EF0049C788 /* Support.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/Stats/AppDelegate.swift b/Stats/AppDelegate.swift index 4d8c4e37..d89ab2de 100755 --- a/Stats/AppDelegate.swift +++ b/Stats/AppDelegate.swift @@ -40,7 +40,9 @@ class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCenterDele internal let settingsWindow: SettingsWindow = SettingsWindow() internal let updateWindow: UpdateWindow = UpdateWindow() internal let setupWindow: SetupWindow = SetupWindow() + internal let supportWindow: SupportWindow = SupportWindow() internal let updateActivity = NSBackgroundActivityScheduler(identifier: "eu.exelban.Stats.updateCheck") + internal let supportActivity = NSBackgroundActivityScheduler(identifier: "eu.exelban.Stats.support") internal var clickInNotification: Bool = false internal var menuBarItem: NSStatusItem? = nil internal var combinedView: CombinedView = CombinedView() diff --git a/Stats/Supporting Files/ar.lproj/Localizable.strings b/Stats/Supporting Files/ar.lproj/Localizable.strings index 7ba1daa1..0f09ffdf 100644 --- a/Stats/Supporting Files/ar.lproj/Localizable.strings +++ b/Stats/Supporting Files/ar.lproj/Localizable.strings @@ -118,6 +118,7 @@ "Successfully updated" = "تم التحديث بنجاح"; "Stats was updated to v" = "تم تحديث الإحصاءات إلى الإصدار v%0"; "Reset settings text" = "سيتم إعادة ضبط جميع إعدادات التطبيق وسيتم إعادة تشغيل التطبيق. هل تريد المتابعة؟"; +"Support text" = "شكرًا لك على استخدامك ل Stats! \n\nيستغرق الحفاظ على هذا المشروع مفتوح المصدر وتحسينه وقتًا وموارد. دعمكم يساعدنا على الاستمرار في توفير تطبيق مجاني وموثوق للجميع. كل جزء صغير يساعدنا!"; // Settings "Open Activity Monitor" = "فتح مراقب النشاط"; diff --git a/Stats/Supporting Files/bg.lproj/Localizable.strings b/Stats/Supporting Files/bg.lproj/Localizable.strings index ae3ea8d3..04ef536b 100644 --- a/Stats/Supporting Files/bg.lproj/Localizable.strings +++ b/Stats/Supporting Files/bg.lproj/Localizable.strings @@ -118,6 +118,7 @@ "Successfully updated" = "Успешно обновяване"; "Stats was updated to v" = "Stats е обновена до версия v%0"; "Reset settings text" = "Всички настройки на приложението ще бъдат занулени и приложението ще се рестартира. Сигурни ли сте, че искате това?"; +"Support text" = "Благодарим ви, че използвате Статистики!\n\n Поддържането и подобряването на този проект с отворен код изисква време и ресурси. Вашата подкрепа ни помага да продължим да предоставяме безплатно и надеждно приложение за всички.\n\nАко намирате Stats за полезно, моля, помислете дали да не дадете своя принос. Всяка малка част помага!"; // Settings "Open Activity Monitor" = "Отваряне на монитора на активностите"; diff --git a/Stats/Supporting Files/ca.lproj/Localizable.strings b/Stats/Supporting Files/ca.lproj/Localizable.strings index 23768eed..13ed87ed 100644 --- a/Stats/Supporting Files/ca.lproj/Localizable.strings +++ b/Stats/Supporting Files/ca.lproj/Localizable.strings @@ -118,6 +118,7 @@ "Successfully updated" = "Actualització completada amb èxit"; "Stats was updated to v" = "Stats s'ha actualitzat a v%0"; "Reset settings text" = "Tota la configuració actual serà esborrada i l'aplicació es reiniciarà. Estàs segur/segura de voler fer això?"; +"Support text" = "Gràcies per utilitzar Stats!\n\n Mantenir i millorar aquest projecte de codi obert requereix temps i recursos. El vostre suport ens ajuda a continuar oferint una aplicació gratuïta i fiable per a tothom.\n\nSi trobeu útils les estadístiques, penseu a fer una contribució. Cada petita mica ajuda!"; // Settings "Open Activity Monitor" = "Obre el Visor d'Activitat"; diff --git a/Stats/Supporting Files/cs.lproj/Localizable.strings b/Stats/Supporting Files/cs.lproj/Localizable.strings index e173fc72..e5638a51 100644 --- a/Stats/Supporting Files/cs.lproj/Localizable.strings +++ b/Stats/Supporting Files/cs.lproj/Localizable.strings @@ -118,6 +118,7 @@ "Successfully updated" = "Úspěšně aktualizováno"; "Stats was updated to v" = "Stats byly aktualizovány na v%0"; "Reset settings text" = "Všechna nastavení aplikace budou resetována a aplikace bude restartována. Jste si jisti, že to chcete udělat?"; +"Support text" = "Děkujeme, že používáte Stats!\n\n Udržování a zlepšování tohoto open-source projektu vyžaduje čas a zdroje. Vaše podpora nám pomáhá nadále poskytovat bezplatnou a spolehlivou aplikaci pro každého.\n\nPokud vám Stats pomáhají, zvažte prosím možnost přispět. Každý malý kousek pomůže!"; // Settings "Open Activity Monitor" = "Otevřít Monitor aktivity"; diff --git a/Stats/Supporting Files/da.lproj/Localizable.strings b/Stats/Supporting Files/da.lproj/Localizable.strings index 26aa3240..ef0f035c 100644 --- a/Stats/Supporting Files/da.lproj/Localizable.strings +++ b/Stats/Supporting Files/da.lproj/Localizable.strings @@ -118,6 +118,7 @@ "Successfully updated" = "Opdatering succesfuld"; "Stats was updated to v" = "Stats er blevet opdateret til v%0"; "Reset settings text" = "Alle programmets indstillinger vil blive nulstillet og programmet genstartes. Er du sikker på du vil fortsætte?"; +"Support text" = "Tak, fordi du bruger Stats!\n\n Det tager tid og ressourcer at vedligeholde og forbedre dette open source-projekt. Din støtte hjælper os med at fortsætte med at levere en gratis og pålidelig applikation til alle.\n\nHvis du finder Stats nyttigt, kan du overveje at give et bidrag. Hver eneste lille smule hjælper!"; // Settings "Open Activity Monitor" = "Åben Aktivitetsmonitor"; diff --git a/Stats/Supporting Files/de.lproj/Localizable.strings b/Stats/Supporting Files/de.lproj/Localizable.strings index eb7f0830..ea4a23ba 100644 --- a/Stats/Supporting Files/de.lproj/Localizable.strings +++ b/Stats/Supporting Files/de.lproj/Localizable.strings @@ -118,6 +118,7 @@ "Successfully updated" = "Erfolgreich aktualisiert"; "Stats was updated to v" = "Stats wurde auf v%0 aktualisiert"; "Reset settings text" = "Alle Einstellungen von Stats werden zurückgesetzt und Stats wird neu gestartet. Möchten Sie dies wirklich?"; +"Support text" = "Vielen Dank, dass Sie Stats nutzen!\n\n Die Pflege und Verbesserung dieses Open-Source-Projekts erfordert Zeit und Ressourcen. Ihre Unterstützung hilft uns, weiterhin eine kostenlose und zuverlässige Anwendung für jedermann bereitzustellen.\n\n Wenn Sie Stats hilfreich finden, ziehen Sie bitte eine Spende in Betracht. Jedes kleine bisschen hilft!"; // Settings "Open Activity Monitor" = "Aktivitätsanzeige öffnen"; diff --git a/Stats/Supporting Files/el.lproj/Localizable.strings b/Stats/Supporting Files/el.lproj/Localizable.strings index 3f0fd958..4fb69173 100644 --- a/Stats/Supporting Files/el.lproj/Localizable.strings +++ b/Stats/Supporting Files/el.lproj/Localizable.strings @@ -118,6 +118,7 @@ "Successfully updated" = "Επιτυχής ενημέρωση"; "Stats was updated to v" = "Το Stats ενημερώθηκε στην ε%0"; "Reset settings text" = "Όλες οι ρυθμίσεις της εφαρμογής θα αρχικοποιηθούν και η εφαρμογή θα επανεκκινηθεί. Είστε σίγουροι;"; +"Support text" = "Σας ευχαριστούμε για τη χρήση των Stats!\n\n Η συντήρηση και η βελτίωση αυτού του έργου ανοιχτού κώδικα απαιτεί χρόνο και πόρους. Η υποστήριξή σας μας βοηθά να συνεχίσουμε να παρέχουμε μια δωρεάν και αξιόπιστη εφαρμογή για όλους.\n\nΕάν βρίσκετε το Stats χρήσιμο, παρακαλούμε σκεφτείτε να συνεισφέρετε. Κάθε μικρό ποσό βοηθάει!"; // Settings "Open Activity Monitor" = "Άνοιγμα Παρακολούθησης Δραστηριότητας"; diff --git a/Stats/Supporting Files/en-AU.lproj/Localizable.strings b/Stats/Supporting Files/en-AU.lproj/Localizable.strings index da7f196b..2d59420b 100644 --- a/Stats/Supporting Files/en-AU.lproj/Localizable.strings +++ b/Stats/Supporting Files/en-AU.lproj/Localizable.strings @@ -118,6 +118,7 @@ "Successfully updated" = "Successfully updated"; "Stats was updated to v" = "Stats was updated to v%0"; "Reset settings text" = "All application settings will be reset and the application will be restarted. Are you sure you want to do this?"; +"Support text" = "Thank you for using Stats!\n\n Maintaining and improving this open-source project takes time and resources. Your support helps us continue to provide a free and reliable application for everyone.\n\nIf you find Stats helpful, please consider making a contribution. Every little bit helps!"; // Settings "Open Activity Monitor" = "Open Activity Monitor"; diff --git a/Stats/Supporting Files/en-GB.lproj/Localizable.strings b/Stats/Supporting Files/en-GB.lproj/Localizable.strings index 9d2c89de..401051b0 100644 --- a/Stats/Supporting Files/en-GB.lproj/Localizable.strings +++ b/Stats/Supporting Files/en-GB.lproj/Localizable.strings @@ -118,6 +118,7 @@ "Successfully updated" = "Successfully updated"; "Stats was updated to v" = "Stats was updated to v%0"; "Reset settings text" = "All application settings will be reset and the application will be restarted. Are you sure you want to do this?"; +"Support text" = "Thank you for using Stats!\n\n Maintaining and improving this open-source project takes time and resources. Your support helps us continue to provide a free and reliable application for everyone.\n\nIf you find Stats helpful, please consider making a contribution. Every little bit helps!"; // Settings "Open Activity Monitor" = "Open Activity Monitor"; diff --git a/Stats/Supporting Files/en.lproj/Localizable.strings b/Stats/Supporting Files/en.lproj/Localizable.strings index 5b3bb096..fabd89dd 100644 --- a/Stats/Supporting Files/en.lproj/Localizable.strings +++ b/Stats/Supporting Files/en.lproj/Localizable.strings @@ -118,6 +118,7 @@ "Successfully updated" = "Successfully updated"; "Stats was updated to v" = "Stats was updated to v%0"; "Reset settings text" = "All application settings will be reset and the application will be restarted. Are you sure you want to do this?"; +"Support text" = "Thank you for using Stats!\n\n Maintaining and improving this open-source project takes time and resources. Your support helps us continue to provide a free and reliable application for everyone.\n\nIf you find Stats helpful, please consider making a contribution. Every little bit helps!"; // Settings "Open Activity Monitor" = "Open Activity Monitor"; diff --git a/Stats/Supporting Files/es.lproj/Localizable.strings b/Stats/Supporting Files/es.lproj/Localizable.strings index 00514bc8..76bdbc4f 100644 --- a/Stats/Supporting Files/es.lproj/Localizable.strings +++ b/Stats/Supporting Files/es.lproj/Localizable.strings @@ -118,6 +118,7 @@ "Successfully updated" = "Actualización completada con éxito"; "Stats was updated to v" = "Stats se ha actualizado a v%0"; "Reset settings text" = "Todos los ajustes de la aplicación serán restablecidos y la aplicación se reiniciará. ¿Seguro que quieres hacer esto?"; +"Support text" = "Gracias por usar Stats. Mantener y mejorar este proyecto de código abierto requiere tiempo y recursos. Tu apoyo nos ayuda a seguir proporcionando una aplicación gratuita y fiable para todo el mundo.\nSi Stats te resulta útil, por favor, considera hacer una contribución. Todo ayuda."; // Settings "Open Activity Monitor" = "Abrir Monitor de Actividad"; diff --git a/Stats/Supporting Files/et.lproj/Localizable.strings b/Stats/Supporting Files/et.lproj/Localizable.strings index 50a56580..f42eb1c9 100644 --- a/Stats/Supporting Files/et.lproj/Localizable.strings +++ b/Stats/Supporting Files/et.lproj/Localizable.strings @@ -118,6 +118,7 @@ "Successfully updated" = "Edukalt värskendatud"; "Stats was updated to v" = "Stats värskendati versioonile %0"; "Reset settings text" = "Kõik rakenduse seaded lähtestatakse ja rakendus taaskäivitatakse. Kas olete kindel, et soovite seda teha?"; +"Support text" = "Täname teid statistika kasutamise eest!\n\n Selle avatud lähtekoodiga projekti hooldamine ja täiustamine nõuab aega ja ressursse. Teie toetus aitab meil jätkuvalt pakkuda kõigile tasuta ja usaldusväärset rakendust.\n\nJa kui Stats on teie arvates kasulik, siis palun kaaluge panuse andmist. Iga väike summa aitab!"; // Settings "Open Activity Monitor" = "Ava aktiivsusmonitor"; diff --git a/Stats/Supporting Files/fa.lproj/Localizable.strings b/Stats/Supporting Files/fa.lproj/Localizable.strings index 1e4a8d4b..748675a9 100644 --- a/Stats/Supporting Files/fa.lproj/Localizable.strings +++ b/Stats/Supporting Files/fa.lproj/Localizable.strings @@ -118,6 +118,7 @@ "Successfully updated" = "با موفقیت به‌روزرسانی شد"; "Stats was updated to v" = "Stats به نسخه‌ی v%0 بروزسانی شد "; "Reset settings text" = "تمام تنظیمات اپلیکیشن ریست خواهد شد و اپ دوباره راه‌اندازی خواهد شد، آیا از این کار مطمئنید؟"; +"Support text" = "از اینکه از آمار استفاده می کنید متشکریم!\n\n نگهداری و بهبود این پروژه منبع باز زمان و منابع می طلبد. پشتیبانی شما به ما کمک می‌کند تا به ارائه یک برنامه رایگان و قابل اعتماد برای همه ادامه دهیم.\n\nاگر آمارها را مفید می‌دانید، لطفاً در نظر بگیرید. هر ذره کمک می کند!"; // Settings "Open Activity Monitor" = "باز کردن نظارت فعالیت‌ها"; diff --git a/Stats/Supporting Files/fi.lproj/Localizable.strings b/Stats/Supporting Files/fi.lproj/Localizable.strings index 830d49bb..6898c24f 100644 --- a/Stats/Supporting Files/fi.lproj/Localizable.strings +++ b/Stats/Supporting Files/fi.lproj/Localizable.strings @@ -118,6 +118,7 @@ "Successfully updated" = "Päivitys onnistui"; "Stats was updated to v" = "Stats päivitettiin versioon v%0"; "Reset settings text" = "Kaikki sovelluksen asetukset nollataan, ja sovellus käynnistetään uudelleen. Haluatko varmasti tehdä tämän?"; +"Support text" = "Kiitos, että käytät Statsia!\n\n Tämän avoimen lähdekoodin projektin ylläpitäminen ja parantaminen vie aikaa ja resursseja. Tukesi auttaa meitä jatkossakin tarjoamaan ilmaisen ja luotettavan sovelluksen kaikille.\n\nJos Stats on mielestäsi hyödyllinen, harkitse lahjoituksen tekemistä. Jokainen pieni osa auttaa!"; // Settings "Open Activity Monitor" = "Avaa Aktiviteettimonitori"; diff --git a/Stats/Supporting Files/fr.lproj/Localizable.strings b/Stats/Supporting Files/fr.lproj/Localizable.strings index 38989034..9b13afc9 100644 --- a/Stats/Supporting Files/fr.lproj/Localizable.strings +++ b/Stats/Supporting Files/fr.lproj/Localizable.strings @@ -118,6 +118,7 @@ "Successfully updated" = "Mise à jour effectuée avec succès"; "Stats was updated to v" = "Stats a été mis à jour en version %0"; "Reset settings text" = "Tous les paramètres de l'application seront réinitialisés et l'application redémarrera. Êtes-vous sûr de vouloir continuer ?"; +"Support text" = "Merci d'utiliser Stats!\NLa maintenance et l'amélioration de ce projet open-source nécessitent du temps et des ressources. Votre soutien nous aide à continuer à fournir une application gratuite et fiable pour tout le monde.\NSi vous trouvez Stats utile, veuillez envisager de faire une contribution. Chaque petit geste compte!"; // Settings "Open Activity Monitor" = "Ouvrir le Moniteur d'activité"; diff --git a/Stats/Supporting Files/he.lproj/Localizable.strings b/Stats/Supporting Files/he.lproj/Localizable.strings index 6dc249bd..1f9fae73 100644 --- a/Stats/Supporting Files/he.lproj/Localizable.strings +++ b/Stats/Supporting Files/he.lproj/Localizable.strings @@ -118,6 +118,7 @@ "Successfully updated" = "עודכן בהצלחה"; "Stats was updated to v" = "v%0עודכן ל Stats"; "Reset settings text" = "?כל הגדרות התוכנה יתאפסו והתוכנה תופעל מחדש. האם אתם בטוחים שאתם רוצים לעשות את זה"; +"Support text" = "תודה על השימוש בסטטיסטיקה!\n\n תחזוקה ושיפור של פרויקט קוד פתוח זה דורש זמן ומשאבים. התמיכה שלך עוזרת לנו להמשיך לספק אפליקציה חינמית ומהימנה לכולם.\n\nאם אתה מוצא שסטטיסטיקות מועילות, שקול לתרום. כל טיפה עוזרת!"; // Settings "Open Activity Monitor" = "פתח/י את מעקב הפעילות"; diff --git a/Stats/Supporting Files/hi.lproj/Localizable.strings b/Stats/Supporting Files/hi.lproj/Localizable.strings index a8c31858..dc7f5cef 100644 --- a/Stats/Supporting Files/hi.lproj/Localizable.strings +++ b/Stats/Supporting Files/hi.lproj/Localizable.strings @@ -118,6 +118,7 @@ "Successfully updated" = "सफलतापूर्वक अपडेट किया गया"; "Stats was updated to v" = "आँकड़े v पर अपडेट किए गए थे"; "Reset settings text" = "Aसभी एप्लिकेशन सेटिंग्स रीसेट हो जाएंगी और एप्लिकेशन को पुनरारंभ किया जाएगा। क्या आप वाकई ऐसा करना चाहते हैं?"; +"Support text" = "Stats का उपयोग करने के लिए धन्यवाद!\n\n इस ओपन-सोर्स प्रोजेक्ट को बनाए रखने और सुधारने में समय और संसाधन लगते हैं। आपका समर्थन हमें सभी के लिए एक निःशुल्क और विश्वसनीय एप्लिकेशन प्रदान करना जारी रखने में मदद करता है.\n\nयदि आपको Stats मददगार लगता है, तो कृपया योगदान देने पर विचार करें। हर छोटी-छोटी मदद मददगार होती है!"; // Settings "Open Activity Monitor" = "ओपन एक्टिविटी मॉनिटर"; diff --git a/Stats/Supporting Files/hr.lproj/Localizable.strings b/Stats/Supporting Files/hr.lproj/Localizable.strings index 803db9e9..7dbbd309 100644 --- a/Stats/Supporting Files/hr.lproj/Localizable.strings +++ b/Stats/Supporting Files/hr.lproj/Localizable.strings @@ -118,6 +118,7 @@ "Successfully updated" = "Aktualiziranje je uspjelo"; "Stats was updated to v" = "Stats je aktualiziran na v%0"; "Reset settings text" = "Sve postavke programa će se resetirati i program će se ponovo pokrenuti. Stvarno to želiš učiniti?"; +"Support text" = "Hvala vam što koristite Stats!\n\n Održavanje i poboljšanje ovog projekta otvorenog koda zahtijeva vrijeme i resurse. Vaša nam podrška pomaže da nastavimo pružati besplatnu i pouzdanu aplikaciju za sve.\n\nAko smatrate da je statistika korisna, razmislite o davanju doprinosa. Svako malo pomaže!"; // Settings "Open Activity Monitor" = "Otvori program „Praćenje aktivnosti”"; diff --git a/Stats/Supporting Files/hu.lproj/Localizable.strings b/Stats/Supporting Files/hu.lproj/Localizable.strings index d9fafd37..3f1bf66f 100644 --- a/Stats/Supporting Files/hu.lproj/Localizable.strings +++ b/Stats/Supporting Files/hu.lproj/Localizable.strings @@ -118,6 +118,7 @@ "Successfully updated" = "Sikeres frissítés"; "Stats was updated to v" = "A Stats sikeresen frissítve lett a(z) v%0 verzióra"; "Reset settings text" = "Minden alkalmazás beállítás alaphelyzetbe fog állni, és az alkalmazás újra fog indulni. Biztosan ezt szeretnéd?"; +"Support text" = "Köszönjük, hogy használja a Stats-t!\n\n A nyílt forráskódú projekt fenntartása és fejlesztése időt és erőforrásokat igényel. Az Ön támogatása segít nekünk abban, hogy továbbra is ingyenes és megbízható alkalmazást nyújtsunk mindenkinek.\n\nHa hasznosnak találja a Stats-t, kérjük, fontolja meg, hogy hozzájáruljon. Minden kis aprócska összeg segít!"; // Settings "Open Activity Monitor" = "Tevékenységfigyelő megnyitása"; diff --git a/Stats/Supporting Files/id.lproj/Localizable.strings b/Stats/Supporting Files/id.lproj/Localizable.strings index fb76cb2c..f54010ae 100644 --- a/Stats/Supporting Files/id.lproj/Localizable.strings +++ b/Stats/Supporting Files/id.lproj/Localizable.strings @@ -118,6 +118,7 @@ "Successfully updated" = "Pembaruan berhasil"; "Stats was updated to v" = "Stats telah diperbarui v%0"; "Reset settings text" = "Semua pengaturan aplikasi akan diatur ulang, dan aplikasi akan mengulang kembali. Anda yakin untuk melakukan ini?"; +"Support text" = "Terima kasih telah menggunakan Stats!\n\nMemelihara dan meningkatkan proyek sumber terbuka ini membutuhkan waktu dan sumber daya. Dukungan Anda membantu kami untuk terus menyediakan aplikasi yang gratis dan dapat diandalkan untuk semua orang.\n\nJika Anda merasa Stats bermanfaat, mohon pertimbangkan untuk memberikan kontribusi. Setiap hal kecil akan sangat membantu!"; // Settings "Open Activity Monitor" = "Buka Monitor Aktivitas"; diff --git a/Stats/Supporting Files/it.lproj/Localizable.strings b/Stats/Supporting Files/it.lproj/Localizable.strings index c6f85110..6ebacdba 100644 --- a/Stats/Supporting Files/it.lproj/Localizable.strings +++ b/Stats/Supporting Files/it.lproj/Localizable.strings @@ -118,6 +118,7 @@ "Successfully updated" = "Aggiornato con successo"; "Stats was updated to v" = "Stats è stato aggiornato alla v%0"; "Reset settings text" = "Tutte le impostazioni saranno resettate e l'applicazione sarà riavviata. Sei sicuro di volerlo fare?"; +"Support text" = "Grazie per aver usato Stats! Il mantenimento e il miglioramento di questo progetto open-source richiede tempo e risorse. Il vostro sostegno ci aiuta a continuare a fornire un'applicazione gratuita e affidabile per tutti.\n}Se trovate Stats utile, prendete in considerazione l'idea di dare un contributo. Ogni piccolo contributo è utile!"; // Settings "Open Activity Monitor" = "Apri Monitoraggio Attività"; diff --git a/Stats/Supporting Files/ja.lproj/Localizable.strings b/Stats/Supporting Files/ja.lproj/Localizable.strings index a4beb14d..f86d141d 100644 --- a/Stats/Supporting Files/ja.lproj/Localizable.strings +++ b/Stats/Supporting Files/ja.lproj/Localizable.strings @@ -118,6 +118,7 @@ "Successfully updated" = "正常にアップデートされました"; "Stats was updated to v" = "Stats v%0 にアップデートしました"; "Reset settings text" = "アプリの設定をすべてリセットし、アプリを再起動します。本当に続けますか?"; +"Support text" = "Statsをご利用いただきありがとうございます。Statsが役に立つと感じたら、寄付をご検討ください。少しでも役に立ちます!"; // Settings "Open Activity Monitor" = "アクティビティモニタを開く"; diff --git a/Stats/Supporting Files/ko.lproj/Localizable.strings b/Stats/Supporting Files/ko.lproj/Localizable.strings index 064dd548..52c6cd96 100644 --- a/Stats/Supporting Files/ko.lproj/Localizable.strings +++ b/Stats/Supporting Files/ko.lproj/Localizable.strings @@ -118,6 +118,7 @@ "Successfully updated" = "성공적으로 업데이트되었습니다"; "Stats was updated to v" = "Stats가 v%0 버전으로 업데이트되었습니다"; "Reset settings text" = "모든 애플리케이션 설정이 재설정되고 다시 시작됩니다. 계속 진행하시겠습니까?"; +"Support text" = "Stats를 사용해 주셔서 감사합니다!\n\n 이 오픈 소스 프로젝트를 유지 관리하고 개선하는 데는 시간과 리소스가 필요합니다. 여러분의 지원은 모든 사람에게 신뢰할 수 있는 무료 애플리케이션을 계속 제공하는 데 도움이 됩니다.\n\nStats가 도움이 된다면 기여를 고려해 주세요. 여러분의 작은 도움이 큰 힘이 됩니다!"; // Settings "Open Activity Monitor" = "활동 모니터 열기"; @@ -126,8 +127,8 @@ "Close application" = "애플리케이션 닫기"; "Open application settings" = "애플리케이션 설정 열기"; "Open dashboard" = "대시보드 열기"; -"No notifications available in this module" = "No notifications available in this module"; -"Open Calendar" = "Open Calendar"; +"No notifications available in this module" = "이 모듈에서 사용할 수 있는 알림이 없습니다"; +"Open Calendar" = "캘린더 열기"; // Application settings "Update application" = "애플리케이션 업데이트"; diff --git a/Stats/Supporting Files/nb.lproj/Localizable.strings b/Stats/Supporting Files/nb.lproj/Localizable.strings index 5be1cc13..7c139b9d 100644 --- a/Stats/Supporting Files/nb.lproj/Localizable.strings +++ b/Stats/Supporting Files/nb.lproj/Localizable.strings @@ -118,6 +118,7 @@ "Successfully updated" = "Oppdateringen var vellykket"; "Stats was updated to v" = "Stats ble oppdatert til v%0"; "Reset settings text" = "Alle innstillinger vil bli nullstilt og applikasjonen vil starte på nytt. Er du sikker på at du vil gjøre dette?"; +"Support text" = "Takk for at du bruker Stats!\n\nDet krever tid og ressurser å vedlikeholde og forbedre dette åpen kildekode-prosjektet. Din støtte hjelper oss med å fortsette å tilby et gratis og pålitelig program for alle. Hvis du synes Stats er nyttig, kan du vurdere å gi et bidrag. Hver eneste lille bit hjelper!"; // Settings "Open Activity Monitor" = "Åpne Aktivitetsmonitor"; diff --git a/Stats/Supporting Files/nl.lproj/Localizable.strings b/Stats/Supporting Files/nl.lproj/Localizable.strings index cb914ca3..48b269bb 100644 --- a/Stats/Supporting Files/nl.lproj/Localizable.strings +++ b/Stats/Supporting Files/nl.lproj/Localizable.strings @@ -118,6 +118,7 @@ "Successfully updated" = "Succesvol geüpdatet"; "Stats was updated to v" = "Stats is bijgewerkt naar v%0"; "Reset settings text" = "Alle applicatie instellingen worden gereset en de applicatie wordt opnieuw opgestart. Weet u zeker dat u dit wilt doen?"; +"Support text" = "Bedankt voor het gebruik van Stats! Het onderhouden en verbeteren van dit open-source project kost tijd en middelen. Als je Stats nuttig vindt, overweeg dan alsjeblieft om een bijdrage te leveren. Alle beetjes helpen!"; // Settings "Open Activity Monitor" = "Open Activiteitenweergave"; diff --git a/Stats/Supporting Files/pl.lproj/Localizable.strings b/Stats/Supporting Files/pl.lproj/Localizable.strings index da4a0635..d7dfc9c1 100644 --- a/Stats/Supporting Files/pl.lproj/Localizable.strings +++ b/Stats/Supporting Files/pl.lproj/Localizable.strings @@ -118,6 +118,7 @@ "Successfully updated" = "Zaktualizowano pomyślnie"; "Stats was updated to v" = "Stats został zaktualizowany do v%0"; "Reset settings text" = "Wszystkie ustawienia aplikacji zostaną zresetowane, a aplikacja zostanie uruchomiona ponownie. Czy na pewno chcesz to zrobić?"; +"Support text" = "Dziękujemy za korzystanie ze Stats! \n\n Utrzymanie i ulepszanie tego projektu open-source wymaga czasu i zasobów. Twoje wsparcie pomaga nam nadal dostarczać bezpłatną i niezawodną aplikację dla każdego. Jeśli uważasz, że Stats jest pomocny, rozważ dokonanie wpłaty. Każda drobnostka pomaga!"; // Settings "Open Activity Monitor" = "Otwórz Monitor Aktywności"; diff --git a/Stats/Supporting Files/pt-BR.lproj/Localizable.strings b/Stats/Supporting Files/pt-BR.lproj/Localizable.strings index a9b90e83..dba1ad99 100644 --- a/Stats/Supporting Files/pt-BR.lproj/Localizable.strings +++ b/Stats/Supporting Files/pt-BR.lproj/Localizable.strings @@ -118,6 +118,7 @@ "Successfully updated" = "Atualizado com sucesso"; "Stats was updated to v" = "Stats foi atualizado para v%0"; "Reset settings text" = "Todas as configurações do aplicativo serão redefinidas e o aplicativo será reiniciado. Tem certeza de que deseja fazer isso?"; +"Support text" = "Obrigado por usar o Stats!\n\nA manutenção e o aprimoramento deste projeto de código aberto exigem tempo e recursos. Seu apoio nos ajuda a continuar fornecendo um aplicativo gratuito e confiável para todos.\n\nSe você acha o Stats útil, considere fazer uma contribuição. Cada pedacinho ajuda!"; // Settings "Open Activity Monitor" = "Abrir Monitor de Atividades"; diff --git a/Stats/Supporting Files/pt-PT.lproj/Localizable.strings b/Stats/Supporting Files/pt-PT.lproj/Localizable.strings index f0cc57ed..2ae23961 100644 --- a/Stats/Supporting Files/pt-PT.lproj/Localizable.strings +++ b/Stats/Supporting Files/pt-PT.lproj/Localizable.strings @@ -118,6 +118,7 @@ "Successfully updated" = "Atualização feita com sucesso"; "Stats was updated to v" = "Stats foi atualizado para v%0"; "Reset settings text" = "Todas as configurações da aplicação serão restabelecidas e a aplicação será reiniciada. Tens a certeza que queres fazer isso?"; +"Support text" = "Obrigado por utilizar o Stats!\n\nA manutenção e melhoria deste projeto de código aberto requer tempo e recursos. O seu apoio ajuda-nos a continuar a fornecer uma aplicação gratuita e fiável para todos.\n\nSe considera o Stats útil, por favor considere fazer uma contribuição. Cada pedacinho ajuda!"; // Settings "Open Activity Monitor" = "Abrir Monitor de Atividades"; diff --git a/Stats/Supporting Files/ro.lproj/Localizable.strings b/Stats/Supporting Files/ro.lproj/Localizable.strings index 77d0aea8..2b4b8224 100644 --- a/Stats/Supporting Files/ro.lproj/Localizable.strings +++ b/Stats/Supporting Files/ro.lproj/Localizable.strings @@ -118,6 +118,7 @@ "Successfully updated" = "Actualizat cu succes"; "Stats was updated to v" = "Stats a fost actualizat la v%0"; "Reset settings text" = "All application settings will be reset and the application will be restarted. Are you sure you want to do this?"; +"Support text" = "Vă mulțumim pentru utilizarea Stats!\n\n Menținerea și îmbunătățirea acestui proiect open-source necesită timp și resurse. Sprijinul dumneavoastră ne ajută să continuăm să oferim o aplicație gratuită și fiabilă pentru toată lumea.\n\nDacă Stats vă este util, vă rugăm să luați în considerare posibilitatea de a face o contribuție. Fiecare bănuț ajută!"; // Settings "Open Activity Monitor" = "Deschide Monitorul de Activitate"; diff --git a/Stats/Supporting Files/ru.lproj/Localizable.strings b/Stats/Supporting Files/ru.lproj/Localizable.strings index a57ce13a..0f21cb06 100644 --- a/Stats/Supporting Files/ru.lproj/Localizable.strings +++ b/Stats/Supporting Files/ru.lproj/Localizable.strings @@ -118,6 +118,7 @@ "Successfully updated" = "Успешно обновлено"; "Stats was updated to v" = "Stats обновлено до v%0"; "Reset settings text" = "Все настройки приложения будут сброшены, и приложение будет перезапущено. Вы уверены, что хотите это сделать?"; +"Support text" = "Спасибо за использование Stats.\n\n Поддержание и улучшение этого проекта с открытым исходным кодом требует времени и ресурсов. Ваша поддержка помогает нам продолжать предоставлять бесплатное и надежное приложение для всех.\n\nЕсли вы находите Stats полезным, пожалуйста, подумайте о том, чтобы сделать взнос. Каждый маленький кусочек помогает!"; // Settings "Open Activity Monitor" = "Открыть Мониторинг системы"; diff --git a/Stats/Supporting Files/sk.lproj/Localizable.strings b/Stats/Supporting Files/sk.lproj/Localizable.strings index 30b3c925..e905613e 100644 --- a/Stats/Supporting Files/sk.lproj/Localizable.strings +++ b/Stats/Supporting Files/sk.lproj/Localizable.strings @@ -118,6 +118,7 @@ "Successfully updated" = "Úspešne aktualizované"; "Stats was updated to v" = "Stats bol aktualizovaný na v%0"; "Reset settings text" = "Všetky nastavenia aplikácie budú zresetované a aplikácia bude reštartovaná. Ste si istý, že chcete pokračovať?"; +"Support text" = "Ďakujeme, že používate Stats!\n\n Udržiavanie a zlepšovanie tohto open-source projektu si vyžaduje čas a zdroje. Vaša podpora nám pomáha pokračovať v poskytovaní bezplatnej a spoľahlivej aplikácie pre každého.\n\nAk považujete Stats za užitočné, zvážte prosím možnosť prispieť. Každý malý kúsok pomôže!"; // Settings "Open Activity Monitor" = "Otvoriť Monitor aktivity"; diff --git a/Stats/Supporting Files/sl.lproj/Localizable.strings b/Stats/Supporting Files/sl.lproj/Localizable.strings index d67eea89..84a19568 100644 --- a/Stats/Supporting Files/sl.lproj/Localizable.strings +++ b/Stats/Supporting Files/sl.lproj/Localizable.strings @@ -118,6 +118,7 @@ "Successfully updated" = "Uspešno posodobljeno"; "Stats was updated to v" = "Program Stats je bil posodobljen na v%0"; "Reset settings text" = "Vse nastavitve aplikacije se bodo ponastavile in aplikacija se bo znova zagnala. Ali ste prepričani, da to storiti?"; +"Support text" = "Zahvaljujemo se vam za uporabo Stats!\n\n Vzdrževanje in izboljševanje tega odprtokodnega projekta zahteva čas in sredstva. Vaša podpora nam pomaga še naprej zagotavljati brezplačno in zanesljivo aplikacijo za vsakogar.\n\nČe vam je program Stats koristen, razmislite o prispevku. Vsaka malenkost pomaga!"; // Settings "Open Activity Monitor" = "Odpri monitor dejavnosti"; diff --git a/Stats/Supporting Files/sv.lproj/Localizable.strings b/Stats/Supporting Files/sv.lproj/Localizable.strings index bc802296..478fc898 100644 --- a/Stats/Supporting Files/sv.lproj/Localizable.strings +++ b/Stats/Supporting Files/sv.lproj/Localizable.strings @@ -118,6 +118,7 @@ "Successfully updated" = "Uppdateringen lyckades"; "Stats was updated to v" = "Stats uppdaterades till v%0"; "Reset settings text" = "Alla programinställningar kommer att återställas och programmet startas om. Är du säker på att du vill göra detta?"; +"Support text" = "Tack för att du använder Stats!\n\n Att underhålla och förbättra detta projekt med öppen källkod tar tid och resurser. Ditt stöd hjälper oss att fortsätta tillhandahålla en gratis och tillförlitlig applikation för alla.\n\nOm du tycker att Stats är användbart kan du överväga att ge ett bidrag. Varje liten bit hjälper!"; // Settings "Open Activity Monitor" = "Öppna Aktivitetsövervakaren"; diff --git a/Stats/Supporting Files/th.lproj/Localizable.strings b/Stats/Supporting Files/th.lproj/Localizable.strings index 9a10e00f..ee671c85 100644 --- a/Stats/Supporting Files/th.lproj/Localizable.strings +++ b/Stats/Supporting Files/th.lproj/Localizable.strings @@ -118,6 +118,7 @@ "Successfully updated" = "อัพเดทสำเร็จ"; "Stats was updated to v" = "Stats อัพเดทเป็น v%0"; "Reset settings text" = "การตั้งค่าของแอพพลิเคชันทั้งหมดจะถูกรีเซ็ตและแอพพลิเคชันจะเริ่มต้นใหม่ คุณแน่ใจหรือไม่ว่าต้องการดำเนินการนี้?"; +"Support text" = "ขอขอบคุณที่ใช้ Stats!\n\n การบำรุงรักษาและปรับปรุงโครงการโอเพนซอร์สนี้ต้องใช้เวลาและทรัพยากร การสนับสนุนของคุณช่วยให้เราสามารถให้บริการแอปพลิเคชันฟรีและเชื่อถือได้สำหรับทุกคนต่อไปได้\n\n หากคุณพบว่า Stats มีประโยชน์ โปรดพิจารณาให้ความช่วยเหลือ ทุก ๆ ความช่วยเหลือเล็ก ๆ น้อย ๆ ล้วนมีประโยชน์!"; // Settings "Open Activity Monitor" = "เปิด Activity Monitor"; diff --git a/Stats/Supporting Files/tr.lproj/Localizable.strings b/Stats/Supporting Files/tr.lproj/Localizable.strings index 7887f478..80b24cde 100644 --- a/Stats/Supporting Files/tr.lproj/Localizable.strings +++ b/Stats/Supporting Files/tr.lproj/Localizable.strings @@ -118,6 +118,7 @@ "Successfully updated" = "Başarıyla güncellendi"; "Stats was updated to v" = "Stats v%0 sürümüne güncellendi"; "Reset settings text" = "Bütün uygulama ayarları sıfırlanacak ve uygulama yeniden başlatılacak. Bunu yapmak istediğinize emin misiniz?"; +"Support text" = "Stats'i kullandığınız için teşekkür ederiz.\n\n Bu açık kaynak projesini sürdürmek ve geliştirmek zaman ve kaynak gerektirir. Desteğiniz, herkes için ücretsiz ve güvenilir bir uygulama sağlamaya devam etmemize yardımcı olur.\n\nStats'ı yararlı buluyorsanız, lütfen katkıda bulunmayı düşünün. Her küçük parça yardımcı olur!"; // Settings "Open Activity Monitor" = "Etkinlik Monitörünü aç"; diff --git a/Stats/Supporting Files/uk.lproj/Localizable.strings b/Stats/Supporting Files/uk.lproj/Localizable.strings index 3fb060e1..6a983494 100644 --- a/Stats/Supporting Files/uk.lproj/Localizable.strings +++ b/Stats/Supporting Files/uk.lproj/Localizable.strings @@ -118,6 +118,7 @@ "Successfully updated" = "Успішно оновленно"; "Stats was updated to v" = "Stats оновлено до v%0"; "Reset settings text" = "Усі налаштування програми буде скинуто, і програма буде перезапущена. Ви впевнені, що хочете це зробити?"; +"Support text" = "Дякуємо за використання Stats!\n\n Підтримка і вдосконалення цього проекту з відкритим вихідним кодом вимагає часу і ресурсів. Ваша підтримка допомагає нам продовжувати надавати безкоштовну і надійну програму для всіх.\n\nЯкщо ви вважаєте Stats корисною, будь ласка, зробіть свій внесок. Кожна копійка допомагає!"; // Settings "Open Activity Monitor" = "Відкрити Монітор активності"; diff --git a/Stats/Supporting Files/vi.lproj/Localizable.strings b/Stats/Supporting Files/vi.lproj/Localizable.strings index 6ec83d26..89480060 100644 --- a/Stats/Supporting Files/vi.lproj/Localizable.strings +++ b/Stats/Supporting Files/vi.lproj/Localizable.strings @@ -118,6 +118,7 @@ "Successfully updated" = "Cập nhật thành công"; "Stats was updated to v" = "Stats đã được cập nhật lên v%0"; "Reset settings text" = "Tất cả cài đặt ứng dụng sẽ được đặt lại và ứng dụng sẽ khởi động lại. Bạn có chắc chắn muốn thực hiện không?"; +"Support text" = "Cảm ơn bạn đã sử dụng Stats!\n\n Việc duy trì và cải thiện dự án nguồn mở này cần có thời gian và nguồn lực. Sự hỗ trợ của bạn giúp chúng tôi tiếp tục cung cấp một ứng dụng miễn phí và đáng tin cậy cho mọi người.\n\nNếu bạn thấy Stats hữu ích, vui lòng cân nhắc đóng góp. Mỗi đóng góp nhỏ đều có ích!"; // Settings "Open Activity Monitor" = "Mở Activity Monitor"; diff --git a/Stats/Supporting Files/zh-Hans.lproj/Localizable.strings b/Stats/Supporting Files/zh-Hans.lproj/Localizable.strings index 520e5758..4ea60c2c 100644 --- a/Stats/Supporting Files/zh-Hans.lproj/Localizable.strings +++ b/Stats/Supporting Files/zh-Hans.lproj/Localizable.strings @@ -118,6 +118,7 @@ "Successfully updated" = "更新成功"; "Stats was updated to v" = "Stats 已更新到 v%0"; "Reset settings text" = "应用程序的所有设置将会被重置,应用程序也将重新启动。你确定要这么做吗?"; +"Support text" = "感谢您使用 Stats!维护和改进这个开源项目需要时间和资源。如果您觉得 Stats 对您有帮助,请考虑贡献一份力量。一点一滴都有帮助!"; // Settings "Open Activity Monitor" = "打开活动监视器"; diff --git a/Stats/Supporting Files/zh-Hant.lproj/Localizable.strings b/Stats/Supporting Files/zh-Hant.lproj/Localizable.strings index 81873226..aaa83b39 100644 --- a/Stats/Supporting Files/zh-Hant.lproj/Localizable.strings +++ b/Stats/Supporting Files/zh-Hant.lproj/Localizable.strings @@ -118,6 +118,7 @@ "Successfully updated" = "更新成功"; "Stats was updated to v" = "Stats 已更新到 v%0"; "Reset settings text" = "應用程式的所有設定將會重置,並會重新打開此應用程式。您確定要這樣做嗎?"; +"Support text" = "感謝您使用 Stats!維護和改進這個開放源專案需要時間和資源。如果您覺得 Stats 有幫助,請考慮捐款。一分一毫都有幫助!"; // Settings "Open Activity Monitor" = "打開活動監視器"; diff --git a/Stats/Views/Support.swift b/Stats/Views/Support.swift new file mode 100644 index 00000000..a1cded95 --- /dev/null +++ b/Stats/Views/Support.swift @@ -0,0 +1,146 @@ +// +// Support.swift +// Stats +// +// Created by Serhiy Mytrovtsiy on 14/01/2025 +// Using Swift 6.0 +// Running on macOS 15.1 +// +// Copyright © 2025 Serhiy Mytrovtsiy. All rights reserved. +// + +import Cocoa +import Kit + +internal class SupportWindow: NSWindow, NSWindowDelegate { + private let viewController: SupportViewController = SupportViewController() + + init() { + super.init( + contentRect: NSRect( + x: NSScreen.main!.frame.width - self.viewController.view.frame.width, + y: NSScreen.main!.frame.height - self.viewController.view.frame.height, + width: self.viewController.view.frame.width, + height: self.viewController.view.frame.height + ), + styleMask: [.closable, .titled, .fullSizeContentView], + backing: .buffered, + defer: true + ) + + self.title = "Support Stats" + self.titleVisibility = .hidden + self.contentViewController = self.viewController + self.titlebarAppearsTransparent = true + self.positionCenter() + self.setIsVisible(false) + + let windowController = NSWindowController() + windowController.window = self + windowController.loadWindow() + } + + private func positionCenter() { + self.setFrameOrigin(NSPoint( + x: (NSScreen.main!.frame.width - self.viewController.view.frame.width)/2, + y: (NSScreen.main!.frame.height - self.viewController.view.frame.height)/1.75 + )) + } + + internal func show() { + self.setIsVisible(true) + self.orderFrontRegardless() + } +} + +private class SupportViewController: NSViewController { + private var support: SupportView + + public init() { + self.support = SupportView(frame: NSRect(x: 0, y: 0, width: 460, height: 340)) + super.init(nibName: nil, bundle: nil) + self.view = self.support + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } +} + +private class SupportView: NSStackView { + override init(frame: NSRect) { + super.init(frame: CGRect(x: frame.origin.x, y: frame.origin.y, width: frame.width, height: frame.height)) + self.wantsLayer = true + self.orientation = .vertical + self.spacing = 0 + + let sidebar = NSVisualEffectView(frame: NSRect(x: 0, y: 0, width: self.frame.width, height: self.frame.height)) + sidebar.material = .sidebar + sidebar.blendingMode = .behindWindow + sidebar.state = .active + + self.addSubview(sidebar, positioned: .below, relativeTo: nil) + + let container: NSStackView = NSStackView() + container.widthAnchor.constraint(equalToConstant: self.frame.width - 40).isActive = true + container.orientation = .vertical + + let textField: NSTextField = TextView() + textField.wantsLayer = false + textField.alignment = .center + textField.font = NSFont.systemFont(ofSize: 14) + textField.stringValue = localizedString("Support text") + textField.isSelectable = false + container.addArrangedSubview(NSView()) + container.addArrangedSubview(textField) + container.addArrangedSubview(NSView()) + + let support: NSStackView = NSStackView(frame: NSRect(x: 0, y: 0, width: 160, height: 60)) + support.heightAnchor.constraint(equalToConstant: 80).isActive = true + support.edgeInsets = NSEdgeInsets(top: 12, left: 0, bottom: 0, right: 0) + support.spacing = 20 + support.orientation = .horizontal + + let github = SupportButtonView(name: "GitHub Sponsors", image: "github", action: { + NSWorkspace.shared.open(URL(string: "https://github.com/sponsors/exelban")!) + }) + let paypal = SupportButtonView(name: "PayPal", image: "paypal", action: { + NSWorkspace.shared.open(URL(string: "https://www.paypal.com/donate?hosted_button_id=3DS5JHDBATMTC")!) + }) + let koFi = SupportButtonView(name: "Ko-fi", image: "ko-fi", action: { + NSWorkspace.shared.open(URL(string: "https://ko-fi.com/exelban")!) + }) + let patreon = SupportButtonView(name: "Patreon", image: "patreon", action: { + NSWorkspace.shared.open(URL(string: "https://patreon.com/exelban")!) + }) + + support.addArrangedSubview(github) + support.addArrangedSubview(paypal) + support.addArrangedSubview(koFi) + support.addArrangedSubview(patreon) + + let footer = NSStackView() + footer.heightAnchor.constraint(equalToConstant: 60).isActive = true + footer.orientation = .horizontal + let close = NSButton() + close.heightAnchor.constraint(equalToConstant: 28).isActive = true + close.bezelStyle = .regularSquare + close.title = localizedString("Close") + close.toolTip = localizedString("Close") + close.action = #selector(self.close) + close.target = self + footer.addArrangedSubview(close) + + self.addArrangedSubview(container) + self.addArrangedSubview(support) + self.addArrangedSubview(footer) + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + @objc private func close() { + self.window?.close() + } +} diff --git a/Stats/helpers.swift b/Stats/helpers.swift index 34d67e50..ea3b3515 100644 --- a/Stats/helpers.swift +++ b/Stats/helpers.swift @@ -95,6 +95,14 @@ extension AppDelegate { NSApp.setActivationPolicy(dockIconStatus) } + self.checkIfShouldShowSupportWindow() + self.supportActivity.interval = 60 * 60 * 24 * 30 + self.supportActivity.repeats = true + self.supportActivity.schedule { (completion: @escaping NSBackgroundActivityScheduler.CompletionHandler) in + self.checkIfShouldShowSupportWindow() + completion(NSBackgroundActivityScheduler.Result.finished) + } + if let updateInterval = AppUpdateInterval(rawValue: Store.shared.string(key: "update-interval", defaultValue: AppUpdateInterval.silent.rawValue)) { self.updateActivity.invalidate() self.updateActivity.repeats = true @@ -192,6 +200,22 @@ extension AppDelegate { } } + func checkIfShouldShowSupportWindow() { + let now = Int(Date().timeIntervalSince1970) + if !Store.shared.exist(key: "support_ts") { + Store.shared.set(key: "support_ts", value: now) + self.supportWindow.show() + return + } + let lastShow = Store.shared.int(key: "support_ts", defaultValue: now) + let diff = (now - lastShow) / (60 * 60 * 24) + if diff <= 31 { + debug("The support window was shown \(diff) days ago, stopping...") + return + } + self.supportWindow.show() + } + private func showUpdateNotification(version: version_s) { debug("show update notification") _ = showNotification(