From a2bb787e40dfe990ee00729e0fce0fb5b0eb7d7d Mon Sep 17 00:00:00 2001 From: Jim Norman Date: Wed, 26 Oct 2005 14:37:01 +0000 Subject: [PATCH] Bug 130123 Disallow * --- c_gui/MiCasa.cs | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/c_gui/MiCasa.cs b/c_gui/MiCasa.cs index ff5a4acd..ce0e7428 100644 --- a/c_gui/MiCasa.cs +++ b/c_gui/MiCasa.cs @@ -716,6 +716,20 @@ public class MiCasa : Store ArrayList arrKeys = null, arrValues = null; + if ((true == entrySecretID.Editable) && (entrySecretID.Text.IndexOf("*") > -1)) + { + // prompt user + MessageDialog md=new MessageDialog(this.windowMain,Gtk.DialogFlags.Modal, + Gtk.MessageType.Warning, + Gtk.ButtonsType.Ok, + "Secret ID may not contain \"*\""); + + md.Response += new ResponseHandler(md_Response); + md.SetPosition(Gtk.WindowPosition.CenterOnParent); + md.Modal = true; + md.Show(); + } + if( (true == entrySecretID.Editable) && ("" != entrySecretID.Text) && (tvKeyValue.Model.IterNChildren() > 0) ) { Logger.DbgLog("GUI:MiCasa.on_buttonNewOk_clicked() - Adding New Secrets and KeyValues."); @@ -1112,9 +1126,16 @@ public class MiCasa : Store }*/ } - /// LINK - - + /// LINK + + private void md_Response(object o, ResponseArgs args) + { + MessageDialog md = (MessageDialog)o; + if (md != null) + { + md.Destroy(); + } + } } } ///##################################################################