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... # 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. # Oh My Fucking God, this is such a big, unportable mess. Oh well.
# BSD Make > * # BSD Make > *
include global.mk
APPS=phonectl phoned lib scripts APPS=phonectl phoned lib scripts
APPSUF=${APPS:S/$/_app/} APPSUF=${APPS:S/$/_app/}
APPSCLEAN=${APPS:S/$/_cl/} APPSCLEAN=${APPS:S/$/_cl/}
CLEANFILES=.config
all: ${APPSUF} all: ${APPSUF}
${APPSUF}: ${APPSUF}: .config
@cd ${@:S/_app$//} && make @cd ${@:S/_app$//} && make
clean: ${APPSCLEAN} ourclean clean: ${APPSCLEAN} ourclean
${APPSCLEAN}: ${APPSCLEAN}:
@cd ${@:S/_cl$//} && make clean @cd ${@:S/_cl$//} && make clean
ourclean: ourclean:
.config:
./configure.tcl $(PREFIX)
# rm -f .conf # rm -f .conf
#.conf: #.conf:
# @perl -e 'require 5.0001; require Modem::fgetty' \ # @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 # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE. # 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 # vars
proc logindlg {} { proc logindlg {} {
toplevel .login toplevel .login
@ -48,6 +51,34 @@ proc logindlg {} {
wm resizable .login 0 0 wm resizable .login 0 0
wm title .login "Login" 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 prj .mbar.project
set phdm .mbar.phoned set phdm .mbar.phoned
#frame #frame
@ -74,7 +105,7 @@ menu .mbar.help -tearoff no
# main widgets # main widgets
set w .m.calls 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" $w configure -font "[font actual [$w cget -font]] -size 20"
set w .m.msgs set w .m.msgs
button .m.msgs -text "Messages" 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 # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE. # SUCH DAMAGE.
# #
# $Amigan: phoned/xfone/phoned.tcl,v 1.5 2005/06/27 00:08:47 dcp1990 Exp $ # $Amigan: phoned/xfone/phoned.tcl,v 1.6 2005/06/27 20:47:09 dcp1990 Exp $
load ./udom.so set loggedin false
set callscb addtocallslist
proc openSock {sfile} { proc openSock {sfile} {
set os [udom -file $sfile] set os [udom -file $sfile]
fconfigure $os -buffering line -blocking false fconfigure $os -buffering line -blocking false
@ -42,15 +42,20 @@ proc handleme {fh} {
proc parseres {res} { proc parseres {res} {
# 501 = success, 514 = failure # 501 = success, 514 = failure
# tk_messageBox -message $res -type ok -title Result # 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 { switch $code {
501 { 501 {
tk_messageBox -message "Logged in!" -type ok -title "Login" tk_messageBox -message "Logged in!" -type ok -title "Login"
set loggedin true
} }
514 { 514 {
set res [tk_messageBox -message "Login failure." -type retrycancel] set res [tk_messageBox -message "Login failure." -type retrycancel]
switch $res { retry {logindlg} cancel {return} } switch $res { retry {logindlg} cancel {return} }
} }
700 {
$callscb $data
default { default {
tk_messageBox -message [list Result was $res] -type ok -title "Result" 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 # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE. # 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 config.tcl
source phoned.tcl source phoned.tcl
source maindlg.tcl source maindlg.tcl
source init.tcl source init.tcl