class ts2.gui.dialogs.DownloadSimulationsDialog(parent)[source]

Bases: PyQt5.QtWidgets.QDialog

Popup window for the user to select download server.


Constructor for the DownloadSimulationsDialog.

class ts2.gui.dialogs.ExceptionDialog[source]

Bases: object

A Dialog box for displaying exception information


list of weak references to the object (if defined)

static popupException(parent, exception=None)[source]

Displays a dialog with all the information about the exception and the traceback.

class ts2.gui.dialogs.PropertiesDialog(parent, simulation)[source]

Bases: PyQt5.QtWidgets.QDialog

Dialog box for editing simulation properties during the game.

__init__(parent, simulation)[source]

Constructor for the PropertiesDialog class.


Changes the trackItemBased Option.

class ts2.gui.dialogs.ServiceAssignDialog(parent, simulation)[source]

Bases: PyQt5.QtWidgets.QDialog

TODO Document ServiceAssignDialog


Save window postions on close

static reassignServiceToTrain(simulation, trainId)[source]

Reassigns a service to the train given by trainId by poping-up a reassignServiceDialog.

class ts2.gui.dialogs.SplitTrainDialog(parent, train)[source]

Bases: PyQt5.QtWidgets.QDialog

Popup window for the user to select where to split a train.

__init__(parent, train)[source]

Constructor for the SplitTrainDialog.


Save window postions on close

Returns:The index of the selected radio button
static getSplitIndexPopUp(train)[source]

Pops up a split train dialog and returns the index at which to split the given train. :param train: The train instance to split

ts2.gui.dialogs.translate(str, str, str disambiguation=None, int n=-1) → str


class ts2.gui.opendialog.OpenDialog(parent, tab=0)[source]

Bases: PyQt5.QtWidgets.QDialog

Open sim file dialog

__init__(parent, tab=0)[source]

Constructor for the OpenDialog.


Downloads zip when Download button clicked


Reloads the recent items


Reloads the simulations dir

ts2.gui.opendialog.translate(str, str, str disambiguation=None, int n=-1) → str


class ts2.gui.servicelistview.ServiceListView(parent)[source]

Bases: PyQt5.QtWidgets.QTreeView

TODO Document ServiceListView

selectionChanged(selected, deselected)[source]

This function is called when a line is selected in the serviceListView. It emits the serviceSelected signal for others to connect to.


Updates the service list view.


Update the selection by selecting the service of the train given by trainId.


class ts2.gui.trainlistview.TrainListView(parent)[source]

Bases: PyQt5.QtWidgets.QTreeView

TODO Document TrainListView class


class ts2.gui.widgets.ClockWidget(parent)[source]

Bases: PyQt5.QtWidgets.QLCDNumber

Clock LCD Widget


Constructor for the ClockWidget class.

class ts2.gui.widgets.HBoxWidget(parent=None, margin=0)[source]

Bases: PyQt5.QtWidgets.QWidget

Widget with a Horizontal Box

class ts2.gui.widgets.StatusBar(parent=None)[source]

Bases: PyQt5.QtWidgets.QStatusBar

A horizontal bar with embedded progress bar


Shows the progress bar and makes busy bee

showMessage(txt, timeout=0, info=False, warn=False)[source]

Shows a message

  • txt (str) – Text to display
  • timeout (int) – Timeout in seconds
  • info (bool) – shows blue
  • warn (bool) – shows red
class ts2.gui.widgets.VBoxWidget(parent=None, margin=0)[source]

Bases: PyQt5.QtWidgets.QWidget

Widget with a Vertical Box

class ts2.gui.widgets.XGraphicsView(parent=None)[source]

Bases: PyQt5.QtWidgets.QGraphicsView

An extended QGraphicsView to handle wheel events


Signal emited when wheel has changed, direction = +1 or -1


Override the wheelEvent, and send signal with direction

class ts2.gui.widgets.ZoomWidget(parent=None)[source]

Bases: PyQt5.QtWidgets.QWidget

Zoom slider bar with associated spinBox.


Constructor for the ZoomWidget class.


Sets the zoom to 100%.