Commit Graph

131 Commits

Author SHA1 Message Date
Florian Müllner
f59acb55c1 gdesktopappinfo: Use "Keywords" instead of "X-GNOME-Keywords"
The field has now been standardized, so drop the prefix.
2011-12-19 15:26:30 +01:00
Matthias Clasen
5896808e8c GIO: Don't use G_DISABLE_DEPRECATED for functions 2011-11-03 00:16:41 -04:00
Cosimo Cecchi
3569af4af1 desktop-app-info: annotate g_desktop_app_info_get_keywords()
https://bugzilla.gnome.org/show_bug.cgi?id=662096
2011-10-19 17:27:21 -04:00
Dan Winship
de834bed30 GAppLaunchContext: add environment-manipulating functions
Add functions for manipulating the environment under which a
GAppLaunchContext will launch its children, to avoid thread-related
bugs with using setenv() directly.

FIXME: win32 side isn't implemented yet

https://bugzilla.gnome.org/show_bug.cgi?id=659326
2011-10-15 17:30:55 -04:00
Florian Müllner
1ed88f0615 desktop-app-info: Add support for X-GNOME-Keywords
With search gaining traction as being the preferred way to locate
applications, the existing .desktop file fields meant for browsing
often produce insufficient results.
gnome-control-center introduced a custom X-GNOME-Keywords field for
that purpose, which we plan to support in gnome-shell as well.

https://bugzilla.gnome.org/show_bug.cgi?id=661763
2011-10-14 23:30:21 +02:00
Matthias Clasen
5156d1b2d4 Prevent data loss in gdesktopappinfo.c
Don't loose the content of mimeapps.list when it doesn't contain
a [Added Associations] group. Pointed out by Alexander Larsson.

https://bugzilla.gnome.org/show_bug.cgi?id=660130
2011-09-29 23:42:58 -04:00
Ryan Lortie
104ea17125 GDesktopAppInfo: simplify how defaults work
Previously, we took the default application for a particular mimetype
from the system and copied it into the user's configuration as the
default there.

Instead of doing that we leave the user's default unset, and at time of
use, if the user has no explicitly-set default value, we use the system
default.

This avoids complicated situations where inappropriate applications were
being set as the default in the user's configuration.

https://bugzilla.gnome.org/show_bug.cgi?id=658188
2011-09-26 16:54:24 -04:00
Matthias Clasen
2d44a45b6b GDesktopAppInfo: Improve docs 2011-09-12 01:56:45 -04:00
Matthias Clasen
05342d0a93 Fix formatting in a doc comment 2011-09-12 01:49:01 -04:00
Matthias Clasen
75c989b9ab Revert "Fix default setting generation in g_desktop_app_info_set_as_last_used"
This reverts commit a13f5ca4da.
2011-09-11 23:28:45 -04:00
Josselin Mouette
a13f5ca4da Fix default setting generation in g_desktop_app_info_set_as_last_used
* Do not ignore the system default
 * Do not exclude the last used being set from the default list

This fixes the default applications dialog in control-center.

https://bugzilla.gnome.org/show_bug.cgi?id=658188
2011-09-10 08:26:12 +02:00
Matthias Clasen
e5653c0050 Keep up with the standards
More choices, always better.
2011-09-09 20:37:09 -04:00
Bastien Nocera
229234111c gio: Error out when we cannot modify a GAppInfo
g_desktop_app_info_set_as_default_for_type() and
g_desktop_app_info_set_as_last_used_for_type () require the
application's ID, but depending on how the GAppInfo was created,
we might not be have one, and would thus silently fail to set
the default application, or last used application.

https://bugzilla.gnome.org/show_bug.cgi?id=657445
2011-08-30 15:55:02 +01:00
Matthias Clasen
1b28408b8b Spelling fixes
Spelling fixes in comments and docs, provided by
Kjartan Maraas in bug 657336.
2011-08-29 14:49:32 -04:00
Vincent Untz
ae7c48b955 GDesktopAppInfo: Add g_desktop_app_info_get_show_in()
Necessary for rebasing gnome-menus on top of GDesktopAppInfo.

https://bugzilla.gnome.org/show_bug.cgi?id=655044
2011-07-23 10:05:12 +02:00
Vincent Untz
b87d9405be GDesktopAppInfo: Fix declaration of g_desktop_app_info_get_nodisplay 2011-06-14 09:01:25 +02:00
Vincent Untz
86ffdf5570 GDesktopAppInfo: Add g_desktop_app_info_get_nodisplay
Necessary for rebasing gnome-menus on top of GDesktopAppInfo.

https://bugzilla.gnome.org/show_bug.cgi?id=652385
2011-06-14 08:53:48 +02:00
Matthias Clasen
f4cff2b923 Some documentation additions 2011-05-01 23:02:53 -04:00
Colin Walters
4098ddcb06 GDesktopAppInfo: Add g_desktop_app_info_get_generic_name
Necessary for rebasing gnome-menus on top of GDesktopAppInfo.

https://bugzilla.gnome.org/show_bug.cgi?id=647967
2011-04-27 11:34:43 -04:00
Colin Walters
276e6a7be8 GDesktopAppInfo: Add g_desktop_app_info_get_categories()
This is needed to rebase gnome-menus on top of GDesktopAppInfo.

https://bugzilla.gnome.org/show_bug.cgi?id=647903
2011-04-27 11:24:37 -04:00
Colin Walters
2a3f7f49b4 GDesktopAppInfo: Add "filename" property for bindings
GDesktopAppInfo violates the GObject rule that your C constructors
should just be thin wrappers around g_object_new().  While GKeyFile
isn't introspctable, this patch allows from JavaScript:

var app = new Gio.DesktopAppInfo({ filename: '/path/to/foo.desktop' });

https://bugzilla.gnome.org/show_bug.cgi?id=648425
2011-04-26 15:08:54 -04:00
Michael Terry
a330c2f19f Don't ignore SUPPORTS_STARTUP_NOTIFICATION for commandline GAppInfos
https://bugzilla.gnome.org/show_bug.cgi?id=648416
2011-04-25 08:34:13 -04:00
Vincent Untz
f909469e31 appinfo: Do not override system default handler with less specific one
We were considering explicitly configured defaults for parent types
after we already got results for the specific type we're interested in.

This resulted in the explicit default for text/plain to override all
system defaults for subtypes of text/plain, for example. The explicit
default should not apply to subtypes that have a system default.

https://bugzilla.gnome.org/show_bug.cgi?id=642797
2011-02-20 16:06:40 +01:00
Colin Walters
a7faf0b16e gdesktopappinfo: Handle g_get_prgname() being NULL
Reported-By: Sebastien Bacher <seb128@ubuntu.com>

https://bugzilla.gnome.org/show_bug.cgi?id=642490
2011-02-16 13:49:20 -05:00
Michal Hruby
d43b2d52b4 Add more data about origin application to the "Launched" signal.
This will help applications such as zeitgeist's datahub to collect
more complete information about application launches, as the "actor"
of a launch is important for zeitgeist's magic to work properly.
2011-02-07 23:39:07 -05:00
Colin Walters
d6954c785d gdesktopappinfo: Asynchronously flush after sending notification
If we were the initial connection owner, unref will destroy the
connection immediately, and we may lose messages.  Asynchronously
flush to avoid that.

https://bugzilla.gnome.org/show_bug.cgi?id=641411
2011-02-07 23:37:14 -05:00
Colin Walters
e738a8dd8c gdesktopappinfo: Don't crash if we don't have a desktop filename
If code creates a GDesktopAppInfo via g_desktop_app_info_new_from_keyfile(),
we'd try to send a NULL pointer down into GVariant.

Since in this case we don't have a filename, just send the empty
string.  In the future we should either:

1) Change panel to use g_desktop_app_info_new_from_filename(), and
   take the hit of parsing the file twice.
2) Add a g_key_file_get_origin_filename()
3) Add g_desktop_app_info_new_from_keyfile_and_name()

https://bugzilla.gnome.org/show_bug.cgi?id=638838
2011-01-06 13:32:56 -05:00
Pavel Holejsovsky
b497220e48 Fix GI annotation for g_desktop_app_info_launch_uris_as_manager 2011-01-05 20:35:50 +01:00
Colin Walters
e6546debd6 gdesktopappinfo: Add g_desktop_app_info_launch_uris_as_manager()
A new GDesktopAppInfo specific function which provides more control
over launched processes.  Intended basically only for use in GNOME
Shell, where we want:

*) To directly know the GPid for each launched program, without
   having to listen to a DBus signal emitted in our own process
*) Possibly control over the process environment; for example,
   we may want to call setsid() or redirect file descriptors.

And in the future:
*) To avoid recursively calling ourself via DBus, when a later
   patch causes g_app_info_launch() to indirect via the shell.

https://bugzilla.gnome.org/show_bug.cgi?id=606960
2011-01-05 11:58:07 -05:00
Colin Walters
bb6c44b9d3 gdesktopappinfo: Send out a session bus signal when launching .desktop file
This signal contains the full path of the .desktop file, along with
the process id, which allows multiple interested components (like
GNOME Shell) to better know the state of the system (which processes
correspond to which .desktop files).

https://bugzilla.gnome.org/show_bug.cgi?id=606960
2011-01-05 11:58:03 -05:00
Pavel Holejsovsky
1f84c5b72f Add GI annotations to GAppInfo and GDesktopAppInfo 2010-12-27 15:40:07 +01:00
Cosimo Cecchi
6a10591573 appinfo: avoid overriding the system defaults when adding support
We want to be compatible with the following situation:
- there's no explicit default set in mimeapps.list
- we add support for a content type to a specific application, and that
  list is empty
- the default should be picked from the system list, not overridden by
  the user-added application.

So we make the default explicit in this case, by adding it to the
relevant section in mimeapps.list.

https://bugzilla.gnome.org/show_bug.cgi?id=637675
2010-12-20 18:19:13 +01:00
Cosimo Cecchi
678bcad92c appinfo: add g_app_info_set_as_last_used_for_type()
This commit also changes (maintaining compatibility) the way
user-specified default applications are stored (as in, those for which
g_app_info_set_as_default_for_type() has been called.

We now store the default application for a content type in a new group
in the mimeapps.list keyfile, and "Added Associations" tracks only the
applications that have been added by the user, following a
most-recently-used first order.

This is useful in GtkAppChooser-like widgets to pre-select the last used
application when constructing a widget.

https://bugzilla.gnome.org/show_bug.cgi?id=636311
2010-12-20 15:43:58 +01:00
Matthias Clasen
eed36d38d1 Various doc tweaks 2010-11-28 23:55:43 -05:00
Matthias Clasen
e5dd266c33 Add Since: tags for new api
Also, remove <!-- --> from things like #GAppInfo<!-- -->s.
gtk-doc learned to deal with this a while ago.
2010-11-24 15:57:40 -05:00
Cosimo Cecchi
30c378032f appinfo: update docs for API addition 2010-11-23 10:29:09 +01:00
Cosimo Cecchi
182fcff2ea appinfo: only rewrite recommended applications when adding non-default
Otherwise you break the fallback + recommended distinction for a content
type, as you end up adding support for a given content type to *all* of
the applications claiming to support the supertype.
2010-11-23 10:29:09 +01:00
Cosimo Cecchi
94c67d8420 appinfo: add API to get fallback and recommended GAppInfos for a ctype
This ways UIs can differentiate between them, and show them in different
section.
- a recommended app is an application that claims to support a content
  type directly, not by a supertype derivation.
- a fallback app is an application that claims to support a supertype of
  a given content type.
2010-11-23 10:29:09 +01:00
Benjamin Otte
fb94859e84 API: Reinstate "gio-desktop-app-info-lookup" extension point
Removing an extension point is an API and ABI break. In particular, it
causes (older) gvfs versions to fail loading with a linkage error from
ld which in turn makes the desktop unusable.
So this reinstate the extension point and API provided by it, but
deprecates and does not use it. So no functionality is changed.

This reverts parts of commit 9b262f1c5f.

Complaints-Also-To: Ryan Lortie <desrt@desrt.ca>
2010-11-09 21:13:04 -05:00
Bastien Nocera
9b262f1c5f Replace "gio-desktop-app-info-lookup" extension point
With a native version, that looks for desktop items supporting
x-scheme-handler/foo, when looking for a handler for the "foo"
URI scheme handler.

https://bugzilla.gnome.org/show_bug.cgi?id=631410
2010-10-05 17:15:37 +01:00
Johan Dahlin
30132c44c1 Add a lot of missing annotations 2010-09-24 18:24:41 -03:00
Johan Dahlin
835f9cb310 [introspection] Move over annotations
Move all the annotations over from gobject-introspection.

They will not be used directly by the introspection scanner for now,
instead they will be extracted by a script and updated manually
until introspection is properly integrated into the glib build
2010-09-24 15:52:38 -03:00
Matthias Clasen
f8e22856c6 Add a GAppInfoCreate flag for startup-notification
Using this flag, it will be possible to launch apps without a
desktop file, in the same way that gdk_spawn_... lets you do.

Requested in bug 599223.
2010-07-10 17:57:45 -04:00
Matthias Clasen
448ac22e80 Fix an oversight in the previous commit 2010-07-08 16:24:44 -04:00
Matthias Clasen
349aab2bd4 A little more correctness in formatting pids
Requested in bug 623772
2010-07-08 15:11:24 -04:00
Matthias Clasen
fcddf9c2a1 Escape arguments when putting together a cmdline
See bug 623770
2010-07-08 14:58:33 -04:00
Ryan Lortie
5b946e0504 gio/: fully remove gioalias hacks 2010-07-07 19:53:22 -04:00
Colin Walters
7c36619d26 [Gio] Merge in introspection annotations from gobject-introspection gio-2.0.c
This is not an exhaustive set, but covers everything we have so far.
2010-06-10 14:03:02 -04:00
Matthias Clasen
6427e93757 Merge the wip/gapplication branch
This adds a GApplication object to GIO, which is the core of
an application support class, supporting
- uniqueness
- exporting actions (simple scripting)
- standard actions (quit, activate)

The implementation for Linux uses D-Bus, takes a name on the
session bus, and exports a org.gtk.Application interface.

Implementations for Win32 and OS X are still missing.
2010-06-07 13:48:42 -04:00
Matthias Clasen
7ca2e00054 Doc improvements
Make sure all unix-specific apis are marked as such.
2010-05-08 23:28:17 -04:00