]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/gtk/GText.C
Change glob() API to accept a dir parameter.
[lyx.git] / src / frontends / gtk / GText.C
index 1a6aaf143896c0fc9db2090e6315a1bfed20df47..2f28716cd5280727163553415bbeab7956a93573 100644 (file)
@@ -9,38 +9,52 @@
  */
 
 #include <config.h>
-#include <gtkmm.h>
-#include <libglademm.h>
 
-#include "support/lstrings.h"
-#include "support/filetools.h"
-#include "ControlCommand.h"
+// Too hard to make concept checks work with this file
+#ifdef _GLIBCPP_CONCEPT_CHECKS
+#undef _GLIBCPP_CONCEPT_CHECKS
+#endif
+
 #include "GText.h"
+#include "ControlCommand.h"
+#include "ghelpers.h"
 #include "IdSc.h"
 
+#include "support/lstrings.h"
+
+#include <gtkmm.h>
+#include <libglademm.h>
+
+using std::string;
+
+namespace lyx {
+namespace frontend {
+
 GText::GText(Dialog & parent, string const & title, string const & label)
        : GViewCB<ControlCommand, GViewGladeB>(parent, title),
          label_(label), entry_(0)
 {
 }
 
+
 void GText::apply()
 {
        string const contents = Glib::locale_from_utf8(entry_->get_text());
        controller().params().setContents(contents);
 }
 
+
 void GText::update()
 {
-       string const contents = lyx::support::trim(
+       string const contents = support::trim(
                controller().params().getContents());
        entry_->set_text(Glib::locale_to_utf8(contents));
 }
 
+
 void GText::doBuild()
 {
-       string const gladeName =
-               lyx::support::LibFileSearch("glade", "text", "glade");
+       string const gladeName = findGladeFile("text");
        xml_ = Gnome::Glade::Xml::create(gladeName);
        Gtk::Label * label;
        Gtk::Button * restore;
@@ -54,24 +68,20 @@ void GText::doBuild()
        xml_->get_widget("Apply", apply);
        xml_->get_widget("OK", ok);
        label->set_text(Glib::locale_to_utf8(id_sc::id(label_)));
-       bcview().setOK(ok);
-       bcview().setApply(apply);
-       bcview().setCancel(cancel);
-       bcview().setRestore(restore);
+       setOK(ok);
+       setApply(apply);
+       setCancel(cancel);
+       setRestore(restore);
        bcview().addReadOnly(entry_);
-       ok->signal_clicked().connect(
-               SigC::slot(*this, &GViewBase::onOK));
-       apply->signal_clicked().connect(
-               SigC::slot(*this, &GViewBase::onApply));
-       cancel->signal_clicked().connect(
-               SigC::slot(*this, &GViewBase::onCancel));
-       restore->signal_clicked().connect(
-               SigC::slot(*this, &GViewBase::onRestore));
        entry_->signal_changed().connect(
-               SigC::slot(*this, &GText::onEntryChanged));
+               sigc::mem_fun(*this, &GText::onEntryChanged));
 }
 
+
 void GText::onEntryChanged()
 {
        bc().valid(!entry_->get_text().empty());
 }
+
+} // namespace frontend
+} // namespace lyx