[Legacy] ircII EPIC For Windows
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

menu-v2.0.2.bas 28KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957
  1. ' SOSDG Menu Application
  2. ' Copyright (c) 2002-2004 Brian Bruns <bruns@2mbit.com>
  3. ' Copyright (c) 2002-2004 The Summit Open Source Development Group / Administrative Team - http://www.2mbit.com
  4. ' All Rights Reserved
  5. '
  6. ' URL: http://www.2mbit.com/software.html
  7. ' Build: 2.0.2
  8. ' License: See Below
  9. ' Source: YES (e-mail bruns@2mbit.com for more info and latest version)
  10. ' Notes:
  11. '
  12. '* Redistribution and use in source and binary forms, with or without
  13. '* modification, are permitted provided that the following conditions
  14. '* are met:
  15. '* 1. Redistributions of source code must retain the above copyright
  16. '* notice, this list of conditions and the following disclaimer.
  17. '* 2. Redistributions in binary form must reproduce the above copyright
  18. '* notices, the above paragraph (the one permitting redistribution),
  19. '* this list of conditions and the following disclaimer in the
  20. '* documentation and/or other materials provided with the distribution.
  21. '* 3. The names of the author(s) may not be used to endorse or promote
  22. '* products derived from this software without specific prior written
  23. '* permission.
  24. '*
  25. '* THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
  26. '* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  27. '* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  28. '* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  29. '* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  30. '* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  31. '* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
  32. '* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  33. '* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  34. '* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  35. '* SUCH DAMAGE.
  36. ' VERSION HISTORY
  37. ' 1.0 - Development, initial test version
  38. ' 1.2 - Limited testing
  39. ' 1.3 - Bug fixing stage 1
  40. ' 1.4 - Bug fixing stage 2
  41. ' 1.5 - Bug fixing state 3
  42. ' 1.6 - Solid stable public version used in builds prior to Dec 16th 2002
  43. ' 1.7 - Testing INI config file
  44. ' 1.8 - Solid stable public version using INI file, changed server listing slightly, bug fixes,
  45. ' disabled the Real Name field (still not implemented properly, why get users hopes up?),
  46. ' and removed cruft from old builds that I left in for my own reference.
  47. ' 1.9 - See version.txt from the ircii epic4 installer, or check the website
  48. $OPTIMIZE ON
  49. $INCLUDE "RAPIDQ.INC"
  50. ' RQ INI File Support - Contact: StarBase12@OneBox.com
  51. $INCLUDE "QLibrary.inc"
  52. $TYPECHECK OFF
  53. $ESCAPECHARS OFF
  54. APPLICATION.TITLE = "ircII EPIC4"
  55. DECLARE SUB NickClick
  56. DECLARE SUB FullNameClick
  57. DECLARE SUB UserNameClick
  58. DECLARE SUB ServerNameClick
  59. DECLARE SUB SaveOptToDisk
  60. DECLARE SUB AboutMenuShow
  61. DECLARE SUB AboutMenuClose
  62. DECLARE SUB QuitProgram
  63. DECLARE SUB DelOptFile
  64. DECLARE SUB RunWithCurrOpt
  65. DECLARE SUB LoadOptionsFile
  66. DECLARE SUB DispServerList
  67. DECLARE SUB DispServerListClose
  68. DECLARE SUB ChangeServerName2 (Sender AS QLISTBOX)
  69. DECLARE SUB ReadOptFromDisk
  70. DECLARE SUB ShowVerHistory
  71. DECLARE SUB CloseVerHistory
  72. DECLARE SUB ShowMenuOpt
  73. DECLARE SUB CloseMenuOpt
  74. DECLARE SUB CancelMenuOpt
  75. DECLARE SUB ReadMenuOpt
  76. DECLARE SUB LoadWin32Readme
  77. DECLARE SUB LoadUNIXReadme
  78. DECLARE SUB LoadLicense
  79. DECLARE SUB LoadVersHistory
  80. DECLARE SUB SaveTempOpt
  81. DECLARE SUB OptWinResetDefaults
  82. DECLARE SUB Editircrc
  83. Declare Sub SaveEPICini
  84. DECLARE Sub AddNoConFlag
  85. DECLARE Sub AddNoircrcFlag
  86. DECLARE Sub AddXDebugFlag
  87. DECLARE Sub JoinChanOnCon
  88. DECLARE Sub AddJoinChannel
  89. DECLARE Sub PasswdConnectOpt
  90. DECLARE Sub LoadServerList
  91. DECLARE Sub ChkServerListExist
  92. DIM CmdLineOpts AS STRING
  93. DIM JoinChanStr AS STRING
  94. DIM PasswordStr AS STRING
  95. DIM ServerConnectStr AS STRING
  96. DIM NoConStr AS STRING
  97. DIM NoircrcStr AS STRING
  98. DIM XDebugStr AS STRING
  99. DIM EPIC4PathCurr AS STRING
  100. DIM EPIC4BinCurr AS STRING
  101. DIM EPIC4TermInfoCurr AS STRING
  102. DIM EPIC4DocsCurr AS STRING
  103. DIM EPIC4ExtraOptCurr AS STRING
  104. DIM RXVTBinCurr AS STRING
  105. DIM DOCREADMEWIN AS STRING
  106. DIM DOCREADMEUNIX AS STRING
  107. DIM DOCREADMELICENSE AS STRING
  108. DIM DOCREADMEVERSION AS STRING
  109. DIM ServerFile AS QFILESTREAM
  110. DIM ServerListFile AS QFILESTREAM
  111. 'DIM ConfigFile AS QFILESTREAM
  112. DIM HeaderFont AS QFONT
  113. DIM HeaderFont2 AS QFONT
  114. DIM HeaderFont3 AS QFONT
  115. DIM HeaderFont4 AS QFONT
  116. HeaderFont.Name = "Tahoma"
  117. HeaderFont.AddStyles(fsBold)
  118. HeaderFont.Size = 24
  119. HeaderFont2.Name = "Tahoma"
  120. HeaderFont2.Size = 12
  121. HeaderFont3.Name = "Tahoma"
  122. HeaderFont3.Size = 8
  123. HeaderFont4.Name = "Tahoma"
  124. HeaderFont4.Size = 10
  125. Create EPICIniFile As QIniFile
  126. Name = "epic4.ini"
  127. End Create
  128. Create MenuIniFile AS QIniFile
  129. Name = "menu.ini"
  130. End Create
  131. Dim EPICContent As QStringList
  132. Dim I As Integer
  133. Dim MenuContent AS QStringList
  134. CREATE MainForm AS QFORM
  135. Center
  136. Caption = "ircII EPIC Config App"
  137. Height = 350
  138. Width = 500
  139. BorderStyle = bsToolWindow
  140. CREATE MainMenu AS QMainMenu
  141. CREATE FileMenu AS QMenuItem
  142. Caption = "&File"
  143. CREATE LoadConfig AS QMenuItem
  144. Caption = "Load &Options"
  145. OnClick = ReadOptFromDisk
  146. ShortCut = "CTRL+O"
  147. END CREATE
  148. CREATE SaveConfig AS QMenuItem
  149. Caption = "&Save Options"
  150. OnClick = SaveOptToDisk
  151. ShortCut = "CTRL+S"
  152. END CREATE
  153. CREATE Break1 AS QMenuItem
  154. Caption = "-"
  155. END CREATE
  156. CREATE StartEpic AS QMenuItem
  157. Caption = "Run Epic"
  158. OnClick = RunWithCurrOpt
  159. ShortCut = "CTRL+R"
  160. END CREATE
  161. CREATE Break2 AS QMenuItem
  162. Caption = "-"
  163. END CREATE
  164. CREATE MenuOptMenu AS QMenuItem
  165. Caption = "Configure Menu Settings"
  166. OnClick = ShowMenuOpt
  167. END CREATE
  168. CREATE Break3 AS QMenuItem
  169. Caption = "-"
  170. END CREATE
  171. CREATE ExitApp AS QMenuItem
  172. Caption = "&Exit"
  173. OnClick = QuitProgram
  174. ShortCut = "ALT+F4"
  175. END CREATE
  176. END CREATE
  177. CREATE Tools AS QMenuItem
  178. Caption = "&Tools"
  179. CREATE DelOptions AS QMenuItem
  180. Caption = "Delete User Options"
  181. OnClick = DelOptFile
  182. ShortCut = "CTRL+D"
  183. END CREATE
  184. CREATE EditircrcOpt AS QMenuItem
  185. Caption = "Edit ircrc in Notepad"
  186. OnClick = Editircrc
  187. ShortCut = "CTRL+E"
  188. END CREATE
  189. END CREATE
  190. CREATE Help AS QMenuItem
  191. Caption = "&Help"
  192. CREATE EPICTxtInfo AS QMenuItem
  193. Caption = "EPIC Information..."
  194. OnClick = ShowVerHistory
  195. END CREATE
  196. CREATE AboutOpt AS QMenuItem
  197. Caption = "About..."
  198. OnClick = AboutMenuShow
  199. END CREATE
  200. END CREATE
  201. END CREATE
  202. CREATE NickLabel AS QLABEL
  203. Caption = "Nickname:"
  204. Top = 2
  205. Left = 10
  206. END CREATE
  207. CREATE NickEdit AS QEDIT
  208. Top = NickLabel.Top + 17
  209. Left = NickLabel.Left
  210. Width = 230
  211. Text = "EpicUser"
  212. MaxLength = 30
  213. END CREATE
  214. 'CREATE NickHelp AS QBUTTON
  215. ' Top = NickEdit.Top - 2
  216. ' Left = 250
  217. ' Width = 20
  218. ' Caption = "?"
  219. ' OnClick = NickClick
  220. 'END CREATE
  221. CREATE FullNameLabel AS QLABEL
  222. Caption = "Full Name:"
  223. Top = NickEdit.Top + 27
  224. Left = NickLabel.Left
  225. END CREATE
  226. CREATE FullNameEdit AS QEDIT
  227. Top = FullNameLabel.Top + 17
  228. Left = NickLabel.Left
  229. Width = 230
  230. MaxLength = 100
  231. Text = "Some Random EPIC User"
  232. END CREATE
  233. 'CREATE FullNameHelp AS QBUTTON
  234. ' Top = FullNameEdit.Top - 2
  235. ' Left = NickHelp.Left
  236. ' Width = 20
  237. ' Caption = "?"
  238. ' OnClick = FullNameClick
  239. 'END CREATE
  240. CREATE UserNameLabel AS QLABEL
  241. Caption = "User Name:"
  242. Top = FullNameEdit.Top + 27
  243. Left = NickLabel.Left
  244. END CREATE
  245. CREATE UserNameEdit AS QEDIT
  246. Top = UserNameLabel.Top + 17
  247. Left = NickLabel.Left
  248. Width = 230
  249. Text = "epicuser"
  250. END CREATE
  251. 'CREATE UserNameHelp AS QBUTTON
  252. ' Top = UserNameEdit.Top - 2
  253. ' Left = NickHelp.Left
  254. ' Width = 20
  255. ' Caption = "?"
  256. ' OnClick = UserNameClick
  257. 'END CREATE
  258. CREATE ServerNameLabel AS QLABEL
  259. Caption = "Server:"
  260. Top = UserNameEdit.Top + 27
  261. Left = NickLabel.Left
  262. END CREATE
  263. CREATE ServerNameEdit AS QEDIT
  264. Top = ServerNameLabel.Top + 17
  265. Left = NickLabel.Left
  266. Width = 230
  267. Text = "irc.oftc.net"
  268. END CREATE
  269. 'CREATE ServerNameHelp AS QBUTTON
  270. ' Top = ServerNameEdit.Top - 2
  271. ' Left = NickHelp.Left
  272. ' Width = 20
  273. ' Caption = "?"
  274. ' OnClick = ServerNameClick
  275. 'END CREATE
  276. ' CREATE ServerNameMult AS QBUTTON
  277. ' Top = ServerNameHelp.Top
  278. ' Left = ServerNameEdit.Left + 205
  279. ' Width = 18
  280. ' Caption = "..."
  281. ' Enabled = True
  282. ' OnClick = DispServerList
  283. ' END CREATE
  284. CREATE PortNumLabel AS QLABEL
  285. Caption = "Port:"
  286. Top = ServerNameEdit.Top + 27
  287. Left = NickLabel.Left
  288. END CREATE
  289. CREATE PortNumEdit AS QEDIT
  290. Top = PortNumLabel.Top + 17
  291. Left = NickLabel.Left
  292. Width = 60
  293. Text = "6667"
  294. MaxLength = 6
  295. END CREATE
  296. CREATE ServerListLabel2 AS QLABEL
  297. Left = 280
  298. Top = NickLabel.Top
  299. Width = 300
  300. Caption = "Please Select A Server Below:"
  301. END CREATE
  302. CREATE ServerListBox1 AS QLISTBOX
  303. Left = ServerListLabel2.Left
  304. Top = ServerLabelList2.Top + 20
  305. Height = 120
  306. Width = 200
  307. MultiSelect = False
  308. 'AddItems "OFTC (http://www.oftc.net)", "EFNet (http://www.efnet.net)", "DALNet (http://www.dalnet.net)"
  309. 'AddItems "FreeNode (http://www.freenode.net)", "IRCNet (http://www.ircnet.org)
  310. OnClick = ChangeServerName2
  311. END CREATE
  312. 'CREATE ServerListOK AS QBUTTON
  313. ' 'Kind = bkOK
  314. ' Width = 80
  315. 'Caption = "Set Server"
  316. ' Top = ServerNameHelp.Top
  317. ' Left = ServerListLabel2.Left + 57
  318. ' 'ModalResult = mrOK
  319. ' OnClick = ChangeServerName2
  320. 'END CREATE
  321. CREATE NoConCheckBox AS QCHECKBOX
  322. Left = ServerListLabel2.Left
  323. Top = ServerListBox1.Top + 130
  324. Caption = "Don't connect automatically"
  325. Width = 170
  326. OnClick = AddNoConFlag
  327. END CREATE
  328. CREATE NoircrcCheckBox AS QCHECKBOX
  329. Left = NoConCheckBox.Left
  330. Top = NoConCheckBox.Top + 20
  331. Caption = "Don't load ircrc"
  332. Width = 170
  333. OnClick = AddNoircrcFlag
  334. END CREATE
  335. CREATE XDebugCheckBox AS QCHECKBOX
  336. Left = NoConCheckBox.Left
  337. Top = NoircrcCheckBox.Top + 20
  338. Caption = "X_Debug Mode"
  339. OnClick = AddXDebugFlag
  340. Width = 170
  341. END CREATE
  342. CREATE ChanConnectCheckBox AS QCHECKBOX
  343. Left = PortNumLabel.Left + 70
  344. Top = PortNumLabel.Top
  345. Caption = "Join channel:"
  346. OnClick = AddJoinChannel
  347. Width = 170
  348. END CREATE
  349. CREATE ChannelNameEdit AS QEDIT
  350. Top = ChanConnectCheckBox.Top + 17
  351. Left = ChanConnectCheckBox.Left
  352. Width = 160
  353. Text = "#irchelp"
  354. Enabled = False
  355. MaxLength = 100
  356. END CREATE
  357. CREATE PassConnectCheckBox AS QCHECKBOX
  358. Left = ChanConnectCheckBox.Left
  359. Top = ChannelNameEdit.Top + 30
  360. Caption = "Server password:"
  361. OnClick = PasswdConnectOpt
  362. Width = 170
  363. END CREATE
  364. CREATE PassConnectEdit AS QEDIT
  365. Top = PassConnectCheckBox.Top + 17
  366. Left = PassConnectCheckBox.Left
  367. Width = 160
  368. Enabled = False
  369. MaxLength = 32
  370. END CREATE
  371. CREATE RunEpic AS QBUTTON
  372. Top = 260
  373. Left = 350
  374. Width = 100
  375. Caption = "Run EPIC"
  376. OnClick = RunWithCurrOpt
  377. END CREATE
  378. 'CREATE URLLabel1 AS QLABEL
  379. ' Left = 10
  380. ' Top = 270
  381. ' Width = 100
  382. ' Caption = "http://www.2mbit.com/software.html - v2.0.2"
  383. ' Font = HeaderFont3
  384. 'END CREATE
  385. CREATE StatusBar AS QStatusBar
  386. AddPanels "",""
  387. Panel(0).Width = 380
  388. 'Panel(0).Caption = str$(StatusBar.Panel(0).Width)
  389. Panel(1).Caption = "Version 2.0.2"
  390. SizeGrip = False
  391. END CREATE
  392. END CREATE
  393. SUB SaveOptToDisk
  394. SaveEPICini
  395. ShowMessage("The config has been saved.")
  396. LoadConfig.Enabled = True
  397. DelOptions.Enabled = True
  398. END SUB
  399. SUB ReadOptFromDisk
  400. IF FILEEXISTS("epic4.ini") THEN
  401. NickEdit.Text = EPICIniFile.ReadEntry("Config","IRCNICK")
  402. UserNameEdit.Text = EPICIniFile.ReadEntry("Config","IRCUSER")
  403. PortNumEdit.Text = EPICIniFile.ReadEntry("Config","IRCPORT")
  404. ServerNameEdit.Text = EPICIniFile.ReadEntry("Config","IRCSERVER")
  405. FullNameEdit.Text = EPICIniFile.ReadEntry("Config","REALNAME")
  406. ChannelNameEdit.Text = EPICIniFile.ReadEntry("Config","CHANNEL")
  407. PassConnectEdit.Text = EPICIniFile.ReadEntry("Config","PASSWORD")
  408. 'ShowMessage("The config file has been loaded")
  409. ELSE
  410. ShowMessage("The config file does not exist. You should change the options above and click Save Options first.")
  411. END IF
  412. END SUB
  413. '--------- NickName Help Display
  414. SUB NickClick
  415. ShowMessage("You can enter a nickname here. Nicknames must consist of letters and numbers and _
  416. can be up to 30 characters on most IRC networks. The only exception is EFNet, _
  417. which has a max of 9 characters.")
  418. END SUB
  419. '-------- Full Name Help Display
  420. SUB FullNameClick
  421. ShowMessage("You can enter your full name here. If you don't want to put your full name here, _
  422. that is ok too - anything is acceptable. It is part of your WHOIS response.")
  423. END SUB
  424. '-------- User Name Help Display
  425. SUB UserNameClick
  426. ShowMessage("You can enter your user name here. If you don't have Identd installed, this is the _
  427. username passed to the server. This can be only letters and numbers, and is a _
  428. max of 9 characters. If you have an Ident (AKA Auth) server installed on your machine_
  429. , this has no affect.")
  430. END SUB
  431. '---------- Server Name Help
  432. SUB ServerNameClick
  433. ShowMessage("You can enter a server name here, or click one of the servers to the right to use a preset.")
  434. END SUB
  435. '-------- About Dialog Display
  436. CREATE AboutMenuDlg AS QFORM
  437. BorderStyle = bsDialog
  438. Center
  439. Caption = "About This Program..."
  440. Height = 200
  441. Width = 500
  442. CREATE AboutMenuLabel1 AS QLABEL
  443. Left = 47
  444. Top = 2
  445. Width = 300
  446. Caption = "ircII EPIC4 Config Menu"
  447. Font = HeaderFont
  448. END CREATE
  449. CREATE AboutMenuLabel2 AS QLABEL
  450. Left = 20
  451. Top = AboutMenuLabel1.Top + 40
  452. Width = 300
  453. Caption = "Copyright The Summit Open Source Development Group 2002"
  454. Font = HeaderFont2
  455. END CREATE
  456. CREATE AboutMenuLabel3 AS QLABEL
  457. Left = 5
  458. Top = 160
  459. Width = 100
  460. Caption = "http://www.2mbit.com"
  461. Font = HeaderFont3
  462. END CREATE
  463. CREATE AboutMenuLabel4 AS QLABEL
  464. Left = 25
  465. Top = AboutMenuLabel2.Top + 30
  466. WordWrap = True
  467. Width = 524
  468. Caption = "Developed by Brian Bruns (bruns@2mbit.com) for use with the ircII EPIC4 client on Windows 9x/ME/NT/2k/XP. Developed under Rapid-Q from basicguru.com."
  469. Font = HeaderFont4
  470. END CREATE
  471. CREATE AboutMenuOK AS QBUTTON
  472. Kind = bkOK
  473. Width = 50
  474. Top = 145
  475. Left = 225
  476. ModalResult = mrOK
  477. OnClick = AboutMenuClose
  478. END CREATE
  479. END CREATE
  480. SUB AboutMenuShow
  481. AboutMenuDlg.Show
  482. END SUB
  483. SUB AboutMenuClose
  484. AboutMenuDlg.Close
  485. END SUB
  486. '-- Quit Program
  487. SUB QuitProgram
  488. 'MainForm.Close
  489. Application.Terminate
  490. END SUB
  491. SUB ChangeServerName2 (Sender AS QLISTBOX)
  492. ServerNameEdit.Text = REPLACESUBSTR$(FIELD$(Sender.item(Sender.ItemIndex),":",2),CHR$(09),"")
  493. END SUB
  494. SUB DispServerList
  495. 'ServerListDlg.Show
  496. END SUB
  497. SUB DispServerListClose
  498. 'ServerListDlg.Close
  499. END SUB
  500. CREATE MenuOptWin AS QFORM
  501. BorderStyle = bsDialog
  502. Center
  503. Caption = "Menu Configuration"
  504. Height = 400
  505. Width = 420
  506. CREATE EPIC4PathLabel AS QLABEL
  507. Caption = "Path to the epic4 directory:"
  508. Top = 10
  509. Left = 5
  510. END CREATE
  511. CREATE EPIC4Path AS QEDIT
  512. Top = EPIC4PathLabel.Top + 20
  513. Left = 5
  514. Width = 400
  515. Text = "C:\epic4"
  516. MaxLength = 255
  517. END CREATE
  518. CREATE EPIC4BinaryLabel AS QLABEL
  519. Caption = "Path to the epic4 binary:"
  520. Top = EPIC4Path.Top + 30
  521. Left = 5
  522. END CREATE
  523. CREATE EPIC4Binary AS QEDIT
  524. Top = EPIC4BinaryLabel.Top + 20
  525. Left = 5
  526. Width = 400
  527. Text = "C:\epic4\bin\epic.exe"
  528. MaxLength = 255
  529. END CREATE
  530. CREATE EPIC4TermInfoLabel AS QLABEL
  531. Caption = "Path to the Terminfo files:"
  532. Top = EPIC4Binary.Top + 30
  533. Left = 5
  534. END CREATE
  535. CREATE EPIC4TermInfo AS QEDIT
  536. Top = EPIC4TermInfoLabel.Top + 20
  537. Left = 5
  538. Width = 400
  539. Text = "C:\epic4\terminfo"
  540. MaxLength = 255
  541. END CREATE
  542. CREATE EPIC4DocsLabel AS QLABEL
  543. Caption = "Path to the EPIC4 documentation:"
  544. Top = EPIC4TermInfo.Top + 30
  545. Left = 5
  546. END CREATE
  547. CREATE EPIC4Docs AS QEDIT
  548. Top = EPIC4DocsLabel.Top + 20
  549. Left = 5
  550. Width = 400
  551. Text = "C:\epic4\docs"
  552. MaxLength = 255
  553. END CREATE
  554. CREATE EPIC4ExtraOptLabel AS QLABEL
  555. Caption = "Extra Options For EPIC:"
  556. Top = EPIC4Docs.Top + 30
  557. Left = 5
  558. END CREATE
  559. CREATE EPIC4ExtraOpt AS QEDIT
  560. Top = EPIC4ExtraOptLabel.Top + 20
  561. Left = 5
  562. Width = 400
  563. Text = ""
  564. MaxLength = 255
  565. END CREATE
  566. CREATE RXVTBinLabel AS QLABEL
  567. Caption = "Path to the RXVT binary:"
  568. Top = EPIC4ExtraOpt.Top + 30
  569. Left = 5
  570. END CREATE
  571. CREATE RXVTBinary AS QEDIT
  572. Top = RXVTBinLabel.Top + 20
  573. Left = 5
  574. Width = 400
  575. Text = "C:\epic4\bin\rxvt.exe"
  576. MaxLength = 255
  577. END CREATE
  578. CREATE OptWinOK AS QBUTTON
  579. Kind = bkOK
  580. Width = 80
  581. Top = 340
  582. Left = 5
  583. 'ModalResult = mrOk
  584. OnClick = CloseMenuOpt
  585. END CREATE
  586. CREATE OptWinCancel AS QBUTTON
  587. Kind = bkCancel
  588. Width = 80
  589. Top = 340
  590. Left = OptWinOk.Left + 90
  591. 'ModalResult = mrCanel
  592. OnClick = CancelMenuOpt
  593. END CREATE
  594. CREATE OptWinReset AS QBUTTON
  595. Width = 120
  596. Caption = "Reset To Defaults"
  597. Top = 340
  598. Left = OptWinCancel.Left + 90
  599. OnClick = OptWinResetDefaults
  600. END CREATE
  601. END CREATE
  602. Sub ShowMenuOpt
  603. SaveTempOpt
  604. MenuOptWin.Show
  605. END SUB
  606. Sub CloseMenuOpt
  607. MenuContent.Clear
  608. MenuContent.AddItems "EPICPath="+EPIC4Path.Text
  609. MenuContent.AddItems "EPICBin="+EPIC4Binary.Text
  610. MenuContent.AddItems "Terminfo="+EPIC4TermInfo.Text
  611. MenuContent.AddItems "EPICDocs="+EPIC4Docs.Text
  612. MenuContent.AddItems "EPICExtra="+EPIC4ExtraOpt.Text
  613. MenuContent.AddItems "RXVTBin="+RXVTBinary.Text
  614. KILL "menu.ini"
  615. MenuIniFile.WriteSection "Config",MenuContent
  616. MenuOptWin.Close
  617. StatusBar.Panel(0).Caption = "Menu configuration saved."
  618. END SUB
  619. Sub ReadMenuOpt
  620. IF FILEEXISTS("menu.ini") THEN
  621. EPIC4Path.Text = MenuIniFile.ReadEntry("Config","EPICPath")
  622. EPIC4Binary.Text = MenuIniFile.ReadEntry("Config","EPICBin")
  623. EPIC4TermInfo.Text = MenuIniFile.ReadEntry("Config","Terminfo")
  624. EPIC4Docs.Text = MenuIniFile.ReadEntry("Config","EPICDocs")
  625. EPIC4ExtraOpt.Text = MenuIniFile.ReadEntry("Config","EPICExtra")
  626. RXVTBinary.Text = MenuIniFile.ReadEntry("Config","RXVTBin")
  627. END IF
  628. End Sub
  629. Sub SaveTempOpt
  630. EPIC4PathCurr = EPIC4Path.Text
  631. EPIC4BinCurr = EPIC4Binary.Text
  632. EPIC4TermInfoCurr = EPIC4TermInfo.Text
  633. EPIC4DocsCurr = EPIC4Docs.Text
  634. EPIC4ExtraOptCurr = EPIC4ExtraOpt.Text
  635. RXVTBinCurr = RXVTBinary.Text
  636. END SUB
  637. Sub OptWinResetDefaults
  638. EPIC4Path.Text = "C:\epic4"
  639. EPIC4Binary.Text = "C:\epic4\bin\epic.exe"
  640. EPIC4TermInfo.Text = "C:\epic4\terminfo"
  641. EPIC4Docs.Text = "C:\epic4\docs"
  642. EPIC4ExtraOpt.Text = ""
  643. RXVTBinary.Text = "C:\epic4\bin\rxvt.exe"
  644. END SUB
  645. Sub CancelMenuOpt
  646. EPIC4Path.Text = EPIC4PathCurr
  647. EPIC4Binary.Text = EPIC4BinCurr
  648. EPIC4TermInfo.Text = EPIC4TermInfoCurr
  649. EPIC4Docs.Text = EPIC4DocsCurr
  650. EPIC4ExtraOpt.Text = EPIC4ExtraOptCurr
  651. RXVTBinary.Text = RXVTBinCurr
  652. MenuOptWin.Close
  653. StatusBar.Panel(0).Caption = "Menu configuration changes canceled."
  654. END SUB
  655. SUB AddNoConFlag
  656. IF NoConCheckBox.Checked THEN
  657. NoConStr = " -s "
  658. ChanConnectCheckBox.Enabled = False
  659. ChannelNameEdit.Enabled = False
  660. 'PassConnectCheckBox.Enabled = False
  661. 'PassConnectEdit.Enabled = False
  662. ELSE
  663. NoConStr = ""
  664. ChanConnectCheckBox.Enabled = True
  665. AddJoinChannel
  666. 'ChannelNameEdit.Enabled = True
  667. 'PassConnectCheckBox.Enabled = True
  668. 'PassConnectEdit.Enabled = True
  669. END IF
  670. END SUB
  671. SUB AddNoircrcFlag
  672. IF NoircrcCheckBox.Checked THEN
  673. NoircrcStr = " -q "
  674. ELSE
  675. NoircrcStr = ""
  676. END IF
  677. END SUB
  678. SUB AddXDebugFlag
  679. IF XDebugCheckBox.Checked THEN
  680. XDebugStr = " -x "
  681. ELSE
  682. XDebugStr = ""
  683. END IF
  684. END SUB
  685. SUB AddJoinChannel
  686. IF ChanConnectCheckBox.Checked THEN
  687. ChannelNameEdit.Enabled = True
  688. JoinChanStr = " -c "+ChannelNameEdit.Text+" "
  689. ELSE
  690. ChannelNameEdit.Enabled = False
  691. JoinChanStr = ""
  692. END IF
  693. END SUB
  694. SUB PasswdConnectOpt
  695. IF PassConnectCheckBox.Checked THEN
  696. PassConnectEdit.Enabled = True
  697. PasswordStr = PassConnectEdit.Text
  698. ELSE
  699. PassConnectEdit.Enabled = False
  700. PasswordStr = ""
  701. END IF
  702. END SUB
  703. SUB RunWithCurrOpt
  704. DIM EPIC4Bin AS STRING
  705. DIM RXVTBin AS STRING
  706. EPIC4Bin = EPIC4Binary.Text
  707. RXVTBin = RXVTBinary.Text
  708. AddJoinChannel
  709. IF PassConnectCheckBox.Checked THEN
  710. ServerConnectStr = ServerNameEdit.Text+":"+PortNumEdit.Text+":"+PasswordStr
  711. ELSE
  712. ServerConnectStr = ServerNameEdit.Text+":"+PortNumEdit.Text
  713. END IF
  714. IF FILEEXISTS(EPIC4Bin) THEN
  715. ENVIRON "TERMINFO="+EPIC4TermInfo.Text
  716. ENVIRON "HOME="+EPIC4Path.Text
  717. ENVIRON "IRCNAME="+FullNameEdit.Text
  718. 'ENVIRON "HELP_PATH="+EPIC4Path.Text+"\share\epic\help"
  719. 'CmdLineOpts = NickEdit.Text+" -z "+UserNameEdit.Text+" -p "+PortNumEdit.Text+" "+NoConStr+NoircrcStr+XDebugStr+JoinChanStr+" "+EPIC4ExtraOpt.Text+" "+ServerNameEdit.Text
  720. CmdLineOpts = NickEdit.Text+" -z "+UserNameEdit.Text+" "+NoConStr+NoircrcStr+XDebugStr+JoinChanStr+" "+EPIC4ExtraOpt.Text+" "+ServerConnectStr
  721. RUN RXVTBin+" +ut -sr -sl 5000 -tn xterm -e "+EPIC4Bin+" -n "+CmdLineOpts
  722. 'ShowMessage(CmdLineOpts)
  723. StatusBar.Panel(0).Caption = CmdLineOpts
  724. QuitProgram
  725. ELSE
  726. ShowMessage("Error: The EPIC4 application was not found. Please check the paths under Tools -> Configure Menu Settings.")
  727. StatusBar.Panel(0).Caption = "The EPIC4 application was not found!"
  728. END IF
  729. END SUB
  730. SUB DelOptFile
  731. KILL "epic4.ini"
  732. 'ShowMessage("Config file deleted.")
  733. StatusBar.Panel(0).Caption = "EPIC4 config file deleted."
  734. LoadConfig.Enabled = False
  735. DelOptions.Enabled = False
  736. END SUB
  737. SUB ChkCfgExist
  738. IF FILEEXISTS("epic4.ini") THEN
  739. LoadConfig.Enabled = True
  740. DelOptions.Enabled = True
  741. StatusBar.Panel(0).Caption = "EPIC4 config file found and loaded."
  742. ReadOptFromDisk
  743. ELSE
  744. StatusBar.Panel(0).Caption = "EPIC4 config file not found. Loaded default settings."
  745. LoadConfig.Enabled = False
  746. DelOptions.Enabled = False
  747. END IF
  748. END SUB
  749. Sub SaveEPICini
  750. EPICContent.Clear
  751. EPICContent.AddItems "IRCNICK="+NickEdit.Text
  752. EPICContent.AddItems "IRCUSER="+UserNameEdit.Text
  753. EPICContent.AddItems "IRCPORT="+PortNumEdit.Text
  754. EPICContent.AddItems "IRCSERVER="+ServerNameEdit.Text
  755. EPICContent.AddItems "REALNAME="+FullNameEdit.Text
  756. EPICContent.AddItems "CHANNEL="+ChannelNameEdit.Text
  757. EPICContent.AddItems "PASSWORD="+PassConnectEdit.Text
  758. KILL "epic4.ini"
  759. EPICIniFile.WriteSection "Config",EPICContent
  760. End Sub
  761. CREATE EPICTxtWin AS QFORM
  762. BorderStyle = bsDialog
  763. Center
  764. Caption = "EPIC Information"
  765. Height = 400
  766. Width = 500
  767. CREATE REVersion AS QRICHEDIT
  768. ScrollBars = ssBoth
  769. ReadOnly = True
  770. Left = 5
  771. Top = 2
  772. Height = 330
  773. Width = 483
  774. END CREATE
  775. CREATE ReadMe AS QBUTTON
  776. Top = 340
  777. Left = 5
  778. Width = 80
  779. Caption = "EPIC (Win32)"
  780. OnClick = LoadWin32Readme
  781. END CREATE
  782. CREATE ReadMe2 AS QBUTTON
  783. Top = ReadMe.Top
  784. Left = ReadMe.Left + 90
  785. Width = 80
  786. Caption = "EPIC (UNIX)"
  787. OnClick = LoadUNIXReadme
  788. END CREATE
  789. CREATE License AS QBUTTON
  790. Top = ReadMe.Top
  791. Left = ReadMe2.Left + 90
  792. Width = 80
  793. Caption = "License"
  794. OnClick = LoadLicense
  795. END CREATE
  796. CREATE VersionHistory AS QBUTTON
  797. Top = ReadMe.Top
  798. Left = License.Left + 90
  799. Width = 80
  800. Caption = "Versions"
  801. OnClick = LoadVersHistory
  802. END CREATE
  803. CREATE TXTWinOK AS QBUTTON
  804. Kind = bkOK
  805. Width = 50
  806. Top = ReadMe.Top
  807. Left = VersionHistory.Left + 150
  808. ModalResult = mrOK
  809. OnClick = CloseVerHistory
  810. END CREATE
  811. END CREATE
  812. Sub LoadWin32Readme
  813. IF FILEEXISTS(EPIC4Docs.Text+"\readme.txt") THEN
  814. REVersion.LoadFromFile EPIC4Docs.Text+"\readme.txt"
  815. ELSE
  816. ShowMessage("Warning: readme.txt was not found. Unable to display!")
  817. END IF
  818. End Sub
  819. Sub LoadUNIXReadme
  820. IF FILEEXISTS(EPIC4Docs.Text+"\readme-unix.txt") THEN
  821. REVersion.LoadFromFile EPIC4Docs.Text+"\readme-unix.txt"
  822. ELSE
  823. ShowMessage("Warning: readme-unix.txt was not found. Unable to display!")
  824. END IF
  825. End Sub
  826. Sub LoadLicense
  827. IF FILEEXISTS(EPIC4Docs.Text+"\copyright.txt") THEN
  828. REVersion.LoadFromFile EPIC4Docs.Text+"\copyright.txt"
  829. ELSE
  830. ShowMessage("Warning: copyright.txt was not found. Unable to display!")
  831. END IF
  832. End Sub
  833. Sub LoadVersHistory
  834. IF FILEEXISTS(EPIC4Docs.Text+"\version.txt") THEN
  835. REVersion.LoadFromFile EPIC4Docs.Text+"\version.txt"
  836. ELSE
  837. ShowMessage("Warning: version.txt was not found. Unable to display!")
  838. END IF
  839. End Sub
  840. Sub ShowVerHistory
  841. EPICTxtWin.Show
  842. END SUB
  843. Sub CloseVerHistory
  844. EPICTxtWin.Close
  845. END SUB
  846. Sub Editircrc
  847. IF FILEEXISTS(EPIC4Path.Text+"\ircrc") THEN
  848. RUN "notepad.exe "+EPIC4Path.Text+"\ircrc"
  849. ELSE
  850. DIM IRCRCFile AS QFileStream
  851. IRCRCFile.Open(EPIC4Path.Text+"\ircrc", fmCreate)
  852. IRCRCFile.WriteLine("# This is a blank ircrc file.")
  853. IRCRCFile.WriteLine("# You can load up your EPIC4 scripts here or put")
  854. IRCRCFile.WriteLine("# commands you want run when the client connects.")
  855. IRCRCFile.Close
  856. RUN "notepad.exe "+EPIC4Path.Text+"\ircrc"
  857. END IF
  858. End Sub
  859. Sub LoadServerList
  860. ServerFile.Open("ircservers.txt", fmOpenRead)
  861. ServerListBox1.Clear
  862. Y# = 0
  863. Do
  864. ServerListBox1.AddItems ServerFile.ReadLine
  865. Y++
  866. Loop until ServerFile.eof
  867. 'ShowMessage(FIELD$(ServerListBox1.Item(0), CHR$(09), 2))
  868. END SUB
  869. Sub ChkServerListExist
  870. IF FILEEXISTS("ircservers.txt") THEN
  871. ' Nothing to do
  872. ELSE
  873. ServerListFile.Open("ircservers.txt", fmCreate)
  874. ServerListFile.WriteLine("EFNet:"+CHR$(09)+CHR$(09)+"us.rr.efnet.net")
  875. ServerListFile.WriteLine("DALNet:"+CHR$(09)+CHR$(09)+"irc.dal.net")
  876. ServerListFile.WriteLine("OFTC:"+CHR$(09)+CHR$(09)+"irc.oftc.net")
  877. ServerListFile.WriteLine("XIPH:"+CHR$(09)+CHR$(09)+"irc.xiph.org")
  878. ServerListFile.WriteLine("FreeNode:"+CHR$(09)+"irc.openprojects.net")
  879. ServerListFile.WriteLine("IRCNet:"+CHR$(09)+CHR$(09)+"irc.ircnet.org")
  880. ServerListFile.WriteLine("UnderNet:"+CHR$(09)+"us.undernet.org")
  881. ServerListFile.Close
  882. END IF
  883. END Sub
  884. 'FullNameEdit.Enabled = False
  885. ' Its not working correctly with the addition of the password and channel boxes
  886. 'NoConCheckBox.Enabled = False
  887. ChkServerListExist
  888. LoadServerList
  889. ReadMenuOpt
  890. ChkCfgExist
  891. MainForm.ShowModal