Skip to content

Commit c72dbfe

Browse files
committed
Chore: Add ReadOnly Mode
1 parent d443420 commit c72dbfe

File tree

4 files changed

+88
-98
lines changed

4 files changed

+88
-98
lines changed

Source/NETworkManager.Localization/Resources/Strings.Designer.cs

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

Source/NETworkManager.Localization/Resources/Strings.resx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2392,7 +2392,7 @@ $$hostname$$ --&gt; Hostname</value>
23922392
<value>Restart as Administrator</value>
23932393
</data>
23942394
<data name="NetworkPacketsCaptureAdminMessage" xml:space="preserve">
2395-
<value>To analyze network packets, the application must be started with elevated rights!</value>
2395+
<value>Analysing network packets requires elevated rights!</value>
23962396
</data>
23972397
<data name="Capture" xml:space="preserve">
23982398
<value>Capture</value>
@@ -3886,7 +3886,7 @@ Right-click for more options.</value>
38863886
<value>Hosts File Editor</value>
38873887
</data>
38883888
<data name="HostsFileEditorAdminMessage" xml:space="preserve">
3889-
<value>To edit the hosts file, the application must be started with elevated rights!</value>
3889+
<value>Read-only mode. Modifying the hosts file requires elevated rights!</value>
38903890
</data>
38913891
<data name="Comment" xml:space="preserve">
38923892
<value>Comment</value>

Source/NETworkManager/Views/DiscoveryProtocolView.xaml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -271,30 +271,39 @@
271271
</StackPanel>
272272
</Grid>
273273
</Grid>
274-
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Center"
274+
<Grid Background="{DynamicResource MahApps.Brushes.Gray10}"
275+
Visibility="{Binding Source={x:Static settings:ConfigurationManager.Current}, Path=IsAdmin, Converter={StaticResource BooleanReverseToVisibilityCollapsedConverter}}">
276+
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Center"
275277
Visibility="{Binding Source={x:Static settings:ConfigurationManager.Current}, Path=IsAdmin, Converter={StaticResource BooleanReverseToVisibilityCollapsedConverter}}">
276278
<TextBlock Text="{x:Static localization:Strings.NetworkPacketsCaptureAdminMessage}"
277-
Style="{StaticResource MessageTextBlock}" Margin="0,0,0,10" />
278-
<Button Command="{Binding RestartAsAdminCommand}" HorizontalAlignment="Center"
279+
Style="{StaticResource MessageTextBlock}"
280+
Margin="0,0,0,10" />
281+
<Button Command="{Binding RestartAsAdminCommand}"
282+
HorizontalAlignment="Center"
279283
Style="{StaticResource ImageWithTextButton}">
280284
<Button.Content>
281285
<Grid>
282286
<Grid.ColumnDefinitions>
283287
<ColumnDefinition Width="Auto" />
284288
<ColumnDefinition Width="*" />
285289
</Grid.ColumnDefinitions>
286-
<Rectangle Width="20" Height="20" Margin="10,5,0,5"
290+
<Rectangle Width="20" Height="20"
291+
Margin="10,5,0,5"
287292
Fill="{DynamicResource MahApps.Brushes.Gray3}">
288293
<Rectangle.OpacityMask>
289294
<VisualBrush Stretch="Uniform" Visual="{iconPacks:Material Kind=Shield}" />
290295
</Rectangle.OpacityMask>
291296
</Rectangle>
292-
<TextBlock Grid.Column="1" Text="{x:Static localization:Strings.RestartAsAdmin}"
293-
FontSize="14" Margin="10,5" TextAlignment="Center" />
297+
<TextBlock Grid.Column="1" Grid.Row="0"
298+
Text="{x:Static localization:Strings.RestartAsAdmin}"
299+
FontSize="14"
300+
Margin="10,5"
301+
TextAlignment="Center" />
294302
</Grid>
295303
</Button.Content>
296304
</Button>
297305
</StackPanel>
306+
</Grid>
298307
</Grid>
299308
</TabItem>
300309
</TabControl>

0 commit comments

Comments
 (0)