+
+
+// We need these in the file browser.
+extern string system_lyxdir;
+extern string user_lyxdir;
+
+string const ControlGraphics::Browse(string const & in_name)
+{
+ string const title = N_("Graphics|#G#g");
+ // FIXME: currently we need the second '|' to prevent mis-interpretation
+ string const pattern = "*.(eps|png|jpeg|jpg|gif)|";
+
+ // Does user clipart directory exist?
+ string clipdir = AddName (user_lyxdir, "clipart");
+ FileInfo fileInfo(clipdir);
+ if (!(fileInfo.isOK() && fileInfo.isDir()))
+ // No - bail out to system clipart directory
+ clipdir = AddName (system_lyxdir, "clipart");
+ pair<string, string> dir1(N_("Clipart|#C#c"), clipdir);
+
+ // Show the file browser dialog
+ return browseFile(&lv_, in_name, title, pattern, dir1);
+}