Skip to content

Commit

Permalink
Show an error message when Chrome tabs time out
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Rondeau committed Sep 2, 2014
1 parent 4b8b717 commit 79b4a5f
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 3 deletions.
3 changes: 2 additions & 1 deletion GoToWindow.Extensibility/Controls/BasicListEntry.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
</Grid.ColumnDefinitions>
<Image Grid.Column="0" Source="{Binding Path=Icon}" Margin="8,8,8,8" />
<TextBlock Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Center" Margin="8,0,8,0" TextTrimming="CharacterEllipsis" Foreground="Gray" Text="{Binding Path=ProcessName}" />
<TextBlock Grid.Column="2" HorizontalAlignment="Stretch" VerticalAlignment="Center" Margin="8,0,8,0" TextTrimming="CharacterEllipsis" Text="{Binding Path=Title}" />
<TextBlock Grid.Column="2" HorizontalAlignment="Stretch" VerticalAlignment="Center" Margin="8,0,8,0" TextTrimming="CharacterEllipsis" Text="{Binding Path=Title}" />
<TextBlock Grid.Column="2" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="16,2,2,2" TextTrimming="CharacterEllipsis" Text="{Binding Path=Error}" Foreground="Red" FontSize="8" />
</Grid>
</UserControl>
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ public class DesignTimeSearchResult : IBasicSearchResult
public BitmapFrame Icon { get; private set; }
public string Title { get; private set; }
public string ProcessName { get; private set; }
public string Error { get; set; }

public DesignTimeSearchResult()
: this(null, "process", "Window Title")
Expand Down
1 change: 1 addition & 0 deletions GoToWindow.Extensibility/ViewModel/IBasicSearchResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ public interface IBasicSearchResult : ISearchResult
BitmapFrame Icon { get; }
string Title { get; }
string ProcessName { get; }
string Error { get; }
}
}
3 changes: 2 additions & 1 deletion GoToWindow.Extensibility/ViewModel/IWindowSearchResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

namespace GoToWindow.Extensibility.ViewModel
{
public interface IWindowSearchResult : ISearchResult, IBasicSearchResult
public interface IWindowSearchResult : IBasicSearchResult
{
new string Error { get; set; }
IntPtr HWnd { get; }
}
}
1 change: 1 addition & 0 deletions GoToWindow.Extensibility/ViewModel/SearchResultBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ namespace GoToWindow.Extensibility.ViewModel
{
public abstract class SearchResultBase
{
public string Error { get; set; }
private readonly Func<UserControl> _viewCtor;
private UserControl _view;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ public void BuildList(List<ISearchResult> list)

if (!task.Wait(TimeoutMilliseconds, token))
{
item.Error = "* Error: Timeout trying to get tabs";
Log.WarnFormat("Timeout trying to get tabs for '{0}'", browserName);
continue;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public class ExplorerWindowSearchResult : IWindowSearchResult
public BitmapFrame Icon { get { return _window.Icon; } }
public string Title { get { return _path; } }
public string ProcessName { get { return _window.ProcessName; } }
public string Error { get { return _window.Error; } set { _window.Error = value; } }
public IntPtr HWnd { get { return _window.HWnd; } }

public bool IsShown(string searchQuery)
Expand Down
2 changes: 1 addition & 1 deletion GoToWindow/ViewModels/DesignTimeMainViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public DesignTimeMainViewModel()
{
new DesignTimeSearchResult(icon, "process", "Window Title"),
new DesignTimeSearchResult(icon, "very long process name", "Very very long window title that should end up with ellipsis because it is so very long"),
new DesignTimeSearchResult(icon, "filler", "Some Window Title"),
new DesignTimeSearchResult(icon, "error", "This window has an error") { Error = "This is the error message" },
new DesignTimeSearchResult(icon, "filler", "Some Window Title"),
new DesignTimeSearchResult(icon, "filler", "Some Window Title"),
new DesignTimeSearchResult(icon, "filler", "Some Window Title"),
Expand Down

0 comments on commit 79b4a5f

Please sign in to comment.