/[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 2536 by schoenebeck, Mon Apr 21 17:49:17 2014 UTC revision 2550 by schoenebeck, Wed May 14 01:31:30 2014 UTC
# Line 42  Line 42 
42  #include <sndfile.h>  #include <sndfile.h>
43    
44  #include "mainwindow.h"  #include "mainwindow.h"
45    #include "Settings.h"
46    #include "CombineInstrumentsDialog.h"
47  #include "../../gfx/status_attached.xpm"  #include "../../gfx/status_attached.xpm"
48  #include "../../gfx/status_detached.xpm"  #include "../../gfx/status_detached.xpm"
49    
# Line 182  MainWindow::MainWindow() : Line 183  MainWindow::MainWindow() :
183          sigc::mem_fun(*this, &MainWindow::on_action_remove_instrument)          sigc::mem_fun(*this, &MainWindow::on_action_remove_instrument)
184      );      );
185    
186    
187        actionGroup->add(Gtk::Action::create("MenuSettings", _("_Settings")));
188        
189        toggle_action =
190            Gtk::ToggleAction::create("WarnUserOnExtensions", _("Show warning on format _extensions"));
191        toggle_action->set_active(Settings::singleton()->warnUserOnExtensions);
192        actionGroup->add(
193            toggle_action,
194            sigc::mem_fun(*this, &MainWindow::on_action_warn_user_on_extensions)
195        );
196    
197    
198        actionGroup->add(Gtk::Action::create("MenuTools", _("_Tools")));
199    
200        actionGroup->add(
201            Gtk::Action::create("CombineInstruments", _("_Combine Instruments...")),
202            sigc::mem_fun(*this, &MainWindow::on_action_combine_instruments)
203        );
204    
205    
206      // sample right-click popup actions      // sample right-click popup actions
207      actionGroup->add(      actionGroup->add(
208          Gtk::Action::create("SampleProperties", Gtk::Stock::PROPERTIES),          Gtk::Action::create("SampleProperties", Gtk::Stock::PROPERTIES),
# Line 233  MainWindow::MainWindow() : Line 254  MainWindow::MainWindow() :
254          "    <menu action='MenuView'>"          "    <menu action='MenuView'>"
255          "      <menuitem action='Statusbar'/>"          "      <menuitem action='Statusbar'/>"
256          "    </menu>"          "    </menu>"
257            "    <menu action='MenuTools'>"
258            "      <menuitem action='CombineInstruments'/>"
259            "    </menu>"
260            "    <menu action='MenuSettings'>"
261            "      <menuitem action='WarnUserOnExtensions'/>"
262            "    </menu>"
263          "    <menu action='MenuHelp'>"          "    <menu action='MenuHelp'>"
264          "      <menuitem action='About'/>"          "      <menuitem action='About'/>"
265          "    </menu>"          "    </menu>"
# Line 277  MainWindow::MainWindow() : Line 304  MainWindow::MainWindow() :
304              uiManager->get_widget("/MenuBar/MenuEdit/CopySampleLoop"));              uiManager->get_widget("/MenuBar/MenuEdit/CopySampleLoop"));
305          item->set_tooltip_text(_("Used when dragging a sample to a region's sample reference field. You may disable this for example if you want to replace an existing sample in a region with a new sample, but don't want that the region's current loop informations to be altered by this action."));          item->set_tooltip_text(_("Used when dragging a sample to a region's sample reference field. You may disable this for example if you want to replace an existing sample in a region with a new sample, but don't want that the region's current loop informations to be altered by this action."));
306      }      }
307        {
308            Gtk::MenuItem* item = dynamic_cast<Gtk::MenuItem*>(
309                uiManager->get_widget("/MenuBar/MenuSettings/WarnUserOnExtensions"));
310            item->set_tooltip_text(_("If checked, a warning will be shown whenever you try to use a feature which is based on a LinuxSampler extension ontop of the original gig format, which would not work with the Gigasampler/GigaStudio application."));
311        }
312    
313      instrument_menu = static_cast<Gtk::MenuItem*>(      instrument_menu = static_cast<Gtk::MenuItem*>(
314          uiManager->get_widget("/MenuBar/MenuInstrument"))->get_submenu();          uiManager->get_widget("/MenuBar/MenuInstrument"))->get_submenu();
# Line 402  MainWindow::MainWindow() : Line 434  MainWindow::MainWindow() :
434    
435      // start with a new gig file by default      // start with a new gig file by default
436      on_action_file_new();      on_action_file_new();
437    
438        // select 'Instruments' tab by default
439        // (gtk allows this only if the tab childs are visible, thats why it's here)
440        m_TreeViewNotebook.set_current_page(1);
441  }  }
442    
443  MainWindow::~MainWindow()  MainWindow::~MainWindow()
# Line 954  void MainWindow::on_action_file_properti Line 990  void MainWindow::on_action_file_properti
990      propDialog.deiconify();      propDialog.deiconify();
991  }  }
992    
993    void MainWindow::on_action_warn_user_on_extensions() {
994        Settings::singleton()->warnUserOnExtensions =
995            !Settings::singleton()->warnUserOnExtensions;
996    }
997    
998  void MainWindow::on_action_help_about()  void MainWindow::on_action_help_about()
999  {  {
1000      Gtk::AboutDialog dialog;      Gtk::AboutDialog dialog;
# Line 1973  void MainWindow::on_sample_label_drop_dr Line 2014  void MainWindow::on_sample_label_drop_dr
2014          bool channels_changed = false;          bool channels_changed = false;
2015          if (sample->Channels == 1 && stereo_dimension) {          if (sample->Channels == 1 && stereo_dimension) {
2016              // remove the samplechannel dimension              // remove the samplechannel dimension
2017    /* commented out, because it makes it impossible building up an instrument from scratch using two separate L/R samples
2018              region->DeleteDimension(stereo_dimension);              region->DeleteDimension(stereo_dimension);
2019              channels_changed = true;              channels_changed = true;
2020              region_changed();              region_changed();
2021    */
2022          }          }
2023          dimreg_edit.set_sample(          dimreg_edit.set_sample(
2024              sample,              sample,
# Line 2075  void MainWindow::instrument_name_changed Line 2118  void MainWindow::instrument_name_changed
2118      }      }
2119  }  }
2120    
2121    void MainWindow::on_action_combine_instruments() {
2122        CombineInstrumentsDialog* d = new CombineInstrumentsDialog(*this, file);
2123        d->show_all();
2124        d->resize(500, 400);
2125        d->run();
2126        if (d->fileWasChanged()) {
2127            // update GUI with new instrument just created
2128            add_instrument(d->newCombinedInstrument());
2129        }
2130        delete d;
2131    }
2132    
2133  void MainWindow::set_file_is_shared(bool b) {  void MainWindow::set_file_is_shared(bool b) {
2134      this->file_is_shared = b;      this->file_is_shared = b;
2135    

Legend:
Removed from v.2536  
changed lines
  Added in v.2550

  ViewVC Help
Powered by ViewVC