Ignore:
Timestamp:
Sep 11, 2010, 5:10:41 PM (11 years ago)
Author:
Paul Lelgemann
Message:

o KeySearcher: fixed "+unendlich years" as estimated finish date display bug
o P2PEditor: fixed behavior of new button without p2p connection and participate button with not job selected
o P2PEditor: minor refactoring, removed unused code and classes

Location:
trunk/CrypPlugins/P2PEditor/GUI/Controls
Files:
3 edited

Legend:

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

    r1619 r1917  
    55namespace Cryptool.P2PEditor.GUI.Controls
    66{
    7     /// <summary>
    8     /// Interaction logic for ConnectTab.xaml
    9     /// </summary>
    107    public partial class ConnectTab
    118    {
     
    2825        }
    2926
    30         private void ConnectButtonClick(object sender, System.Windows.RoutedEventArgs e)
     27        private void ConnectButtonClick(object sender, RoutedEventArgs e)
    3128        {
    3229            if (!P2PManager.IsConnected)
    33             {
    3430                P2PManager.Connect();
    35             }
    3631
    3732            ((P2PEditorPresentation) P2PEditor.Presentation).UpdateConnectionState();
  • trunk/CrypPlugins/P2PEditor/GUI/Controls/JobDisplay.xaml

    r1727 r1917  
    1515        <DockPanel Name="mainPane">
    1616            <Grid Background="White">
    17                 <ListBox x:Name="JobListBox" HorizontalContentAlignment="Stretch" ItemsSource="{Binding Jobs, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}" ItemTemplate="{StaticResource jobDisplayTemplate}" Style="{StaticResource jobListDisplayStyle}" KeyUp="JobListBox_KeyUp" Margin="0,0,0,35">
     17                <ListBox x:Name="JobListBox" HorizontalContentAlignment="Stretch" ItemsSource="{Binding Jobs, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}" ItemTemplate="{StaticResource jobDisplayTemplate}" Style="{StaticResource jobListDisplayStyle}" KeyUp="JobListBoxKeyUp" Margin="0,0,0,35">
    1818                    <ListBox.ItemContainerStyle>
    1919                        <Style TargetType="{x:Type ListBoxItem}">
     
    2323                </ListBox>
    2424                <Grid DataContext="{Binding SelectedItem,ElementName=JobListBox}">
    25                     <Button Content="Participate" HorizontalAlignment="Right" Margin="0,0,0,6" Name="ParticipateButton" Width="75" Height="23" VerticalAlignment="Bottom" Click="ParticipateButton_Click" />
    26                     <Button Content="Refresh" Click="RefreshButton_Click" Margin="0,0,0,6" Name="RefreshButton" Height="23" VerticalAlignment="Bottom" HorizontalAlignment="Left" Width="75" />
    27                     <Button Content="Delete" Click="DeleteButton_Click" Margin="0,0,81,6" Name="DeleteButton" HorizontalAlignment="Right" Width="75" Height="23" VerticalAlignment="Bottom" />
     25                    <Button Content="Participate" HorizontalAlignment="Right" Margin="0,0,0,6" Name="ParticipateButton" Width="75" Height="23" VerticalAlignment="Bottom" Click="ParticipateButtonClick" />
     26                    <Button Content="Refresh" Click="RefreshButtonClick" Margin="0,0,0,6" Name="RefreshButton" Height="23" VerticalAlignment="Bottom" HorizontalAlignment="Left" Width="75" />
     27                    <Button Content="Delete" Click="DeleteButtonClick" Margin="0,0,81,6" Name="DeleteButton" HorizontalAlignment="Right" Width="75" Height="23" VerticalAlignment="Bottom" />
    2828                </Grid>
    2929            </Grid>
  • trunk/CrypPlugins/P2PEditor/GUI/Controls/JobDisplay.xaml.cs

    r1727 r1917  
    6464        private void AttachLoadingAdorner()
    6565        {
    66             ParticipateAdorner participateAdorner = new ParticipateAdorner(mainPane);
    67            /* participateAdorner.FontSize = 15;
    68             loading.OverlayedText = "loading...";
    69             loading.Typeface = new Typeface(FontFamily, FontStyles.Italic,
    70                 FontWeights.Bold, FontStretch);*/
    71             Binding bind = new Binding("Participating");
     66            var participateAdorner = new ParticipateAdorner(mainPane);
     67            var bind = new Binding("Participating");
    7268            bind.Source = this;
    7369            bind.Converter = new TrueToVisibleOrCollapsedConverter();
     
    119115        }
    120116
    121         private void RefreshButton_Click(object sender, RoutedEventArgs e)
     117        private void RefreshButtonClick(object sender, RoutedEventArgs e)
    122118        {
    123119            UpdateJobList();
     
    148144        }
    149145
    150         private void ParticipateButton_Click(object sender, RoutedEventArgs e)
     146        private void ParticipateButtonClick(object sender, RoutedEventArgs e)
    151147        {
    152148            ParticipateInSelectedJob();
     
    160156        private void ParticipateInSelectedJob()
    161157        {
     158            var jobToParticipateIn = (DistributedJob) JobListBox.SelectedItem;
     159            if (jobToParticipateIn == null) return;
     160
    162161            Participating = true;
    163 
    164             var jobToParticipateIn = (DistributedJob) JobListBox.SelectedItem;
    165 
    166             if (jobToParticipateIn == null) return;
    167162
    168163            P2PEditor.GuiLogMessage(
     
    173168        }
    174169
    175         private void DeleteButton_Click(object sender, RoutedEventArgs e)
     170        private void DeleteButtonClick(object sender, RoutedEventArgs e)
    176171        {
    177172            DeleteSelectedJob();
    178173        }
    179174
    180         private void JobListBox_KeyUp(object sender, KeyEventArgs e)
     175        private void JobListBoxKeyUp(object sender, KeyEventArgs e)
    181176        {
    182177            switch (e.Key)
Note: See TracChangeset for help on using the changeset viewer.