Skip to content
Snippets Groups Projects
Commit 8f1a94a3 authored by Raphael GIRARDOT's avatar Raphael GIRARDOT
Browse files

- call MamboDbUtils.updateDbRadioButtons after adding buttons in group (TANGOARCH-948)

- no need to display warning popup when there are no attributes in VC
parent 4383fe3b
No related branches found
No related tags found
No related merge requests found
......@@ -41,11 +41,13 @@ public class ACEditChooseDialog extends JDialog {
tdb.setSelected(false);
tts = new JRadioButton(Messages.getMessage("ARCHIVING_CHOOSE_EDIT_TTS"));
tts.setSelected(false);
MamboDbUtils.updateDbRadioButtons(hdb, tdb, tts);
// TANGOARCH-948: call MamboDbUtils.updateDbRadioButtons after adding buttons in group.
dbGroup.add(hdb);
dbGroup.add(tdb);
dbGroup.add(tts);
MamboDbUtils.updateDbRadioButtons(hdb, tdb, tts);
JButton okButton = new JButton("ok");
okButton.setToolTipText("ok");
okButton.addActionListener(new ACECCloseAction());
......
......@@ -26,6 +26,7 @@ import fr.soleil.archiving.gui.tools.GUIUtilities;
import fr.soleil.archiving.hdbtdb.api.tools.SamplingType;
import fr.soleil.lib.project.ObjectUtils;
import fr.soleil.mambo.bean.view.ViewConfigurationBean;
import fr.soleil.mambo.data.view.ViewConfiguration;
import fr.soleil.mambo.models.VCAttributesTreeModel;
import fr.soleil.mambo.models.VCPossibleAttributesTreeModel;
import fr.soleil.mambo.tools.MamboDbUtils;
......@@ -424,6 +425,12 @@ public class GeneralTab extends JPanel implements ItemListener {
historic = Boolean.FALSE;
}
if (!ObjectUtils.sameObject(wasHistoric, historic)) {
int confirm;
ViewConfiguration vc = viewConfigurationBean.getEditingViewConfiguration();
if ((vc != null) && (vc.getAttributes() != null) && (vc.getAttributes().countAttributes() == 0)) {
// No need to display warning popup when there are no attributes in config.
confirm = JOptionPane.OK_OPTION;
} else {
// title
String msgTitle = Messages.getMessage("DIALOGS_EDIT_VC_GENERAL_HISTORIC_CONFIRM_TITLE");
// message
......@@ -431,10 +438,9 @@ public class GeneralTab extends JPanel implements ItemListener {
String msgCancel = Messages.getMessage("DIALOGS_EDIT_VC_GENERAL_HISTORIC_CONFIRM_CANCEL");
String msgValidate = Messages.getMessage("DIALOGS_EDIT_VC_GENERAL_HISTORIC_CONFIRM_VALIDATE");
Object[] options = { msgValidate, msgCancel };
int confirm = JOptionPane.showOptionDialog(null, msgConfirm, msgTitle, JOptionPane.DEFAULT_OPTION,
confirm = JOptionPane.showOptionDialog(null, msgConfirm, msgTitle, JOptionPane.DEFAULT_OPTION,
JOptionPane.WARNING_MESSAGE, null, options, options[0]);
}
if (confirm == JOptionPane.OK_OPTION) {
viewConfigurationBean.getVcPossibleAttributesTreeModel().setHistoric(wasHistoric);
VCAttributesTreeModel vCAttributesTreeModel = viewConfigurationBean.getEditingModel();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment