Skip to content

Commit dcee5a1

Browse files
Merge b9228b4 into 4530139
2 parents 4530139 + b9228b4 commit dcee5a1

File tree

6 files changed

+39
-4
lines changed

6 files changed

+39
-4
lines changed

src/Papercut.UI/App.config

+3
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@
5252
<setting name="MessagePaths" serializeAs="String">
5353
<value>%ApplicationData%\Changemaker Studios\Papercut SMTP;%ApplicationData%\Papercut;%BaseDirectory%\Incoming;%DataDirectory%\Incoming</value>
5454
</setting>
55+
<setting name="ShowNotifications" serializeAs="String">
56+
<value>True</value>
57+
</setting>
5558
</Papercut.Properties.Settings>
5659
</userSettings>
5760
<runtime>

src/Papercut.UI/AppLayer/UiCommands/UiCommandHub.cs

+5-2
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,11 @@ public void ShowOptionWindow()
6868

6969
public void ShowBalloonTip(int timeout, string tipTitle, string tipText, ToolTipIcon toolTipIcon)
7070
{
71-
var command = new ShowBalloonTipCommand(timeout, tipTitle, tipText, toolTipIcon);
72-
this._onShowBalloonTip.OnNext(command);
71+
if (Papercut.Properties.Settings.Default.ShowNotifications)
72+
{
73+
var command = new ShowBalloonTipCommand(timeout, tipTitle, tipText, toolTipIcon);
74+
this._onShowBalloonTip.OnNext(command);
75+
}
7376
}
7477

7578
protected override void Dispose(bool disposing)

src/Papercut.UI/Properties/Settings.Designer.cs

+13-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Papercut.UI/Properties/Settings.settings

+3
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,8 @@
4444
<Setting Name="MessagePaths" Type="System.String" Scope="User">
4545
<Value Profile="(Default)">%ApplicationData%\Changemaker Studios\Papercut SMTP;%ApplicationData%\Papercut;%BaseDirectory%\Incoming;%DataDirectory%\Incoming</Value>
4646
</Setting>
47+
<Setting Name="ShowNotifications" Type="System.Boolean" Scope="User">
48+
<Value Profile="(Default)">True</Value>
49+
</Setting>
4750
</Settings>
4851
</SettingsFile>

src/Papercut.UI/ViewModels/OptionsViewModel.cs

+12
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ public class OptionsViewModel : Screen
6464
private ThemeColor _themeColor;
6565

6666
string _windowTitle = WindowTitleDefault;
67+
68+
private bool _showNotifications;
6769

6870
public OptionsViewModel(IMessageBus messageBus, ThemeColorRepository themeColorRepository)
6971
{
@@ -155,6 +157,16 @@ public bool MinimizeToTray
155157
}
156158
}
157159

160+
public bool ShowNotifications
161+
{
162+
get => this._showNotifications;
163+
set
164+
{
165+
this._showNotifications = value;
166+
this.NotifyOfPropertyChange(() => this.ShowNotifications);
167+
}
168+
}
169+
158170
public bool StartMinimized
159171
{
160172
get => this._startMinimized;

src/Papercut.UI/Views/OptionsView.xaml

+3-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
xmlns:behaviours="http://metro.mahapps.com/winfx/xaml/shared"
1212
mc:Ignorable="d"
1313
d:DataContext="{x:Type ViewModels:OptionsViewModel}"
14-
Title="{Binding WindowTitle}" Width="313" Height="290" Icon="/Papercut;component/App.ico"
14+
Title="{Binding WindowTitle}" Width="313" Height="310" Icon="/Papercut;component/App.ico"
1515
WindowStyle="ToolWindow"
1616
ResizeMode="NoResize"
1717
ShowIconOnTitleBar="false" WindowStartupLocation="CenterOwner"
@@ -36,6 +36,7 @@
3636
<RowDefinition Height="Auto" />
3737
<RowDefinition Height="Auto" />
3838
<RowDefinition Height="Auto" />
39+
<RowDefinition Height="Auto" />
3940
</Grid.RowDefinitions>
4041
<Label Grid.Column="0" Grid.Row="0" Margin="0,2,0,29" Grid.RowSpan="2">IP Address:</Label>
4142
<Label Grid.Column="0" Grid.Row="1" Margin="0,2,10,0" Grid.RowSpan="3">Port:</Label>
@@ -48,6 +49,7 @@
4849
<CheckBox Grid.Column="1" Grid.Row="4" Margin="5,0,5,-116" Name="RunOnStartup" VerticalAlignment="Bottom"
4950
Content="Run on startup" Grid.ColumnSpan="2" Height="18" />
5051
<CheckBox Grid.Row="4" Margin="5,0,5,-47" Name="StartMinimized" VerticalAlignment="Bottom" Grid.ColumnSpan="2" Height="18" Grid.Column="1">Start minimized</CheckBox>
52+
<CheckBox Grid.Row="5" Margin="5,0,5,-139" Name="ShowNotifications" VerticalAlignment="Bottom" Grid.ColumnSpan="2" Height="18" Grid.Column="1">Show Notifications</CheckBox>
5153
<CheckBox Grid.Column="1" Grid.Row="4" Margin="5,0,5,-93" Name="MinimizeOnClose" VerticalAlignment="Bottom" Grid.ColumnSpan="2" Height="18">Minimize on close</CheckBox>
5254
<ComboBox Grid.Column="1" Grid.Row="4" Margin="2.4,2.6,0,7.4"
5355
x:Name="SortOrders" SelectedItem="{Binding MessageListSortOrder}" HorizontalAlignment="Left" Width="170" Grid.ColumnSpan="2">

0 commit comments

Comments
 (0)