Changeset 2344


Ignore:
Timestamp:
Jan 14, 2011, 9:14:31 PM (10 years ago)
Author:
kopal
Message:
  • p2peditor now doesn't use tabs any more
  • user can now enter user name, password and world name in the connect view
Location:
trunk/CrypPlugins/P2PEditor
Files:
6 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrypPlugins/P2PEditor/GUI/P2PEditorPresentation.xaml

    r2277 r2344  
    33        <Converters:ConnectivityToVisibilityConverter x:Key="ConnectivityToVisibilityConverter" />
    44        </GUI:P2PUserControl.Resources>
    5         <Grid>
    6                 <TabControl TabStripPlacement="Top" Name="JobTabControl">
    7             <TabItem Header="Active jobs" Name="ActiveJobsTab" IsEnabled="{Binding IsP2PConnected, ElementName=P2PEditorControl}">
    8                 <controls:JobDisplay x:Name="ActiveJobsControl" Jobs="{Binding Jobs, ElementName=P2PEditorControl}" />
    9                         </TabItem>
    10             <TabItem Header="New job" Name="JobCreationTab" IsEnabled="{Binding IsP2PConnected, ElementName=P2PEditorControl}">
    11                                 <controls:JobCreation />
    12                         </TabItem>
    13             <TabItem Header="Connect" Name="ConnectTab" Visibility="{Binding IsP2PConnected, ElementName=P2PEditorControl, Converter={StaticResource ConnectivityToVisibilityConverter}}">
    14                 <controls:ConnectTab IsP2PConnecting="{Binding IsP2PConnecting, ElementName=P2PEditorControl}" />
    15             </TabItem>
    16             <TabItem Header="Get a certificate!" Name="GetNewCertificateTab">
    17                 <controls:GetNewCertificate />
    18             </TabItem>
    19             <TabItem Header="About" Name="AboutTab">
    20                 <Frame Source="../DetailedDescription/Description.xaml" />
    21             </TabItem>
    22         </TabControl>
     5        <Grid Background="White">
     6                    <controls:JobDisplay x:Name="JobDisplay" Jobs="{Binding Jobs, ElementName=P2PEditorControl}" Visibility="Hidden"/>
     7            <controls:JobCreation x:Name="JobCreation" Visibility="Hidden"/>
     8            <controls:ConnectTab x:Name="Connect" IsP2PConnecting="{Binding IsP2PConnecting, ElementName=P2PEditorControl}" />
     9            <controls:GetNewCertificate x:Name="GetNewCertificate" Visibility="Hidden"/>
     10            <Frame Name="Help" Source="../DetailedDescription/Description.xaml" Visibility="Hidden"/>           
    2311        </Grid>
    2412</GUI:P2PUserControl>
  • trunk/CrypPlugins/P2PEditor/GUI/P2PEditorPresentation.xaml.cs

    r2081 r2344  
    6969            UpdateDisplay();
    7070
    71             if (!P2PManager.IsConnected)
    72             {
    73                 ShowConnectTab();
    74             }
     71            this.Connect.P2PEditorPresentation = this;
     72            this.GetNewCertificate.P2PEditorPresentation = this;
     73            this.JobCreation.P2PEditorPresentation = this;
     74            this.JobDisplay.P2PEditorPresentation = this;
    7575        }
    7676
     
    8181            if (P2PManager.IsConnected)
    8282            {
    83                 Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(ShowActiveJobs));
     83                Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(ShowActiveJobsView));
    8484            }
    8585            else
    8686            {
    87                 Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(ShowConnectTab));
     87                Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(ShowConnectView));
    8888            }
    8989        }
     
    110110        {
    111111            Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(UpdateConnectionState));
    112             Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(ActiveJobsControl.UpdateJobList));
     112            Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(JobDisplay.UpdateJobList));
    113113        }
    114114
     
    119119        }
    120120
    121         internal void ShowJobCreation()
     121
     122        internal void hideAllViews()
    122123        {
    123             JobTabControl.SelectedItem = JobCreationTab;
     124            this.JobCreation.Visibility = Visibility.Hidden;
     125            this.JobDisplay.Visibility = Visibility.Hidden;
     126            this.Connect.Visibility = Visibility.Hidden;
     127            this.GetNewCertificate.Visibility = Visibility.Hidden;           
    124128        }
    125129
    126         internal void ShowActiveJobs()
     130        internal void ShowGetNewCertificateView()
    127131        {
    128             UpdateDisplay();
    129             JobTabControl.SelectedItem = ActiveJobsTab;
     132            hideAllViews();
     133            this.GetNewCertificate.Visibility = Visibility.Visible;           
    130134        }
    131135
    132         internal void ShowConnectTab()
     136        internal void ShowJobCreationView()
    133137        {
    134             JobTabControl.SelectedItem = ConnectTab;
     138            hideAllViews();
     139            this.JobCreation.Visibility = Visibility.Visible;
     140        }
     141
     142        internal void ShowActiveJobsView()
     143        {
     144            hideAllViews();
     145            this.JobDisplay.Visibility = Visibility.Visible;
     146            UpdateDisplay();           
     147        }
     148
     149        internal void ShowConnectView()
     150        {
     151            hideAllViews();
     152            this.Connect.Visibility = Visibility.Visible;           
    135153        }
    136154
    137155        internal void ShowHelp()
    138156        {
    139             JobTabControl.SelectedItem = AboutTab;
     157            hideAllViews();
     158            //to be implemented
    140159        }
    141160    }
  • trunk/CrypPlugins/P2PEditor/P2PEditor.cs

    r2241 r2344  
    7373                initialNewEventHandled = true;
    7474            else
    75                 ((P2PEditorPresentation) Presentation).ShowJobCreation();
     75                ((P2PEditorPresentation) Presentation).ShowJobCreationView();
    7676        }
    7777
  • trunk/CrypPlugins/P2PEditor/P2PEditor.csproj

    r2310 r2344  
    3434  </PropertyGroup>
    3535  <ItemGroup>
    36       <Reference Include="CertificateLibrary">
     36    <Reference Include="CertificateLibrary">
    3737      <HintPath>..\..\AppReferences\CertificateLibrary.dll</HintPath>
    3838      <Private>false</Private>
     
    6060    <Compile Include="Distributed\DistributedJobSerializer.cs" />
    6161    <Compile Include="Distributed\DistributedJobStatus.cs" />
    62     <Compile Include="GUI\Controls\ConnectTab.xaml.cs">
    63       <DependentUpon>ConnectTab.xaml</DependentUpon>
     62    <Compile Include="GUI\Controls\ConnectView.xaml.cs">
     63      <DependentUpon>ConnectView.xaml</DependentUpon>
    6464    </Compile>
    65     <Compile Include="GUI\Controls\GetNewCertificate.xaml.cs">
    66       <DependentUpon>GetNewCertificate.xaml</DependentUpon>
     65    <Compile Include="GUI\Controls\GetNewCertificateView.xaml.cs">
     66      <DependentUpon>GetNewCertificateView.xaml</DependentUpon>
    6767    </Compile>
    6868    <Compile Include="GUI\P2PUserControl.cs" />
     
    7474    <Compile Include="Converters\InverseBooleanConverter.cs" />
    7575    <Compile Include="P2PEditor.cs" />
    76     <Compile Include="GUI\Controls\JobCreation.xaml.cs">
    77       <DependentUpon>JobCreation.xaml</DependentUpon>
     76    <Compile Include="GUI\Controls\JobCreationView.xaml.cs">
     77      <DependentUpon>JobCreationView.xaml</DependentUpon>
    7878    </Compile>
    79     <Compile Include="GUI\Controls\JobDisplay.xaml.cs">
    80       <DependentUpon>JobDisplay.xaml</DependentUpon>
     79    <Compile Include="GUI\Controls\JobDisplayView.xaml.cs">
     80      <DependentUpon>JobDisplayView.xaml</DependentUpon>
    8181    </Compile>
    8282    <Compile Include="GUI\P2PEditorPresentation.xaml.cs">
     
    141141      <Generator>MSBuild:Compile</Generator>
    142142    </Resource>
    143     <Page Include="GUI\Controls\ConnectTab.xaml">
     143    <Page Include="GUI\Controls\ConnectView.xaml">
    144144      <SubType>Designer</SubType>
    145145      <Generator>MSBuild:Compile</Generator>
    146146    </Page>
    147     <Page Include="GUI\Controls\GetNewCertificate.xaml">
     147    <Page Include="GUI\Controls\GetNewCertificateView.xaml">
    148148      <Generator>MSBuild:Compile</Generator>
    149149      <SubType>Designer</SubType>
    150150    </Page>
    151     <Page Include="GUI\Controls\JobCreation.xaml">
     151    <Page Include="GUI\Controls\JobCreationView.xaml">
    152152      <SubType>Designer</SubType>
    153153      <Generator>MSBuild:Compile</Generator>
    154154    </Page>
    155     <Page Include="GUI\Controls\JobDisplay.xaml">
     155    <Page Include="GUI\Controls\JobDisplayView.xaml">
    156156      <SubType>Designer</SubType>
    157157      <Generator>MSBuild:Compile</Generator>
Note: See TracChangeset for help on using the changeset viewer.