Move the join chat menu item to the new menu setup

Wed, 01 Apr 2020 13:08:57 -0500

author
Gary Kramlich <grim@reaperworld.com>
date
Wed, 01 Apr 2020 13:08:57 -0500
changeset 40378
9713b0ef6504
parent 40377
be51a9f44cea
child 40379
c50c509dd028

Move the join chat menu item to the new menu setup

pidgin/gtkblist.c file | annotate | diff | comparison | revisions
pidgin/pidginactiongroup.c file | annotate | diff | comparison | revisions
pidgin/pidginactiongroup.h file | annotate | diff | comparison | revisions
--- a/pidgin/gtkblist.c	Tue Mar 31 23:54:24 2020 -0500
+++ b/pidgin/gtkblist.c	Wed Apr 01 13:08:57 2020 -0500
@@ -3521,10 +3521,6 @@
 static const GtkActionEntry blist_menu_entries[] = {
 /* NOTE: Do not set any accelerator to Control+O. It is mapped by
    gtk_blist_key_press_cb to "Get User Info" on the selected buddy. */
-	/* Buddies menu */
-	{ "BuddiesMenu", NULL, N_("_Buddies"), NULL, NULL, NULL },
-	{ "JoinAChat", PIDGIN_STOCK_CHAT, N_("Join a _Chat..."), "<control>C", NULL, pidgin_blist_joinchat_show },
-
 	/* Accounts menu */
 	{ "AccountsMenu", NULL, N_("_Accounts"), NULL, NULL, NULL },
 
@@ -3536,9 +3532,6 @@
 static const char *blist_menu =
 "<ui>"
 	"<menubar name='BList'>"
-		"<menu action='BuddiesMenu'>"
-			"<menuitem action='JoinAChat'/>"
-		"</menu>"
 		"<menu action='AccountsMenu'>"
 		"</menu>"
 		"<menu action='ToolsMenu'>"
@@ -4346,13 +4339,7 @@
 
 static const char *require_connection[] =
 {
-	"/BList/BuddiesMenu/NewInstantMessage",
 	"/BList/BuddiesMenu/JoinAChat",
-	"/BList/BuddiesMenu/GetUserInfo",
-	"/BList/BuddiesMenu/AddBuddy",
-	"/BList/BuddiesMenu/AddChat",
-	"/BList/BuddiesMenu/AddGroup",
-	"/BList/ToolsMenu/Privacy",
 };
 
 static const int require_connection_size = sizeof(require_connection)
--- a/pidgin/pidginactiongroup.c	Tue Mar 31 23:54:24 2020 -0500
+++ b/pidgin/pidginactiongroup.c	Wed Apr 01 13:08:57 2020 -0500
@@ -27,6 +27,7 @@
 #include "internal.h"
 
 #include "pidgin/gtkaccount.h"
+#include "pidgin/gtkblist.h"
 #include "pidgin/gtkdialogs.h"
 #include "pidgin/gtkpounce.h"
 #include "pidgin/gtkprefs.h"
@@ -52,7 +53,7 @@
  */
 static const gchar *pidgin_action_group_online_actions[] = {
 	PIDGIN_ACTION_NEW_MESSAGE,
-	// PIDGIN_ACTION_JOIN_CHAT,
+	PIDGIN_ACTION_JOIN_CHAT,
 	PIDGIN_ACTION_GET_USER_INFO,
 	PIDGIN_ACTION_ADD_BUDDY,
 	PIDGIN_ACTION_ADD_CHAT,
@@ -400,6 +401,13 @@
 }
 
 static void
+pidgin_action_group_join_chat(GSimpleAction *simple, GVariant *parameter,
+                              gpointer data)
+{
+	pidgin_blist_joinchat_show();
+}
+
+static void
 pidgin_action_group_manage_accounts(GSimpleAction *simple, GVariant *parameter,
                                     gpointer data)
 {
@@ -559,6 +567,9 @@
 			.name = PIDGIN_ACTION_GET_USER_INFO,
 			.activate = pidgin_action_group_get_user_info,
 		}, {
+			.name = PIDGIN_ACTION_JOIN_CHAT,
+			.activate = pidgin_action_group_join_chat,
+		}, {
 			.name = PIDGIN_ACTION_MANAGE_ACCOUNTS,
 			.activate = pidgin_action_group_manage_accounts,
 		}, {
--- a/pidgin/pidginactiongroup.h	Tue Mar 31 23:54:24 2020 -0500
+++ b/pidgin/pidginactiongroup.h	Wed Apr 01 13:08:57 2020 -0500
@@ -91,11 +91,18 @@
 /**
  * PIDGIN_ACTION_GET_USER_INFO:
  *
- * A constant that represents the get-user info action.
+ * A constant that represents the get-user-info action.
  */
 #define PIDGIN_ACTION_GET_USER_INFO ("get-user-info")
 
 /**
+ * PIDGIN_ACTION_JOIN_CHAT:
+ *
+ * A constant that represents the join-chat action.
+ */
+#define PIDGIN_ACTION_JOIN_CHAT ("join-chat")
+
+/**
  * PIDGIN_ACTION_MANAGE_ACCOUNTS:
  *
  * A constatnt that represents the manage-accounts action to displays the

mercurial