diff --git a/src/menu.js b/src/actions.js similarity index 90% rename from src/menu.js rename to src/actions.js index 313c2626..333ef749 100644 --- a/src/menu.js +++ b/src/actions.js @@ -1,11 +1,11 @@ const Dialogs = imports.src.dialogs; var actions = { - openLocal: { + open_local: { run: (window) => new Dialogs.FileChooser(window), accels: ['O'], }, - openUri: { + open_uri: { run: (window) => new Dialogs.UriDialog(window), accels: ['U'], }, @@ -14,5 +14,5 @@ var actions = { }, about: { run: (window) => new Dialogs.AboutDialog(window), - }, + } }; diff --git a/src/appBase.js b/src/appBase.js index 3d849eb9..8e237e84 100644 --- a/src/appBase.js +++ b/src/appBase.js @@ -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); } } diff --git a/ui/clapper.ui b/ui/clapper.ui index a83c24df..55119d74 100644 --- a/ui/clapper.ui +++ b/ui/clapper.ui @@ -4,11 +4,11 @@
Open Local... - app.openLocal + app.open_local Open URI... - app.openUri + app.open_uri