main_win.cc
changeset 194 6b2b718420eb
parent 191 af2ed974ab68
child 201 879e47e5b731
equal deleted inserted replaced
53:d825ce8c08d2 54:f5616de99ea8
    18 
    18 
    19 #ifdef HAVE_CONFIG_H
    19 #ifdef HAVE_CONFIG_H
    20 #include <config.h>
    20 #include <config.h>
    21 #endif
    21 #endif
    22 
    22 
    23 #include "main_win.h"
    23 #include <main_win.h>
    24 #include "guipixbufs.h"
    24 #include <guipixbufs.h>
    25 #include "background_chooser_dialog.h"
    25 #include <background_chooser_dialog.h>
       
    26 
       
    27 #include <mapstorage.h>
       
    28 #include <graph_displayer_canvas.h>
       
    29 #include <algowin.h>
       
    30 #include <new_map_win.h>
       
    31 #include <nbtab.h>
    26 
    32 
    27 #include "i18n.h"
    33 #include "i18n.h"
    28 
    34 
    29 MainWin::MainWin()
    35 MainWin::MainWin()
    30 {
    36 {
   362 
   368 
   363 void MainWin::closeTab()
   369 void MainWin::closeTab()
   364 {
   370 {
   365   if(active_tab!=-1)
   371   if(active_tab!=-1)
   366     {
   372     {
   367       if (tabs[active_tab]->mapstorage.modified)
   373       if (tabs[active_tab]->mapstorage->modified)
   368 	{
   374 	{
   369 	  Gtk::MessageDialog mdialog(_("<b>Save changes before closing?</b>"), true, 
   375 	  Gtk::MessageDialog mdialog(_("<b>Save changes before closing?</b>"), true, 
   370 				     Gtk::MESSAGE_WARNING, Gtk::BUTTONS_NONE);
   376 				     Gtk::MESSAGE_WARNING, Gtk::BUTTONS_NONE);
   371 	  mdialog.add_button(_("Close file _without Saving"), Gtk::RESPONSE_REJECT);
   377 	  mdialog.add_button(_("Close file _without Saving"), Gtk::RESPONSE_REJECT);
   372 	  mdialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
   378 	  mdialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
   551 {
   557 {
   552   int i=0;
   558   int i=0;
   553   for(;(i<(int)tabnames.size())&&(tabnames[i]!=tabname);i++)
   559   for(;(i<(int)tabnames.size())&&(tabnames[i]!=tabname);i++)
   554     {
   560     {
   555     }
   561     }
   556   awp->update_maplist(&(tabs[i]->mapstorage));
   562   awp->update_maplist(tabs[i]->mapstorage);
   557 }
   563 }
   558 
   564 
   559 void MainWin::deRegisterAlgoWin(AlgoWin * awp)
   565 void MainWin::deRegisterAlgoWin(AlgoWin * awp)
   560 {
   566 {
   561   aws.erase(awp);
   567   aws.erase(awp);
   630     }
   636     }
   631 }
   637 }
   632 
   638 
   633 void MainWin::createBackgroundChooser()
   639 void MainWin::createBackgroundChooser()
   634 {
   640 {
   635   BackgroundChooserDialog dialog(&(tabs[active_tab]->mapstorage));
   641   BackgroundChooserDialog dialog(tabs[active_tab]->mapstorage);
   636   dialog.run();
   642   dialog.run();
   637 }
   643 }