/[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 2507 by persson, Sun Jan 12 19:37:55 2014 UTC revision 2541 by schoenebeck, Wed Apr 23 16:49:05 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 "../../gfx/status_attached.xpm"  #include "../../gfx/status_attached.xpm"
47  #include "../../gfx/status_detached.xpm"  #include "../../gfx/status_detached.xpm"
48    
# Line 89  MainWindow::MainWindow() : Line 89  MainWindow::MainWindow() :
89      dimreg_vbox.pack_start(dimreg_hbox, Gtk::PACK_SHRINK);      dimreg_vbox.pack_start(dimreg_hbox, Gtk::PACK_SHRINK);
90      m_HPaned.add2(dimreg_vbox);      m_HPaned.add2(dimreg_vbox);
91    
92        dimreg_label.set_tooltip_text(_("To automatically apply your changes above globally to the entire instrument, check all 3 check boxes on the right."));
93        dimreg_all_regions.set_tooltip_text(_("If checked: all changes you perform above will automatically be applied to all regions of this instrument as well."));
94        dimreg_all_dimregs.set_tooltip_text(_("If checked: all changes you perform above will automatically be applied as well to all dimension splits of the region selected below."));
95        dimreg_stereo.set_tooltip_text(_("If checked: all changes you perform above will automatically be applied to both audio channel splits (only if a \"stereo\" dimension is defined below)."));
96    
97      m_TreeViewNotebook.append_page(m_ScrolledWindowSamples, _("Samples"));      m_TreeViewNotebook.append_page(m_ScrolledWindowSamples, _("Samples"));
98      m_TreeViewNotebook.append_page(m_ScrolledWindow, _("Instruments"));      m_TreeViewNotebook.append_page(m_ScrolledWindow, _("Instruments"));
# Line 136  MainWindow::MainWindow() : Line 140  MainWindow::MainWindow() :
140      actionGroup->add(Gtk::Action::create("MenuEdit", _("_Edit")));      actionGroup->add(Gtk::Action::create("MenuEdit", _("_Edit")));
141    
142      Glib::RefPtr<Gtk::ToggleAction> toggle_action =      Glib::RefPtr<Gtk::ToggleAction> toggle_action =
143          Gtk::ToggleAction::create("CopySampleUnity", _("Copy Sample's _Unity Note"), "ffaga");          Gtk::ToggleAction::create("CopySampleUnity", _("Copy Sample's _Unity Note"));
144      toggle_action->set_active(true);      toggle_action->set_active(true);
     //FIXME: doesn't work, why?  
     toggle_action->set_tooltip(_("Used when dragging a sample to a region's sample reference field."));  
145      actionGroup->add(toggle_action);      actionGroup->add(toggle_action);
146    
147      toggle_action =      toggle_action =
148          Gtk::ToggleAction::create("CopySampleTune", _("Copy Sample's _Fine Tune"));          Gtk::ToggleAction::create("CopySampleTune", _("Copy Sample's _Fine Tune"));
149      toggle_action->set_active(true);      toggle_action->set_active(true);
     //FIXME: doesn't work, why?  
     toggle_action->set_tooltip(_("Used when dragging a sample to a region's sample reference field."));  
150      actionGroup->add(toggle_action);      actionGroup->add(toggle_action);
151    
152      toggle_action =      toggle_action =
153          Gtk::ToggleAction::create("CopySampleLoop", _("Copy Sample's _Loop Points"));          Gtk::ToggleAction::create("CopySampleLoop", _("Copy Sample's _Loop Points"));
154      toggle_action->set_active(true);      toggle_action->set_active(true);
     //FIXME: doesn't work, why?  
     toggle_action->set_tooltip(_("Used when dragging a sample to a region's sample reference field."));  
155      actionGroup->add(toggle_action);      actionGroup->add(toggle_action);
156    
157    
# Line 184  MainWindow::MainWindow() : Line 182  MainWindow::MainWindow() :
182          sigc::mem_fun(*this, &MainWindow::on_action_remove_instrument)          sigc::mem_fun(*this, &MainWindow::on_action_remove_instrument)
183      );      );
184    
185    
186        actionGroup->add(Gtk::Action::create("MenuSettings", _("_Settings")));
187        
188        toggle_action =
189            Gtk::ToggleAction::create("WarnUserOnExtensions", _("Show warning on format _extensions"));
190        toggle_action->set_active(Settings::singleton()->warnUserOnExtensions);
191        actionGroup->add(
192            toggle_action,
193            sigc::mem_fun(*this, &MainWindow::on_action_warn_user_on_extensions)
194        );
195    
196    
197      // sample right-click popup actions      // sample right-click popup actions
198      actionGroup->add(      actionGroup->add(
199          Gtk::Action::create("SampleProperties", Gtk::Stock::PROPERTIES),          Gtk::Action::create("SampleProperties", Gtk::Stock::PROPERTIES),
# Line 235  MainWindow::MainWindow() : Line 245  MainWindow::MainWindow() :
245          "    <menu action='MenuView'>"          "    <menu action='MenuView'>"
246          "      <menuitem action='Statusbar'/>"          "      <menuitem action='Statusbar'/>"
247          "    </menu>"          "    </menu>"
248            "    <menu action='MenuSettings'>"
249            "      <menuitem action='WarnUserOnExtensions'/>"
250            "    </menu>"
251          "    <menu action='MenuHelp'>"          "    <menu action='MenuHelp'>"
252          "      <menuitem action='About'/>"          "      <menuitem action='About'/>"
253          "    </menu>"          "    </menu>"
# Line 259  MainWindow::MainWindow() : Line 272  MainWindow::MainWindow() :
272      uiManager->add_ui_from_string(ui_info);      uiManager->add_ui_from_string(ui_info);
273    
274      popup_menu = dynamic_cast<Gtk::Menu*>(uiManager->get_widget("/PopupMenu"));      popup_menu = dynamic_cast<Gtk::Menu*>(uiManager->get_widget("/PopupMenu"));
275        
276        // Set tooltips for menu items (for some reason, setting a tooltip on the
277        // respective Gtk::Action objects above will simply be ignored, no matter
278        // if using Gtk::Action::set_tooltip() or passing the tooltip string on
279        // Gtk::Action::create()).
280        {
281            Gtk::MenuItem* item = dynamic_cast<Gtk::MenuItem*>(
282                uiManager->get_widget("/MenuBar/MenuEdit/CopySampleUnity"));
283            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 unity note setting will be altered by this action."));
284        }
285        {
286            Gtk::MenuItem* item = dynamic_cast<Gtk::MenuItem*>(
287                uiManager->get_widget("/MenuBar/MenuEdit/CopySampleTune"));
288            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 sample playback tuning will be altered by this action."));
289        }
290        {
291            Gtk::MenuItem* item = dynamic_cast<Gtk::MenuItem*>(
292                uiManager->get_widget("/MenuBar/MenuEdit/CopySampleLoop"));
293            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."));
294        }
295        {
296            Gtk::MenuItem* item = dynamic_cast<Gtk::MenuItem*>(
297                uiManager->get_widget("/MenuBar/MenuSettings/WarnUserOnExtensions"));
298            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."));
299        }
300    
301      instrument_menu = static_cast<Gtk::MenuItem*>(      instrument_menu = static_cast<Gtk::MenuItem*>(
302          uiManager->get_widget("/MenuBar/MenuInstrument"))->get_submenu();          uiManager->get_widget("/MenuBar/MenuInstrument"))->get_submenu();
# Line 287  MainWindow::MainWindow() : Line 325  MainWindow::MainWindow() :
325      // Create the Tree model:      // Create the Tree model:
326      m_refTreeModel = Gtk::ListStore::create(m_Columns);      m_refTreeModel = Gtk::ListStore::create(m_Columns);
327      m_TreeView.set_model(m_refTreeModel);      m_TreeView.set_model(m_refTreeModel);
328        m_TreeView.set_tooltip_text(_("Right click here for actions on instruments & MIDI Rules."));
329      instrument_name_connection = m_refTreeModel->signal_row_changed().connect(      instrument_name_connection = m_refTreeModel->signal_row_changed().connect(
330          sigc::mem_fun(*this, &MainWindow::instrument_name_changed)          sigc::mem_fun(*this, &MainWindow::instrument_name_changed)
331      );      );
# Line 298  MainWindow::MainWindow() : Line 337  MainWindow::MainWindow() :
337      // create samples treeview (including its data model)      // create samples treeview (including its data model)
338      m_refSamplesTreeModel = SamplesTreeStore::create(m_SamplesModel);      m_refSamplesTreeModel = SamplesTreeStore::create(m_SamplesModel);
339      m_TreeViewSamples.set_model(m_refSamplesTreeModel);      m_TreeViewSamples.set_model(m_refSamplesTreeModel);
340        m_TreeViewSamples.set_tooltip_text(_("To actually use a sample, drag it from this list view to \"Sample\" -> \"Sample:\" on the region's settings pane on the right.\n\nRight click here for more actions on samples."));
341      // m_TreeViewSamples.set_reorderable();      // m_TreeViewSamples.set_reorderable();
342      m_TreeViewSamples.append_column_editable("Samples", m_SamplesModel.m_col_name);      m_TreeViewSamples.append_column_editable("Samples", m_SamplesModel.m_col_name);
343      m_TreeViewSamples.set_headers_visible(false);      m_TreeViewSamples.set_headers_visible(false);
# Line 934  void MainWindow::on_action_file_properti Line 974  void MainWindow::on_action_file_properti
974      propDialog.deiconify();      propDialog.deiconify();
975  }  }
976    
977    void MainWindow::on_action_warn_user_on_extensions() {
978        Settings::singleton()->warnUserOnExtensions =
979            !Settings::singleton()->warnUserOnExtensions;
980    }
981    
982  void MainWindow::on_action_help_about()  void MainWindow::on_action_help_about()
983  {  {
984      Gtk::AboutDialog dialog;      Gtk::AboutDialog dialog;

Legend:
Removed from v.2507  
changed lines
  Added in v.2541

  ViewVC Help
Powered by ViewVC