Florian Müllner
cc45bd63ab
cleanup: Use new gettext() convenience
...
gnome-shell now includes convenience helpers for gettext functions that
use an extension's text domain (as initialized by initTranslations()).
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/183 >
2021-08-14 23:15:56 +02:00
Florian Müllner
d0b9c9b54a
cleanup: Document functions
...
gjs now enforces this in its eslint configuration. Adding type
information generally is a good idea, so add appropriate comments
to public functions before picking up that configuration change.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/180 >
2021-08-13 04:48:22 +02:00
Florian Müllner
0d06cc685e
extensions: Pick up gettext domain from metadata
...
Since commit a6ee142f21 , the extension archives that are uploaded
to extensions.gnome.org only contain strings that are relevant for
the extension, not all translations from all extensions.
Unfortunately all extensions still share a common gettext domain,
so the extension with the last bind_textdomain() call wins and
leaves the others without translations.
We'll address this by using distinct domains when not installed
system-wide. That becomes easier if there is a canonical place
for the text domain, with the existing metadata key being the
natural choice.
https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/issues/335
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/179 >
2021-08-11 18:42:43 +02:00
Florian Müllner
d421bbfa60
drive-menu: Hide items initially
...
Now that the check for network mounts is non-blocking, the initial
sync doesn't take effect immediately. We don't want hidden items
to briefly flash the indicator, so create them initially hidden.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/176 >
2021-07-13 11:54:21 +02:00
Florian Müllner
3539ce1139
drive-menu: Fix indicator visibility
...
Commit 519269be9d made the check for network mounts non-blocking, and
we now update the indicator's visibility before a newly-added network
mount is hidden.
Address this by monitoring the item itself for visibility changes.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/176 >
2021-07-13 11:46:16 +02:00
Florian Müllner
519269be9d
drive-menu: Avoid blocking I/O when querying filesystem
...
The last commit improved the heuristics for detecting network mounts,
but at the price of potentially blocking the shell. Avoid that drawback
by making the code in question async.
https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/53
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/27 >
2021-06-23 18:15:42 +02:00
Florian Müllner
7d6670ce3c
drive-menu: Don't assume mounts without volume are local
...
The intention of the code is to only expose actually plugged in
devices rather than network mounts, but the existing heuristics are
based on GVolume and simply assume a local mount where there's no
associated volume. Fill that gap by querying the ::remote filesystem
attribute in that case.
https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/53
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/27 >
2021-06-23 17:52:19 +02:00
Florian Müllner
1e44941db6
drive-menu: Remove unused style class
...
The .single-indicator class was added to add extra spacing to
lone top bar items when removing the arrows, but dropped again
after solving the extra spacing differently.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/161 >
2021-02-24 00:45:58 +00:00
Florian Müllner
ac2ed286e1
extensions: Remove arrows from top bar menus
...
... following the corresponding gnome-shell change.
https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3567
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/156 >
2021-01-26 16:59:43 +01:00
Florian Müllner
0426d1d8d5
drive-menu: Emphasize eject buttons as distinct controls
...
The buttons currently appear more as an attachment to the label
than as distinct controls. Address that by:
- applying .button styling
- increasing spacing between label and button
- aligning buttons at the end
https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/issues/223
2020-04-10 14:31:40 +00:00
Florian Müllner
b25c4d07a7
style: Avoid unnecessary parentheses
...
The eslint check in CI is broken, and some style nits weren't caught
as a consequence.
https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/105
2020-01-26 23:43:18 +01:00
Florian Müllner
9c964eaf1b
drive-menu: Stop using deprecated child properties
...
StBoxLayout's child properties were deprecated in favor of the generic
expand/align properties.
https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/102
2020-01-09 20:16:39 +01:00
Florian Müllner
7c170e7e90
cleanup: Always use type-safe comparisons
...
The type coercion performed by the regular == and != operators can
have surprising results. It is therefore considered good practice
to use the type-safe === and !== variants instead.
https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/91
2019-08-21 15:13:44 +00:00
Florian Müllner
ed7a292805
cleanup: Don't use comparison operator when checking falsy values
...
We mostly use the regular == and != comparison operators over their
type-safe === and !== counterparts. This is about to change, but there
are some places where we don't care whether a value is null, undefined
or 0; just check for falsiness there instead of using operators, so
we can start to consistently use the type-safe operators everywhere
else in a follow-up commit.
https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/91
2019-08-21 15:13:44 +00:00
Florian Müllner
eb79f5b512
cleanup: Require "dangling" commas
...
Since ES5, trailing commas in arrays and object literals are valid.
We generally haven't used them so far, but they are actually a good
idea, as they make additions and removals in diffs much cleaner.
https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/91
2019-08-21 15:13:44 +00:00
Florian Müllner
eceff51ba1
cleanup: Use consistent brace style of blocks
...
Our coding style has always been to avoid braces when all blocks
are single-lines. Make sure we apply that style consistently.
https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/91
2019-08-21 15:13:44 +00:00
Florian Müllner
fdc3dda484
cleanup: Fix stray/missing spaces
...
Those are wrong according to our style guidelines, but the previous
eslint ruleset didn't catch them.
https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/91
2019-08-21 15:13:44 +00:00
Florian Müllner
5f96b3c11c
cleanup: Don't omit parens when constructing
...
While it is legal to omit parentheses when invoking a constructor
with no arguments, we generally avoid that in our coding style.
https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/91
2019-08-21 15:13:43 +00:00
Florian Müllner
f8bae05036
cleanup: Stop using PopupMenuItem.actor properties
...
Popup menu items are now actor subclasses, and their actor property
points to the item itself.
https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/84
2019-07-20 00:20:51 +02:00
Florian Müllner
2db4589dea
cleanup: Re-order imports
...
They should be grouped between external (GI/gjs) and shell and in
alphabetical order. Until commit bab4be1a ExtensionUtils was special
as it was required for some imports, but that's no longer the case
for most extensions.
https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/76
2019-06-28 21:51:38 +02:00
Florian Müllner
65191d83b4
drive-menu: Adjust to GObject-ification of menu items
...
https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/67
2019-05-29 09:38:21 +00:00
Florian Müllner
06f1303834
drive-menu: Reindent to conform with new style
...
Instead of aligning arguments like we used to do, use a consistent
four-space indent as mandated by gjs' current style guide.
https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/66
2019-05-22 20:40:18 +02:00
Florian Müllner
1f1f9664a6
cleanup: Share unmount/eject arugments
...
Besides the callback, eject and unmount share the same arguments.
Make this explicit by sharing the common arguments between branches.
https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/60
2019-03-04 19:35:10 +01:00
Florian Müllner
d83d6e857a
style: Use single-quotes for translated strings
...
The coding style of using double quotes for translatable strings
and single quotes otherwise is unnecessarily complex and cannot
be enforced with an eslint rule.
Simply use single quotes consistently for all strings.
https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/57
2019-02-28 23:29:31 +01:00
Florian Müllner
db35d7ae7c
style: Change indentation style of object literals
...
Instead of keeping the first property on the same line as the opening
brace and aligning the properties, use a four-space indent. This brings
us closer to gjs' coding style, and as a bonus helps keeping lines in
the soft 80 character limit.
https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/57
2019-02-28 23:29:24 +01:00
Florian Müllner
0d41643866
cleanup: Use destructuring for imports from GI
...
This is *much* nicer than repetitive "imports.gi" lines ...
https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/54
2019-02-16 00:49:44 +01:00
Florian Müllner
bab4be1a59
extensions: Drop Convenience library
...
Its methods are now provided by gnome-shell itself and can be used
as an easy drop-in replacement.
https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/44
2019-02-06 20:17:59 +01:00
Florian Müllner
3861ffae31
extensions: Mark exported symbols
...
eslint obviously doesn't know about gnome-shell's extension API, so
the various entry points trigger unused-variable errors. To fix,
explicitly mark those symbols as exported.
https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/50
2019-01-28 06:51:20 +01:00
Florian Müllner
1be7061da0
style: Fix stray/missing spaces
...
Spotted by eslint.
https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/49
2019-01-28 06:37:28 +01:00
Florian Müllner
f75d1d75af
style: Fix stray/missing semi-colons
...
Spotted by eslint.
https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/49
2019-01-28 06:37:28 +01:00
Florian Müllner
67f9e4c419
style: Use space after catch
...
We currently use a consistent style of not adding spaces in catch
clauses, however that's inconsistent with the style we use for any
other statement. There's not really a good reason to stick with it,
so switch to the style gjs/eslint default to.
https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/49
2019-01-28 06:37:28 +01:00
Florian Müllner
a317d75f70
cleanups: Clean up unused imports
...
Spotted by eslint.
https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/49
2019-01-28 06:37:28 +01:00
Florian Müllner
ee85839d60
drive-menu: Don't override ClutterActor.destroy()
...
Now that PanelMenu.Button was made an StWidget subclass, the destroy()
method actually maps to the ClutterActor method, and overriding it
results in warnings when the extension is disabled. So instead, use
the existing ::destroy handler.
https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/113
2018-11-12 23:42:06 +00:00
Florian Müllner
d9932b8f55
drive-menu: Stop using compatibility actor property
...
PanelMenu.Button sets up a `this.actor = this` property for compatibility,
but let's reflect the actual new object hierarchy.
https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/113
2018-11-12 23:42:06 +00:00
Florian Müllner
efa882080f
drive-menu: Adjust to gnome-shell changes
...
PanelMenu.Button is now a GObject subclass, so initialization must
happen in _init() rather than constructor().
https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/113
2018-11-12 23:42:06 +00:00
Florian Müllner
f59ab1272d
drive-menu: Disconnect volume monitor signals
...
The handler IDs were renamed at some point, resulting in the signals
not being disconnected on disable.
2018-05-10 18:56:23 +02:00
Florian Müllner
ba27cc4a64
cleanup: Get rid of Lang.bind()
...
After replacing Lang.Class with ES6 classes and adopting arrow notation
for anonymous callbacks, we only use the Lang module to bind `this` to
named callbacks. However since ES5, this functionality is already provided
by Function.prototype.bind() - in fact, Lang.bind() itself uses it when
no extra arguments are specified.
So just use the built-in function directly instead of the wrapper.
Fixes https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/30
2017-12-01 20:50:52 +01:00
Florian Müllner
48399d46c0
cleanup: Port non-GObject classes to ES6 classes
...
ES6 finally adds standard class syntax to the language, so we can
replace our custom Lang.Class framework with the new syntax. Any
classes that inherit from GObject will need special treatment,
so limit the port to regular javascript classes for now.
Fixes https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/30
2017-12-01 20:50:46 +01:00
Florian Müllner
30e7ff5a8f
cleanup: Use method syntax
...
Modern javascript has a short-hand for function properties, embrace
it for better readability and to prepare for porting to ES6 classes.
Fixes https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/30
2017-12-01 20:50:28 +01:00
Florian Müllner
968ae427f1
cleanup: Use arrow-notation for anonymous functions
...
Arrow notation is great, but as we only started using it recently,
we currently have a wild mix of Lang.bind(), function() and () => {}.
To make the style consistent again, change all anonymous functions
to arrow notation.
Fixes https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/30
2017-12-01 20:40:32 +01:00
Florian Müllner
4ee30a5445
cleanup: Replace tabs with spaces
...
Fixes https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/30
2017-12-01 20:38:38 +01:00
Florian Müllner
ba38019049
build: Remove autotools support
...
Complete the switch to meson and drop autotools support ...
Fixes https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/31
2017-12-01 17:43:21 +01:00
Florian Müllner
3ab01aebec
build: Support the meson build system
...
Meson is on track to replace autotools as the build system of choice,
so support it in addition to autotools.
Fixes https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/31
2017-12-01 17:41:04 +01:00
Piotr Drąg
71ba8b04d7
drive-menu: Add a translator comment explaining a variable
...
https://bugzilla.gnome.org/show_bug.cgi?id=687590
2017-08-03 14:06:26 +02:00
Florian Müllner
c5da5cf9b5
drive-menu: Fix launch-nautilus label
...
The user-visible name of nautilus is "Files", not "File" ...
https://bugzilla.gnome.org/show_bug.cgi?id=781235
2017-05-09 19:30:52 +02:00
Piotr Drąg
5ad82d05f9
Use Unicode in translatable strings
...
See https://developer.gnome.org/hig/stable/typography.html
https://bugzilla.gnome.org/show_bug.cgi?id=772211
2017-02-16 02:20:03 +01:00
Florian Müllner
5e9f66f3d1
Use a proper arrows instead of UTF8
...
All proper shell menus were updated to do that a while ago, we
should do the same for consistency.
https://bugzilla.gnome.org/show_bug.cgi?id=745909
2015-03-10 19:56:41 +01:00
Florian Müllner
4da36684ad
drive-menu: Adjust for renamed .desktop file name
...
Nautilus now uses reverse domain notation for its .desktop file,
adjust for that.
https://bugzilla.gnome.org/show_bug.cgi?id=739931
2014-11-12 19:53:13 +01:00
Florian Müllner
109bdd1cd0
drive-menu: Update for gnome-shell changes
...
Since shell commit 3227d4f3edad, Shell.Global.create_app_launch_context()
expects additional parameters.
2014-11-12 19:51:33 +01:00
Giovanni Campagna
a519c9fe91
drive-menu: fix interesting check
...
In case of shadowed mounts, mounts can become uninteresting
after they are added, according to whether our handler or gvfs
runs first, so we need to watch for changes. The easiest way
is to create an item for all mounts, and only show the interesting
ones.
2014-02-05 01:00:35 +01:00