Add clickable progress bar class. Few changes of main screen. Round floating point numbers to 2 decimanl digits in man screen. Hide border in mode screen for themes
This commit is contained in:
@@ -27,7 +27,7 @@ from audio_player import AudioPlayer
|
|||||||
from space_weather_data import SpaceWeatherData
|
from space_weather_data import SpaceWeatherData
|
||||||
from double_text_button import DoubleTextButton
|
from double_text_button import DoubleTextButton
|
||||||
from download_window import DownloadWindow
|
from download_window import DownloadWindow
|
||||||
from switchable_label import SwitchableLabel, SwitchableLabelsIterable
|
from switchable_label import SwitchableLabelsIterable
|
||||||
from constants import (Constants,
|
from constants import (Constants,
|
||||||
Ftype,
|
Ftype,
|
||||||
GfdType,
|
GfdType,
|
||||||
@@ -376,7 +376,8 @@ class Artemis(QMainWindow, Ui_MainWindow):
|
|||||||
|
|
||||||
# Space weather
|
# Space weather
|
||||||
self.info_now_btn.clicked.connect(lambda : webbrowser.open(Constants.FORECAST_INFO))
|
self.info_now_btn.clicked.connect(lambda : webbrowser.open(Constants.FORECAST_INFO))
|
||||||
self.update_now_btn.clicked.connect(self.start_update_space_weather)
|
self.update_now_bar.clicked.connect(self.start_update_space_weather)
|
||||||
|
self.update_now_bar.set_idle()
|
||||||
self.space_weather_data = SpaceWeatherData()
|
self.space_weather_data = SpaceWeatherData()
|
||||||
self.space_weather_data.update_complete.connect(self.update_space_weather)
|
self.space_weather_data.update_complete.connect(self.update_space_weather)
|
||||||
self.switchable_r_labels = SwitchableLabelsIterable(self.r0_now_lbl,
|
self.switchable_r_labels = SwitchableLabelsIterable(self.r0_now_lbl,
|
||||||
@@ -464,12 +465,12 @@ class Artemis(QMainWindow, Ui_MainWindow):
|
|||||||
@pyqtSlot()
|
@pyqtSlot()
|
||||||
def start_update_space_weather(self):
|
def start_update_space_weather(self):
|
||||||
if not self.space_weather_data.is_updating:
|
if not self.space_weather_data.is_updating:
|
||||||
self.update_now_bar.setMaximum(self.update_now_bar.minimum())
|
self.update_now_bar.set_updating()
|
||||||
self.space_weather_data.update()
|
self.space_weather_data.update()
|
||||||
|
|
||||||
@pyqtSlot(bool)
|
@pyqtSlot(bool)
|
||||||
def update_space_weather(self, status_ok):
|
def update_space_weather(self, status_ok):
|
||||||
self.update_now_bar.setMaximum(self.update_now_bar.minimum() + 1)
|
self.update_now_bar.set_idle()
|
||||||
if status_ok:
|
if status_ok:
|
||||||
xray_long = float(self.space_weather_data.xray[-1][7])
|
xray_long = float(self.space_weather_data.xray[-1][7])
|
||||||
format_text = lambda letter, power : letter + f"{xray_long * 10**power:.1f}"
|
format_text = lambda letter, power : letter + f"{xray_long * 10**power:.1f}"
|
||||||
|
|||||||
392
artemis.ui
392
artemis.ui
@@ -199,8 +199,46 @@
|
|||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
<string>Main</string>
|
<string>Main</string>
|
||||||
</attribute>
|
</attribute>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
<layout class="QGridLayout" name="gridLayout_2">
|
||||||
<item>
|
<item row="1" column="0">
|
||||||
|
<spacer name="horizontalSpacer_19">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeType">
|
||||||
|
<enum>QSizePolicy::Minimum</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>90</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="0" colspan="3">
|
||||||
|
<widget class="QTextBrowser" name="description_text">
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<pointsize>11</pointsize>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="styleSheet">
|
||||||
|
<string notr="true">border: 0px;
|
||||||
|
/*border-radius: 8px;*/</string>
|
||||||
|
</property>
|
||||||
|
<property name="verticalScrollBarPolicy">
|
||||||
|
<enum>Qt::ScrollBarAsNeeded</enum>
|
||||||
|
</property>
|
||||||
|
<property name="horizontalScrollBarPolicy">
|
||||||
|
<enum>Qt::ScrollBarAsNeeded</enum>
|
||||||
|
</property>
|
||||||
|
<property name="readOnly">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="0" colspan="3">
|
||||||
<widget class="QTextBrowser" name="name_lab">
|
<widget class="QTextBrowser" name="name_lab">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Maximum">
|
<sizepolicy hsizetype="Expanding" vsizetype="Maximum">
|
||||||
@@ -233,10 +271,57 @@ p, li { white-space: pre-wrap; }
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="3" column="0">
|
||||||
|
<widget class="QLabel" name="label_9">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<pointsize>12</pointsize>
|
||||||
|
<weight>75</weight>
|
||||||
|
<bold>true</bold>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Description</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="2">
|
||||||
|
<spacer name="horizontalSpacer_20">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeType">
|
||||||
|
<enum>QSizePolicy::Minimum</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>90</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="1">
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_40">
|
||||||
|
<item>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||||
<item>
|
<item>
|
||||||
<layout class="QGridLayout" name="gridLayout_2">
|
|
||||||
<item row="0" column="0">
|
|
||||||
<widget class="QWidget" name="widget_5" native="true">
|
<widget class="QWidget" name="widget_5" native="true">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout_4">
|
<layout class="QGridLayout" name="gridLayout_4">
|
||||||
<item row="5" column="1">
|
<item row="5" column="1">
|
||||||
<widget class="QLabel" name="acf_lab">
|
<widget class="QLabel" name="acf_lab">
|
||||||
@@ -523,7 +608,54 @@ p, li { white-space: pre-wrap; }
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="1" rowspan="2">
|
<item>
|
||||||
|
<widget class="QWidget" name="widget_4" native="true">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_17">
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="url_button">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<pointsize>12</pointsize>
|
||||||
|
<weight>75</weight>
|
||||||
|
<bold>true</bold>
|
||||||
|
<underline>true</underline>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string><html><head/><body><p><span style=" color:#000000;">Go to the signal's wiki.</span></p></body></html></string>
|
||||||
|
</property>
|
||||||
|
<property name="styleSheet">
|
||||||
|
<string notr="true"/>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Signal's wiki</string>
|
||||||
|
</property>
|
||||||
|
<property name="flat">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
<widget class="QWidget" name="widget_3" native="true">
|
<widget class="QWidget" name="widget_3" native="true">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||||
@@ -1032,99 +1164,25 @@ p, li { white-space: pre-wrap; }
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0">
|
|
||||||
<widget class="QWidget" name="widget_4" native="true">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_17">
|
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="url_button">
|
|
||||||
<property name="enabled">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="font">
|
|
||||||
<font>
|
|
||||||
<pointsize>12</pointsize>
|
|
||||||
<weight>75</weight>
|
|
||||||
<bold>true</bold>
|
|
||||||
<underline>true</underline>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
<property name="toolTip">
|
|
||||||
<string><html><head/><body><p><span style=" color:#000000;">Go to the signal's wiki.</span></p></body></html></string>
|
|
||||||
</property>
|
|
||||||
<property name="styleSheet">
|
|
||||||
<string notr="true"/>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Signal's wiki</string>
|
|
||||||
</property>
|
|
||||||
<property name="flat">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item row="2" column="0" colspan="3">
|
||||||
<widget class="QLabel" name="label_9">
|
<spacer name="verticalSpacer_12">
|
||||||
<property name="sizePolicy">
|
<property name="orientation">
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
<enum>Qt::Vertical</enum>
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
</property>
|
||||||
<property name="font">
|
<property name="sizeType">
|
||||||
<font>
|
<enum>QSizePolicy::MinimumExpanding</enum>
|
||||||
<pointsize>12</pointsize>
|
|
||||||
<weight>75</weight>
|
|
||||||
<bold>true</bold>
|
|
||||||
</font>
|
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="sizeHint" stdset="0">
|
||||||
<string>Description</string>
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="alignment">
|
</spacer>
|
||||||
<set>Qt::AlignCenter</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item row="5" column="0" colspan="3">
|
||||||
<widget class="QTextBrowser" name="description_text">
|
|
||||||
<property name="font">
|
|
||||||
<font>
|
|
||||||
<pointsize>11</pointsize>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
<property name="styleSheet">
|
|
||||||
<string notr="true">border: 0px;
|
|
||||||
/*border-radius: 8px;*/</string>
|
|
||||||
</property>
|
|
||||||
<property name="verticalScrollBarPolicy">
|
|
||||||
<enum>Qt::ScrollBarAsNeeded</enum>
|
|
||||||
</property>
|
|
||||||
<property name="horizontalScrollBarPolicy">
|
|
||||||
<enum>Qt::ScrollBarAsNeeded</enum>
|
|
||||||
</property>
|
|
||||||
<property name="readOnly">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QWidget" name="widget_6" native="true">
|
<widget class="QWidget" name="widget_6" native="true">
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string><html><head/><body><p><span style=" color:#000000;">Frequency bands</span></p></body></html></string>
|
<string><html><head/><body><p><span style=" color:#000000;">Frequency bands</span></p></body></html></string>
|
||||||
@@ -3516,20 +3574,20 @@ Inactive</string>
|
|||||||
<string>Mode</string>
|
<string>Mode</string>
|
||||||
</attribute>
|
</attribute>
|
||||||
<layout class="QGridLayout" name="gridLayout_13">
|
<layout class="QGridLayout" name="gridLayout_13">
|
||||||
<item row="1" column="0">
|
<item row="2" column="2">
|
||||||
<spacer name="horizontalSpacer">
|
<spacer name="horizontalSpacer_2">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeHint" stdset="0">
|
<property name="sizeHint" stdset="0">
|
||||||
<size>
|
<size>
|
||||||
<width>171</width>
|
<width>170</width>
|
||||||
<height>20</height>
|
<height>20</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="1">
|
<item row="2" column="1">
|
||||||
<widget class="QTreeWidget" name="mode_tree_widget">
|
<widget class="QTreeWidget" name="mode_tree_widget">
|
||||||
<property name="font">
|
<property name="font">
|
||||||
<font>
|
<font>
|
||||||
@@ -3563,50 +3621,6 @@ Inactive</string>
|
|||||||
</column>
|
</column>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="2">
|
|
||||||
<spacer name="horizontalSpacer_2">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>170</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="0" colspan="3">
|
|
||||||
<widget class="DoubleTextButton" name="apply_remove_mode_filter_btn">
|
|
||||||
<property name="font">
|
|
||||||
<font>
|
|
||||||
<pointsize>12</pointsize>
|
|
||||||
<weight>75</weight>
|
|
||||||
<bold>true</bold>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Apply</string>
|
|
||||||
</property>
|
|
||||||
<property name="checkable">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="3" column="0" colspan="3">
|
|
||||||
<widget class="QPushButton" name="reset_mode_filters_btn">
|
|
||||||
<property name="font">
|
|
||||||
<font>
|
|
||||||
<pointsize>12</pointsize>
|
|
||||||
<weight>75</weight>
|
|
||||||
<bold>true</bold>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Reset</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="0" colspan="3">
|
<item row="0" column="0" colspan="3">
|
||||||
<widget class="QPushButton" name="include_unknown_modes_btn">
|
<widget class="QPushButton" name="include_unknown_modes_btn">
|
||||||
<property name="font">
|
<property name="font">
|
||||||
@@ -3624,6 +3638,66 @@ Inactive</string>
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="3" column="0" colspan="3">
|
||||||
|
<widget class="DoubleTextButton" name="apply_remove_mode_filter_btn">
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<pointsize>12</pointsize>
|
||||||
|
<weight>75</weight>
|
||||||
|
<bold>true</bold>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Apply</string>
|
||||||
|
</property>
|
||||||
|
<property name="checkable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="0" colspan="3">
|
||||||
|
<widget class="QPushButton" name="reset_mode_filters_btn">
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<pointsize>12</pointsize>
|
||||||
|
<weight>75</weight>
|
||||||
|
<bold>true</bold>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Reset</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0">
|
||||||
|
<spacer name="horizontalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>171</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0" colspan="3">
|
||||||
|
<spacer name="verticalSpacer_11">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeType">
|
||||||
|
<enum>QSizePolicy::Minimum</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="tab_7">
|
<widget class="QWidget" name="tab_7">
|
||||||
@@ -6568,34 +6642,37 @@ background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0,stop:0 #283048 ,sto
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="update_now_btn">
|
<widget class="ClickableProgressBar" name="update_now_bar">
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Update</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QProgressBar" name="update_now_bar">
|
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<pointsize>8</pointsize>
|
||||||
|
<weight>75</weight>
|
||||||
|
<bold>true</bold>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="styleSheet">
|
||||||
|
<string notr="true"/>
|
||||||
|
</property>
|
||||||
<property name="maximum">
|
<property name="maximum">
|
||||||
<number>1</number>
|
<number>1</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="value">
|
<property name="value">
|
||||||
<number>-1</number>
|
<number>-1</number>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignCenter</set>
|
||||||
|
</property>
|
||||||
<property name="textVisible">
|
<property name="textVisible">
|
||||||
<bool>false</bool>
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="format">
|
||||||
|
<string>%p%</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@@ -6936,6 +7013,11 @@ QSlider::handle:horizontal {
|
|||||||
<extends>QLabel</extends>
|
<extends>QLabel</extends>
|
||||||
<header>switchable_label.h</header>
|
<header>switchable_label.h</header>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
|
<customwidget>
|
||||||
|
<class>ClickableProgressBar</class>
|
||||||
|
<extends>QProgressBar</extends>
|
||||||
|
<header>clickable_progress_bar.h</header>
|
||||||
|
</customwidget>
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="icon.qrc"/>
|
<include location="icon.qrc"/>
|
||||||
|
|||||||
31
clickable_progress_bar.py
Normal file
31
clickable_progress_bar.py
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
from PyQt5.QtWidgets import QProgressBar
|
||||||
|
from PyQt5.QtCore import Qt, pyqtSignal
|
||||||
|
from constants import Constants
|
||||||
|
|
||||||
|
class ClickableProgressBar(QProgressBar):
|
||||||
|
|
||||||
|
clicked = pyqtSignal()
|
||||||
|
|
||||||
|
def __init__(self, parent = None):
|
||||||
|
self.__text = ''
|
||||||
|
super().__init__(parent)
|
||||||
|
|
||||||
|
def __set_text(self, text):
|
||||||
|
self.__text = text
|
||||||
|
|
||||||
|
def text(self):
|
||||||
|
return self.__text
|
||||||
|
|
||||||
|
def set_idle(self):
|
||||||
|
self.__set_text(Constants.CLICK_TO_UPDATE_STR)
|
||||||
|
self.setMaximum(self.minimum() + 1)
|
||||||
|
|
||||||
|
def set_updating(self):
|
||||||
|
self.__set_text(Constants.UPDATING_STR)
|
||||||
|
self.setMaximum(self.minimum())
|
||||||
|
|
||||||
|
def mousePressEvent(self, event):
|
||||||
|
if event.button() == Qt.LeftButton:
|
||||||
|
self.clicked.emit()
|
||||||
|
else:
|
||||||
|
super().mousePressEvent(event)
|
||||||
@@ -91,6 +91,8 @@ class Colors(object):
|
|||||||
YELLOW_LIGHT = "#ffff33"
|
YELLOW_LIGHT = "#ffff33"
|
||||||
|
|
||||||
class Constants(object):
|
class Constants(object):
|
||||||
|
CLICK_TO_UPDATE_STR = "Click to update"
|
||||||
|
UPDATING_STR = "Updating..."
|
||||||
ACF_DOCS = "https://aresvalley.com/documentation/"
|
ACF_DOCS = "https://aresvalley.com/documentation/"
|
||||||
FORECAST_XRAY = "https://services.swpc.noaa.gov/text/goes-xray-flux-primary.txt"
|
FORECAST_XRAY = "https://services.swpc.noaa.gov/text/goes-xray-flux-primary.txt"
|
||||||
FORECAST_PROT = "https://services.swpc.noaa.gov/text/goes-particle-flux-primary.txt"
|
FORECAST_PROT = "https://services.swpc.noaa.gov/text/goes-particle-flux-primary.txt"
|
||||||
|
|||||||
@@ -433,6 +433,7 @@ TreeViewMenu (Mode)
|
|||||||
QTreeView {
|
QTreeView {
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
selection-background-color: transparent;
|
selection-background-color: transparent;
|
||||||
|
border: 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
QTreeView::item {
|
QTreeView::item {
|
||||||
|
|||||||
@@ -452,6 +452,7 @@ TreeViewMenu (Mode)
|
|||||||
QTreeView {
|
QTreeView {
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
selection-background-color: transparent;
|
selection-background-color: transparent;
|
||||||
|
border: 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
QTreeView::item {
|
QTreeView::item {
|
||||||
|
|||||||
@@ -452,6 +452,7 @@ TreeViewMenu (Mode)
|
|||||||
QTreeView {
|
QTreeView {
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
selection-background-color: transparent;
|
selection-background-color: transparent;
|
||||||
|
border: 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
QTreeView::item {
|
QTreeView::item {
|
||||||
|
|||||||
@@ -97,8 +97,12 @@ def format_numbers(lower, upper):
|
|||||||
upper = int(upper) / upper_factor
|
upper = int(upper) / upper_factor
|
||||||
if lower.is_integer():
|
if lower.is_integer():
|
||||||
lower = int(lower)
|
lower = int(lower)
|
||||||
|
else:
|
||||||
|
lower = round(lower, 2)
|
||||||
if upper.is_integer():
|
if upper.is_integer():
|
||||||
upper = int(upper)
|
upper = int(upper)
|
||||||
|
else:
|
||||||
|
upper = round(upper, 2)
|
||||||
if pre_lower != pre_upper:
|
if pre_lower != pre_upper:
|
||||||
return f"{lower:,} {units[lower_factor]} - {upper:,} {units[upper_factor]}"
|
return f"{lower:,} {units[lower_factor]} - {upper:,} {units[upper_factor]}"
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user