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) |
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 |
} |
} |