main_win.cc
branchgui
changeset 104 623ae8ed0877
parent 103 3a263e57e1d9
child 106 853dd852abc7
     1.1 --- a/main_win.cc	Tue Jan 03 17:30:22 2006 +0000
     1.2 +++ b/main_win.cc	Wed Jan 04 11:41:58 2006 +0000
     1.3 @@ -210,7 +210,18 @@
     1.4  
     1.5  void MainWin::set_tabtitle(std::string name)
     1.6  {
     1.7 -  tabnames[active_tab]=name;
     1.8 +  if(strinst.find(name)==strinst.end())
     1.9 +    {
    1.10 +      tabnames[active_tab]=name;
    1.11 +      strinst[name]=1;
    1.12 +    }
    1.13 +  else
    1.14 +    {
    1.15 +      strinst[name]++;
    1.16 +      std::ostringstream o;
    1.17 +      o << strinst[name];
    1.18 +      tabnames[active_tab]=name+" - "+o.str();
    1.19 +    }
    1.20    set_title(tabnames[active_tab] + " - " + prog_name);
    1.21    notebook.set_tab_label_text((Widget&)*(tabs[active_tab]), tabnames[active_tab]);
    1.22    updateAlgoWins();
    1.23 @@ -229,13 +240,12 @@
    1.24    tabnames.resize(size+1);
    1.25    active_tab=size;
    1.26    tabs[active_tab]=new NoteBookTab();
    1.27 -  tabnames[active_tab]="unsaved file";
    1.28    tabs[active_tab]->signal_title_ch().connect(sigc::mem_fun(*this, &MainWin::set_tabtitle));
    1.29    tabs[active_tab]->signal_newmap_needed().connect(sigc::mem_fun(*this, &MainWin::createNewMapWinAfterSignal));
    1.30    tabs[active_tab]->gd_canvas->changeEditorialTool(active_tool);
    1.31    notebook.append_page((Gtk::Widget&)(*(tabs[active_tab])));
    1.32    notebook.set_current_page(size);
    1.33 -  set_tabtitle(tabnames[active_tab]);
    1.34 +  set_tabtitle("unsaved file");
    1.35    updateAlgoWins();
    1.36  }
    1.37  
    1.38 @@ -289,8 +299,6 @@
    1.39  	  onChangeTab(NULL,0);
    1.40  	}
    1.41  
    1.42 -      std::cout << "NAAAA" << std::endl;
    1.43 -
    1.44        //if this was the last page in notebook, there is
    1.45        //no active_tab now
    1.46        if(size==1)