Changeset 6559 for trunk/gtk/util.c


Ignore:
Timestamp:
Aug 17, 2008, 12:39:26 PM (13 years ago)
Author:
muks
Message:

Don't show an error when transmission is run twice

Instead, present the main window. This commit also auto-generates
the dbus bindings.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gtk/util.c

    r6516 r6559  
    501501}
    502502
     503gboolean
     504gtr_dbus_present_window()
     505{
     506    static gboolean success = FALSE;
     507#ifdef HAVE_DBUS_GLIB
     508    DBusGProxy * proxy = NULL;
     509    GError * err = NULL;
     510    DBusGConnection * conn;
     511    if(( conn = dbus_g_bus_get( DBUS_BUS_SESSION, &err )))
     512        proxy = dbus_g_proxy_new_for_name (conn, VALUE_SERVICE_NAME,
     513                                                 VALUE_SERVICE_OBJECT_PATH,
     514                                                 VALUE_SERVICE_INTERFACE );
     515    else if( err )
     516       g_message( "err: %s", err->message );
     517    if( proxy )
     518        dbus_g_proxy_call( proxy, "PresentWindow", &err,
     519                           G_TYPE_INVALID,
     520                           G_TYPE_BOOLEAN, &success,
     521                           G_TYPE_INVALID );
     522    if( err )
     523       g_message( "err: %s", err->message );
     524
     525    g_object_unref( proxy );
     526    dbus_g_connection_unref( conn );
     527#endif
     528    return success;
     529}
     530
    503531GtkWidget *
    504532tr_button_new_from_stock( const char * stock,
Note: See TracChangeset for help on using the changeset viewer.