Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Evergreen:11.2:Test
ifolder3
ifolder_client_crash.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File ifolder_client_crash.patch of Package ifolder3
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' src/UI/Linux/LinuxClient/application/iFolderApplication.cs src/UI/Linux/LinuxClient/application/iFolderApplication.cs --- src/UI/Linux/LinuxClient/application/iFolderApplication.cs 2009-06-02 10:16:48.000000000 +0530 +++ src/UI/Linux/LinuxClient/application/iFolderApplication.cs 2009-10-22 04:11:26.000000000 +0530 @@ -119,6 +119,10 @@ private iFolderMsgDialog quitDlg; private bool quit_iFolder; + + private Status ClientUpgradeStatus; + private string NewClientVersion; + private string NewClientDomainID; /// /// D-Bus variables @@ -169,6 +173,10 @@ currentIconAnimationDirection = 0; + this.ClientUpgradeStatus = null; + this.NewClientVersion = null; + this.NewClientDomainID = null; + eBox = new EventBox(); eBox.ButtonPressEvent += new ButtonPressEventHandler(trayapp_clicked); @@ -364,8 +372,26 @@ ReLogin(args.DomainID); } - private void OnClientUpgradeAvailableEvent(object sender, DomainClientUpgradeAvailableEventArgs args) + /// Now thw event handler does not show the upgrade dialog box directly, it will store the relevant informations + /// Just after this, there will be successful login event, so there ShowClientUpgradeMessageBox will be called + /// to show the upgrade dialog box with all the informations stored here + private void OnClientUpgradeAvailableEvent(object sender, DomainClientUpgradeAvailableEventArgs args) { + + this.ClientUpgradeStatus = DomainController.upgradeStatus; + this.NewClientVersion = args.NewClientVersion; + this.NewClientDomainID = args.DomainID; + } + + /// This method is called by Successful login handler, it is called before passphrase verify invocation + /// The variable used in this method should have been captured during the ClientUpgrade Event handler + /// This method should only be called during first time login (or after exit/login) + private void ShowClientUpgradeMessageBox() { + if(this.NewClientVersion == null || this.ClientUpgradeStatus == null || this.NewClientDomainID == null) + { + return; + } + if (ClientUpgradeDialog != null) return; // This dialog is already showing if(DomainController.upgradeStatus.statusCode == StatusCodes.ServerOld) @@ -397,7 +423,7 @@ iFolderMsgDialog.ButtonSet.AcceptDeny, Util.GS("iFolder Client Upgrade"), Util.GS("Would you like to download new iFolder Client?"), - string.Format(Util.GS("A newer version \"{0}\" of the iFolder Client is available."), args.NewClientVersion)); + string.Format(Util.GS("A newer version \"{0}\" of the iFolder Client is available."), this.NewClientVersion)); } int rc = ClientUpgradeDialog.Run(); ClientUpgradeDialog.Hide(); @@ -424,9 +450,13 @@ } }while( rc1 == (int)ResponseType.Ok); if( cp != null) + { cp.Destroy(); + cp=null; + } win.Hide(); win.Destroy(); + win=null; if( rc1 != (int) ResponseType.Ok) { Debug.PrintLine("OnClientUpgradeAvailableEvent return"); @@ -438,7 +468,7 @@ if(ifws !=null) { Debug.PrintLine("ifws.RunClientUpdate"); - bUpdateRunning = ifws.RunClientUpdate(args.DomainID, selectedFolder); + bUpdateRunning = ifws.RunClientUpdate(this.NewClientDomainID, selectedFolder); } } catch(Exception e) @@ -480,8 +510,8 @@ if( DomainController.upgradeStatus.statusCode == StatusCodes.UpgradeNeeded ) { // Deny login - if( domainController.GetDomain(args.DomainID) != null) - domainController.RemoveDomain(args.DomainID, false); + if( domainController.GetDomain(this.NewClientDomainID) != null) + domainController.RemoveDomain(this.NewClientDomainID, false); } } @@ -490,12 +520,15 @@ if(DomainController.upgradeStatus.statusCode == StatusCodes.ServerOld || DomainController.upgradeStatus.statusCode == StatusCodes.UpgradeNeeded ) { // Deny login - if( domainController.GetDomain(args.DomainID) != null) - domainController.RemoveDomain(args.DomainID, false); + if( domainController.GetDomain(this.NewClientDomainID) != null) + domainController.RemoveDomain(this.NewClientDomainID, false); } } ClientUpgradeDialog = null; + this.ClientUpgradeStatus = null; + this.NewClientVersion = null; + this.NewClientDomainID = null; } private void ReLogin(string domainID) @@ -582,6 +615,7 @@ // No recovery agent present; // return; // } + ShowClientUpgradeMessageBox(); int result; int policy = ifws.GetSecurityPolicy(DomainID); if( policy % 2 == 0) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' src/UI/Linux/LinuxClient/library/CopyLocation.cs src/UI/Linux/LinuxClient/library/CopyLocation.cs --- src/UI/Linux/LinuxClient/library/CopyLocation.cs 1970-01-01 05:30:00.000000000 +0530 +++ src/UI/Linux/LinuxClient/library/CopyLocation.cs 2009-10-22 04:17:49.000000000 +0530 @@ -0,0 +1,137 @@ +/***************************************************************************** +* +* Copyright (c) [2009] Novell, Inc. +* All Rights Reserved. +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of version 2 of the GNU General Public License as +* published by the Free Software Foundation. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, contact Novell, Inc. +* +* To contact Novell about this file by physical or electronic mail, +* you may find current contact information at www.novell.com +* +*----------------------------------------------------------------------------- + * + * $Author: Ramesh Sunder <sramesh@novell.com> + * $Modified by: <Modifier> + * $Mod Date: <Date Modified> + * $Revision: 0.0 + *----------------------------------------------------------------------------- + * This module is used to: + * <Description of the functionality of the file > + * + * + *******************************************************************************/ + +using Gtk; +using System; + +namespace Novell.iFolder +{ + /// <summary> + /// class Copy Location + /// </summary> + public class CopyLocation : FileChooserDialog + { + private DomainInformation[] domains; + private ComboBox domainComboBox; + // private ComboBox security_lvl_ComboBox; + private CheckButton Encryption; + private CheckButton SSL; + private string initialPath; + iFolderWebService ifws; + private uint keyReleasedTimeoutID; + private Label Mesg; + + /// <summary> + /// Gets / Sets the iFolder Path + /// </summary> + public string iFolderPath + { + get + { + return this.Filename; + } + set + { + this.SetCurrentFolder(value); + } + } + + /// <summary> + /// Gets / Sets Domain ID + /// </summary> + public string DomainID + { + get + { + int activeIndex = domainComboBox.Active; + if (activeIndex >= 0) + return domains[activeIndex].ID; + else + return "0"; + } + } + + /// + /// filteredDomainID: If the main iFolders window is currently + /// filtering the list of domains, this parameter is used to allow this + /// dialog to respect the currently selected domain. + public CopyLocation(Gtk.Window parentWindow, string initialPath) + : base("Choose folder", Util.GS("Select the folder to Download..."), parentWindow, FileChooserAction.SelectFolder, Stock.Cancel, ResponseType.Cancel, + Stock.Ok, ResponseType.Ok) + { + this.Icon = new Gdk.Pixbuf(Util.ImagesPath("ifolder16.png")); + +// if (this.initialPath != null && this.initialPath.Length > 0) + this.SetCurrentFolder(initialPath); + this.SetFilename(initialPath); + // More options expander + this.SetResponseSensitive(ResponseType.Ok, false); + } + + protected override void OnSelectionChanged() + { + string currentPath = this.Filename; + + this.SetResponseSensitive(ResponseType.Ok, true); + } + + protected override bool OnKeyReleaseEvent(Gdk.EventKey evnt) + { +// if (descriptionTextView.HasFocus) +// return true; // Don't do anything here + + if (keyReleasedTimeoutID != 0) + { + GLib.Source.Remove(keyReleasedTimeoutID); + keyReleasedTimeoutID = 0; + } + + return true; + } + + /// <summary> + /// Check Enable OK Button + /// </summary> + /// <returns></returns> + private bool CheckEnableOkButton() + { + try + { + string currentPath = this.Filename; + } + catch{} + this.SetResponseSensitive(ResponseType.Ok, false); + return false; + } + } +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' src/UI/Linux/LinuxClient/library/Makefile.am src/UI/Linux/LinuxClient/library/Makefile.am --- src/UI/Linux/LinuxClient/library/Makefile.am 2009-06-02 10:16:48.000000000 +0530 +++ src/UI/Linux/LinuxClient/library/Makefile.am 2009-10-22 04:17:32.000000000 +0530 @@ -1,7 +1,7 @@ # handle Mono secondary dependencies export MONO_PATH := $(MONO_PATH) -UILIB_CSFILES = $(srcdir)/iFolderHolder.cs $(srcdir)/iFolderConflictDialog.cs $(srcdir)/iFolderAcceptDialog.cs $(srcdir)/iFolderUserSelector.cs $(srcdir)/iFolderLoginDialog.cs $(srcdir)/iFolderPropSettingsPage.cs $(srcdir)/iFolderPropSharingPage.cs $(srcdir)/iFolderPropertiesDialog.cs $(srcdir)/iFolderCrashDialog.cs $(srcdir)/iFolderMsgDialog.cs $(srcdir)/iFolderWindow.cs $(srcdir)/iFolderCreationDialog.cs $(srcdir)/iFolderExceptionDialog.cs $(srcdir)/iFolderAccessDialog.cs $(srcdir)/iFolderTreeView.cs $(srcdir)/NotifyWindow.cs $(srcdir)/CompatFileChooserDialog.cs $(srcdir)/ClientConfig.cs $(srcdir)/SimiasEventBroker.cs $(srcdir)/CreateDialog.cs $(srcdir)/DragCreateDialog.cs $(srcdir)/LogWindow.cs $(srcdir)/PreferencesWindow.cs $(srcdir)/PrefsGeneralPage.cs $(srcdir)/PrefsAccountsPage.cs $(srcdir)/AccountDialog.cs $(srcdir)/RemoveAccountDialog.cs $(srcdir)/iFolderData.cs $(srcdir)/FileRenameDialog.cs $(srcdir)/list.cs $(srcdir)/elabel.cs $(srcdir)/GnomeHttpProxy.cs $(srcdir)/Events.cs $(srcdir)/DomainController.cs $(srcdir)/iFolderIconView.cs $(srcdir)/AddAccountWizard.cs $(srcdir)/iFolderViewGroup.cs $(srcdir)/iFolderViewItem.cs $(srcdir)/iFolderWaitDialog.cs $(srcdir)/IDomainProviderUI.cs $(srcdir)/DomainProviderUI.cs $(srcdir)/EnterpriseAccountDialog.cs $(srcdir)/MigrationPage.cs $(srcdir)/MigrationWizard.cs $(srcdir)/MigrateLocation.cs $(srcdir)/MigrationWindow.cs $(srcdir)/EnterPassPhraseDialog.cs $(srcdir)/VerifyPassPhraseDialog.cs $(srcdir)/ResetPassPhraseDialog.cs $(srcdir)/ExportKeysDialog.cs $(srcdir)/ImportKeysDialog.cs $(srcdir)/CertificateDialog.cs IiFolderLog.cs iFolderLog.cs iFolderLogManager.cs $(srcdir)/MigrationDialog.cs $(srcdir)/ResetPasswordDialog.cs +UILIB_CSFILES = $(srcdir)/iFolderHolder.cs $(srcdir)/iFolderConflictDialog.cs $(srcdir)/iFolderAcceptDialog.cs $(srcdir)/iFolderUserSelector.cs $(srcdir)/iFolderLoginDialog.cs $(srcdir)/iFolderPropSettingsPage.cs $(srcdir)/iFolderPropSharingPage.cs $(srcdir)/iFolderPropertiesDialog.cs $(srcdir)/iFolderCrashDialog.cs $(srcdir)/iFolderMsgDialog.cs $(srcdir)/iFolderWindow.cs $(srcdir)/iFolderCreationDialog.cs $(srcdir)/iFolderExceptionDialog.cs $(srcdir)/iFolderAccessDialog.cs $(srcdir)/iFolderTreeView.cs $(srcdir)/NotifyWindow.cs $(srcdir)/CompatFileChooserDialog.cs $(srcdir)/ClientConfig.cs $(srcdir)/SimiasEventBroker.cs $(srcdir)/CreateDialog.cs $(srcdir)/DragCreateDialog.cs $(srcdir)/LogWindow.cs $(srcdir)/PreferencesWindow.cs $(srcdir)/PrefsGeneralPage.cs $(srcdir)/PrefsAccountsPage.cs $(srcdir)/AccountDialog.cs $(srcdir)/RemoveAccountDialog.cs $(srcdir)/iFolderData.cs $(srcdir)/FileRenameDialog.cs $(srcdir)/list.cs $(srcdir)/elabel.cs $(srcdir)/GnomeHttpProxy.cs $(srcdir)/Events.cs $(srcdir)/DomainController.cs $(srcdir)/iFolderIconView.cs $(srcdir)/AddAccountWizard.cs $(srcdir)/iFolderViewGroup.cs $(srcdir)/iFolderViewItem.cs $(srcdir)/iFolderWaitDialog.cs $(srcdir)/IDomainProviderUI.cs $(srcdir)/DomainProviderUI.cs $(srcdir)/EnterpriseAccountDialog.cs $(srcdir)/MigrationPage.cs $(srcdir)/MigrationWizard.cs $(srcdir)/MigrateLocation.cs $(srcdir)/MigrationWindow.cs $(srcdir)/EnterPassPhraseDialog.cs $(srcdir)/VerifyPassPhraseDialog.cs $(srcdir)/ResetPassPhraseDialog.cs $(srcdir)/ExportKeysDialog.cs $(srcdir)/ImportKeysDialog.cs $(srcdir)/CertificateDialog.cs IiFolderLog.cs iFolderLog.cs iFolderLogManager.cs $(srcdir)/MigrationDialog.cs $(srcdir)/ResetPasswordDialog.cs $(srcdir)/CopyLocation.cs UILIB_CSFILES_CSC := $(subst /,$(SEP),$(UILIB_CSFILES)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' src/UI/Linux/LinuxClient/library/PrefsAccountsPage.cs src/UI/Linux/LinuxClient/library/PrefsAccountsPage.cs --- src/UI/Linux/LinuxClient/library/PrefsAccountsPage.cs 2009-06-02 10:16:48.000000000 +0530 +++ src/UI/Linux/LinuxClient/library/PrefsAccountsPage.cs 2009-10-22 04:04:25.000000000 +0530 @@ -85,7 +85,12 @@ private DomainProviderUI domainProviderUI; private iFolderLoginDialog LoginDialog; - + + private iFolderWebService ifws; + private iFolderMsgDialog ClientUpgradeDialog; + private Status ClientUpgradeStatus; + private string NewClientVersion; + private string NewClientDomainID; /// <summary> /// Default constructor for iFolderAccountsPage @@ -95,10 +100,20 @@ { this.topLevelWindow = topWindow; this.simiasManager = Util.GetSimiasManager(); + string localServiceUrl = simiasManager.WebServiceUri.ToString(); + ifws = new iFolderWebService(); + ifws.Url = localServiceUrl + "/iFolder.asmx"; + LocalService.Start(ifws, simiasManager.WebServiceUri, simiasManager.DataPath); + this.simws = new SimiasWebService(); simws.Url = simiasManager.WebServiceUri.ToString() + "/Simias.asmx"; LocalService.Start(simws, simiasManager.WebServiceUri, simiasManager.DataPath); + ClientUpgradeDialog = null; + + this.ClientUpgradeStatus = null; + this.NewClientVersion = null; + this.NewClientDomainID = null; curDomains = new Hashtable(); @@ -127,6 +142,9 @@ new DomainNewDefaultEventHandler(OnNewDefaultDomainEvent); domainController.DomainInGraceLoginPeriod += new DomainInGraceLoginPeriodEventHandler(OnDomainInGraceLoginPeriodEvent); + domainController.DomainClientUpgradeAvailable += + new DomainClientUpgradeAvailableEventHandler(OnClientUpgradeAvailableEvent); + } detailsDialogs = new Hashtable(); @@ -158,6 +176,8 @@ new DomainNewDefaultEventHandler(OnNewDefaultDomainEvent); domainController.DomainInGraceLoginPeriod -= new DomainInGraceLoginPeriodEventHandler(OnDomainInGraceLoginPeriodEvent); + domainController.DomainClientUpgradeAvailable -= + new DomainClientUpgradeAvailableEventHandler(OnClientUpgradeAvailableEvent); } } @@ -627,6 +647,168 @@ break; } } + + /// Now thw event handler does not show the upgrade dialog box directly, it will store the relevant informations + /// Just after this, there will be successful login event, so there ShowClientUpgradeMessageBox will be called + /// to show the upgrade dialog box with all the informations stored here + private void OnClientUpgradeAvailableEvent(object sender, DomainClientUpgradeAvailableEventArgs args) { + + this.ClientUpgradeStatus = DomainController.upgradeStatus; + this.NewClientVersion = args.NewClientVersion; + this.NewClientDomainID = args.DomainID; + } + + /// This method is called by Successful login handler, it is called before passphrase verify invocation + /// The variable used in this method should have been captured during the ClientUpgrade Event handler + /// This method should only be called during toggling of checkbox on prefs/account page (logout/login) + private void ShowClientUpgradeMessageBox() + { + if(this.NewClientVersion == null || this.ClientUpgradeStatus == null || this.NewClientDomainID == null) + { + return; // no handler was generated/caught for ClientUpgradeAvailable + } + + if (ClientUpgradeDialog != null) + return; // This dialog is already showing + if(DomainController.upgradeStatus.statusCode == StatusCodes.ServerOld) + { + ClientUpgradeDialog = new iFolderMsgDialog( + null, + iFolderMsgDialog.DialogType.Info, + iFolderMsgDialog.ButtonSet.Ok, + Util.GS("iFolder Server Older"), + Util.GS("The server is running an older version."), + string.Format(Util.GS("The server needs to be upgraded to be connected from this client"))); + + } + else if(DomainController.upgradeStatus.statusCode == StatusCodes.UpgradeNeeded) + { + ClientUpgradeDialog = new iFolderMsgDialog( + null, + iFolderMsgDialog.DialogType.Info, + iFolderMsgDialog.ButtonSet.AcceptDeny, + Util.GS("iFolder Client Upgrade"), + Util.GS("Would you like to download new iFolder Client?"), + string.Format(Util.GS("The client needs to be upgraded to be connected to the server"))); + } + else + { + ClientUpgradeDialog = new iFolderMsgDialog( + null, + iFolderMsgDialog.DialogType.Info, + iFolderMsgDialog.ButtonSet.AcceptDeny, + Util.GS("iFolder Client Upgrade"), + Util.GS("Would you like to download new iFolder Client?"), + string.Format(Util.GS("A newer version \"{0}\" of the iFolder Client is available."), this.NewClientVersion)); + } + + int rc = ClientUpgradeDialog.Run(); + ClientUpgradeDialog.Hide(); + ClientUpgradeDialog.Destroy(); + ClientUpgradeDialog = null; + + if (rc == -8) + { + bool bUpdateRunning = false; + Gtk.Window win = new Gtk.Window(""); + string initialPath = (string)System.IO.Path.GetTempPath(); + + Debug.PrintLine(String.Format("Initial Path: {0}", initialPath)); + CopyLocation cp = new CopyLocation(win, (string)System.IO.Path.GetTempPath()); + string selectedFolder = ""; + int rc1 = 0; + do + { + rc1 = cp.Run(); + cp.Hide(); + if(rc1 ==(int)ResponseType.Ok) + { + selectedFolder = cp.iFolderPath.Trim(); + cp.Destroy(); + cp = null; + break; + } + }while( rc1 == (int)ResponseType.Ok); + if( cp != null) + { + cp.Destroy(); + cp=null; + } + win.Hide(); + win.Destroy(); + win=null; + if( rc1 != (int) ResponseType.Ok) + { + Debug.PrintLine("OnClientUpgradeAvailableEvent return"); + ClientUpgradeDialog = null; + return; + } + try + { + if(ifws !=null) + { + Debug.PrintLine("ifws.RunClientUpdate"); + bUpdateRunning = ifws.RunClientUpdate(this.NewClientDomainID, selectedFolder); + } + } + catch(Exception e) + { + Debug.PrintLine(String.Format("ifws.RunClientUpdate exception :{0}", e.Message)); + ClientUpgradeDialog = null; + return; + } + + if (bUpdateRunning) + { + ClientUpgradeDialog = new iFolderMsgDialog( + null, + iFolderMsgDialog.DialogType.Info, + iFolderMsgDialog.ButtonSet.Ok, + Util.GS("Download Complete..."), + Util.GS("Download Finished "), + string.Format(Util.GS("The new client rpm's have been downloaded."))); + ClientUpgradeDialog.Run(); + ClientUpgradeDialog.Hide(); + ClientUpgradeDialog.Destroy(); + // QuitiFolder(); + } + else + { + iFolderMsgDialog dialog = new iFolderMsgDialog( + null, + iFolderMsgDialog.DialogType.Error, + iFolderMsgDialog.ButtonSet.None, + Util.GS("Upgrade Failure"), + Util.GS("The iFolder client upgrade failed."), + Util.GS("Please contact your system administrator.")); + dialog.Run(); + dialog.Hide(); + dialog.Destroy(); + dialog = null; + } + + if( DomainController.upgradeStatus.statusCode == StatusCodes.UpgradeNeeded ) + { + // Deny login + if( domainController.GetDomain(this.NewClientDomainID) != null) + domainController.RemoveDomain(this.NewClientDomainID, false); + } + + } + else //if(rc == -9) + { + if(DomainController.upgradeStatus.statusCode == StatusCodes.ServerOld || DomainController.upgradeStatus.statusCode == StatusCodes.UpgradeNeeded ) + { + // Deny login + if( domainController.GetDomain(this.NewClientDomainID) != null) + domainController.RemoveDomain(this.NewClientDomainID, false); + } + } + ClientUpgradeDialog = null; + this.ClientUpgradeStatus = null; + this.NewClientVersion = null; + this.NewClientDomainID = null; + } /// <summary> /// Event handler for Domain Login COmpleted @@ -660,6 +842,7 @@ // No recovery agent present; // return; // } + ShowClientUpgradeMessageBox(); int result; iFolderWebService ifws = DomainController.GetiFolderService(); int policy = ifws.GetSecurityPolicy(args.DomainID);
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor