|
|
|
|
@ -4,6 +4,44 @@
|
|
|
|
|
#include <iostream> |
|
|
|
|
#include <string> |
|
|
|
|
|
|
|
|
|
const Glib::ustring juci_section_xml = R"RAW(<section> |
|
|
|
|
<item> |
|
|
|
|
<attribute name='label' translatable='yes'>_About</attribute> |
|
|
|
|
<attribute name='action'>app.about</attribute> |
|
|
|
|
</item> |
|
|
|
|
</section> |
|
|
|
|
<section> |
|
|
|
|
<item> |
|
|
|
|
<attribute name='label' translatable='yes'>_Preferences</attribute> |
|
|
|
|
<attribute name='action'>app.preferences</attribute> |
|
|
|
|
</item> |
|
|
|
|
</section> |
|
|
|
|
<section> |
|
|
|
|
<item> |
|
|
|
|
<attribute name='label' translatable='yes'>_Snippets</attribute> |
|
|
|
|
<attribute name='action'>app.snippets</attribute> |
|
|
|
|
</item> |
|
|
|
|
<item> |
|
|
|
|
<attribute name='label' translatable='yes'>_Commands</attribute> |
|
|
|
|
<attribute name='action'>app.commands</attribute> |
|
|
|
|
</item> |
|
|
|
|
</section> |
|
|
|
|
<section> |
|
|
|
|
<item> |
|
|
|
|
<attribute name='label' translatable='yes'>_Quit</attribute> |
|
|
|
|
<attribute name='action'>app.quit</attribute> |
|
|
|
|
</item> |
|
|
|
|
</section> |
|
|
|
|
)RAW"; |
|
|
|
|
|
|
|
|
|
#ifdef __APPLE__ |
|
|
|
|
const Glib::ustring juci_menu_xml = "<menu id='juci-menu'>" + juci_section_xml + "</menu>"; |
|
|
|
|
const Glib::ustring juci_submenu_xml = ""; |
|
|
|
|
#else |
|
|
|
|
const Glib::ustring juci_menu_xml = ""; |
|
|
|
|
const Glib::ustring juci_submenu_xml = "<submenu><attribute name='label' translatable='no'>juCi++</attribute>" + juci_section_xml + "</submenu>"; |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
const Glib::ustring menu_xml = R"RAW(<interface> |
|
|
|
|
<menu id='right-click-line-menu'> |
|
|
|
|
<section> |
|
|
|
|
@ -88,38 +126,10 @@ const Glib::ustring menu_xml = R"RAW(<interface>
|
|
|
|
|
</section> |
|
|
|
|
</menu> |
|
|
|
|
|
|
|
|
|
)RAW" + juci_menu_xml + R"RAW( |
|
|
|
|
|
|
|
|
|
<menu id='window-menu'> |
|
|
|
|
<submenu id='juci-menu'> |
|
|
|
|
<attribute name='label' translatable='yes'>_juci++</attribute> |
|
|
|
|
<section> |
|
|
|
|
<item> |
|
|
|
|
<attribute name='label' translatable='yes'>_About</attribute> |
|
|
|
|
<attribute name='action'>app.about</attribute> |
|
|
|
|
</item> |
|
|
|
|
</section> |
|
|
|
|
<section> |
|
|
|
|
<item> |
|
|
|
|
<attribute name='label' translatable='yes'>_Preferences</attribute> |
|
|
|
|
<attribute name='action'>app.preferences</attribute> |
|
|
|
|
</item> |
|
|
|
|
</section> |
|
|
|
|
<section> |
|
|
|
|
<item> |
|
|
|
|
<attribute name='label' translatable='yes'>_Snippets</attribute> |
|
|
|
|
<attribute name='action'>app.snippets</attribute> |
|
|
|
|
</item> |
|
|
|
|
<item> |
|
|
|
|
<attribute name='label' translatable='yes'>_Commands</attribute> |
|
|
|
|
<attribute name='action'>app.commands</attribute> |
|
|
|
|
</item> |
|
|
|
|
</section> |
|
|
|
|
<section> |
|
|
|
|
<item> |
|
|
|
|
<attribute name='label' translatable='yes'>_Quit</attribute> |
|
|
|
|
<attribute name='action'>app.quit</attribute> |
|
|
|
|
</item> |
|
|
|
|
</section> |
|
|
|
|
</submenu> |
|
|
|
|
)RAW" + juci_submenu_xml + R"RAW( |
|
|
|
|
<submenu> |
|
|
|
|
<attribute name='label' translatable='yes'>_File</attribute> |
|
|
|
|
<section> |
|
|
|
|
@ -612,7 +622,9 @@ void Menu::set_keys() {
|
|
|
|
|
void Menu::build() { |
|
|
|
|
try { |
|
|
|
|
builder = Gtk::Builder::create_from_string(menu_xml); |
|
|
|
|
auto object = builder->get_object("window-menu"); |
|
|
|
|
auto object = builder->get_object("juci-menu"); |
|
|
|
|
juci_menu = Glib::RefPtr<Gio::Menu>::cast_dynamic(object); |
|
|
|
|
object = builder->get_object("window-menu"); |
|
|
|
|
window_menu = Glib::RefPtr<Gio::Menu>::cast_dynamic(object); |
|
|
|
|
object = builder->get_object("right-click-line-menu"); |
|
|
|
|
auto ptr = Glib::RefPtr<Gio::Menu>::cast_dynamic(object); |
|
|
|
|
|