COIN-OR::LEMON - Graph Library

Changeset 130:3533c2d9a865 in glemon-0.x


Ignore:
Timestamp:
03/23/06 20:57:14 (18 years ago)
Author:
Akos Ladanyi
Branch:
gui
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk/gui@2646
Message:
  • added gettext infrastructure to the gui
  • the gui has a separate configure script now
  • other minor changes
Files:
9 added
3 edited

Legend:

Unmodified
Added
Removed
  • Makefile.am

    r112 r130  
    1 AM_CPPFLAGS = -I$(top_srcdir)
    2 LDADD = $(top_builddir)/lemon/libemon.la
     1AM_CPPFLAGS = -I$(top_srcdir) -DLOCALEDIR=\""$(datadir)/locale"\"
     2LDADD = ../lemon/libemon.la
     3
     4ACLOCAL_AMFLAGS = -I m4
     5
     6EXTRA_DIST = \
     7        build-aux/config.rpath
     8
     9SUBDIRS = po
    310
    411bin_PROGRAMS = glemon
     
    4047        gui_writer.cc \
    4148        xml.h \
    42         guipixbufs.h
     49        guipixbufs.h \
     50        gettext.h
    4351
    4452glemon_CXXFLAGS = $(GTK_CFLAGS)
    4553glemon_LDFLAGS = $(GTK_LIBS)
     54#glemon_LDADD = $(LIBINTL)
    4655
    4756IMAGES = \
     
    6877        ( rm -f guipixbufs.h && false )
    6978
    70 EXTRA_DIST = $(IMAGES) guipixbufs.h
     79EXTRA_DIST += $(IMAGES) guipixbufs.h
     80
     81MRPROPERFILES = \
     82        aclocal.m4 \
     83        config.h.in \
     84        config.h.in~ \
     85        configure \
     86        Makefile.in \
     87        build-aux/config.guess \
     88        build-aux/config.rpath \
     89        build-aux/config.sub \
     90        build-aux/depcomp \
     91        build-aux/install-sh \
     92        build-aux/ltmain.sh \
     93        build-aux/missing \
     94        build-aux/mkinstalldirs \
     95        Makefile.in \
     96        m4/intmax.m4 \
     97        m4/lib-link.m4 \
     98        m4/lib-prefix.m4 \
     99        m4/printf-posix.m4 \
     100        m4/xsize.m4 \
     101        m4/glibc2.m4 \
     102        m4/lib-ld.m4 \
     103        m4/lcmessage.m4 \
     104        m4/wint_t.m4 \
     105        m4/ulonglong.m4 \
     106        m4/inttypes-pri.m4 \
     107        m4/progtest.m4 \
     108        m4/uintmax_t.m4 \
     109        m4/signed.m4 \
     110        m4/stdint_h.m4 \
     111        m4/intdiv0.m4 \
     112        m4/iconv.m4 \
     113        m4/po.m4 \
     114        m4/isc-posix.m4 \
     115        m4/longlong.m4 \
     116        m4/inttypes.m4 \
     117        m4/size_max.m4 \
     118        m4/glibc21.m4 \
     119        m4/gettext.m4 \
     120        m4/codeset.m4 \
     121        m4/inttypes_h.m4 \
     122        m4/wchar_t.m4 \
     123        m4/longdouble.m4 \
     124        m4/nls.m4 \
     125        po/Rules-quot \
     126        po/en@quot.header \
     127        po/insert-header.sin \
     128        po/quot.sed \
     129        po/en@boldquot.header \
     130        po/boldquot.sed \
     131        po/Makevars.template \
     132        po/remove-potcdate.sin \
     133        po/Makefile.in.in
     134
     135mrproper:
     136        $(MAKE) $(AM_MAKEFLAGS) maintainer-clean
     137        -rm -f $(MRPROPERFILES)
     138
     139.PHONY: mrproper
  • graph-displayer.cc

    r102 r130  
     1#ifdef HAVE_CONFIG_H
     2#include <config.h>
     3#endif
     4
    15#include "all_include.h"
    26#include "mapstorage.h"
     
    48#include <libgnomecanvasmm.h>
    59#include <libgnomecanvasmm/polygon.h>
     10
     11#include <locale.h>
     12#include "gettext.h"
    613
    714#define MAIN_PART
     
    1522int main(int argc, char *argv[])
    1623{
     24  bindtextdomain(PACKAGE, LOCALEDIR);
     25  bind_textdomain_codeset(PACKAGE, "UTF-8");
     26  textdomain(PACKAGE);
    1727
    1828  //initializing
  • main_win.cc

    r120 r130  
     1#ifdef HAVE_CONFIG_H
     2#include <config.h>
     3#endif
     4
    15#include "main_win.h"
    26#include "guipixbufs.h"
     7
     8#include "gettext.h"
     9#define _(string) gettext (string)
    310
    411MainWin::MainWin()
     
    7279  ag=Gtk::ActionGroup::create();
    7380
    74   ag->add( Gtk::Action::create("FileMenu", "_File") );
     81  ag->add( Gtk::Action::create("FileMenu", _("_File")) );
    7582  ag->add( Gtk::Action::create("FileNew", Gtk::Stock::NEW),
    7683      sigc::mem_fun(*this, &MainWin::newTab));
    7784  ag->add( Gtk::Action::create("FileOpen", Gtk::Stock::OPEN),
    7885      sigc::mem_fun(*this, &MainWin::openFile));
    79   ag->add( Gtk::Action::create("FileClearTab", "Clear Tab"),
     86  ag->add( Gtk::Action::create("FileClearTab", _("Clear Tab")),
    8087      sigc::mem_fun(*this, &MainWin::newFile));
    8188  ag->add( Gtk::Action::create("FileSave", Gtk::Stock::SAVE),
     
    8895      sigc::mem_fun(*this, &MainWin::hide));
    8996
    90   ag->add( Gtk::Action::create("ViewMenu", "_View") );
     97  ag->add( Gtk::Action::create("ViewMenu", _("_View")) );
    9198  ag->add( Gtk::Action::create("ViewZoomIn", Gtk::Stock::ZOOM_IN),
    9299      sigc::mem_fun(*this, &MainWin::zoomIn));
     
    98105      sigc::mem_fun(*this, &MainWin::zoom100));
    99106 
    100   ag->add( Gtk::Action::create("ShowMenu", "_Show") );
    101   ag->add( Gtk::Action::create("ShowMaps", "_Maps"),
     107  ag->add( Gtk::Action::create("ShowMenu", _("_Show")) );
     108  ag->add( Gtk::Action::create("ShowMaps", _("_Maps")),
    102109           sigc::mem_fun(*this, &MainWin::createMapWin));
    103110
    104   ag->add( Gtk::Action::create("AlgoMenu", "_Algorithms") );
    105   ag->add( Gtk::Action::create("AlgoGeneral", "_General"),
     111  ag->add( Gtk::Action::create("AlgoMenu", _("_Algorithms")) );
     112  ag->add( Gtk::Action::create("AlgoGeneral", _("_General")),
    106113           sigc::bind( sigc::mem_fun ( *this, &MainWin::createAlgoWin ), 0) );
    107   ag->add( Gtk::Action::create("AlgoKruskal", "_Kruskal"),
     114  ag->add( Gtk::Action::create("AlgoKruskal", _("_Kruskal")),
    108115           sigc::bind( sigc::mem_fun ( *this, &MainWin::createAlgoWin ), 1) );
    109116
    110117  Gtk::RadioAction::Group tool_group;
    111   ag->add( Gtk::RadioAction::create(tool_group, "MoveItem", Gtk::StockID("gd-move"), "Move"),
     118  ag->add( Gtk::RadioAction::create(tool_group, "MoveItem", Gtk::StockID("gd-move"), _("Move")),
    112119      sigc::bind( sigc::mem_fun ( *this, &MainWin::changeEditorialTool ), 0) );
    113   ag->add( Gtk::RadioAction::create(tool_group, "CreateNode", Gtk::StockID("gd-addnode"), "Create node"),
     120  ag->add( Gtk::RadioAction::create(tool_group, "CreateNode", Gtk::StockID("gd-addnode"), _("Create node")),
    114121      sigc::bind( sigc::mem_fun ( *this, &MainWin::changeEditorialTool ), 1) );
    115   ag->add( Gtk::RadioAction::create(tool_group, "CreateEdge", Gtk::StockID("gd-addlink"), "Create edge"),
     122  ag->add( Gtk::RadioAction::create(tool_group, "CreateEdge", Gtk::StockID("gd-addlink"), _("Create edge")),
    116123      sigc::bind( sigc::mem_fun ( *this, &MainWin::changeEditorialTool ), 2) );
    117   ag->add( Gtk::RadioAction::create(tool_group, "EraseItem", Gtk::StockID("gd-delete"), "Delete"),
     124  ag->add( Gtk::RadioAction::create(tool_group, "EraseItem", Gtk::StockID("gd-delete"), _("Delete")),
    118125      sigc::bind( sigc::mem_fun ( *this, &MainWin::changeEditorialTool ), 3) );
    119126
    120   ag->add( Gtk::RadioAction::create(tool_group, "EditEdgeMap", Gtk::StockID("gd-editlink"), "Edit edge map"),
     127  ag->add( Gtk::RadioAction::create(tool_group, "EditEdgeMap", Gtk::StockID("gd-editlink"), _("Edit edge map")),
    121128      sigc::bind( sigc::mem_fun ( *this, &MainWin::changeEditorialTool ), 4) );
    122   ag->add( Gtk::RadioAction::create(tool_group, "EditNodeMap", Gtk::StockID("gd-editnode"), "Edit node map"),
     129  ag->add( Gtk::RadioAction::create(tool_group, "EditNodeMap", Gtk::StockID("gd-editnode"), _("Edit node map")),
    123130      sigc::bind( sigc::mem_fun ( *this, &MainWin::changeEditorialTool ), 5) );
    124131
     
    251258  notebook.append_page((Gtk::Widget&)(*(tabs[active_tab])));
    252259  notebook.set_current_page(size);
    253   set_tabtitle("unsaved file");
     260  set_tabtitle(_("unsaved file"));
    254261  updateAlgoWinTabs();
    255262}
     
    261268      if (tabs[active_tab]->mapstorage.modified)
    262269        {
    263           Gtk::MessageDialog mdialog("<b>Save changes before closing?</b>", true,
     270          Gtk::MessageDialog mdialog(_("<b>Save changes before closing?</b>"), true,
    264271                                     Gtk::MESSAGE_WARNING, Gtk::BUTTONS_NONE);
    265           mdialog.add_button("Close file _without Saving", Gtk::RESPONSE_REJECT);
     272          mdialog.add_button(_("Close file _without Saving"), Gtk::RESPONSE_REJECT);
    266273          mdialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
    267274          mdialog.add_button(Gtk::Stock::SAVE, Gtk::RESPONSE_ACCEPT);
     
    450457  if(active_tab!=-1)
    451458    {
    452       NewMapWin * nmw=new NewMapWin("Create New Map - "+tabnames[active_tab], *(tabs[active_tab]));
     459      NewMapWin * nmw=new NewMapWin(_("Create New Map - ")+tabnames[active_tab], *(tabs[active_tab]));
    453460      nmw->show();
    454461    }
     
    479486        }
    480487    }
    481   NewMapWin * nmw=new NewMapWin("Create New Map - "+tabnames[i], *nbt, itisedge, false);
     488  NewMapWin * nmw=new NewMapWin(_("Create New Map - ")+tabnames[i], *nbt, itisedge, false);
    482489  nmw->run();
    483490}
Note: See TracChangeset for help on using the changeset viewer.