[Lemon-commits] [lemon_svn] hegyi: r2447 - hugo/trunk/gui
Lemon SVN
svn at lemon.cs.elte.hu
Mon Nov 6 20:52:42 CET 2006
Author: hegyi
Date: Wed Jan 4 12:41:58 2006
New Revision: 2447
Modified:
hugo/trunk/gui/main_win.cc
hugo/trunk/gui/main_win.h
Log:
Best feature ever\! Name of tabs are different from now on\!
Modified: hugo/trunk/gui/main_win.cc
==============================================================================
--- hugo/trunk/gui/main_win.cc (original)
+++ hugo/trunk/gui/main_win.cc Wed Jan 4 12:41:58 2006
@@ -210,7 +210,18 @@
void MainWin::set_tabtitle(std::string name)
{
- tabnames[active_tab]=name;
+ if(strinst.find(name)==strinst.end())
+ {
+ tabnames[active_tab]=name;
+ strinst[name]=1;
+ }
+ else
+ {
+ strinst[name]++;
+ std::ostringstream o;
+ o << strinst[name];
+ tabnames[active_tab]=name+" - "+o.str();
+ }
set_title(tabnames[active_tab] + " - " + prog_name);
notebook.set_tab_label_text((Widget&)*(tabs[active_tab]), tabnames[active_tab]);
updateAlgoWins();
@@ -229,13 +240,12 @@
tabnames.resize(size+1);
active_tab=size;
tabs[active_tab]=new NoteBookTab();
- tabnames[active_tab]="unsaved file";
tabs[active_tab]->signal_title_ch().connect(sigc::mem_fun(*this, &MainWin::set_tabtitle));
tabs[active_tab]->signal_newmap_needed().connect(sigc::mem_fun(*this, &MainWin::createNewMapWinAfterSignal));
tabs[active_tab]->gd_canvas->changeEditorialTool(active_tool);
notebook.append_page((Gtk::Widget&)(*(tabs[active_tab])));
notebook.set_current_page(size);
- set_tabtitle(tabnames[active_tab]);
+ set_tabtitle("unsaved file");
updateAlgoWins();
}
@@ -289,8 +299,6 @@
onChangeTab(NULL,0);
}
- std::cout << "NAAAA" << std::endl;
-
//if this was the last page in notebook, there is
//no active_tab now
if(size==1)
Modified: hugo/trunk/gui/main_win.h
==============================================================================
--- hugo/trunk/gui/main_win.h (original)
+++ hugo/trunk/gui/main_win.h Wed Jan 4 12:41:58 2006
@@ -27,6 +27,8 @@
std::vector<NoteBookTab *> tabs;
std::vector<std::string> tabnames;
+ std::map<std::string, int> strinst;
+
std::set< AlgoWin* > aws;
public:
More information about the Lemon-commits
mailing list