mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Merge branch 'dev' into dev
This commit is contained in:
commit
d1bb08affb
27 changed files with 309 additions and 98 deletions
|
|
@ -1,4 +1,6 @@
|
|||
namespace Flow.Launcher.Core.ExternalPlugins
|
||||
using System;
|
||||
|
||||
namespace Flow.Launcher.Core.ExternalPlugins
|
||||
{
|
||||
public record UserPlugin
|
||||
{
|
||||
|
|
@ -12,5 +14,8 @@
|
|||
public string UrlDownload { get; set; }
|
||||
public string UrlSourceCode { get; set; }
|
||||
public string IcoPath { get; set; }
|
||||
public DateTime LatestReleaseDate { get; set; }
|
||||
public DateTime DateAdded { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
43
Flow.Launcher/Converters/BoolToVisibilityConverter.cs
Normal file
43
Flow.Launcher/Converters/BoolToVisibilityConverter.cs
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
|
||||
namespace Flow.Launcher.Converters
|
||||
{
|
||||
public class BoolToVisibilityConverter : IValueConverter
|
||||
{
|
||||
public object Convert(object value, System.Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
if (parameter != null)
|
||||
{
|
||||
if (value is true)
|
||||
{
|
||||
return Visibility.Collapsed;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
return Visibility.Visible;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (value is true)
|
||||
{
|
||||
return Visibility.Visible;
|
||||
}
|
||||
|
||||
else {
|
||||
return Visibility.Collapsed;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, System.Type targetType, object parameter, CultureInfo culture) => throw new System.InvalidOperationException();
|
||||
}
|
||||
}
|
||||
32
Flow.Launcher/Converters/TextConverter.cs
Normal file
32
Flow.Launcher/Converters/TextConverter.cs
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
using System;
|
||||
using System.Globalization;
|
||||
using System.Windows.Data;
|
||||
using Flow.Launcher.Core.Resource;
|
||||
using Flow.Launcher.ViewModel;
|
||||
|
||||
namespace Flow.Launcher.Converters
|
||||
{
|
||||
public class TextConverter : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
var ID = value.ToString();
|
||||
switch(ID)
|
||||
{
|
||||
case PluginStoreItemViewModel.NewRelease:
|
||||
return InternationalizationManager.Instance.GetTranslation("pluginStore_NewRelease");
|
||||
case PluginStoreItemViewModel.RecentlyUpdated:
|
||||
return InternationalizationManager.Instance.GetTranslation("pluginStore_RecentlyUpdated");
|
||||
case PluginStoreItemViewModel.None:
|
||||
return InternationalizationManager.Instance.GetTranslation("pluginStore_None");
|
||||
case PluginStoreItemViewModel.Installed:
|
||||
return InternationalizationManager.Instance.GetTranslation("pluginStore_Installed");
|
||||
default:
|
||||
return ID;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, System.Type targetType, object parameter, CultureInfo culture) => throw new System.InvalidOperationException();
|
||||
}
|
||||
}
|
||||
|
|
@ -77,13 +77,13 @@
|
|||
<system:String x:Key="plugin_query_time">Søgetid:</system:String>
|
||||
<system:String x:Key="plugin_query_version">| Version</system:String>
|
||||
<system:String x:Key="plugin_query_web">Website</system:String>
|
||||
<system:String x:Key="plugin_uninstall">Uninstall</system:String>
|
||||
<system:String x:Key="uninstallbtn">Uninstall</system:String>
|
||||
|
||||
|
||||
<!-- Setting Plugin Store -->
|
||||
<system:String x:Key="pluginStore">Plugin Store</system:String>
|
||||
<system:String x:Key="refresh">Refresh</system:String>
|
||||
<system:String x:Key="install">Install</system:String>
|
||||
<system:String x:Key="installbtn">Install</system:String>
|
||||
|
||||
<!-- Setting Theme -->
|
||||
<system:String x:Key="theme">Tema</system:String>
|
||||
|
|
|
|||
|
|
@ -77,13 +77,13 @@
|
|||
<system:String x:Key="plugin_query_time">Abfragezeit:</system:String>
|
||||
<system:String x:Key="plugin_query_version">Version</system:String>
|
||||
<system:String x:Key="plugin_query_web">Webseite</system:String>
|
||||
<system:String x:Key="plugin_uninstall">Deinstallieren</system:String>
|
||||
<system:String x:Key="uninstallbtn">Deinstallieren</system:String>
|
||||
|
||||
|
||||
<!-- Setting Plugin Store -->
|
||||
<system:String x:Key="pluginStore">Erweiterungen laden</system:String>
|
||||
<system:String x:Key="refresh">Aktualisieren</system:String>
|
||||
<system:String x:Key="install">Installieren</system:String>
|
||||
<system:String x:Key="installbtn">Installieren</system:String>
|
||||
|
||||
<!-- Setting Theme -->
|
||||
<system:String x:Key="theme">Design</system:String>
|
||||
|
|
|
|||
|
|
@ -92,13 +92,24 @@
|
|||
<system:String x:Key="plugin_query_time">Query time:</system:String>
|
||||
<system:String x:Key="plugin_query_version">| Version</system:String>
|
||||
<system:String x:Key="plugin_query_web">Website</system:String>
|
||||
<system:String x:Key="plugin_uninstall">Uninstall</system:String>
|
||||
|
||||
|
||||
<!-- Setting Plugin Store -->
|
||||
<system:String x:Key="pluginStore">Plugin Store</system:String>
|
||||
<system:String x:Key="pluginStore_NewRelease">New Release</system:String>
|
||||
<system:String x:Key="pluginStore_RecentlyUpdated">Recently Updated</system:String>
|
||||
<system:String x:Key="pluginStore_None">Plugins</system:String>
|
||||
<system:String x:Key="pluginStore_Installed">Installed</system:String>
|
||||
<system:String x:Key="refresh">Refresh</system:String>
|
||||
<system:String x:Key="install">Install</system:String>
|
||||
<system:String x:Key="installbtn">Install</system:String>
|
||||
<system:String x:Key="uninstallbtn">Uninstall</system:String>
|
||||
<system:String x:Key="updatebtn">Update</system:String>
|
||||
<system:String x:Key="LabelInstalledToolTip">Plug-in already installed</system:String>
|
||||
<system:String x:Key="LabelNew">New Version</system:String>
|
||||
<system:String x:Key="LabelNewToolTip">This plug-in has been updated within the last 7 days</system:String>
|
||||
<system:String x:Key="LabelUpdateToolTip">New Update is Available</system:String>
|
||||
|
||||
|
||||
|
||||
<!-- Setting Theme -->
|
||||
<system:String x:Key="theme">Theme</system:String>
|
||||
|
|
|
|||
|
|
@ -77,13 +77,13 @@
|
|||
<system:String x:Key="plugin_query_time">Tiempo de consulta:</system:String>
|
||||
<system:String x:Key="plugin_query_version">| Versión</system:String>
|
||||
<system:String x:Key="plugin_query_web">Sitio web</system:String>
|
||||
<system:String x:Key="plugin_uninstall">Uninstall</system:String>
|
||||
<system:String x:Key="uninstallbtn">Uninstall</system:String>
|
||||
|
||||
|
||||
<!-- Setting Plugin Store -->
|
||||
<system:String x:Key="pluginStore">Tienda de Plugins</system:String>
|
||||
<system:String x:Key="refresh">Recargar</system:String>
|
||||
<system:String x:Key="install">Instalar</system:String>
|
||||
<system:String x:Key="installbtn">Instalar</system:String>
|
||||
|
||||
<!-- Setting Theme -->
|
||||
<system:String x:Key="theme">Tema</system:String>
|
||||
|
|
|
|||
|
|
@ -77,13 +77,13 @@
|
|||
<system:String x:Key="plugin_query_time">Utilisation :</system:String>
|
||||
<system:String x:Key="plugin_query_version">| Version</system:String>
|
||||
<system:String x:Key="plugin_query_web">Website</system:String>
|
||||
<system:String x:Key="plugin_uninstall">Désinstaller</system:String>
|
||||
<system:String x:Key="uninstallbtn">Désinstaller</system:String>
|
||||
|
||||
|
||||
<!-- Setting Plugin Store -->
|
||||
<system:String x:Key="pluginStore">Plugin Store</system:String>
|
||||
<system:String x:Key="refresh">Refresh</system:String>
|
||||
<system:String x:Key="install">Install</system:String>
|
||||
<system:String x:Key="installbtn">Install</system:String>
|
||||
|
||||
<!-- Setting Theme -->
|
||||
<system:String x:Key="theme">Thèmes</system:String>
|
||||
|
|
|
|||
|
|
@ -77,13 +77,13 @@
|
|||
<system:String x:Key="plugin_query_time">Tempo ricerca:</system:String>
|
||||
<system:String x:Key="plugin_query_version">| Versione</system:String>
|
||||
<system:String x:Key="plugin_query_web">Sito Web</system:String>
|
||||
<system:String x:Key="plugin_uninstall">Disinstalla</system:String>
|
||||
<system:String x:Key="uninstallbtn">Disinstalla</system:String>
|
||||
|
||||
|
||||
<!-- Setting Plugin Store -->
|
||||
<system:String x:Key="pluginStore">Negozio dei Plugin</system:String>
|
||||
<system:String x:Key="refresh">Aggiorna</system:String>
|
||||
<system:String x:Key="install">Installa</system:String>
|
||||
<system:String x:Key="installbtn">Installa</system:String>
|
||||
|
||||
<!-- Setting Theme -->
|
||||
<system:String x:Key="theme">Tema</system:String>
|
||||
|
|
|
|||
|
|
@ -77,13 +77,13 @@
|
|||
<system:String x:Key="plugin_query_time">クエリ時間:</system:String>
|
||||
<system:String x:Key="plugin_query_version">| バージョン</system:String>
|
||||
<system:String x:Key="plugin_query_web">ウェブサイト</system:String>
|
||||
<system:String x:Key="plugin_uninstall">アンインストール</system:String>
|
||||
<system:String x:Key="uninstallbtn">アンインストール</system:String>
|
||||
|
||||
|
||||
<!-- Setting Plugin Store -->
|
||||
<system:String x:Key="pluginStore">プラグインストア</system:String>
|
||||
<system:String x:Key="refresh">Refresh</system:String>
|
||||
<system:String x:Key="install">Install</system:String>
|
||||
<system:String x:Key="installbtn">Install</system:String>
|
||||
|
||||
<!-- Setting Theme -->
|
||||
<system:String x:Key="theme">テーマ</system:String>
|
||||
|
|
|
|||
|
|
@ -77,13 +77,13 @@
|
|||
<system:String x:Key="plugin_query_time">쿼리 시간:</system:String>
|
||||
<system:String x:Key="plugin_query_version">| 버전</system:String>
|
||||
<system:String x:Key="plugin_query_web">웹사이트</system:String>
|
||||
<system:String x:Key="plugin_uninstall">제거</system:String>
|
||||
<system:String x:Key="uninstallbtn">제거</system:String>
|
||||
|
||||
|
||||
<!-- Setting Plugin Store -->
|
||||
<system:String x:Key="pluginStore">플러그인 스토어</system:String>
|
||||
<system:String x:Key="refresh">새로고침</system:String>
|
||||
<system:String x:Key="install">설치</system:String>
|
||||
<system:String x:Key="installbtn">설치</system:String>
|
||||
|
||||
<!-- Setting Theme -->
|
||||
<system:String x:Key="theme">테마</system:String>
|
||||
|
|
|
|||
|
|
@ -77,13 +77,13 @@
|
|||
<system:String x:Key="plugin_query_time">Query time:</system:String>
|
||||
<system:String x:Key="plugin_query_version">| Version</system:String>
|
||||
<system:String x:Key="plugin_query_web">Website</system:String>
|
||||
<system:String x:Key="plugin_uninstall">Uninstall</system:String>
|
||||
<system:String x:Key="uninstallbtn">Uninstall</system:String>
|
||||
|
||||
|
||||
<!-- Setting Plugin Store -->
|
||||
<system:String x:Key="pluginStore">Plugin Store</system:String>
|
||||
<system:String x:Key="refresh">Refresh</system:String>
|
||||
<system:String x:Key="install">Install</system:String>
|
||||
<system:String x:Key="installbtn">Install</system:String>
|
||||
|
||||
<!-- Setting Theme -->
|
||||
<system:String x:Key="theme">Theme</system:String>
|
||||
|
|
|
|||
|
|
@ -77,13 +77,13 @@
|
|||
<system:String x:Key="plugin_query_time">Query tijd:</system:String>
|
||||
<system:String x:Key="plugin_query_version">| Versie</system:String>
|
||||
<system:String x:Key="plugin_query_web">Website</system:String>
|
||||
<system:String x:Key="plugin_uninstall">Uninstall</system:String>
|
||||
<system:String x:Key="uninstallbtn">Uninstall</system:String>
|
||||
|
||||
|
||||
<!-- Setting Plugin Store -->
|
||||
<system:String x:Key="pluginStore">Plugin Winkel</system:String>
|
||||
<system:String x:Key="refresh">Vernieuwen</system:String>
|
||||
<system:String x:Key="install">Installeren</system:String>
|
||||
<system:String x:Key="installbtn">Installeren</system:String>
|
||||
|
||||
<!-- Setting Theme -->
|
||||
<system:String x:Key="theme">Thema</system:String>
|
||||
|
|
|
|||
|
|
@ -77,13 +77,13 @@
|
|||
<system:String x:Key="plugin_query_time">Czas zapytania:</system:String>
|
||||
<system:String x:Key="plugin_query_version">| Version</system:String>
|
||||
<system:String x:Key="plugin_query_web">Website</system:String>
|
||||
<system:String x:Key="plugin_uninstall">Odinstalowywanie</system:String>
|
||||
<system:String x:Key="uninstallbtn">Odinstalowywanie</system:String>
|
||||
|
||||
|
||||
<!-- Setting Plugin Store -->
|
||||
<system:String x:Key="pluginStore">Plugin Store</system:String>
|
||||
<system:String x:Key="refresh">Refresh</system:String>
|
||||
<system:String x:Key="install">Install</system:String>
|
||||
<system:String x:Key="installbtn">Install</system:String>
|
||||
|
||||
<!-- Setting Theme -->
|
||||
<system:String x:Key="theme">Skórka</system:String>
|
||||
|
|
|
|||
|
|
@ -77,13 +77,13 @@
|
|||
<system:String x:Key="plugin_query_time">Tempo de consulta:</system:String>
|
||||
<system:String x:Key="plugin_query_version">| Version</system:String>
|
||||
<system:String x:Key="plugin_query_web">Website</system:String>
|
||||
<system:String x:Key="plugin_uninstall">Desinstalar</system:String>
|
||||
<system:String x:Key="uninstallbtn">Desinstalar</system:String>
|
||||
|
||||
|
||||
<!-- Setting Plugin Store -->
|
||||
<system:String x:Key="pluginStore">Plugin Store</system:String>
|
||||
<system:String x:Key="refresh">Refresh</system:String>
|
||||
<system:String x:Key="install">Install</system:String>
|
||||
<system:String x:Key="installbtn">Install</system:String>
|
||||
|
||||
<!-- Setting Theme -->
|
||||
<system:String x:Key="theme">Tema</system:String>
|
||||
|
|
|
|||
|
|
@ -77,13 +77,13 @@
|
|||
<system:String x:Key="plugin_query_time">Tempo de consulta:</system:String>
|
||||
<system:String x:Key="plugin_query_version">| Versão</system:String>
|
||||
<system:String x:Key="plugin_query_web">Site</system:String>
|
||||
<system:String x:Key="plugin_uninstall">Desinstalar</system:String>
|
||||
<system:String x:Key="uninstallbtn">Desinstalar</system:String>
|
||||
|
||||
|
||||
<!-- Setting Plugin Store -->
|
||||
<system:String x:Key="pluginStore">Loja de plugins</system:String>
|
||||
<system:String x:Key="refresh">Recarregar</system:String>
|
||||
<system:String x:Key="install">Instalar</system:String>
|
||||
<system:String x:Key="installbtn">Instalar</system:String>
|
||||
|
||||
<!-- Setting Theme -->
|
||||
<system:String x:Key="theme">Tema</system:String>
|
||||
|
|
|
|||
|
|
@ -77,13 +77,13 @@
|
|||
<system:String x:Key="plugin_query_time">Запрос:</system:String>
|
||||
<system:String x:Key="plugin_query_version">| Version</system:String>
|
||||
<system:String x:Key="plugin_query_web">Website</system:String>
|
||||
<system:String x:Key="plugin_uninstall">Удалить</system:String>
|
||||
<system:String x:Key="uninstallbtn">Удалить</system:String>
|
||||
|
||||
|
||||
<!-- Setting Plugin Store -->
|
||||
<system:String x:Key="pluginStore">Plugin Store</system:String>
|
||||
<system:String x:Key="refresh">Refresh</system:String>
|
||||
<system:String x:Key="install">Install</system:String>
|
||||
<system:String x:Key="installbtn">Install</system:String>
|
||||
|
||||
<!-- Setting Theme -->
|
||||
<system:String x:Key="theme">Тема</system:String>
|
||||
|
|
|
|||
|
|
@ -77,13 +77,13 @@
|
|||
<system:String x:Key="plugin_query_time">Trvanie dopytu:</system:String>
|
||||
<system:String x:Key="plugin_query_version">| Verzia</system:String>
|
||||
<system:String x:Key="plugin_query_web">Webstránka</system:String>
|
||||
<system:String x:Key="plugin_uninstall">Odinštalovať</system:String>
|
||||
<system:String x:Key="uninstallbtn">Odinštalovať</system:String>
|
||||
|
||||
|
||||
<!-- Setting Plugin Store -->
|
||||
<system:String x:Key="pluginStore">Repozitár pluginov</system:String>
|
||||
<system:String x:Key="refresh">Obnoviť</system:String>
|
||||
<system:String x:Key="install">Inštalovať</system:String>
|
||||
<system:String x:Key="installbtn">Inštalovať</system:String>
|
||||
|
||||
<!-- Setting Theme -->
|
||||
<system:String x:Key="theme">Motív</system:String>
|
||||
|
|
|
|||
|
|
@ -77,13 +77,13 @@
|
|||
<system:String x:Key="plugin_query_time">Vreme upita:</system:String>
|
||||
<system:String x:Key="plugin_query_version">| Version</system:String>
|
||||
<system:String x:Key="plugin_query_web">Website</system:String>
|
||||
<system:String x:Key="plugin_uninstall">Uninstall</system:String>
|
||||
<system:String x:Key="uninstallbtn">Uninstall</system:String>
|
||||
|
||||
|
||||
<!-- Setting Plugin Store -->
|
||||
<system:String x:Key="pluginStore">Plugin Store</system:String>
|
||||
<system:String x:Key="refresh">Refresh</system:String>
|
||||
<system:String x:Key="install">Install</system:String>
|
||||
<system:String x:Key="installbtn">Install</system:String>
|
||||
|
||||
<!-- Setting Theme -->
|
||||
<system:String x:Key="theme">Tema</system:String>
|
||||
|
|
|
|||
|
|
@ -77,13 +77,13 @@
|
|||
<system:String x:Key="plugin_query_time">Sorgu Süresi:</system:String>
|
||||
<system:String x:Key="plugin_query_version">Sürüm</system:String>
|
||||
<system:String x:Key="plugin_query_web">İnternet Sitesi</system:String>
|
||||
<system:String x:Key="plugin_uninstall">Kaldır</system:String>
|
||||
<system:String x:Key="uninstallbtn">Kaldır</system:String>
|
||||
|
||||
|
||||
<!-- Setting Plugin Store -->
|
||||
<system:String x:Key="pluginStore">Eklenti Mağazası</system:String>
|
||||
<system:String x:Key="refresh">Yenile</system:String>
|
||||
<system:String x:Key="install">İndir</system:String>
|
||||
<system:String x:Key="installbtn">İndir</system:String>
|
||||
|
||||
<!-- Setting Theme -->
|
||||
<system:String x:Key="theme">Temalar</system:String>
|
||||
|
|
|
|||
|
|
@ -77,13 +77,13 @@
|
|||
<system:String x:Key="plugin_query_time">Запит:</system:String>
|
||||
<system:String x:Key="plugin_query_version">| Версія</system:String>
|
||||
<system:String x:Key="plugin_query_web">Сайт</system:String>
|
||||
<system:String x:Key="plugin_uninstall">Uninstall</system:String>
|
||||
<system:String x:Key="uninstallbtn">Uninstall</system:String>
|
||||
|
||||
|
||||
<!-- Setting Plugin Store -->
|
||||
<system:String x:Key="pluginStore">Магазин плагінів</system:String>
|
||||
<system:String x:Key="refresh">Оновити</system:String>
|
||||
<system:String x:Key="install">Встановити</system:String>
|
||||
<system:String x:Key="installbtn">Встановити</system:String>
|
||||
|
||||
<!-- Setting Theme -->
|
||||
<system:String x:Key="theme">Тема</system:String>
|
||||
|
|
|
|||
|
|
@ -77,13 +77,13 @@
|
|||
<system:String x:Key="plugin_query_time">查询耗时:</system:String>
|
||||
<system:String x:Key="plugin_query_version">| 版本</system:String>
|
||||
<system:String x:Key="plugin_query_web">官方网站</system:String>
|
||||
<system:String x:Key="plugin_uninstall">卸载</system:String>
|
||||
<system:String x:Key="uninstallbtn">卸载</system:String>
|
||||
|
||||
|
||||
<!-- Setting Plugin Store -->
|
||||
<system:String x:Key="pluginStore">插件商店</system:String>
|
||||
<system:String x:Key="refresh">刷新</system:String>
|
||||
<system:String x:Key="install">安装</system:String>
|
||||
<system:String x:Key="installbtn">安装</system:String>
|
||||
|
||||
<!-- Setting Theme -->
|
||||
<system:String x:Key="theme">主题</system:String>
|
||||
|
|
|
|||
|
|
@ -77,13 +77,13 @@
|
|||
<system:String x:Key="plugin_query_time">查詢耗時:</system:String>
|
||||
<system:String x:Key="plugin_query_version">| 版本</system:String>
|
||||
<system:String x:Key="plugin_query_web">官方網站</system:String>
|
||||
<system:String x:Key="plugin_uninstall">解除安裝</system:String>
|
||||
<system:String x:Key="uninstallbtn">解除安裝</system:String>
|
||||
|
||||
|
||||
<!-- Setting Plugin Store -->
|
||||
<system:String x:Key="pluginStore">外掛商店</system:String>
|
||||
<system:String x:Key="refresh">重新整理</system:String>
|
||||
<system:String x:Key="install">安裝</system:String>
|
||||
<system:String x:Key="installbtn">安裝</system:String>
|
||||
|
||||
<!-- Setting Theme -->
|
||||
<system:String x:Key="theme">主題</system:String>
|
||||
|
|
|
|||
|
|
@ -40,6 +40,8 @@
|
|||
|
||||
<Window.Resources>
|
||||
<converters:BorderClipConverter x:Key="BorderClipConverter" />
|
||||
<converters:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter" />
|
||||
<converters:TextConverter x:Key="TextConverter" />
|
||||
<CollectionViewSource x:Key="SortedFonts" Source="{Binding Source={x:Static Fonts.SystemFontFamilies}}">
|
||||
<CollectionViewSource.SortDescriptions>
|
||||
<scm:SortDescription PropertyName="Source" />
|
||||
|
|
@ -1330,7 +1332,7 @@
|
|||
FontSize="11"
|
||||
Foreground="{DynamicResource PluginInfoColor}"
|
||||
MouseUp="OnExternalPluginUninstallClick"
|
||||
Text="{DynamicResource plugin_uninstall}"
|
||||
Text="{DynamicResource uninstallbtn}"
|
||||
TextDecorations="Underline" />
|
||||
|
||||
<TextBlock
|
||||
|
|
@ -1477,6 +1479,32 @@
|
|||
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
|
||||
SelectionMode="Single"
|
||||
Style="{DynamicResource StoreListStyle}">
|
||||
<ListBox.GroupStyle>
|
||||
<GroupStyle>
|
||||
<GroupStyle.ContainerStyle>
|
||||
<Style TargetType="{x:Type GroupItem}">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate>
|
||||
<Grid>
|
||||
<StackPanel Orientation="Vertical">
|
||||
<TextBlock
|
||||
Margin="0,0,0,10"
|
||||
VerticalAlignment="Top"
|
||||
FontSize="16"
|
||||
FontWeight="Bold"
|
||||
Text="{Binding Name, Converter={StaticResource TextConverter}}" />
|
||||
<ItemsPresenter />
|
||||
</StackPanel>
|
||||
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</GroupStyle.ContainerStyle>
|
||||
</GroupStyle>
|
||||
</ListBox.GroupStyle>
|
||||
<ListBox.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<UniformGrid
|
||||
|
|
@ -1533,33 +1561,16 @@
|
|||
HorizontalAlignment="Right"
|
||||
Orientation="Horizontal">
|
||||
<Border
|
||||
x:Name="LabelNew"
|
||||
x:Name="LabelUpdate"
|
||||
Height="12"
|
||||
Margin="0,10,8,0"
|
||||
Padding="6,2,6,2"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Top"
|
||||
Background="#f14551"
|
||||
CornerRadius="4"
|
||||
Visibility="Collapsed">
|
||||
<TextBlock
|
||||
FontSize="11"
|
||||
Foreground="White"
|
||||
Text="New" />
|
||||
</Border>
|
||||
<Border
|
||||
x:Name="Labelinstalled"
|
||||
Margin="0,10,8,0"
|
||||
Padding="6,2,6,2"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Top"
|
||||
Background="{DynamicResource ToggleSwitchFillOn}"
|
||||
CornerRadius="4"
|
||||
Visibility="Collapsed">
|
||||
<TextBlock
|
||||
FontSize="11"
|
||||
Foreground="White"
|
||||
Text="Installed" />
|
||||
</Border>
|
||||
Background="#45BD59"
|
||||
CornerRadius="36"
|
||||
ToolTip="{DynamicResource LabelUpdateToolTip}"
|
||||
Visibility="{Binding LabelUpdate, Converter={StaticResource BoolToVisibilityConverter}}" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel
|
||||
|
|
@ -1618,7 +1629,7 @@
|
|||
<Run
|
||||
FontSize="12"
|
||||
Foreground="{DynamicResource Color04B}"
|
||||
Text="{Binding Description}" />
|
||||
Text="{Binding Description, Mode=OneWay}" />
|
||||
</TextBlock>
|
||||
|
||||
</StackPanel>
|
||||
|
|
@ -1680,25 +1691,45 @@
|
|||
Foreground="{DynamicResource Color04B}"
|
||||
NavigateUri="{Binding Website}"
|
||||
RequestNavigate="OnRequestNavigate">
|
||||
<Run FontSize="12" Text="{Binding Author}" />
|
||||
<Run FontSize="12" Text="{Binding Author, Mode=OneWay}" />
|
||||
</Hyperlink>
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
<Border
|
||||
Grid.Row="0"
|
||||
Grid.Column="1"
|
||||
Padding="0,0,0,0">
|
||||
<Button
|
||||
Name="ShortCutButtonPrev"
|
||||
MinHeight="40"
|
||||
<Grid Grid.Row="0" Grid.Column="1">
|
||||
<StackPanel
|
||||
Margin="0,70,20,0"
|
||||
Padding="15,5,15,5"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Click="OnExternalPluginInstallClick"
|
||||
Content="{DynamicResource install}" />
|
||||
</Border>
|
||||
Orientation="Horizontal">
|
||||
<Button
|
||||
MinHeight="40"
|
||||
Padding="15,5,15,5"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Click="OnExternalPluginInstallClick"
|
||||
Content="{DynamicResource installbtn}"
|
||||
Visibility="{Binding LabelInstalled, Converter={StaticResource BoolToVisibilityConverter}, ConverterParameter='!'}" />
|
||||
<Button
|
||||
MinHeight="40"
|
||||
Margin="5,0,0,0"
|
||||
Padding="15,5,15,5"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Click="OnExternalPluginUninstallClick"
|
||||
Content="{DynamicResource uninstallbtn}"
|
||||
Visibility="{Binding LabelInstalled, Converter={StaticResource BoolToVisibilityConverter}}" />
|
||||
<Button
|
||||
MinHeight="40"
|
||||
Margin="5,0,0,0"
|
||||
Padding="15,5,15,5"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Click="OnExternalPluginUpdateClick"
|
||||
Content="{DynamicResource updatebtn}"
|
||||
Visibility="{Binding LabelUpdate, Converter={StaticResource BoolToVisibilityConverter}}" />
|
||||
<!-- Hide Install Button when installed Item -->
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
|
|
|||
|
|
@ -47,6 +47,10 @@ namespace Flow.Launcher
|
|||
API = api;
|
||||
InitializePosition();
|
||||
InitializeComponent();
|
||||
|
||||
CollectionView view = (CollectionView)CollectionViewSource.GetDefaultView(StoreListBox.ItemsSource);
|
||||
PropertyGroupDescription groupDescription = new PropertyGroupDescription("Category");
|
||||
view.GroupDescriptions.Add(groupDescription);
|
||||
}
|
||||
|
||||
#region General
|
||||
|
|
@ -306,15 +310,34 @@ namespace Flow.Launcher
|
|||
|
||||
private void OnExternalPluginInstallClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (sender is Button { DataContext: UserPlugin plugin })
|
||||
if (sender is Button { DataContext: PluginStoreItemViewModel plugin })
|
||||
{
|
||||
var pluginsManagerPlugin = PluginManager.GetPluginForId("9f8f9b14-2518-4907-b211-35ab6290dee7");
|
||||
var actionKeyword = pluginsManagerPlugin.Metadata.ActionKeywords.Count == 0 ? "" : pluginsManagerPlugin.Metadata.ActionKeywords[0];
|
||||
API.ChangeQuery($"{actionKeyword} install {plugin.Name}");
|
||||
API.ShowMainWindow();
|
||||
viewModel.DisplayPluginQuery($"install {plugin.Name}", PluginManager.GetPluginForId("9f8f9b14-2518-4907-b211-35ab6290dee7"));
|
||||
}
|
||||
}
|
||||
|
||||
private void OnExternalPluginUninstallClick(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (e.ChangedButton == MouseButton.Left)
|
||||
{
|
||||
var name = viewModel.SelectedPlugin.PluginPair.Metadata.Name;
|
||||
viewModel.DisplayPluginQuery($"uninstall {name}", PluginManager.GetPluginForId("9f8f9b14-2518-4907-b211-35ab6290dee7"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void OnExternalPluginUninstallClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (sender is Button { DataContext: PluginStoreItemViewModel plugin })
|
||||
viewModel.DisplayPluginQuery($"uninstall {plugin.Name}", PluginManager.GetPluginForId("9f8f9b14-2518-4907-b211-35ab6290dee7"));
|
||||
}
|
||||
|
||||
private void OnExternalPluginUpdateClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (sender is Button { DataContext: PluginStoreItemViewModel plugin })
|
||||
viewModel.DisplayPluginQuery($"update {plugin.Name}", PluginManager.GetPluginForId("9f8f9b14-2518-4907-b211-35ab6290dee7"));
|
||||
}
|
||||
|
||||
private void window_MouseDown(object sender, MouseButtonEventArgs e) /* for close hotkey popup */
|
||||
{
|
||||
if (Keyboard.FocusedElement is not TextBox textBox)
|
||||
|
|
@ -388,7 +411,7 @@ namespace Flow.Launcher
|
|||
{
|
||||
if (string.IsNullOrEmpty(pluginStoreFilterTxb.Text))
|
||||
return true;
|
||||
if (item is UserPlugin model)
|
||||
if (item is PluginStoreItemViewModel model)
|
||||
{
|
||||
return StringMatcher.FuzzySearch(pluginStoreFilterTxb.Text, model.Name).IsSearchPrecisionScoreMet()
|
||||
|| StringMatcher.FuzzySearch(pluginStoreFilterTxb.Text, model.Description).IsSearchPrecisionScoreMet();
|
||||
|
|
@ -473,17 +496,6 @@ namespace Flow.Launcher
|
|||
var top = (dip2.Y - this.ActualHeight) / 2 + dip1.Y - 20;
|
||||
return top;
|
||||
}
|
||||
private void OnExternalPluginUninstallClick(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (e.ChangedButton == MouseButton.Left)
|
||||
{
|
||||
var id = viewModel.SelectedPlugin.PluginPair.Metadata.Name;
|
||||
var pluginsManagerPlugin = PluginManager.GetPluginForId("9f8f9b14-2518-4907-b211-35ab6290dee7");
|
||||
var actionKeyword = pluginsManagerPlugin.Metadata.ActionKeywords.Count == 0 ? "" : pluginsManagerPlugin.Metadata.ActionKeywords[0];
|
||||
API.ChangeQuery($"{actionKeyword} uninstall {id}");
|
||||
API.ShowMainWindow();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
58
Flow.Launcher/ViewModel/PluginStoreItemViewModel.cs
Normal file
58
Flow.Launcher/ViewModel/PluginStoreItemViewModel.cs
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
using System;
|
||||
using Flow.Launcher.Core.ExternalPlugins;
|
||||
using Flow.Launcher.Core.Plugin;
|
||||
using Flow.Launcher.Plugin;
|
||||
|
||||
namespace Flow.Launcher.ViewModel
|
||||
{
|
||||
public class PluginStoreItemViewModel : BaseModel
|
||||
{
|
||||
public PluginStoreItemViewModel(UserPlugin plugin)
|
||||
{
|
||||
_plugin = plugin;
|
||||
}
|
||||
|
||||
private UserPlugin _plugin;
|
||||
|
||||
public string ID => _plugin.ID;
|
||||
public string Name => _plugin.Name;
|
||||
public string Description => _plugin.Description;
|
||||
public string Author => _plugin.Author;
|
||||
public string Version => _plugin.Version;
|
||||
public string Language => _plugin.Language;
|
||||
public string Website => _plugin.Website;
|
||||
public string UrlDownload => _plugin.UrlDownload;
|
||||
public string UrlSourceCode => _plugin.UrlSourceCode;
|
||||
public string IcoPath => _plugin.IcoPath;
|
||||
|
||||
public bool LabelInstalled => PluginManager.GetPluginForId(_plugin.ID) != null;
|
||||
public bool LabelUpdate => LabelInstalled && _plugin.Version != PluginManager.GetPluginForId(_plugin.ID).Metadata.Version;
|
||||
|
||||
internal const string None = "None";
|
||||
internal const string RecentlyUpdated = "RecentlyUpdated";
|
||||
internal const string NewRelease = "NewRelease";
|
||||
internal const string Installed = "Installed";
|
||||
|
||||
public string Category
|
||||
{
|
||||
get
|
||||
{
|
||||
string category = None;
|
||||
if (DateTime.Now - _plugin.LatestReleaseDate < TimeSpan.FromDays(7))
|
||||
{
|
||||
category = RecentlyUpdated;
|
||||
}
|
||||
if (DateTime.Now - _plugin.DateAdded < TimeSpan.FromDays(7))
|
||||
{
|
||||
category = NewRelease;
|
||||
}
|
||||
if (PluginManager.GetPluginForId(_plugin.ID) != null)
|
||||
{
|
||||
category = Installed;
|
||||
}
|
||||
|
||||
return category;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -281,14 +281,24 @@ namespace Flow.Launcher.ViewModel
|
|||
}
|
||||
}
|
||||
|
||||
public IList<UserPlugin> ExternalPlugins
|
||||
public IList<PluginStoreItemViewModel> ExternalPlugins
|
||||
{
|
||||
get
|
||||
{
|
||||
return PluginsManifest.UserPlugins;
|
||||
return LabelMaker(PluginsManifest.UserPlugins);
|
||||
}
|
||||
}
|
||||
|
||||
private IList<PluginStoreItemViewModel> LabelMaker(IList<UserPlugin> list)
|
||||
{
|
||||
return list.Select(p=>new PluginStoreItemViewModel(p))
|
||||
.OrderByDescending(p => p.Category == PluginStoreItemViewModel.NewRelease)
|
||||
.ThenByDescending(p=>p.Category == PluginStoreItemViewModel.RecentlyUpdated)
|
||||
.ThenByDescending(p => p.Category == PluginStoreItemViewModel.None)
|
||||
.ThenByDescending(p => p.Category == PluginStoreItemViewModel.Installed)
|
||||
.ToList();
|
||||
}
|
||||
|
||||
public Control SettingProvider
|
||||
{
|
||||
get
|
||||
|
|
@ -314,6 +324,15 @@ namespace Flow.Launcher.ViewModel
|
|||
OnPropertyChanged(nameof(ExternalPlugins));
|
||||
}
|
||||
|
||||
internal void DisplayPluginQuery(string queryToDisplay, PluginPair plugin, int actionKeywordPosition = 0)
|
||||
{
|
||||
var actionKeyword = plugin.Metadata.ActionKeywords.Count == 0
|
||||
? string.Empty
|
||||
: plugin.Metadata.ActionKeywords[actionKeywordPosition];
|
||||
|
||||
App.API.ChangeQuery($"{actionKeyword} {queryToDisplay}");
|
||||
App.API.ShowMainWindow();
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
|
|
|||
Loading…
Reference in a new issue