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

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

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

revision 1082 by schoenebeck, Thu Mar 8 01:43:18 2007 UTC revision 1084 by schoenebeck, Thu Mar 8 16:47:15 2007 UTC
# Line 27  Line 27 
27  #if GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION >= 6  #if GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION >= 6
28  #define ABOUT_DIALOG  #define ABOUT_DIALOG
29  #include <gtkmm/aboutdialog.h>  #include <gtkmm/aboutdialog.h>
30    #include <gtkmm/messagedialog.h>
31  #endif  #endif
32    
33  #define _(String) gettext(String)  #define _(String) gettext(String)
# Line 1643  void MainWindow::on_action_add_sample() Line 1644  void MainWindow::on_action_add_sample()
1644  }  }
1645    
1646  void MainWindow::on_action_remove_sample() {  void MainWindow::on_action_remove_sample() {
1647      //TODO: remove the selected group or sample      if (!file) return;
1648        Glib::RefPtr<Gtk::TreeSelection> sel = m_TreeViewSamples.get_selection();
1649        Gtk::TreeModel::iterator it = sel->get_selected();
1650        if (it) {
1651            Gtk::TreeModel::Row row = *it;
1652            gig::Group* group   = row[m_SamplesModel.m_col_group];
1653            gig::Sample* sample = row[m_SamplesModel.m_col_sample];
1654            try {
1655                // remove group or sample from the gig file
1656                if (group) {
1657                    file->DeleteGroup(group);
1658                } else if (sample) {
1659                    file->DeleteSample(sample);
1660                }
1661                // remove respective row(s) from samples tree view
1662                m_refSamplesTreeModel->erase(it);
1663            } catch (RIFF::Exception e) {
1664                Gtk::MessageDialog msg(*this, e.Message.c_str(), false, Gtk::MESSAGE_ERROR);
1665                msg.run();
1666            }
1667        }
1668  }  }

Legend:
Removed from v.1082  
changed lines
  Added in v.1084

  ViewVC Help
Powered by ViewVC