You are here

Pidgin: Spell-checking?

8 posts / 0 new
Last post
gboutwell
Offline
Last seen: 14 years 10 months ago
Joined: 2006-02-08 17:43
Pidgin: Spell-checking?

Is it possible to have the spelling dictionary and what not on the USB drive with Portable GAIM in a way that I don't have to install Spelling on every computer that I use it on?

Thanks,

George

gboutwell
Offline
Last seen: 14 years 10 months ago
Joined: 2006-02-08 17:43
Anyone have any help for

Anyone have any help for this.. I have taken the ASpell files installed on a computer and copied them to various locations on the USB drive that runs Gaim but apparently it doesn't matter where I copy them, it still can't find them. Is there some way to point Portable GAIM to these files?

ASPell help/README files seems to say that there is a way to get ASpell to see files on a USB drive or without a drive letter.

George

TheAngryPenguin (not verified)
Unfortunately, it appears

Unfortunately, it appears that you will need to have Aspell fully installed (including your preferred language pack). Right now, there doesn't seem to be any other way to get Gaim to hook into Aspell's shared DLL's so that it can do its voodoo with your fat-fingered words.

gboutwell
Offline
Last seen: 14 years 10 months ago
Joined: 2006-02-08 17:43
Got it working

After much tinkering and what not... I was able to get ASpell to work in PortableGaim from an Aspell installed on my portable drive. I thought I'd share this with the community.

I had to set an environment variable to the location on the portable drive where Aspell\bin directory was, then run PortableGAIM... with that I get spell checking in PortableGAIM.

I tried modifying the PortableGAIM.nsi script to create an PortableGAIM.exe that included this like it does the GTK but failed miserably some how. I got the modifications in, but wan't able to get the Portable.nsi script to build/compile. If someone could help me with this, I'd be glad to send a patch to the portable gaim developers with this addition and make it so that all users can benefit from this...

John T. Haller
John T. Haller's picture
Offline
Last seen: 7 hours 34 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Post It

Post the info related to the environment variable and what you've discovered here (use the PRE html tag for code) and we'll test it out.

Sometimes, the impossible can become possible, if you're awesome!

gboutwell
Offline
Last seen: 14 years 10 months ago
Joined: 2006-02-08 17:43
ENVIRONMENT VAR and details

Ok... the ugly details...
In the directory PortableGAIM\Aspell is where I put the Aspell files...
In the directory ProtableGAIM\gaim is where gaim is...

I start gaim from a .BAT in the root directory of the portable drive with an bat files that has the following:

@ECHO OFF
SET GAIM_ASPELL_DIR=.\PortableGAIM\ASpell\bin
start PortableGAIM\PortableGAIM.exe

This is what I have working atm... It works, as it gives me spell checking at this very moment in my PortableGAIM.. It's not the best solution but it works. Following is an post of the PortableGAIM.nsi with my (failed) attempted hack to accomplish setting the same environment variable in it so as to not need to set it in the batch file. In a nutshell I copy/pasted the GTK stuff and made changes to it to be ASPELL and the GAIM_ASPELL_DIR environment instead. So here it is in it's entirety, hope you have more luck with it than I did, hope I didn't butcher trying different things out trying to get it to compile:

;Copyright (C) 2004-2005 John T. Haller
;Additional Ideas from tracon and mai9

;Website: https://portableapps.com/portablegaim

;This software is OSI Certified Open Source Software.
;OSI Certified is a certification mark of the Open Source Initiative.

;This program is free software; you can redistribute it and/or
;modify it under the terms of the GNU General Public License
;as published by the Free Software Foundation; either version 2
;of the License, or (at your option) any later version.

;This program is distributed in the hope that it will be useful,
;but WITHOUT ANY WARRANTY; without even the implied warranty of
;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;GNU General Public License for more details.

;You should have received a copy of the GNU General Public License
;along with this program; if not, write to the Free Software
;Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.

!define NAME "PortableGaim"
!define FRIENDLYNAME "Portable Gaim"
!define APP "Gaim"
!define VER "1.1.5.0gpb"
!define WEBSITE "portableapps.com/portablegaim"
!define DEFAULTEXE "gaim.exe"
!define DEFAULTAPPDIR "gaim"
!define DEFAULTGTKDIR "gtk/bin"
!define DEFAULTASPELLDIR "Aspell/bin"
!define DEFAULTSETTINGSDIR "settings"
!define DEFAULTUSERPROFILE "userprofile"

;=== Program Details
Name "${NAME}"
OutFile "${NAME}.exe"
Caption "${FRIENDLYNAME} - Instant Messaging Made Portable"
VIProductVersion "${VER}"
VIAddVersionKey FileDescription "${FRIENDLYNAME}"
VIAddVersionKey LegalCopyright "GPL"
VIAddVersionKey Comments "Allows ${APP} to be run from a removable drive.  For additional details, visit ${WEBSITE}"
VIAddVersionKey CompanyName "by John T. Haller et al"
VIAddVersionKey OriginalFilename "${NAME}.exe"
VIAddVersionKey FileVersion "${VER}"

;=== Runtime Switches
CRCCheck On
WindowIcon Off
SilentInstall Silent
AutoCloseWindow True

;=== Program Icon
Icon "${APP}.ico"

Var PROGRAMDIRECTORY
Var GTKDIRECTORY
var ASPELLDIRECTORY
Var SETTINGSDIRECTORY
Var USERPROFILEDIRECTORY
Var ADDITIONALPARAMETERS
Var EXECSTRING
Var WAITFORPROGRAM
Var PROGRAMEXECUTABLE
Var INIPATH
Var DISABLESPLASHSCREEN
var NOPROGMESSAGE

Section "Main"
	;=== Find the INI file, if there is one
		IfFileExists "$EXEDIR\${NAME}.ini" "" CheckSubINI
			StrCpy "$INIPATH" "$EXEDIR\"
			Goto ReadINI

	CheckSubINI:
		IfFileExists "$EXEDIR\${NAME}\${NAME}.ini" "" CheckSubSubINI
			StrCpy "$INIPATH" "$EXEDIR\${NAME}\"
			Goto ReadINI

	CheckSubSubINI:
		IfFileExists "$EXEDIR\PortableApps\${NAME}\${NAME}.ini" "" CheckPortableAppsINI
			StrCpy "$INIPATH" "$EXEDIR\PortableApps\${NAME}\"
			Goto ReadINI

	CheckPortableAppsINI:
		IfFileExists "$EXEDIR\Data\${NAME}\${NAME}.ini" ""  NoINI
			StrCpy "$INIPATH" "$EXEDIR\Data\${NAME}\"
			Goto ReadINI

	ReadINI:
		;=== Read the parameters from the INI file
		ReadINIStr $0 "$INIPATH\${NAME}.ini" "${NAME}" "${APP}Directory"
		StrCpy "$PROGRAMDIRECTORY" "$EXEDIR\$0"
		ReadINIStr $0 "$INIPATH\${NAME}.ini" "${NAME}" "GTKDirectory"
		StrCpy "$GTKDIRECTORY" "$0"
		ReadINIStr $0 "$INIPATH\${NAME}.ini" "${NAME}" "AspellDirectory"
		StrCpy "$ASPELLDIRECTORY" "$0"
		ReadINIStr $0 "$INIPATH\${NAME}.ini" "${NAME}" "SettingsDirectory"
		StrCpy "$SETTINGSDIRECTORY" "$0"
	

		;=== Check that the above required parameters are present
		IfErrors NoINI

		ReadINIStr $0 "$INIPATH\${NAME}.ini" "${NAME}" "AdditionalParameters"
		StrCpy "$ADDITIONALPARAMETERS" $0
		ReadINIStr $0 "$INIPATH\${NAME}.ini" "${NAME}" "WaitFor${APP}"
		StrCpy "$WAITFORPROGRAM" $0
		ReadINIStr $0 "$INIPATH\${NAME}.ini" "${NAME}" "${APP}Executable"
		StrCpy "$PROGRAMEXECUTABLE" $0
		ReadINIStr $0 "$INIPATH\${NAME}.ini" "${NAME}" "UserProfileDirectory"
		StrCpy "$USERPROFILEDIRECTORY" "$0"
		ReadINIStr $0 "$INIPATH\${NAME}.ini" "${NAME}" "DisableSplashScreen"
		StrCpy "$DISABLESPLASHSCREEN" $0

		
		;=== Any missing unrequired INI entries will be an empty string, ignore associated errors
		ClearErrors

		;=== Correct PROGRAMEXECUTABLE if blank
		StrCmp $PROGRAMEXECUTABLE "" "" EndINI
			StrCpy "$PROGRAMEXECUTABLE" "${DEFAULTEXE}"
			Goto EndINI

	NoINI:
		;=== No INI file, so we'll use the defaults
		StrCpy "$ADDITIONALPARAMETERS" ""
		StrCpy "$WAITFORPROGRAM" "false"
		StrCpy "$PROGRAMEXECUTABLE" "${DEFAULTEXE}"

		IfFileExists "$EXEDIR\${DEFAULTAPPDIR}\${DEFAULTEXE}" "" CheckPortableProgramDIR
			StrCpy "$PROGRAMDIRECTORY" "$EXEDIR\${DEFAULTAPPDIR}"
			StrCpy "$GTKDIRECTORY" "$EXEDIR\${DEFAULTGTKDIR}"
			StrCpy "$ASPELLDIRECTORY" "$EXEDIR\${DEFAULTASPELLDIR}"
			StrCpy "$SETTINGSDIRECTORY" "$EXEDIR\${DEFAULTSETTINGSDIR}"
			StrCpy "$USERPROFILEDIRECTORY" "${DEFAULTUSERPROFILE}"
			GoTo EndINI

		CheckPortableProgramDIR:
			IfFileExists "$EXEDIR\${NAME}\${DEFAULTAPPDIR}\${DEFAULTEXE}" "" CheckPortableAppsDIR
			StrCpy "$PROGRAMDIRECTORY" "$EXEDIR\${NAME}\${DEFAULTAPPDIR}"
			StrCpy "$GTKDIRECTORY" "$EXEDIR\${NAME}\${DEFAULTGTKDIR}"
			StrCpy "$ASPELLDIRECTORY" "$EXEDIR\${NAME}\${DEFAULTASPELLDIR}"
			StrCpy "$SETTINGSDIRECTORY" "$EXEDIR\${NAME}\${DEFAULTSETTINGSDIR}"
			StrCpy "$USERPROFILEDIRECTORY" "${NAME}\${DEFAULTUSERPROFILE}"
			GoTo EndINI

		CheckPortableAppsDIR:
			IfFileExists "$EXEDIR\PortableApps\${NAME}\${DEFAULTAPPDIR}\${DEFAULTEXE}" "" CheckPortableAppsSplitDIR
			StrCpy "$PROGRAMDIRECTORY" "$EXEDIR\PortableApps\${NAME}\${DEFAULTAPPDIR}"
			StrCpy "$GTKDIRECTORY" "$EXEDIR\PortableApps\${NAME}\${DEFAULTGTKDIR}"
			StrCpy "$ASPELLDIRECTORY" "$EXEDIR\PortableApps\${NAME}\${DEFAULTASPELLDIR}"
			StrCpy "$SETTINGSDIRECTORY" "$EXEDIR\PortableApps\${NAME}\${DEFAULTSETTINGSDIR}"
			StrCpy "$USERPROFILEDIRECTORY" "PortableApps\${NAME}\${DEFAULTUSERPROFILE}"
			GoTo EndINI

		CheckPortableAppsSplitDIR:
			IfFileExists "$EXEDIR\Apps\${NAME}\${DEFAULTAPPDIR}\${DEFAULTEXE}" "" NoProgramEXE
			StrCpy "$PROGRAMDIRECTORY" "$EXEDIR\Apps\${NAME}\${DEFAULTAPPDIR}"
			
			IfFileExists "$EXEDIR\App\GTK\bin\*.*" "" UniqueGTKDIR
				;=== Shared GTK Directory
				StrCpy "$GTKDIRECTORY" "$EXEDIR\Apps\GTK\bin"
				Goto CheckUniqueUserProfileDIR

			UniqueGTKDIR:
				StrCpy "$GTKDIRECTORY" "$EXEDIR\PortableApps\${NAME}\${DEFAULTGTKDIR}"
	
		CheckUniqueUserProfileDIR:
			IfFileExists "$EXEDIR\Data\UserProfile\*.*" "" UniqueUserProfileDIR
				;=== Shared UserProfile directory
				StrCpy "$USERPROFILEDIRECTORY" "Data\UserProfile"
				GoTo EndINI

			UniqueUserProfileDIR:
				StrCpy "$USERPROFILEDIRECTORY" "Data\${NAME}\${DEFAULTUSERPROFILE}"
			GoTo EndINI	

	EndINI:
		IfFileExists "$PROGRAMDIRECTORY\$PROGRAMEXECUTABLE" FoundProgramEXE

	NoProgramEXE:
		;=== Program executable not where expected
		MessageBox MB_OK|MB_ICONEXCLAMATION '$PROGRAMEXECUTABLE was not found.  Please check your configuration'
		Abort
		
	FoundProgramEXE:
		StrCmp $DISABLESPLASHSCREEN "true" SkipSplashScreen
			;=== Show the splash screen before processing the files
			InitPluginsDir
			File /oname=$PLUGINSDIR\splash.jpg "${NAME}.jpg"
		
			StrCmp $WAITFORPROGRAM "true" ShortSplashScreen
			newadvsplash::show /NOUNLOAD 30000 400 0 -1 /L $PLUGINSDIR\splash.jpg
			GoTo SkipSplashScreen
			
			ShortSplashScreen:
				newadvsplash::show /NOUNLOAD 2000 200 0 -1 /L $PLUGINSDIR\splash.jpg

	SkipSplashScreen:
	
		;=== Get any passed parameters
		Call GetParameters
		Pop $0
		StrCmp "'$0'" "''" "" LaunchProgramParameters

		;=== No parameters
		StrCpy $EXECSTRING `"$PROGRAMDIRECTORY\$PROGRAMEXECUTABLE"`
		Goto AdditionalParameters

	LaunchProgramParameters:
		StrCpy $EXECSTRING `"$PROGRAMDIRECTORY\$PROGRAMEXECUTABLE" $0`

	AdditionalParameters:
		StrCmp $ADDITIONALPARAMETERS "" UserProfileEnvironment

		;=== Additional Parameters
		StrCpy $EXECSTRING `$EXECSTRING $ADDITIONALPARAMETERS`

	UserProfileEnvironment:
		;=== Set the %USERPROFILE% directory if we have a path
		StrCmp $USERPROFILEDIRECTORY "" GaimEnvironment
		IfFileExists "$EXEDIR\$USERPROFILEDIRECTORY\*.*" "" GaimEnvironment
		System::Call 'Kernel32::SetEnvironmentVariableA(t, t) i("USERPROFILE", "$EXEDIR\$USERPROFILEDIRECTORY").r0'
		
	GaimEnvironment:
		;=== Set the %GAIMHOME% directory if we have a path
		StrCmp $SETTINGSDIRECTORY "" GaimHomeNotFound
		IfFileExists "$SETTINGSDIRECTORY\*.*" "" GaimHomeNotFound
		System::Call 'Kernel32::SetEnvironmentVariableA(t, t) i("GAIMHOME", "$SETTINGSDIRECTORY").r0'
		GoTo GTKDirectory

	GaimHomeNotFound:
		MessageBox MB_OK|MB_ICONEXCLAMATION `$SETTINGSDIRECTORY was not found.  Please check your configuration`
		Abort

	GTKDirectory:
		;=== Add GTK to the %PATH% directory if we have a path, otherwise, skip it
		StrCmp $GTKDIRECTORY "" LaunchNow
		IfFileExists "$GTKDIRECTORY\*.*" "" LaunchNow
		ReadEnvStr $R0 "PATH"
		StrCpy $R0 "$GTKDIRECTORY;$R0"
		System::Call 'Kernel32::SetEnvironmentVariableA(t, t) i("PATH", "$R0").r0'
		GoTo AspellDirectory


	ASpellDirectory:
		;=== set the %GAIM_ASPELL_DIR% directory if we have a path
		StrCmp $ASPELLDIRECTORY "" LaunchNow
		IfFileExists "$ASPELLDIRECTORY\*.*" "" LaunchNow
		System::Call 'Kernel32::SetEnvironmentVariableA(t, t) i("GAIM_ASPELL_DIR", "$ASPELLDIRECTORY").r0'
		GoTo LaunchNow

	;GTKNotFound:
	;	MessageBox MB_OK|MB_ICONEXCLAMATION `$GTKDIRECTORY was not found.  Please check your configuration`
	;	Abort
		
	LaunchNow:
		StrCmp $WAITFORPROGRAM "true" LaunchAndWait LaunchAndClose

	LaunchAndWait:
		ExecWait $EXECSTRING
		GoTo TheEnd

	LaunchAndClose:
		Exec $EXECSTRING
		Sleep 2000 ;=== allow the splash screen to show for at least 2 seconds after starting
		StrCmp $DISABLESPLASHSCREEN "true" TheEnd
			newadvsplash::stop

	TheEnd:

SectionEnd

Function "GetParameters"
  Push $R0
  Push $R1
  Push $R2
  StrCpy $R0 $CMDLINE 1
  StrCpy $R1 '"'
  StrCpy $R2 1
  StrCmp $R0 '"' loop
    StrCpy $R1 ' ' ; we're scanning for a space instead of a quote
  loop:
    StrCpy $R0 $CMDLINE 1 $R2
    StrCmp $R0 $R1 loop2
    StrCmp $R0 "\" "" "nofile"
      IntOp $2 $R2 + 1
    nofile:
    ;MessageBox MB_OK "r0: $R0"
    StrCmp $R0 "" loop2
    IntOp $R2 $R2 + 1
    Goto loop
  loop2:
    IntOp $R0 $R2 - $2
    IntOp $R0 $R0 - 4
    ;MessageBox MB_OK "$R2 - $2 = $R0"
    StrCpy $R7 $CMDLINE $R0 $2 ; we save the filename
    ;MessageBox MB_OK "$2"
  loop2b:
    IntOp $R2 $R2 + 1
    StrCpy $R0 $CMDLINE 1 $R2
    ;MessageBox MB_OK "rr0: $R0"
    StrCmp $R0 " " loop2b
  StrCpy $R0 $CMDLINE "" $R2
  Pop $R2
  Pop $R1
  Exch $R0
FunctionEnd
Jakanden
Offline
Last seen: 16 years 8 months ago
Joined: 2006-09-23 06:57
This work for me for a few

This work for me for a few days and now all of a sudden it does not work. I have tried re-creating the batch file, reinstalling Aspell and so forth. Any ideas?

gboutwell
Offline
Last seen: 14 years 10 months ago
Joined: 2006-02-08 17:43
confirm

John,

Can you please confirm that someone in regards to the project has seen my other message with the details?

Thanks,

George

Topic locked