/[svn]/gigedit/trunk/src/gigedit/mainwindow.cpp
ViewVC logotype

Diff of /gigedit/trunk/src/gigedit/mainwindow.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1396 by schoenebeck, Wed Oct 10 15:48:54 2007 UTC revision 1411 by schoenebeck, Fri Oct 12 17:46:29 2007 UTC
# Line 49  Glib::ustring filename_display_basename( Line 49  Glib::ustring filename_display_basename(
49    
50  #include "mainwindow.h"  #include "mainwindow.h"
51    
52    #include "../../gfx/status_attached.xpm"
53    #include "../../gfx/status_detached.xpm"
54    
55  template<class T> inline std::string ToString(T o) {  template<class T> inline std::string ToString(T o) {
56      std::stringstream ss;      std::stringstream ss;
57      ss << o;      ss << o;
# Line 210  MainWindow::MainWindow() Line 213  MainWindow::MainWindow()
213      m_VBox.pack_start(m_HPaned);      m_VBox.pack_start(m_HPaned);
214      m_VBox.pack_start(m_RegionChooser, Gtk::PACK_SHRINK);      m_VBox.pack_start(m_RegionChooser, Gtk::PACK_SHRINK);
215      m_VBox.pack_start(m_DimRegionChooser, Gtk::PACK_SHRINK);      m_VBox.pack_start(m_DimRegionChooser, Gtk::PACK_SHRINK);
216        m_VBox.pack_start(m_StatusBar, Gtk::PACK_SHRINK);
217    
218        // Status Bar:
219        m_StatusBar.pack_start(m_AttachedStateLabel, Gtk::PACK_SHRINK);
220        m_StatusBar.pack_start(m_AttachedStateImage, Gtk::PACK_SHRINK);
221        m_StatusBar.show();
222    
223      m_RegionChooser.signal_region_selected().connect(      m_RegionChooser.signal_region_selected().connect(
224          sigc::mem_fun(*this, &MainWindow::region_changed) );          sigc::mem_fun(*this, &MainWindow::region_changed) );
# Line 294  MainWindow::MainWindow() Line 303  MainWindow::MainWindow()
303    
304      file = 0;      file = 0;
305      file_is_changed = false;      file_is_changed = false;
306      file_is_shared  = false;      set_file_is_shared(false);
307    
308      show_all_children();      show_all_children();
309    
# Line 429  void MainWindow::__clear() { Line 438  void MainWindow::__clear() {
438      // free libgig's gig::File instance      // free libgig's gig::File instance
439      if (file && !file_is_shared) delete file;      if (file && !file_is_shared) delete file;
440      file = NULL;      file = NULL;
441      file_is_shared = false;      set_file_is_shared(false);
442  }  }
443    
444  void MainWindow::on_action_file_new()  void MainWindow::on_action_file_new()
# Line 958  void MainWindow::file_changed() Line 967  void MainWindow::file_changed()
967  void MainWindow::load_gig(gig::File* gig, const char* filename, bool isSharedInstrument)  void MainWindow::load_gig(gig::File* gig, const char* filename, bool isSharedInstrument)
968  {  {
969      file = 0;      file = 0;
970      file_is_shared = isSharedInstrument;      set_file_is_shared(isSharedInstrument);
971    
972      this->filename = filename ? filename : _("Unsaved Gig File");      this->filename = filename ? filename : _("Unsaved Gig File");
973      set_title(Glib::filename_display_basename(this->filename));      set_title(Glib::filename_display_basename(this->filename));
# Line 1502  void MainWindow::instrument_name_changed Line 1511  void MainWindow::instrument_name_changed
1511      }      }
1512  }  }
1513    
1514    void MainWindow::set_file_is_shared(bool b) {
1515        this->file_is_shared = b;
1516    
1517        if (file_is_shared) {
1518            m_AttachedStateLabel.set_label(_("live-mode"));
1519            m_AttachedStateImage.set(
1520                Gdk::Pixbuf::create_from_xpm_data(status_attached_xpm)
1521            );
1522        } else {
1523            m_AttachedStateLabel.set_label(_("stand-alone"));
1524            m_AttachedStateImage.set(
1525                Gdk::Pixbuf::create_from_xpm_data(status_detached_xpm)
1526            );
1527        }
1528    }
1529    
1530  sigc::signal<void, gig::File*>& MainWindow::signal_file_structure_to_be_changed() {  sigc::signal<void, gig::File*>& MainWindow::signal_file_structure_to_be_changed() {
1531      return file_structure_to_be_changed_signal;      return file_structure_to_be_changed_signal;
1532  }  }

Legend:
Removed from v.1396  
changed lines
  Added in v.1411

  ViewVC Help
Powered by ViewVC