[Shadowirc-commits] CVS: shadowirc/src IRCGlobals.h,1.23,1.24 MWPanes.c,1.16,1.17 MsgWindows.c,1.56,
Status: Alpha
Brought to you by:
dshadow
From: John B. <ds...@us...> - 2005-01-26 04:16:06
|
Update of /cvsroot/shadowirc/shadowirc/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15128/src Modified Files: IRCGlobals.h MWPanes.c MsgWindows.c filesMan.c Log Message: Save the default inline input height on shift-resize. Index: IRCGlobals.h =================================================================== RCS file: /cvsroot/shadowirc/shadowirc/src/IRCGlobals.h,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- IRCGlobals.h 15 Aug 2004 02:52:52 -0000 1.23 +++ IRCGlobals.h 26 Jan 2005 04:14:47 -0000 1.24 @@ -1,6 +1,6 @@ /* ShadowIRC - A Mac OS IRC Client - Copyright (C) 1996-2004 John Bafford + Copyright (C) 1996-2005 John Bafford ds...@sh... http://www.shadowirc.com @@ -102,7 +102,7 @@ Str255 serverMessagePrefix; //Prefix for server messages Rect consoleLoc; Rect inputLoc; //Position and size of inputline. -short unusedIW; + short inlineInputDefaultHeight; //Default height for inputlines in the channel window char consoleOpen; //Is console window open? char userListOpen; Rect userListRect; Index: MWPanes.c =================================================================== RCS file: /cvsroot/shadowirc/shadowirc/src/MWPanes.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- MWPanes.c 17 Aug 2004 04:43:32 -0000 1.16 +++ MWPanes.c 26 Jan 2005 04:14:50 -0000 1.17 @@ -61,7 +61,7 @@ static void MWInputPaneClick(mwPanePtr o, Point where, float time, UInt32 modifiers) { - #pragma unused(time, modifiers) + #pragma unused(time) extern char iwFront; iwFront = true; @@ -92,13 +92,16 @@ MWPaneRecalculate(o->mw); MWPaneResize(o->mw); MWPaneUpdate(o->mw); + + if(modifiers & shiftKey) + mainPrefs->inlineInputDefaultHeight = o->drawArea.bottom - o->drawArea.top; } r = o->drawArea; r.bottom = r.top + 5; DrawBorder(&r, kThemeStateActive, true); } - else if(where.v >= o->drawArea.top + 8) //field + else //field { //We don't do anything here, the control handles it } Index: MsgWindows.c =================================================================== RCS file: /cvsroot/shadowirc/shadowirc/src/MsgWindows.c,v retrieving revision 1.56 retrieving revision 1.57 diff -u -d -r1.56 -r1.57 --- MsgWindows.c 3 Sep 2004 18:29:15 -0000 1.56 +++ MsgWindows.c 26 Jan 2005 04:14:50 -0000 1.57 @@ -1210,7 +1210,7 @@ h->font=fontNum; h->size=mainPrefs->defaultFontSize; - + if(!h->protect) { SetWindowContentColor(h->w, &shadowircColors[sicWindowBG]); @@ -1232,7 +1232,15 @@ if(noFloatingInput && !h->protect) { Rect zeroRect = {0, 0, 0, 0}; - MWNewPane(h, mwInputPane, mwPaneBottom, 32, -1); + short inlineHeight = (windowSize.bottom - windowSize.top) / 2; + + if(mainPrefs->inlineInputDefaultHeight < inlineHeight) + inlineHeight = mainPrefs->inlineInputDefaultHeight; + + if(inlineHeight < 32) + inlineHeight = 32; + + MWNewPane(h, mwInputPane, mwPaneBottom, inlineHeight, -1); h->inputData = IADNew(h->w, zeroRect, NewKey, false); } Index: filesMan.c =================================================================== RCS file: /cvsroot/shadowirc/shadowirc/src/filesMan.c,v retrieving revision 1.38 retrieving revision 1.39 diff -u -d -r1.38 -r1.39 --- filesMan.c 27 Jul 2004 09:00:43 -0000 1.38 +++ filesMan.c 26 Jan 2005 04:14:50 -0000 1.39 @@ -1,6 +1,6 @@ /* ShadowIRC - A Mac OS IRC Client - Copyright (C) 1996-2003 John Bafford + Copyright (C) 1996-2005 John Bafford ds...@sh... http://www.shadowirc.com @@ -549,7 +549,7 @@ kShadowIRC11PreferencesVersion = 3, kShadowIRC20Alpha10PreferencesVersion = 4, PreferencesVersion = kShadowIRC20Alpha10PreferencesVersion, - PrefsUpdateLevel = 0, + PrefsUpdateLevel = 6, SizeOfPrefsDataArea = sizeof(prefsRec) + (sizeof(linkPrefsRec)*maxLinks), SizeOfPrefs = sizeof(prefsStruct) + SizeOfPrefsDataArea }; @@ -622,6 +622,16 @@ return; } } + else if(p.version > PreferencesVersion) + { + s2 = GetIntStringPtr(spError, sErrorLoadingPrefs); + s = GetIntStringPtr(spError, sPrefsVersionError); +// else +// s = GetIntStringPtr(spError, sUnrecognizedPrefs); + ParamText(s2, "\p", s, "\p"); + Alert(130,0); + ExitToShell(); + } //Prefs are ok. l=sizeof(prefsRec); @@ -638,60 +648,55 @@ l=sizeof(linkPrefsRec) * 10; FSRead(mainRefNum, &l, (Ptr)linkPrefsArray); - if(p.version == kShadowIRC11PreferencesVersion) + //Check to see if the prefs need updating + if(p.version == kShadowIRC20Alpha10PreferencesVersion && p.prefsUpdate == 0) + p.prefsUpdate = 5; + + switch(p.prefsUpdate) { - switch(p.prefsUpdate) - { - case 2: - mainPrefs->displayJoin = - mainPrefs->displayPart = - mainPrefs->displayQuit = - mainPrefs->displayModes = - mainPrefs->displayNicks = - mainPrefs->displayKicks = - mainPrefs->displayInvites = 1; - mainPrefs->dccSendPacketSize = 4096; - - shadowircColors[13].red=25368; - shadowircColors[13].green=0; - shadowircColors[13].blue=25368; - - shadowircColors[14].red= - shadowircColors[14].green= - shadowircColors[14].blue=0; - - mainPrefs->userlistInWindowRight = 1; - mainPrefs->nonGlobalInput = 0; - - for(x=0;x<17;x++) - p.padding[x] = 0; + case 2: + mainPrefs->displayJoin = + mainPrefs->displayPart = + mainPrefs->displayQuit = + mainPrefs->displayModes = + mainPrefs->displayNicks = + mainPrefs->displayKicks = + mainPrefs->displayInvites = 1; + mainPrefs->dccSendPacketSize = 4096; - case 3: //fix the position of recent nicks/channels - for(x = 0; x < 10; x++) - { - linkPrefsPtr lpp = &linkPrefsArray[x]; - BlockMoveData(&lpp->unusedX, lpp->recentNicks, (64 * 10 + 256 * 10)); - lpp->unusedX = 0; - lpp->regainNick = 0; - } - - case 4: - mainPrefs->dccUsePortRange = 0; - mainPrefs->dccPortRangeLow = 2048; - mainPrefs->dccPortRangeHigh = 4096; - - p.prefsUpdate = PrefsUpdateLevel; - } - } - else if(p.version > PreferencesVersion) - { - s2 = GetIntStringPtr(spError, sErrorLoadingPrefs); - s = GetIntStringPtr(spError, sPrefsVersionError); -// else -// s = GetIntStringPtr(spError, sUnrecognizedPrefs); - ParamText(s2, "\p", s, "\p"); - Alert(130,0); - ExitToShell(); + shadowircColors[13].red=25368; + shadowircColors[13].green=0; + shadowircColors[13].blue=25368; + + shadowircColors[14].red= + shadowircColors[14].green= + shadowircColors[14].blue=0; + + mainPrefs->userlistInWindowRight = 1; + mainPrefs->nonGlobalInput = 0; + + for(x=0;x<17;x++) + p.padding[x] = 0; + + case 3: //fix the position of recent nicks/channels + for(x = 0; x < 10; x++) + { + linkPrefsPtr lpp = &linkPrefsArray[x]; + BlockMoveData(&lpp->unusedX, lpp->recentNicks, (64 * 10 + 256 * 10)); + lpp->unusedX = 0; + lpp->regainNick = 0; + } + + case 4: + mainPrefs->dccUsePortRange = 0; + mainPrefs->dccPortRangeLow = 2048; + mainPrefs->dccPortRangeHigh = 4096; + + case 5: //actually 2.0a10 prefsUpdate #0, but we're kludging it for simplicity + mainPrefs->inlineInputDefaultHeight = 32; + + case 6: //2.0a14 + p.prefsUpdate = PrefsUpdateLevel; } //Note that the links haven't been set up yet!! @@ -757,7 +762,7 @@ pstrcpy("\p*** ", mp->serverMessagePrefix); ZeroRect(mp->consoleLoc); ZeroRect(mp->inputLoc); -mp->unusedIW=0; + mp->inlineInputDefaultHeight = 32; mp->consoleOpen=true; mp->userListOpen=0; ZeroRect(mp->userListRect); |