gui/

dialogs.*

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

Bases: PyQt5.QtWidgets.QDialog

Popup window for the user to select download server.

__init__(parent)[source]

Constructor for the DownloadSimulationsDialog.

class ts2.gui.dialogs.ExceptionDialog[source]

Bases: object

A Dialog box for displaying exception information

__weakref__

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.

changeTIB(checkState)[source]

Changes the trackItemBased Option.

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

Bases: PyQt5.QtWidgets.QDialog

TODO Document ServiceAssignDialog

closeEvent(event)[source]

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.

closeEvent(event)[source]

Save window postions on close

getSplitIndex()[source]
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

opendialog.*

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.

onDownload()[source]

Downloads zip when Download button clicked

onRefreshRecent()[source]

Reloads the recent items

onRefreshSims()[source]

Reloads the simulations dir

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

servicelistview.*

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.

setupServiceList(sim)[source]

Updates the service list view.

updateServiceSelection(trainId)[source]

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

trainlistview.*

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

Bases: PyQt5.QtWidgets.QTreeView

TODO Document TrainListView class

widgets.*

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

Bases: PyQt5.QtWidgets.QLCDNumber

Clock LCD Widget

__init__(parent)[source]

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

showBusy(is_busy)[source]

Shows the progress bar and makes busy bee

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

Shows a message

Parameters:
  • 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

wheelChanged

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

wheelEvent(ev)[source]

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.

__init__(parent=None)[source]

Constructor for the ZoomWidget class.

setDefaultZoom()[source]

Sets the zoom to 100%.