main_win.cc
branchgui
changeset 130 3533c2d9a865
parent 120 9166130d8d56
child 133 b289ba51506f
     1.1 --- a/main_win.cc	Thu Feb 02 15:44:45 2006 +0000
     1.2 +++ b/main_win.cc	Thu Mar 23 19:57:14 2006 +0000
     1.3 @@ -1,6 +1,13 @@
     1.4 +#ifdef HAVE_CONFIG_H
     1.5 +#include <config.h>
     1.6 +#endif
     1.7 +
     1.8  #include "main_win.h"
     1.9  #include "guipixbufs.h"
    1.10  
    1.11 +#include "gettext.h"
    1.12 +#define _(string) gettext (string)
    1.13 +
    1.14  MainWin::MainWin()
    1.15  {
    1.16    set_title ("no file");
    1.17 @@ -71,12 +78,12 @@
    1.18    
    1.19    ag=Gtk::ActionGroup::create();
    1.20  
    1.21 -  ag->add( Gtk::Action::create("FileMenu", "_File") );
    1.22 +  ag->add( Gtk::Action::create("FileMenu", _("_File")) );
    1.23    ag->add( Gtk::Action::create("FileNew", Gtk::Stock::NEW),
    1.24        sigc::mem_fun(*this, &MainWin::newTab));
    1.25    ag->add( Gtk::Action::create("FileOpen", Gtk::Stock::OPEN),
    1.26        sigc::mem_fun(*this, &MainWin::openFile));
    1.27 -  ag->add( Gtk::Action::create("FileClearTab", "Clear Tab"),
    1.28 +  ag->add( Gtk::Action::create("FileClearTab", _("Clear Tab")),
    1.29        sigc::mem_fun(*this, &MainWin::newFile));
    1.30    ag->add( Gtk::Action::create("FileSave", Gtk::Stock::SAVE),
    1.31        sigc::mem_fun(*this, &MainWin::saveFile));
    1.32 @@ -87,7 +94,7 @@
    1.33    ag->add( Gtk::Action::create("Quit", Gtk::Stock::QUIT),
    1.34        sigc::mem_fun(*this, &MainWin::hide));
    1.35  
    1.36 -  ag->add( Gtk::Action::create("ViewMenu", "_View") );
    1.37 +  ag->add( Gtk::Action::create("ViewMenu", _("_View")) );
    1.38    ag->add( Gtk::Action::create("ViewZoomIn", Gtk::Stock::ZOOM_IN),
    1.39        sigc::mem_fun(*this, &MainWin::zoomIn));
    1.40    ag->add( Gtk::Action::create("ViewZoomOut", Gtk::Stock::ZOOM_OUT),
    1.41 @@ -97,29 +104,29 @@
    1.42    ag->add( Gtk::Action::create("ViewZoom100", Gtk::Stock::ZOOM_100),
    1.43        sigc::mem_fun(*this, &MainWin::zoom100));
    1.44    
    1.45 -  ag->add( Gtk::Action::create("ShowMenu", "_Show") );
    1.46 -  ag->add( Gtk::Action::create("ShowMaps", "_Maps"),
    1.47 +  ag->add( Gtk::Action::create("ShowMenu", _("_Show")) );
    1.48 +  ag->add( Gtk::Action::create("ShowMaps", _("_Maps")),
    1.49  	   sigc::mem_fun(*this, &MainWin::createMapWin));
    1.50  
    1.51 -  ag->add( Gtk::Action::create("AlgoMenu", "_Algorithms") );
    1.52 -  ag->add( Gtk::Action::create("AlgoGeneral", "_General"),
    1.53 +  ag->add( Gtk::Action::create("AlgoMenu", _("_Algorithms")) );
    1.54 +  ag->add( Gtk::Action::create("AlgoGeneral", _("_General")),
    1.55  	   sigc::bind( sigc::mem_fun ( *this, &MainWin::createAlgoWin ), 0) );
    1.56 -  ag->add( Gtk::Action::create("AlgoKruskal", "_Kruskal"),
    1.57 +  ag->add( Gtk::Action::create("AlgoKruskal", _("_Kruskal")),
    1.58  	   sigc::bind( sigc::mem_fun ( *this, &MainWin::createAlgoWin ), 1) );
    1.59  
    1.60    Gtk::RadioAction::Group tool_group;
    1.61 -  ag->add( Gtk::RadioAction::create(tool_group, "MoveItem", Gtk::StockID("gd-move"), "Move"),
    1.62 +  ag->add( Gtk::RadioAction::create(tool_group, "MoveItem", Gtk::StockID("gd-move"), _("Move")),
    1.63        sigc::bind( sigc::mem_fun ( *this, &MainWin::changeEditorialTool ), 0) );
    1.64 -  ag->add( Gtk::RadioAction::create(tool_group, "CreateNode", Gtk::StockID("gd-addnode"), "Create node"),
    1.65 +  ag->add( Gtk::RadioAction::create(tool_group, "CreateNode", Gtk::StockID("gd-addnode"), _("Create node")),
    1.66        sigc::bind( sigc::mem_fun ( *this, &MainWin::changeEditorialTool ), 1) );
    1.67 -  ag->add( Gtk::RadioAction::create(tool_group, "CreateEdge", Gtk::StockID("gd-addlink"), "Create edge"),
    1.68 +  ag->add( Gtk::RadioAction::create(tool_group, "CreateEdge", Gtk::StockID("gd-addlink"), _("Create edge")),
    1.69        sigc::bind( sigc::mem_fun ( *this, &MainWin::changeEditorialTool ), 2) );
    1.70 -  ag->add( Gtk::RadioAction::create(tool_group, "EraseItem", Gtk::StockID("gd-delete"), "Delete"),
    1.71 +  ag->add( Gtk::RadioAction::create(tool_group, "EraseItem", Gtk::StockID("gd-delete"), _("Delete")),
    1.72        sigc::bind( sigc::mem_fun ( *this, &MainWin::changeEditorialTool ), 3) );
    1.73  
    1.74 -  ag->add( Gtk::RadioAction::create(tool_group, "EditEdgeMap", Gtk::StockID("gd-editlink"), "Edit edge map"),
    1.75 +  ag->add( Gtk::RadioAction::create(tool_group, "EditEdgeMap", Gtk::StockID("gd-editlink"), _("Edit edge map")),
    1.76        sigc::bind( sigc::mem_fun ( *this, &MainWin::changeEditorialTool ), 4) );
    1.77 -  ag->add( Gtk::RadioAction::create(tool_group, "EditNodeMap", Gtk::StockID("gd-editnode"), "Edit node map"),
    1.78 +  ag->add( Gtk::RadioAction::create(tool_group, "EditNodeMap", Gtk::StockID("gd-editnode"), _("Edit node map")),
    1.79        sigc::bind( sigc::mem_fun ( *this, &MainWin::changeEditorialTool ), 5) );
    1.80  
    1.81    ag->add( Gtk::Action::create("AddMap", Gtk::StockID("gd-newmap")),
    1.82 @@ -250,7 +257,7 @@
    1.83    tabs[active_tab]->gd_canvas->changeEditorialTool(active_tool);
    1.84    notebook.append_page((Gtk::Widget&)(*(tabs[active_tab])));
    1.85    notebook.set_current_page(size);
    1.86 -  set_tabtitle("unsaved file");
    1.87 +  set_tabtitle(_("unsaved file"));
    1.88    updateAlgoWinTabs();
    1.89  }
    1.90  
    1.91 @@ -260,9 +267,9 @@
    1.92      {
    1.93        if (tabs[active_tab]->mapstorage.modified)
    1.94  	{
    1.95 -	  Gtk::MessageDialog mdialog("<b>Save changes before closing?</b>", true, 
    1.96 +	  Gtk::MessageDialog mdialog(_("<b>Save changes before closing?</b>"), true, 
    1.97  				     Gtk::MESSAGE_WARNING, Gtk::BUTTONS_NONE);
    1.98 -	  mdialog.add_button("Close file _without Saving", Gtk::RESPONSE_REJECT);
    1.99 +	  mdialog.add_button(_("Close file _without Saving"), Gtk::RESPONSE_REJECT);
   1.100  	  mdialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
   1.101  	  mdialog.add_button(Gtk::Stock::SAVE, Gtk::RESPONSE_ACCEPT);
   1.102  	  switch (mdialog.run())
   1.103 @@ -449,7 +456,7 @@
   1.104  {
   1.105    if(active_tab!=-1)
   1.106      {
   1.107 -      NewMapWin * nmw=new NewMapWin("Create New Map - "+tabnames[active_tab], *(tabs[active_tab]));
   1.108 +      NewMapWin * nmw=new NewMapWin(_("Create New Map - ")+tabnames[active_tab], *(tabs[active_tab]));
   1.109        nmw->show();
   1.110      }
   1.111  }
   1.112 @@ -478,6 +485,6 @@
   1.113  	  continue;
   1.114  	}
   1.115      }
   1.116 -  NewMapWin * nmw=new NewMapWin("Create New Map - "+tabnames[i], *nbt, itisedge, false);
   1.117 +  NewMapWin * nmw=new NewMapWin(_("Create New Map - ")+tabnames[i], *nbt, itisedge, false);
   1.118    nmw->run();
   1.119  }