1 |
/* |
/* |
2 |
* Copyright (C) 2006-2017 Andreas Persson |
* Copyright (C) 2006-2019 Andreas Persson |
3 |
* |
* |
4 |
* This program is free software; you can redistribute it and/or |
* This program is free software; you can redistribute it and/or |
5 |
* modify it under the terms of the GNU General Public License as |
* modify it under the terms of the GNU General Public License as |
1516 |
sigc::hide( |
sigc::hide( |
1517 |
sigc::bind( |
sigc::bind( |
1518 |
file_structure_to_be_changed_signal.make_slot(), |
file_structure_to_be_changed_signal.make_slot(), |
1519 |
|
#if SIGCXX_MAJOR_VERSION > 2 || (SIGCXX_MAJOR_VERSION == 2 && SIGCXX_MINOR_VERSION >= 8) |
1520 |
|
std::ref(this->file) |
1521 |
|
#else |
1522 |
sigc::ref(this->file) |
sigc::ref(this->file) |
1523 |
|
#endif |
1524 |
) |
) |
1525 |
) |
) |
1526 |
); |
); |
1528 |
sigc::hide( |
sigc::hide( |
1529 |
sigc::bind( |
sigc::bind( |
1530 |
file_structure_changed_signal.make_slot(), |
file_structure_changed_signal.make_slot(), |
1531 |
|
#if SIGCXX_MAJOR_VERSION > 2 || (SIGCXX_MAJOR_VERSION == 2 && SIGCXX_MINOR_VERSION >= 8) |
1532 |
|
std::ref(this->file) |
1533 |
|
#else |
1534 |
sigc::ref(this->file) |
sigc::ref(this->file) |
1535 |
|
#endif |
1536 |
) |
) |
1537 |
) |
) |
1538 |
); |
); |
1554 |
sigc::mem_fun(*this, &MainWindow::update_dimregs)); |
sigc::mem_fun(*this, &MainWindow::update_dimregs)); |
1555 |
|
|
1556 |
m_searchText.signal_changed().connect( |
m_searchText.signal_changed().connect( |
1557 |
sigc::mem_fun(m_refTreeModelFilter.operator->(), &Gtk::TreeModelFilter::refilter) |
sigc::mem_fun(*m_refTreeModelFilter.operator->(), &Gtk::TreeModelFilter::refilter) |
1558 |
); |
); |
1559 |
|
|
1560 |
file = 0; |
file = 0; |
2677 |
dialog.set_name("Gigedit"); |
dialog.set_name("Gigedit"); |
2678 |
#endif |
#endif |
2679 |
dialog.set_version(VERSION); |
dialog.set_version(VERSION); |
2680 |
dialog.set_copyright("Copyright (C) 2006-2017 Andreas Persson"); |
dialog.set_copyright("Copyright (C) 2006-2019 Andreas Persson"); |
2681 |
const std::string sComment = |
const std::string sComment = |
2682 |
_("Built " __DATE__ "\nUsing ") + |
_("Built " __DATE__ "\nUsing ") + |
2683 |
::gig::libraryName() + " " + ::gig::libraryVersion() + "\n\n" + |
::gig::libraryName() + " " + ::gig::libraryVersion() + "\n\n" + |
2773 |
#endif |
#endif |
2774 |
|
|
2775 |
add(vbox); |
add(vbox); |
2776 |
#if GTKMM_MAJOR_VERSION > 3 || (GTKMM_MAJOR_VERSION == 3 && GTKMM_MINOR_VERSION > 22) |
#if GTKMM_MAJOR_VERSION > 3 || (GTKMM_MAJOR_VERSION == 3 && GTKMM_MINOR_VERSION > 24) |
2777 |
table.set_margin(5); |
table.set_margin(5); |
2778 |
#else |
#else |
2779 |
table.set_border_width(5); |
table.set_border_width(5); |
2781 |
vbox.add(table); |
vbox.add(table); |
2782 |
vbox.pack_start(buttonBox, Gtk::PACK_SHRINK); |
vbox.pack_start(buttonBox, Gtk::PACK_SHRINK); |
2783 |
buttonBox.set_layout(Gtk::BUTTONBOX_END); |
buttonBox.set_layout(Gtk::BUTTONBOX_END); |
2784 |
#if GTKMM_MAJOR_VERSION > 3 || (GTKMM_MAJOR_VERSION == 3 && GTKMM_MINOR_VERSION > 22) |
#if GTKMM_MAJOR_VERSION > 3 || (GTKMM_MAJOR_VERSION == 3 && GTKMM_MINOR_VERSION > 24) |
2785 |
buttonBox.set_margin(5); |
buttonBox.set_margin(5); |
2786 |
#else |
#else |
2787 |
buttonBox.set_border_width(5); |
buttonBox.set_border_width(5); |
2933 |
table.add(eDimensionKeyRangeHigh); |
table.add(eDimensionKeyRangeHigh); |
2934 |
|
|
2935 |
add(vbox); |
add(vbox); |
2936 |
#if GTKMM_MAJOR_VERSION > 3 || (GTKMM_MAJOR_VERSION == 3 && GTKMM_MINOR_VERSION > 22) |
#if GTKMM_MAJOR_VERSION > 3 || (GTKMM_MAJOR_VERSION == 3 && GTKMM_MINOR_VERSION > 24) |
2937 |
table.set_margin(5); |
table.set_margin(5); |
2938 |
#else |
#else |
2939 |
table.set_border_width(5); |
table.set_border_width(5); |
2942 |
table.show(); |
table.show(); |
2943 |
vbox.pack_start(buttonBox, Gtk::PACK_SHRINK); |
vbox.pack_start(buttonBox, Gtk::PACK_SHRINK); |
2944 |
buttonBox.set_layout(Gtk::BUTTONBOX_END); |
buttonBox.set_layout(Gtk::BUTTONBOX_END); |
2945 |
#if GTKMM_MAJOR_VERSION > 3 || (GTKMM_MAJOR_VERSION == 3 && GTKMM_MINOR_VERSION > 22) |
#if GTKMM_MAJOR_VERSION > 3 || (GTKMM_MAJOR_VERSION == 3 && GTKMM_MINOR_VERSION > 24) |
2946 |
buttonBox.set_margin(5); |
buttonBox.set_margin(5); |
2947 |
#else |
#else |
2948 |
buttonBox.set_border_width(5); |
buttonBox.set_border_width(5); |
3006 |
|
|
3007 |
bool MainWindow::onQueryTreeViewTooltip(int x, int y, bool keyboardTip, const Glib::RefPtr<Gtk::Tooltip>& tooltip) { |
bool MainWindow::onQueryTreeViewTooltip(int x, int y, bool keyboardTip, const Glib::RefPtr<Gtk::Tooltip>& tooltip) { |
3008 |
Gtk::TreeModel::iterator iter; |
Gtk::TreeModel::iterator iter; |
3009 |
m_TreeView.get_tooltip_context_iter(x, y, keyboardTip, iter); |
if (!m_TreeView.get_tooltip_context_iter(x, y, keyboardTip, iter)) { |
3010 |
|
return false; |
3011 |
|
} |
3012 |
Gtk::TreeModel::Path path(iter); |
Gtk::TreeModel::Path path(iter); |
3013 |
Gtk::TreeModel::Row row = *iter; |
Gtk::TreeModel::Row row = *iter; |
3014 |
Gtk::TreeViewColumn* pointedColumn = NULL; |
Gtk::TreeViewColumn* pointedColumn = NULL; |
3040 |
static Glib::ustring scriptTooltipFor(gig::Instrument* instrument, int index) { |
static Glib::ustring scriptTooltipFor(gig::Instrument* instrument, int index) { |
3041 |
Glib::ustring name(gig_to_utf8(instrument->pInfo->Name)); |
Glib::ustring name(gig_to_utf8(instrument->pInfo->Name)); |
3042 |
const int iScriptSlots = instrument->ScriptSlotCount(); |
const int iScriptSlots = instrument->ScriptSlotCount(); |
3043 |
Glib::ustring tooltip = "<u>(" + ToString(index) + ") „" + name + "”</u>\n\n"; |
Glib::ustring tooltip = "<u>(" + ToString(index) + ") “" + name + "”</u>\n\n"; |
3044 |
if (!iScriptSlots) |
if (!iScriptSlots) |
3045 |
tooltip += "<span foreground='red'><i>No script assigned</i></span>"; |
tooltip += "<span foreground='red'><i>No script assigned</i></span>"; |
3046 |
else { |
else { |
3047 |
for (int i = 0; i < iScriptSlots; ++i) { |
for (int i = 0; i < iScriptSlots; ++i) { |
3048 |
tooltip += "• " + ToString(i+1) + ". Script: „<span foreground='#46DEFF'><b>" + |
tooltip += "• " + ToString(i+1) + ". Script: “<span foreground='#46DEFF'><b>" + |
3049 |
instrument->GetScriptOfSlot(i)->Name + "</b></span>”"; |
instrument->GetScriptOfSlot(i)->Name + "</b></span>”"; |
3050 |
if (i + 1 < iScriptSlots) tooltip += "\n\n"; |
if (i + 1 < iScriptSlots) tooltip += "\n\n"; |
3051 |
} |
} |
3463 |
show_intruments_tab(); |
show_intruments_tab(); |
3464 |
m_TreeView.get_selection()->unselect_all(); |
m_TreeView.get_selection()->unselect_all(); |
3465 |
|
|
3466 |
#if GTKMM_MAJOR_VERSION > 3 || (GTKMM_MAJOR_VERSION == 3 && GTKMM_MINOR_VERSION > 22) |
#if GTKMM_MAJOR_VERSION > 3 || (GTKMM_MAJOR_VERSION == 3 && GTKMM_MINOR_VERSION > 24) |
3467 |
auto iterSel = model->children()[i].get_iter(); |
auto iterSel = model->children()[i].get_iter(); |
3468 |
m_TreeView.get_selection()->select(iterSel); |
m_TreeView.get_selection()->select(iterSel); |
3469 |
#else |
#else |
3493 |
// select and show the respective instrument in the list view |
// select and show the respective instrument in the list view |
3494 |
show_intruments_tab(); |
show_intruments_tab(); |
3495 |
m_TreeView.get_selection()->unselect_all(); |
m_TreeView.get_selection()->unselect_all(); |
3496 |
#if GTKMM_MAJOR_VERSION > 3 || (GTKMM_MAJOR_VERSION == 3 && GTKMM_MINOR_VERSION > 22) |
#if GTKMM_MAJOR_VERSION > 3 || (GTKMM_MAJOR_VERSION == 3 && GTKMM_MINOR_VERSION > 24) |
3497 |
auto iterSel = model->children()[i].get_iter(); |
auto iterSel = model->children()[i].get_iter(); |
3498 |
m_TreeView.get_selection()->select(iterSel); |
m_TreeView.get_selection()->select(iterSel); |
3499 |
#else |
#else |
3529 |
if (rowSample[m_SamplesModel.m_col_sample] == sample) { |
if (rowSample[m_SamplesModel.m_col_sample] == sample) { |
3530 |
show_samples_tab(); |
show_samples_tab(); |
3531 |
m_TreeViewSamples.get_selection()->unselect_all(); |
m_TreeViewSamples.get_selection()->unselect_all(); |
3532 |
#if GTKMM_MAJOR_VERSION > 3 || (GTKMM_MAJOR_VERSION == 3 && GTKMM_MINOR_VERSION > 22) |
#if GTKMM_MAJOR_VERSION > 3 || (GTKMM_MAJOR_VERSION == 3 && GTKMM_MINOR_VERSION > 24) |
3533 |
auto iterSel = rowGroup.children()[s].get_iter(); |
auto iterSel = rowGroup.children()[s].get_iter(); |
3534 |
m_TreeViewSamples.get_selection()->select(iterSel); |
m_TreeViewSamples.get_selection()->select(iterSel); |
3535 |
#else |
#else |
4804 |
trim(pattern); |
trim(pattern); |
4805 |
if (pattern.empty()) return true; |
if (pattern.empty()) return true; |
4806 |
|
|
4807 |
#if GTKMM_MAJOR_VERSION > 3 || (GTKMM_MAJOR_VERSION == 3 && GTKMM_MINOR_VERSION > 22) |
#if GTKMM_MAJOR_VERSION > 3 || (GTKMM_MAJOR_VERSION == 3 && GTKMM_MINOR_VERSION > 24) |
4808 |
//HACK: on GTKMM4 development branch const_iterator cannot be easily converted to iterator, probably going to be fixed before final GTKMM4 release though. |
//HACK: on GTKMM4 development branch const_iterator cannot be easily converted to iterator, probably going to be fixed before final GTKMM4 release though. |
4809 |
Gtk::TreeModel::Row row = **(Gtk::TreeModel::iterator*)(&iter); |
Gtk::TreeModel::Row row = **(Gtk::TreeModel::iterator*)(&iter); |
4810 |
#else |
#else |