changeset 18468:8c16685b0fef

merge of '039acbe69fd4ab8680c82186bcbd98185aa10460' and 'e3b6edc11813a7bb0096dae3a0be15e3b979738f'
author Mark Doliner <mark@kingant.net>
date Tue, 10 Jul 2007 05:42:49 +0000
parents 18a81722d6d4 (diff) 934409c222a3 (current diff)
children 436d3c4c9930
files
diffstat 3 files changed, 71 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/blist.h	Tue Jul 10 03:25:56 2007 +0000
+++ b/libpurple/blist.h	Tue Jul 10 05:42:49 2007 +0000
@@ -635,7 +635,7 @@
 /**
  * Finds a group by name
  *
- * @param name    The groups name
+ * @param name    The group's name
  * @return        The group or NULL if the group does not exist
  */
 PurpleGroup *purple_find_group(const char *name);
--- a/pidgin/plugins/win32/transparency/win2ktrans.c	Tue Jul 10 03:25:56 2007 +0000
+++ b/pidgin/plugins/win32/transparency/win2ktrans.c	Tue Jul 10 05:42:49 2007 +0000
@@ -76,15 +76,6 @@
 /*
  *  CODE
  */
-static GtkWidget *wpurple_button(const char *text, const char *pref, GtkWidget *page) {
-	GtkWidget *button;
-	button = gtk_check_button_new_with_mnemonic(text);
-	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button),
-		purple_prefs_get_bool(pref));
-	gtk_box_pack_start(GTK_BOX(page), button, FALSE, FALSE, 0);
-	gtk_widget_show(button);
-	return button;
-}
 
 /* Set window transparency level */
 static void set_wintrans(GtkWidget *window, int alpha, gboolean enabled,
@@ -233,7 +224,8 @@
 		G_CALLBACK(focus_conv_win_cb), window);
 }
 
-static void purple_conversation_delete(PurpleConversation *conv) {
+static void
+conversation_delete_cb(PurpleConversation *conv) {
 	PidginWindow *win = pidgin_conv_get_window(PIDGIN_CONVERSATION(conv));
 	/* If it is the last conversation in the window, cleanup */
 	if (pidgin_conv_window_get_gtkconv_count(win) == 1)
@@ -391,12 +383,35 @@
 		remove_convs_wintrans(FALSE);
 }
 
-static void purple_new_conversation(PurpleConversation *conv) {
+static void
+conv_updated_cb(PurpleConversation *conv, PurpleConvUpdateType type) {
+	PidginConversation *pconv = PIDGIN_CONVERSATION(conv);
+	PidginWindow *win = pidgin_conv_get_window(pconv);
+
+	if (type == PURPLE_CONV_UPDATE_UNSEEN && !pidgin_conv_is_hidden(pconv)
+			&& pconv->unseen_state == PIDGIN_UNSEEN_NONE
+			&& pidgin_conv_window_get_gtkconv_count(win) == 1) {
+		GtkWidget *window = win->window;
+
+		set_conv_window_trans(NULL, win);
+
+		if (g_signal_handler_find(G_OBJECT(window), G_SIGNAL_MATCH_FUNC,
+				0, 0, NULL, G_CALLBACK(focus_conv_win_cb), NULL) == 0) {
+			g_signal_connect(G_OBJECT(window), "focus_in_event",
+				G_CALLBACK(focus_conv_win_cb), window);
+			g_signal_connect(G_OBJECT(window), "focus_out_event",
+				G_CALLBACK(focus_conv_win_cb), window);
+		}
+	}
+}
+
+static void
+new_conversation_cb(PurpleConversation *conv) {
 	PidginWindow *win = pidgin_conv_get_window(PIDGIN_CONVERSATION(conv));
 
 	/* If it is the first conversation in the window,
 	 * add the sliders, and set transparency */
-	if (pidgin_conv_window_get_gtkconv_count(win) == 1) {
+	if (!pidgin_conv_is_hidden(PIDGIN_CONVERSATION(conv)) && pidgin_conv_window_get_gtkconv_count(win) == 1) {
 		GtkWidget *window = win->window;
 
 		set_conv_window_trans(NULL, win);
@@ -408,7 +423,8 @@
 	}
 }
 
-static void blist_created_cb(PurpleBuddyList *purple_blist, gpointer data) {
+static void
+blist_created_cb(PurpleBuddyList *purple_blist, gpointer data) {
 	if (blist) {
 		if (purple_prefs_get_bool(OPT_WINTRANS_BL_ENABLED)) {
 			set_wintrans(blist,
@@ -477,17 +493,21 @@
 
 	purple_signal_connect(purple_conversations_get_handle(),
 		"conversation-created", plugin,
-		PURPLE_CALLBACK(purple_new_conversation), NULL);
+		PURPLE_CALLBACK(new_conversation_cb), NULL);
 
 	/* Set callback to remove window from the list, if the window is destroyed */
 	purple_signal_connect(purple_conversations_get_handle(),
 		"deleting-conversation", plugin,
-		PURPLE_CALLBACK(purple_conversation_delete), NULL);
+		PURPLE_CALLBACK(conversation_delete_cb), NULL);
 
 	purple_signal_connect(pidgin_conversations_get_handle(),
 		"conversation-dragging", plugin,
 		PURPLE_CALLBACK(set_conv_window_trans), NULL);
 
+	purple_signal_connect(purple_conversations_get_handle(),
+		"conversation-updated", plugin,
+		PURPLE_CALLBACK(conv_updated_cb), NULL);
+
 	update_existing_convs();
 
 	if (blist)
@@ -531,7 +551,7 @@
 
 	/* IM Convo trans options */
 	imtransbox = pidgin_make_frame(ret, _("IM Conversation Windows"));
-	button = wpurple_button(_("_IM window transparency"),
+	button = pidgin_prefs_checkbox(_("_IM window transparency"),
 		OPT_WINTRANS_IM_ENABLED, imtransbox);
 	g_signal_connect(GTK_OBJECT(button), "clicked",
 		GTK_SIGNAL_FUNC(update_convs_wintrans),
@@ -545,7 +565,7 @@
 	g_signal_connect(GTK_OBJECT(button), "clicked",
 		GTK_SIGNAL_FUNC(pidgin_toggle_sensitive), trans_box);
 
-	button = wpurple_button(_("_Show slider bar in IM window"),
+	button = pidgin_prefs_checkbox(_("_Show slider bar in IM window"),
 		OPT_WINTRANS_IM_SLIDER, trans_box);
 	g_signal_connect(GTK_OBJECT(button), "clicked",
 		GTK_SIGNAL_FUNC(update_convs_wintrans),
@@ -555,7 +575,7 @@
 		_("Remove IM window transparency on focus"),
 		OPT_WINTRANS_IM_ONFOCUS, trans_box);
 
-	button = wpurple_button(_("Always on top"), OPT_WINTRANS_IM_ONTOP,
+	button = pidgin_prefs_checkbox(_("Always on top"), OPT_WINTRANS_IM_ONTOP,
 		trans_box);
 	g_signal_connect(GTK_OBJECT(button), "clicked",
 		GTK_SIGNAL_FUNC(update_convs_wintrans),
@@ -588,7 +608,7 @@
 
 	/* Buddy List trans options */
 	bltransbox = pidgin_make_frame (ret, _("Buddy List Window"));
-	button = wpurple_button(_("_Buddy List window transparency"),
+	button = pidgin_prefs_checkbox(_("_Buddy List window transparency"),
 		OPT_WINTRANS_BL_ENABLED, bltransbox);
 	g_signal_connect(GTK_OBJECT(button), "clicked",
 		GTK_SIGNAL_FUNC(set_blist_trans),
@@ -603,7 +623,7 @@
 	button = pidgin_prefs_checkbox(
 		_("Remove Buddy List window transparency on focus"),
 		OPT_WINTRANS_BL_ONFOCUS, trans_box);
-	button = wpurple_button(_("Always on top"), OPT_WINTRANS_BL_ONTOP,
+	button = pidgin_prefs_checkbox(_("Always on top"), OPT_WINTRANS_BL_ONTOP,
 		trans_box);
 	g_signal_connect(GTK_OBJECT(button), "clicked",
 		GTK_SIGNAL_FUNC(set_blist_trans),
--- a/pidgin/win32/nsis/pidgin-installer.nsi	Tue Jul 10 03:25:56 2007 +0000
+++ b/pidgin/win32/nsis/pidgin-installer.nsi	Tue Jul 10 05:42:49 2007 +0000
@@ -1168,6 +1168,35 @@
   ;Preselect the URI handlers as appropriate
   Call SelectURIHandlerSelections
 
+  ;Preselect the "shortcuts" checkboxes according to the previous installation
+  ClearErrors
+  ;Make sure that there was a previous installation
+  ReadRegStr $R0 HKCU "${PIDGIN_REG_KEY}" "Installer Language"
+  IfErrors done_preselecting_shortcuts
+    ;Does the Desktop shortcut exist?
+    GetFileTime "$DESKTOP\Pidgin.lnk" $R0 $R0
+    IfErrors +1 +4
+    ClearErrors
+    SetShellVarContext "all"
+    GetFileTime "$DESKTOP\Pidgin.lnk" $R0 $R0
+    IfErrors preselect_startmenu_shortcut ;Desktop Shortcut if off by default
+    !insertmacro SelectSection ${SecDesktopShortcut}
+  preselect_startmenu_shortcut:
+    ;Reset ShellVarContext because we may have changed it
+    SetShellVarContext "current"
+    ClearErrors
+    ;Does the StartMenu shortcut exist?
+    GetFileTime "$SMPROGRAMS\Pidgin.lnk" $R0 $R0
+    IfErrors +1 done_preselecting_shortcuts ;StartMenu Shortcut is on by default
+    ClearErrors
+    SetShellVarContext "all"
+    GetFileTime "$SMPROGRAMS\Pidgin.lnk" $R0 $R0
+    IfErrors +1 done_preselecting_shortcuts ;StartMenu Shortcut is on by default
+    !insertmacro UnselectSection ${SecStartMenuShortcut}
+  done_preselecting_shortcuts:
+  ;Reset ShellVarContext because we may have changed it
+  SetShellVarContext "current"
+
   StrCpy $ISSILENT "/NOUI"
 
   ; GTK installer has two silent states.. one with Message boxes, one without
@@ -1305,7 +1334,7 @@
 
 !ifndef WITH_GTK
   ; If this installer dosn't have GTK, check whether we need it.
-  ; We do this here an not in .onInit because language change in
+  ; We do this here and not in .onInit because language change in
   ; .onInit doesn't take effect until it is finished.
   Call DoWeNeedGtk
   Pop $R0