--- gigedit/trunk/src/gigedit/mainwindow.cpp 2015/08/30 10:00:49 2841 +++ gigedit/trunk/src/gigedit/mainwindow.cpp 2015/09/20 10:18:22 2845 @@ -35,7 +35,6 @@ #include #include #include -#include #include #include #include @@ -118,30 +117,28 @@ actionGroup = Gtk::ActionGroup::create(); actionGroup->add(Gtk::Action::create("MenuFile", _("_File"))); - actionGroup->add(Gtk::Action::create("New", Gtk::Stock::NEW), + actionGroup->add(Gtk::Action::create("New", _("_New")), + Gtk::AccelKey("n"), sigc::mem_fun( *this, &MainWindow::on_action_file_new)); - Glib::RefPtr action = - Gtk::Action::create("Open", Gtk::Stock::OPEN); - action->property_label() = action->property_label() + "..."; - actionGroup->add(action, + actionGroup->add(Gtk::Action::create("Open", _("_Open...")), + Gtk::AccelKey("o"), sigc::mem_fun( *this, &MainWindow::on_action_file_open)); - actionGroup->add(Gtk::Action::create("Save", Gtk::Stock::SAVE), + actionGroup->add(Gtk::Action::create("Save", _("_Save")), + Gtk::AccelKey("s"), sigc::mem_fun( *this, &MainWindow::on_action_file_save)); - action = Gtk::Action::create("SaveAs", Gtk::Stock::SAVE_AS); - action->property_label() = action->property_label() + "..."; - actionGroup->add(action, + actionGroup->add(Gtk::Action::create("SaveAs", _("Save _As...")), Gtk::AccelKey("s"), sigc::mem_fun( *this, &MainWindow::on_action_file_save_as)); actionGroup->add(Gtk::Action::create("Properties", - Gtk::Stock::PROPERTIES), + _("_Properties")), sigc::mem_fun( *this, &MainWindow::on_action_file_properties)); actionGroup->add(Gtk::Action::create("InstrProperties", - Gtk::Stock::PROPERTIES), + _("_Properties")), sigc::mem_fun( *this, &MainWindow::show_instr_props)); actionGroup->add(Gtk::Action::create("MidiRules", @@ -152,7 +149,8 @@ _("_Script Slots...")), sigc::mem_fun( *this, &MainWindow::show_script_slots)); - actionGroup->add(Gtk::Action::create("Quit", Gtk::Stock::QUIT), + actionGroup->add(Gtk::Action::create("Quit", _("_Quit")), + Gtk::AccelKey("q"), sigc::mem_fun( *this, &MainWindow::on_action_quit)); actionGroup->add( @@ -199,10 +197,8 @@ sigc::mem_fun(*this, &MainWindow::on_action_refresh_all) ); - action = Gtk::Action::create("MenuHelp", Gtk::Stock::HELP); - actionGroup->add(Gtk::Action::create("MenuHelp", - action->property_label())); - actionGroup->add(Gtk::Action::create("About", Gtk::Stock::ABOUT), + actionGroup->add(Gtk::Action::create("MenuHelp", _("_Help"))); + actionGroup->add(Gtk::Action::create("About", _("_About")), sigc::mem_fun( *this, &MainWindow::on_action_help_about)); actionGroup->add( @@ -214,7 +210,7 @@ sigc::mem_fun(*this, &MainWindow::on_action_duplicate_instrument) ); actionGroup->add( - Gtk::Action::create("RemoveInstrument", Gtk::Stock::REMOVE), + Gtk::Action::create("RemoveInstrument", _("_Remove")), sigc::mem_fun(*this, &MainWindow::on_action_remove_instrument) ); @@ -261,7 +257,7 @@ // sample right-click popup actions actionGroup->add( - Gtk::Action::create("SampleProperties", Gtk::Stock::PROPERTIES), + Gtk::Action::create("SampleProperties", _("_Properties")), sigc::mem_fun(*this, &MainWindow::on_action_sample_properties) ); actionGroup->add( @@ -273,7 +269,7 @@ sigc::mem_fun(*this, &MainWindow::on_action_add_sample) ); actionGroup->add( - Gtk::Action::create("RemoveSample", Gtk::Stock::REMOVE), + Gtk::Action::create("RemoveSample", _("_Remove")), sigc::mem_fun(*this, &MainWindow::on_action_remove_sample) ); actionGroup->add( @@ -309,7 +305,7 @@ sigc::mem_fun(*this, &MainWindow::on_action_edit_script) ); actionGroup->add( - Gtk::Action::create("RemoveScript", Gtk::Stock::REMOVE), + Gtk::Action::create("RemoveScript", _("_Remove")), sigc::mem_fun(*this, &MainWindow::on_action_remove_script) ); @@ -1018,8 +1014,8 @@ g_free(msg); dialog.set_secondary_text(_("If you close without saving, your changes will be lost.")); dialog.add_button(_("Close _Without Saving"), Gtk::RESPONSE_NO); - dialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); - dialog.add_button(file_has_name ? Gtk::Stock::SAVE : Gtk::Stock::SAVE_AS, Gtk::RESPONSE_YES); + dialog.add_button(_("_Cancel"), Gtk::RESPONSE_CANCEL); + dialog.add_button(file_has_name ? _("_Save") : _("Save _As"), Gtk::RESPONSE_YES); dialog.set_default_response(Gtk::RESPONSE_YES); int response = dialog.run(); dialog.hide(); @@ -1050,7 +1046,7 @@ "used by the sampler until you tell the sampler explicitly to " "load it.")); dialog.add_button(_("_Yes, Detach"), Gtk::RESPONSE_YES); - dialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); + dialog.add_button(_("_Cancel"), Gtk::RESPONSE_CANCEL); dialog.set_default_response(Gtk::RESPONSE_CANCEL); int response = dialog.run(); dialog.hide(); @@ -1064,8 +1060,8 @@ if (file_is_shared && !leaving_shared_mode_dialog()) return; Gtk::FileChooserDialog dialog(*this, _("Open file")); - dialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); - dialog.add_button(Gtk::Stock::OPEN, Gtk::RESPONSE_OK); + dialog.add_button(_("_Cancel"), Gtk::RESPONSE_CANCEL); + dialog.add_button(_("_Open"), Gtk::RESPONSE_OK); dialog.set_default_response(Gtk::RESPONSE_OK); #if (GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION < 90) || GTKMM_MAJOR_VERSION < 2 Gtk::FileFilter filter; @@ -1260,9 +1256,9 @@ bool MainWindow::file_save_as() { - Gtk::FileChooserDialog dialog(*this, _("Save as"), Gtk::FILE_CHOOSER_ACTION_SAVE); - dialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); - dialog.add_button(Gtk::Stock::SAVE, Gtk::RESPONSE_OK); + Gtk::FileChooserDialog dialog(*this, _("Save As"), Gtk::FILE_CHOOSER_ACTION_SAVE); + dialog.add_button(_("_Cancel"), Gtk::RESPONSE_CANCEL); + dialog.add_button(_("_Save"), Gtk::RESPONSE_OK); dialog.set_default_response(Gtk::RESPONSE_OK); dialog.set_do_overwrite_confirmation(); @@ -1293,7 +1289,9 @@ // show warning in the dialog Gtk::HBox descriptionArea; descriptionArea.set_spacing(15); - Gtk::Image warningIcon(Gtk::Stock::DIALOG_WARNING, Gtk::IconSize(Gtk::ICON_SIZE_DIALOG)); + Gtk::Image warningIcon; + warningIcon.set_from_icon_name("dialog-warning", + Gtk::IconSize(Gtk::ICON_SIZE_DIALOG)); descriptionArea.pack_start(warningIcon, Gtk::PACK_SHRINK); #if GTKMM_MAJOR_VERSION < 3 view::WrapLabel description; @@ -1502,7 +1500,7 @@ eSourceForm(_("Source form")), eCommissioned(_("Commissioned")), eSubject(_("Subject")), - quitButton(Gtk::Stock::CLOSE), + quitButton(_("_Close"), true), table(2, 1), m_file(NULL) { @@ -1625,7 +1623,7 @@ } InstrumentProps::InstrumentProps() : - quitButton(Gtk::Stock::CLOSE), + quitButton(_("_Close"), true), table(2,1), eName(_("Name")), eIsDrum(_("Is drum")), @@ -2438,8 +2436,8 @@ // show 'browse for file' dialog Gtk::FileChooserDialog dialog(*this, replace ? _("Replace Sample with") : _("Add Sample(s)")); - dialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); - dialog.add_button(Gtk::Stock::OPEN, Gtk::RESPONSE_OK); + dialog.add_button(_("_Cancel"), Gtk::RESPONSE_CANCEL); + dialog.add_button(_("_Open"), Gtk::RESPONSE_OK); dialog.set_select_multiple(!replace); // allow multi audio file selection only when adding new samples, does not make sense when replacing a specific sample // matches all file types supported by libsndfile @@ -2639,7 +2637,7 @@ dialog.get_vbox()->pack_start(entryArea, Gtk::PACK_SHRINK); description.show(); entryArea.show_all(); - dialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); + dialog.add_button(_("_Cancel"), Gtk::RESPONSE_CANCEL); dialog.add_button(_("Select"), Gtk::RESPONSE_OK); dialog.set_select_multiple(false); if (current_sample_dir != "") { @@ -3259,7 +3257,7 @@ } Gtk::FileChooserDialog dialog(*this, _("Merge .gig files")); - dialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); + dialog.add_button(_("_Cancel"), Gtk::RESPONSE_CANCEL); dialog.add_button(_("Merge"), Gtk::RESPONSE_OK); dialog.set_default_response(Gtk::RESPONSE_CANCEL); #if (GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION < 90) || GTKMM_MAJOR_VERSION < 2 @@ -3278,7 +3276,9 @@ // show warning in the file picker dialog Gtk::HBox descriptionArea; descriptionArea.set_spacing(15); - Gtk::Image warningIcon(Gtk::Stock::DIALOG_WARNING, Gtk::IconSize(Gtk::ICON_SIZE_DIALOG)); + Gtk::Image warningIcon; + warningIcon.set_from_icon_name("dialog-warning", + Gtk::IconSize(Gtk::ICON_SIZE_DIALOG)); descriptionArea.pack_start(warningIcon, Gtk::PACK_SHRINK); #if GTKMM_MAJOR_VERSION < 3 view::WrapLabel description;