/[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 3157 by schoenebeck, Mon May 8 17:30:10 2017 UTC revision 3225 by schoenebeck, Fri May 26 22:10:16 2017 UTC
# Line 35  Line 35 
35  #include <gtkmm/aboutdialog.h>  #include <gtkmm/aboutdialog.h>
36  #include <gtkmm/filechooserdialog.h>  #include <gtkmm/filechooserdialog.h>
37  #include <gtkmm/messagedialog.h>  #include <gtkmm/messagedialog.h>
38    #include <gtkmm/stock.h>
39  #include <gtkmm/targetentry.h>  #include <gtkmm/targetentry.h>
40  #include <gtkmm/main.h>  #include <gtkmm/main.h>
41  #include <gtkmm/toggleaction.h>  #include <gtkmm/toggleaction.h>
# Line 77  MainWindow::MainWindow() : Line 78  MainWindow::MainWindow() :
78      loadBuiltInPix();      loadBuiltInPix();
79    
80  //    set_border_width(5);  //    set_border_width(5);
81  //    set_default_size(400, 200);  
82        if (!Settings::singleton()->autoRestoreWindowDimension) {
83            set_default_size(800, 600);
84            set_position(Gtk::WIN_POS_CENTER);
85        }
86    
87      add(m_VBox);      add(m_VBox);
88    
# Line 156  MainWindow::MainWindow() : Line 161  MainWindow::MainWindow() :
161      actionGroup = Gtk::ActionGroup::create();      actionGroup = Gtk::ActionGroup::create();
162    
163      actionGroup->add(Gtk::Action::create("MenuFile", _("_File")));      actionGroup->add(Gtk::Action::create("MenuFile", _("_File")));
164      actionGroup->add(Gtk::Action::create("New", _("_New")),      actionGroup->add(Gtk::Action::create("New", Gtk::Stock::NEW),
                      Gtk::AccelKey("<control>n"),  
165                       sigc::mem_fun(                       sigc::mem_fun(
166                           *this, &MainWindow::on_action_file_new));                           *this, &MainWindow::on_action_file_new));
167      actionGroup->add(Gtk::Action::create("Open", _("_Open...")),      Glib::RefPtr<Gtk::Action> action =
168                       Gtk::AccelKey("<control>o"),          Gtk::Action::create("Open", Gtk::Stock::OPEN);
169        action->property_label() = action->property_label() + "...";
170        actionGroup->add(action,
171                       sigc::mem_fun(                       sigc::mem_fun(
172                           *this, &MainWindow::on_action_file_open));                           *this, &MainWindow::on_action_file_open));
173      actionGroup->add(Gtk::Action::create("Save", _("_Save")),      actionGroup->add(Gtk::Action::create("Save", Gtk::Stock::SAVE),
                      Gtk::AccelKey("<control>s"),  
174                       sigc::mem_fun(                       sigc::mem_fun(
175                           *this, &MainWindow::on_action_file_save));                           *this, &MainWindow::on_action_file_save));
176      actionGroup->add(Gtk::Action::create("SaveAs", _("Save _As...")),      action = Gtk::Action::create("SaveAs", Gtk::Stock::SAVE_AS);
177        action->property_label() = action->property_label() + "...";
178        actionGroup->add(action,
179                       Gtk::AccelKey("<shift><control>s"),                       Gtk::AccelKey("<shift><control>s"),
180                       sigc::mem_fun(                       sigc::mem_fun(
181                           *this, &MainWindow::on_action_file_save_as));                           *this, &MainWindow::on_action_file_save_as));
182      actionGroup->add(Gtk::Action::create("Properties",      actionGroup->add(Gtk::Action::create("Properties",
183                                           _("_Properties")),                                           Gtk::Stock::PROPERTIES),
184                       sigc::mem_fun(                       sigc::mem_fun(
185                           *this, &MainWindow::on_action_file_properties));                           *this, &MainWindow::on_action_file_properties));
186      actionGroup->add(Gtk::Action::create("InstrProperties",      actionGroup->add(Gtk::Action::create("InstrProperties",
187                                           _("_Properties")),                                           Gtk::Stock::PROPERTIES),
188                       sigc::mem_fun(                       sigc::mem_fun(
189                           *this, &MainWindow::show_instr_props));                           *this, &MainWindow::show_instr_props));
190      actionGroup->add(Gtk::Action::create("MidiRules",      actionGroup->add(Gtk::Action::create("MidiRules",
# Line 188  MainWindow::MainWindow() : Line 195  MainWindow::MainWindow() :
195                                           _("_Script Slots...")),                                           _("_Script Slots...")),
196                       sigc::mem_fun(                       sigc::mem_fun(
197                           *this, &MainWindow::show_script_slots));                           *this, &MainWindow::show_script_slots));
198      actionGroup->add(Gtk::Action::create("Quit", _("_Quit")),      actionGroup->add(Gtk::Action::create("Quit", Gtk::Stock::QUIT),
                      Gtk::AccelKey("<control>q"),  
199                       sigc::mem_fun(                       sigc::mem_fun(
200                           *this, &MainWindow::on_action_quit));                           *this, &MainWindow::on_action_quit));
201      actionGroup->add(      actionGroup->add(
# Line 316  MainWindow::MainWindow() : Line 322  MainWindow::MainWindow() :
322          sigc::mem_fun(*this, &MainWindow::on_action_refresh_all)          sigc::mem_fun(*this, &MainWindow::on_action_refresh_all)
323      );                      );                
324    
325      actionGroup->add(Gtk::Action::create("MenuHelp", _("_Help")));      action = Gtk::Action::create("MenuHelp", Gtk::Stock::HELP);
326      actionGroup->add(Gtk::Action::create("About", _("_About")),      actionGroup->add(Gtk::Action::create("MenuHelp",
327                                             action->property_label()));
328        actionGroup->add(Gtk::Action::create("About", Gtk::Stock::ABOUT),
329                       sigc::mem_fun(                       sigc::mem_fun(
330                           *this, &MainWindow::on_action_help_about));                           *this, &MainWindow::on_action_help_about));
331      actionGroup->add(      actionGroup->add(
# Line 329  MainWindow::MainWindow() : Line 337  MainWindow::MainWindow() :
337          sigc::mem_fun(*this, &MainWindow::on_action_duplicate_instrument)          sigc::mem_fun(*this, &MainWindow::on_action_duplicate_instrument)
338      );      );
339      actionGroup->add(      actionGroup->add(
340          Gtk::Action::create("RemoveInstrument", _("_Remove")),          Gtk::Action::create("RemoveInstrument", Gtk::Stock::REMOVE),
341          sigc::mem_fun(*this, &MainWindow::on_action_remove_instrument)          sigc::mem_fun(*this, &MainWindow::on_action_remove_instrument)
342      );      );
343    
# Line 376  MainWindow::MainWindow() : Line 384  MainWindow::MainWindow() :
384    
385      // sample right-click popup actions      // sample right-click popup actions
386      actionGroup->add(      actionGroup->add(
387          Gtk::Action::create("SampleProperties", _("_Properties")),          Gtk::Action::create("SampleProperties", Gtk::Stock::PROPERTIES),
388          sigc::mem_fun(*this, &MainWindow::on_action_sample_properties)          sigc::mem_fun(*this, &MainWindow::on_action_sample_properties)
389      );      );
390      actionGroup->add(      actionGroup->add(
# Line 388  MainWindow::MainWindow() : Line 396  MainWindow::MainWindow() :
396          sigc::mem_fun(*this, &MainWindow::on_action_add_sample)          sigc::mem_fun(*this, &MainWindow::on_action_add_sample)
397      );      );
398      actionGroup->add(      actionGroup->add(
399          Gtk::Action::create("RemoveSample", _("_Remove")),          Gtk::Action::create("RemoveSample", Gtk::Stock::REMOVE),
400          sigc::mem_fun(*this, &MainWindow::on_action_remove_sample)          sigc::mem_fun(*this, &MainWindow::on_action_remove_sample)
401      );      );
402      actionGroup->add(      actionGroup->add(
# Line 424  MainWindow::MainWindow() : Line 432  MainWindow::MainWindow() :
432          sigc::mem_fun(*this, &MainWindow::on_action_edit_script)          sigc::mem_fun(*this, &MainWindow::on_action_edit_script)
433      );      );
434      actionGroup->add(      actionGroup->add(
435          Gtk::Action::create("RemoveScript", _("_Remove")),          Gtk::Action::create("RemoveScript", Gtk::Stock::REMOVE),
436          sigc::mem_fun(*this, &MainWindow::on_action_remove_script)          sigc::mem_fun(*this, &MainWindow::on_action_remove_script)
437      );      );
438    
# Line 650  MainWindow::MainWindow() : Line 658  MainWindow::MainWindow() :
658      // Add the TreeView's view columns:      // Add the TreeView's view columns:
659      m_TreeView.append_column(_("Nr"), m_Columns.m_col_nr);      m_TreeView.append_column(_("Nr"), m_Columns.m_col_nr);
660      m_TreeView.append_column_editable(_("Instrument"), m_Columns.m_col_name);      m_TreeView.append_column_editable(_("Instrument"), m_Columns.m_col_name);
661        m_TreeView.append_column(_("Scripts"), m_Columns.m_col_scripts);
662      m_TreeView.set_headers_visible(true);      m_TreeView.set_headers_visible(true);
663            
664      // establish drag&drop within the instrument tree view, allowing to reorder      // establish drag&drop within the instrument tree view, allowing to reorder
# Line 910  void MainWindow::updateMacroMenu() { Line 919  void MainWindow::updateMacroMenu() {
919          );          );
920          menuMacro->append(*item);          menuMacro->append(*item);
921          item->set_accel_path("<Macros>/macro_" + ToString(iMacro));          item->set_accel_path("<Macros>/macro_" + ToString(iMacro));
922            Glib::ustring comment = macro.comment();
923            if (!comment.empty())
924                item->set_tooltip_text(comment);
925      }      }
926      // if there are no macros configured at all, then show a dummy entry instead      // if there are no macros configured at all, then show a dummy entry instead
927      if (m_macros.empty()) {      if (m_macros.empty()) {
# Line 953  void MainWindow::onMacroSelected(int iMa Line 965  void MainWindow::onMacroSelected(int iMa
965    
966  void MainWindow::setupMacros() {  void MainWindow::setupMacros() {
967      MacrosSetup* setup = new MacrosSetup();      MacrosSetup* setup = new MacrosSetup();
968      setup->setMacros(m_macros);      gig::DimensionRegion* pDimRgn = m_DimRegionChooser.get_main_dimregion();
969        setup->setMacros(m_macros, &m_serializationArchive, pDimRgn);
970      setup->signal_macros_changed().connect(      setup->signal_macros_changed().connect(
971          sigc::mem_fun(*this, &MainWindow::onMacrosSetupChanged)          sigc::mem_fun(*this, &MainWindow::onMacrosSetupChanged)
972      );      );
# Line 1196  void Saver::thread_function() Line 1209  void Saver::thread_function()
1209                  // save the file as separate temporary file first,                  // save the file as separate temporary file first,
1210                  // then move the saved file over the old file                  // then move the saved file over the old file
1211                  // (may result in performance speedup during save)                  // (may result in performance speedup during save)
1212                  String tmpname = filename + ".TMP";                  gig::String tmpname = filename + ".TMP";
1213                  gig->Save(tmpname, &progress);                  gig->Save(tmpname, &progress);
1214                  #if defined(WIN32)                  #if defined(WIN32)
1215                  if (!DeleteFile(filename.c_str())) {                  if (!DeleteFile(filename.c_str())) {
# Line 1204  void Saver::thread_function() Line 1217  void Saver::thread_function()
1217                  }                  }
1218                  #else // POSIX ...                  #else // POSIX ...
1219                  if (unlink(filename.c_str())) {                  if (unlink(filename.c_str())) {
1220                      throw RIFF::Exception("Could not replace original file with temporary file (unable to remove original file): " + String(strerror(errno)));                      throw RIFF::Exception("Could not replace original file with temporary file (unable to remove original file): " + gig::String(strerror(errno)));
1221                  }                  }
1222                  #endif                  #endif
1223                  if (rename(tmpname.c_str(), filename.c_str())) {                  if (rename(tmpname.c_str(), filename.c_str())) {
1224                      #if defined(WIN32)                      #if defined(WIN32)
1225                      throw RIFF::Exception("Could not replace original file with temporary file (unable to rename temp file).");                      throw RIFF::Exception("Could not replace original file with temporary file (unable to rename temp file).");
1226                      #else                      #else
1227                      throw RIFF::Exception("Could not replace original file with temporary file (unable to rename temp file): " + String(strerror(errno)));                      throw RIFF::Exception("Could not replace original file with temporary file (unable to rename temp file): " + gig::String(strerror(errno)));
1228                      #endif                      #endif
1229                  }                  }
1230              }              }
# Line 1339  bool MainWindow::close_confirmation_dial Line 1352  bool MainWindow::close_confirmation_dial
1352      g_free(msg);      g_free(msg);
1353      dialog.set_secondary_text(_("If you close without saving, your changes will be lost."));      dialog.set_secondary_text(_("If you close without saving, your changes will be lost."));
1354      dialog.add_button(_("Close _Without Saving"), Gtk::RESPONSE_NO);      dialog.add_button(_("Close _Without Saving"), Gtk::RESPONSE_NO);
1355      dialog.add_button(_("_Cancel"), Gtk::RESPONSE_CANCEL);      dialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
1356      dialog.add_button(file_has_name ? _("_Save") : _("Save _As"), Gtk::RESPONSE_YES);      dialog.add_button(file_has_name ? Gtk::Stock::SAVE : Gtk::Stock::SAVE_AS, Gtk::RESPONSE_YES);
1357      dialog.set_default_response(Gtk::RESPONSE_YES);      dialog.set_default_response(Gtk::RESPONSE_YES);
1358      int response = dialog.run();      int response = dialog.run();
1359      dialog.hide();      dialog.hide();
# Line 1371  bool MainWindow::leaving_shared_mode_dia Line 1384  bool MainWindow::leaving_shared_mode_dia
1384            "used by the sampler until you tell the sampler explicitly to "            "used by the sampler until you tell the sampler explicitly to "
1385            "load it."));            "load it."));
1386      dialog.add_button(_("_Yes, Detach"), Gtk::RESPONSE_YES);      dialog.add_button(_("_Yes, Detach"), Gtk::RESPONSE_YES);
1387      dialog.add_button(_("_Cancel"), Gtk::RESPONSE_CANCEL);      dialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
1388      dialog.set_default_response(Gtk::RESPONSE_CANCEL);      dialog.set_default_response(Gtk::RESPONSE_CANCEL);
1389      int response = dialog.run();      int response = dialog.run();
1390      dialog.hide();      dialog.hide();
# Line 1385  void MainWindow::on_action_file_open() Line 1398  void MainWindow::on_action_file_open()
1398      if (file_is_shared && !leaving_shared_mode_dialog()) return;      if (file_is_shared && !leaving_shared_mode_dialog()) return;
1399    
1400      Gtk::FileChooserDialog dialog(*this, _("Open file"));      Gtk::FileChooserDialog dialog(*this, _("Open file"));
1401      dialog.add_button(_("_Cancel"), Gtk::RESPONSE_CANCEL);      dialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
1402      dialog.add_button(_("_Open"), Gtk::RESPONSE_OK);      dialog.add_button(Gtk::Stock::OPEN, Gtk::RESPONSE_OK);
1403      dialog.set_default_response(Gtk::RESPONSE_OK);      dialog.set_default_response(Gtk::RESPONSE_OK);
1404  #if (GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION < 90) || GTKMM_MAJOR_VERSION < 2  #if (GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION < 90) || GTKMM_MAJOR_VERSION < 2
1405      Gtk::FileFilter filter;      Gtk::FileFilter filter;
# Line 1581  void MainWindow::on_action_file_save_as( Line 1594  void MainWindow::on_action_file_save_as(
1594    
1595  bool MainWindow::file_save_as()  bool MainWindow::file_save_as()
1596  {  {
1597      Gtk::FileChooserDialog dialog(*this, _("Save As"), Gtk::FILE_CHOOSER_ACTION_SAVE);      Gtk::FileChooserDialog dialog(*this, _("Save as"), Gtk::FILE_CHOOSER_ACTION_SAVE);
1598      dialog.add_button(_("_Cancel"), Gtk::RESPONSE_CANCEL);      dialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
1599      dialog.add_button(_("_Save"), Gtk::RESPONSE_OK);      dialog.add_button(Gtk::Stock::SAVE, Gtk::RESPONSE_OK);
1600      dialog.set_default_response(Gtk::RESPONSE_OK);      dialog.set_default_response(Gtk::RESPONSE_OK);
1601      dialog.set_do_overwrite_confirmation();      dialog.set_do_overwrite_confirmation();
1602    
# Line 1807  void MainWindow::on_action_help_about() Line 1820  void MainWindow::on_action_help_about()
1820      dialog.set_comments(sComment.c_str());      dialog.set_comments(sComment.c_str());
1821      dialog.set_website("http://www.linuxsampler.org");      dialog.set_website("http://www.linuxsampler.org");
1822      dialog.set_website_label("http://www.linuxsampler.org");      dialog.set_website_label("http://www.linuxsampler.org");
1823        dialog.set_position(Gtk::WIN_POS_CENTER);
1824      dialog.run();      dialog.run();
1825  }  }
1826    
# Line 1828  PropDialog::PropDialog() Line 1842  PropDialog::PropDialog()
1842        eSourceForm(_("Source form")),        eSourceForm(_("Source form")),
1843        eCommissioned(_("Commissioned")),        eCommissioned(_("Commissioned")),
1844        eSubject(_("Subject")),        eSubject(_("Subject")),
1845        quitButton(_("_Close"), true),        quitButton(Gtk::Stock::CLOSE),
1846        table(2, 1),        table(2, 1),
1847        m_file(NULL)        m_file(NULL)
1848  {  {
1849        if (!Settings::singleton()->autoRestoreWindowDimension) {
1850            set_default_size(470, 390);
1851            set_position(Gtk::WIN_POS_MOUSE);
1852        }
1853    
1854      set_title(_("File Properties"));      set_title(_("File Properties"));
1855      eName.set_width_chars(50);      eName.set_width_chars(50);
1856    
# Line 1951  void InstrumentProps::set_MIDIProgram(ui Line 1970  void InstrumentProps::set_MIDIProgram(ui
1970  }  }
1971    
1972  InstrumentProps::InstrumentProps() :  InstrumentProps::InstrumentProps() :
1973      quitButton(_("_Close"), true),      quitButton(Gtk::Stock::CLOSE),
1974      table(2,1),      table(2,1),
1975      eName(_("Name")),      eName(_("Name")),
1976      eIsDrum(_("Is drum")),      eIsDrum(_("Is drum")),
# Line 1966  InstrumentProps::InstrumentProps() : Line 1985  InstrumentProps::InstrumentProps() :
1985      eDimensionKeyRangeLow(_("Keyswitching range low")),      eDimensionKeyRangeLow(_("Keyswitching range low")),
1986      eDimensionKeyRangeHigh(_("Keyswitching range high"))      eDimensionKeyRangeHigh(_("Keyswitching range high"))
1987  {  {
1988        if (!Settings::singleton()->autoRestoreWindowDimension) {
1989            //set_default_size(470, 390);
1990            set_position(Gtk::WIN_POS_MOUSE);
1991        }
1992    
1993      set_title(_("Instrument Properties"));      set_title(_("Instrument Properties"));
1994    
1995      eDimensionKeyRangeLow.set_tip(      eDimensionKeyRangeLow.set_tip(
# Line 2090  void MainWindow::load_gig(gig::File* gig Line 2114  void MainWindow::load_gig(gig::File* gig
2114      for (gig::Instrument* instrument = gig->GetFirstInstrument() ; instrument ;      for (gig::Instrument* instrument = gig->GetFirstInstrument() ; instrument ;
2115           instrument = gig->GetNextInstrument(), ++index) {           instrument = gig->GetNextInstrument(), ++index) {
2116          Glib::ustring name(gig_to_utf8(instrument->pInfo->Name));          Glib::ustring name(gig_to_utf8(instrument->pInfo->Name));
2117            const int iScriptSlots = instrument->ScriptSlotCount();
2118    
2119          Gtk::TreeModel::iterator iter = m_refTreeModel->append();          Gtk::TreeModel::iterator iter = m_refTreeModel->append();
2120          Gtk::TreeModel::Row row = *iter;          Gtk::TreeModel::Row row = *iter;
2121          row[m_Columns.m_col_nr] = index;          row[m_Columns.m_col_nr] = index;
2122          row[m_Columns.m_col_name] = name;          row[m_Columns.m_col_name] = name;
2123          row[m_Columns.m_col_instr] = instrument;          row[m_Columns.m_col_instr] = instrument;
2124            row[m_Columns.m_col_scripts] = iScriptSlots ? ToString(iScriptSlots) : "";
2125    
2126          add_instrument_to_menu(name);          add_instrument_to_menu(name);
2127      }      }
# Line 2234  void MainWindow::show_script_slots() { Line 2260  void MainWindow::show_script_slots() {
2260    
2261      ScriptSlots* window = new ScriptSlots;      ScriptSlots* window = new ScriptSlots;
2262      window->setInstrument(instrument);      window->setInstrument(instrument);
2263        window->signal_script_slots_changed().connect(
2264            sigc::mem_fun(*this, &MainWindow::onScriptSlotsModified)
2265        );
2266      //window->reparent(*this);      //window->reparent(*this);
2267      window->show();      window->show();
2268  }  }
2269    
2270    void MainWindow::onScriptSlotsModified(gig::Instrument* pInstrument) {
2271        if (!pInstrument) return;
2272        const int iScriptSlots = pInstrument->ScriptSlotCount();
2273    
2274        Glib::RefPtr<Gtk::TreeModel> model = m_TreeView.get_model();
2275        for (int i = 0; i < model->children().size(); ++i) {
2276            Gtk::TreeModel::Row row = model->children()[i];
2277            if (row[m_Columns.m_col_instr] != pInstrument) continue;
2278            row[m_Columns.m_col_scripts] = iScriptSlots ? ToString(iScriptSlots) : "";
2279            break;
2280        }
2281    }
2282    
2283  void MainWindow::on_action_refresh_all() {  void MainWindow::on_action_refresh_all() {
2284      __refreshEntireGUI();      __refreshEntireGUI();
2285  }  }
# Line 2552  void MainWindow::add_instrument(gig::Ins Line 2594  void MainWindow::add_instrument(gig::Ins
2594      rowInstr[m_Columns.m_col_nr] = m_refTreeModel->children().size() - 1;      rowInstr[m_Columns.m_col_nr] = m_refTreeModel->children().size() - 1;
2595      rowInstr[m_Columns.m_col_name] = name;      rowInstr[m_Columns.m_col_name] = name;
2596      rowInstr[m_Columns.m_col_instr] = instrument;      rowInstr[m_Columns.m_col_instr] = instrument;
2597        rowInstr[m_Columns.m_col_scripts] = "";
2598      instrument_name_connection.unblock();      instrument_name_connection.unblock();
2599    
2600      add_instrument_to_menu(name);      add_instrument_to_menu(name);
# Line 2840  void MainWindow::add_or_replace_sample(b Line 2883  void MainWindow::add_or_replace_sample(b
2883    
2884      // show 'browse for file' dialog      // show 'browse for file' dialog
2885      Gtk::FileChooserDialog dialog(*this, replace ? _("Replace Sample with") : _("Add Sample(s)"));      Gtk::FileChooserDialog dialog(*this, replace ? _("Replace Sample with") : _("Add Sample(s)"));
2886      dialog.add_button(_("_Cancel"), Gtk::RESPONSE_CANCEL);      dialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
2887      dialog.add_button(_("_Open"), Gtk::RESPONSE_OK);      dialog.add_button(Gtk::Stock::OPEN, Gtk::RESPONSE_OK);
2888      dialog.set_select_multiple(!replace); // allow multi audio file selection only when adding new samples, does not make sense when replacing a specific sample      dialog.set_select_multiple(!replace); // allow multi audio file selection only when adding new samples, does not make sense when replacing a specific sample
2889    
2890      // matches all file types supported by libsndfile      // matches all file types supported by libsndfile
# Line 3041  void MainWindow::on_action_replace_all_s Line 3084  void MainWindow::on_action_replace_all_s
3084      dialog.get_vbox()->pack_start(entryArea, Gtk::PACK_SHRINK);      dialog.get_vbox()->pack_start(entryArea, Gtk::PACK_SHRINK);
3085      description.show();      description.show();
3086      entryArea.show_all();      entryArea.show_all();
3087      dialog.add_button(_("_Cancel"), Gtk::RESPONSE_CANCEL);      dialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
3088      dialog.add_button(_("Select"), Gtk::RESPONSE_OK);      dialog.add_button(_("Select"), Gtk::RESPONSE_OK);
3089      dialog.set_select_multiple(false);      dialog.set_select_multiple(false);
3090      if (current_sample_dir != "") {      if (current_sample_dir != "") {
# Line 3530  void MainWindow::instrument_name_changed Line 3573  void MainWindow::instrument_name_changed
3573  void MainWindow::on_action_combine_instruments() {  void MainWindow::on_action_combine_instruments() {
3574      CombineInstrumentsDialog* d = new CombineInstrumentsDialog(*this, file);      CombineInstrumentsDialog* d = new CombineInstrumentsDialog(*this, file);
3575      d->show_all();      d->show_all();
     d->resize(500, 400);  
3576      d->run();      d->run();
3577      if (d->fileWasChanged()) {      if (d->fileWasChanged()) {
3578          // update GUI with new instrument just created          // update GUI with new instrument just created
# Line 3665  void MainWindow::on_action_merge_files() Line 3707  void MainWindow::on_action_merge_files()
3707      }      }
3708    
3709      Gtk::FileChooserDialog dialog(*this, _("Merge .gig files"));      Gtk::FileChooserDialog dialog(*this, _("Merge .gig files"));
3710      dialog.add_button(_("_Cancel"), Gtk::RESPONSE_CANCEL);      dialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
3711      dialog.add_button(_("Merge"), Gtk::RESPONSE_OK);      dialog.add_button(_("Merge"), Gtk::RESPONSE_OK);
3712      dialog.set_default_response(Gtk::RESPONSE_CANCEL);      dialog.set_default_response(Gtk::RESPONSE_CANCEL);
3713  #if (GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION < 90) || GTKMM_MAJOR_VERSION < 2  #if (GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION < 90) || GTKMM_MAJOR_VERSION < 2
# Line 3865  void MainWindow::paste_copied_dimrgn() { Line 3907  void MainWindow::paste_copied_dimrgn() {
3907    
3908  void MainWindow::adjust_clipboard_content() {  void MainWindow::adjust_clipboard_content() {
3909      MacroEditor* editor = new MacroEditor();      MacroEditor* editor = new MacroEditor();
3910      editor->setMacro(&m_serializationArchive);      editor->setMacro(&m_serializationArchive, true);
3911      editor->show();      editor->show();
3912  }  }
3913    
# Line 3915  void MainWindow::applyMacro(Serializatio Line 3957  void MainWindow::applyMacro(Serializatio
3957           itDimReg != dimreg_edit.dimregs.end(); ++itDimReg)           itDimReg != dimreg_edit.dimregs.end(); ++itDimReg)
3958      {      {
3959          gig::DimensionRegion* pDimRgn = *itDimReg;          gig::DimensionRegion* pDimRgn = *itDimReg;
3960          dimreg_to_be_changed_signal.emit(pDimRgn);          DimRegionChangeGuard(this, pDimRgn);
3961          m_serializationArchive.deserialize(pDimRgn);          macro.deserialize(pDimRgn);
         dimreg_changed_signal.emit(pDimRgn);  
3962      }      }
3963      //region_changed()      //region_changed()
3964      file_changed();      file_changed();

Legend:
Removed from v.3157  
changed lines
  Added in v.3225

  ViewVC Help
Powered by ViewVC