Permalink
Browse files

Expiry date handling for no end periods

  • Loading branch information...
hypatia2 committed Aug 19, 2015
1 parent 70f6c09 commit 7b8f7bb358a49ccc93431f6120ae301df0cf5ae9
Showing with 14 additions and 7 deletions.
  1. +2 −2 fruho/add_from_file.tcl
  2. +4 −4 fruho/add_securitykiss.tcl
  3. +8 −1 fruho/main.tcl
@@ -35,8 +35,8 @@ proc ::from_file::create-import-frame {tab} {
grid $pconf.select.button -row 0 -column 1 -sticky e -padx 5 -pady 5
grid columnconfigure $pconf.select 0 -weight 1
ttk::label $pconf.selectinfo -foreground grey
grid columnconfigure $pconf 0 -weight 3 -uniform 1
grid columnconfigure $pconf 1 -weight 5 -uniform 1
grid columnconfigure $pconf 0 -weight 4 -uniform 1
grid columnconfigure $pconf 1 -weight 4 -uniform 1
grid columnconfigure $pconf 2 -weight 4 -uniform 1
grid $pconf.profilelabel -row 1 -column 0 -sticky news -padx 5 -pady 5
grid $pconf.profileinput -row 1 -column 1 -sticky news -padx 5 -pady 5
@@ -32,10 +32,10 @@ proc ::securitykiss::create-import-frame {tab} {
ttk::label $pconf.profilelabel -text "Profile name" -anchor e
ttk::entry $pconf.profileinput -textvariable ::${name}::newprofilename
ttk::label $pconf.profileinfo -foreground grey
ttk::label $pconf.usernamelabel -text "Username" -anchor e
ttk::label $pconf.usernamelabel -text "SecurityKISS username" -anchor e
ttk::entry $pconf.usernameinput -textvariable ::securitykiss::username
ttk::label $pconf.usernameinfo -foreground grey -text "e.g. client12345678"
ttk::label $pconf.passwordlabel -text "Password" -anchor e
ttk::label $pconf.passwordlabel -text "SecurityKISS password" -anchor e
ttk::entry $pconf.passwordinput -textvariable ::${name}::password
ttk::label $pconf.passwordinfo -foreground grey
ttk::frame $pconf.importline
@@ -47,8 +47,8 @@ proc ::securitykiss::create-import-frame {tab} {
grid $pconf.importline.button -row 0 -column 0 -padx 10
grid $pconf.importline.img -row 0 -column 1 -padx 10 -pady 10
grid $pconf.importline.msg -row 0 -column 2 -padx 10 -pady 10
grid columnconfigure $pconf 0 -weight 3 -uniform 1
grid columnconfigure $pconf 1 -weight 5 -uniform 1
grid columnconfigure $pconf 0 -weight 4 -uniform 1
grid columnconfigure $pconf 1 -weight 4 -uniform 1
grid columnconfigure $pconf 2 -weight 4 -uniform 1
grid $pconf.profilelabel -row 1 -column 0 -sticky news -padx 5 -pady 5
grid $pconf.profileinput -row 1 -column 1 -sticky news -padx 5 -pady 5
@@ -1281,7 +1281,7 @@ proc dash-plan {p} {
grid $dbplan.planname.val -row 0 -column 1 -sticky w
frame $dbplan.planexpiry
label $dbplan.planexpiry.lbl -text "Expiry date:"
label $dbplan.planexpiry.lbl
label $dbplan.planexpiry.val -font [dynafont -weight bold]
grid $dbplan.planexpiry.lbl -row 0 -column 0 -sticky e
grid $dbplan.planexpiry.val -row 0 -column 1 -sticky e
@@ -1384,8 +1384,15 @@ proc dash-plan-update {} {
set plan_start [plan-start $plan]
set plan_end [plan-end $plan]
set until [format-date $plan_end]
set expires "Expires:"
set period [dict-pop $plan timelimit period day]
$dbplan.planname.val configure -text $planname
# if longer than 10 years
if {$plan_end - $plan_start > 315000000} {
set until ""
set expires ""
}
$dbplan.planexpiry.lbl configure -text $expires
$dbplan.planexpiry.val configure -text $until
}
}

0 comments on commit 7b8f7bb

Please sign in to comment.