Skip to content

Commit dc192b9

Browse files
committed
Merge pull request #1097 from Hosch250/BugBlipper
Remove todo priorities
2 parents a39cda5 + b4c7371 commit dc192b9

File tree

14 files changed

+31
-223
lines changed

14 files changed

+31
-223
lines changed

RetailCoder.VBE/Rubberduck.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -771,7 +771,6 @@
771771
<Compile Include="Inspections\OptionExplicitInspectionResult.cs" />
772772
<Compile Include="Inspections\VariableTypeNotDeclaredInspection.cs" />
773773
<Compile Include="Inspections\VariableTypeNotDeclaredInspectionResult.cs" />
774-
<Compile Include="ToDoItems\TodoPriority.cs" />
775774
<Compile Include="UI\AboutWindow.cs">
776775
<SubType>Form</SubType>
777776
</Compile>

RetailCoder.VBE/Settings/ConfigurationLoader.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,9 @@ private GeneralSettings GetDefaultGeneralSettings()
146146

147147
public ToDoMarker[] GetDefaultTodoMarkers()
148148
{
149-
var note = new ToDoMarker(RubberduckUI.TodoMarkerNote, TodoPriority.Low);
150-
var todo = new ToDoMarker(RubberduckUI.TodoMarkerTodo, TodoPriority.Medium);
151-
var bug = new ToDoMarker(RubberduckUI.TodoMarkerBug, TodoPriority.High);
149+
var note = new ToDoMarker(RubberduckUI.TodoMarkerNote);
150+
var todo = new ToDoMarker(RubberduckUI.TodoMarkerTodo);
151+
var bug = new ToDoMarker(RubberduckUI.TodoMarkerBug);
152152

153153
return new[] { note, todo, bug };
154154
}
Lines changed: 16 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
using System;
22
using System.Xml.Serialization;
3-
using Rubberduck.ToDoItems;
4-
using Rubberduck.UI;
53

64
namespace Rubberduck.Settings
75
{
86
public interface IToDoMarker
97
{
10-
TodoPriority Priority { get; set; }
118
string Text { get; set; }
129
}
1310

@@ -17,37 +14,25 @@ public class ToDoMarker : IToDoMarker
1714
//either the code can be properly case, or the XML can be, but the xml attributes must here *exactly* match the xml
1815
[XmlAttribute]
1916
public string Text { get; set; }
20-
21-
[XmlAttribute]
22-
public TodoPriority Priority { get; set; }
23-
17+
18+
[Obsolete]
2419
[XmlIgnore]
25-
public string PriorityLabel
26-
{
27-
get { return RubberduckUI.ResourceManager.GetString("ToDoPriority_" + Priority, RubberduckUI.Culture); }
28-
set
29-
{
30-
foreach (var priority in Enum.GetValues(typeof(TodoPriority)))
31-
{
32-
if (value == RubberduckUI.ResourceManager.GetString("ToDoPriority_" + priority, RubberduckUI.Culture))
33-
{
34-
Priority = (TodoPriority)priority;
35-
return;
36-
}
37-
}
38-
}
39-
}
40-
20+
public TodoPriority Priority { get; set; }
21+
4122
/// <summary> Default constructor is required for serialization. DO NOT USE. </summary>
4223
public ToDoMarker()
4324
{
4425
// default constructor required for serialization
4526
}
4627

47-
public ToDoMarker(string text, TodoPriority priority)
28+
public ToDoMarker(string text)
4829
{
4930
Text = text;
50-
Priority = priority;
31+
}
32+
33+
[Obsolete]
34+
public ToDoMarker(string text, TodoPriority priority) : this(text)
35+
{
5136
}
5237

5338
/// <summary> Convert this object into a string representation. Over-riden for easy databinding.</summary>
@@ -63,14 +48,17 @@ public override bool Equals(object obj)
6348

6449
if (other == null) { return false; }
6550

66-
// no need to check PriorityLabel as it soley relies on Priority - if one is wrong, the other has to be too
67-
return Text == other.Text &&
68-
Priority == other.Priority;
51+
return Text == other.Text;
6952
}
7053

7154
public override int GetHashCode()
7255
{
7356
return Text.GetHashCode();
7457
}
7558
}
59+
60+
public enum TodoPriority
61+
{
62+
Low, Medium, High
63+
}
7664
}

RetailCoder.VBE/ToDoItems/ToDoItem.cs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@ namespace Rubberduck.ToDoItems
1212
/// </summary>
1313
public class ToDoItem : INavigateSource
1414
{
15-
private readonly TodoPriority _priority;
16-
public TodoPriority Priority { get { return _priority; } }
17-
18-
public string PriorityLabel { get { return RubberduckUI.ResourceManager.GetString("ToDoPriority_" + Priority, RubberduckUI.Culture); } }
19-
2015
private readonly string _description;
2116
public string Description { get { return _description; } }
2217

@@ -35,14 +30,13 @@ public class ToDoItem : INavigateSource
3530
private readonly QualifiedSelection _selection;
3631
public QualifiedSelection GetSelection() { return _selection; }
3732

38-
public ToDoItem(string markerText, TodoPriority priority, CommentNode comment)
39-
: this(markerText, priority, comment.CommentText, comment.QualifiedSelection)
33+
public ToDoItem(string markerText, CommentNode comment)
34+
: this(markerText, comment.CommentText, comment.QualifiedSelection)
4035
{
4136
}
4237

43-
public ToDoItem(string markerText, TodoPriority priority, string description, QualifiedSelection qualifiedSelection)
38+
public ToDoItem(string markerText, string description, QualifiedSelection qualifiedSelection)
4439
{
45-
_priority = priority;
4640
_description = description;
4741
_selection = qualifiedSelection;
4842
_projectName = qualifiedSelection.QualifiedName.ProjectName;

RetailCoder.VBE/ToDoItems/TodoPriority.cs

Lines changed: 0 additions & 9 deletions
This file was deleted.

RetailCoder.VBE/UI/Controls/GroupingGrid.xaml

Lines changed: 2 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
</LinearGradientBrush>
1919
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightTextBrushKey}" Color="Black" />
2020
<SolidColorBrush x:Key="{x:Static SystemColors.ControlTextBrushKey}" Color="Black" />
21-
21+
2222
<Style x:Key="PrettifyRow" TargetType="{x:Type DataGridRow}">
2323
<Style.Resources>
2424
<Style TargetType="{x:Type Border}">
@@ -52,82 +52,6 @@
5252
</MultiTrigger>
5353
</Style.Triggers>
5454
</Style>
55-
<SolidColorBrush x:Key="ToolBarHorizontalBackground" Color="#FFEEF5FD"/>
56-
<SolidColorBrush x:Key="ToolBarToggleButtonVerticalBackground" Color="#FFEEF5FD"/>
57-
<SolidColorBrush x:Key="ToolBarButtonHover" Color="#210080FF"/>
58-
<SolidColorBrush x:Key="ToolBarGripper" Color="#FF6D6D6D"/>
59-
<Style x:Key="ToolBarVerticalOverflowButtonStyle" TargetType="{x:Type ToggleButton}">
60-
<Setter Property="Background" Value="{StaticResource ToolBarToggleButtonVerticalBackground}"/>
61-
<Setter Property="MinHeight" Value="0"/>
62-
<Setter Property="MinWidth" Value="0"/>
63-
<Setter Property="Template">
64-
<Setter.Value>
65-
<ControlTemplate TargetType="{x:Type ToggleButton}">
66-
<Border x:Name="Bd" SnapsToDevicePixels="true" CornerRadius="0,0,3,3" Background="{TemplateBinding Background}">
67-
<Canvas Width="7" VerticalAlignment="Bottom" SnapsToDevicePixels="true" Margin="2,7,2,2" Height="6" HorizontalAlignment="Right">
68-
<Path Data="M 1.5 1 L 1.5 6" Stroke="White"/>
69-
<Path Data="M 0.5 0 L 0.5 5" Stroke="{TemplateBinding Foreground}"/>
70-
<Path Data="M 3.5 0.5 L 7 3.5 L 4 6.5 Z" Fill="White"/>
71-
<Path Data="M 3 -0.5 L 6 2.5 L 3 5.5 Z" Fill="{TemplateBinding Foreground}"/>
72-
</Canvas>
73-
</Border>
74-
<ControlTemplate.Triggers>
75-
<Trigger Property="IsMouseOver" Value="true">
76-
<Setter Property="Background" TargetName="Bd" Value="{StaticResource ToolBarButtonHover}"/>
77-
</Trigger>
78-
<Trigger Property="IsKeyboardFocused" Value="true">
79-
<Setter Property="Background" TargetName="Bd" Value="{StaticResource ToolBarButtonHover}"/>
80-
</Trigger>
81-
<Trigger Property="IsEnabled" Value="false">
82-
<Setter Property="Foreground" Value="{StaticResource ToolBarGripper}"/>
83-
</Trigger>
84-
</ControlTemplate.Triggers>
85-
</ControlTemplate>
86-
</Setter.Value>
87-
</Setter>
88-
<Style.Triggers>
89-
<DataTrigger Binding="{Binding Source={x:Static SystemParameters.HighContrast}}" Value="true">
90-
<Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
91-
</DataTrigger>
92-
</Style.Triggers>
93-
</Style>
94-
<SolidColorBrush x:Key="ToolBarVerticalBackground" Color="#FFEEF5FD"/>
95-
<SolidColorBrush x:Key="ToolBarToggleButtonHorizontalBackground" Color="#FFEEF5FD"/>
96-
<Style x:Key="ToolBarHorizontalOverflowButtonStyle" TargetType="{x:Type ToggleButton}">
97-
<Setter Property="Background" Value="{StaticResource ToolBarToggleButtonHorizontalBackground}"/>
98-
<Setter Property="MinHeight" Value="0"/>
99-
<Setter Property="MinWidth" Value="0"/>
100-
<Setter Property="Template">
101-
<Setter.Value>
102-
<ControlTemplate TargetType="{x:Type ToggleButton}">
103-
<Border x:Name="Bd" SnapsToDevicePixels="true" CornerRadius="0,3,3,0" Background="{TemplateBinding Background}">
104-
<Canvas Width="6" VerticalAlignment="Bottom" SnapsToDevicePixels="true" Margin="7,2,2,2" Height="7" HorizontalAlignment="Right">
105-
<Path Data="M 1 1.5 L 6 1.5" Stroke="White"/>
106-
<Path Data="M 0 0.5 L 5 0.5" Stroke="{TemplateBinding Foreground}"/>
107-
<Path Data="M 0.5 4 L 6.5 4 L 3.5 7 Z" Fill="White"/>
108-
<Path Data="M -0.5 3 L 5.5 3 L 2.5 6 Z" Fill="{TemplateBinding Foreground}"/>
109-
</Canvas>
110-
</Border>
111-
<ControlTemplate.Triggers>
112-
<Trigger Property="IsMouseOver" Value="true">
113-
<Setter Property="Background" TargetName="Bd" Value="{StaticResource ToolBarButtonHover}"/>
114-
</Trigger>
115-
<Trigger Property="IsKeyboardFocused" Value="true">
116-
<Setter Property="Background" TargetName="Bd" Value="{StaticResource ToolBarButtonHover}"/>
117-
</Trigger>
118-
<Trigger Property="IsEnabled" Value="false">
119-
<Setter Property="Foreground" Value="{StaticResource ToolBarGripper}"/>
120-
</Trigger>
121-
</ControlTemplate.Triggers>
122-
</ControlTemplate>
123-
</Setter.Value>
124-
</Setter>
125-
<Style.Triggers>
126-
<DataTrigger Binding="{Binding Source={x:Static SystemParameters.HighContrast}}" Value="true">
127-
<Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
128-
</DataTrigger>
129-
</Style.Triggers>
130-
</Style>
13155

13256
<Style TargetType="{x:Type DataGridColumnHeadersPresenter}">
13357
<Setter Property="Margin" Value="25,0,0,0" />
@@ -191,6 +115,7 @@
191115
<Setter Property="Background" Value="Transparent" />
192116
<Setter Property="Padding" Value="0" />
193117
<Setter Property="VerticalContentAlignment" Value="Stretch" />
118+
<Setter Property="VerticalAlignment" Value="Center" />
194119
</Style>
195120
</DataGrid.CellStyle>
196121
</DataGrid>

RetailCoder.VBE/UI/RubberduckUI.Designer.cs

Lines changed: 0 additions & 54 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

RetailCoder.VBE/UI/RubberduckUI.resx

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -609,9 +609,6 @@ Warning: All customized settings will be lost. Your old file will be saved in '
609609
<data name="_TypeNotDeclared_" xml:space="preserve">
610610
<value>{0} '{1}' is implicitly Variant</value>
611611
</data>
612-
<data name="Priority" xml:space="preserve">
613-
<value>Priority</value>
614-
</data>
615612
<data name="Component" xml:space="preserve">
616613
<value>Component</value>
617614
</data>
@@ -801,9 +798,6 @@ Warning: All customized settings will be lost. Your old file will be saved in '
801798
<data name="Settings_Caption" xml:space="preserve">
802799
<value>Rubberduck Settings</value>
803800
</data>
804-
<data name="TodoSettings_PriorityLabel" xml:space="preserve">
805-
<value>Priority:</value>
806-
</data>
807801
<data name="TodoSettings_TokenLabel" xml:space="preserve">
808802
<value>Token Text:</value>
809803
</data>
@@ -1072,15 +1066,6 @@ Are you sure you want to proceed with this rename?</value>
10721066
<data name="SourceControl_NoRepoFound" xml:space="preserve">
10731067
<value>No repository found.</value>
10741068
</data>
1075-
<data name="TodoPriority_High" xml:space="preserve">
1076-
<value>High</value>
1077-
</data>
1078-
<data name="TodoPriority_Low" xml:space="preserve">
1079-
<value>Low</value>
1080-
</data>
1081-
<data name="TodoPriority_Medium" xml:space="preserve">
1082-
<value>Medium</value>
1083-
</data>
10841069
<data name="SourceControl_SuccessfulMerge" xml:space="preserve">
10851070
<value>Successfully Merged {0} into {1}</value>
10861071
</data>
@@ -1109,9 +1094,6 @@ Are you sure you want to proceed with this rename?</value>
11091094
<data name="TodoSettings_TextLabel" xml:space="preserve">
11101095
<value>Text:</value>
11111096
</data>
1112-
<data name="TodoSettings_Priority" xml:space="preserve">
1113-
<value>Priority</value>
1114-
</data>
11151097
<data name="TodoSettings_Text" xml:space="preserve">
11161098
<value>Text</value>
11171099
</data>

RetailCoder.VBE/UI/Settings/InspectionSettings.xaml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,6 @@
4949
HorizontalGridLinesBrush="Transparent" VerticalGridLinesBrush="Transparent"
5050
HeadersVisibility="None" ScrollViewer.HorizontalScrollBarVisibility="Disabled"
5151
ColumnHeaderHeight="22" BorderThickness="0">
52-
<controls:GroupingGrid.CellStyle>
53-
<Style TargetType="{x:Type DataGridCell}">
54-
<Setter Property="BorderThickness" Value="0" />
55-
<Setter Property="VerticalAlignment" Value="Center" />
56-
<Setter Property="Background" Value="Transparent" />
57-
</Style>
58-
</controls:GroupingGrid.CellStyle>
5952
<controls:GroupingGrid.Columns>
6053
<DataGridTemplateColumn Header="{Resx ResxName=Rubberduck.UI.RubberduckUI, Key=NameLabelText}" Width="2.75*" IsReadOnly="True">
6154
<DataGridTemplateColumn.CellTemplate>

0 commit comments

Comments
 (0)