Better missing database management
This commit is contained in:
@@ -75,7 +75,7 @@ class AudioPlayer(object):
|
|||||||
def set_audio_player(self, fname = ""):
|
def set_audio_player(self, fname = ""):
|
||||||
self.__first_call = True
|
self.__first_call = True
|
||||||
self.__reset_audio_widget()
|
self.__reset_audio_widget()
|
||||||
full_name = os.path.join('Data', 'Audio_wav', fname + '.wav')
|
full_name = os.path.join('Data', 'Audio', fname + '.wav')
|
||||||
if os.path.exists(full_name):
|
if os.path.exists(full_name):
|
||||||
self.__play.setEnabled(True)
|
self.__play.setEnabled(True)
|
||||||
self.__audio_file = full_name
|
self.__audio_file = full_name
|
||||||
|
|||||||
26
main.py
26
main.py
@@ -137,19 +137,19 @@ class MyApp(QMainWindow, Ui_MainWindow):
|
|||||||
self.signal_names = self.db.index
|
self.signal_names = self.db.index
|
||||||
self.db.fillna("N/A", inplace = True)
|
self.db.fillna("N/A", inplace = True)
|
||||||
self.db["url_clicked"] = False
|
self.db["url_clicked"] = False
|
||||||
try:
|
try:
|
||||||
with open(os.path.join('Data', 'verdb.ini'), 'r') as dbver:
|
with open(os.path.join('Data', 'verdb.ini'), 'r') as dbver:
|
||||||
self.db_version = int(dbver.read())
|
self.db_version = int(dbver.read())
|
||||||
except (FileNotFoundError, ValueError):
|
except (FileNotFoundError, ValueError):
|
||||||
box = QMessageBox(self)
|
box = QMessageBox(self)
|
||||||
box.setWindowTitle("No database version")
|
box.setWindowTitle("No database version")
|
||||||
box.setText("Unable to detect database version.\n"
|
box.setText("Unable to detect database version.\n"
|
||||||
"Possible data curruption.\n"
|
"Possible data curruption.\n"
|
||||||
"Go to Updates->Force Download.")
|
"Go to Updates->Force Download.")
|
||||||
box.show()
|
box.show()
|
||||||
self.setStatusTip("Database version: undefined.")
|
self.setStatusTip("Database version: undefined.")
|
||||||
else:
|
else:
|
||||||
self.setStatusTip(f"Database version: {self.db_version}")
|
self.setStatusTip(f"Database version: {self.db_version}")
|
||||||
|
|
||||||
def display_signals(self):
|
def display_signals(self):
|
||||||
self.result_list.clear()
|
self.result_list.clear()
|
||||||
|
|||||||
@@ -6,8 +6,8 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>1169</width>
|
<width>1337</width>
|
||||||
<height>626</height>
|
<height>641</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
@@ -261,6 +261,12 @@ border-radius: 5px;</string>
|
|||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>200</width>
|
||||||
|
<height>400</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
<property name="layoutDirection">
|
<property name="layoutDirection">
|
||||||
<enum>Qt::LeftToRight</enum>
|
<enum>Qt::LeftToRight</enum>
|
||||||
</property>
|
</property>
|
||||||
@@ -1920,7 +1926,7 @@ QTabBar::tab:!selected {
|
|||||||
</property>
|
</property>
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>170</width>
|
<width>300</width>
|
||||||
<height>0</height>
|
<height>0</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
@@ -1955,7 +1961,7 @@ QLabel, QPushButton, QSlider {
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QWidget" name="audio_widget" native="true">
|
<widget class="QWidget" name="audio_widget" native="true">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
@@ -2020,8 +2026,8 @@ QPushButton:disabled {
|
|||||||
</property>
|
</property>
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>41</width>
|
<width>60</width>
|
||||||
<height>41</height>
|
<height>60</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -2045,8 +2051,8 @@ QPushButton:disabled {
|
|||||||
</property>
|
</property>
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>41</width>
|
<width>60</width>
|
||||||
<height>41</height>
|
<height>60</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -2070,8 +2076,8 @@ QPushButton:disabled {
|
|||||||
</property>
|
</property>
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>41</width>
|
<width>60</width>
|
||||||
<height>41</height>
|
<height>60</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -2151,15 +2157,15 @@ QSlider::handle:horizontal {
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="spectrogram">
|
<widget class="QLabel" name="spectrogram">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>153</width>
|
<width>250</width>
|
||||||
<height>350</height>
|
<height>400</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
@@ -2189,7 +2195,7 @@ QSlider::handle:horizontal {
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>1169</width>
|
<width>1337</width>
|
||||||
<height>21</height>
|
<height>21</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
|
|||||||
Reference in New Issue
Block a user