← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 4489: [mydatamart] increased timeout for login to 20 seconds. Some minor improvements to indicate logi...

 

------------------------------------------------------------
revno: 4489
committer: Bob Jolliffe bobjolliffe@xxxxxxxxx
branch nick: dhis2
timestamp: Wed 2011-08-31 15:17:36 +0100
message:
  [mydatamart] increased timeout for login to 20 seconds.  Some minor improvements to indicate login progress to user.
modified:
  tools/datamart/mydatamart.vfs/appinit.tcl
  tools/datamart/mydatamart.vfs/settings.tcl


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'tools/datamart/mydatamart.vfs/appinit.tcl'
--- tools/datamart/mydatamart.vfs/appinit.tcl	2011-08-05 12:31:11 +0000
+++ tools/datamart/mydatamart.vfs/appinit.tcl	2011-08-31 14:17:36 +0000
@@ -18,6 +18,9 @@
 set ::dhis(resource) [file join $starkit::topdir resource]
 set ::dhis(createQuery) [file join $::dhis(resource) sql/create.sql]
 
+# set 20s default login timeout
+set ::dhis(login_timeout) 20000
+
 # organize a place for temp stuff ...
 set tmpdir "/tmp"
 if { [info exists ::env(TMP)] } {

=== modified file 'tools/datamart/mydatamart.vfs/settings.tcl'
--- tools/datamart/mydatamart.vfs/settings.tcl	2011-08-02 19:21:56 +0000
+++ tools/datamart/mydatamart.vfs/settings.tcl	2011-08-31 14:17:36 +0000
@@ -47,7 +47,8 @@
 	-row $row -column 1 -padx 20 -pady 2 -sticky w
 
     grid [ttk::button $settingsFrame.login -text [mc "Login"] -command {
-	dhisweb::login $::dhis(url) $::dhis(username) $::dhis(password)
+	set ::dhis(status) "Logging in to $::dhis(url)"
+	dhisweb::login $::dhis(url) $::dhis(username) $::dhis(password) $::dhis(login_timeout)
 	persistLocal url $::dhis(url)
 	persistLocal username $::dhis(username)
     } ] -row $row -column 2 
@@ -176,6 +177,14 @@
 	    $::loginImage configure -image img::fail
 	    set ::dhis(status) [mc "Couldn't connect to host - check URL"]
 	}
+	TIMEOUT {
+	    $::loginImage configure -image img::fail
+	    set ::dhis(status) [mc "Timeout trying to login"]
+	}
+	default {
+	    $::loginImage configure -image img::fail
+	    set ::dhis(status) [mc "Login unknown status"]	    
+	}
     }
 }