From 6ada61e182f55c612b4d743f37b14c10d032ccad Mon Sep 17 00:00:00 2001 From: Georg Baum Date: Sat, 7 Oct 2006 16:47:54 +0000 Subject: [PATCH] Rename namespace Alert to lyx::frontend::Alert. This prevents a name clash with Qt 4.2.0 on OS X. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15267 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/BufferView.C | 2 ++ src/buffer.C | 1 + src/buffer_funcs.C | 1 + src/bufferlist.C | 2 ++ src/bufferparams.C | 1 + src/converter.C | 8 +++++--- src/exporter.C | 1 + src/format.C | 1 + src/frontends/Alert.C | 6 ++++++ src/frontends/Alert.h | 4 ++++ src/frontends/qt3/validators.C | 2 +- src/frontends/qt4/validators.C | 2 +- src/importer.C | 2 +- src/insets/insetbibtex.C | 1 + src/insets/insetinclude.C | 1 + src/insets/insettabular.C | 2 ++ src/lyx_cb.C | 1 + src/lyx_main.C | 1 + src/lyxfind.C | 3 ++- src/lyxfunc.C | 1 + src/lyxvc.C | 2 ++ src/output.C | 2 +- 22 files changed, 39 insertions(+), 8 deletions(-) diff --git a/src/BufferView.C b/src/BufferView.C index c91a92ddfb..0a393c0f61 100644 --- a/src/BufferView.C +++ b/src/BufferView.C @@ -103,6 +103,8 @@ using std::mem_fun_ref; using std::string; using std::vector; +namespace Alert = lyx::frontend::Alert; + namespace { diff --git a/src/buffer.C b/src/buffer.C index df4cddcded..59677959ca 100644 --- a/src/buffer.C +++ b/src/buffer.C @@ -123,6 +123,7 @@ using lyx::support::subst; using lyx::support::tempName; using lyx::support::trim; +namespace Alert = lyx::frontend::Alert; namespace os = lyx::support::os; namespace fs = boost::filesystem; diff --git a/src/buffer_funcs.C b/src/buffer_funcs.C index f4d7726555..ce0f60c7d1 100644 --- a/src/buffer_funcs.C +++ b/src/buffer_funcs.C @@ -63,6 +63,7 @@ using lyx::support::unlink; using std::min; using std::string; +namespace Alert = lyx::frontend::Alert; namespace fs = boost::filesystem; namespace { diff --git a/src/bufferlist.C b/src/bufferlist.C index ed749a0312..7ee22c652f 100644 --- a/src/bufferlist.C +++ b/src/bufferlist.C @@ -57,6 +57,8 @@ using std::vector; using std::back_inserter; using std::transform; +namespace Alert = lyx::frontend::Alert; + BufferList::BufferList() {} diff --git a/src/bufferparams.C b/src/bufferparams.C index 61d1088e46..d45bbe0c0d 100644 --- a/src/bufferparams.C +++ b/src/bufferparams.C @@ -60,6 +60,7 @@ using std::ostream; using std::ostringstream; using std::pair; +namespace Alert = lyx::frontend::Alert; namespace biblio = lyx::biblio; diff --git a/src/converter.C b/src/converter.C index f6d226f83b..1463e6e792 100644 --- a/src/converter.C +++ b/src/converter.C @@ -58,6 +58,8 @@ using std::string; using std::vector; using std::distance; +namespace Alert = lyx::frontend::Alert; + namespace { @@ -449,9 +451,9 @@ bool Converters::convert(Buffer const * buffer, } else { // FIXME: this should go out of here. For example, here we cannot say if // it is a document (.lyx) or something else. Same goes for elsewhere. - Alert::error(_("Cannot convert file"), - bformat(_("An error occurred whilst running %1$s"), - lyx::from_ascii(command.substr(0, 50)))); + Alert::error(_("Cannot convert file"), + bformat(_("An error occurred whilst running %1$s"), + lyx::from_ascii(command.substr(0, 50)))); } return false; } diff --git a/src/exporter.C b/src/exporter.C index 5e6b2aad6a..70f90317a7 100644 --- a/src/exporter.C +++ b/src/exporter.C @@ -53,6 +53,7 @@ using std::find; using std::string; using std::vector; +namespace Alert = lyx::frontend::Alert; namespace fs = boost::filesystem; namespace { diff --git a/src/format.C b/src/format.C index 58d0e38f4a..8ab1755954 100644 --- a/src/format.C +++ b/src/format.C @@ -44,6 +44,7 @@ using lyx::support::token; using std::string; using std::distance; +namespace Alert = lyx::frontend::Alert; namespace fs = boost::filesystem; namespace os = lyx::support::os; diff --git a/src/frontends/Alert.C b/src/frontends/Alert.C index 3bae1126f4..98c971c37a 100644 --- a/src/frontends/Alert.C +++ b/src/frontends/Alert.C @@ -24,6 +24,9 @@ using std::pair; using std::string; +namespace lyx { +namespace frontend { + int Alert::prompt(docstring const & title, docstring const & question, int default_button, int escape_button, docstring const & b1, docstring const & b2, docstring const & b3) @@ -98,3 +101,6 @@ pair const Alert::askForText(docstring const & msg, return askForText_pimpl(msg, dflt); } + +} +} diff --git a/src/frontends/Alert.h b/src/frontends/Alert.h index 716b1a700b..cb3a0a8e4f 100644 --- a/src/frontends/Alert.h +++ b/src/frontends/Alert.h @@ -15,6 +15,8 @@ #include "support/lstrings.h" +namespace lyx { +namespace frontend { namespace Alert { /** @@ -58,5 +60,7 @@ askForText(lyx::docstring const & msg, lyx::docstring const & dflt = lyx::docstring()); } +} +} #endif // LYX_ALERT_H diff --git a/src/frontends/qt3/validators.C b/src/frontends/qt3/validators.C index 5f536bf3ac..c9240bd00c 100644 --- a/src/frontends/qt3/validators.C +++ b/src/frontends/qt3/validators.C @@ -138,7 +138,7 @@ QValidator::State PathValidator::validate(QString & qtext, int &) const static int counter = 0; if (counter == 0) { - Alert::error(_("Invalid filename"), + lyx::frontend::Alert::error(_("Invalid filename"), _("LyX does not provide LateX support for file names containing any of these characters:\n") + lyx::from_utf8(printable_list(invalid_chars))); } diff --git a/src/frontends/qt4/validators.C b/src/frontends/qt4/validators.C index 74ccd42746..0f388d58f7 100644 --- a/src/frontends/qt4/validators.C +++ b/src/frontends/qt4/validators.C @@ -138,7 +138,7 @@ QValidator::State PathValidator::validate(QString & qtext, int &) const static int counter = 0; if (counter == 0) { - Alert::error(_("Invalid filename"), + lyx::frontend::Alert::error(_("Invalid filename"), _("LyX does not provide LateX support for file names containing any of these characters:\n") + lyx::from_utf8(printable_list(invalid_chars))); } diff --git a/src/importer.C b/src/importer.C index f9f9f7843f..6d4801249a 100644 --- a/src/importer.C +++ b/src/importer.C @@ -59,7 +59,7 @@ bool Importer::Import(LyXView * lv, string const & filename, } } if (loader_format.empty()) { - Alert::error(_("Couldn't import file"), + lyx::frontend::Alert::error(_("Couldn't import file"), bformat(_("No information for importing the format %1$s."), formats.prettyName(format))); return false; diff --git a/src/insets/insetbibtex.C b/src/insets/insetbibtex.C index 91647a2a04..7f5e2dc84c 100644 --- a/src/insets/insetbibtex.C +++ b/src/insets/insetbibtex.C @@ -57,6 +57,7 @@ using lyx::support::subst; using lyx::support::tokenPos; using lyx::support::trim; +namespace Alert = lyx::frontend::Alert; namespace os = lyx::support::os; using std::endl; diff --git a/src/insets/insetinclude.C b/src/insets/insetinclude.C index 6a964f97df..daa2a43678 100644 --- a/src/insets/insetinclude.C +++ b/src/insets/insetinclude.C @@ -81,6 +81,7 @@ using std::istringstream; using std::ostream; using std::ostringstream; +namespace Alert = lyx::frontend::Alert; namespace fs = boost::filesystem; diff --git a/src/insets/insettabular.C b/src/insets/insettabular.C index bbe11a42fd..95fc6310a5 100644 --- a/src/insets/insettabular.C +++ b/src/insets/insettabular.C @@ -71,6 +71,8 @@ using std::ostringstream; using std::swap; using std::vector; +namespace Alert = lyx::frontend::Alert; + namespace { diff --git a/src/lyx_cb.C b/src/lyx_cb.C index 455136b3df..af2f31c90f 100644 --- a/src/lyx_cb.C +++ b/src/lyx_cb.C @@ -78,6 +78,7 @@ using lyx::support::unlink; using boost::shared_ptr; +namespace Alert = lyx::frontend::Alert; namespace fs = boost::filesystem; using std::back_inserter; diff --git a/src/lyx_main.C b/src/lyx_main.C index 958f2fdd39..6e2b8ba530 100644 --- a/src/lyx_main.C +++ b/src/lyx_main.C @@ -77,6 +77,7 @@ using lyx::support::Systemcall; using lyx::docstring; +namespace Alert = lyx::frontend::Alert; namespace os = lyx::support::os; namespace fs = boost::filesystem; diff --git a/src/lyxfind.C b/src/lyxfind.C index 0aec2206be..f69b4249b4 100644 --- a/src/lyxfind.C +++ b/src/lyxfind.C @@ -137,7 +137,8 @@ bool findChange(DocIterator & cur) bool searchAllowed(BufferView * bv, string const & str) { if (str.empty()) { - Alert::error(_("Search error"), _("Search string is empty")); + lyx::frontend::Alert::error(_("Search error"), + _("Search string is empty")); return false; } return bv->buffer(); diff --git a/src/lyxfunc.C b/src/lyxfunc.C index 4485522754..3850651545 100644 --- a/src/lyxfunc.C +++ b/src/lyxfunc.C @@ -136,6 +136,7 @@ using std::string; using std::istringstream; using std::ostringstream; +namespace Alert = lyx::frontend::Alert; namespace biblio = lyx::biblio; namespace fs = boost::filesystem; diff --git a/src/lyxvc.C b/src/lyxvc.C index 49b69ad94c..607950c46d 100644 --- a/src/lyxvc.C +++ b/src/lyxvc.C @@ -37,6 +37,8 @@ using std::endl; using std::string; using std::pair; +namespace Alert = lyx::frontend::Alert; + LyXVC::LyXVC() { diff --git a/src/output.C b/src/output.C index e45640df36..fbdef6bbbb 100644 --- a/src/output.C +++ b/src/output.C @@ -35,7 +35,7 @@ bool openFileWrite(ofstream & ofs, string const & fname) docstring const file = makeDisplayPath(fname, 50); docstring text = bformat(_("Could not open the specified " "document\n%1$s."), file); - Alert::error(_("Could not open file"), text); + lyx::frontend::Alert::error(_("Could not open file"), text); return false; } return true; -- 2.39.2