pidgin: 2a7ad9dd: Allow the GTK+ Runtime to be unselected ...
datallah at pidgin.im
datallah at pidgin.im
Sat May 15 02:16:26 EDT 2010
-----------------------------------------------------------------
Revision: 2a7ad9dd15f080096423a10b56336b0f1c25783a
Ancestor: 9e39de8a60da06a1d33d6e9904dd7532fa5cdc16
Author: datallah at pidgin.im
Date: 2010-05-15T06:13:15
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/2a7ad9dd15f080096423a10b56336b0f1c25783a
Modified files:
pidgin/win32/nsis/langmacros.nsh
pidgin/win32/nsis/pidgin-installer.nsi
pidgin/win32/nsis/translations/english.nsh
ChangeLog:
Allow the GTK+ Runtime to be unselected when there is no existing runtime
(but not when there is an existing runtime that is too old). This allows
"advanced" users to more easily reuse a global GTK+ runtime if they choose to
do so.
Additionally, this provides some additional alerts and hints about what to do
when downloading the GTK+ Runtime or Spellchecking dictionary fails.
Fixes #11852, #11889
-------------- next part --------------
============================================================
--- pidgin/win32/nsis/langmacros.nsh 55b8e5dabbdd6ec5ce316ee0a3192effdcb47660
+++ pidgin/win32/nsis/langmacros.nsh 5b3e01bc57539ab7e29af377b0c93fcd2b6ddda7
@@ -71,6 +71,8 @@
!insertmacro PIDGIN_MACRO_LANGSTRING_INSERT PIDGIN_DEBUGSYMBOLS_ERROR ${CUR_LANG}
!insertmacro PIDGIN_MACRO_LANGSTRING_INSERT PIDGIN_GTK_DOWNLOAD_ERROR ${CUR_LANG}
+ !insertmacro PIDGIN_MACRO_LANGSTRING_INSERT PIDGIN_PROMPT_FORCE_NO_GTK ${CUR_LANG}
+
!undef CUR_LANG
!macroend
============================================================
--- pidgin/win32/nsis/pidgin-installer.nsi 50a33cd60e5d4b5cddf4c8827f39e546d3a8a2db
+++ pidgin/win32/nsis/pidgin-installer.nsi cc27f8628e6a5ec240c9c05a3db83bed50c66d54
@@ -8,8 +8,9 @@ Var name
;--------------------------------
;Global Variables
Var name
-Var ISSILENT
Var STARTUP_RUN_KEY
+Var CURRENT_GTK_STATE
+Var WARNED_GTK_STATE
;--------------------------------
;Configuration
@@ -351,7 +352,7 @@ Section $(GTK_SECTION_TITLE) SecGtk
Pop $R0
StrCmp $R0 "cancel" done
StrCmp $R0 "success" +2
- MessageBox MB_RETRYCANCEL "$(PIDGIN_GTK_DOWNLOAD_ERROR) : $R2" /SD IDCANCEL IDRETRY retry IDCANCEL done
+ MessageBox MB_RETRYCANCEL "$(PIDGIN_GTK_DOWNLOAD_ERROR)" /SD IDCANCEL IDRETRY retry IDCANCEL done
!endif
@@ -548,7 +549,7 @@ Section /o $(DEBUG_SYMBOLS_SECTION_TITLE
Pop $R0
StrCmp $R0 "cancel" done
StrCmp $R0 "success" +2
- MessageBox MB_RETRYCANCEL "$(PIDGIN_DEBUGSYMBOLS_ERROR) : $R2" /SD IDCANCEL IDRETRY retry IDCANCEL done
+ MessageBox MB_RETRYCANCEL "$(PIDGIN_DEBUGSYMBOLS_ERROR)" /SD IDCANCEL IDRETRY retry IDCANCEL done
!endif
@@ -1154,12 +1155,6 @@ Function .onInit
;Reset ShellVarContext because we may have changed it
SetShellVarContext "current"
- StrCpy $ISSILENT "/S"
- ; GTK installer has two silent states - one with Message boxes, one without
- ; If pidgin installer was run silently, we want to supress gtk installer msg boxes.
- IfSilent 0 +2
- StrCpy $ISSILENT "/NOUI"
-
ClearErrors
${GetOptions} "$R3" "/L=" $R1
IfErrors +3
@@ -1263,9 +1258,11 @@ Function preWelcomePage
!endif
Call DoWeNeedGtk
- Pop $R0
- IntCmp $R0 1 done gtk_not_mandatory
- ; Make the GTK+ Section RO if it is required.
+ Pop $CURRENT_GTK_STATE
+ StrCpy $WARNED_GTK_STATE "0"
+ IntCmp $CURRENT_GTK_STATE 1 done gtk_not_mandatory
+ ; Make the GTK+ Section RO if it is required. (it is required only if you have an existing version that is too old)
+ StrCmp $CURRENT_GTK_STATE "2" 0 done
!insertmacro SetSectionFlag ${SecGtk} ${SF_RO}
Goto done
gtk_not_mandatory:
@@ -1277,6 +1274,29 @@ FunctionEnd
Pop $R0
FunctionEnd
+; If the GTK+ Section has been unselected and there isn't a compatible GTK+ already, confirm
+Function .onSelChange
+ Push $R0
+
+ SectionGetFlags ${SecGtk} $R0
+ IntOp $R0 $R0 & ${SF_SELECTED}
+ ; If the Gtk Section is currently selected, reset the "Warned" flag
+ StrCmp $R0 "${SF_SELECTED}" 0 +3
+ StrCpy $WARNED_GTK_STATE "0"
+ Goto done
+
+ ; If we've already warned the user, don't warn them again
+ StrCmp $WARNED_GTK_STATE "1" done
+ IntCmp $CURRENT_GTK_STATE 1 done done 0
+ StrCpy $WARNED_GTK_STATE "1"
+ MessageBox MB_YESNO $(PIDGIN_PROMPT_FORCE_NO_GTK) /SD IDNO IDYES done
+ !insertmacro SelectSection ${SecGtk}
+
+ done:
+ Pop $R0
+FunctionEnd
+
+
; Convert the current $LANGUAGE to a language code that we can use for translation mo selection
; If there's a better way to do this, I'd love to know it
Function SelectTranslationForCurrentLanguage
@@ -1429,6 +1449,7 @@ Function InstallDict
Pop $R1 ;This is the language file
Push $R2
Push $R3
+ Push $R4
ClearErrors
IfFileExists "$INSTDIR\spellcheck\share\enchant\myspell\$R0.dic" installed
@@ -1441,10 +1462,10 @@ Function InstallDict
DetailPrint "Downloading the $R0 Dictionary... ($R3)"
retry:
NSISdl::download /TIMEOUT=10000 "$R3" "$R2"
- Pop $R3
- StrCmp $R3 "cancel" done
- StrCmp $R3 "success" +3
- MessageBox MB_RETRYCANCEL "$(PIDGIN_SPELLCHECK_ERROR) : $R3" /SD IDCANCEL IDRETRY retry IDCANCEL done
+ Pop $R4
+ StrCmp $R4 "cancel" done
+ StrCmp $R4 "success" +3
+ MessageBox MB_RETRYCANCEL "$(PIDGIN_SPELLCHECK_ERROR)" /SD IDCANCEL IDRETRY retry IDCANCEL done
Goto done
SetOutPath "$INSTDIR\spellcheck\share\enchant\myspell"
nsisunz::UnzipToLog "$R2" "$OUTDIR"
@@ -1458,6 +1479,7 @@ Function InstallDict
DetailPrint "$R0 Dictionary is installed"
done:
+ Pop $R4
Pop $R3
Pop $R2
Pop $R0
============================================================
--- pidgin/win32/nsis/translations/english.nsh 3b5beda1d75bea05b1a84532f0179063fa86d9f0
+++ pidgin/win32/nsis/translations/english.nsh 53798df62a96fc431967676db914a65ab89e5fe0
@@ -44,6 +44,8 @@
; GTK+ Section Prompts
+!insertmacro PIDGIN_MACRO_DEFAULT_STRING PIDGIN_PROMPT_FORCE_NO_GTK "Pidgin requires a compatible GTK+ Runtime (which doesn't appear to be already present).$\rAre you sure you want to skip installing the GTK+ Runtime?"
+
; URL Handler section
!insertmacro PIDGIN_MACRO_DEFAULT_STRING URI_HANDLERS_SECTION_TITLE "URI Handlers"
@@ -53,10 +55,10 @@
; Spellcheck Section Prompts
!insertmacro PIDGIN_MACRO_DEFAULT_STRING PIDGIN_SPELLCHECK_SECTION_TITLE "Spellchecking Support"
-!insertmacro PIDGIN_MACRO_DEFAULT_STRING PIDGIN_SPELLCHECK_ERROR "Error Installing Spellchecking"
+!insertmacro PIDGIN_MACRO_DEFAULT_STRING PIDGIN_SPELLCHECK_ERROR "Error Installing Spellchecking ($R3).$\rIf retrying fails, manual installation instructions are at: http://d.pidgin.im/wiki/Installing%20Pidgin#manual_win32_spellcheck_installation"
!insertmacro PIDGIN_MACRO_DEFAULT_STRING PIDGIN_SPELLCHECK_SECTION_DESCRIPTION "Support for Spellchecking. (Internet connection required for installation)"
-!insertmacro PIDGIN_MACRO_DEFAULT_STRING PIDGIN_DEBUGSYMBOLS_ERROR "Error Installing Debug Symbols"
+!insertmacro PIDGIN_MACRO_DEFAULT_STRING PIDGIN_DEBUGSYMBOLS_ERROR "Error Installing Debug Symbols ($R2)"
-!insertmacro PIDGIN_MACRO_DEFAULT_STRING PIDGIN_GTK_DOWNLOAD_ERROR "Error Downloading the GTK+ Runtime"
+!insertmacro PIDGIN_MACRO_DEFAULT_STRING PIDGIN_GTK_DOWNLOAD_ERROR "Error Downloading the GTK+ Runtime ($R2).$\rThis is required for Pidgin to function; if retrying fails, you may need to use the 'Offline Installer' from http://pidgin.im/download/windows/ ."
More information about the Commits
mailing list