private Gnome.DruidPage CreateSelectionPage()
 {
     SelectionPage = new modelKeyPage("Select Passphrase Recovery Step",KeyRecoveryPixbuf,null);
        SelectionPage.CancelClicked += new Gnome.CancelClickedHandler(OnCancelClicked);
        SelectionPage.Prepared += new Gnome.PreparedHandler(OnSelectionPagePrepared);
        SelectionPage.ValidateClicked += new KRValidateClickedHandler(OnSelectionPageValidated);
                 Table table = new Table(4, 3, false);
              SelectionPage.VBox.PackStart(table, false, false, 0);
                 table.ColumnSpacing = 6;
                 table.RowSpacing = 6;
                 table.BorderWidth = 12;
     Label l = new Label(Util.GS("Select an option to recover your passphrase."));
                 table.Attach(l, 0,1, 0,1,
                         AttachOptions.Fill | AttachOptions.Expand, 0,0,0);
                 l.LineWrap = true;
                 l.Xalign = 0.0F;
     haveBoth = new RadioButton(Util.GS("I have the _secret file and its password"));
                 table.Attach(haveBoth, 0,1, 1,2,
                                 AttachOptions.Fill | AttachOptions.Expand, 0,0,0);
        haveBoth.Sensitive = true;
                 haveBoth.Active = true;
                 haveOne = new RadioButton(haveBoth, Util.GS("I have the new _data file sent by the administrator"));
                 table.Attach(haveOne, 0,1, 2,3, AttachOptions.Fill | AttachOptions.Shrink, 0,0,0);
        haveOne.Sensitive = true;
        haveNone = new RadioButton(haveBoth,Util.GS("_I have no secret or data file"));
        table.Attach(haveNone,0,1,3,4,AttachOptions.Fill | AttachOptions.Shrink, 0,0,0);
        haveNone.Sensitive = true;
        return SelectionPage;
 }
 private Gnome.DruidPage CreateSingleWizPage()
 {
     SingleWizPage = new modelKeyPage(Util.GS("Set new passphrase"),
                                 KeyRecoveryPixbuf,
                                 null);
        SingleWizPage.CancelClicked +=
                         new Gnome.CancelClickedHandler(OnCancelClicked);
        SingleWizPage.ValidateClicked +=
     new KRValidateClickedHandler(OnSingleWizPageValidated);
     SingleWizPage.SkipClicked +=
                        new KRSkipClickedHandler(OnSingleWizSkipClicked);
     SingleWizPage.Prepared +=
                            new Gnome.PreparedHandler(OnSingleWizPagePrepared);
     Table table = new Table(4, 3, false);
       SingleWizPage.VBox.PackStart(table, false, false, 0);
                 table.ColumnSpacing = 6;
                 table.RowSpacing = 6;
                 table.BorderWidth = 12;
                 Label lbl = new Label(Util.GS("_iFolder Account"+":"));
                 table.Attach(lbl, 0,1, 0,1,
                         AttachOptions.Fill | AttachOptions.Expand, 0,0,0);
                 lbl.LineWrap = true;
                 lbl.Xalign = 0.0F;
                 singleWizDomain = new Entry();
                 lbl.MnemonicWidget = singleWizDomain;
                 singleWizDomain.Sensitive = false;
                 table.Attach(singleWizDomain, 1,2,0,1, AttachOptions.Fill|AttachOptions.Expand, 0,0,0);
                 Label lb2 = new Label(Util.GS("_Location of secret file")+ ":");
                 table.Attach(lb2, 0,1, 1,2,
                         AttachOptions.Fill | AttachOptions.Expand, 0,0,0);
                 lb2.LineWrap = true;
                 lb2.Xalign = 0.0F;
                 p12FilePath = new Entry();
                  p12FilePath.Visibility = true;
                 table.Attach(p12FilePath, 1,2, 1,2,
                         AttachOptions.Fill | AttachOptions.Expand, 0,0,0);
                 lb2.MnemonicWidget = p12FilePath;
                 p12FilePath.Changed += new EventHandler(UpdateSensitivity);
        singleWizBrowseButton = new Button(Util.GS("_Browse"));
                 table.Attach(singleWizBrowseButton, 2,3, 1,2, AttachOptions.Fill, 0,0,0);
                 singleWizBrowseButton.Sensitive = true;
                 singleWizBrowseButton.Clicked += new EventHandler(OnSingleWizBrowseButtonClicked);
                  Label lb3 = new Label(Util.GS("_Secret Password")+":");
                 table.Attach(lb3, 0,1, 2,3,
                         AttachOptions.Fill | AttachOptions.Expand, 0,0,0);
                 lb3.LineWrap = true;
                 lb3.Xalign = 0.0F;
                 domainPasswd = new Entry();
                 domainPasswd.Visibility = false;
                 table.Attach(domainPasswd, 1,2, 2,3,
                         AttachOptions.Fill | AttachOptions.Expand, 0,0,0);
        lb3.MnemonicWidget = domainPasswd;
                 domainPasswd.Changed += new EventHandler(UpdateSensitivity);
                  Label lb4 = new Label(Util.GS("_New passphrase")+":");
                 table.Attach(lb4, 0,1, 3,4,
                         AttachOptions.Fill | AttachOptions.Expand, 0,0,0);
                 lb4.LineWrap = true;
                 lb4.Xalign = 0.0F;
                singleWizNewPassphrase = new Entry();
                 singleWizNewPassphrase.Visibility = false;
                 table.Attach(singleWizNewPassphrase, 1,2, 3,4,
                         AttachOptions.Fill | AttachOptions.Expand, 0,0,0);
                 lb4.MnemonicWidget = singleWizNewPassphrase;
                 singleWizNewPassphrase.Changed += new EventHandler(UpdateSensitivity);
                 Label lb5 = new Label(Util.GS("_Confirm passphrase") + ":");
                 table.Attach(lb5, 0,1, 4,5,
                         AttachOptions.Fill | AttachOptions.Expand, 0,0,0);
                 lb5.LineWrap = true;
                 lb5.Xalign = 0.0F;
                 singleWizConfirmPassphrase = new Entry();
                 singleWizConfirmPassphrase.Visibility = false;
                 table.Attach(singleWizConfirmPassphrase, 1,2, 4,5,
                         AttachOptions.Fill | AttachOptions.Expand, 0,0,0);
                 lb5.MnemonicWidget = singleWizConfirmPassphrase;
                singleWizConfirmPassphrase.Changed += new EventHandler(UpdateSensitivity);
        return SingleWizPage;
 }
 private Gnome.DruidPage CreateInfoPage()
 {
     InfoPage = new modelKeyPage(
                         Util.GS("Welcome to the Passphrase Recovery Wizard"),
                         KeyRecoveryPixbuf, null);
                 InfoPage.CancelClicked +=
                         new Gnome.CancelClickedHandler(OnCancelClicked);
                 InfoPage.Prepared +=
                         new Gnome.PreparedHandler(OnInfoPagePrepared);
     InfoPage.SkipClicked +=
                         new KRSkipClickedHandler(OnInfoPageSkipClicked);
                 Table table = new Table(4,3, false);
                 InfoPage.VBox.PackStart(table, false, false, 0);
                 table.ColumnSpacing = 6;
                 table.RowSpacing = 6;
                 table.BorderWidth = 12;
                 Label l2 = new Label(Util.GS("To recover a lost passphrase, you require the secret file (private key of the certificate) and its passowrd or the data file from the administrator."));
                 table.Attach(l2,0,1, 1,2,
                         AttachOptions.Fill | AttachOptions.Expand, 0,0,0);
                 l2.LineWrap = true;
                 l2.Xalign = 0.0F;
                 Label l5 = new Label(Util.GS("If you don't have this information, you must use this wizard to obtain the old data file and then mail the file to your administrator.The administrator will send back to you a new data file which you can use to reset your passphrase."));
                 table.Attach(l5, 0,1, 4,5,
                         AttachOptions.Fill | AttachOptions.Expand, 0,0,0);
                 l5.LineWrap = true;
                 l5.Xalign = 0.0F;
        return InfoPage;
 }
 private Gnome.DruidPage CreateImportKeyPage()
 {
     ImportKeyPage =
                         new modelKeyPage(Util.GS("Set new passphrase"),
                                 KeyRecoveryPixbuf,
                                 null);
     ImportKeyPage.CancelClicked +=
                          new Gnome.CancelClickedHandler(OnCancelClicked);
             ImportKeyPage.Prepared +=
                         new Gnome.PreparedHandler(OnImportKeyPagePrepared);
        ImportKeyPage.ValidateClicked +=
      new KRValidateClickedHandler(OnImportKeyPageValidated);
        ImportKeyPage.SkipClicked +=
                           new KRSkipClickedHandler(OnImportKeyPageSkipClicked);
                 Table table = new Table(4, 3, false);
                 ImportKeyPage.VBox.PackStart(table, false, false, 0);
       table.ColumnSpacing = 6;
                 table.RowSpacing = 6;
                 table.BorderWidth = 12;
                 Label l = new Label(Util.GS("_iFolder Account")+":");
                 table.Attach(l, 0,1, 0,1, AttachOptions.Fill | AttachOptions.Expand, 0,0,0);
                 l.LineWrap = true;
                 l.Xalign = 0.0F;
                 importDomain = new Entry();
                 importDomain.Sensitive = false;
        table.Attach(importDomain, 1,2,0,1, AttachOptions.Fill|AttachOptions.Expand, 0,0,0);
                 l.MnemonicWidget = importDomain;
                 l = new Label(Util.GS("_Location of new data file")+":");
                 table.Attach(l, 0,1, 1,2,
                         AttachOptions.Fill | AttachOptions.Expand, 0,0,0);
                 l.LineWrap = true;
                 l.Xalign = 0.0F;
                 importLocation = new Entry();
                 this.importLocation.Changed += new EventHandler(OnImportFieldsChanged);
                 table.Attach(importLocation, 1,2, 1,2,
                         AttachOptions.Expand | AttachOptions.Fill, 0,0,0);
                 l.MnemonicWidget = importLocation;
                 importBrowseButton = new Button(Util.GS("_Browse"));
                 table.Attach(importBrowseButton, 2,3, 1,2, AttachOptions.Fill, 0,0,0);
                 importBrowseButton.Sensitive = true;
                 importBrowseButton.Clicked += new EventHandler(OnImportBrowseButtonClicked);
        isEncrypted = new CheckButton(Util.GS("Is the _above file encrypted?"));
                 table.Attach(isEncrypted, 1,2, 2,3, AttachOptions.Fill | AttachOptions.Shrink, 0,0,0);
        isEncrypted.Toggled += new EventHandler(OnIsEncryptedToggled);
                 l = new Label(Util.GS("One Time Password")+":");
                 l.Xalign = 0.0F;
                 table.Attach(l, 0,1, 3,4,
                         AttachOptions.Fill, 0,0,0);
                 oneTimePassphrase = new Entry();
                 oneTimePassphrase.Visibility = false;
        oneTimePassphrase.Sensitive = false;
                 oneTimePassphrase.Changed += new EventHandler(OnImportFieldsChanged);
                 table.Attach(oneTimePassphrase, 1,2, 3,4,
                         AttachOptions.Expand | AttachOptions.Fill, 0,0,0);
                 l.MnemonicWidget = oneTimePassphrase;
                 l = new Label(Util.GS("_New passphrase")+":");
                 l.Xalign = 0.0F;
                 table.Attach(l, 0,1, 4,5,
                         AttachOptions.Fill | AttachOptions.Expand, 0,0,0);
                 importPageNewPassphrase = new Entry();
                 importPageNewPassphrase.Visibility = false;
                 importPageNewPassphrase.Changed += new EventHandler(OnImportFieldsChanged);
                 table.Attach(importPageNewPassphrase, 1, 2, 4, 5,
                         AttachOptions.Expand | AttachOptions.Fill, 0,0,0);
                 l.MnemonicWidget = importPageNewPassphrase;
                 l = new Label("_Confirm passphrase"+":");
                 l.Xalign = 0.0F;
                 table.Attach(l, 0,1, 5,6,
                         AttachOptions.Fill | AttachOptions.Expand, 0,0,0);
                 importPageConfirmPassphrase = new Entry();
                 importPageConfirmPassphrase.Visibility = false;
                 importPageConfirmPassphrase.Changed += new EventHandler(OnImportFieldsChanged);
                 table.Attach(importPageConfirmPassphrase, 1, 2, 5, 6,
                         AttachOptions.Expand | AttachOptions.Fill, 0,0,0);
                 l.MnemonicWidget = importPageConfirmPassphrase;
        return ImportKeyPage;
 }
 private Gnome.DruidPage CreateExportKeyPage()
 {
     ExportKeyPage = new modelKeyPage(
                                 Util.GS("Obtain old data file"),
                                 KeyRecoveryPixbuf,
                                 null);
        ExportKeyPage.CancelClicked +=
                         new Gnome.CancelClickedHandler(OnCancelClicked);
       ExportKeyPage.Prepared +=
                         new Gnome.PreparedHandler(OnExportKeyPagePrepared);
       ExportKeyPage.ValidateClicked +=
     new KRValidateClickedHandler(OnExportKeyPageValidated);
       ExportKeyPage.SkipClicked +=
                         new KRSkipClickedHandler(OnExportKeyPageSkipClicked);
                 Table table = new Table(4, 3, false);
                 ExportKeyPage.VBox.PackStart(table, false, false, 0);
       table.ColumnSpacing = 6;
                 table.RowSpacing = 6;
                 table.BorderWidth = 12;
                 Label l = new Label(Util.GS("_iFolder Account")+":");
                 table.Attach(l, 0,1, 0,1,
                         AttachOptions.Fill | AttachOptions.Expand, 0,0,0);
                 l.LineWrap = true;
                 l.Xalign = 0.0F;
                 exportDomain = new Entry();
        exportDomain.Sensitive = false;
     table.Attach(exportDomain, 1,2,0,1, AttachOptions.Fill|AttachOptions.Expand, 0,0,0);
                 l.MnemonicWidget = exportDomain;
                 l = new Label(Util.GS("Recovery Agent")+":");
                 l.Xalign = 0.0F;
                 table.Attach(l, 0,1, 1,2,
                         AttachOptions.Fill | AttachOptions.Expand, 0,0,0);
                 recoveryAgent = new Entry();
                 recoveryAgent.Sensitive = false;
     table.Attach(recoveryAgent, 1,2,1,2, AttachOptions.Fill|AttachOptions.Expand, 0,0,0);
                 l.MnemonicWidget = recoveryAgent;
                 l = new Label(Util.GS("_Location to save old data file")+":");
                 l.Xalign = 0.0F;
                 table.Attach(l, 0,1, 2,3,
                         AttachOptions.Fill, 0,0,0);
                 exportLocation = new Entry();
                 this.exportLocation.Changed += new EventHandler(OnExportPageFieldsChanged);
                 table.Attach(exportLocation, 1,2, 2,3,
                         AttachOptions.Expand | AttachOptions.Fill, 0,0,0);
                 l.MnemonicWidget = exportLocation;
                 exportBrowseButton = new Button(Util.GS("_Browse"));
                 table.Attach(exportBrowseButton, 2,3, 2,3, AttachOptions.Fill, 0,0,0);
                 exportBrowseButton.Sensitive = true;
                 exportBrowseButton.Clicked += new EventHandler(OnExportBrowseButtonClicked);
        return ExportKeyPage;
 }
 private Gnome.DruidPage CreateEnterPassphrasePage()
 {
     EnterPassphrasePage = new modelKeyPage(Util.GS("Set new passphrase"), KeyRecoveryPixbuf, null);
         EnterPassphrasePage.CancelClicked += new Gnome.CancelClickedHandler(OnCancelClicked);
         EnterPassphrasePage.Prepared += new Gnome.PreparedHandler(OnEnterPassphrasePagePrepared);
         EnterPassphrasePage.ValidateClicked += new KRValidateClickedHandler(OnEnterPassphrasePageValidated);
         Table table = new Table(4, 3, false);
         EnterPassphrasePage.VBox.PackStart(table, false, false, 0);
         table.ColumnSpacing = 6;
         table.RowSpacing = 6;
         table.BorderWidth = 12;
         Label l = new Label(Util.GS("_iFolder Account") + ":");
         l.Xalign = 0.0F;
         table.Attach(l, 0, 1, 0, 1,
                 AttachOptions.Fill, 0, 0, 0);
         iFolderAcc = new Entry();
         iFolderAcc.Sensitive = false;
        table.Attach(iFolderAcc, 1, 2, 0, 1,
                 AttachOptions.Expand | AttachOptions.Fill, 0, 0, 0);
         l.MnemonicWidget = iFolderAcc;
         l = new Label(Util.GS("_New passphrase") + ":");
         l.Xalign = 0.0F;
         table.Attach(l, 0, 1, 1, 2,
                 AttachOptions.Fill | AttachOptions.Expand, 0, 0, 0);
         newPassphrase = new Entry();
         newPassphrase.Visibility = false;
         newPassphrase.Changed += new EventHandler(OnEnterPassphraseFieldsChanged);
         table.Attach(newPassphrase, 1, 2, 1, 2,
                 AttachOptions.Expand | AttachOptions.Fill, 0, 0, 0);
         l.MnemonicWidget = newPassphrase;
         l = new Label(Util.GS("_Confirm passphrase") + ":");
         l.Xalign = 0.0F;
         table.Attach(l, 0, 1, 2, 3,
                 AttachOptions.Fill | AttachOptions.Expand, 0, 0, 0);
         confirmPassphrase = new Entry();
         confirmPassphrase.Visibility = false;
         confirmPassphrase.Changed += new EventHandler(OnEnterPassphraseFieldsChanged);
         table.Attach(confirmPassphrase, 1, 2, 2, 3,
                 AttachOptions.Expand | AttachOptions.Fill, 0, 0, 0);
         l.MnemonicWidget = confirmPassphrase;
        l = new Label(Util.GS("_User name") + ":");
         l.Xalign = 0.0F;
         table.Attach(l, 0, 1, 3, 4,
                 AttachOptions.Fill | AttachOptions.Expand, 0, 0, 0);
       userName = new Entry();
       userName.Sensitive = false;
        table.Attach(userName, 1, 2, 3, 4,
                 AttachOptions.Expand | AttachOptions.Fill, 0, 0, 0);
         l.MnemonicWidget = userName;
        l = new Label(Util.GS("_Password:"));
         l.Xalign = 0.0F;
         table.Attach(l, 0, 1, 4, 5,
                 AttachOptions.Fill | AttachOptions.Expand, 0, 0, 0);
       password = new Entry();
       password.Visibility = false;
       password.Changed += new EventHandler(OnEnterPassphraseFieldsChanged);
        table.Attach(password, 1, 2, 4, 5,
                 AttachOptions.Expand | AttachOptions.Fill, 0, 0, 0);
         l.MnemonicWidget = password;
       return EnterPassphrasePage;
 }
 private modelKeyPage CreateDomainSelectionPage()
 {
     DomainSelectionPage = new modelKeyPage(Util.GS("Select account"),KeyRecoveryPixbuf,null);
        DomainSelectionPage.CancelClicked += new Gnome.CancelClickedHandler(OnCancelClicked);
        DomainSelectionPage.Prepared += new Gnome.PreparedHandler(OnDomainSelectionPagePrepared);
        DomainSelectionPage.ValidateClicked += new KRValidateClickedHandler(OnDomainSelectionPageValidated);
        Table table = new Table(4, 3, false);
              DomainSelectionPage.VBox.PackStart(table,false,false, 0);
                 table.ColumnSpacing = 6;
                 table.RowSpacing = 6;
                 table.BorderWidth = 12;
     Label l1 = new Label(Util.GS("Select the account for which the passphrase must to be reset."));
                 table.Attach(l1, 0,1, 0,1,
                         AttachOptions.Fill | AttachOptions.Expand, 0,0,0);
                 l1.LineWrap = true;
                 l1.Xalign = 0.0F;
        Label l2 = new Label(Util.GS("_iFolder Account")+":");
        table.Attach(l2, 0,1,5,6,
                         AttachOptions.Fill | AttachOptions.Expand, 0,0,0);
                 l2.LineWrap = true;
                 l2.Xalign = 0.0F;
                 domainComboBox = ComboBox.NewText();
        DomainController domainController = DomainController.GetDomainController();
                 domains= domainController.GetLoggedInDomains();
                 string defaultDomainID = simws.GetDefaultDomainID();
                  int defaultDomain = 0 ;
                  for (int x = 0; x < domains.Length; x++)
                 {
                         domainComboBox.AppendText(domains[x].Name+"-"+domains[x].Host);
                          if(defaultDomainID != null && defaultDomainID == domains[x].ID)
                                        defaultDomain = x;
                 }
                 if( domains.Length > 0)
                         domainComboBox.Active = defaultDomain;
                 table.Attach(domainComboBox, 1,2,5,6, AttachOptions.Fill, 0,0,0);
        l2.MnemonicWidget = domainComboBox;
                 Label l3 = new Label(Util.GS("Click Forward to proceed."));
                 table.Attach(l3, 0, 1, 7, 8,
                         AttachOptions.Fill | AttachOptions.Expand, 0, 0, 0);
                 l3.LineWrap = true;
                 l3.Xalign = 0.0F;
       return DomainSelectionPage;
 }