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> |
157 |
actionGroup = Gtk::ActionGroup::create(); |
actionGroup = Gtk::ActionGroup::create(); |
158 |
|
|
159 |
actionGroup->add(Gtk::Action::create("MenuFile", _("_File"))); |
actionGroup->add(Gtk::Action::create("MenuFile", _("_File"))); |
160 |
actionGroup->add(Gtk::Action::create("New", _("_New")), |
actionGroup->add(Gtk::Action::create("New", Gtk::Stock::NEW), |
|
Gtk::AccelKey("<control>n"), |
|
161 |
sigc::mem_fun( |
sigc::mem_fun( |
162 |
*this, &MainWindow::on_action_file_new)); |
*this, &MainWindow::on_action_file_new)); |
163 |
actionGroup->add(Gtk::Action::create("Open", _("_Open...")), |
Glib::RefPtr<Gtk::Action> action = |
164 |
Gtk::AccelKey("<control>o"), |
Gtk::Action::create("Open", Gtk::Stock::OPEN); |
165 |
|
action->property_label() = action->property_label() + "..."; |
166 |
|
actionGroup->add(action, |
167 |
sigc::mem_fun( |
sigc::mem_fun( |
168 |
*this, &MainWindow::on_action_file_open)); |
*this, &MainWindow::on_action_file_open)); |
169 |
actionGroup->add(Gtk::Action::create("Save", _("_Save")), |
actionGroup->add(Gtk::Action::create("Save", Gtk::Stock::SAVE), |
|
Gtk::AccelKey("<control>s"), |
|
170 |
sigc::mem_fun( |
sigc::mem_fun( |
171 |
*this, &MainWindow::on_action_file_save)); |
*this, &MainWindow::on_action_file_save)); |
172 |
actionGroup->add(Gtk::Action::create("SaveAs", _("Save _As...")), |
action = Gtk::Action::create("SaveAs", Gtk::Stock::SAVE_AS); |
173 |
|
action->property_label() = action->property_label() + "..."; |
174 |
|
actionGroup->add(action, |
175 |
Gtk::AccelKey("<shift><control>s"), |
Gtk::AccelKey("<shift><control>s"), |
176 |
sigc::mem_fun( |
sigc::mem_fun( |
177 |
*this, &MainWindow::on_action_file_save_as)); |
*this, &MainWindow::on_action_file_save_as)); |
178 |
actionGroup->add(Gtk::Action::create("Properties", |
actionGroup->add(Gtk::Action::create("Properties", |
179 |
_("_Properties")), |
Gtk::Stock::PROPERTIES), |
180 |
sigc::mem_fun( |
sigc::mem_fun( |
181 |
*this, &MainWindow::on_action_file_properties)); |
*this, &MainWindow::on_action_file_properties)); |
182 |
actionGroup->add(Gtk::Action::create("InstrProperties", |
actionGroup->add(Gtk::Action::create("InstrProperties", |
183 |
_("_Properties")), |
Gtk::Stock::PROPERTIES), |
184 |
sigc::mem_fun( |
sigc::mem_fun( |
185 |
*this, &MainWindow::show_instr_props)); |
*this, &MainWindow::show_instr_props)); |
186 |
actionGroup->add(Gtk::Action::create("MidiRules", |
actionGroup->add(Gtk::Action::create("MidiRules", |
191 |
_("_Script Slots...")), |
_("_Script Slots...")), |
192 |
sigc::mem_fun( |
sigc::mem_fun( |
193 |
*this, &MainWindow::show_script_slots)); |
*this, &MainWindow::show_script_slots)); |
194 |
actionGroup->add(Gtk::Action::create("Quit", _("_Quit")), |
actionGroup->add(Gtk::Action::create("Quit", Gtk::Stock::QUIT), |
|
Gtk::AccelKey("<control>q"), |
|
195 |
sigc::mem_fun( |
sigc::mem_fun( |
196 |
*this, &MainWindow::on_action_quit)); |
*this, &MainWindow::on_action_quit)); |
197 |
actionGroup->add( |
actionGroup->add( |
318 |
sigc::mem_fun(*this, &MainWindow::on_action_refresh_all) |
sigc::mem_fun(*this, &MainWindow::on_action_refresh_all) |
319 |
); |
); |
320 |
|
|
321 |
actionGroup->add(Gtk::Action::create("MenuHelp", _("_Help"))); |
action = Gtk::Action::create("MenuHelp", Gtk::Stock::HELP); |
322 |
actionGroup->add(Gtk::Action::create("About", _("_About")), |
actionGroup->add(Gtk::Action::create("MenuHelp", |
323 |
|
action->property_label())); |
324 |
|
actionGroup->add(Gtk::Action::create("About", Gtk::Stock::ABOUT), |
325 |
sigc::mem_fun( |
sigc::mem_fun( |
326 |
*this, &MainWindow::on_action_help_about)); |
*this, &MainWindow::on_action_help_about)); |
327 |
actionGroup->add( |
actionGroup->add( |
333 |
sigc::mem_fun(*this, &MainWindow::on_action_duplicate_instrument) |
sigc::mem_fun(*this, &MainWindow::on_action_duplicate_instrument) |
334 |
); |
); |
335 |
actionGroup->add( |
actionGroup->add( |
336 |
Gtk::Action::create("RemoveInstrument", _("_Remove")), |
Gtk::Action::create("RemoveInstrument", Gtk::Stock::REMOVE), |
337 |
sigc::mem_fun(*this, &MainWindow::on_action_remove_instrument) |
sigc::mem_fun(*this, &MainWindow::on_action_remove_instrument) |
338 |
); |
); |
339 |
|
|
380 |
|
|
381 |
// sample right-click popup actions |
// sample right-click popup actions |
382 |
actionGroup->add( |
actionGroup->add( |
383 |
Gtk::Action::create("SampleProperties", _("_Properties")), |
Gtk::Action::create("SampleProperties", Gtk::Stock::PROPERTIES), |
384 |
sigc::mem_fun(*this, &MainWindow::on_action_sample_properties) |
sigc::mem_fun(*this, &MainWindow::on_action_sample_properties) |
385 |
); |
); |
386 |
actionGroup->add( |
actionGroup->add( |
392 |
sigc::mem_fun(*this, &MainWindow::on_action_add_sample) |
sigc::mem_fun(*this, &MainWindow::on_action_add_sample) |
393 |
); |
); |
394 |
actionGroup->add( |
actionGroup->add( |
395 |
Gtk::Action::create("RemoveSample", _("_Remove")), |
Gtk::Action::create("RemoveSample", Gtk::Stock::REMOVE), |
396 |
sigc::mem_fun(*this, &MainWindow::on_action_remove_sample) |
sigc::mem_fun(*this, &MainWindow::on_action_remove_sample) |
397 |
); |
); |
398 |
actionGroup->add( |
actionGroup->add( |
428 |
sigc::mem_fun(*this, &MainWindow::on_action_edit_script) |
sigc::mem_fun(*this, &MainWindow::on_action_edit_script) |
429 |
); |
); |
430 |
actionGroup->add( |
actionGroup->add( |
431 |
Gtk::Action::create("RemoveScript", _("_Remove")), |
Gtk::Action::create("RemoveScript", Gtk::Stock::REMOVE), |
432 |
sigc::mem_fun(*this, &MainWindow::on_action_remove_script) |
sigc::mem_fun(*this, &MainWindow::on_action_remove_script) |
433 |
); |
); |
434 |
|
|
1343 |
g_free(msg); |
g_free(msg); |
1344 |
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.")); |
1345 |
dialog.add_button(_("Close _Without Saving"), Gtk::RESPONSE_NO); |
dialog.add_button(_("Close _Without Saving"), Gtk::RESPONSE_NO); |
1346 |
dialog.add_button(_("_Cancel"), Gtk::RESPONSE_CANCEL); |
dialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); |
1347 |
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); |
1348 |
dialog.set_default_response(Gtk::RESPONSE_YES); |
dialog.set_default_response(Gtk::RESPONSE_YES); |
1349 |
int response = dialog.run(); |
int response = dialog.run(); |
1350 |
dialog.hide(); |
dialog.hide(); |
1375 |
"used by the sampler until you tell the sampler explicitly to " |
"used by the sampler until you tell the sampler explicitly to " |
1376 |
"load it.")); |
"load it.")); |
1377 |
dialog.add_button(_("_Yes, Detach"), Gtk::RESPONSE_YES); |
dialog.add_button(_("_Yes, Detach"), Gtk::RESPONSE_YES); |
1378 |
dialog.add_button(_("_Cancel"), Gtk::RESPONSE_CANCEL); |
dialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); |
1379 |
dialog.set_default_response(Gtk::RESPONSE_CANCEL); |
dialog.set_default_response(Gtk::RESPONSE_CANCEL); |
1380 |
int response = dialog.run(); |
int response = dialog.run(); |
1381 |
dialog.hide(); |
dialog.hide(); |
1389 |
if (file_is_shared && !leaving_shared_mode_dialog()) return; |
if (file_is_shared && !leaving_shared_mode_dialog()) return; |
1390 |
|
|
1391 |
Gtk::FileChooserDialog dialog(*this, _("Open file")); |
Gtk::FileChooserDialog dialog(*this, _("Open file")); |
1392 |
dialog.add_button(_("_Cancel"), Gtk::RESPONSE_CANCEL); |
dialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); |
1393 |
dialog.add_button(_("_Open"), Gtk::RESPONSE_OK); |
dialog.add_button(Gtk::Stock::OPEN, Gtk::RESPONSE_OK); |
1394 |
dialog.set_default_response(Gtk::RESPONSE_OK); |
dialog.set_default_response(Gtk::RESPONSE_OK); |
1395 |
#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 |
1396 |
Gtk::FileFilter filter; |
Gtk::FileFilter filter; |
1585 |
|
|
1586 |
bool MainWindow::file_save_as() |
bool MainWindow::file_save_as() |
1587 |
{ |
{ |
1588 |
Gtk::FileChooserDialog dialog(*this, _("Save As"), Gtk::FILE_CHOOSER_ACTION_SAVE); |
Gtk::FileChooserDialog dialog(*this, _("Save as"), Gtk::FILE_CHOOSER_ACTION_SAVE); |
1589 |
dialog.add_button(_("_Cancel"), Gtk::RESPONSE_CANCEL); |
dialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); |
1590 |
dialog.add_button(_("_Save"), Gtk::RESPONSE_OK); |
dialog.add_button(Gtk::Stock::SAVE, Gtk::RESPONSE_OK); |
1591 |
dialog.set_default_response(Gtk::RESPONSE_OK); |
dialog.set_default_response(Gtk::RESPONSE_OK); |
1592 |
dialog.set_do_overwrite_confirmation(); |
dialog.set_do_overwrite_confirmation(); |
1593 |
|
|
1832 |
eSourceForm(_("Source form")), |
eSourceForm(_("Source form")), |
1833 |
eCommissioned(_("Commissioned")), |
eCommissioned(_("Commissioned")), |
1834 |
eSubject(_("Subject")), |
eSubject(_("Subject")), |
1835 |
quitButton(_("_Close"), true), |
quitButton(Gtk::Stock::CLOSE), |
1836 |
table(2, 1), |
table(2, 1), |
1837 |
m_file(NULL) |
m_file(NULL) |
1838 |
{ |
{ |
1955 |
} |
} |
1956 |
|
|
1957 |
InstrumentProps::InstrumentProps() : |
InstrumentProps::InstrumentProps() : |
1958 |
quitButton(_("_Close"), true), |
quitButton(Gtk::Stock::CLOSE), |
1959 |
table(2,1), |
table(2,1), |
1960 |
eName(_("Name")), |
eName(_("Name")), |
1961 |
eIsDrum(_("Is drum")), |
eIsDrum(_("Is drum")), |
2844 |
|
|
2845 |
// show 'browse for file' dialog |
// show 'browse for file' dialog |
2846 |
Gtk::FileChooserDialog dialog(*this, replace ? _("Replace Sample with") : _("Add Sample(s)")); |
Gtk::FileChooserDialog dialog(*this, replace ? _("Replace Sample with") : _("Add Sample(s)")); |
2847 |
dialog.add_button(_("_Cancel"), Gtk::RESPONSE_CANCEL); |
dialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); |
2848 |
dialog.add_button(_("_Open"), Gtk::RESPONSE_OK); |
dialog.add_button(Gtk::Stock::OPEN, Gtk::RESPONSE_OK); |
2849 |
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 |
2850 |
|
|
2851 |
// matches all file types supported by libsndfile |
// matches all file types supported by libsndfile |
3045 |
dialog.get_vbox()->pack_start(entryArea, Gtk::PACK_SHRINK); |
dialog.get_vbox()->pack_start(entryArea, Gtk::PACK_SHRINK); |
3046 |
description.show(); |
description.show(); |
3047 |
entryArea.show_all(); |
entryArea.show_all(); |
3048 |
dialog.add_button(_("_Cancel"), Gtk::RESPONSE_CANCEL); |
dialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); |
3049 |
dialog.add_button(_("Select"), Gtk::RESPONSE_OK); |
dialog.add_button(_("Select"), Gtk::RESPONSE_OK); |
3050 |
dialog.set_select_multiple(false); |
dialog.set_select_multiple(false); |
3051 |
if (current_sample_dir != "") { |
if (current_sample_dir != "") { |
3669 |
} |
} |
3670 |
|
|
3671 |
Gtk::FileChooserDialog dialog(*this, _("Merge .gig files")); |
Gtk::FileChooserDialog dialog(*this, _("Merge .gig files")); |
3672 |
dialog.add_button(_("_Cancel"), Gtk::RESPONSE_CANCEL); |
dialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); |
3673 |
dialog.add_button(_("Merge"), Gtk::RESPONSE_OK); |
dialog.add_button(_("Merge"), Gtk::RESPONSE_OK); |
3674 |
dialog.set_default_response(Gtk::RESPONSE_CANCEL); |
dialog.set_default_response(Gtk::RESPONSE_CANCEL); |
3675 |
#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 |