partial compile fix

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15348 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Georg Baum 2006-10-16 09:53:30 +00:00
parent 3a32fff90e
commit 80080dcfae
10 changed files with 59 additions and 54 deletions

View File

@ -20,10 +20,12 @@
#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);
}

View File

@ -24,23 +24,25 @@
#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;
}

View File

@ -19,21 +19,21 @@
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_;

View 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

View 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) {

View 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));
}

View 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()) {

View 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)));
}

View File

@ -268,7 +268,7 @@ void GMenubar::onSubMenuActivate(MenuItem const * item,
void GMenubar::onCommandActivate(MenuItem const * item,
Gtk::MenuItem * /*gitem*/)
{
view_.dispatch(item->func());
view_->dispatch(item->func());
}
} // namespace frontend

View 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_;