Changeset 849:7edb1f4cd12a


Ignore:
Timestamp:
05/11/17 18:32:20 (7 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

The Save button of the PIREP Editor becomes active only after the first modification (re #307)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/gui/pirep.py

    r848 r849  
    722722        self._okButton = self.add_button(xstr("button_save"), RESPONSETYPE_OK)
    723723        self._okButton.set_can_default(True)
     724        self._modified = False
    724725
    725726    def setPIREP(self, pirep):
     
    842843        self._okButton.grab_default()
    843844
     845        self._modified = False
    844846        self._updateButtons()
     847        self._modified = True
    845848
    846849    def delayCodesChanged(self):
     
    12321235                                              xstr("pirepView_bagWeight"),
    12331236                                              100000, width = 6)
     1237        self._flownBagWeight.connect("value-changed", self._updateButtons)
    12341238        self._flownBagWeight.set_tooltip_text(xstr("payload_bag_tooltip"))
    12351239
     
    12381242                                              xstr("pirepView_cargoWeight"),
    12391243                                              100000, width = 6)
     1244        self._flownCargoWeight.connect("value-changed", self._updateButtons)
    12401245        self._flownCargoWeight.set_tooltip_text(xstr("payload_cargo_tooltip"))
    12411246
     
    12441249                                              xstr("pirepView_mailWeight"),
    12451250                                              100000, width = 6)
     1251        self._flownMailWeight.connect("value-changed", self._updateButtons)
    12461252        self._flownMailWeight.set_tooltip_text(xstr("payload_mail_tooltip"))
    12471253
     
    12501256                                      xstr("pirepView_flightType"),
    12511257                                      self._flightType)
     1258        self._flightType.connect("changed", self._updateButtons)
    12521259        self._flightType.set_tooltip_text(xstr("pirepEdit_flight_type_tooltip"))
    12531260
    12541261        self._online = gtk.CheckButton(xstr("pirepEdit_online"))
    12551262        table.attach(self._online, 2, 3, 2, 3)
     1263        self._online.connect("toggled", self._updateButtons)
    12561264        self._online.set_tooltip_text(xstr("pirepEdit_online_tooltip"))
    12571265
     
    13401348                                 buffer.get_end_iter(), True)
    13411349
    1342         self._okButton.set_sensitive(timesOK and
     1350        self._okButton.set_sensitive(self._modified and timesOK and
    13431351                                     self._flightInfo.faultsFullyExplained and
    13441352                                     self._flownNumPassengers.get_value_as_int()>0 and
Note: See TracChangeset for help on using the changeset viewer.