]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/xforms/FormTexinfo.C
Change the semantics of 'none' and 'auto' viewers/editors: 'none' means now
[lyx.git] / src / frontends / xforms / FormTexinfo.C
index 70ca9967365e806aeff5f71ea3a7a787dd6af1df..98677ef2ce703776f2c2b5a200f43ff7dea1cb93 100644 (file)
@@ -3,32 +3,34 @@
  * This file is part of LyX, the document processor.
  * Licence details can be found in the file COPYING.
  *
- * \author Herbert Voss
+ * \author Herbert Voß
  *
- * Full author contact details are available in file CREDITS
- * \date 2001-10-01
+ * Full author contact details are available in file CREDITS.
  */
 
 #include <config.h>
 
-#include "xformsBC.h"
 #include "FormTexinfo.h"
 #include "forms/form_texinfo.h"
+
 #include "Tooltips.h"
-#include "gettext.h"
-#include "xforms_helpers.h"
-#include "support/LAssert.h"
-#include "support/lstrings.h"
+#include "xformsBC.h"
+
 #include "support/filetools.h"
 
 #include "lyx_forms.h"
 
-using namespace lyx::support;
+using std::string;
+
+namespace lyx {
+
+namespace frontend {
+
 
 typedef FormController<ControlTexinfo, FormView<FD_texinfo> > base_class;
 
 FormTexinfo::FormTexinfo(Dialog & parent)
-       : base_class(parent, _("LaTeX Information")),
+       : base_class(parent, _("TeX Information")),
          activeStyle(ControlTexinfo::cls)
 {}
 
@@ -53,7 +55,7 @@ void FormTexinfo::build() {
        str = _("Show full path or only file name.");
        tooltips().init(dialog_->check_fullpath, str);
 
-       str = _("Runs the script \"TexFiles.sh\" to build new file lists.");
+       str = _("Runs the script \"TexFiles.sh\" to rebuild the file lists.");
        tooltips().init(dialog_->button_rescan, str);
 
        str = _("Double click to view contents of file.");
@@ -85,8 +87,12 @@ ButtonPolicy::SMInput FormTexinfo::input(FL_OBJECT * ob, long ob_value) {
                // double click in browser: view selected file
                ContentsType::size_type const sel = fl_get_browser(ob);
                ContentsType const & data = texdata_[activeStyle];
+               string file = data[sel-1];
+               if (!fl_get_button(dialog_->check_fullpath))
+                       file = getTexFileFromList(data[sel-1],
+                               controller().getFileType(activeStyle));
                if (sel >= 1 && sel <= data.size())
-                       controller().viewFile(data[sel-1]);
+                       controller().viewFile(file);
 
                // reset the browser so that the following single-click
                // callback doesn't do anything
@@ -121,17 +127,17 @@ ButtonPolicy::SMInput FormTexinfo::input(FL_OBJECT * ob, long ob_value) {
 void FormTexinfo::updateStyles(ControlTexinfo::texFileSuffix whichStyle)
 {
        ContentsType & data = texdata_[whichStyle];
-       getTexFileList(whichStyle, data);
-
        bool const withFullPath = fl_get_button(dialog_->check_fullpath);
+       getTexFileList(whichStyle, data, withFullPath);
 
        fl_clear_browser(dialog_->browser);
        ContentsType::const_iterator it  = data.begin();
        ContentsType::const_iterator end = data.end();
-       for (; it != end; ++it) {
-               string const line = withFullPath ? *it : OnlyFilename(*it);
-               fl_add_browser_line(dialog_->browser, line.c_str());
-       }
+       for (; it != end; ++it)
+               fl_add_browser_line(dialog_->browser, (*it).c_str());
 
        activeStyle = whichStyle;
 }
+
+} // namespace frontend
+} // namespace lyx