Xfone shiite

This commit is contained in:
dcp1990 2005-06-27 20:47:08 +00:00
parent eed51cae67
commit 22eee03db6
4 changed files with 56 additions and 9 deletions

View File

@ -1,17 +1,22 @@
# main makefile...
# $Amigan: phoned/Makefile,v 1.7 2005/06/27 00:15:42 dcp1990 Exp $
# $Amigan: phoned/Makefile,v 1.8 2005/06/27 20:47:08 dcp1990 Exp $
# Oh My Fucking God, this is such a big, unportable mess. Oh well.
# BSD Make > *
include global.mk
APPS=phonectl phoned lib scripts
APPSUF=${APPS:S/$/_app/}
APPSCLEAN=${APPS:S/$/_cl/}
CLEANFILES=.config
all: ${APPSUF}
${APPSUF}:
${APPSUF}: .config
@cd ${@:S/_app$//} && make
clean: ${APPSCLEAN} ourclean
${APPSCLEAN}:
@cd ${@:S/_cl$//} && make clean
ourclean:
.config:
./configure.tcl $(PREFIX)
# rm -f .conf
#.conf:
# @perl -e 'require 5.0001; require Modem::fgetty' \

View File

@ -27,7 +27,10 @@
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
# $Amigan: phoned/xfone/maindlg.tcl,v 1.3 2005/06/27 00:08:47 dcp1990 Exp $
# $Amigan: phoned/xfone/maindlg.tcl,v 1.4 2005/06/27 20:47:09 dcp1990 Exp $
package require Tk
# important
package require tablelist
# vars
proc logindlg {} {
toplevel .login
@ -48,6 +51,34 @@ proc logindlg {} {
wm resizable .login 0 0
wm title .login "Login"
}
proc addtocallslist {dta} {
if {![winfo exists .calls]} return
set tlb .calls.m.lb
set flds [split $dta :]
set date [join [list [lindex $flds 0] [lindex $flds 1]] /]
set time [join [list [lindex $flds 2] : [lindex $flds 3]]
set name [lindex $flds 4]
set numb [lindex $flds 5]
$tlb insert [list $date $time $name $numb] end
}
proc calls {} {
global loggedin
if {!$loggedin} return
toplevel .calls
set f .calls.m
frame $f
grid $f -row 0
set g .calls.acts
frame $g
grid $g -row 1
#altre
set tlb [set f].lb
tablelist::tablelist $tlb -columns {0 "Time" 1 "Date" 2 "Name" 3 "Number"} -stretch all
grid $tlb -row 0 -column 0
#btns
button $g.inf -text "Info"
grid $g.inf -row 0 -column 0
}
set prj .mbar.project
set phdm .mbar.phoned
#frame
@ -74,7 +105,7 @@ menu .mbar.help -tearoff no
# main widgets
set w .m.calls
button .m.calls -text "Calls"
button .m.calls -text "Calls" -command calls
$w configure -font "[font actual [$w cget -font]] -size 20"
set w .m.msgs
button .m.msgs -text "Messages"

View File

@ -27,9 +27,9 @@
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
# $Amigan: phoned/xfone/phoned.tcl,v 1.5 2005/06/27 00:08:47 dcp1990 Exp $
load ./udom.so
# $Amigan: phoned/xfone/phoned.tcl,v 1.6 2005/06/27 20:47:09 dcp1990 Exp $
set loggedin false
set callscb addtocallslist
proc openSock {sfile} {
set os [udom -file $sfile]
fconfigure $os -buffering line -blocking false
@ -42,15 +42,20 @@ proc handleme {fh} {
proc parseres {res} {
# 501 = success, 514 = failure
# tk_messageBox -message $res -type ok -title Result
if {[regexp -- "^(\[0-9\]{3}) (\[A-Z\]+): (.*)$" $res a code msg english]} {
global loggedin
global callscb
if {[regexp -- "^(\[0-9\]{3}) (\[A-Z\]+): (.*)$" $res a code msg data]} {
switch $code {
501 {
tk_messageBox -message "Logged in!" -type ok -title "Login"
set loggedin true
}
514 {
set res [tk_messageBox -message "Login failure." -type retrycancel]
switch $res { retry {logindlg} cancel {return} }
}
700 {
$callscb $data
default {
tk_messageBox -message [list Result was $res] -type ok -title "Result"
}

View File

@ -27,8 +27,14 @@
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
# $Amigan: phoned/xfone/xfone.tcl,v 1.2 2005/06/26 16:51:00 dcp1990 Exp $
# $Amigan: phoned/xfone/xfone.tcl,v 1.3 2005/06/27 20:47:09 dcp1990 Exp $
source paths.tcl
#modules
load $udom_lib
source config.tcl
source phoned.tcl
source maindlg.tcl
source init.tcl