/[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 3441 by schoenebeck, Sun Dec 9 20:48:18 2018 UTC revision 3461 by persson, Sat Feb 2 17:53:36 2019 UTC
# Line 1  Line 1 
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
# Line 1516  MainWindow::MainWindow() : Line 1516  MainWindow::MainWindow() :
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      );      );
# Line 1524  MainWindow::MainWindow() : Line 1528  MainWindow::MainWindow() :
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      );      );
# Line 1546  MainWindow::MainWindow() : Line 1554  MainWindow::MainWindow() :
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;
# Line 2669  void MainWindow::on_action_help_about() Line 2677  void MainWindow::on_action_help_about()
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" +
# Line 2765  PropDialog::PropDialog() Line 2773  PropDialog::PropDialog()
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);
# Line 2773  PropDialog::PropDialog() Line 2781  PropDialog::PropDialog()
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);
# Line 2925  InstrumentProps::InstrumentProps() : Line 2933  InstrumentProps::InstrumentProps() :
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);
# Line 2934  InstrumentProps::InstrumentProps() : Line 2942  InstrumentProps::InstrumentProps() :
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);
# Line 2998  void MainWindow::updateSampleRefCountMap Line 3006  void MainWindow::updateSampleRefCountMap
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;
# Line 3030  bool MainWindow::onQueryTreeViewTooltip( Line 3040  bool MainWindow::onQueryTreeViewTooltip(
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          }          }
# Line 3453  void MainWindow::select_instrument(gig:: Line 3463  void MainWindow::select_instrument(gig::
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
# Line 3483  bool MainWindow::select_dimension_region Line 3493  bool MainWindow::select_dimension_region
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
# Line 3519  void MainWindow::select_sample(gig::Samp Line 3529  void MainWindow::select_sample(gig::Samp
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
# Line 4794  bool MainWindow::instrument_row_visible( Line 4804  bool MainWindow::instrument_row_visible(
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

Legend:
Removed from v.3441  
changed lines
  Added in v.3461

  ViewVC Help
Powered by ViewVC