]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiListings.cpp
header cleanup
[lyx.git] / src / frontends / qt4 / GuiListings.cpp
index 0ad96d07c99f3ccdee0a678cfd0c5623e3c9d22b..52c03e9508ccb4c6f13f1ab859cbc772bfaffbac 100644 (file)
 #include "FuncRequest.h"
 #include "insets/InsetListings.h"
 #include "insets/InsetListingsParams.h"
-#include "debug.h"
+#include "support/debug.h"
 
+#include "support/gettext.h"
 #include "support/lstrings.h"
 
 #include <QLineEdit>
-#include <QCloseEvent>
 #include <QPushButton>
 #include <QValidator>
 #include <QRegExpValidator>
 
-
-using std::string;
-using std::vector;
-using lyx::support::findToken;
-using lyx::support::getVectorFromString;
-using lyx::support::getStringFromVector;
-using lyx::support::prefixIs;
-using lyx::support::suffixIs;
-using lyx::support::contains;
-
+using namespace std;
+using namespace lyx::support;
 
 namespace lyx {
 namespace frontend {
@@ -52,7 +44,7 @@ namespace frontend {
 char const * languages[] =
 { "no language", "ABAP", "ACSL", "Ada", "ALGOL", "Assembler", "Awk", "bash", "Basic", "C",
   "C++", "Caml", "Clean", "Cobol", "Comal 80", "command.com", "Comsol", "csh", "Delphi",
-  "Eiffel", "Elan", "Euphoria", "Fortran", "Gnuplot", "Haskell", "HTML", "IDL", "inform",
+  "Eiffel", "Elan", "erlang", "Euphoria", "Fortran", "Gnuplot", "Haskell", "HTML", "IDL", "inform",
   "Java", "JVMIS", "ksh", "Lingo", "Lisp", "Logo", "make", "Mathematica", "Matlab", "Mercury",
   "MetaPost", "Miranda", "ML", "Modula-2", "MuPAD", "NASTRAN", "Oberon-2", "OCL", "Octave",
   "Oz", "Pascal", "Perl", "PHP", "PL/I", "Plasm", "PostScript", "POV", "Prolog", "Promela",
@@ -64,7 +56,7 @@ char const * languages[] =
 char const * languages_gui[] =
 { N_("No language"), "ABAP", "ACSL", "Ada", "ALGOL", "Assembler", "Awk", "bash", "Basic",
   "C", "C++", "Caml", "Clean", "Cobol", "Comal 80", "command.com", "Comsol", "csh", "Delphi",
-  "Eiffel", "Elan", "Euphoria", "Fortran", "Gnuplot", "Haskell", "HTML", "IDL", "inform",
+  "Eiffel", "Elan", "Erlang", "Euphoria", "Fortran", "Gnuplot", "Haskell", "HTML", "IDL", "inform",
   "Java", "JVMIS", "ksh", "Lingo", "Lisp", "Logo", "make", "Mathematica", "Matlab", "Mercury",
   "MetaPost", "Miranda", "ML", "Modula-2", "MuPAD", "NASTRAN", "Oberon-2", "OCL", "Octave",
   "Oz", "Pascal", "Perl", "PHP", "PL/I", "Plasm", "PostScript", "POV", "Prolog", "Promela",
@@ -165,11 +157,10 @@ char const * font_styles_gui[] =
 
 
 
-GuiListings::GuiListings(LyXView & lv)
-       : GuiDialog(lv, "listings")
+GuiListings::GuiListings(GuiView & lv)
+       : GuiDialog(lv, "listings", qt_("Program Listing Settings"))
 {
        setupUi(this);
-       setViewTitle(_("Program Listing Settings"));
 
        connect(okPB, SIGNAL(clicked()), this, SLOT(slotOK()));
        connect(applyPB, SIGNAL(clicked()), this, SLOT(slotApply()));
@@ -246,13 +237,6 @@ GuiListings::GuiListings(LyXView & lv)
 }
 
 
-void GuiListings::closeEvent(QCloseEvent * e)
-{
-       slotClose();
-       e->accept();
-}
-
-
 void GuiListings::change_adaptor()
 {
        changed();
@@ -441,7 +425,7 @@ void GuiListings::applyView()
 }
 
 
-static string plainParam(std::string const & par)
+static string plainParam(string const & par)
 {
        // remove enclosing braces
        if (prefixIs(par, "{") && suffixIs(par, "}"))
@@ -489,11 +473,12 @@ void GuiListings::updateContents()
                        string dialect;
                        bool in_gui = false;
                        if (prefixIs(arg, "[") && contains(arg, "]")) {
-                               string::size_type end_dialect = arg.find("]");
+                               size_t end_dialect = arg.find("]");
                                dialect = arg.substr(1, end_dialect - 1);
                                language = arg.substr(end_dialect + 1);
-                       } else
+                       } else {
                                language = arg;
+                       }
                        int n = findToken(languages, language);
                        if (n >= 0) {
                                languageCO->setCurrentIndex(n);
@@ -642,7 +627,7 @@ void GuiListings::setParams(InsetListingsParams const & params)
 }
 
 
-Dialog * createGuiListings(LyXView & lv) { return new GuiListings(lv); }
+Dialog * createGuiListings(GuiView & lv) { return new GuiListings(lv); }
 
 
 } // namespace frontend