Changeset 2253 for trunk/builder/scripts


Ignore:
Timestamp:
May 20, 2011 1:00:35 PM (13 years ago)
Author:
mmc
Message:

Fixed the "save as..." to do a better job of knowing when changes need to
be saved. It used to be that if you set the program type, then saved, then
tried to exit, it would prompt you to save again. That's fixed now. Also
added a "cancel" button in case you are trying to exit, see that there are
changes, and want to cancel the exit.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/builder/scripts/main.tcl

    r2252 r2253  
    784784                main_generate_xml
    785785
     786                # change any !Language for the command into a proper
     787                # invocation command.  Grab the XML before we do this
     788                # as the last official XML that's been saved.  We'll
     789                # know later if things changed and we need to save again.
     790                set xmlBeforeCmdSubst [$ToolXml xml]
     791
    786792                set cmd [$ToolXml get tool.command]
    787793                if {[string index $cmd 0] eq "!"} {
     
    807813                    set status "error"
    808814                } else {
    809                     set LastToolXmlLoaded [$ToolXml xml]
     815                    set LastToolXmlLoaded $xmlBeforeCmdSubst
    810816                }
    811817            }
     
    966972
    967973    if {[$ToolXml xml] ne $LastToolXmlLoaded} {
    968         set choice [tk_messageBox -icon warning -type yesno -title "Rappture: Save Changes?" -message "Changes to the current tool haven't been saved.\n\nSave changes?"]
     974        set choice [tk_messageBox -icon warning -type yesnocancel -title "Rappture: Save Changes?" -message "Changes to the current tool haven't been saved.\n\nSave changes?"]
    969975        if {$choice == "yes" && ![main_saveas]} {
     976            return
     977        } elseif {$choice == "cancel"} {
    970978            return
    971979        }
Note: See TracChangeset for help on using the changeset viewer.