]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/controllers/helper_funcs.C
Add a buffer_path arg to InsetGraphicsMailer's params2string, string2params.
[lyx.git] / src / frontends / controllers / helper_funcs.C
index 8fa6d4d9d436d83700cc1d55c19abe0f78d039b2..28826ad9e732a50e80f49046fe95c01f8ff17dc8 100644 (file)
@@ -10,9 +10,6 @@
 
 #include <vector>
 
-#ifdef __GNUG__
-#pragma implementation
-#endif
 
 #include <config.h>
 #include "LString.h"
 #include "gettext.h" // _()
 #include "frontends/Alert.h"
 
+using namespace lyx::support;
+
 using std::pair;
 using std::vector;
 using std::make_pair;
 
 
-string const browseFile(LyXView * lv, string const & filename,
+string const browseFile(string const & filename,
                        string const & title,
                        string const & pattern,
                        bool save,
@@ -40,7 +39,7 @@ string const browseFile(LyXView * lv, string const & filename,
        if (!filename.empty())
                lastPath = OnlyPath(filename);
 
-       FileDialog fileDlg(lv, title, LFUN_SELECT_FILE_SYNC, dir1, dir2);
+       FileDialog fileDlg(title, LFUN_SELECT_FILE_SYNC, dir1, dir2);
 
        FileDialog::Result result;
 
@@ -60,16 +59,17 @@ string const browseFile(LyXView * lv, 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;
 }
 
 
-string const browseRelFile(LyXView * lv, string const & filename,
+string const browseRelFile(string const & filename,
                        string const & refpath,
                        string const & title,
                        string const & pattern,
@@ -79,7 +79,7 @@ string const browseRelFile(LyXView * lv, string const & filename,
 {
        string const fname = MakeAbsPath(filename, refpath);
 
-       string const outname = browseFile(lv, fname, title, pattern, save,
+       string const outname = browseFile(fname, title, pattern, save,
                                          dir1, dir2);
        string const reloutname = MakeRelPath(outname, refpath);
        if (prefixIs(reloutname, "../"))
@@ -89,7 +89,7 @@ string const browseRelFile(LyXView * lv, string const & filename,
 }
 
 
-string const browseDir(LyXView * lv, string const & pathname,
+string const browseDir(string const & pathname,
                        string const & title,
                        pair<string,string> const & dir1,
                        pair<string,string> const & dir2)
@@ -98,7 +98,7 @@ string const browseDir(LyXView * lv, string const & pathname,
        if (!pathname.empty())
                lastPath = OnlyPath(pathname);
 
-       FileDialog fileDlg(lv, title, LFUN_SELECT_FILE_SYNC, dir1, dir2);
+       FileDialog fileDlg(title, LFUN_SELECT_FILE_SYNC, dir1, dir2);
 
        FileDialog::Result result;
 
@@ -114,9 +114,10 @@ string const browseDir(LyXView * lv, 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;