Changeset 2372


Ignore:
Timestamp:
Jan 18, 2011, 2:54:16 PM (10 years ago)
Author:
kopal
Message:

some small fixes

Location:
trunk/CrypPlugins/P2PEditor/GUI
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrypPlugins/P2PEditor/GUI/Controls/ConnectView.xaml

    r2348 r2372  
    1 <GUI:P2PUserControl x:Class="Cryptool.P2PEditor.GUI.Controls.ConnectTab" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:GUI="clr-namespace:Cryptool.P2PEditor.GUI" xmlns:Converters="clr-namespace:Cryptool.P2PEditor.Converters" mc:Ignorable="d" d:DesignHeight="650" d:DesignWidth="360" IsVisibleChanged="P2PUserControl_IsVisibleChanged">
     1<GUI:P2PUserControl x:Class="Cryptool.P2PEditor.GUI.Controls.ConnectTab" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:GUI="clr-namespace:Cryptool.P2PEditor.GUI" xmlns:Converters="clr-namespace:Cryptool.P2PEditor.Converters" mc:Ignorable="d" d:DesignHeight="550" d:DesignWidth="360" IsVisibleChanged="P2PUserControl_IsVisibleChanged">
    22        <GUI:P2PUserControl.Resources>
    33                <Converters:InverseBooleanConverter x:Key="InverseBooleanConverter" />
     
    88        <Grid>
    99        <ScrollViewer VerticalScrollBarVisibility="Auto">
    10                     <StackPanel VerticalAlignment="Center" HorizontalAlignment="Center" Margin="80,55,80,53">
     10                    <StackPanel VerticalAlignment="Center" HorizontalAlignment="Center" Margin="15,15,15,15">
    1111                <Label FontSize="20" HorizontalContentAlignment="Center">CrypTool 2.0</Label>
    1212                <Label FontSize="13" HorizontalContentAlignment="Center">Distributed Computing Platform</Label>               
     
    2020                <Label>Password:</Label>
    2121                <PasswordBox Name="Password" PasswordChanged="Password_PasswordChanged" IsEnabled="{Binding IsP2PConnecting, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}, Converter={StaticResource InverseBooleanConverter}}" />
    22                 <Label>Worldname:</Label>
    23                 <TextBox Name="Worldname" TextChanged="Worldname_TextChanged" IsEnabled="{Binding IsP2PConnecting, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}, Converter={StaticResource InverseBooleanConverter}}" />
    2422                <Label/>
    2523                <Button Name="ConnectButton" IsDefault="True" Content="Connect" Height="38" FontFamily="Consolas" FontSize="20" Click="ConnectButtonClick" IsEnabled="{Binding IsP2PConnecting, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}, Converter={StaticResource InverseBooleanConverter}}" />
  • trunk/CrypPlugins/P2PEditor/GUI/Controls/ConnectView.xaml.cs

    r2371 r2372  
    100100        }
    101101
    102         private void Worldname_TextChanged(object sender, System.Windows.Controls.TextChangedEventArgs e)
    103         {
    104             ((P2PEditorSettings)((P2PEditor)GetValue(P2PEditorProperty)).Settings).WorldName = this.Worldname.Text;
    105         }
    106 
    107102        private void Password_PasswordChanged(object sender, RoutedEventArgs e)
    108103        {
     
    111106
    112107        private void P2PUserControl_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
    113         {
    114             if (this.Visibility == System.Windows.Visibility.Visible)
     108        {           
     109            this.Username.Text = ((P2PEditorSettings)((P2PEditor)GetValue(P2PEditorProperty)).Settings).PeerName;
     110            this.Password.Password = ((P2PEditorSettings)((P2PEditor)GetValue(P2PEditorProperty)).Settings).Password;
     111            if (this.IsP2PConnecting)
    115112            {
    116                 this.Username.Text = ((P2PEditorSettings)((P2PEditor)GetValue(P2PEditorProperty)).Settings).PeerName;
    117                 this.Worldname.Text = ((P2PEditorSettings)((P2PEditor)GetValue(P2PEditorProperty)).Settings).WorldName;
    118                 this.Password.Password = ((P2PEditorSettings)((P2PEditor)GetValue(P2PEditorProperty)).Settings).Password;
    119                 if (this.IsP2PConnecting)
    120                 {
    121                     Storyboard storyboard = (Storyboard)FindResource("AnimateBigWorldIcon");
    122                     storyboard.Begin();
    123                 }
    124                 else
    125                 {
    126                     Storyboard storyboard = (Storyboard)FindResource("AnimateBigWorldIcon");
    127                     storyboard.Stop();
    128                 }
     113                Storyboard storyboard = (Storyboard)FindResource("AnimateBigWorldIcon");
     114                storyboard.Begin();
     115            }
     116            else
     117            {
     118                Storyboard storyboard = (Storyboard)FindResource("AnimateBigWorldIcon");
     119                storyboard.Stop();
    129120            }
    130121        }
  • trunk/CrypPlugins/P2PEditor/GUI/Controls/GetNewCertificateView.xaml.cs

    r2347 r2372  
    176176                {                   
    177177                    ((P2PEditorPresentation)((P2PEditor)GetValue(P2PEditorProperty)).Presentation).Connect.Username.Text = this.UsernameField.Text;
    178                     ((P2PEditorPresentation)((P2PEditor)GetValue(P2PEditorProperty)).Presentation).Connect.Worldname.Text = "CrypTool2";
    179178                    ((P2PEditorPresentation)((P2PEditor)GetValue(P2PEditorProperty)).Presentation).Connect.Password.Password = this.PasswordField.Password;
    180179                    this.UsernameField.Text = "";
  • trunk/CrypPlugins/P2PEditor/GUI/P2PEditorPresentation.xaml

    r2358 r2372  
    66                    <controls:JobDisplay x:Name="JobDisplay" Jobs="{Binding Jobs, ElementName=P2PEditorControl}" Visibility="Hidden"/>
    77            <controls:JobCreation x:Name="JobCreation" Visibility="Hidden"/>
    8             <controls:ConnectTab x:Name="Connect" IsP2PConnecting="{Binding IsP2PConnecting, ElementName=P2PEditorControl}" />
     8            <controls:ConnectTab x:Name="Connect" IsP2PConnecting="{Binding IsP2PConnecting, ElementName=P2PEditorControl}" Visibility="Hidden" />
    99            <controls:GetNewCertificate x:Name="GetNewCertificate" Visibility="Hidden"/>
    1010            <Frame Name="Help" Source="../DetailedDescription/Description.xaml" Visibility="Hidden"/>           
  • trunk/CrypPlugins/P2PEditor/GUI/P2PEditorPresentation.xaml.cs

    r2358 r2372  
    7575            this.JobCreation.P2PEditorPresentation = this;
    7676            this.JobDisplay.P2PEditorPresentation = this;
     77
     78            if (this.IsP2PConnecting || !this.IsP2PConnected)
     79            {
     80                Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(ShowConnectView));
     81            }
     82            else
     83            {
     84                Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(ShowActiveJobsView));
     85            }
    7786        }
    7887
     
    146155            hideAllViews();
    147156            this.JobDisplay.Visibility = Visibility.Visible;
    148             UpdateDisplay();           
     157            UpdateDisplay();
    149158        }
    150159
     
    152161        {
    153162            hideAllViews();
    154             this.Connect.Visibility = Visibility.Visible;            
     163            this.Connect.Visibility = Visibility.Visible;         
    155164        }
    156165
     
    164173            if (this.IsP2PConnecting || !this.IsP2PConnected)
    165174            {
    166                 Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(ShowConnectView));               
     175                Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(ShowConnectView));
     176            }
     177            else
     178            {
     179                Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(ShowActiveJobsView));
    167180            }
    168181        }
Note: See TracChangeset for help on using the changeset viewer.