diff --git a/src/BreCalClient/BreCalClient.csproj b/src/BreCalClient/BreCalClient.csproj
index af9a231..4c4c0a8 100644
--- a/src/BreCalClient/BreCalClient.csproj
+++ b/src/BreCalClient/BreCalClient.csproj
@@ -34,6 +34,8 @@
+
+
@@ -87,6 +89,8 @@
+
+
diff --git a/src/BreCalClient/EditTimesControl.xaml b/src/BreCalClient/EditTimesControl.xaml
index 64d9b1b..57d22c1 100644
--- a/src/BreCalClient/EditTimesControl.xaml
+++ b/src/BreCalClient/EditTimesControl.xaml
@@ -24,6 +24,9 @@
+
diff --git a/src/BreCalClient/EditTimesControl.xaml.cs b/src/BreCalClient/EditTimesControl.xaml.cs
index 8f4c633..82fb1e8 100644
--- a/src/BreCalClient/EditTimesControl.xaml.cs
+++ b/src/BreCalClient/EditTimesControl.xaml.cs
@@ -4,7 +4,9 @@
//
using BreCalClient.misc.Model;
+using System;
using System.Windows;
+using System.Windows.Media.Imaging;
namespace BreCalClient
{
@@ -52,6 +54,14 @@ namespace BreCalClient
this.Close();
}
+ private void buttonFixedOrder_Click(object sender, RoutedEventArgs e)
+ {
+ bool newValue = true;
+ if (this.Times.EtaBerthFixed ?? false)
+ newValue = false;
+ SetLockButton(newValue);
+ }
+
#endregion
#region private methods
@@ -87,13 +97,19 @@ namespace BreCalClient
this.labelETD.FontWeight = FontWeights.Bold;
this.datePickerETDBerth.ContextMenu.IsEnabled = false;
break;
- }
+ }
+
+ this.SetLockButton(this.Times.EtaBerthFixed ?? false);
}
private void EnableControls()
{
Extensions.ParticipantType pType = (Extensions.ParticipantType) this.Times.ParticipantType;
- if (this.Times.ParticipantId != App.Participant.Id) return; // if this is not "my" entry, there is no editing!
+ if (this.Times.ParticipantId != App.Participant.Id)
+ {
+ this.buttonFixedOrder.IsEnabled = false;
+ return; // if this is not "my" entry, there is no editing!
+ }
switch (pType)
{
@@ -117,6 +133,20 @@ namespace BreCalClient
this.buttonOK.IsEnabled = true;
}
+ private void SetLockButton(bool newValue)
+ {
+ if (newValue)
+ {
+ this.Times.EtaBerthFixed = true;
+ this.imageFixedOrder.Source = new BitmapImage(new Uri(@"pack://application:,,,/Resources/lock.png", UriKind.RelativeOrAbsolute));
+ }
+ else
+ {
+ this.Times.EtaBerthFixed = false;
+ this.imageFixedOrder.Source = new BitmapImage(new Uri(@"pack://application:,,,/Resources/lock_open.png", UriKind.RelativeOrAbsolute));
+ }
+ }
+
#endregion
#region clear value event handler
@@ -139,9 +169,10 @@ namespace BreCalClient
private void contextMenuItemClearZoneEntry_Click(object sender, RoutedEventArgs e)
{
this.datePickerZoneEntry.Value = null;
- }
+ }
#endregion
+
}
}
diff --git a/src/BreCalClient/Resources/Resources.Designer.cs b/src/BreCalClient/Resources/Resources.Designer.cs
index e403743..723dc6b 100644
--- a/src/BreCalClient/Resources/Resources.Designer.cs
+++ b/src/BreCalClient/Resources/Resources.Designer.cs
@@ -60,6 +60,16 @@ namespace BreCalClient.Resources {
}
}
+ ///
+ /// Looks up a localized resource of type System.Byte[].
+ ///
+ public static byte[] _lock {
+ get {
+ object obj = ResourceManager.GetObject("_lock", resourceCulture);
+ return ((byte[])(obj));
+ }
+ }
+
///
/// Looks up a localized resource of type System.Byte[].
///
@@ -210,6 +220,16 @@ namespace BreCalClient.Resources {
}
}
+ ///
+ /// Looks up a localized resource of type System.Byte[].
+ ///
+ public static byte[] lock_open {
+ get {
+ object obj = ResourceManager.GetObject("lock_open", resourceCulture);
+ return ((byte[])(obj));
+ }
+ }
+
///
/// Looks up a localized resource of type System.Byte[].
///
diff --git a/src/BreCalClient/Resources/Resources.resx b/src/BreCalClient/Resources/Resources.resx
index 9a3fc62..fccba54 100644
--- a/src/BreCalClient/Resources/Resources.resx
+++ b/src/BreCalClient/Resources/Resources.resx
@@ -163,6 +163,9 @@
emergency_stop_button.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+ lock_open.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
logo_bremen_calling.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
@@ -496,4 +499,7 @@
worker2.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+ lock.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
\ No newline at end of file
diff --git a/src/BreCalClient/Resources/lock.png b/src/BreCalClient/Resources/lock.png
new file mode 100644
index 0000000..23b14b2
Binary files /dev/null and b/src/BreCalClient/Resources/lock.png differ
diff --git a/src/BreCalClient/Resources/lock_open.png b/src/BreCalClient/Resources/lock_open.png
new file mode 100644
index 0000000..3051af3
Binary files /dev/null and b/src/BreCalClient/Resources/lock_open.png differ