From a1b64bc72dc0002cab9eef7d6232b3b4aeb2f768 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ignacio=20Mu=C3=B1oz=20Fernandez?= Date: Thu, 26 Nov 2020 03:10:46 +0100 Subject: [PATCH] Cleanup QWeatherInfoWindow and rjust wind bearings. (#456) --- qt_ui/widgets/QConditionsWidget.py | 7 +++---- qt_ui/windows/weather/QWeatherInfoWindow.py | 16 ---------------- 2 files changed, 3 insertions(+), 20 deletions(-) delete mode 100644 qt_ui/windows/weather/QWeatherInfoWindow.py diff --git a/qt_ui/widgets/QConditionsWidget.py b/qt_ui/widgets/QConditionsWidget.py index 80e27c9b..c61ba326 100644 --- a/qt_ui/widgets/QConditionsWidget.py +++ b/qt_ui/widgets/QConditionsWidget.py @@ -6,7 +6,6 @@ from game.weather import Conditions, TimeOfDay, Weather from game.utils import meter_to_nm, mps_to_knots from dcs.weather import Weather as PydcsWeather -from qt_ui.windows.weather.QWeatherInfoWindow import QWeatherInfoWindow import qt_ui.uiconstants as CONST class QTimeTurnWidget(QGroupBox): @@ -165,17 +164,17 @@ class QWeatherWidget(QGroupBox): """Updates the UI with the current conditions wind info. """ windGlSpeed = mps_to_knots(self.conditions.weather.wind.at_0m.speed or 0) - windGlDir = self.conditions.weather.wind.at_0m.direction or 0 + windGlDir = str(self.conditions.weather.wind.at_0m.direction or 0).rjust(3, '0') self.windGLSpeedLabel.setText('{}kts'.format(windGlSpeed)) self.windGLDirLabel.setText('{}º'.format(windGlDir)) windFL08Speed = mps_to_knots(self.conditions.weather.wind.at_2000m.speed or 0) - windFL08Dir = self.conditions.weather.wind.at_2000m.direction or 0 + windFL08Dir = str(self.conditions.weather.wind.at_2000m.direction or 0).rjust(3, '0') self.windFL08SpeedLabel.setText('{}kts'.format(windFL08Speed)) self.windFL08DirLabel.setText('{}º'.format(windFL08Dir)) windFL26Speed = mps_to_knots(self.conditions.weather.wind.at_8000m.speed or 0) - windFL26Dir = self.conditions.weather.wind.at_8000m.direction or 0 + windFL26Dir = str(self.conditions.weather.wind.at_8000m.direction or 0).rjust(3, '0') self.windFL26SpeedLabel.setText('{}kts'.format(windFL26Speed)) self.windFL26DirLabel.setText('{}º'.format(windFL26Dir)) diff --git a/qt_ui/windows/weather/QWeatherInfoWindow.py b/qt_ui/windows/weather/QWeatherInfoWindow.py deleted file mode 100644 index 272b40ce..00000000 --- a/qt_ui/windows/weather/QWeatherInfoWindow.py +++ /dev/null @@ -1,16 +0,0 @@ -from PySide2.QtWidgets import QDialog, QGridLayout, QLabel, QFrame, QSizePolicy - -from game.game import Game -from game.weather import Conditions, TimeOfDay, Weather - -import qt_ui.uiconstants as CONST - -class QWeatherInfoWindow(QDialog): - - def __init__(self, turn: int, conditions: Conditions): - super(QWeatherInfoWindow, self).__init__() - - self.setModal(True) - self.setWindowTitle("Weather Forecast Report") - self.setWindowIcon(CONST.ICONS["Money"]) - self.setMinimumSize(450, 200) \ No newline at end of file