]> git.lyx.org Git - features.git/commitdiff
Changes to External controller for GTK implementation
authorJohn Spray <spray@lyx.org>
Wed, 19 Apr 2006 09:11:25 +0000 (09:11 +0000)
committerJohn Spray <spray@lyx.org>
Wed, 19 Apr 2006 09:11:25 +0000 (09:11 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13693 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/controllers/ChangeLog
src/frontends/controllers/ControlExternal.C
src/frontends/controllers/ControlExternal.h

index af0b6456316bed01660c099426f829bf48c2880a..1d33d438e189ad49ca6f2f62bdd9662d23fd87d0 100644 (file)
@@ -1,3 +1,7 @@
+2006-04-19  Bernhard Reiter <ockham@gmx.net>
+       * ControlExternal.[Ch]: Split browse(...) half, introducing
+       getTemplateFilters(...)
+
 2006-03-10  Martin Vermeer  <martin.vermeer@hut.fi>
 
        * ControlChanges.C: fix bug 2212: First change is skipped in
index e0c36c0ec416e905cb68e32b07e9ec5ff53010ed..520a1f4e2382eb1c9b8adfd545a1f7732147686d 100644 (file)
@@ -140,22 +140,30 @@ external::Template ControlExternal::getTemplate(int i) const
 }
 
 
-string const ControlExternal::browse(string const & input,
-                                    string const & template_name) const
+string const
+ControlExternal::getTemplateFilters(string const & template_name) const
 {
-       string const title =  _("Select external file");
-
-       string const bufpath = kernel().bufferFilepath();
-
        /// Determine the template file extension
        external::TemplateManager const & etm =
                external::TemplateManager::get();
        external::Template const * const et_ptr =
                etm.getTemplateByName(template_name);
 
-       FileFilterList const filter = et_ptr ?
-               FileFilterList(et_ptr->fileRegExp) :
-               FileFilterList();
+       if (et_ptr) 
+               return et_ptr->fileRegExp;
+
+       return string();
+}
+
+
+string const ControlExternal::browse(string const & input,
+                                    string const & template_name) const
+{
+       string const title =  _("Select external file");
+
+       string const bufpath = kernel().bufferFilepath();
+       FileFilterList const filter = 
+               FileFilterList(getTemplateFilters(template_name));
 
        std::pair<string, string> dir1(N_("Documents|#o#O"),
                                       string(lyxrc.document_path));
index da404970d3cc2d44b888f91ff830b7e674abbede..967dce22cf385e3143b0c5b3f3befc55dddc5821 100644 (file)
@@ -65,8 +65,11 @@ public:
        ///
        external::Template getTemplate(int) const;
        ///
+       std::string const 
+       getTemplateFilters(std::string const & template_name) const;
+       ///
        std::string const browse(std::string const & input_file,
-                                std::string const & tempalate_name) const;
+                                std::string const & template_name) const;
 
        /// Read the Bounding Box from a eps or ps-file
        std::string const readBB(std::string const & file);