Loading data/mlm.gresource.xml +2 −0 Original line number Diff line number Diff line Loading @@ -3,5 +3,7 @@ <gresource prefix="/mx/unam/MLM"> <file>mlm.css</file> <file preprocess="xml-stripblanks">mlm.ui</file> <file preprocess="xml-stripblanks">mlm.svg</file> <file preprocess="xml-stripblanks">shortcuts.ui</file> </gresource> </gresources> data/shortcuts.ui 0 → 100644 +79 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="UTF-8"?> <interface> <requires lib="gtk+" version="3.20"/> <template class="MLMShortcutsWindow" parent="GtkShortcutsWindow"> <property name="visible">false</property> <property name="modal">true</property> <property name="icon">resource:///mx/unam/MLM/mlm.svg</property> <signal name="delete-event" handler="gtk_widget_hide_on_delete" swapped="no"/> <child> <object class="GtkShortcutsSection" id="all"> <property name="visible">true</property> <property name="section-name">main</property> <property name="title">Main shortcuts</property> <property name="max-height">10</property> <child> <object class="GtkShortcutsGroup" id="global"> <property name="visible">true</property> <property name="title">Global</property> <child> <object class="GtkShortcutsShortcut" id="shortcuts"> <property name="visible">true</property> <property name="title">Show shortcuts dialog</property> <property name="accelerator"><ctrl>t</property> </object> </child> <child> <object class="GtkShortcutsShortcut" id="about"> <property name="visible">true</property> <property name="title">Show about dialog</property> <property name="accelerator"><ctrl>b</property> </object> </child> <child> <object class="GtkShortcutsShortcut" id="quit"> <property name="visible">true</property> <property name="title">Quit application</property> <property name="accelerator"><ctrl>q</property> </object> </child> </object> </child> <child> <object class="GtkShortcutsGroup" id="tags"> <property name="visible">true</property> <property name="title">Tags</property> <child> <object class="GtkShortcutsShortcut" id="previous"> <property name="visible">true</property> <property name="title">Go to previous file</property> <property name="accelerator"><ctrl>Page_Up</property> </object> </child> <child> <object class="GtkShortcutsShortcut" id="next"> <property name="visible">true</property> <property name="title">Go to next file</property> <property name="accelerator"><ctrl>Page_Down</property> </object> </child> <child> <object class="GtkShortcutsShortcut" id="save"> <property name="visible">true</property> <property name="title">Save file</property> <property name="accelerator"><ctrl>s</property> </object> </child> <child> <object class="GtkShortcutsShortcut" id="play"> <property name="visible">true</property> <property name="title">Play file</property> <property name="accelerator"><ctrl>space</property> </object> </child> </object> </child> </object> </child> </template> </interface> meson.build +2 −1 Original line number Diff line number Diff line Loading @@ -134,7 +134,8 @@ mlm_gui_sources = [ 'src/application/encoder.vala', 'src/application/main.vala', 'src/application/media.vala', 'src/application/player.vala' 'src/application/player.vala', 'src/application/shortcuts-window.vala' ] mlm_gui_dependencies = [ Loading src/application/application-window.vala +11 −0 Original line number Diff line number Diff line Loading @@ -157,6 +157,8 @@ namespace MLM { [GtkChild] private Gtk.Label filename_label; /* The shortcuts dialog. */ private ShortcutsWindow shortcuts; /* The MLM application. */ private Application mlm; /* The file tags. */ Loading Loading @@ -462,6 +464,15 @@ namespace MLM { "wrap-license", true); } /** * Shows the shortcuts dialog. */ public void show_shortcuts_dialog() { if (shortcuts == null) shortcuts = new ShortcutsWindow(); shortcuts.show_all(); } /* Selects an image from a file. */ private uint8[]? select_image(string title) { var dialog = Loading src/application/application.vala +10 −0 Original line number Diff line number Diff line Loading @@ -90,6 +90,11 @@ namespace MLM { action.activate.connect(stop_encoder); add_action(action); action = new GLib.SimpleAction("shortcuts", null); action.activate.connect(shortcuts); add_action(action); set_accels_for_action("app.shortcuts", new string[]{"<Ctrl>T"}); action = new GLib.SimpleAction("about", null); action.activate.connect(about); add_action(action); Loading Loading @@ -242,6 +247,11 @@ namespace MLM { tags.update(); } /* The shortcuts action. */ private void shortcuts() { window.show_shortcuts_dialog(); } /* Compares two files by path. */ private int compare_files_by_path(GLib.File a, GLib.File b) { return a.get_path().collate(b.get_path()); Loading Loading
data/mlm.gresource.xml +2 −0 Original line number Diff line number Diff line Loading @@ -3,5 +3,7 @@ <gresource prefix="/mx/unam/MLM"> <file>mlm.css</file> <file preprocess="xml-stripblanks">mlm.ui</file> <file preprocess="xml-stripblanks">mlm.svg</file> <file preprocess="xml-stripblanks">shortcuts.ui</file> </gresource> </gresources>
data/shortcuts.ui 0 → 100644 +79 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="UTF-8"?> <interface> <requires lib="gtk+" version="3.20"/> <template class="MLMShortcutsWindow" parent="GtkShortcutsWindow"> <property name="visible">false</property> <property name="modal">true</property> <property name="icon">resource:///mx/unam/MLM/mlm.svg</property> <signal name="delete-event" handler="gtk_widget_hide_on_delete" swapped="no"/> <child> <object class="GtkShortcutsSection" id="all"> <property name="visible">true</property> <property name="section-name">main</property> <property name="title">Main shortcuts</property> <property name="max-height">10</property> <child> <object class="GtkShortcutsGroup" id="global"> <property name="visible">true</property> <property name="title">Global</property> <child> <object class="GtkShortcutsShortcut" id="shortcuts"> <property name="visible">true</property> <property name="title">Show shortcuts dialog</property> <property name="accelerator"><ctrl>t</property> </object> </child> <child> <object class="GtkShortcutsShortcut" id="about"> <property name="visible">true</property> <property name="title">Show about dialog</property> <property name="accelerator"><ctrl>b</property> </object> </child> <child> <object class="GtkShortcutsShortcut" id="quit"> <property name="visible">true</property> <property name="title">Quit application</property> <property name="accelerator"><ctrl>q</property> </object> </child> </object> </child> <child> <object class="GtkShortcutsGroup" id="tags"> <property name="visible">true</property> <property name="title">Tags</property> <child> <object class="GtkShortcutsShortcut" id="previous"> <property name="visible">true</property> <property name="title">Go to previous file</property> <property name="accelerator"><ctrl>Page_Up</property> </object> </child> <child> <object class="GtkShortcutsShortcut" id="next"> <property name="visible">true</property> <property name="title">Go to next file</property> <property name="accelerator"><ctrl>Page_Down</property> </object> </child> <child> <object class="GtkShortcutsShortcut" id="save"> <property name="visible">true</property> <property name="title">Save file</property> <property name="accelerator"><ctrl>s</property> </object> </child> <child> <object class="GtkShortcutsShortcut" id="play"> <property name="visible">true</property> <property name="title">Play file</property> <property name="accelerator"><ctrl>space</property> </object> </child> </object> </child> </object> </child> </template> </interface>
meson.build +2 −1 Original line number Diff line number Diff line Loading @@ -134,7 +134,8 @@ mlm_gui_sources = [ 'src/application/encoder.vala', 'src/application/main.vala', 'src/application/media.vala', 'src/application/player.vala' 'src/application/player.vala', 'src/application/shortcuts-window.vala' ] mlm_gui_dependencies = [ Loading
src/application/application-window.vala +11 −0 Original line number Diff line number Diff line Loading @@ -157,6 +157,8 @@ namespace MLM { [GtkChild] private Gtk.Label filename_label; /* The shortcuts dialog. */ private ShortcutsWindow shortcuts; /* The MLM application. */ private Application mlm; /* The file tags. */ Loading Loading @@ -462,6 +464,15 @@ namespace MLM { "wrap-license", true); } /** * Shows the shortcuts dialog. */ public void show_shortcuts_dialog() { if (shortcuts == null) shortcuts = new ShortcutsWindow(); shortcuts.show_all(); } /* Selects an image from a file. */ private uint8[]? select_image(string title) { var dialog = Loading
src/application/application.vala +10 −0 Original line number Diff line number Diff line Loading @@ -90,6 +90,11 @@ namespace MLM { action.activate.connect(stop_encoder); add_action(action); action = new GLib.SimpleAction("shortcuts", null); action.activate.connect(shortcuts); add_action(action); set_accels_for_action("app.shortcuts", new string[]{"<Ctrl>T"}); action = new GLib.SimpleAction("about", null); action.activate.connect(about); add_action(action); Loading Loading @@ -242,6 +247,11 @@ namespace MLM { tags.update(); } /* The shortcuts action. */ private void shortcuts() { window.show_shortcuts_dialog(); } /* Compares two files by path. */ private int compare_files_by_path(GLib.File a, GLib.File b) { return a.get_path().collate(b.get_path()); Loading