Changeset 2620


Ignore:
Timestamp:
Feb 8, 2011, 12:30:49 PM (11 years ago)
Author:
nolte
Message:

Higher Usability + Percent Flexibility

Location:
trunk/CrypPlugins/KeySearcher/Presentation/Controls
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrypPlugins/KeySearcher/Presentation/Controls/P2PQuickWatchPresentation.xaml

    r2614 r2620  
    2525                <Grid Width="646" >
    2626            <StackPanel>
    27                 <Button Click="SwitchView">Statistics</Button>
    2827                <Border BorderBrush="Silver" BorderThickness="2,2,2,0" Visibility="{Binding IsSearchingForReservedNodes, FallbackValue=Collapsed, Converter={StaticResource TrueToVisibleOrCollapsedConverter}}">
    2928                                        <Grid x:Name="EndgameGrid" Height="36" Background="#C8D1E3FF" RenderTransformOrigin="0.5,0.5">
     
    7675                            <Label Content="Global" FontSize="11" HorizontalAlignment="Center" Foreground="White" />
    7776                        </Border>
     77                        <Button Name="statButton" Content="Show Statistics" Click="SwitchView" Width="111" Height="23" Margin="0,0,67,2" Grid.Column="1" Grid.Row="1" VerticalAlignment="Bottom" HorizontalAlignment="Right" Background="LightBlue" BorderBrush="DarkBlue" Foreground="DarkBlue" />
    7878                        <Label Content="{Loc Participants_}" Grid.Column="1" />
    7979                        <Label Content="{Binding TotalAmountOfParticipants, FallbackValue=-}" Grid.Column="1" HorizontalContentAlignment="Right" Padding="5,5,20,5" />
  • trunk/CrypPlugins/KeySearcher/Presentation/Controls/StatisticsPresentation.xaml

    r2614 r2620  
    3030        </Style>
    3131
    32     </UserControl.Resources>
    33     <StackPanel>
    34         <Button Click="SwitchView">Progress</Button>
    35        
     32    </UserControl.Resources>       
    3633        <TabControl>
    3734            <TabItem Header="{Loc _Information_}">
    3835                <Viewbox>
    39                     <Grid Width="646">
     36                <Grid Width="407">
    4037                        <StackPanel>
    4138                            <Border BorderBrush="Silver" BorderThickness="2,2,2,2">
     
    7370
    7471                            <Border BorderBrush="Silver" BorderThickness="2,0,2,2">
    75                                 <Grid Height="160" Background="#AFAAE1E8">
     72                                <Grid Height="190" Background="#AFAAE1E8">
    7673                                    <Grid.RowDefinitions>
    7774                                        <RowDefinition Height="40" />
     
    7976                                        <RowDefinition Height="40" />
    8077                                        <RowDefinition Height="25" />
    81                                         <RowDefinition Height="30" />   
    82                                     </Grid.RowDefinitions>
     78                                        <RowDefinition Height="30" />
     79                                        <RowDefinition Height="30" />
     80                                </Grid.RowDefinitions>
    8381                                    <Grid.ColumnDefinitions>
    8482                                        <ColumnDefinition Width="26" />
    8583                                        <ColumnDefinition Width="*" />
    8684                                    </Grid.ColumnDefinitions>
    87                                     <Border BorderThickness="1" BorderBrush="Black" LayoutTransform="{StaticResource HeaderRotate}" Grid.Column="0" Grid.RowSpan="5" Background="#FF099BA7">
     85                                    <Border BorderThickness="1" BorderBrush="Black" LayoutTransform="{StaticResource HeaderRotate}" Grid.Column="0" Grid.RowSpan="6" Background="#FF099BA7">
    8886                                        <Label Content="{Loc AdditionalInformation_}" FontSize="11" HorizontalAlignment="Center" Foreground="White" />
    8987                                    </Border>
    9088                                    <Label Content=" Average rate: - key/sec" Name="Rate" VerticalAlignment="Center" Grid.Row="0" Grid.Column="1" HorizontalContentAlignment="Center" Padding="5,5,20,5" />
    91                                     <Label Content=" Top user: -" Name="BestUser" VerticalAlignment="Bottom" Grid.Row="1" Grid.Column="1" HorizontalContentAlignment="Center" Padding="5,5,20,5" />
    92                                     <Label Content=" - users are working on this job." Name="UserCount" VerticalAlignment="Top"  Grid.Row="2" Grid.Column="1" HorizontalContentAlignment="Center" Padding="5,5,20,5" />
     89                                <Label Content=" Top user: -" Name="BestUser" VerticalAlignment="Bottom" Grid.Row="1" Grid.Column="1" HorizontalContentAlignment="Center" Padding="5,5,20,5" />
     90                                <Label Content=" - users are working on this job." Name="UserCount" VerticalAlignment="Top"  Grid.Row="2" Grid.Column="1" HorizontalContentAlignment="Center" Padding="5,5,20,5" />
    9391                                    <Label Content=" Top machine: -" Name="BestMachine" VerticalAlignment="Bottom" Grid.Row="3" Grid.Column="1" HorizontalContentAlignment="Center" Padding="5,5,20,5" />
    9492                                    <Label Content=" - machines are working on this job." Name="MachineCount" VerticalAlignment="Top"  Grid.Row="4" Grid.Column="1" HorizontalContentAlignment="Center" Padding="5,5,20,5" />                               
     
    9694                            </Border>
    9795                       </StackPanel>
     96                       <Button Name="myProgButton" Content="Progress" Click="SwitchView" Width="75" Height="23" Margin="10,10" VerticalAlignment="Bottom" HorizontalAlignment="Right" FontWeight="bold" Background="LightBlue" BorderBrush="DarkBlue" Foreground="DarkBlue" />
    9897                    </Grid>
    9998                </Viewbox>
     99               
    100100            </TabItem>
    101101            <TabItem Header="{Loc _Users_}">
     
    155155                        </TreeView.ItemTemplate>
    156156                    </TreeView>
     157                    <Button Name="myProgButton2" Content="Progress" Click="SwitchView" Width="75" Height="23" Margin="0,0,6,6" VerticalAlignment="Bottom" HorizontalAlignment="Right" FontWeight="bold" Background="LightBlue" BorderBrush="DarkBlue" Foreground="DarkBlue" Grid.Column="1" Grid.Row="1" />
    157158                </Grid>
    158            
    159 
    160             </TabItem>
     159                </TabItem>
    161160       
    162161            <TabItem Header="{Loc _Machines_}">
    163                 <Grid>
     162                        <Grid>
    164163                    <Grid.ColumnDefinitions>
    165164                        <ColumnDefinition Width="120"/>
     
    195194                        </TreeView.ItemTemplate>
    196195                    </TreeView>
     196                    <Button Name="myProgButton3" Content="Progress" Click="SwitchView" Width="75" Height="23" Margin="0,0,6,6" VerticalAlignment="Bottom" HorizontalAlignment="Right" FontWeight="bold" Background="LightBlue" BorderBrush="DarkBlue" Foreground="DarkBlue" Grid.Column="1" Grid.Row="1" />
    197197                </Grid>
    198             </TabItem>       
    199         </TabControl>
    200     </StackPanel>
     198                </TabItem>       
     199        </TabControl>   
    201200</UserControl>
  • trunk/CrypPlugins/KeySearcher/Presentation/Controls/StatisticsPresentation.xaml.cs

    r2614 r2620  
    194194                Dispatcher.Invoke(DispatcherPriority.Normal, (SendOrPostCallback)delegate
    195195                {
    196                      PercentsComplete.Content = string.Format("{0:g} %", percent);
    197                 }, null);
    198             }
     196                     PercentsComplete.Content = string.Format("{0:0."+ getCommaPlaces() +"} %", percent);
     197                }, null);
     198            }
     199        }
     200
     201        private string getCommaPlaces()
     202        {
     203            var l = totalKeys.ToString().Length;
     204
     205            if(l < 5)
     206            {
     207                return "####";
     208            }
     209            else if(l < 10)
     210            {
     211                return "########";
     212            }
     213            else
     214            {
     215                return "############";
     216            }           
    199217        }
    200218
Note: See TracChangeset for help on using the changeset viewer.