Skip to content

Commit 5af526d

Browse files
committed
Add restart notification
1 parent 4be3803 commit 5af526d

File tree

5 files changed

+31
-13
lines changed

5 files changed

+31
-13
lines changed

src/Flow.Launcher.Plugin.ClipboardPlus.Panels/ViewModels/SettingsViewModel.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,8 @@ public bool ActionTop
267267

268268
#region Sync Windows Clipboard History
269269

270+
public bool SyncWindowsClipboardHistoryEnabled => !Settings.UseWindowsClipboardHistoryOnly;
271+
270272
public bool SyncWindowsClipboardHistory
271273
{
272274
get => Settings.SyncWindowsClipboardHistory;
@@ -314,6 +316,12 @@ public bool UseWindowsClipboardHistoryOnly
314316
}
315317
Settings.UseWindowsClipboardHistoryOnly = value;
316318
OnPropertyChanged();
319+
OnPropertyChanged(nameof(SyncWindowsClipboardHistoryEnabled));
320+
MessageBox.Show(Context?.API.GetTranslation("flowlauncher_plugin_clipboardplus_restart_text") ?? "Restart is required for this option to take effect",
321+
Context?.API.GetTranslation("flowlauncher_plugin_clipboardplus_restart_caption") ?? "Restart",
322+
MessageBoxButton.OK,
323+
MessageBoxImage.Warning);
324+
Context?.API.RestartApp();
317325
}
318326
}
319327

src/Flow.Launcher.Plugin.ClipboardPlus.Panels/Views/SettingsPanel.xaml

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -116,16 +116,27 @@
116116
IsChecked="{Binding ActionTop, Mode=TwoWay}" />
117117

118118
<!-- Sync Windows Clipboard History -->
119-
<StackPanel
119+
<CheckBox
120120
Grid.Row="5"
121121
Grid.ColumnSpan="2"
122122
Margin="10,5,5,5"
123+
VerticalAlignment="Center"
124+
Content="{DynamicResource flowlauncher_plugin_clipboardplus_sync_windows_clipboard_history}"
125+
IsChecked="{Binding SyncWindowsClipboardHistory, Mode=TwoWay}"
126+
IsEnabled="{Binding SyncWindowsClipboardHistoryEnabled, Mode=OneWay}"
127+
Visibility="{Binding SyncWindowsClipboardHistoryVisibility, Mode=OneTime}" />
128+
129+
<!-- Use Windows Clipboard History Only -->
130+
<StackPanel
131+
Grid.Row="6"
132+
Grid.ColumnSpan="2"
133+
Margin="10,5,5,5"
123134
Orientation="Horizontal"
124135
Visibility="{Binding SyncWindowsClipboardHistoryVisibility, Mode=OneTime}">
125136
<CheckBox
126137
VerticalAlignment="Center"
127-
Content="{DynamicResource flowlauncher_plugin_clipboardplus_sync_windows_clipboard_history}"
128-
IsChecked="{Binding SyncWindowsClipboardHistory, Mode=TwoWay}" />
138+
Content="{DynamicResource flowlauncher_plugin_clipboardplus_use_windows_clipboard_history_only}"
139+
IsChecked="{Binding UseWindowsClipboardHistoryOnly, Mode=TwoWay}" />
129140
<Button
130141
Margin="5,0,0,0"
131142
HorizontalAlignment="Left"
@@ -134,16 +145,6 @@
134145
Content="{DynamicResource flowlauncher_plugin_clipboardplus_open_windows_clipboard_settings}" />
135146
</StackPanel>
136147

137-
<!-- Use Windows Clipboard History Only -->
138-
<CheckBox
139-
Grid.Row="6"
140-
Grid.ColumnSpan="2"
141-
Margin="10,5,5,5"
142-
VerticalAlignment="Center"
143-
Content="{DynamicResource flowlauncher_plugin_clipboardplus_use_windows_clipboard_history_only}"
144-
IsChecked="{Binding UseWindowsClipboardHistoryOnly, Mode=TwoWay}"
145-
Visibility="{Binding SyncWindowsClipboardHistoryVisibility, Mode=OneTime}" />
146-
147148
<!-- Seperator -->
148149
<Separator
149150
Grid.Row="7"

src/Flow.Launcher.Plugin.ClipboardPlus/Languages/en.xaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,9 @@
9898
<system:String x:Key="flowlauncher_plugin_clipboardplus_use_windows_clipboard_history_only_caption">Are you sure you want to enable this option?</system:String>
9999
<system:String x:Key="flowlauncher_plugin_clipboardplus_use_windows_clipboard_history_only_text">If you enable this option, query records will fully match the Windows clipboard history. Records from the database will no longer be loaded, and records cannot be saved to the database.</system:String>
100100

101+
<system:String x:Key="flowlauncher_plugin_clipboardplus_restart_caption">Restart</system:String>
102+
<system:String x:Key="flowlauncher_plugin_clipboardplus_restart_text">Restart is required for this option to take effect</system:String>
103+
101104
<system:String x:Key="flowlauncher_plugin_clipboardplus_click_action">Record click action:</system:String>
102105
<system:String x:Key="flowlauncher_plugin_clipboardplus_default_rich_text_copy_option">Rich text default:</system:String>
103106
<system:String x:Key="flowlauncher_plugin_clipboardplus_default_image_copy_option">Image default:</system:String>

src/Flow.Launcher.Plugin.ClipboardPlus/Languages/zh-cn.xaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,9 @@
9898
<system:String x:Key="flowlauncher_plugin_clipboardplus_use_windows_clipboard_history_only_caption">你确定要启用这个选项吗?</system:String>
9999
<system:String x:Key="flowlauncher_plugin_clipboardplus_use_windows_clipboard_history_only_text">如果你启用了这个选项,查询记录将与Windows剪切板历史完全一致。数据库中的记录将不会加载,且记录无法被保存到数据库。</system:String>
100100

101+
<system:String x:Key="flowlauncher_plugin_clipboardplus_restart_caption">重启</system:String>
102+
<system:String x:Key="flowlauncher_plugin_clipboardplus_restart_text">需要重启使该选项生效</system:String>
103+
101104
<system:String x:Key="flowlauncher_plugin_clipboardplus_click_action">记录点击动作:</system:String>
102105
<system:String x:Key="flowlauncher_plugin_clipboardplus_default_rich_text_copy_option">富文本默认:</system:String>
103106
<system:String x:Key="flowlauncher_plugin_clipboardplus_default_image_copy_option">图片默认:</system:String>

src/Flow.Launcher.Plugin.ClipboardPlus/Languages/zh-tw.xaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,9 @@
9898
<system:String x:Key="flowlauncher_plugin_clipboardplus_use_windows_clipboard_history_only_caption">你確定要啓用這個選項嗎?</system:String>
9999
<system:String x:Key="flowlauncher_plugin_clipboardplus_use_windows_clipboard_history_only_text">如果你啓用了這個選項,查詢記錄將與Windows剪切板歷史完全一致。數據庫中的記錄將不會加載,且記錄無法被保存到數據庫。</system:String>
100100

101+
<system:String x:Key="flowlauncher_plugin_clipboardplus_restart_caption">重啓</system:String>
102+
<system:String x:Key="flowlauncher_plugin_clipboardplus_restart_text">需要重啓使該選項生效</system:String>
103+
101104
<system:String x:Key="flowlauncher_plugin_clipboardplus_click_action">記録點擊働作:</system:String>
102105
<system:String x:Key="flowlauncher_plugin_clipboardplus_default_rich_text_copy_option">富文本默認:</system:String>
103106
<system:String x:Key="flowlauncher_plugin_clipboardplus_default_image_copy_option">圖片默認:</system:String>

0 commit comments

Comments
 (0)