Beispiel #1
0
        /// <summary>
        /// Event Handler for Remove Account
        /// </summary>
        private void OnRemoveAccount(object o, EventArgs args)
        {
            TreeSelection tSelect = AccTreeView.Selection;

            if (tSelect.CountSelectedRows() == 1)
            {
                TreeModel tModel;
                TreeIter  iter;

                tSelect.GetSelected(out tModel, out iter);
                string            domainID = (string)tModel.GetValue(iter, 0);
                DomainInformation dom      = domainController.GetDomain(domainID);

                RemoveAccountDialog rad = new RemoveAccountDialog(dom);
                rad.TransientFor = topLevelWindow;
                int rc = rad.Run();
                rad.Hide();
                if ((ResponseType)rc == ResponseType.Yes)
                {
                    try
                    {
                        removedDomains[dom.ID] = dom.ID;

                        domainController.RemoveDomain(dom.ID, rad.RemoveiFoldersFromServer);

                        RemoveDomain(dom.ID);
                    }
                    catch (Exception e)
                    {
                        if (removedDomains.ContainsKey(dom.ID))
                        {
                            removedDomains.Remove(dom.ID);
                        }

                        iFolderExceptionDialog ied =
                            new iFolderExceptionDialog(topLevelWindow, e);
                        ied.Run();
                        ied.Hide();
                        ied.Destroy();
                        rad.Destroy();                          // Clean up before bailing
                        return;
                    }

                    AddButton.Sensitive     = true;
                    RemoveButton.Sensitive  = false;
                    DetailsButton.Sensitive = false;
                }

                rad.Destroy();
            }
        }
        /// <summary>
        /// Event Handler for LimitSize Button event
        /// </summary>

        /*		private void OnLimitSizeButton(object o, EventArgs args)
         *          {
         *                  if(LimitCheckButton.Active == true)
         *                  {
         *                          LimitUnit.Sensitive = true;
         *                          AvailLabel.Sensitive = true;
         *                          AvailValue.Sensitive = true;
         *                          AvailUnit.Sensitive = true;
         *                          LimitEntry.Sensitive = true;
         *                          DiskUsageBar.Sensitive = true;
         *                          DiskUsageFrame.Sensitive = true;
         *                          DiskUsageFullLabel.Sensitive = true;
         *                          DiskUsageEmptyLabel.Sensitive = true;
         *                  }
         *                  else
         *                  {
         *                          LimitUnit.Sensitive = false;
         *                          AvailLabel.Sensitive = false;
         *                          AvailValue.Sensitive = false;
         *                          AvailUnit.Sensitive = false;
         *                          DiskUsageBar.Sensitive = false;
         *                          DiskUsageFrame.Sensitive = false;
         *                          DiskUsageFullLabel.Sensitive = false;
         *                          DiskUsageEmptyLabel.Sensitive = false;
         *
         *                          LimitEntry.Sensitive = false;
         *                          LimitEntry.Text = Util.GS("0");
         *
         *                          // if the currrent value is not the same as the
         *                          // read value, we need to save the currrent value
         *                          if(GetCurrentLimit() != ds.Limit)
         *                          {
         *                                  // thick client user does not have right to set disk quota policy, so commenting the code.
         *                                  //SaveLimit();
         *                          }
         *                  }
         *          }  */



        /// <summary>
        /// Event Handler for LImit Changed event
        /// </summary>

/*		private void OnLimitChanged(object o, EventArgs args)
 *              {
 *                      int tmpValue;
 *
 *                      long sizeLimit = GetCurrentLimit();
 *
 *                      if(sizeLimit == 0)
 *                      {
 *                              AvailValue.Text = Util.GS("0");
 *                      }
 *                      else
 *                      {
 *                              long result = sizeLimit - ds.UsedSpace;
 *                              if(result < 0)
 *                                      tmpValue = 0;
 *                              else
 *                              {
 *                                      tmpValue = (int)(result / (1024 * 1024));
 *                              }
 *
 *                              AvailValue.Text = string.Format("{0}",tmpValue);
 *                      }
 *
 *                      SetGraph(ds.UsedSpace, sizeLimit);
 *              } */



        /// <summary>
        /// Event Handler for Limit Edited event
        /// </summary>

/*		private void OnLimitEdited(object o, EventArgs args)
 *              {
 *                      SaveLimit();
 *              } */



        /*	private void OnLimitFocusLost(object o, FocusOutEventArgs args)
         *      {
         *              SaveLimit();
         *      } */



        /// <summary>
        /// Event Handler for Sync Now Clicked
        /// </summary>
        private void OnSyncNowClicked(object o, EventArgs args)
        {
            try
            {
                ifws.SynciFolderNow(ifolder.ID);
            }
            catch (Exception e)
            {
                iFolderExceptionDialog ied = new iFolderExceptionDialog(
                    topLevelWindow, e);
                ied.Run();
                ied.Hide();
                ied.Destroy();
                return;
            }
        }
Beispiel #3
0
        private void OnAutoSyncButton(object o, EventArgs args)
        {
            if (AutoSyncCheckButton.Active == true)
            {
                SyncSpinButton.Sensitive    = true;
                SyncUnitsComboBox.Sensitive = true;

                SyncUnitsComboBox.Changed -= new EventHandler(OnSyncUnitsChanged);
                SyncUnitsComboBox.Active   = (int)SyncUnit.Minutes;
                currentSyncUnit            = SyncUnit.Minutes;
                SaveSyncUnitConfig();
                SyncUnitsComboBox.Changed += new EventHandler(OnSyncUnitsChanged);

                SyncSpinButton.Value = 5;
            }
            else
            {
                if (oneMinuteLimitNotifyWindow != null)
                {
                    oneMinuteLimitNotifyWindow.Hide();
                    oneMinuteLimitNotifyWindow.Destroy();
                    oneMinuteLimitNotifyWindow = null;
                }

                try
                {
                    ifws.SetDefaultSyncInterval(-1);
                }
                catch (Exception e)
                {
                    iFolderExceptionDialog ied = new iFolderExceptionDialog(
                        topLevelWindow, e);
                    ied.Run();
                    ied.Hide();
                    ied.Destroy();
                    return;
                }

                SyncSpinButton.ValueChanged -= new EventHandler(OnSyncIntervalChanged);
                SyncSpinButton.Value         = 0;
                SyncSpinButton.Sensitive     = false;
                SyncUnitsComboBox.Sensitive  = false;
                SyncSpinButton.ValueChanged += new EventHandler(OnSyncIntervalChanged);
            }
        }
Beispiel #4
0
        private void OnSyncIntervalChanged(object o, EventArgs args)
        {
            if ((currentSyncUnit == SyncUnit.Seconds) && (SyncSpinButton.Value < 5))
            {
                if (oneMinuteLimitNotifyWindow != null)
                {
                    oneMinuteLimitNotifyWindow.Hide();
                    oneMinuteLimitNotifyWindow.Destroy();
                    oneMinuteLimitNotifyWindow = null;
                }
                SyncSpinButton.Value       = 5;
                oneMinuteLimitNotifyWindow =
                    new NotifyWindow(
                        SyncSpinButton, Util.GS("Synchronization Interval Limit"),
                        Util.GS("The synchronization interval cannot be set to less than 5 Seconds.  It will automatically change to 5 seconds."), Gtk.MessageType.Info, 10000);
                oneMinuteLimitNotifyWindow.ShowAll();
            }

            int syncSpinValue =
                CalculateActualSyncInterval((int)SyncSpinButton.Value,
                                            currentSyncUnit);

            try
            {
                lastSyncInterval = syncSpinValue;
                if (lastSyncInterval <= 0)
                {
                    ifws.SetDefaultSyncInterval(-1);
                }
                else
                {
                    ifws.SetDefaultSyncInterval(lastSyncInterval);
                }
            }
            catch (Exception e)
            {
                iFolderExceptionDialog ied = new iFolderExceptionDialog(
                    topLevelWindow, e);
                ied.Run();
                ied.Hide();
                ied.Destroy();
                return;
            }
        }
        /// <summary>
        /// SetSelectedUserRights
        /// </summary>
        /// <param name="rights">Rights</param>
        private void SetSelectedUserRights(string rights)
        {
            TreeModel tModel;

            // User clicked on rights
            TreeSelection tSelect = UserTreeView.Selection;

            Array treePaths =
                tSelect.GetSelectedRows(out tModel);

            foreach (TreePath tPath in treePaths)
            {
                TreeIter iter;

                if (UserTreeStore.GetIter(out iter, tPath))
                {
                    iFolderUser user =
                        (iFolderUser)tModel.GetValue(iter, 0);

                    try
                    {
                        ifws.SetUserRights(ifolder.ID,
                                           user.UserID,
                                           rights);
                        user.Rights = rights;

                        tModel.SetValue(iter, 0, user);
                    }
                    catch (Exception e)
                    {
                        iFolderExceptionDialog ied =
                            new iFolderExceptionDialog(
                                topLevelWindow, e);
                        ied.Run();
                        ied.Hide();
                        ied.Destroy();
                        ied = null;
                    }
                }
            }
        }
Beispiel #6
0
 private void RemoveSelectedFolderHandler()
 {
     iFolderHolder holder = iFolderIconView.SelectedFolder;
        DomainInformation domain = domainController.GetDomain(holder.iFolder.DomainID);
        if(domain == null) return;
        if (holder != null)
        {
     iFolderMsgDialog dialog = new iFolderMsgDialog(
      this,
      iFolderMsgDialog.DialogType.Question,
      iFolderMsgDialog.ButtonSet.YesNo,
      Util.GS("Revert to Normal Folder"),
      Util.GS("Revert this iFolder to a normal folder?"),
      Util.GS("The folder will still be on your computer, but it will no longer synchronize with the iFolder Server."));
     CheckButton deleteFromServerCB;
     if (domain.MemberUserID == holder.iFolder.OwnerID)
      deleteFromServerCB = new CheckButton(Util.GS("_Delete this iFolder from the server"));
     else
      deleteFromServerCB = new CheckButton(Util.GS("_Remove my membership from this iFolder"));
     deleteFromServerCB.Sensitive = domain.Authenticated;
     dialog.ExtraWidget = deleteFromServerCB;
     int rc = dialog.Run();
     dialog.Hide();
     dialog.Destroy();
     if(rc == -8)
     {
      try
      {
       bool removeDefault = false;
       string domainID = holder.iFolder.DomainID;
       if( simws.GetDefaultiFolder( domainID ) == holder.iFolder.ID)
       {
        Debug.PrintLine("Removing default iFolder");
        removeDefault = true;
       }
       iFolderHolder subHolder =
        ifdata.RevertiFolder(holder.iFolder.ID);
       if (deleteFromServerCB.Active)
       {
        if (subHolder == null)
        {
     ifdata.DeleteiFolder(holder.iFolder.ID);
        }
        else
        {
     ifdata.DeleteiFolder(subHolder.iFolder.ID);
        }
        if( removeDefault )
     simws.DefaultAccount(domainID, null);
       UpdateServerInfoForSelectedDomain();
       }
       if( ifolderlistview.Visible )
                                    GLib.Idle.Add(UpdateListViewItemsMainThread);
                    else
        iFoldersIconView.UnselectAll();
      }
      catch(Exception e)
      {
       iFolderExceptionDialog ied =
        new iFolderExceptionDialog(
     this,
     e);
       ied.Run();
       ied.Hide();
       ied.Destroy();
      }
      UpdateSensitivity();
     }
        }
 }
Beispiel #7
0
 private void RemoveMembershipFromSelectedFolder()
 {
     iFolderHolder holder = iFolderIconView.SelectedFolder;
        if (holder != null && holder.iFolder.IsSubscription)
        {
     int rc = 0;
     rc = AskRemoveMembership(holder);
     if(rc != -8)
      return;
     try
     {
      ifdata.DeleteiFolder(holder.iFolder.ID);
      if( ifolderlistview.Visible )
                               GLib.Idle.Add(UpdateListViewItemsMainThread);
                   else
       iFoldersIconView.UnselectAll();
     }
     catch(Exception e)
     {
      iFolderExceptionDialog ied =
       new iFolderExceptionDialog(
        this,
        e);
      ied.Run();
      ied.Hide();
      ied.Destroy();
      return;
     }
        UpdateServerInfoForSelectedDomain();
        }
 }
Beispiel #8
0
 private void DeleteSelectedFolderFromServer()
 {
     iFolderHolder holder = iFolderIconView.SelectedFolder;
        if (holder != null && holder.iFolder.IsSubscription)
        {
     int rc = 0;
     rc = AskDeleteiFolder(holder);
     if(rc != -8)
      return;
     try
     {
      bool removeDefault = false;
      string domainID = holder.iFolder.DomainID;
      if( simws.GetDefaultiFolder( domainID ) == holder.iFolder.ID)
      {
       Debug.PrintLine("Removing default iFolder");
       removeDefault = true;
      }
      if( removeDefault == true )
      {
       Debug.PrintLine("Removing default ifolder");
       simws.DefaultAccount(domainID, null);
      }
      else
       Debug.PrintLine("Not a default account");
      ifdata.DeleteiFolder(holder.iFolder.ID);
      if( ifolderlistview.Visible )
                           GLib.Idle.Add(UpdateListViewItemsMainThread);
                   else
       iFoldersIconView.UnselectAll();
     }
     catch(Exception e)
     {
      iFolderExceptionDialog ied =
       new iFolderExceptionDialog(
        this,
        e);
      ied.Run();
      ied.Hide();
      ied.Destroy();
      return;
     }
        }
 }
 private void OnRemoveAccount(object o, EventArgs args)
 {
     TreeSelection tSelect = AccTreeView.Selection;
        if(tSelect.CountSelectedRows() == 1)
        {
     TreeModel tModel;
     TreeIter iter;
     tSelect.GetSelected(out tModel, out iter);
     string domainID = (string) tModel.GetValue(iter, 0);
     DomainInformation dom = domainController.GetDomain(domainID);
     RemoveAccountDialog rad = new RemoveAccountDialog(dom);
     rad.TransientFor = topLevelWindow;
     int rc = rad.Run();
     rad.Hide();
     if((ResponseType)rc == ResponseType.Yes)
     {
      try
      {
       removedDomains[dom.ID] = dom.ID;
       domainController.RemoveDomain(dom.ID, rad.RemoveiFoldersFromServer);
       RemoveDomain(dom.ID);
      }
      catch(Exception e)
      {
       if (removedDomains.ContainsKey(dom.ID))
        removedDomains.Remove(dom.ID);
       iFolderExceptionDialog ied =
        new iFolderExceptionDialog( topLevelWindow, e);
       ied.Run();
       ied.Hide();
       ied.Destroy();
       rad.Destroy();
       return;
      }
      AddButton.Sensitive = true;
      RemoveButton.Sensitive = false;
      DetailsButton.Sensitive = false;
     }
     rad.Destroy();
        }
 }
Beispiel #10
0
 private void RemoveSelectedFolderHandler()
 {
     iFolderHolder holder = iFoldersIconView.SelectedFolder;
        if (holder != null)
        {
     iFolderMsgDialog dialog = new iFolderMsgDialog(
      this,
      iFolderMsgDialog.DialogType.Question,
      iFolderMsgDialog.ButtonSet.YesNo,
      "",
      Util.GS("Change this iFolder back to a normal folder?"),
      Util.GS("The folder will still be on your computer, but it will no longer synchronize with the iFolder Server."));
     int rc = dialog.Run();
     dialog.Hide();
     dialog.Destroy();
     if(rc == -8)
     {
      try
      {
       ifdata.RevertiFolder(holder.iFolder.ID);
      }
      catch(Exception e)
      {
       iFolderExceptionDialog ied =
        new iFolderExceptionDialog(
     this,
     e);
       ied.Run();
       ied.Hide();
       ied.Destroy();
      }
      UpdateSensitivity();
     }
        }
 }
Beispiel #11
0
 private void ShowFolderProperties(iFolderHolder ifHolder, int desiredPage)
 {
     if (ifHolder != null)
        {
     iFolderPropertiesDialog propsDialog =
      (iFolderPropertiesDialog) PropDialogs[ifHolder.iFolder.ID];
     if (propsDialog == null)
     {
      try
      {
       propsDialog =
        new iFolderPropertiesDialog(this, ifHolder.iFolder, ifws, simws, simiasManager);
       propsDialog.SetPosition(WindowPosition.Center);
       propsDialog.Response +=
     new ResponseHandler(OnPropertiesDialogResponse);
       propsDialog.CurrentPage = desiredPage;
       propsDialog.ShowAll();
       PropDialogs[ifHolder.iFolder.ID] = propsDialog;
      }
      catch(Exception e)
      {
       if(propsDialog != null)
       {
        propsDialog.Hide();
        propsDialog.Destroy();
        propsDialog = null;
       }
       iFolderExceptionDialog ied =
        new iFolderExceptionDialog(this, e);
       ied.Run();
       ied.Hide();
       ied.Destroy();
       ied = null;
      }
     }
     else
     {
      propsDialog.Present();
      propsDialog.CurrentPage = desiredPage;
     }
        }
 }
        private void OnUserSelectorResponse(object o, ResponseArgs args)
        {
            if (UserSelector != null)
            {
                switch (args.ResponseId)
                {
                case Gtk.ResponseType.Ok:
                {
                    foreach (MemberInfo member in UserSelector.SelectedUsers)
                    {
                        if (!curUsers.ContainsKey(member.UserID))
                        {
                            try
                            {
                                /*
                                 * try
                                 * {
                                 *      // Add the member to the domain.  If the member is
                                 *      // already a member of the domain, the call will do
                                 *      // nothing.  This call will facilitate the local
                                 *      // workstation not adding every possible domain user
                                 *      // to the local workstatin until they've actually
                                 *      // been added as an iFolder member.
                                 *      simws.AddMemberToDomain(ifolder.DomainID,
                                 *                                                      member.Name,
                                 *                                                      member.UserID,
                                 *                                                      null,	// FIXME: Where should I get the PublicKey?
                                 *                                                      member.GivenName,
                                 *                                                      member.FamilyName);
                                 * }
                                 * catch {}
                                 */

                                iFolderUser newUser =
                                    ifws.AddAndInviteUser(
                                        ifolder.ID,
                                        member.Name,
                                        member.GivenName,
                                        member.FamilyName,
                                        member.UserID,
                                        null,
                                        "ReadOnly");

                                TreeIter iter =
                                    UserTreeStore.AppendValues(newUser);

                                if (memberFullNames.Contains(newUser.FN))
                                {
                                    // This is a duplicate
                                    duplicateMembers[newUser.FN] = 0;
                                }
                                else
                                {
                                    memberFullNames[newUser.FN] = 0;
                                }

                                curUsers.Add(newUser.UserID, iter);
                            }
                            catch (Exception e)
                            {
                                iFolderExceptionDialog ied =
                                    new iFolderExceptionDialog(
                                        topLevelWindow, e);
                                ied.Run();
                                ied.Hide();
                                ied.Destroy();
                                ied = null;
                                break;
                            }
                        }
                    }
                    UserSelector.Hide();
                    UserSelector.Destroy();
                    UserSelector = null;
                    break;
                }

                case Gtk.ResponseType.Help:
                {
                    Util.ShowHelp("sharewith.html", topLevelWindow);
                    break;
                }

                case Gtk.ResponseType.Cancel:
                {
                    UserSelector.Hide();
                    UserSelector.Destroy();
                    UserSelector = null;
                    break;
                }
                }
            }
        }
Beispiel #13
0
 private bool DisplayCreateOrSetupException(Exception e)
 {
     string primaryText = null;
        string secondaryText = null;
        if (e.Message.IndexOf("Path did not exist") >= 0 || e.Message.IndexOf("URI scheme was not recognized") >= 0)
        {
     primaryText = Util.GS("Invalid folder specified");
     secondaryText = Util.GS("The folder you've specified does not exist.  Please select an existing folder and try again.");
        }
        else if (e.Message.IndexOf("PathExists") >= 0)
        {
     primaryText = Util.GS("A folder with the same name already exists.");
     secondaryText = Util.GS("The location you selected already contains a folder with the same name as this iFolder.  Please select a different location and try again.");
        }
        else if (e.Message.IndexOf("RootOfDrivePath") >= 0)
        {
     primaryText = Util.GS("iFolders cannot exist at the drive level.");
     secondaryText = Util.GS("The location you selected is at the root of the drive.  Please select a location that is not at the root of a drive and try again.");
        }
        else if (e.Message.IndexOf("InvalidCharactersPath") >= 0)
        {
     primaryText = Util.GS("The selected location contains invalid characters.");
     secondaryText = Util.GS("The characters \\:*?\"<>| cannot be used in an iFolder. Please select a different location and try again.");
        }
        else if (e.Message.IndexOf("AtOrInsideStorePath") >= 0)
        {
     primaryText = Util.GS("The selected location is inside the iFolder data folder.");
     secondaryText = Util.GS("The iFolder data folder is normally located in your home folder in the folder \".local/share\".  Please select a different location and try again.");
        }
        else if (e.Message.IndexOf("ContainsStorePath") >= 0)
        {
     primaryText = Util.GS("The selected location contains the iFolder data files.");
     secondaryText = Util.GS("The location you have selected contains the iFolder data files.  These are normally located in your home folder in the folder \".local/share\".  Please select a different location and try again.");
        }
        else if (e.Message.IndexOf("NotFixedDrivePath") >= 0)
        {
     primaryText = Util.GS("The selected location is on a network or non-physical drive.");
     secondaryText = Util.GS("iFolders must reside on a physical drive.  Please select a different location and try again.");
        }
        else if (e.Message.IndexOf("SystemDirectoryPath") >= 0)
        {
     primaryText = Util.GS("The selected location contains a system folder.");
     secondaryText = Util.GS("System folders cannot be contained in an iFolder.  Please select a different location and try again.");
        }
        else if (e.Message.IndexOf("SystemDrivePath") >= 0)
        {
     primaryText = Util.GS("The selected location is a system drive.");
     secondaryText = Util.GS("System drives cannot be contained in an iFolder.  Please select a different location and try again.");
        }
        else if (e.Message.IndexOf("IncludesWinDirPath") >= 0)
        {
     primaryText = Util.GS("The selected location includes the Windows folder.");
     secondaryText = Util.GS("The Windows folder cannot be contained in an iFolder.  Please select a different location and try again.");
        }
        else if (e.Message.IndexOf("IncludesProgFilesPath") >= 0)
        {
     primaryText = Util.GS("The selected location includes the Program Files folder.");
     secondaryText = Util.GS("The Program Files folder cannot be contained in an iFolder.  Please select a different location and try again.");
        }
        else if (e.Message.IndexOf("DoesNotExistPath") >= 0)
        {
     primaryText = Util.GS("The selected location does not exist.");
     secondaryText = Util.GS("iFolders can only be created from folders that exist.  Please select a different location and try again.");
        }
        else if (e.Message.IndexOf("NoReadRightsPath") >= 0)
        {
     primaryText = Util.GS("You do not have access to read files in the selected location.");
     secondaryText = Util.GS("iFolders can only be created from folders where you have access to read and write files.  Please select a different location and try again.");
        }
        else if (e.Message.IndexOf("NoWriteRightsPath") >= 0)
        {
     primaryText = Util.GS("You do not have access to write files in the selected location.");
     secondaryText = Util.GS("iFolders can only be created from folders where you have access to read and write files.  Please select a different location and try again.");
        }
        else if (e.Message.IndexOf("ContainsCollectionPath") >= 0)
        {
     primaryText = Util.GS("The selected location already contains an iFolder.");
     secondaryText = Util.GS("iFolders cannot exist inside other iFolders.  Please select a different location and try again.");
        }
        else if (e.Message.IndexOf("AtOrInsideCollectionPath") >= 0)
        {
     primaryText = Util.GS("The selected location is inside another iFolder.");
     secondaryText = Util.GS("iFolders cannot exist inside other iFolders.  Please select a different location and try again.");
        }
        if (primaryText != null)
        {
     iFolderMsgDialog dg = new iFolderMsgDialog(
      this,
      iFolderMsgDialog.DialogType.Warning,
      iFolderMsgDialog.ButtonSet.Ok,
      "",
      primaryText,
      secondaryText);
      dg.Run();
      dg.Hide();
      dg.Destroy();
      return true;
        }
        else
        {
     iFolderExceptionDialog ied =
      new iFolderExceptionDialog(
       this,
       e);
     ied.Run();
     ied.Hide();
     ied.Destroy();
        }
        return false;
 }
 private void OnUserSelectorResponse(object o, ResponseArgs args)
 {
     if(UserSelector != null)
        {
     switch(args.ResponseId)
     {
      case Gtk.ResponseType.Ok:
      {
       foreach(MemberInfo member in UserSelector.SelectedUsers)
       {
        if(!curUsers.ContainsKey(member.UserID))
        {
     try
     {
     iFolderUser newUser =
      ifws.AddAndInviteUser(
       ifolder.ID,
       member.Name,
       member.GivenName,
       member.FamilyName,
       member.UserID,
       null,
       "ReadWrite" );
      TreeIter iter =
       UserTreeStore.AppendValues(newUser);
      if (memberFullNames.Contains(newUser.FN))
      {
       duplicateMembers[newUser.FN] = 0;
      }
      else
       memberFullNames[newUser.FN] = 0;
      curUsers.Add(newUser.UserID, iter);
     }
     catch(Exception e)
     {
      iFolderExceptionDialog ied =
        new iFolderExceptionDialog(
      topLevelWindow, e);
      ied.Run();
      ied.Hide();
      ied.Destroy();
      ied = null;
      break;
     }
        }
       }
       UserSelector.Hide();
       UserSelector.Destroy();
       UserSelector = null;
       break;
      }
      case Gtk.ResponseType.Help:
      {
       Util.ShowHelp("sharewith.html#bq6lwm0", topLevelWindow);
       break;
      }
      case Gtk.ResponseType.Cancel:
      {
       UserSelector.Hide();
       UserSelector.Destroy();
       UserSelector = null;
       break;
      }
     }
        }
 }
        /// <summary>
        /// Event Handler for Remove User
        /// </summary>
        private void OnRemoveUser(object o, EventArgs args)
        {
            TreeModel tModel;

            TreeSelection tSelect = UserTreeView.Selection;

            if (tSelect.CountSelectedRows() > 0)
            {
                iFolderMsgDialog dialog = new iFolderMsgDialog(
                    topLevelWindow,
                    iFolderMsgDialog.DialogType.Question,
                    iFolderMsgDialog.ButtonSet.YesNo,
                    "",
                    Util.GS("Remove the selected users?"),
                    Util.GS("This will remove the selected users from this iFolder.  They will no longer be able to synchronize files with this iFolder."));
                int rc = dialog.Run();
                dialog.Hide();
                dialog.Destroy();
                if (rc == -8)
                {
                    Queue iterQueue;
                    Array treePaths = tSelect.GetSelectedRows(out tModel);

                    iterQueue = new Queue();

                    foreach (TreePath tPath in treePaths)
                    {
                        TreeIter iter;

                        if (UserTreeStore.GetIter(out iter, tPath))
                        {
                            iterQueue.Enqueue(iter);
                        }
                    }
                    // Now that we have all of the TreeIters, loop and
                    // remove them all
                    while (iterQueue.Count > 0)
                    {
                        TreeIter iter = (TreeIter)iterQueue.Dequeue();

                        iFolderUser user =
                            (iFolderUser)tModel.GetValue(iter, 0);

                        try
                        {
                            ifws.RemoveiFolderUser(ifolder.ID,
                                                   user.UserID);
                            UserTreeStore.Remove(ref iter);
                            curUsers.Remove(user.UserID);
                        }
                        catch (Exception e)
                        {
                            iFolderExceptionDialog ied =
                                new iFolderExceptionDialog(
                                    topLevelWindow, e);
                            ied.Run();
                            ied.Hide();
                            ied.Destroy();
                            ied = null;
                        }
                    }
                }
            }
        }
 private void OnSyncIntervalChanged(object o, EventArgs args)
 {
     if ((currentSyncUnit == SyncUnit.Seconds) && (SyncSpinButton.Value < 5) )
        {
        if (oneMinuteLimitNotifyWindow != null)
        {
       oneMinuteLimitNotifyWindow.Hide();
        oneMinuteLimitNotifyWindow.Destroy();
        oneMinuteLimitNotifyWindow = null;
        }
        SyncSpinButton.Value = 5;
        oneMinuteLimitNotifyWindow =
      new NotifyWindow(
       SyncSpinButton, Util.GS("Synchronization Interval Limit"),
       Util.GS("The synchronization interval cannot be set to less than 5 Seconds.  It will automatically change to 5 seconds."), Gtk.MessageType.Info, 10000);
       oneMinuteLimitNotifyWindow.ShowAll();
        }
        int syncSpinValue =
     CalculateActualSyncInterval((int)SyncSpinButton.Value,
        currentSyncUnit);
        try
        {
     lastSyncInterval = syncSpinValue;
     if(lastSyncInterval <= 0)
     {
      ifws.SetDefaultSyncInterval(-1);
     }
     else
     {
      ifws.SetDefaultSyncInterval(lastSyncInterval);
     }
        }
        catch(Exception e)
        {
     iFolderExceptionDialog ied = new iFolderExceptionDialog(
      topLevelWindow, e);
     ied.Run();
     ied.Hide();
     ied.Destroy();
     return;
        }
 }
 private void SaveLimit()
 {
     long sizeLimit = GetCurrentLimit();
     try
        {
     ifws.SetiFolderDiskSpaceLimit(ifolder.ID, sizeLimit);
        }
        catch(Exception e)
        {
     iFolderExceptionDialog ied = new iFolderExceptionDialog(
     topLevelWindow, e);
     ied.Run();
     ied.Hide();
     ied.Destroy();
     return;
        }
 }
 private void OnSyncNowClicked(object o, EventArgs args)
 {
     try
        {
     ifws.SynciFolderNow(ifolder.ID);
        }
        catch(Exception e)
        {
     iFolderExceptionDialog ied = new iFolderExceptionDialog(
     topLevelWindow, e);
     ied.Run();
     ied.Hide();
     ied.Destroy();
     return;
        }
 }
 private void OnAccessClicked(object o, EventArgs args)
 {
     TreeModel tModel;
        iFolderAccessDialog accDialog = null;
        string defaultRights = "ReadWrite";
        string userName = null;
        bool allowOwner = false;
        TreeSelection tSelect = UserTreeView.Selection;
        if(tSelect.CountSelectedRows() == 1)
        {
     Array treePaths = tSelect.GetSelectedRows(out tModel);
     foreach(TreePath tPath in treePaths)
     {
      TreeIter iter;
      if(UserTreeStore.GetIter(out iter, tPath))
      {
       iFolderUser user =
     (iFolderUser) tModel.GetValue(iter, 0);
       if (user.FN != null)
        userName = user.FN;
       else
        userName = user.Name;
       defaultRights = user.Rights;
       if( (ifolder.CurrentUserID == ifolder.OwnerID) &&
        (user.State == "Member") )
        allowOwner = true;
      }
      break;
     }
        }
        accDialog = new iFolderAccessDialog(
     topLevelWindow, userName, defaultRights, allowOwner);
        int rc = accDialog.Run();
        accDialog.Hide();
        if(rc == -5)
        {
     string newrights = accDialog.Rights;
     string oldOwnerID;
     Array treePaths = tSelect.GetSelectedRows(out tModel);
     foreach(TreePath tPath in treePaths)
     {
      TreeIter iter;
      if(UserTreeStore.GetIter(out iter, tPath))
      {
       iFolderUser user =
     (iFolderUser) tModel.GetValue(iter,0);
       try
       {
       ifws.SetUserRights( ifolder.ID,
     user.UserID,
     newrights);
        user.Rights = newrights;
        if(accDialog.IsOwner)
        {
     ifws.ChangeOwner( ifolder.ID,
      user.UserID,
      "Admin");
     oldOwnerID = ifolder.OwnerID;
     user.Rights = "Admin";
     ifolder.Owner = user.Name;
     ifolder.OwnerID = user.UserID;
     TreeIter ownIter;
     if(UserTreeStore.GetIterFirst(out ownIter))
     {
      do
      {
       iFolderUser ownUser = (iFolderUser)
        UserTreeStore.GetValue(ownIter,0);
       if(oldOwnerID == ownUser.UserID)
       {
        ownUser.Rights = "Admin";
        tModel.SetValue(ownIter,
         0, ownUser);
        break;
       }
      }
      while(UserTreeStore.IterNext(ref ownIter));
     }
        }
        tModel.SetValue(iter, 0, user);
       }
       catch(Exception e)
       {
        iFolderExceptionDialog ied =
      new iFolderExceptionDialog(
        topLevelWindow, e);
        ied.Run();
        ied.Hide();
        ied.Destroy();
        ied = null;
       }
      }
     }
        }
        accDialog.Destroy();
        accDialog = null;
 }
Beispiel #20
0
 private void RemoveSelectedFolderHandler()
 {
     iFolderHolder holder = iFoldersIconView.SelectedFolder;
        if (holder != null)
        {
     iFolderMsgDialog dialog = new iFolderMsgDialog(
      this,
      iFolderMsgDialog.DialogType.Question,
      iFolderMsgDialog.ButtonSet.YesNo,
      "",
      Util.GS("Revert this iFolder back to a normal folder?"),
      Util.GS("The folder will still be on your computer, but it will no longer synchronize with the iFolder Server."));
     CheckButton deleteFromServerCB;
     DomainInformation domain =
      domainController.GetDomain(holder.iFolder.DomainID);
     if (domain == null || domain.MemberUserID == holder.iFolder.OwnerID)
      deleteFromServerCB = new CheckButton(Util.GS("Also _delete this iFolder from the server"));
     else
      deleteFromServerCB = new CheckButton(Util.GS("Also _remove my membership from this iFolder"));
     dialog.ExtraWidget = deleteFromServerCB;
     int rc = dialog.Run();
     dialog.Hide();
     dialog.Destroy();
     if(rc == -8)
     {
      try
      {
       iFolderHolder subHolder =
        ifdata.RevertiFolder(holder.iFolder.ID);
       if (deleteFromServerCB.Active)
       {
        if (subHolder == null)
     ifdata.DeleteiFolder(holder.iFolder.ID);
        else
     ifdata.DeleteiFolder(subHolder.iFolder.ID);
       }
       iFoldersIconView.UnselectAll();
      }
      catch(Exception e)
      {
       iFolderExceptionDialog ied =
        new iFolderExceptionDialog(
     this,
     e);
       ied.Run();
       ied.Hide();
       ied.Destroy();
      }
      UpdateSensitivity();
     }
        }
 }
 private void OnRemoveUser(object o, EventArgs args)
 {
     TreeModel tModel;
        TreeSelection tSelect = UserTreeView.Selection;
        if(tSelect.CountSelectedRows() > 0)
        {
     iFolderMsgDialog dialog = new iFolderMsgDialog(
      topLevelWindow,
      iFolderMsgDialog.DialogType.Question,
      iFolderMsgDialog.ButtonSet.YesNo,
      "",
      Util.GS("Remove the selected users?"),
      Util.GS("This will remove the selected users from this iFolder.  They will no longer be able to synchronize files with this iFolder."));
     int rc = dialog.Run();
     dialog.Hide();
     dialog.Destroy();
     if(rc == -8)
     {
      Queue iterQueue;
      Array treePaths = tSelect.GetSelectedRows(out tModel);
      iterQueue = new Queue();
      foreach(TreePath tPath in treePaths)
      {
       TreeIter iter;
       if(UserTreeStore.GetIter(out iter, tPath))
       {
        iterQueue.Enqueue(iter);
       }
      }
      while(iterQueue.Count > 0)
      {
       TreeIter iter = (TreeIter) iterQueue.Dequeue();
       iFolderUser user =
     (iFolderUser) tModel.GetValue(iter, 0);
       try
       {
        ifws.RemoveiFolderUser(ifolder.ID,
      user.UserID);
        UserTreeStore.Remove(ref iter);
        curUsers.Remove(user.UserID);
       }
       catch(Exception e)
       {
        iFolderExceptionDialog ied =
      new iFolderExceptionDialog(
        topLevelWindow, e);
        ied.Run();
        ied.Hide();
        ied.Destroy();
        ied = null;
       }
      }
     }
        }
 }
        /// <summary>
        /// Event handler for Access Clicked
        /// </summary>
        private void OnAccessClicked(object o, EventArgs args)
        {
            TreeModel           tModel;
            iFolderAccessDialog accDialog = null;
            string defaultRights          = "ReadWrite";
            string userName   = null;
            bool   allowOwner = false;

            TreeSelection tSelect = UserTreeView.Selection;

            // only allow the changing of the owner if the current
            // user is the owner and if the selected users are members
            if (tSelect.CountSelectedRows() == 1)
            {
                Array treePaths = tSelect.GetSelectedRows(out tModel);

                foreach (TreePath tPath in treePaths)
                {
                    TreeIter iter;

                    if (UserTreeStore.GetIter(out iter, tPath))
                    {
                        iFolderUser user =
                            (iFolderUser)tModel.GetValue(iter, 0);
                        if (user.FN != null)
                        {
                            userName = user.FN;
                        }
                        else
                        {
                            userName = user.Name;
                        }
                        defaultRights = user.Rights;

                        if ((ifolder.CurrentUserID == ifolder.OwnerID) &&
                            (user.State == "Member"))
                        {
                            allowOwner = true;
                        }
                    }
                    break;
                }
            }

            accDialog = new iFolderAccessDialog(
                topLevelWindow, userName, defaultRights, allowOwner);

            int rc = accDialog.Run();

            accDialog.Hide();
            if (rc == -5)
            {
                string newrights = accDialog.Rights;
                string oldOwnerID;

                Array treePaths = tSelect.GetSelectedRows(out tModel);

                foreach (TreePath tPath in treePaths)
                {
                    TreeIter iter;

                    if (UserTreeStore.GetIter(out iter, tPath))
                    {
                        iFolderUser user =
                            (iFolderUser)tModel.GetValue(iter, 0);

                        try
                        {
                            ifws.SetUserRights(ifolder.ID,
                                               user.UserID,
                                               newrights);
                            user.Rights = newrights;

                            // if the user selected to make this
                            // use the owner set that right now
                            if (accDialog.IsOwner)
                            {
                                if (ifws.CanOwnerBeChanged(user.UserID, ifolder.DomainID))
                                {
                                    ifws.ChangeOwner(ifolder.ID,
                                                     user.UserID,
                                                     "Admin");

                                    // update the objects here instead of
                                    // re-reading them, that's expensive!
                                    oldOwnerID      = ifolder.OwnerID;
                                    user.Rights     = "Admin";
                                    ifolder.Owner   = user.Name;
                                    ifolder.OwnerID = user.UserID;

                                    // now loop through the users, find
                                    // the current owner, and set him to
                                    // not be the owner any more
                                    TreeIter ownIter;
                                    if (UserTreeStore.GetIterFirst(out ownIter))
                                    {
                                        do
                                        {
                                            iFolderUser ownUser = (iFolderUser)
                                                                  UserTreeStore.GetValue(ownIter, 0);
                                            if (oldOwnerID == ownUser.UserID)
                                            {
                                                ownUser.Rights = "Admin";
                                                tModel.SetValue(ownIter,
                                                                0, ownUser);
                                                break;
                                            }
                                        }while(UserTreeStore.IterNext(ref ownIter));
                                    }
                                }
                                else
                                {
                                    iFolderMsgDialog messdialog = new iFolderMsgDialog(
                                        null,
                                        iFolderMsgDialog.DialogType.Error,
                                        iFolderMsgDialog.ButtonSet.Ok,
                                        Util.GS("Policy Violation"),
                                        String.Format(Util.GS("Ownership of the iFolder {0} could not be transferred to {1} as it is violating the limit of iFolders set by the Administrator."), ifolder.Name, user.Name), Util.GS(" "));
                                    messdialog.Run();
                                    messdialog.Hide();
                                    messdialog.Destroy();
                                }
                            }

                            tModel.SetValue(iter, 0, user);
                        }
                        catch (Exception e)
                        {
                            iFolderExceptionDialog ied =
                                new iFolderExceptionDialog(
                                    topLevelWindow, e);
                            ied.Run();
                            ied.Hide();
                            ied.Destroy();
                            ied = null;
                        }
                    }
                }
            }
            accDialog.Destroy();
            accDialog = null;
        }
 private void SetSelectedUserRights(string rights)
 {
     TreeModel tModel;
        TreeSelection tSelect = UserTreeView.Selection;
        Array treePaths =
      tSelect.GetSelectedRows(out tModel);
        foreach(TreePath tPath in treePaths)
        {
     TreeIter iter;
     if(UserTreeStore.GetIter(out iter, tPath))
     {
      iFolderUser user =
       (iFolderUser) tModel.GetValue(iter, 0);
      try
      {
      ifws.SetUserRights( ifolder.ID,
        user.UserID,
        rights);
       user.Rights = rights;
       tModel.SetValue(iter, 0, user);
      }
      catch(Exception e)
      {
       iFolderExceptionDialog ied =
     new iFolderExceptionDialog(
       topLevelWindow, e);
       ied.Run();
       ied.Hide();
       ied.Destroy();
       ied = null;
      }
     }
        }
 }
 private void OnAccessClicked(object o, EventArgs args)
 {
     TreeModel tModel;
        iFolderAccessDialog accDialog = null;
        string defaultRights = "ReadWrite";
        string userName = null;
        bool allowOwner = false;
        TreeSelection tSelect = UserTreeView.Selection;
        if(tSelect.CountSelectedRows() == 1)
        {
     Array treePaths = tSelect.GetSelectedRows(out tModel);
     foreach(TreePath tPath in treePaths)
     {
      TreeIter iter;
      if(UserTreeStore.GetIter(out iter, tPath))
      {
       iFolderUser user =
     (iFolderUser) tModel.GetValue(iter, 0);
       if (user.FN != null)
        userName = user.FN;
       else
        userName = user.Name;
       defaultRights = user.Rights;
       if( (ifolder.CurrentUserID == ifolder.OwnerID) &&
        (user.State == "Member") )
        allowOwner = true;
      }
      break;
     }
        }
        accDialog = new iFolderAccessDialog(
     topLevelWindow, userName, defaultRights, allowOwner);
        int rc = accDialog.Run();
        accDialog.Hide();
        if(rc == -5)
        {
     string newrights = accDialog.Rights;
     string oldOwnerID;
     Array treePaths = tSelect.GetSelectedRows(out tModel);
     foreach(TreePath tPath in treePaths)
     {
      TreeIter iter;
      if(UserTreeStore.GetIter(out iter, tPath))
      {
       iFolderUser user =
     (iFolderUser) tModel.GetValue(iter,0);
       try
       {
       ifws.SetUserRights( ifolder.ID,
     user.UserID,
     newrights);
        user.Rights = newrights;
        if(accDialog.IsOwner)
        {
     if( ifws.CanOwnerBeChanged(user.UserID,ifolder.DomainID))
     {
      ifws.ChangeOwner( ifolder.ID,
      user.UserID,
      "Admin");
      oldOwnerID = ifolder.OwnerID;
      user.Rights = "Admin";
      ifolder.Owner = user.Name;
      ifolder.OwnerID = user.UserID;
      TreeIter ownIter;
      if(UserTreeStore.GetIterFirst(out ownIter))
      {
       do
       {
        iFolderUser ownUser = (iFolderUser)
        UserTreeStore.GetValue(ownIter,0);
        if(oldOwnerID == ownUser.UserID)
        {
     ownUser.Rights = "Admin";
     tModel.SetValue(ownIter,
          0, ownUser);
     break;
        }
       }
       while(UserTreeStore.IterNext(ref ownIter));
      }
     }
     else
     {
      iFolderMsgDialog messdialog = new iFolderMsgDialog(
                                      null,
                                      iFolderMsgDialog.DialogType.Error,
                                      iFolderMsgDialog.ButtonSet.Ok,
                                      Util.GS("Policy Violation"),
                                      String.Format(Util.GS("Ownership of the iFolder {0} could not be transferred to {1} as it is violating the limit of iFolders set by the Administrator."),ifolder.Name,user.Name),Util.GS(" "));
                              messdialog.Run();
                              messdialog.Hide();
                              messdialog.Destroy();
     }
        }
        tModel.SetValue(iter, 0, user);
       }
       catch(Exception e)
       {
        iFolderExceptionDialog ied =
      new iFolderExceptionDialog(
        topLevelWindow, e);
        ied.Run();
        ied.Hide();
        ied.Destroy();
        ied = null;
       }
      }
     }
        }
        accDialog.Destroy();
        accDialog = null;
 }
Beispiel #25
0
 private void RemoveMembershipFromSelectedFolder()
 {
     iFolderHolder holder = iFoldersIconView.SelectedFolder;
        if (holder != null && holder.iFolder.IsSubscription)
        {
     int rc = 0;
     rc = AskRemoveMembership(holder);
     if(rc != -8)
      return;
     try
     {
      ifdata.DeleteiFolder(holder.iFolder.ID);
      iFoldersIconView.UnselectAll();
     }
     catch(Exception e)
     {
      iFolderExceptionDialog ied =
       new iFolderExceptionDialog(
        this,
        e);
      ied.Run();
      ied.Hide();
      ied.Destroy();
      return;
     }
        }
 }
 private void OnAutoSyncButton(object o, EventArgs args)
 {
     if(AutoSyncCheckButton.Active == true)
        {
     SyncSpinButton.Sensitive = true;
     SyncUnitsComboBox.Sensitive = true;
     SyncUnitsComboBox.Changed -= new EventHandler(OnSyncUnitsChanged);
     SyncUnitsComboBox.Active = (int)SyncUnit.Minutes;
     currentSyncUnit = SyncUnit.Minutes;
     SaveSyncUnitConfig();
     SyncUnitsComboBox.Changed += new EventHandler(OnSyncUnitsChanged);
     SyncSpinButton.Value = 5;
        }
        else
        {
     if (oneMinuteLimitNotifyWindow != null)
     {
      oneMinuteLimitNotifyWindow.Hide();
      oneMinuteLimitNotifyWindow.Destroy();
      oneMinuteLimitNotifyWindow = null;
     }
     try
     {
      ifws.SetDefaultSyncInterval(-1);
     }
     catch(Exception e)
     {
      iFolderExceptionDialog ied = new iFolderExceptionDialog(
       topLevelWindow, e);
      ied.Run();
      ied.Hide();
      ied.Destroy();
      return;
     }
     SyncSpinButton.Value = 0;
     SyncSpinButton.Sensitive = false;
     SyncUnitsComboBox.Sensitive = false;
        }
 }
Beispiel #27
0
 private void ResolveConflicts(iFolderHolder holder)
 {
     if (holder == null) return;
        iFolderConflictDialog conflictDialog =
     (iFolderConflictDialog) ConflictDialogs[holder.iFolder.ID];
        if (conflictDialog == null)
        {
     try
     {
      conflictDialog =
       new iFolderConflictDialog(
        this, holder.iFolder, ifws, simws);
      conflictDialog.SetPosition(WindowPosition.Center);
      conflictDialog.Response +=
       new ResponseHandler(OnConflictDialogResponse);
      conflictDialog.ShowAll();
      ConflictDialogs[holder.iFolder.ID] = conflictDialog;
     }
     catch(Exception e)
     {
      if(conflictDialog != null)
      {
       conflictDialog.Hide();
       conflictDialog.Destroy();
       conflictDialog = null;
      }
      iFolderExceptionDialog ied =
       new iFolderExceptionDialog(this, e);
      ied.Run();
      ied.Hide();
      ied.Destroy();
      ied = null;
     }
        }
        else
        {
     conflictDialog.Present();
        }
 }
 private void OnSyncIntervalChanged(object o, EventArgs args)
 {
     if (oneMinuteLimitNotifyWindow != null)
        {
     oneMinuteLimitNotifyWindow.Hide();
     oneMinuteLimitNotifyWindow.Destroy();
     oneMinuteLimitNotifyWindow = null;
        }
        int syncSpinValue =
     CalculateActualSyncInterval((int)SyncSpinButton.Value,
        currentSyncUnit);
        try
        {
     lastSyncInterval = syncSpinValue;
     if(lastSyncInterval <= 0)
     {
      ifws.SetDefaultSyncInterval(-1);
     }
     else
     {
      ifws.SetDefaultSyncInterval(lastSyncInterval);
     }
        }
        catch(Exception e)
        {
     iFolderExceptionDialog ied = new iFolderExceptionDialog(
      topLevelWindow, e);
     ied.Run();
     ied.Hide();
     ied.Destroy();
     return;
        }
 }
Beispiel #29
0
 private void SyncSelectedFolder()
 {
     iFolderHolder holder = iFoldersIconView.SelectedFolder;
        if (holder != null)
        {
     try
     {
     ifws.SynciFolderNow(holder.iFolder.ID);
     }
     catch(Exception e)
     {
      iFolderExceptionDialog ied =
       new iFolderExceptionDialog(
        this,
        e);
      ied.Run();
      ied.Hide();
      ied.Destroy();
     }
        }
 }
 private void OnSyncUnitsChanged(object o, EventArgs args)
 {
     if (oneMinuteLimitNotifyWindow != null)
        {
     oneMinuteLimitNotifyWindow.Hide();
     oneMinuteLimitNotifyWindow.Destroy();
     oneMinuteLimitNotifyWindow = null;
        }
        int syncSpinValue = (int)SyncSpinButton.Value;
        currentSyncUnit = (SyncUnit)SyncUnitsComboBox.Active;
        if (currentSyncUnit == SyncUnit.Seconds)
        {
     SyncSpinButton.Adjustment.Lower = 60;
     if (syncSpinValue < 60)
     {
      oneMinuteLimitNotifyWindow =
       new NotifyWindow(
       SyncSpinButton, Util.GS("Synchronization Interval Limit"),
       Util.GS("The synchronization interval cannot be set to less than one minute.  It was automatically changed to 60 seconds."),
       Gtk.MessageType.Info, 10000);
      oneMinuteLimitNotifyWindow.ShowAll();
      SyncSpinButton.ValueChanged -=
       new EventHandler(OnSyncIntervalChanged);
      SyncSpinButton.Value = 60;
      syncSpinValue = 60;
      SyncSpinButton.ValueChanged +=
       new EventHandler(OnSyncIntervalChanged);
     }
        }
        else
        {
     SyncSpinButton.Adjustment.Lower = 1;
        }
        int syncInterval =
     CalculateActualSyncInterval(syncSpinValue,
        currentSyncUnit);
        try
        {
     lastSyncInterval = syncInterval;
     if(lastSyncInterval <= 0)
     {
      ifws.SetDefaultSyncInterval(-1);
     }
     else
     {
      ifws.SetDefaultSyncInterval(lastSyncInterval);
     }
     SaveSyncUnitConfig();
        }
        catch(Exception e)
        {
     iFolderExceptionDialog ied = new iFolderExceptionDialog(
      topLevelWindow, e);
     ied.Run();
     ied.Hide();
     ied.Destroy();
     return;
        }
 }