]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt2/QTexinfo.C
Some string(widget->text()) fixes. Weirdness
[lyx.git] / src / frontends / qt2 / QTexinfo.C
index 7b76eeec817f90414f6a7d9324fae57f79ff4112..c85deff0083acc8bf8bfef86ed0a3cc97ad6ab10 100644 (file)
@@ -1,15 +1,15 @@
 /**
  * \file QTexinfo.C
- * Copyright 2002 the LyX Team
- * Read the file COPYING
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
  *
- * \author Edwin Leuven <leuven@fee.uva.nl>
+ * \author Edwin Leuven
+ *
+ * Full author contact details are available in file CREDITS
  */
 
 #include <config.h>
 
-#include <vector>
-
 #ifdef __GNUG__
 #pragma implementation
 #endif
 #include "gettext.h"
 #include "helper_funcs.h"
 
+#include "support/lstrings.h"
+
 #include <qlistbox.h>
 #include <qpushbutton.h>
 #include <qcheckbox.h>
 
+using std::vector;
+
 typedef Qt2CB<ControlTexinfo, Qt2DB<QTexinfoDialog> > base_class;
-QTexinfo::QTexinfo(ControlTexinfo & c)
-       : base_class(c, _("LaTeX Information")), warningPosted(false), activeStyle(ControlTexinfo::cls)
 
+
+QTexinfo::QTexinfo()
+       : base_class(_("LaTeX Information")), warningPosted(false), activeStyle(ControlTexinfo::cls)
 {
 }
 
@@ -43,24 +47,37 @@ void QTexinfo::build_dialog()
        bc().setCancel(dialog_->closePB);
 }
 
+
 void QTexinfo::updateStyles(ControlTexinfo::texFileSuffix whichStyle)
 {
+       string const fstr =  controller().getContents(whichStyle, true);
+
+       switch (whichStyle) {
+           case ControlTexinfo::bst:
+               bst_ = getVectorFromString(fstr, "\n");
+               break;
+           case ControlTexinfo::cls:
+               cls_ = getVectorFromString(fstr, "\n");
+               break;
+           case ControlTexinfo::sty:
+               sty_ = getVectorFromString(fstr, "\n");
+               break;
+       }
+
+       dialog_->fileList->clear();
+
        bool const withFullPath = dialog_->path->isChecked();
-       
        string const str =  controller().getContents(whichStyle, withFullPath);
-       std::vector<string> flist = getVectorFromString(str,"\n");
-       
-       dialog_->fileList->clear();
-       
+       vector<string> flist = getVectorFromString(str, "\n");
        for (vector<string>::const_iterator fitem = flist.begin();
                fitem != flist.end(); ++fitem) {
                dialog_->fileList->insertItem((*fitem).c_str());
        }
-       
+
        activeStyle = whichStyle;
 }
 
+
 void QTexinfo::updateStyles()
 {
        updateStyles(activeStyle);