All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5][eclipse-poky] Rename target profiles and handle global changes
@ 2013-02-26 13:49 Timo Mueller
  2013-02-26 13:49 ` [PATCH 1/5] Added eclipse bin folders to gitignore Timo Mueller
  2013-02-27  0:37 ` [PATCH 0/5][eclipse-poky] Rename target profiles and handle global changes Zhang, Jessica
  0 siblings, 2 replies; 7+ messages in thread
From: Timo Mueller @ 2013-02-26 13:49 UTC (permalink / raw)
  To: yocto; +Cc: Timo Mueller

From: Timo Mueller <timo.mueller@bmw-carit.de>

Hi,

this implements two of Jessica's comments regarding the target
profiles that have been introduced recently.

01..02: Small cleanup work
03:     Changes the name of target profiles to cross development
        profiles
04..05: If a global profile is updated this will also update affected
        projects. Also a warning is shown to the user.

Best regards,
Timo

Timo Mueller (5):
  Added eclipse bin folders to gitignore
  plugins/sdk.ide: Remove exception that is never thrown
  plugin/sdk.ide: Change name of target profiles to cross development
    profiles
  plugin/sdk.ide: Added methods for comparing UIElements
  plugin/sdk.ide: Update projects on profile update

 .gitignore                                         |  1 +
 .../org/yocto/sdk/ide/YoctoSDKMessages.properties  | 16 +++---
 .../src/org/yocto/sdk/ide/YoctoUIElement.java      | 58 ++++++++++++++++++++++
 .../src/org/yocto/sdk/ide/YoctoUISetting.java      |  4 +-
 .../ide/preferences/YoctoSDKPreferencePage.java    | 32 +++++++++---
 5 files changed, 95 insertions(+), 16 deletions(-)
 create mode 100644 .gitignore

-- 
1.7.11.7



^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/5] Added eclipse bin folders to gitignore
  2013-02-26 13:49 [PATCH 0/5][eclipse-poky] Rename target profiles and handle global changes Timo Mueller
@ 2013-02-26 13:49 ` Timo Mueller
  2013-02-26 13:49   ` [PATCH 2/5] plugins/sdk.ide: Remove exception that is never thrown Timo Mueller
  2013-02-27  0:37 ` [PATCH 0/5][eclipse-poky] Rename target profiles and handle global changes Zhang, Jessica
  1 sibling, 1 reply; 7+ messages in thread
From: Timo Mueller @ 2013-02-26 13:49 UTC (permalink / raw)
  To: yocto; +Cc: Timo Mueller

From: Timo Mueller <timo.mueller@bmw-carit.de>


Signed-off-by: Timo Mueller <timo.mueller@bmw-carit.de>
---
 .gitignore | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 .gitignore

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..ba077a4
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+bin
-- 
1.7.11.7



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/5] plugins/sdk.ide: Remove exception that is never thrown
  2013-02-26 13:49 ` [PATCH 1/5] Added eclipse bin folders to gitignore Timo Mueller
@ 2013-02-26 13:49   ` Timo Mueller
  2013-02-26 13:49     ` [PATCH 3/5] plugin/sdk.ide: Change name of target profiles to cross development profiles Timo Mueller
  0 siblings, 1 reply; 7+ messages in thread
From: Timo Mueller @ 2013-02-26 13:49 UTC (permalink / raw)
  To: yocto; +Cc: Timo Mueller

From: Timo Mueller <timo.mueller@bmw-carit.de>


Signed-off-by: Timo Mueller <timo.mueller@bmw-carit.de>
---
 plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUISetting.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUISetting.java b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUISetting.java
index 5bca41a..f7e7a3a 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUISetting.java
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUISetting.java
@@ -144,7 +144,7 @@ public class YoctoUISetting {
 		return button;
 	}		
 
-	private void createQemuSetup(final Group targetGroup) throws YoctoGeneralException
+	private void createQemuSetup(final Group targetGroup)
 	{
 		//QEMU Setup
 		kernel_label= new Label(targetGroup, SWT.NONE);
@@ -180,7 +180,7 @@ public class YoctoUISetting {
 		*/
 		
 	}
-	public void createComposite(Composite composite) throws YoctoGeneralException
+	public void createComposite(Composite composite)
 	{
 		GridData gd = new GridData(SWT.FILL, SWT.CENTER, true, false);
 		GridLayout layout = new GridLayout(2, false);
-- 
1.7.11.7



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 3/5] plugin/sdk.ide: Change name of target profiles to cross development profiles
  2013-02-26 13:49   ` [PATCH 2/5] plugins/sdk.ide: Remove exception that is never thrown Timo Mueller
@ 2013-02-26 13:49     ` Timo Mueller
  2013-02-26 13:49       ` [PATCH 4/5] plugin/sdk.ide: Added methods for comparing UIElements Timo Mueller
  0 siblings, 1 reply; 7+ messages in thread
From: Timo Mueller @ 2013-02-26 13:49 UTC (permalink / raw)
  To: yocto; +Cc: Timo Mueller

From: Timo Mueller <timo.mueller@bmw-carit.de>


Signed-off-by: Timo Mueller <timo.mueller@bmw-carit.de>
---
 .../src/org/yocto/sdk/ide/YoctoSDKMessages.properties      | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties
index e779f7d..0323d1c 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties
@@ -51,18 +51,18 @@ Preferences.Profile.Validator.InvalidName.Quote = Warning: The profile name cann
 Preferences.Profile.Validator.InvalidName.Empty = Please provide a new profile name.
 Preferences.Profile.Validator.InvalidName.Exists = Warning: The profile already exists.
 
-Preferences.Profiles.Title = Target profiles:
+Preferences.Profiles.Title = Cross development profiles:
 Preferences.Profile.New.Title = Save as ...
-Preferences.Profile.New.Dialog.Title = Save as new target profile
+Preferences.Profile.New.Dialog.Title = Save as new cross development profile
 Preferences.Profile.New.Dialog.Message = Please input a profile name.
 Preferences.Profile.Rename.Title = Rename
-Preferences.Profile.Rename.Dialog.Title = Rename target profile
+Preferences.Profile.Rename.Dialog.Title = Rename cross development profile
 Preferences.Profile.Rename.Dialog.Message = Please input a new profile name.
 Preferences.Profile.Remove.Title = Remove
-Preferences.Profile.Remove.Dialog.Title = Remove target profile
-Preferences.Profile.Remove.Dialog.Message = Do you really want to the remove the target profile "{0}"?\nProjects using this target profile will be reconfigured to use the standard profile.
-Preferences.Profile.Standard.Modification.Title = Modify standard target profile
-Preferences.Profile.Standard.Modification.Message = Standard target profile cannot be removed or renamed.
+Preferences.Profile.Remove.Dialog.Title = Remove cross development profile
+Preferences.Profile.Remove.Dialog.Message = Do you really want to the remove the cross development profile "{0}"?\nProjects using this cross development profile will be reconfigured to use the standard profile.
+Preferences.Profile.Standard.Modification.Title = Modify standard cross development profile
+Preferences.Profile.Standard.Modification.Message = Standard cross development profile cannot be removed or renamed.
 
 Preferences.Profile.ProjectSpecific.Title = Use project specific settings
 Preferences.Profile.ProjectSpecific.Group.Title = Project specific settings:
-- 
1.7.11.7



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 4/5] plugin/sdk.ide: Added methods for comparing UIElements
  2013-02-26 13:49     ` [PATCH 3/5] plugin/sdk.ide: Change name of target profiles to cross development profiles Timo Mueller
@ 2013-02-26 13:49       ` Timo Mueller
  2013-02-26 13:49         ` [PATCH 5/5] plugin/sdk.ide: Update projects on profile update Timo Mueller
  0 siblings, 1 reply; 7+ messages in thread
From: Timo Mueller @ 2013-02-26 13:49 UTC (permalink / raw)
  To: yocto; +Cc: Timo Mueller

From: Timo Mueller <timo.mueller@bmw-carit.de>

This adds hashCode and equals methods generated by Eclipse to allow
comparison of two UIElements.

Signed-off-by: Timo Mueller <timo.mueller@bmw-carit.de>
---
 .../src/org/yocto/sdk/ide/YoctoUIElement.java      | 58 ++++++++++++++++++++++
 1 file changed, 58 insertions(+)

diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUIElement.java b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUIElement.java
index df19510..de3e905 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUIElement.java
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUIElement.java
@@ -100,4 +100,62 @@ public class YoctoUIElement {
 	public void setStrSysrootLoc(String strSysrootLoc) {
 		this.strSysrootLoc = strSysrootLoc;
 	}
+
+	@Override
+	public int hashCode() {
+		final int prime = 31;
+		int result = 1;
+		result = prime * result + ((enumDeviceMode == null) ? 0 : enumDeviceMode.hashCode());
+		result = prime * result + ((enumPokyMode == null) ? 0 : enumPokyMode.hashCode());
+		result = prime * result + intTargetIndex;
+		result = prime * result + ((strQemuKernelLoc == null) ? 0 : strQemuKernelLoc.hashCode());
+		result = prime * result + ((strQemuOption == null) ? 0 : strQemuOption.hashCode());
+		result = prime * result + ((strSysrootLoc == null) ? 0 : strSysrootLoc.hashCode());
+		result = prime * result + ((strTarget == null) ? 0 : strTarget.hashCode());
+		result = prime * result + ((strToolChainRoot == null) ? 0 : strToolChainRoot.hashCode());
+		return result;
+	}
+
+	@Override
+	public boolean equals(Object obj) {
+		if (this == obj)
+			return true;
+		if (obj == null)
+			return false;
+		if (getClass() != obj.getClass())
+			return false;
+		YoctoUIElement other = (YoctoUIElement) obj;
+		if (enumDeviceMode != other.enumDeviceMode)
+			return false;
+		if (enumPokyMode != other.enumPokyMode)
+			return false;
+		if (intTargetIndex != other.intTargetIndex)
+			return false;
+		if (strQemuKernelLoc == null) {
+			if (other.strQemuKernelLoc != null)
+				return false;
+		} else if (!strQemuKernelLoc.equals(other.strQemuKernelLoc))
+			return false;
+		if (strQemuOption == null) {
+			if (other.strQemuOption != null)
+				return false;
+		} else if (!strQemuOption.equals(other.strQemuOption))
+			return false;
+		if (strSysrootLoc == null) {
+			if (other.strSysrootLoc != null)
+				return false;
+		} else if (!strSysrootLoc.equals(other.strSysrootLoc))
+			return false;
+		if (strTarget == null) {
+			if (other.strTarget != null)
+				return false;
+		} else if (!strTarget.equals(other.strTarget))
+			return false;
+		if (strToolChainRoot == null) {
+			if (other.strToolChainRoot != null)
+				return false;
+		} else if (!strToolChainRoot.equals(other.strToolChainRoot))
+			return false;
+		return true;
+	}
 }
-- 
1.7.11.7



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 5/5] plugin/sdk.ide: Update projects on profile update
  2013-02-26 13:49       ` [PATCH 4/5] plugin/sdk.ide: Added methods for comparing UIElements Timo Mueller
@ 2013-02-26 13:49         ` Timo Mueller
  0 siblings, 0 replies; 7+ messages in thread
From: Timo Mueller @ 2013-02-26 13:49 UTC (permalink / raw)
  To: yocto; +Cc: Timo Mueller

From: Timo Mueller <timo.mueller@bmw-carit.de>

If a cross development profile is changed that is used by projects,
the user will be warned that these projects will also be changed. If
the user accepts the affected projects are updated and are marked
"dirty". Next time the projects are built a reconfigure will also be
triggered.

Signed-off-by: Timo Mueller <timo.mueller@bmw-carit.de>
---
 .../org/yocto/sdk/ide/YoctoSDKMessages.properties  |  2 ++
 .../ide/preferences/YoctoSDKPreferencePage.java    | 32 +++++++++++++++++-----
 2 files changed, 27 insertions(+), 7 deletions(-)

diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties
index 0323d1c..e5748f7 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties
@@ -61,6 +61,8 @@ Preferences.Profile.Rename.Dialog.Message = Please input a new profile name.
 Preferences.Profile.Remove.Title = Remove
 Preferences.Profile.Remove.Dialog.Title = Remove cross development profile
 Preferences.Profile.Remove.Dialog.Message = Do you really want to the remove the cross development profile "{0}"?\nProjects using this cross development profile will be reconfigured to use the standard profile.
+Preferences.Profile.Update.Dialog.Title = Update cross development profile
+Preferences.Profile.Update.Dialog.Message = Do you really want to the update the cross development profile "{0}"?\nProjects using this cross development profile will be reconfigured.
 Preferences.Profile.Standard.Modification.Title = Modify standard cross development profile
 Preferences.Profile.Standard.Modification.Message = Standard cross development profile cannot be removed or renamed.
 
diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
index b5963cf..4d57b45 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
@@ -18,6 +18,7 @@ import org.eclipse.core.runtime.CoreException;
 import org.eclipse.jface.dialogs.Dialog;
 import org.eclipse.jface.dialogs.IDialogConstants;
 import org.eclipse.jface.dialogs.InputDialog;
+import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.jface.preference.IPreferenceStore;
 import org.eclipse.jface.preference.PreferencePage;
 import org.eclipse.swt.SWT;
@@ -40,6 +41,8 @@ public class YoctoSDKPreferencePage extends PreferencePage implements IWorkbench
 
 	private static final String NEW_DIALOG_TITLE = "Preferences.Profile.New.Dialog.Title";
 	private static final String NEW_DIALOG_MESSAGE = "Preferences.Profile.New.Dialog.Message";
+	private static final String UPDATE_DIALOG_TITLE = "Preferences.Profile.Update.Dialog.Title";
+	private static final String UPDATE_DIALOG_MESSAGE = "Preferences.Profile.Update.Dialog.Message";
 
 	private YoctoProfileSetting yoctoProfileSetting;
 	private YoctoUISetting yoctoUISetting;
@@ -93,15 +96,32 @@ public class YoctoSDKPreferencePage extends PreferencePage implements IWorkbench
 	 */
 	public boolean performOk() {
 		try {
-			yoctoUISetting.validateInput(SDKCheckRequestFrom.Preferences, true);
+			yoctoUISetting.validateInput(SDKCheckRequestFrom.Preferences, false);
+
+			YoctoUIElement savedElement = YoctoSDKUtils.getElemFromStore(getPreferenceStore());
+			YoctoUIElement modifiedElement = yoctoUISetting.getCurrentInput();
 
-			YoctoUIElement elem = yoctoUISetting.getCurrentInput();
-			YoctoSDKUtils.saveElemToStore(elem, getPreferenceStore());
+			if (savedElement.equals(modifiedElement)) {
+				return true;
+			}
 
 			YoctoProfileElement profileElement = yoctoProfileSetting.getCurrentInput();
+			HashSet<IProject> yoctoProjects = getAffectedProjects(profileElement.getSelectedProfile());
+
+			if (!yoctoProjects.isEmpty()) {
+				boolean deleteConfirmed =
+						MessageDialog.openConfirm(null, YoctoSDKMessages.getString(UPDATE_DIALOG_TITLE),
+								YoctoSDKMessages.getFormattedString(UPDATE_DIALOG_MESSAGE, profileElement.getSelectedProfile()));
+
+				if (!deleteConfirmed) {
+					return false;
+				}
+			}
+
+			YoctoSDKUtils.saveElemToStore(modifiedElement, getPreferenceStore());
 			YoctoSDKUtils.saveProfilesToDefaultStore(profileElement);
 
-			updateAffectedProjects(profileElement.getSelectedProfile(), elem);
+			updateProjects(yoctoProjects, modifiedElement);
 
 			return super.performOk();
 		} catch (YoctoGeneralException e) {
@@ -194,9 +214,7 @@ public class YoctoSDKPreferencePage extends PreferencePage implements IWorkbench
 		}
 	}
 
-	private void updateAffectedProjects(String usedProfile, YoctoUIElement elem) {
-		HashSet<IProject> yoctoProjects = getAffectedProjects(usedProfile);
-
+	private void updateProjects(HashSet<IProject> yoctoProjects, YoctoUIElement elem) {
 		for (IProject project : yoctoProjects)
 		{
 			YoctoSDKUtils.saveElemToProjectEnv(elem, project);
-- 
1.7.11.7



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/5][eclipse-poky] Rename target profiles and handle global changes
  2013-02-26 13:49 [PATCH 0/5][eclipse-poky] Rename target profiles and handle global changes Timo Mueller
  2013-02-26 13:49 ` [PATCH 1/5] Added eclipse bin folders to gitignore Timo Mueller
@ 2013-02-27  0:37 ` Zhang, Jessica
  1 sibling, 0 replies; 7+ messages in thread
From: Zhang, Jessica @ 2013-02-27  0:37 UTC (permalink / raw)
  To: Timo Mueller, yocto; +Cc: Timo Mueller

Merged to eclipse-poky master.

Thanks,
Jessica

-----Original Message-----
From: yocto-bounces@yoctoproject.org [mailto:yocto-bounces@yoctoproject.org] On Behalf Of Timo Mueller
Sent: Tuesday, February 26, 2013 5:49 AM
To: yocto@yoctoproject.org
Cc: Timo Mueller
Subject: [yocto] [PATCH 0/5][eclipse-poky] Rename target profiles and handle global changes

From: Timo Mueller <timo.mueller@bmw-carit.de>

Hi,

this implements two of Jessica's comments regarding the target profiles that have been introduced recently.

01..02: Small cleanup work
03:     Changes the name of target profiles to cross development
        profiles
04..05: If a global profile is updated this will also update affected
        projects. Also a warning is shown to the user.

Best regards,
Timo

Timo Mueller (5):
  Added eclipse bin folders to gitignore
  plugins/sdk.ide: Remove exception that is never thrown
  plugin/sdk.ide: Change name of target profiles to cross development
    profiles
  plugin/sdk.ide: Added methods for comparing UIElements
  plugin/sdk.ide: Update projects on profile update

 .gitignore                                         |  1 +
 .../org/yocto/sdk/ide/YoctoSDKMessages.properties  | 16 +++---
 .../src/org/yocto/sdk/ide/YoctoUIElement.java      | 58 ++++++++++++++++++++++
 .../src/org/yocto/sdk/ide/YoctoUISetting.java      |  4 +-
 .../ide/preferences/YoctoSDKPreferencePage.java    | 32 +++++++++---
 5 files changed, 95 insertions(+), 16 deletions(-)  create mode 100644 .gitignore

--
1.7.11.7

_______________________________________________
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-02-27  0:37 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-26 13:49 [PATCH 0/5][eclipse-poky] Rename target profiles and handle global changes Timo Mueller
2013-02-26 13:49 ` [PATCH 1/5] Added eclipse bin folders to gitignore Timo Mueller
2013-02-26 13:49   ` [PATCH 2/5] plugins/sdk.ide: Remove exception that is never thrown Timo Mueller
2013-02-26 13:49     ` [PATCH 3/5] plugin/sdk.ide: Change name of target profiles to cross development profiles Timo Mueller
2013-02-26 13:49       ` [PATCH 4/5] plugin/sdk.ide: Added methods for comparing UIElements Timo Mueller
2013-02-26 13:49         ` [PATCH 5/5] plugin/sdk.ide: Update projects on profile update Timo Mueller
2013-02-27  0:37 ` [PATCH 0/5][eclipse-poky] Rename target profiles and handle global changes Zhang, Jessica

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.