Skip to content

Commit

Permalink
Add tray button to rescan all folders
Browse files Browse the repository at this point in the history
Fixes #465
  • Loading branch information
canton7 committed Jul 22, 2018
1 parent dd60b82 commit e836132
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/SyncTrayzor/NotifyIcon/NotifyIconViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,12 @@ public void Restart()
this.syncthingManager.RestartAsync();
}

public bool CanRescanAll => this.SyncthingState == SyncthingState.Running;
public void RescanAll()
{
this.syncthingManager.ScanAsync(null, null);
}

public void Exit()
{
this.OnExitRequested();
Expand Down
3 changes: 2 additions & 1 deletion src/SyncTrayzor/NotifyIcon/TaskbarIconResources.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@
</Style>
</MenuItem.ItemContainerStyle>
</MenuItem>
<Separator Visibility="{Binding Folders, Converter={x:Static s:BoolToVisibilityConverter.Instance}}"/>
<MenuItem Header="{l:Loc TrayIcon_Menu_RescanAllFolders}" Command="{s:Action RescanAll, ActionNotFound=Disable}"/>
<Separator/>

<MenuItem Header="{l:Loc TrayIcon_Menu_StartSyncthing}" Command="{s:Action Start, ActionNotFound=Disable}"/>
<MenuItem Header="{l:Loc TrayIcon_Menu_StopSyncthing}" Command="{s:Action Stop, ActionNotFound=Disable}"/>
Expand Down
9 changes: 9 additions & 0 deletions src/SyncTrayzor/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/SyncTrayzor/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -991,4 +991,8 @@ Please donate to my charity fundraising campaign.</value>
<data name="SettingsView_SyncthingCustomPath" xml:space="preserve">
<value>Syncthing Custom Path</value>
</data>
<data name="TrayIcon_Menu_RescanAllFolders" xml:space="preserve">
<value>_Rescan All Folders</value>
<comment>Menu option available when right-clicking the tray icon. Allows the user to re-scan all folders</comment>
</data>
</root>

0 comments on commit e836132

Please sign in to comment.