]> gitweb.factorcode.org Git - factor.git/commitdiff
Added irc.ui.load; now "irc.ui" run works
authorWilliam Schlieper <schlieper@unc.edu>
Wed, 16 Jul 2008 04:02:04 +0000 (00:02 -0400)
committerWilliam Schlieper <schlieper@unc.edu>
Wed, 16 Jul 2008 04:02:04 +0000 (00:02 -0400)
extra/irc/ui/ircui-rc [new file with mode: 0755]
extra/irc/ui/load/load.factor [new file with mode: 0755]
extra/irc/ui/ui.factor

diff --git a/extra/irc/ui/ircui-rc b/extra/irc/ui/ircui-rc
new file mode 100755 (executable)
index 0000000..a1533c7
--- /dev/null
@@ -0,0 +1,9 @@
+! Default system ircui-rc file\r
+! Copy into .ircui-rc in your home directory and then change username and such\r
+! To find your home directory, type "home ." into a Factor listener\r
+\r
+USING: irc.client irc.ui ;\r
+\r
+"irc.freenode.org" 8001 "factor-irc" f ! server port nick password\r
+{ "#concatenative" "#terrorisland" } ! all the channels you want to autojoin\r
+server-open\r
diff --git a/extra/irc/ui/load/load.factor b/extra/irc/ui/load/load.factor
new file mode 100755 (executable)
index 0000000..6655f31
--- /dev/null
@@ -0,0 +1,16 @@
+! Copyright (C) 2008 William Schlieper\r
+! See http://factorcode.org/license.txt for BSD license.\r
+\r
+USING: kernel io.files parser editors sequences ;\r
+\r
+IN: irc.ui.load\r
+\r
+: file-or ( path path -- path ) over exists? ? ;\r
+\r
+: personal-ui-rc ( -- path ) home ".ircui-rc" append-path ;\r
+\r
+: system-ui-rc ( -- path ) "extra/irc/ui/ircui-rc" resource-path ;\r
+\r
+: ircui-rc ( -- path ) personal-ui-rc system-ui-rc file-or ;\r
+\r
+: run-ircui ( -- ) ircui-rc run-file ;\r
index 2266c51f41d400041949eb54f0db9386b9c00e42..12f9d0118391b33ab19b03027f39af680f51ea83 100755 (executable)
@@ -6,9 +6,9 @@ USING: accessors kernel threads combinators concurrency.mailboxes
        ui ui.gadgets ui.gadgets.panes ui.gadgets.editors\r
        ui.gadgets.scrollers ui.commands ui.gadgets.frames ui.gestures\r
        ui.gadgets.tabs ui.gadgets.grids\r
-       io io.styles namespaces irc.client irc.client.private\r
-       irc.messages irc.messages.private irc.ui.commandparser\r
-       calendar calendar.format ;\r
+       io io.styles namespaces calendar calendar.format\r
+       irc.client irc.client.private irc.messages irc.messages.private\r
+       irc.ui.commandparser irc.ui.load ;\r
 \r
 IN: irc.ui\r
 \r
@@ -145,6 +145,10 @@ M: irc-page ungraft*
     [ listeners>> +server-listener+ swap at <irc-pane> <scroller>\r
       "Server" associate <tabbed> >>tabs ] bi ;\r
 \r
-: freenode-connect ( -- ui-window )\r
-    "irc.freenode.org" 8001 "factor-irc" f\r
-    <irc-profile> ui-connect [ irc-window ] keep ;\r
+: server-open ( server port nick password channels -- )\r
+    [ <irc-profile> ui-connect [ irc-window ] keep ] dip\r
+    [ over join-channel ] each ;\r
+\r
+: main-run ( -- ) run-ircui ;\r
+\r
+MAIN: main-run\r