1.1 --- a/main_win.cc Fri Aug 26 10:46:51 2005 +0000
1.2 +++ b/main_win.cc Fri Aug 26 11:03:59 2005 +0000
1.3 @@ -1,11 +1,11 @@
1.4 #include "main_win.h"
1.5 #include "guipixbufs.h"
1.6
1.7 -MainWin::MainWin(const std::string& title) :
1.8 +MainWin::MainWin() :
1.9 mapwin("Map Setup", mapstorage, gd_canvas),
1.10 newmapwin("Creating new map", gd_canvas), gd_canvas(mapstorage, mapwin, (Gtk::Window *)this)
1.11 {
1.12 - set_title (title);
1.13 + set_title ("unsaved file - " + prog_name);
1.14 set_default_size(WIN_WIDTH,WIN_HEIGHT);
1.15 add(vbox);
1.16
1.17 @@ -209,6 +209,7 @@
1.18 mapstorage.modified = false;
1.19 gd_canvas.drawGraph();
1.20 mapwin.update();
1.21 + set_title(Glib::filename_display_basename(file) + " - " + prog_name);
1.22 }
1.23
1.24 void MainWin::newFile()
1.25 @@ -234,6 +235,7 @@
1.26 gd_canvas.clear();
1.27 mapstorage.clear();
1.28 mapwin.update();
1.29 + set_title("unsaved file - " + prog_name);
1.30 }
1.31
1.32 void MainWin::openFile()
1.33 @@ -256,13 +258,13 @@
1.34 break;
1.35 }
1.36 }
1.37 - gd_canvas.clear();
1.38 - mapstorage.clear();
1.39 Gtk::FileChooserDialog fcdialog("Open File");
1.40 fcdialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
1.41 fcdialog.add_button(Gtk::Stock::OPEN, Gtk::RESPONSE_ACCEPT);
1.42 if (fcdialog.run() == Gtk::RESPONSE_ACCEPT)
1.43 {
1.44 + gd_canvas.clear();
1.45 + mapstorage.clear();
1.46 Glib::ustring filename = fcdialog.get_filename();
1.47 if (!mapstorage.readFromFile(filename))
1.48 {
1.49 @@ -270,6 +272,7 @@
1.50 mapstorage.modified = false;
1.51 gd_canvas.drawGraph();
1.52 mapwin.update();
1.53 + set_title(Glib::filename_display_basename(filename) + " - " + prog_name);
1.54 }
1.55 }
1.56 }
1.57 @@ -283,6 +286,8 @@
1.58 {
1.59 mapstorage.writeToFile(mapstorage.file_name);
1.60 mapstorage.modified = false;
1.61 + set_title(Glib::filename_display_basename(mapstorage.file_name) + " - " +
1.62 + prog_name);
1.63 }
1.64 }
1.65
1.66 @@ -297,6 +302,7 @@
1.67 mapstorage.file_name = filename;
1.68 mapstorage.writeToFile(filename);
1.69 mapstorage.modified = false;
1.70 + set_title(Glib::filename_display_basename(filename) + " - " + prog_name);
1.71 }
1.72 }
1.73
1.74 @@ -323,4 +329,5 @@
1.75 gd_canvas.clear();
1.76 mapstorage.clear();
1.77 mapwin.update();
1.78 + set_title("unsaved file - " + prog_name);
1.79 }