/[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 2658 by persson, Tue Jun 24 02:50:05 2014 UTC revision 2664 by schoenebeck, Sat Jul 5 19:43:14 2014 UTC
# Line 902  void MainWindow::load_instrument(gig::In Line 902  void MainWindow::load_instrument(gig::In
902      // load the instrument      // load the instrument
903      gig::File* pFile = (gig::File*) instr->GetParent();      gig::File* pFile = (gig::File*) instr->GetParent();
904      load_gig(pFile, 0 /*file name*/, true /*shared instrument*/);      load_gig(pFile, 0 /*file name*/, true /*shared instrument*/);
905      //TODO: automatically select the given instrument      // automatically select the given instrument
906        int i = 0;
907        for (gig::Instrument* instrument = pFile->GetFirstInstrument(); instrument;
908             instrument = pFile->GetNextInstrument(), ++i)
909        {
910            if (instrument == instr) {
911                // select item in "instruments" tree view
912                m_TreeView.get_selection()->select(Gtk::TreePath(ToString(i)));
913                // make sure the selected item in the "instruments" tree view is
914                // visible (scroll to it)
915                m_TreeView.scroll_to_row(Gtk::TreePath(ToString(i)));
916                // select item in instrument menu
917                {
918                    const std::vector<Gtk::Widget*> children =
919                        instrument_menu->get_children();
920                    static_cast<Gtk::RadioMenuItem*>(children[i])->set_active();
921                }
922                // update region chooser and dimension region chooser
923                m_RegionChooser.set_instrument(instr);
924                break;
925            }
926        }
927  }  }
928    
929  void MainWindow::on_loader_progress()  void MainWindow::on_loader_progress()

Legend:
Removed from v.2658  
changed lines
  Added in v.2664

  ViewVC Help
Powered by ViewVC