Changeset 2516


Ignore:
Timestamp:
Jan 28, 2011, 3:59:35 PM (11 years ago)
Author:
Sven Rech
Message:

worked on KeySearcher settings tab

Location:
trunk/CrypPlugins/KeySearcher
Files:
3 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrypPlugins/KeySearcher/KeySearcher.csproj

    r2432 r2516  
    149149      <DependentUpon>Resources.resx</DependentUpon>
    150150    </Compile>
     151    <Compile Include="Properties\Settings.Designer.cs">
     152      <AutoGen>True</AutoGen>
     153      <DesignTimeSharedInput>True</DesignTimeSharedInput>
     154      <DependentUpon>Settings.settings</DependentUpon>
     155    </Compile>
    151156    <Compile Include="Server\Job.cs" />
    152157    <Compile Include="Server\Opcodes.cs" />
     
    249254    </EmbeddedResource>
    250255  </ItemGroup>
     256  <ItemGroup>
     257    <None Include="app.config" />
     258    <None Include="Properties\Settings.settings">
     259      <Generator>SettingsSingleFileGenerator</Generator>
     260      <LastGenOutput>Settings.Designer.cs</LastGenOutput>
     261    </None>
     262  </ItemGroup>
    251263  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
    252264  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
  • trunk/CrypPlugins/KeySearcher/KeySearcherSettings.cs

    r2417 r2516  
    6262        {
    6363            OpenCLGroupVisiblity();
     64            Settings.Default.PropertyChanged += delegate
     65                                                    {
     66                                                        OpenCLGroupVisiblity();
     67                                                    };
    6468        }
    6569
     
    278282                return;
    279283
    280             if (DevicesAvailable.Count == 0)
     284            if (!Settings.Default.UseOpenCL)
    281285            {
    282286                TaskPaneAttributeChanged(this, new TaskPaneAttributeChangedEventArgs(new TaskPaneAttribteContainer("OpenCLDevice", Visibility.Collapsed)));
    283287                TaskPaneAttributeChanged(this, new TaskPaneAttributeChangedEventArgs(new TaskPaneAttribteContainer("OpenCLMode", Visibility.Collapsed)));
    284288                TaskPaneAttributeChanged(this, new TaskPaneAttributeChangedEventArgs(new TaskPaneAttribteContainer("UseOpenCL", Visibility.Collapsed)));
    285                 TaskPaneAttributeChanged(this, new TaskPaneAttributeChangedEventArgs(new TaskPaneAttribteContainer("NoOpenCL", Visibility.Visible)));
     289                TaskPaneAttributeChanged(this, new TaskPaneAttributeChangedEventArgs(new TaskPaneAttribteContainer("NoOpenCL", Visibility.Collapsed)));
    286290            }
    287291            else
    288292            {
    289                 TaskPaneAttributeChanged(this, new TaskPaneAttributeChangedEventArgs(new TaskPaneAttribteContainer("OpenCLDevice", Visibility.Visible)));
    290                 TaskPaneAttributeChanged(this, new TaskPaneAttributeChangedEventArgs(new TaskPaneAttribteContainer("OpenCLMode", Visibility.Visible)));
    291                 TaskPaneAttributeChanged(this, new TaskPaneAttributeChangedEventArgs(new TaskPaneAttribteContainer("UseOpenCL", Visibility.Visible)));
    292                 TaskPaneAttributeChanged(this, new TaskPaneAttributeChangedEventArgs(new TaskPaneAttribteContainer("NoOpenCL", Visibility.Collapsed)));
     293                if (DevicesAvailable.Count == 0)
     294                {
     295                    TaskPaneAttributeChanged(this, new TaskPaneAttributeChangedEventArgs(new TaskPaneAttribteContainer("OpenCLDevice", Visibility.Collapsed)));
     296                    TaskPaneAttributeChanged(this, new TaskPaneAttributeChangedEventArgs(new TaskPaneAttribteContainer("OpenCLMode", Visibility.Collapsed)));
     297                    TaskPaneAttributeChanged(this, new TaskPaneAttributeChangedEventArgs(new TaskPaneAttribteContainer("UseOpenCL", Visibility.Collapsed)));
     298                    TaskPaneAttributeChanged(this, new TaskPaneAttributeChangedEventArgs(new TaskPaneAttribteContainer("NoOpenCL", Visibility.Visible)));
     299                }
     300                else
     301                {
     302                    TaskPaneAttributeChanged(this, new TaskPaneAttributeChangedEventArgs(new TaskPaneAttribteContainer("OpenCLDevice", Visibility.Visible)));
     303                    TaskPaneAttributeChanged(this, new TaskPaneAttributeChangedEventArgs(new TaskPaneAttribteContainer("OpenCLMode", Visibility.Visible)));
     304                    TaskPaneAttributeChanged(this, new TaskPaneAttributeChangedEventArgs(new TaskPaneAttribteContainer("UseOpenCL", Visibility.Visible)));
     305                    TaskPaneAttributeChanged(this, new TaskPaneAttributeChangedEventArgs(new TaskPaneAttribteContainer("NoOpenCL", Visibility.Collapsed)));
     306                }
    293307            }
    294308        }
     
    348362                if ((deviceSettings.Count > OpenCLDevice) && (value != deviceSettings[OpenCLDevice].mode))
    349363                {
    350                     deviceSettings[OpenCLDevice].mode = value;
     364                    if (Settings.Default.EnableHighLoad || value != 2)
     365                        deviceSettings[OpenCLDevice].mode = value;
     366                    else
     367                        keysearcher.GuiLogMessage(
     368                            "Using \"High Load\" is disabled. Please check your CrypTool 2.0 settings.", NotificationLevel.Error);
     369
    351370                    OnPropertyChanged("OpenCLMode");
    352371                    HasChanges = true;
  • trunk/CrypPlugins/KeySearcher/KeysearcherSettingsTab.xaml

    r2432 r2516  
    33             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    44             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    5              xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    6              mc:Ignorable="d"
    7              d:DesignHeight="300" d:DesignWidth="300">
     5             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:Properties="clr-namespace:KeySearcher.Properties" mc:Ignorable="d"
     6             d:DesignHeight="300" d:DesignWidth="600">
    87    <Grid>
    9            
     8        <Image Source="/KeySearcher;component/Images/icon.png" Opacity="0.2"/>
     9       
     10        <StackPanel Orientation="Vertical">
     11            <Label Content="OpenCL:" FontWeight="Bold" />
     12            <CheckBox Name="UseOpenCL" Content="Use OpenCL in KeySearcher" IsChecked="{Binding Source={x:Static Properties:Settings.Default}, Path=UseOpenCL, Mode=TwoWay}" ToolTip="Check this to enable the KeySearcher to make use of OpenCL for bruteforcing." Style="{StaticResource ResourceKey=settingsStyle}" />
     13            <CheckBox Content="Enable using OpenCL with high load (not recommend)" IsChecked="{Binding Source={x:Static Properties:Settings.Default}, Path=EnableHighLoad, Mode=TwoWay}" IsEnabled="{Binding ElementName=UseOpenCL, Path=IsChecked}" Style="{StaticResource ResourceKey=settingsStyle}" Margin="40,5,0,10" />
     14        </StackPanel>
    1015    </Grid>
    1116</UserControl>
  • trunk/CrypPlugins/KeySearcher/KeysearcherSettingsTab.xaml.cs

    r2432 r2516  
    2727            Resources.Add("settingsStyle", settingsStyle);
    2828            InitializeComponent();
     29
     30            Properties.Settings.Default.PropertyChanged += delegate
     31                                                               {
     32                                                                   Properties.Settings.Default.Save();
     33                                                               };
    2934        }
    3035    }
  • trunk/CrypPlugins/KeySearcher/Properties/Resources.Designer.cs

    r2507 r2516  
    782782       
    783783        /// <summary>
    784         ///   Looks up a localized string similar to Keysearcher Settings.
     784        ///   Looks up a localized string similar to KeySearcher Settings.
    785785        /// </summary>
    786786        internal static string KeysearcherSettings {
  • trunk/CrypPlugins/KeySearcher/Properties/Resources.de-DE.resx

    r2432 r2516  
    599599  </data>
    600600        <data name="KeysearcherSettings" xml:space="preserve">
    601     <value>Keysearcher Einstellungen</value>
     601    <value>KeySearcher Einstellungen</value>
    602602  </data>
    603603</root>
  • trunk/CrypPlugins/KeySearcher/Properties/Resources.resx

    r2507 r2516  
    605605  </data>
    606606  <data name="KeysearcherSettings" xml:space="preserve">
    607     <value>Keysearcher Settings</value>
     607    <value>KeySearcher Settings</value>
    608608  </data>
    609609  <data name="Aggregate_Statistics_" xml:space="preserve">
Note: See TracChangeset for help on using the changeset viewer.