mirror of
https://github.com/Rafostar/clapper.git
synced 2025-08-29 23:32:04 +02:00
Change actions naming scheme
Use _ instead of capital letters in words for actions names. This will make some other stuff much easier.
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
const Dialogs = imports.src.dialogs;
|
||||
|
||||
var actions = {
|
||||
openLocal: {
|
||||
open_local: {
|
||||
run: (window) => new Dialogs.FileChooser(window),
|
||||
accels: ['<Ctrl>O'],
|
||||
},
|
||||
openUri: {
|
||||
open_uri: {
|
||||
run: (window) => new Dialogs.UriDialog(window),
|
||||
accels: ['<Ctrl>U'],
|
||||
},
|
||||
@@ -14,5 +14,5 @@ var actions = {
|
||||
},
|
||||
about: {
|
||||
run: (window) => new Dialogs.AboutDialog(window),
|
||||
},
|
||||
}
|
||||
};
|
@@ -1,8 +1,8 @@
|
||||
const { Gio, GLib, GObject, Gtk } = imports.gi;
|
||||
const Debug = imports.src.debug;
|
||||
const FileOps = imports.src.fileOps;
|
||||
const Menu = imports.src.menu;
|
||||
const Misc = imports.src.misc;
|
||||
const { actions } = imports.src.actions;
|
||||
|
||||
const { debug } = Debug;
|
||||
const { settings } = Misc;
|
||||
@@ -35,15 +35,15 @@ class ClapperAppBase extends Gtk.Application
|
||||
if(!settings.get_boolean('render-shadows'))
|
||||
window.add_css_class('gpufriendly');
|
||||
|
||||
for(let name in Menu.actions) {
|
||||
for(let name in actions) {
|
||||
const simpleAction = new Gio.SimpleAction({ name });
|
||||
simpleAction.connect(
|
||||
'activate', () => Menu.actions[name].run(this.active_window)
|
||||
'activate', () => actions[name].run(this.active_window)
|
||||
);
|
||||
this.add_action(simpleAction);
|
||||
|
||||
if(Menu.actions[name].accels)
|
||||
this.set_accels_for_action(`app.${name}`, Menu.actions[name].accels);
|
||||
if(actions[name].accels)
|
||||
this.set_accels_for_action(`app.${name}`, actions[name].accels);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -4,11 +4,11 @@
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Open Local...</attribute>
|
||||
<attribute name="action">app.openLocal</attribute>
|
||||
<attribute name="action">app.open_local</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Open URI...</attribute>
|
||||
<attribute name="action">app.openUri</attribute>
|
||||
<attribute name="action">app.open_uri</attribute>
|
||||
</item>
|
||||
</section>
|
||||
<section>
|
||||
|
Reference in New Issue
Block a user