1
0
mirror of https://github.com/moparisthebest/hexchat synced 2024-10-31 15:35:03 -04:00
This commit is contained in:
Richard Hitt 2013-06-15 17:26:13 -07:00
commit 6a7557da01
9 changed files with 50 additions and 23 deletions

View File

@ -7,4 +7,8 @@ script:
- ./autogen.sh - ./autogen.sh
- ./configure --enable-textfe - ./configure --enable-textfe
- make - make
notifications:
irc:
channels: "chat.freenode.net#hexchat-devel"
template: "Build #%{build_number} (%{commit}) by %{author}: %{message}"
on_success: change

View File

@ -189,9 +189,10 @@ if test "$glib" = no; then
AC_MSG_ERROR(Cannot find GLib!) AC_MSG_ERROR(Cannot find GLib!)
fi fi
COMMON_CFLAGS="$GLIB_CFLAGS -DG_DISABLE_SINGLE_INCLUDES" PKG_CHECK_MODULES([GOBJECT], [gobject-2.0], [], [AC_MSG_ERROR(Cannot find gobject-2.0!)])
COMMON_LIBS="$GLIB_LIBS"
COMMON_LIBS="$COMMON_LIBS -lgmodule-2.0 -lgobject-2.0" COMMON_CFLAGS="$GLIB_CFLAGS $GOBJECT_CFLAGS -DG_DISABLE_SINGLE_INCLUDES"
COMMON_LIBS="$GLIB_LIBS $GOBJECT_LIBS"
dnl ********************************************************************* dnl *********************************************************************
dnl ** GTK ************************************************************** dnl ** GTK **************************************************************

View File

@ -1826,7 +1826,7 @@ hexchat_pluginpref_set_int (hexchat_plugin *pl, const char *var, int value)
{ {
char buffer[12]; char buffer[12];
sprintf (buffer, "%d", value); snprintf (buffer, sizeof (buffer), "%d", value);
return hexchat_pluginpref_set_str_real (pl, var, buffer, 1); return hexchat_pluginpref_set_str_real (pl, var, buffer, 1);
} }

View File

@ -58,6 +58,9 @@ struct pevt_stage1
struct pevt_stage1 *next; struct pevt_stage1 *next;
}; };
#ifdef USE_LIBCANBERRA
static ca_context *ca_con;
#endif
static void mkdir_p (char *filename); static void mkdir_p (char *filename);
static char *log_create_filename (char *channame); static char *log_create_filename (char *channame);
@ -2209,9 +2212,6 @@ sound_play (const char *file, gboolean quiet)
char *wavfile; char *wavfile;
#ifndef WIN32 #ifndef WIN32
char *cmd; char *cmd;
#ifdef USE_LIBCANBERRA
ca_context *con;
#endif
#endif #endif
/* the pevents GUI editor triggers this after removing a soundfile */ /* the pevents GUI editor triggers this after removing a soundfile */
@ -2240,9 +2240,16 @@ sound_play (const char *file, gboolean quiet)
PlaySound (wavfile, NULL, SND_NODEFAULT|SND_FILENAME|SND_ASYNC); PlaySound (wavfile, NULL, SND_NODEFAULT|SND_FILENAME|SND_ASYNC);
#else #else
#ifdef USE_LIBCANBERRA #ifdef USE_LIBCANBERRA
ca_context_create (&con); if (ca_con == NULL)
/* TODO: Volume setting? */ {
if (ca_context_play (con, 0, CA_PROP_MEDIA_FILENAME, wavfile, NULL) != 0) ca_context_create (&ca_con);
ca_context_change_props (ca_con,
CA_PROP_APPLICATION_ID, "hexchat",
CA_PROP_APPLICATION_NAME, "HexChat",
CA_PROP_APPLICATION_ICON_NAME, "hexchat", NULL);
}
if (ca_context_play (ca_con, 0, CA_PROP_MEDIA_FILENAME, wavfile, NULL) != 0)
#endif #endif
{ {
cmd = g_find_program_in_path ("play"); cmd = g_find_program_in_path ("play");

View File

@ -629,7 +629,7 @@ chanlist_button_cb (GtkTreeView *tree, GdkEventButton *event, server *serv)
chanlist_copytopic, serv); chanlist_copytopic, serv);
chan = chanlist_get_selected (serv, FALSE); chan = chanlist_get_selected (serv, FALSE);
menu_addfavoritemenu (serv, menu, chan); menu_addfavoritemenu (serv, menu, chan, FALSE);
g_free (chan); g_free (chan);
gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL, 0, event->time); gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL, 0, event->time);

View File

@ -62,6 +62,9 @@
GdkPixmap *channelwin_pix; GdkPixmap *channelwin_pix;
#ifdef USE_LIBCANBERRA
static ca_context *ca_con;
#endif
#ifdef USE_XLIB #ifdef USE_XLIB
@ -674,11 +677,16 @@ fe_beep (session *sess)
} }
#else #else
#ifdef USE_LIBCANBERRA #ifdef USE_LIBCANBERRA
ca_context *con; if (ca_con == NULL)
ca_context_create (&con); {
if (ca_context_play (con, 0, ca_context_create (&ca_con);
CA_PROP_APPLICATION_NAME, DISPLAY_NAME, ca_context_change_props (ca_con,
CA_PROP_EVENT_ID, "message-new-instant", NULL) != 0) CA_PROP_APPLICATION_ID, "hexchat",
CA_PROP_APPLICATION_NAME, DISPLAY_NAME,
CA_PROP_APPLICATION_ICON_NAME, "hexchat", NULL);
}
if (ca_context_play (ca_con, 0, CA_PROP_EVENT_ID, "message-new-instant", NULL) != 0)
#endif #endif
gdk_beep (); gdk_beep ();
#endif #endif

View File

@ -1617,7 +1617,7 @@ mg_create_tabmenu (session *sess, GdkEventButton *event, chan *ch)
menu_quick_item (0, 0, menu, XCMENU_SHADED, 0, 0); menu_quick_item (0, 0, menu, XCMENU_SHADED, 0, 0);
if (sess->type == SESS_CHANNEL) if (sess->type == SESS_CHANNEL)
menu_addfavoritemenu (sess->server, menu, sess->channel); menu_addfavoritemenu (sess->server, menu, sess->channel, TRUE);
else if (sess->type == SESS_SERVER) else if (sess->type == SESS_SERVER)
menu_addconnectmenu (sess->server, menu); menu_addconnectmenu (sess->server, menu);
} }

View File

@ -1016,7 +1016,7 @@ menu_chanmenu (struct session *sess, GdkEventButton * event, char *chan)
str_copy); str_copy);
} }
menu_addfavoritemenu (sess->server, menu, str_copy); menu_addfavoritemenu (sess->server, menu, str_copy, FALSE);
menu_add_plugin_items (menu, "\x5$CHAN", str_copy); menu_add_plugin_items (menu, "\x5$CHAN", str_copy);
menu_popup (menu, event, NULL); menu_popup (menu, event, NULL);
@ -1035,8 +1035,10 @@ menu_addfav_cb (GtkWidget *item, server *serv)
} }
void void
menu_addfavoritemenu (server *serv, GtkWidget *menu, char *channel) menu_addfavoritemenu (server *serv, GtkWidget *menu, char *channel, gboolean istree)
{ {
char *str;
if (!serv->network) if (!serv->network)
return; return;
@ -1046,14 +1048,19 @@ menu_addfavoritemenu (server *serv, GtkWidget *menu, char *channel)
free (str_copy); free (str_copy);
str_copy = strdup (channel); str_copy = strdup (channel);
} }
if (istree)
str = _("_Autojoin");
else
str = _("Autojoin Channel");
if (joinlist_is_in_list (serv, channel)) if (joinlist_is_in_list (serv, channel))
{ {
menu_toggle_item (_("_Autojoin"), menu, menu_delfav_cb, serv, TRUE); menu_toggle_item (str, menu, menu_delfav_cb, serv, TRUE);
} }
else else
{ {
menu_toggle_item (_("_Autojoin"), menu, menu_addfav_cb, serv, FALSE); menu_toggle_item (str, menu, menu_addfav_cb, serv, FALSE);
} }
} }

View File

@ -23,7 +23,7 @@
GtkWidget *menu_create_main (void *accel_group, int bar, int away, int toplevel, GtkWidget **menu_widgets); GtkWidget *menu_create_main (void *accel_group, int bar, int away, int toplevel, GtkWidget **menu_widgets);
void menu_urlmenu (GdkEventButton * event, char *url); void menu_urlmenu (GdkEventButton * event, char *url);
void menu_chanmenu (session *sess, GdkEventButton * event, char *chan); void menu_chanmenu (session *sess, GdkEventButton * event, char *chan);
void menu_addfavoritemenu (server *serv, GtkWidget *menu, char *channel); void menu_addfavoritemenu (server *serv, GtkWidget *menu, char *channel, gboolean istree);
void menu_addconnectmenu (server *serv, GtkWidget *menu); void menu_addconnectmenu (server *serv, GtkWidget *menu);
void menu_nickmenu (session *sess, GdkEventButton * event, char *nick, int num_sel); void menu_nickmenu (session *sess, GdkEventButton * event, char *nick, int num_sel);
void menu_middlemenu (session *sess, GdkEventButton *event); void menu_middlemenu (session *sess, GdkEventButton *event);