Ejemplo n.º 1
0
 private void OniFolderClicked(object o, iFolderClickedArgs args)
 {
     iFolderHolder holder = args.Holder;
        if (holder == null) return;
        switch(args.Button)
        {
     case 3:
      Menu menu = new Menu();
      if (holder.iFolder.IsSubscription)
      {
       MenuItem item_download =
        new MenuItem(Util.GS("Download..."));
       menu.Append(item_download);
       item_download.Activated += new EventHandler(
     DownloadAvailableiFolderHandler);
       menu.Append(new SeparatorMenuItem());
       DomainInformation domain =
        domainController.GetDomain(holder.iFolder.DomainID);
       if (domain == null ||
        domain.MemberUserID == holder.iFolder.OwnerID)
       {
        MenuItem item_delete = new MenuItem (
      Util.GS("Delete from server"));
        menu.Append (item_delete);
        item_delete.Activated += new EventHandler(
      DeleteFromServerHandler);
       }
       else
       {
        MenuItem item_remove_membership = new MenuItem (
      Util.GS("Remove my membership"));
        menu.Append (item_remove_membership);
        item_remove_membership.Activated +=
     new EventHandler(
      RemoveMembershipHandler);
       }
      }
      else
      {
       MenuItem item_open =
        new MenuItem (Util.GS("Open..."));
       menu.Append (item_open);
       item_open.Activated += new EventHandler(
     OnOpenFolderMenu);
       menu.Append(new SeparatorMenuItem());
       if(holder.iFolder.HasConflicts)
       {
        MenuItem item_resolve = new MenuItem (
      Util.GS("Resolve conflicts..."));
        menu.Append (item_resolve);
        item_resolve.Activated += new EventHandler(
     OnResolveConflicts);
        menu.Append(new SeparatorMenuItem());
       }
       MenuItem item_sync =
        new MenuItem(Util.GS("Synchronize now"));
       menu.Append (item_sync);
       item_sync.Activated += new EventHandler(
     OnSynchronizeNow);
       MenuItem item_share =
        new MenuItem (Util.GS("Share with..."));
       menu.Append (item_share);
       item_share.Activated += new EventHandler(
     OnShareSynchronizedFolder);
       if (!holder.iFolder.Role.Equals("Master"))
       {
        MenuItem item_revert = new MenuItem (
      Util.GS("Revert to a normal folder"));
        menu.Append (item_revert);
        item_revert.Activated += new EventHandler(
      RemoveiFolderHandler);
       }
       else if(holder.iFolder.OwnerID !=
       holder.iFolder.CurrentUserID)
       {
        MenuItem item_delete = new MenuItem (
      Util.GS("Revert to a normal folder"));
        menu.Append (item_delete);
        item_delete.Activated += new EventHandler(
      RemoveiFolderHandler);
       }
       menu.Append(new SeparatorMenuItem());
       MenuItem item_properties =
        new MenuItem (Util.GS("Properties"));
       menu.Append (item_properties);
       item_properties.Activated +=
        new EventHandler(OnShowFolderProperties);
      }
      menu.ShowAll();
      menu.Popup(null, null, null,
       IntPtr.Zero, 3,
       Gtk.Global.CurrentEventTime);
      break;
     default:
      break;
        }
 }
Ejemplo n.º 2
0
 private void OniFolderIconViewBackgroundClicked(object o, iFolderClickedArgs args)
 {
     iFoldersIconView.UnselectAll();
        if (args.Button == 3)
        {
     Menu menu = new Menu();
     MenuItem item_refresh =
      new MenuItem(Util.GS("Refresh"));
     menu.Append(item_refresh);
     item_refresh.Activated += new EventHandler(
      RefreshiFoldersHandler);
     menu.ShowAll();
     menu.Popup(null, null, null,
      IntPtr.Zero, 3,
      Gtk.Global.CurrentEventTime);
        }
 }
Ejemplo n.º 3
0
 private void OniFolderClicked(object o, iFolderClickedArgs args)
 {
     iFolderHolder holder = iFolderIconView.SelectedFolder;
        if (holder == null) return;
        switch(args.Button)
        {
     case 3:
      Menu menu = new Menu();
      if (holder.iFolder.IsSubscription)
      {
       MenuItem item_download =
        new MenuItem(Util.GS("Download..."));
       menu.Append(item_download);
       item_download.Activated += new EventHandler(
     DownloadAvailableiFolderHandler);
       menu.Append(new SeparatorMenuItem());
       MenuItem item_merge =
        new MenuItem(Util.GS("Merge"));
       menu.Append(item_merge);
       item_merge.Activated += new EventHandler(MergeAvailableiFolderHandler);
       menu.Append(new SeparatorMenuItem());
       if ( holder.iFolder.CurrentUserID== holder.iFolder.OwnerID)
       {
        MenuItem item_delete = new MenuItem (
      Util.GS("Delete from Server"));
        menu.Append (item_delete);
        item_delete.Activated += new EventHandler(
      DeleteFromServerHandler);
       }
       else
       {
        MenuItem item_remove_membership = new MenuItem (
      Util.GS("Remove My Membership"));
        menu.Append (item_remove_membership);
        item_remove_membership.Activated +=
     new EventHandler(
      RemoveMembershipHandler);
       }
      }
      else
      {
       MenuItem item_open =
        new MenuItem (Util.GS("Open..."));
       menu.Append (item_open);
       item_open.Activated += new EventHandler(
     OnOpenFolderMenu);
       menu.Append(new SeparatorMenuItem());
       if(holder.iFolder.HasConflicts)
       {
        MenuItem item_resolve = new MenuItem (
      Util.GS("Resolve conflicts..."));
        menu.Append (item_resolve);
        item_resolve.Activated += new EventHandler(
     OnResolveConflicts);
        menu.Append(new SeparatorMenuItem());
       }
       MenuItem item_sync =
        new MenuItem(Util.GS("Synchronize Now"));
       menu.Append (item_sync);
       item_sync.Activated += new EventHandler(
     OnSynchronizeNow);
       MenuItem item_share =
        new MenuItem (Util.GS("Share with..."));
       menu.Append (item_share);
       item_share.Activated += new EventHandler(
     OnShareSynchronizedFolder);
       if (!holder.iFolder.Role.Equals("Master"))
       {
        MenuItem item_revert = new MenuItem (
      Util.GS("Revert to a Normal Folder"));
       menu.Append (item_revert);
        if (false == this.RevertMenuItem.Sensitive)
        {
        item_revert.Sensitive = false;
        }
        else
        {
        item_revert.Activated += new EventHandler(
      RemoveiFolderHandler);
        }
       }
       else if (holder.iFolder.OwnerID !=
       holder.iFolder.CurrentUserID)
       {
        MenuItem item_delete = new MenuItem (
      Util.GS("Revert to a normal folder"));
        menu.Append (item_delete);
        if (false == this.RemoveiFolderButton.Sensitive)
                     {
                          item_delete.Sensitive = false;
                     }
                     else
        {
     item_delete.Activated += new EventHandler(RemoveiFolderHandler);
        }
       }
       menu.Append(new SeparatorMenuItem());
       MenuItem item_properties =
        new MenuItem (Util.GS("Properties"));
       menu.Append (item_properties);
       item_properties.Activated +=
        new EventHandler(OnShowFolderProperties);
       if (holder.State == iFolderState.Initial && holder.iFolder.State == "Available")
       {
       item_share.Sensitive = false;
        item_properties.Sensitive = false;
       }
       else
       {
       item_share.Sensitive = true;
        item_properties.Sensitive = true;
       }
      }
      menu.ShowAll();
      menu.Popup(null, null, null,
       IntPtr.Zero, 3,
       Gtk.Global.CurrentEventTime);
      break;
     default:
      break;
        }
 }