diff options
Diffstat (limited to 'src/inkview.cpp')
| -rw-r--r-- | src/inkview.cpp | 40 |
1 files changed, 25 insertions, 15 deletions
diff --git a/src/inkview.cpp b/src/inkview.cpp index a7a6b6a78..ca3d16cdf 100644 --- a/src/inkview.cpp +++ b/src/inkview.cpp @@ -144,12 +144,6 @@ SPSlideShow::SPSlideShow(std::vector<Glib::ustring> const &slides) show(); } -static void usage(); - - -// Dummy functions to keep linker happy -int sp_main_gui (int, char const**) { return 0; } -int sp_main_console (int, char const**) { return 0; } static int sp_svgview_main_delete (GtkWidget */*widget*/, GdkEvent */*event*/, @@ -223,22 +217,22 @@ class InkviewOptionsGroup : public Glib::OptionGroup public: InkviewOptionsGroup() : - Glib::OptionGroup(_("Inkscape Options"), - _("Default program options")), + Glib::OptionGroup(N_("Inkscape Options"), + N_("Default program options")), _entry_timer(), _entry_args() { // Entry for the "timer" option _entry_timer.set_short_name('t'); _entry_timer.set_long_name("timer"); - _entry_timer.set_arg_description(_("NUM")); - _entry_timer.set_description(_("Reset timer:")); + _entry_timer.set_arg_description(N_("NUM")); + _entry_timer.set_description(N_("Reset timer:")); add_entry(_entry_timer, timer); // Entry for the remaining non-option arguments _entry_args.set_short_name('\0'); _entry_args.set_long_name(G_OPTION_REMAINING); - _entry_args.set_arg_description(_("FILES...")); + _entry_args.set_arg_description(N_("FILES …")); add_entry(_entry_args, filenames); } @@ -248,18 +242,34 @@ private: Glib::OptionEntry _entry_args; }; + +#ifdef WIN32 +// minimal print handler (just prints the string to stdout) +void g_print_no_convert(const gchar *buf) +{ + fputs(buf, stdout); +} +#endif + int main (int argc, char **argv) { +#ifdef WIN32 + // Ugly hack to make g_print emit UTF-8 encoded characters. Otherwise glib will *always* + // perform character conversion to the system's ANSI code page making UTF-8 output impossible. + g_set_print_handler(g_print_no_convert); +#endif #ifdef ENABLE_NLS Inkscape::initialize_gettext(); #endif - Glib::OptionContext opt(_("Open SVG files")); + Glib::OptionContext opt(N_("Open SVG files")); + opt.set_translation_domain(GETTEXT_PACKAGE); + InkviewOptionsGroup grp; + grp.set_translation_domain(GETTEXT_PACKAGE); + opt.set_main_group(grp); - // Prevents errors like "Unable to wrap GdkPixbuf..." (in nr-filter-image.cpp for example) - Gtk::Main::init_gtkmm_internals(); Gtk::Main main_instance (argc, argv, opt); LIBXML_TEST_VERSION @@ -271,7 +281,7 @@ int main (int argc, char **argv) if(filenames.empty()) { - std::cout << opt.get_help(); + g_print(opt.get_help().c_str()); exit(EXIT_FAILURE); } |
