Changeset 5100


Ignore:
Timestamp:
Feb 24, 2008, 3:42:31 PM (14 years ago)
Author:
charles
Message:

(gtk) added optional libnotify support to gtk client. (wereHamster, charles)

Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/configure.ac

    r5051 r5100  
    1414GTK_MINIMUM=2.6.0
    1515WX_MINIMUM=2.6.0
     16LIBNOTIFY_MINIMUM=0.4.4
    1617AC_SUBST(GLIB_MINIMUM)
    1718AC_SUBST(GTK_MINIMUM)
    1819AC_SUBST(WX_MINIMUM)
     20AC_SUBST(LIBNOTIFY_MINIMUM)
    1921
    2022AC_PROG_CC
     
    9395AC_SUBST(GTK_CFLAGS)
    9496
     97PKG_CHECK_MODULES([LIBNOTIFY],
     98                  [libnotify >= $LIBNOTIFY_MINIMUM],
     99                  [use_libnotify=yes],
     100                  [use_libnotify=no])
     101AC_SUBST(LIBNOTIFY_LIBS)
     102AC_SUBST(LIBNOTIFY_CFLAGS)
     103if test "x$use_libnotify" = "xyes"; then
     104    AC_DEFINE([HAVE_LIBNOTIFY], 1)
     105fi
     106
    95107IT_PROG_INTLTOOL([0.23],[no-xml])
    96108GETTEXT_PACKAGE=transmission
     
    265277        Build BeOS client:          ${build_beos}
    266278        Build GTK+ client:          ${build_gtk}
     279          ... libnotify support:    ${use_libnotify}
    267280        Build OS X client:          ${build_darwin}
    268281        Build wxWidgets client:     ${build_wx}
  • trunk/gtk/Makefile.am

    r5064 r5100  
    1010    $(GTK_CFLAGS) \
    1111    $(OPENSSL_CFLAGS) \
    12     $(PTHREAD_CFLAGS)
     12    $(PTHREAD_CFLAGS) \
     13    $(LIBNOTIFY_CFLAGS)
    1314
    1415noinst_HEADERS = \
     
    5152    makemeta-ui.c \
    5253    msgwin.c \
     54    notify.c \
    5355    open-dialog.c \
    5456    sexy-icon-entry.c \
     
    7072    $(top_builddir)/third-party/libnatpmp/libnatpmp.a \
    7173    $(GTK_LIBS) \
     74    $(LIBNOTIFY_LIBS) \
    7275    $(OPENSSL_LIBS) \
    7376    $(PTHREAD_LIBS) -lm
  • trunk/gtk/main.c

    r5073 r5100  
    4848#include "makemeta-ui.h"
    4949#include "msgwin.h"
     50#include "notify.h"
    5051#include "open-dialog.h"
    5152#include "stats.h"
     
    268269    }
    269270
     271    tr_notify_init( );
     272
    270273    didinit = cf_init( tr_getPrefsDirectory(), NULL ); /* must come before actions_init */
    271274    tr_prefs_init_global( );
  • trunk/gtk/tr_torrent.c

    r5066 r5100  
    3535#include "tr_torrent.h"
    3636#include "conf.h"
     37#include "notify.h"
    3738#include "util.h"
    3839
     
    162163}
    163164
     165
     166static gboolean
     167notifyInMainThread( gpointer user_data )
     168{
     169g_message( "calling tr_notify_send on %p", user_data );
     170    tr_notify_send( TR_TORRENT( user_data ) );
     171    return FALSE;
     172}
     173static void
     174statusChangedCallback( tr_torrent   * tor UNUSED,
     175                       cp_status_t    status,
     176                       void         * user_data )
     177{
     178g_message( "status changed! new status is %d, user_data is %p", status, user_data );
     179    if( status == TR_CP_COMPLETE )
     180        g_idle_add( notifyInMainThread, user_data );
     181}
    164182static TrTorrent *
    165183maketorrent( tr_torrent * handle )
     
    167185    TrTorrent * tor = g_object_new( TR_TORRENT_TYPE, NULL );
    168186    tor->priv->handle = handle;
     187    tr_torrentSetStatusCallback( handle, statusChangedCallback, tor );
    169188    return tor;
    170189}
  • trunk/transmission.spec.in

    r4755 r5100  
    1515BuildRequires: glib2-devel >= @GLIB_REQUIRED@
    1616BuildRequires: gtk2-devel >= @GTK_REQUIRED@
     17BuildRequires: libnotify-devel >= @LIBNOTIFY_REQUIRED@
    1718
    1819Requires: glib2 >= @GLIB_REQUIRED@
    1920Requires: gtk2 >= @GTK_REQUIRED@
     21Requires: libnotify >= @LIBNOTIFY_REQUIRED@
    2022
    2123Provides: %{name}
Note: See TracChangeset for help on using the changeset viewer.