solve some issues
authorStricted <info@stricted.de>
Mon, 25 Jan 2016 03:42:32 +0000 (04:42 +0100)
committerStricted <info@stricted.de>
Mon, 25 Jan 2016 03:42:32 +0000 (04:42 +0100)
SpeedportHybridControl.Implementations/util.cs
SpeedportHybridControl/Data/SpeedportHybrid.cs
SpeedportHybridControl/PageModel/AboutPageModel.cs
SpeedportHybridControl/PageModel/LoginPageModel.cs
SpeedportHybridControl/PageModel/LteInfoModel.cs
SpeedportHybridControl/PageModel/ltepopupModel.cs
SpeedportHybridControl/page/LoginPage.xaml

index 4187db91e968a221dc22a8b65bb3fc4dd466dfcb..a3c814e65564f317a801092fc0ee9d82df0a097d 100644 (file)
@@ -131,7 +131,7 @@ namespace SpeedportHybridControl.Implementations
             {
                 return Brushes.Red;
             }
-            else if (rsrp >= -126)
+            else if (rsrp <= -126)
             {
                 return Brushes.DarkRed;
             }
index 329aded46e62acbbe00d7cf562cb14951338e08d..e13da8e808c31844627a6a85ea63416697695a31 100644 (file)
@@ -282,9 +282,7 @@ namespace SpeedportHybridControl.Data
                         }
                     }
                 }
-
-                // overview.days_online = ""; // TODO
-
+                
                 overview.datetime = time.ToString(format);
 
                 jArray = null;
index e68e40350e525bebfcc68574181df5962cc3b9bc..aff67ba7acaf99e82310ace563f9d4531d94fc19 100644 (file)
@@ -43,7 +43,7 @@ namespace SpeedportHybridControl.PageModel
 
         private void OnBugtrackerCommandExecute()
         {
-            Process.Start("https://stricted.net/bugtracker/index.php/ProductList/");
+            Process.Start("https://bugtracker.stricted.net/index.php/ProductList/");
         }
 
         private void OnUpdateCommandExecute()
index 513eb4c85a405edd174cc97a244a31f212e12967..c61b5a7e362008dbd155f8076b47b9b07b3c85c0 100644 (file)
@@ -19,7 +19,6 @@ namespace SpeedportHybridControl.PageModel
         private Visibility _loginFieldsVisibility = Visibility.Visible;
 
         private DelegateCommand _showPasswordCommand;
-        private DelegateCommand _savePasswordCommand;
         private DelegateCommand _loginCommand;
 
         public string ip
@@ -31,7 +30,16 @@ namespace SpeedportHybridControl.PageModel
         public string password
         {
             get { return _password; }
-            set { SetProperty(ref _password, value); }
+            set {
+                // TODO: find a better way
+                if (value.IsNullOrEmpty().Equals(true))
+                {
+                    if (SavePassword.Equals(true))
+                        return;
+
+                }
+                SetProperty(ref _password, value);
+            }
         }
 
         public string LoginButtonText
@@ -76,12 +84,6 @@ namespace SpeedportHybridControl.PageModel
             set { SetProperty(ref _showPasswordCommand, value); }
         }
 
-        public DelegateCommand SavePasswordCommand
-        {
-            get { return _savePasswordCommand; }
-            set { SetProperty(ref _savePasswordCommand, value); }
-        }
-
         public DelegateCommand LoginCommand
         {
             get { return _loginCommand; }
@@ -101,11 +103,6 @@ namespace SpeedportHybridControl.PageModel
             }
         }
 
-        private void OnSavePasswordCommandExecute()
-        {
-            Console.WriteLine(SavePassword);
-        }
-
         private void OnLoginCommandExecute()
         {
             MainWindowModel mwm = Application.Current.FindResource("MainWindowModel") as MainWindowModel;
@@ -139,6 +136,7 @@ namespace SpeedportHybridControl.PageModel
 
                         Settings.save(SettingsModel);
                     }
+
                     LoginFieldsVisibility = Visibility.Hidden;
                     mwm.ButtonOverviewPageIsActive = true;
                     mwm.ButtonDSLPageIsActive = true;
@@ -161,7 +159,6 @@ namespace SpeedportHybridControl.PageModel
             else {
                 if (SpeedportHybridAPI.getInstance().logout().Equals(true))
                 {
-                    // TODO: util.logout();
                     LogoutAction();
                 }
             }
@@ -169,6 +166,13 @@ namespace SpeedportHybridControl.PageModel
 
         public void LogoutAction()
         {
+            LteInfoModel lim = Application.Current.FindResource("LteInfoModel") as LteInfoModel;
+            lim.ClosePopup();
+            lim.StopTimer();
+
+            DslPageModel dpm = Application.Current.FindResource("DslPageModel") as DslPageModel;
+            dpm.StopTimer();
+            
             MainWindowModel mwm = Application.Current.FindResource("MainWindowModel") as MainWindowModel;
             LoginFieldsVisibility = Visibility.Visible;
             mwm.ButtonOverviewPageIsActive = false;
@@ -202,7 +206,6 @@ namespace SpeedportHybridControl.PageModel
             }
 
             ShowPasswordCommand = new DelegateCommand(new Action(OnShowPasswordCommandExecute));
-            SavePasswordCommand = new DelegateCommand(new Action(OnSavePasswordCommandExecute));
             LoginCommand = new DelegateCommand(new Action(OnLoginCommandExecute));
         }
     }
index 8948eb0b002d76588d1ae4de6f9e0146f287ea6d..9ec35515597df93d032e452e3a2e411ad4debafc 100644 (file)
@@ -244,6 +244,17 @@ namespace SpeedportHybridControl.PageModel
             set { SetProperty(ref _frequenz, value); }
         }
 
+        public void ClosePopup()
+        {
+            ltepopupModel lm = Application.Current.FindResource("ltepopupModel") as ltepopupModel;
+            lm.StopTimer();
+            if (Object.Equals(_ltepopup, null).Equals(false))
+            {
+                _ltepopup.Close();
+                _ltepopup = null;
+            }
+        }
+
         public LteInfoModel()
         {
             ReloadCommand = new DelegateCommand(new Action(OnReloadCommandExecute));
index 803daad08fa757377542bb15d97d012bb5476711..7466736ff249c7ee7e1f7d05fdf5c7b1e27c3638 100644 (file)
@@ -154,6 +154,8 @@ namespace SpeedportHybridControl.PageModel
 
         public void StartTimer()
         {
+            StopTimer();
+
             _timer = new System.Timers.Timer
             {
                 Interval = 1000, // every second
index e6c9d7c3918f597d0cbe93416ab0882bebb164ff..33b14fcda86e481169d8cae6a075845ce6c7b26f 100644 (file)
@@ -16,9 +16,9 @@
 
             <TextBlock Text="Passwort:" HorizontalAlignment="Left" Margin="55,49,0,0" VerticalAlignment="Top" />
             <PasswordBox Implementations:PasswordHelper.BindPassword="true" Implementations:PasswordHelper.BoundPassword="{Binding Path=password, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"  Visibility="{Binding Path=PasswordBoxVisibility}" x:Name="passwordBox" HorizontalAlignment="Left" Height="23" Margin="115,42,0,0" VerticalAlignment="Top" Width="120" ForceCursor="True" />
-            <TextBox Text="{Binding Path=password, Mode=TwoWay}" HorizontalAlignment="Left" Height="23" Margin="115,42,0,0" VerticalAlignment="Top" Width="120" Visibility="{Binding Path=PasswordTextBoxVisibility}"/>
+            <TextBox Text="{Binding Path=password}" HorizontalAlignment="Left" Height="23" Margin="115,42,0,0" VerticalAlignment="Top" Width="120" Visibility="{Binding Path=PasswordTextBoxVisibility}"/>
             <CheckBox Command="{Binding Path=ShowPasswordCommand}" IsChecked="{Binding Path=ShowPassword, Mode=TwoWay}" Content="Passwort anzeigen" Margin="240,50,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" />
-            <CheckBox Command="{Binding Path=SavePasswordCommand}" IsChecked="{Binding Path=SavePassword, Mode=TwoWay}" Content="Passwort speichern" Margin="240,65,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" />
+            <CheckBox IsChecked="{Binding Path=SavePassword, Mode=TwoWay}" Content="Passwort speichern" Margin="240,65,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" />
         </Grid>
         <Button Command="{Binding Path=LoginCommand}" Content="{Binding Path=LoginButtonText}" HorizontalAlignment="Left" Margin="115,70,0,0" VerticalAlignment="Top" Width="75" IsDefault="True"/>
     </Grid>