Changeset 828:b5013b5bffb1


Ignore:
Timestamp:
09/25/16 08:13:34 (8 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

The pending flights window gets closed automatically if no pending flights remain (re #307).

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • locale/en/mlx.po

    r825 r828  
    24762476msgid "flight_delete_question"
    24772477msgstr "Are you sure to delete the selected flight(s)?"
     2478
     2479msgid "error_communication"
     2480msgstr "Communication error"
     2481
     2482msgid "error_communication_secondary"
     2483msgstr "Communication failed with the MAVA website. Try again later or file a bug report, if the problem persists."
  • locale/hu/mlx.po

    r825 r828  
    24932493msgid "flight_delete_question"
    24942494msgstr "Biztosan törölni szerednéd a kiválasztott járato(ka)t?"
     2495
     2496msgid "error_communication"
     2497msgstr "Kommunikációs hiba"
     2498
     2499msgid "error_communication_secondary"
     2500msgstr "Nem sikerült kommunikálni a MAVA weboldalával. Próbáld meg később, vagy jelents hibát, ha a probléma nem szűnik meg."
  • src/mlx/gui/common.py

    r826 r828  
    495495
    496496#------------------------------------------------------------------------------
     497
     498def errroDialog(message, parent = None, secondary = None,
     499                title = WINDOW_TITLE_BASE):
     500    """Display an error dialog box with the given message."""
     501    dialog = gtk.MessageDialog(parent = parent,
     502                               type = MESSAGETYPE_ERROR,
     503                               message_format = message)
     504    dialog.add_button(xstr("button_ok"), RESPONSETYPE_OK)
     505    dialog.set_title(title)
     506    if secondary is not None:
     507        dialog.format_secondary_markup(secondary)
     508
     509    dialog.run()
     510    dialog.hide()
     511
     512#------------------------------------------------------------------------------
     513
     514def communicationErrorDialog(parent = None, title = WINDOW_TITLE_BASE):
     515    """Display a communication error dialog."""
     516    errroDialog(xstr("error_communication"), parent = parent,
     517                secondary = xstr("error_communication_secondary"),
     518                title = title)
     519
     520#------------------------------------------------------------------------------
  • src/mlx/gui/flightlist.py

    r827 r828  
    342342            for flight in flights:
    343343                self._wizard.reflyFlight(flight)
     344            self._window.checkFlights()
     345        else:
     346            communicationErrorDialog()
    344347
    345348    def _deleteClicked(self, button):
     
    378381            for flight in flights:
    379382                self._wizard.deleteFlight(flight)
     383            self._window.checkFlights()
     384        else:
     385            communicationErrorDialog()
    380386
    381387#-----------------------------------------------------------------------------
     
    439445        self._rejectedFrame.addFlight(flight)
    440446
     447    def checkFlights(self):
     448        """Check if there are any flights in any of the lists, and close the
     449        window if not."""
     450        if not self.hasFlights:
     451            self.emit("delete-event", None)
     452
    441453    def _closeClicked(self, button):
    442454        """Called when the Close button is clicked.
Note: See TracChangeset for help on using the changeset viewer.