]> git.lyx.org Git - features.git/commitdiff
partial compile fix
authorGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Mon, 16 Oct 2006 09:53:30 +0000 (09:53 +0000)
committerGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Mon, 16 Oct 2006 09:53:30 +0000 (09:53 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15348 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/gtk/FileDialog.C
src/frontends/gtk/FileDialogPrivate.C
src/frontends/gtk/FileDialogPrivate.h
src/frontends/gtk/GBC.C
src/frontends/gtk/GBibtex.C
src/frontends/gtk/GExternal.C
src/frontends/gtk/GGraphics.C
src/frontends/gtk/GInclude.C
src/frontends/gtk/GMenubar.C
src/frontends/gtk/GViewBase.h

index 829ebba045731eff0183385fe554321ff467db51..599e84cf22a74a31d2685cd9f3ee6dd3fd2e345e 100644 (file)
 
 #include "FileDialogPrivate.h"
 
+using lyx::docstring;
+
 using std::string;
 
 
-FileDialog::FileDialog(string const & title,
+FileDialog::FileDialog(docstring const & title,
                       kb_action action,
                       Button b1,
                       Button b2)
@@ -39,26 +41,26 @@ FileDialog::~FileDialog()
 
 
 FileDialog::Result const
-FileDialog::open(string const & path,
+FileDialog::open(docstring const & path,
                 lyx::support::FileFilterList const & filters,
-                string const & suggested)
+                docstring const & suggested)
 {
        return private_->open(path, filters, suggested);
 }
 
 
 FileDialog::Result const
-FileDialog::opendir(string const & path,
-                   string const & suggested)
+FileDialog::opendir(docstring const & path,
+                   docstring const & suggested)
 {
        return private_->opendir(path, suggested);
 }
 
 
 FileDialog::Result const
-FileDialog::save(string const & path,
+FileDialog::save(docstring const & path,
                 lyx::support::FileFilterList const & filters,
-                string const & suggested)
+                docstring const & suggested)
 {
        return private_->save(path, filters, suggested);
 }
index 6b8de592f0b2f31b0cc19ebd71ad18c62a6f670d..d8e84b5c06a14360b4dd001e1fe468eb22c19437 100644 (file)
 #include "support/filefilterlist.h"
 #include "debug.h"
 
+using lyx::docstring;
+
 using std::string;
 
-FileDialog::Private::Private(string const & title,
+FileDialog::Private::Private(docstring const & title,
                             kb_action action,
                             FileDialog::Button /*b1*/,
                             FileDialog::Button /*b2*/) :
        action_(action),
        fileChooser_("You shouldn't see this", Gtk::FILE_CHOOSER_ACTION_OPEN)
 {
-       fileChooser_.set_title(title);
+       fileChooser_.set_title(lyx::to_utf8(title));
 }
 
 
 FileDialog::Result const
-FileDialog::Private::open(string const & path,
+FileDialog::Private::open(docstring const & path,
                          lyx::support::FileFilterList const & filters,
-                         string const & suggested)
+                         docstring const & suggested)
 {
        fileChooser_.set_action(Gtk::FILE_CHOOSER_ACTION_OPEN);
        fileChooser_.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
@@ -50,8 +52,8 @@ FileDialog::Private::open(string const & path,
 }
 
 
-FileDialog::Result const FileDialog::Private::opendir(string const & path,
-                                                     string const & suggested)
+FileDialog::Result const FileDialog::Private::opendir(docstring const & path,
+                                                     docstring const & suggested)
 {
        fileChooser_.set_action(Gtk::FILE_CHOOSER_ACTION_SELECT_FOLDER);
        fileChooser_.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
@@ -61,9 +63,9 @@ FileDialog::Result const FileDialog::Private::opendir(string const & path,
 }
 
 
-FileDialog::Result const FileDialog::Private::save(string const & path,
+FileDialog::Result const FileDialog::Private::save(docstring const & path,
                                                   lyx::support::FileFilterList const & filters,
-                                                  string const & suggested)
+                                                  docstring const & suggested)
 {
        fileChooser_.set_action(Gtk::FILE_CHOOSER_ACTION_SAVE);
        fileChooser_.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
@@ -73,13 +75,13 @@ FileDialog::Result const FileDialog::Private::save(string const & path,
 }
 
 
-FileDialog::Result const FileDialog::Private::showChooser(string const & path,
+FileDialog::Result const FileDialog::Private::showChooser(docstring const & path,
                          lyx::support::FileFilterList const & filters,
-                         string const & suggested)
+                         docstring const & suggested)
 {
-       lyxerr[Debug::GUI] << "File Dialog with path \"" << path
-                          << "\", mask \"" << filters.as_string()
-                          << "\", suggested \"" << suggested << "\"\n";
+       lyxerr[Debug::GUI] << "File Dialog with path \"" << lyx::to_utf8(path)
+                          << "\", mask \"" << lyx::to_utf8(filters.as_string())
+                          << "\", suggested \"" << lyx::to_utf8(suggested) << "\"\n";
 
        for (lyx::support::FileFilterList::size_type i = 0; i < filters.size(); ++i) {
                typedef lyx::support::FileFilterList::Filter::glob_iterator glob_iterator;
@@ -89,7 +91,7 @@ FileDialog::Result const FileDialog::Private::showChooser(string const & path,
                        continue;
 
                Gtk::FileFilter filter;
-               filter.set_name(filters[i].description());
+               filter.set_name(lyx::to_utf8(filters[i].description()));
                for (; it != end; ++it)
                        filter.add_pattern(*it);
 
@@ -97,16 +99,16 @@ FileDialog::Result const FileDialog::Private::showChooser(string const & path,
        }
 
        if (!path.empty())
-               fileChooser_.set_current_folder(path);
+               fileChooser_.set_current_folder(lyx::to_utf8(path));
        if (!suggested.empty())
-               fileChooser_.set_current_name(suggested);
+               fileChooser_.set_current_name(lyx::to_utf8(suggested));
 
        fileChooser_.set_default_response(Gtk::RESPONSE_OK);
        Result result;
        result.first = FileDialog::Chosen;
        if (fileChooser_.run() == Gtk::RESPONSE_OK)
-               result.second = fileChooser_.get_filename();
+               result.second = lyx::from_utf8(fileChooser_.get_filename());
        else
-               result.second = string();
+               result.second = docstring();
        return result;
 }
index 1d923e5897b7e2567b034999efe4f0d73f8b167f..9cf74baafa9232dbf9343debbd43ec3bccf0e380 100644 (file)
 
 class FileDialog::Private : public sigc::trackable {
 public:
-       Private(std::string const & title,
+       Private(lyx::docstring const & title,
                kb_action action,
                FileDialog::Button b1, FileDialog::Button b2);
-       FileDialog::Result const open(std::string const & path,
+       FileDialog::Result const open(lyx::docstring const & path,
                lyx::support::FileFilterList const & filters,
-               std::string const & suggested);
-       FileDialog::Result const opendir(std::string const & path,
-               std::string const & suggested);
-       FileDialog::Result const save(std::string const & path,
+               lyx::docstring const & suggested);
+       FileDialog::Result const opendir(lyx::docstring const & path,
+               lyx::docstring const & suggested);
+       FileDialog::Result const save(lyx::docstring const & path,
                lyx::support::FileFilterList const & filters,
-               std::string const & suggested);
+               lyx::docstring const & suggested);
 
-       FileDialog::Result const showChooser(std::string const & path,
+       FileDialog::Result const showChooser(lyx::docstring const & path,
                lyx::support::FileFilterList const & filters,
-               std::string const & suggested);
+               lyx::docstring const & suggested);
 
 private:
        kb_action action_;
index 68605830810c81cd4b38482504773bf72a89895c..98caec10c2543365c0a94f01df7c5bfcee429bd8 100644 (file)
@@ -48,7 +48,7 @@ void GBC::setButtonLabel(Gtk::Button * btn, docstring const & label) const
 {
        // GTK+ Stock buttons take precedence
        if (!btn->get_use_stock())
-               btn->set_label(label);
+               btn->set_label(lyx::to_utf8(label));
 }
 
 } // namespace frontend
index d1a33986519ee3edb6ee21dcc8ba24d44ff96d75..c902f21f2d8da38428399d7f0fb0f3d5c5fe1e32 100644 (file)
@@ -27,6 +27,7 @@
 
 #include <libglademm.h>
 
+using lyx::docstring;
 using lyx::support::changeExtension;
 using lyx::support::split;
 using lyx::support::trim;
@@ -212,7 +213,7 @@ void GBibtex::apply()
 
 void GBibtex::add()
 {
-       string new_bib = controller().browseBib("");
+       string new_bib = lyx::to_utf8(controller().browseBib(docstring()));
        if (new_bib.empty())
                return;
 
@@ -239,10 +240,10 @@ void GBibtex::remove()
 
 void GBibtex::browse()
 {
-       string const file = controller().browseBst("");
+       string const file = lyx::to_utf8(controller().browseBst(docstring()));
 
        if (!file.empty()) {
-               string const filen = changeExtension(file, "");
+               string const filen = changeExtension(file, string());
                bool present = false;
 
                for (unsigned int i = 0; i < stylecombo_.get_model()->children().size(); ++i) {
index 33fcef1bfeded69bb06cbb114f8db09ab8df40ea..289654c783d4ab8cdb2db51153a8c91156e02309 100644 (file)
@@ -34,6 +34,7 @@
 #include <vector>
 #include <string>
 
+using lyx::docstring;
 using lyx::support::token;
 using lyx::support::FileFilterList;
 using lyx::support::trim;
@@ -102,7 +103,7 @@ templateModelColumns& templateColumns() {
 
 /// Produces a vector of Gtk::FileFilter*s out of the controller's filterstring
 /// providing sensible descriptions (with alttitle as a fallback)
-std::vector<Gtk::FileFilter* > get_filters(const std::string & filterstring, const std::string & alttitle)
+std::vector<Gtk::FileFilter* > get_filters(docstring const & filterstring, docstring const & alttitle)
 {
        FileFilterList filterlist(filterstring);
        std::vector<Gtk::FileFilter* > filters(filterlist.size());
@@ -111,17 +112,16 @@ std::vector<Gtk::FileFilter* > get_filters(const std::string & filterstring, con
                FileFilterList::Filter ff = filterlist[i];
 
                filters[i] = new Gtk::FileFilter();
-               std::string description = ff.description();
+               docstring const description = ff.description();
 
                if (description.empty())
-                       filters[i]->set_name(Glib::locale_to_utf8(alttitle) +
-                                            " " + lyx::to_utf8(_("files")));
+                       filters[i]->set_name(lyx::to_utf8(alttitle + ' ' + _("files")));
                else
-                       filters[i]->set_name(Glib::locale_to_utf8(description));
+                       filters[i]->set_name(lyx::to_utf8(description));
 
                for (FileFilterList::Filter::glob_iterator git = ff.begin();
                        git!=ff.end(); ++git)
-                       filters[i]->add_pattern(Glib::locale_to_utf8(*git));
+                       filters[i]->add_pattern(*git);
        }
        return filters;
 }
@@ -328,11 +328,11 @@ void GExternal::doBuild()
                external::Template templ = controller().getTemplate(count);
 
                Gtk::TreeModel::iterator iter = templatestore_->append();
-               (*iter)[templateColumns().name] = Glib::locale_to_utf8(*cit);
-               (*iter)[templateColumns().info] =
-                       Glib::locale_to_utf8(templ.helpText);
+               (*iter)[templateColumns().name] = *cit;
+               (*iter)[templateColumns().info] = templ.helpText;
                (*iter)[templateColumns().filters] = get_filters(
-                       controller().getTemplateFilters(*cit),*cit);
+                       lyx::from_utf8(controller().getTemplateFilters(*cit)),
+                       lyx::from_utf8(*cit));
        }
 
 
index 5215665ee0b8cf7733bce1298c128582b6d74b56..f5697981170a3dbc60db019b496e4187d2908119 100644 (file)
@@ -468,7 +468,7 @@ void GGraphics::onBrowseClicked()
 {
        // Get the filename from the dialog
        string const in_name = fileentry_->get_text();
-       string const out_name = controller().browse(in_name);
+       string const out_name = lyx::to_utf8(controller().browse(lyx::from_utf8(in_name)));
        lyxerr[Debug::GRAPHICS]
                << "[FormGraphics]out_name: " << out_name << "\n";
        if (out_name != in_name && !out_name.empty()) {
index 6420c4c3c34902078ed6d4c232e8684ac344bcc4..a6cf0db6a443dbc5acd56e45c630e7cc4d050167 100644 (file)
@@ -147,7 +147,7 @@ void GInclude::onBrowseClicked()
        else
                type = ControlInclude::VERBATIM;
 
-       fileentry_->set_text(controller().browse(fileentry_->get_text(), type));
+       fileentry_->set_text(lyx::to_utf8(controller().browse(lyx::from_utf8(fileentry_->get_text()), type)));
 }
 
 
index 9cd7322574d5089838e904f242e8a1acb100ea5f..7028ece4d402e9b38a2b9644e0aea45145226803 100644 (file)
@@ -266,9 +266,9 @@ void GMenubar::onSubMenuActivate(MenuItem const * item,
 
 
 void GMenubar::onCommandActivate(MenuItem const * item,
-                                      Gtk::MenuItem * /*gitem*/)
+                                 Gtk::MenuItem * /*gitem*/)
 {
-       view_.dispatch(item->func());
+       view_->dispatch(item->func());
 }
 
 } // namespace frontend
index bfa05ae4c76db60abed719ee183fffafa3a2f3b0..00b42dab72dc9f312b3abb431bbbee5ac17e4119 100644 (file)
@@ -32,7 +32,7 @@ public:
        void setApply(Gtk::Button * apply);
        void setOK(Gtk::Button * ok);
        void setRestore(Gtk::Button * restore);
-       void setTitle(lyx::doctring const &);
+       void setTitle(lyx::docstring const &);
        bool readOnly() const;
 protected:
        // Build the dialog
@@ -90,7 +90,7 @@ const Gtk::Window * GViewDB<Dialog>::window() const
 
 class GViewGladeB : public GViewBase {
 protected:
-       GViewGladeB(Dialog & parent, std::string const & t, bool allowResize);
+       GViewGladeB(Dialog & parent, lyx::docstring const & t, bool allowResize);
        virtual Gtk::Window const * window() const;
        virtual Gtk::Window * window();
        Glib::RefPtr<Gnome::Glade::Xml> xml_;