From 31dabbd890ff1bbd04c01c30687816a04f57f4d8 Mon Sep 17 00:00:00 2001 From: John Levon Date: Sat, 29 Mar 2003 10:55:48 +0000 Subject: [PATCH] more Alert fixes git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6628 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/ChangeLog | 4 ++ src/bufferview_funcs.C | 10 ++--- src/frontends/controllers/ChangeLog | 4 ++ src/frontends/controllers/helper_funcs.C | 14 +++--- src/frontends/xforms/ChangeLog | 4 ++ src/frontends/xforms/input_validators.C | 57 ------------------------ src/insets/ChangeLog | 4 ++ src/insets/insetert.C | 8 ++-- 8 files changed, 34 insertions(+), 71 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index c38255fca4..2e4d9c7a74 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2003-03-29 John Levon + + * bufferview_funcs.C: remove pointless Alert + 2003-03-29 John Levon * BufferView.C: diff --git a/src/bufferview_funcs.C b/src/bufferview_funcs.C index 373004ed0e..cc23921110 100644 --- a/src/bufferview_funcs.C +++ b/src/bufferview_funcs.C @@ -216,11 +216,11 @@ void lang(BufferView * bv, string const & l) { LyXFont font(LyXFont::ALL_IGNORE); Language const * lang = languages.getLanguage(l); - if (lang) { - font.setLanguage(lang); - toggleAndShow(bv, font); - } else - Alert::alert(_("Error! unknown language"),l); + if (!lang) + return; + + font.setLanguage(lang); + toggleAndShow(bv, font); } diff --git a/src/frontends/controllers/ChangeLog b/src/frontends/controllers/ChangeLog index 617b0fc361..f6f78f5a4c 100644 --- a/src/frontends/controllers/ChangeLog +++ b/src/frontends/controllers/ChangeLog @@ -1,3 +1,7 @@ +2003-03-29 John Levon + + * helper_funcs.C: Alert cleanup + 2003-03-29 John Levon * ControlDocument.C: comment out seemingly silly question diff --git a/src/frontends/controllers/helper_funcs.C b/src/frontends/controllers/helper_funcs.C index 34ac0f1207..235ec34706 100644 --- a/src/frontends/controllers/helper_funcs.C +++ b/src/frontends/controllers/helper_funcs.C @@ -57,9 +57,10 @@ string const browseFile(string const & filename, if (result.second.find_first_of("#~$% ") == string::npos) break; - Alert::alert(_("Filename can't contain any " - "of these characters:"), - _("space, '#', '~', '$' or '%'.")); + Alert::error(_("Invalid filename"), + _("Filename can't contain any " + "of these characters:\n" + "space, '#', '~', '$' or '%'.")); } return result.second; @@ -111,9 +112,10 @@ string const browseDir(string const & pathname, if (result.second.find_first_of("#~$% ") == string::npos) break; - Alert::alert(_("directory name can't contain any " - "of these characters:"), - _("space, '#', '~', '$' or '%'.")); + Alert::error(_("Invalid filename"), + _("Filename can't contain any " + "of these characters:\n" + "space, '#', '~', '$' or '%'.")); } return result.second; diff --git a/src/frontends/xforms/ChangeLog b/src/frontends/xforms/ChangeLog index 65103fcf78..14eed10578 100644 --- a/src/frontends/xforms/ChangeLog +++ b/src/frontends/xforms/ChangeLog @@ -1,3 +1,7 @@ +2003-03-29 John Levon + + * input_validators.C: remove dead code + 2003-03-29 John Levon * Alert_pimpl.C: implement information(), warning(), error() diff --git a/src/frontends/xforms/input_validators.C b/src/frontends/xforms/input_validators.C index 121ad90968..634f84c72b 100644 --- a/src/frontends/xforms/input_validators.C +++ b/src/frontends/xforms/input_validators.C @@ -80,63 +80,6 @@ int fl_lowercase_filter(FL_OBJECT * /*ob*/, } -#if 0 -/* I've just moved this code here and written a few comments. - still to complete it. ARRae 20000518 */ - -void fl_print_range_filter(FL_OBJECT * ob, - char const * not_used, - char const * unused, - int c) -{ - /* Started life as changes to PrintApplyCB by Stephan Witt - (stephan.witt@beusen.de), 19-Jan-99 - User may give a page (range) list */ - - if (strchr("0123456789", c)) { - /* Numerals are always valid */ - return FL_VALID; - } else if (strchr("-,", c)) { - /* make sure that the character can go there */ - } else if (c == 0) { - /* final test before handing contents to app - make sure the last char isn't a "-," - That might be acceptable if there was a "to_page" - entry however if you start making a page range in the "from" - field you can do it all in the "from" field. That is, a - range in the "from" field immmediately blanks the "to" - field. */ - } - return FL_INVALID|FL_RINGBELL; - - /* The code above should do the same sort of checking as the - code below. */ - - string pages = subst(fl_get_input(fd_form_print->input_pages), ';',','); - pages = trim(subst(pages, '+', ',')); - - while (!pages.empty()) { // a page range was given - string piece ; - pages = split (pages, piece, ',') ; - piece = trim(piece); - if (!stringOnlyContains (piece, "0123456789-")) { - Alert::alert(_("ERROR! Unable to print!"), - _("Check `range of pages'!")); - return; - } - if (piece.find('-') == string::npos) { // not found - pageflag += lyxrc.print_pagerange_flag + piece + '-' + piece + ' ' ; - } else if (suffixIs(piece, "-")) { // missing last page - pageflag += lyxrc.print_pagerange_flag + piece + "1000 "; - } else if (prefixIs(piece, "-")) { // missing first page - pageflag += lyxrc.print_pagerange_flag + '1' + piece + ' ' ; - } else { - pageflag += lyxrc.print_pagerange_flag + piece + ' ' ; - } - } -} -#endif - #if defined(__cplusplus) } #endif diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index 78e2a293f6..0d62850b38 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,3 +1,7 @@ +2003-03-29 John Levon + + * insetert.C: Alert cleanup + 2003-03-29 John Levon * insettabular.C: Alert fix diff --git a/src/insets/insetert.C b/src/insets/insetert.C index 453f4e9423..0774d61ee0 100644 --- a/src/insets/insetert.C +++ b/src/insets/insetert.C @@ -243,12 +243,14 @@ bool InsetERT::insertInset(BufferView *, Inset *) void InsetERT::setFont(BufferView *, LyXFont const &, bool, bool selectall) { +#ifdef WITH_WARNINGS +#warning FIXME. More UI stupidity... +#endif // if selectall is activated then the fontchange was an outside general // fontchange and this messages is not needed if (!selectall) - Alert::alert(_("Impossible operation!"), - _("Not permitted to change font-types inside ERT-insets!"), - _("Sorry.")); + Alert::error(_("Cannot change font"), + _("You cannot change font settings inside TeX code.")); } -- 2.39.2