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

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

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

revision 3364 by schoenebeck, Tue Nov 14 18:07:25 2017 UTC revision 3677 by schoenebeck, Thu Dec 26 23:01:09 2019 UTC
# Line 1  Line 1 
1  /*  /*
2      Copyright (c) 2014-2017 Christian Schoenebeck      Copyright (c) 2014-2019 Christian Schoenebeck
3            
4      This file is part of "gigedit" and released under the terms of the      This file is part of "gigedit" and released under the terms of the
5      GNU General Public License version 2.      GNU General Public License version 2.
# Line 941  CombineInstrumentsDialog::CombineInstrum Line 941  CombineInstrumentsDialog::CombineInstrum
941      }      }
942    
943      m_buttonBox.set_layout(Gtk::BUTTONBOX_END);      m_buttonBox.set_layout(Gtk::BUTTONBOX_END);
944  #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)
945      m_buttonBox.set_margin(5);      m_buttonBox.set_margin(5);
946  #else  #else
947      m_buttonBox.set_border_width(5);      m_buttonBox.set_border_width(5);
# Line 966  CombineInstrumentsDialog::CombineInstrum Line 966  CombineInstrumentsDialog::CombineInstrum
966      show_all_children();      show_all_children();
967  #endif  #endif
968    
969        Settings::singleton()->showTooltips.get_proxy().signal_changed().connect(
970            sigc::mem_fun(*this, &CombineInstrumentsDialog::on_show_tooltips_changed)
971        );
972        on_show_tooltips_changed();
973    
974      // show a warning to user if he uses a .gig in v2 format      // show a warning to user if he uses a .gig in v2 format
975      if (gig->pVersion->major < 3) {      if (gig->pVersion->major < 3) {
976          Glib::ustring txt = _(          Glib::ustring txt = _(
# Line 1023  void CombineInstrumentsDialog::on_order_ Line 1028  void CombineInstrumentsDialog::on_order_
1028      const Gtk::SelectionData& selection_data, guint, guint time)      const Gtk::SelectionData& selection_data, guint, guint time)
1029  {  {
1030      printf("Drag data received\n");      printf("Drag data received\n");
     if (&selection_data == NULL) {  
         printf("!selection_data\n");  
         return;  
     }  
1031      if (!selection_data.get_data()) {      if (!selection_data.get_data()) {
1032          printf("selection_data.get_data() == NULL\n");          printf("selection_data.get_data() == NULL\n");
1033          return;          return;
# Line 1037  void CombineInstrumentsDialog::on_order_ Line 1038  void CombineInstrumentsDialog::on_order_
1038          printf("!src\n");          printf("!src\n");
1039          return;          return;
1040      }      }
1041      printf("src=%d\n", src);      printf("src=%ld\n", (size_t)src);
1042    
1043      gig::Instrument* dst = NULL;      gig::Instrument* dst = NULL;
1044      {      {
# Line 1191  void CombineInstrumentsDialog::onSelecti Line 1192  void CombineInstrumentsDialog::onSelecti
1192      {      {
1193          Children allOrdered = m_refOrderModel->children();          Children allOrdered = m_refOrderModel->children();
1194          for (Children::iterator itOrder = allOrdered.begin();          for (Children::iterator itOrder = allOrdered.begin();
1195               itOrder != allOrdered.end(); ++itOrder)               itOrder != allOrdered.end(); )
1196          {          {
1197              Gtk::TreeModel::Row rowOrder = *itOrder;              Gtk::TreeModel::Row rowOrder = *itOrder;
1198              gig::Instrument* instr = rowOrder[m_orderColumns.m_col_instr];              gig::Instrument* instr = rowOrder[m_orderColumns.m_col_instr];
# Line 1203  void CombineInstrumentsDialog::onSelecti Line 1204  void CombineInstrumentsDialog::onSelecti
1204              }              }
1205              goto removeOrderedItem;              goto removeOrderedItem;
1206          nextOrderedItem:          nextOrderedItem:
1207                ++itOrder;
1208              continue;              continue;
1209          removeOrderedItem:          removeOrderedItem:
1210              m_refOrderModel->erase(itOrder);              // postfix increment here to avoid iterator invalidation
1211                m_refOrderModel->erase(itOrder++);
1212          }          }
1213      }      }
1214    
# Line 1249  void CombineInstrumentsDialog::onSelecti Line 1252  void CombineInstrumentsDialog::onSelecti
1252      }      }
1253  }  }
1254    
1255    void CombineInstrumentsDialog::on_show_tooltips_changed() {
1256        const bool b = Settings::singleton()->showTooltips;
1257    
1258        m_treeView.set_has_tooltip(b);
1259        m_iconView.set_has_tooltip(b);
1260    
1261        set_has_tooltip(b);
1262    }
1263    
1264  bool CombineInstrumentsDialog::fileWasChanged() const {  bool CombineInstrumentsDialog::fileWasChanged() const {
1265      return m_fileWasChanged;      return m_fileWasChanged;
1266  }  }

Legend:
Removed from v.3364  
changed lines
  Added in v.3677

  ViewVC Help
Powered by ViewVC