Changeset 146709 for trunk/base


Ignore:
Timestamp:
Mar 15, 2016, 4:40:48 PM (4 years ago)
Author:
g5pw@…
Message:

base: offer the user to run reclaim for him

That's more helpful that just printing a ui_warn. If
macports::ui_options(questions_yesno) is not available or the user answers no,
don't do anything.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/base/src/macports1.0/reclaim.tcl

    r146701 r146709  
    348348        if {$time ne ""} {
    349349            if {[clock seconds] - $time > 1209600} {
    350                 ui_warn "You haven't run 'port reclaim' in two weeks. It's recommended you run this every two weeks to reclaim disk space."
     350                if {[info exists macports::ui_options(questions_yesno)]} {
     351                    set retval [$macports::ui_options(questions_yesno)  "You haven't run 'port reclaim' in two weeks. It's recommended you run this every two weeks to reclaim disk space." "ReclaimPrompt" "" {y} 0 "Would you like to run it now?"]
     352                    if {$retval == 0} {
     353                        # User said yes, run port reclaim
     354                        macports::reclaim_main
     355                    }
     356                }
    351357            }
    352358        }
Note: See TracChangeset for help on using the changeset viewer.