All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Timo Müller" <mail@timomueller.eu>
To: yocto@yoctoproject.org
Cc: Timo Mueller <timo.mueller@bmw-carit.de>
Subject: Re: [RFC v2 10/17] plugins/sdk.ide: Add UI method to delete a profile
Date: Wed, 30 Jan 2013 14:59:42 +0100	[thread overview]
Message-ID: <5109274E.3050409@timomueller.eu> (raw)
In-Reply-To: <3bf56fea609743f90d8a6576ab45fc9221859c93.1359466765.git.timo.mueller@bmw-carit.de>

Sorry, this one is already obsolete.

Timo Mueller wrote, On 30.01.2013 14:56:
> From: Timo Mueller <timo.mueller@bmw-carit.de>
>
> A profile is removed from the list, when the delete button is
> clicked. The deletion has to be confirmed by the user. Deleting the
> standard profile is not allowed.
>
> Signed-off-by: Timo Mueller <timo.mueller@bmw-carit.de>
> ---
>   .../src/org/yocto/sdk/ide/YoctoProfileSetting.java | 34 ++++++++++++++++++++++
>   .../org/yocto/sdk/ide/YoctoSDKMessages.properties  |  4 +++
>   2 files changed, 38 insertions(+)
>
> diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java
> index 633eb67..aa6f4b2 100644
> --- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java
> +++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java
> @@ -10,6 +10,7 @@
>    *******************************************************************************/
>   package org.yocto.sdk.ide;
>
> +import org.eclipse.jface.dialogs.MessageDialog;
>   import org.eclipse.jface.preference.PreferencePage;
>   import org.eclipse.swt.SWT;
>   import org.eclipse.swt.events.MouseAdapter;
> @@ -22,6 +23,7 @@ import org.eclipse.swt.widgets.Composite;
>   import org.eclipse.swt.widgets.Event;
>   import org.eclipse.swt.widgets.Group;
>   import org.eclipse.swt.widgets.Listener;
> +import org.yocto.sdk.ide.preferences.PreferenceConstants;
>   import org.yocto.sdk.ide.preferences.YoctoSDKPreferencePage;
>
>   public class YoctoProfileSetting {
> @@ -29,6 +31,10 @@ public class YoctoProfileSetting {
>   	private static final String NEW_PROFILE_TITLE = "Preferences.Profile.New.Title";
>   	private static final String RENAME_PROFILE_TITLE = "Preferences.Profile.Rename.Title";
>   	private static final String REMOVE_PROFILE_TITLE = "Preferences.Profile.Remove.Title";
> +	private static final String REMOVE_DIALOG_TITLE = "Preferences.Profile.Remove.Dialog.Title";
> +	private static final String REMOVE_DIALOG_MESSAGE = "Preferences.Profile.Remove.Dialog.Message";
> +	private static final String MODIFY_STANDARD_TITLE = "Preferences.Profile.Standard.Modification.Title";
> +	private static final String MODIFY_STANDARD_MESSAGE = "Preferences.Profile.Standard.Modification.Message";
>
>   	private Combo sdkConfigsCombo;
>   	private Button btnConfigRename;
> @@ -105,6 +111,34 @@ public class YoctoProfileSetting {
>   		btnConfigRemove = new Button(storeYoctoConfigurationsGroup, SWT.PUSH | SWT.LEAD);
>   		btnConfigRemove.setLayoutData(new GridData(SWT.RIGHT, SWT.TOP, true, false, 3, 1));
>   		btnConfigRemove.setText(YoctoSDKMessages.getString(REMOVE_PROFILE_TITLE));
> +		btnConfigRemove.addMouseListener(new MouseAdapter() {
> +			@Override
> +			public void mouseDown(MouseEvent e) {
> +				saveChangesOnCurrentProfile();
> +				int selectionIndex = sdkConfigsCombo.getSelectionIndex();
> +				String selectedItem = sdkConfigsCombo.getItem(selectionIndex);
> +
> +				if (selectedItem.equals(PreferenceConstants.STANDARD_PROFILE_NAME)) {
> +					MessageDialog.openInformation(null,
> +													YoctoSDKMessages.getString(MODIFY_STANDARD_TITLE),
> +													YoctoSDKMessages.getString(MODIFY_STANDARD_MESSAGE));
> +					return;
> +				}
> +
> +				boolean deleteConfirmed =
> +						MessageDialog.openConfirm(null,
> +													YoctoSDKMessages.getString(REMOVE_DIALOG_TITLE),
> +													YoctoSDKMessages.getFormattedString(REMOVE_DIALOG_MESSAGE, selectedItem));
> +
> +				if (!deleteConfirmed) {
> +					return;
> +				}
> +
> +				sdkConfigsCombo.select(0);
> +				sdkConfigsCombo.remove(selectionIndex);
> +				profileElement.remove(selectedItem);
> +			}
> +		});
>   	}
>
>   	private void createRenameButton(Group storeYoctoConfigurationsGroup) {
> 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 14b7846..1a413fa 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
> @@ -57,6 +57,10 @@ Preferences.Profile.New.Dialog.Title = Save as new target profile
>   Preferences.Profile.New.Dialog.Message = Please input a profile name.
>   Preferences.Profile.Rename.Title = Rename
>   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.
>
>   Console.SDK.Name = Yocto Project Console
>
>



  reply	other threads:[~2013-01-30 13:59 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-30 13:56 [RFC v2 00/18][eclipse-poky] Storing yocto settings as target profiles Timo Mueller
2013-01-30 13:56 ` [RFC v2 01/18] plugins/sdk.ide: Removed unused message Timo Mueller
2013-01-30 13:56 ` [RFC v2 02/18] plugins/sdk.ide: Extract labels to private members Timo Mueller
2013-01-30 13:56 ` [RFC v2 03/18] plugins/sdk.ide: Add method to enable and disable form Timo Mueller
2013-01-30 13:56 ` [RFC v2 04/18] plugins/sdk.ide: Set value of target array on input change Timo Mueller
2013-01-30 13:56 ` [RFC v2 05/18] plugins/sdk.ide: Changed method signature to be more consistent Timo Mueller
2013-01-30 13:56 ` [RFC v2 06/18] plugins/sdk.ide: Create UI element for managing target profiles Timo Mueller
2013-01-30 13:56 ` [RFC v2 07/18] plugins/sdk.ide: Modified preferences storage to support profiles Timo Mueller
2013-01-30 13:56 ` [RFC v2 08/18] plugins/sdk.ide: Set profile on selection change Timo Mueller
2013-01-30 13:56 ` [RFC v2 09/18] plugins/sdk.ide: Add method to allow storing the current settings Timo Mueller
2013-01-30 13:56 ` [RFC v2 10/18] plugins/sdk.ide: Add UI method to create a new profile Timo Mueller
     [not found]   ` <cover.1359466765.git.timo.mueller@bmw-carit.de>
2013-01-30 13:56     ` [RFC v2 10/17] plugins/sdk.ide: Add UI method to delete a profile Timo Mueller
2013-01-30 13:59       ` Timo Müller [this message]
2013-01-30 13:56     ` [RFC v2 11/17] plugins/sdk.ide: Add UI method to rename " Timo Mueller
2013-01-30 13:56     ` [RFC v2 12/17] plugins/sdk.ide: Add method to change values of the preference page Timo Mueller
2013-01-30 13:56     ` [RFC v2 13/17] plugins/sdk.ide: Add method to rename a profile and its preference store Timo Mueller
2013-01-30 13:56     ` [RFC v2 14/17] plugins/sdk.ide: Add method to delete a profile Timo Mueller
2013-01-30 13:56     ` [RFC v2 15/17] plugins/sdk.ide: Use profiles for the preference page Timo Mueller
2013-01-30 13:56     ` [RFC v2 16/17] plugins/sdk.ide: Added profile UI to " Timo Mueller
2013-01-30 13:56     ` [RFC v2 17/17] plugins/sdk.ide: Moved save as button to bottom of " Timo Mueller
2013-01-30 13:56 ` [RFC v2 11/18] plugins/sdk.ide: Add UI method to delete a profile Timo Mueller
2013-01-30 13:56 ` [RFC v2 12/18] plugins/sdk.ide: Add UI method to rename " Timo Mueller
2013-01-30 13:56 ` [RFC v2 13/18] plugins/sdk.ide: Add method to change values of the preference page Timo Mueller
2013-01-30 13:56 ` [RFC v2 14/18] plugins/sdk.ide: Add method to rename a profile and its preference store Timo Mueller
2013-01-30 13:56 ` [RFC v2 15/18] plugins/sdk.ide: Add method to delete a profile Timo Mueller
2013-01-30 13:56 ` [RFC v2 16/18] plugins/sdk.ide: Use profiles for the preference page Timo Mueller
2013-01-30 13:56 ` [RFC v2 17/18] plugins/sdk.ide: Added profile UI to " Timo Mueller
2013-01-30 13:56 ` [RFC v2 18/18] plugins/sdk.ide: Moved save as button to bottom of " Timo Mueller
2013-01-31 19:28 ` [RFC v2 00/18][eclipse-poky] Storing yocto settings as target profiles Zhang, Jessica
2013-02-04  7:28   ` Timo Müller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5109274E.3050409@timomueller.eu \
    --to=mail@timomueller.eu \
    --cc=timo.mueller@bmw-carit.de \
    --cc=yocto@yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.