/[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 2689 by schoenebeck, Sun Jan 4 17:19:19 2015 UTC revision 2694 by schoenebeck, Tue Jan 6 16:08:48 2015 UTC
# Line 562  MainWindow::MainWindow() : Line 562  MainWindow::MainWindow() :
562          sigc::mem_fun(*this, &MainWindow::on_samples_to_be_removed)          sigc::mem_fun(*this, &MainWindow::on_samples_to_be_removed)
563      );      );
564    
565        dimreg_edit.signal_select_sample().connect(
566            sigc::mem_fun(*this, &MainWindow::select_sample)
567        );
568    
569      m_RegionChooser.signal_instrument_struct_to_be_changed().connect(      m_RegionChooser.signal_instrument_struct_to_be_changed().connect(
570          sigc::hide(          sigc::hide(
571              sigc::bind(              sigc::bind(
# Line 943  bool MainWindow::close_confirmation_dial Line 947  bool MainWindow::close_confirmation_dial
947      int response = dialog.run();      int response = dialog.run();
948      dialog.hide();      dialog.hide();
949    
950        // user decided to exit app without saving
951        if (response == Gtk::RESPONSE_NO) return true;
952    
953        // user cancelled dialog, thus don't close app
954        if (response == Gtk::RESPONSE_CANCEL) return false;
955    
956      // TODO: the following return valid is disabled and hard coded instead for      // TODO: the following return valid is disabled and hard coded instead for
957      // now, due to the fact that saving with progress bar is now implemented      // now, due to the fact that saving with progress bar is now implemented
958      // asynchronously, as a result the app does not close automatically anymore      // asynchronously, as a result the app does not close automatically anymore
# Line 1882  void MainWindow::on_instrument_selection Line 1892  void MainWindow::on_instrument_selection
1892          }          }
1893      }      }
1894  }  }
1895    
1896    void MainWindow::select_sample(gig::Sample* sample) {
1897        Glib::RefPtr<Gtk::TreeModel> model = m_TreeViewSamples.get_model();
1898        for (int g = 0; g < model->children().size(); ++g) {
1899            Gtk::TreeModel::Row rowGroup = model->children()[g];
1900            for (int s = 0; s < rowGroup.children().size(); ++s) {
1901                Gtk::TreeModel::Row rowSample = rowGroup.children()[s];
1902                if (rowSample[m_SamplesModel.m_col_sample] == sample) {
1903                    show_samples_tab();
1904                    m_TreeViewSamples.get_selection()->select(rowGroup.children()[s]);
1905                    Gtk::TreePath path(
1906                        m_TreeViewSamples.get_selection()->get_selected()
1907                    );
1908                    m_TreeViewSamples.scroll_to_row(path);
1909                    return;
1910                }
1911            }
1912        }
1913    }
1914    
1915  void MainWindow::on_sample_treeview_button_release(GdkEventButton* button) {  void MainWindow::on_sample_treeview_button_release(GdkEventButton* button) {
1916      if (button->type == GDK_BUTTON_PRESS && button->button == 3) {      if (button->type == GDK_BUTTON_PRESS && button->button == 3) {

Legend:
Removed from v.2689  
changed lines
  Added in v.2694

  ViewVC Help
Powered by ViewVC