Bugfix, Readme
This commit is contained in:
@@ -205,8 +205,7 @@ class Preferences:
|
|||||||
time_periods_min.append(int(time_str[0:2]) * 60 + int(time_str[3:5]))
|
time_periods_min.append(int(time_str[0:2]) * 60 + int(time_str[3:5]))
|
||||||
else:
|
else:
|
||||||
if self.prefs.period_source == PeriodSourceEnum.NETWORKLOCATION:
|
if self.prefs.period_source == PeriodSourceEnum.NETWORKLOCATION:
|
||||||
self.suntimes.calc_suntimes(float(self.prefs.latitude_auto),
|
self.suntimes.calc_suntimes(float(self.prefs.latitude_auto), float(self.prefs.longitude_auto))
|
||||||
float(self.prefs.longitude_auto))
|
|
||||||
else:
|
else:
|
||||||
self.suntimes.calc_suntimes(float(self.etr_latitude.get_text()), float(self.etr_longitude.get_text()))
|
self.suntimes.calc_suntimes(float(self.etr_latitude.get_text()), float(self.etr_longitude.get_text()))
|
||||||
|
|
||||||
@@ -318,6 +317,11 @@ class Preferences:
|
|||||||
# +-----------+-----------+---------------+
|
# +-----------+-----------+---------------+
|
||||||
|
|
||||||
def on_toggle_button_image_set_clicked(self, button: Gtk.ToggleButton):
|
def on_toggle_button_image_set_clicked(self, button: Gtk.ToggleButton):
|
||||||
|
""" Clicked on ToggleButton "Image Set"
|
||||||
|
|
||||||
|
Args:
|
||||||
|
button (Gtk.ToggleButton): Clicked ToggleButton
|
||||||
|
"""
|
||||||
if button.get_active():
|
if button.get_active():
|
||||||
self.prefs.image_source = ImageSourceEnum.IMAGESET
|
self.prefs.image_source = ImageSourceEnum.IMAGESET
|
||||||
self.tb_heic_file.set_active(False)
|
self.tb_heic_file.set_active(False)
|
||||||
@@ -342,6 +346,11 @@ class Preferences:
|
|||||||
|
|
||||||
|
|
||||||
def on_toggle_button_heic_file_clicked(self, button: Gtk.ToggleButton):
|
def on_toggle_button_heic_file_clicked(self, button: Gtk.ToggleButton):
|
||||||
|
""" Clicked on ToggleButton "Heic file"
|
||||||
|
|
||||||
|
Args:
|
||||||
|
button (Gtk.ToggleButton): Clicked ToggleButton
|
||||||
|
"""
|
||||||
if button.get_active():
|
if button.get_active():
|
||||||
self.prefs.image_source = ImageSourceEnum.HEICFILE
|
self.prefs.image_source = ImageSourceEnum.HEICFILE
|
||||||
self.tb_image_set.set_active(False)
|
self.tb_image_set.set_active(False)
|
||||||
@@ -369,6 +378,11 @@ class Preferences:
|
|||||||
|
|
||||||
|
|
||||||
def on_toggle_button_source_folder_clicked(self, button: Gtk.ToggleButton):
|
def on_toggle_button_source_folder_clicked(self, button: Gtk.ToggleButton):
|
||||||
|
""" Clicked on ToggleButton "Source Folder"
|
||||||
|
|
||||||
|
Args:
|
||||||
|
button (Gtk.ToggleButton): Clicked ToggleButton
|
||||||
|
"""
|
||||||
if button.get_active():
|
if button.get_active():
|
||||||
self.prefs.image_source = ImageSourceEnum.SOURCEFOLDER
|
self.prefs.image_source = ImageSourceEnum.SOURCEFOLDER
|
||||||
self.tb_image_set.set_active(False)
|
self.tb_image_set.set_active(False)
|
||||||
@@ -405,6 +419,11 @@ class Preferences:
|
|||||||
# +------------------------------------+
|
# +------------------------------------+
|
||||||
|
|
||||||
def on_cb_image_set_changed(self, combobox: Gtk.ComboBox):
|
def on_cb_image_set_changed(self, combobox: Gtk.ComboBox):
|
||||||
|
""" User select on of the included image sets
|
||||||
|
|
||||||
|
Args:
|
||||||
|
combobox (Gtk.ComboBox): The used ComboBox
|
||||||
|
"""
|
||||||
tree_iter = combobox.get_active_iter()
|
tree_iter = combobox.get_active_iter()
|
||||||
|
|
||||||
if tree_iter is not None and self.prefs.image_source == ImageSourceEnum.IMAGESET:
|
if tree_iter is not None and self.prefs.image_source == ImageSourceEnum.IMAGESET:
|
||||||
@@ -446,6 +465,10 @@ class Preferences:
|
|||||||
# Extract the heic file
|
# Extract the heic file
|
||||||
result = self.images.extract_heic_file(file_path)
|
result = self.images.extract_heic_file(file_path)
|
||||||
|
|
||||||
|
# Update the preferences
|
||||||
|
self.prefs.selected_image_set = ""
|
||||||
|
self.prefs.source_folder = PREFERENCES_URI + "/images/extracted_images/"
|
||||||
|
|
||||||
# Load images only if the extraction was successfully
|
# Load images only if the extraction was successfully
|
||||||
if result:
|
if result:
|
||||||
# Collect all extracted images and push them to the comboboxes
|
# Collect all extracted images and push them to the comboboxes
|
||||||
@@ -455,11 +478,6 @@ class Preferences:
|
|||||||
self.dialogs.message_dialog("Error during extraction")
|
self.dialogs.message_dialog("Error during extraction")
|
||||||
|
|
||||||
|
|
||||||
# Update the preferences
|
|
||||||
self.prefs.selected_image_set = ""
|
|
||||||
self.prefs.source_folder = PREFERENCES_URI + "/images/extracted_images/"
|
|
||||||
|
|
||||||
|
|
||||||
# +------------------------------------------------------------+
|
# +------------------------------------------------------------+
|
||||||
# | Select a source folder | 📂 Open file selection dialog |
|
# | Select a source folder | 📂 Open file selection dialog |
|
||||||
# | /home/developer/Downloads/
|
# | /home/developer/Downloads/
|
||||||
@@ -494,6 +512,11 @@ class Preferences:
|
|||||||
|
|
||||||
|
|
||||||
def on_cb_period_preview_changed(self, combobox: Gtk.ComboBox):
|
def on_cb_period_preview_changed(self, combobox: Gtk.ComboBox):
|
||||||
|
""" User select an image from the ComboBox for the time period
|
||||||
|
|
||||||
|
Args:
|
||||||
|
combobox (Gtk.ComboBox): The used ComboBox
|
||||||
|
"""
|
||||||
tree_iter = combobox.get_active_iter()
|
tree_iter = combobox.get_active_iter()
|
||||||
|
|
||||||
combobox_name = Gtk.Buildable.get_name(combobox)
|
combobox_name = Gtk.Buildable.get_name(combobox)
|
||||||
@@ -609,7 +632,12 @@ class Preferences:
|
|||||||
self.refresh_chart()
|
self.refresh_chart()
|
||||||
|
|
||||||
|
|
||||||
def on_spb_network_location_refresh_time_changed(self, spin_button):
|
def on_spb_network_location_refresh_time_changed(self, spin_button: Gtk.SpinButton):
|
||||||
|
""" User changed the refresh time of network location estimation
|
||||||
|
|
||||||
|
Args:
|
||||||
|
spin_button (Gtk.SpinButton): The used SpinButton
|
||||||
|
"""
|
||||||
self.prefs.location_refresh_intervals = spin_button.get_value()
|
self.prefs.location_refresh_intervals = spin_button.get_value()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -10,9 +10,9 @@ class Time_Bar_Chart:
|
|||||||
"00193d",
|
"00193d",
|
||||||
"05597f",
|
"05597f",
|
||||||
"54babf",
|
"54babf",
|
||||||
"bfe3c2",
|
"9ec3a1",
|
||||||
"ffbf6b",
|
"ffb95e",
|
||||||
"fdb55c",
|
"fcae4e",
|
||||||
"f37f73",
|
"f37f73",
|
||||||
"b45bbc",
|
"b45bbc",
|
||||||
"7e38ce",
|
"7e38ce",
|
||||||
@@ -107,13 +107,22 @@ class Time_Bar_Chart:
|
|||||||
image_height (int): Total height of the image
|
image_height (int): Total height of the image
|
||||||
"""
|
"""
|
||||||
for i in range(0, 8):
|
for i in range(0, 8):
|
||||||
|
# 3 hour vertical line
|
||||||
self.image_code.append(
|
self.image_code.append(
|
||||||
'<line x1="%s" y1="40" x2="%s" y2="%s" stroke="gray" stroke-width="2" />' %
|
'<line x1="%s" y1="40" x2="%s" y2="%s" stroke="white" stroke-width="2" />' %
|
||||||
(i * (image_width // 8), i * (image_width // 8), image_height - 40)
|
(i * (image_width // 8), i * (image_width // 8), image_height - 40)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# The two hours between the 3 hour lines
|
||||||
|
for j in range(1, 3):
|
||||||
self.image_code.append(
|
self.image_code.append(
|
||||||
'<text x="%s" y="%s" fill="gray" font-size="20" font-family="Liberation Sans">%s</text>' %
|
'<line x1="%s" y1="40" x2="%s" y2="%s" stroke="white" stroke-width="0.5" />' %
|
||||||
|
(i * (image_width // 8) + image_width // 24 * j, i * (image_width // 8) + image_width // 24 * j, image_height - 40)
|
||||||
|
)
|
||||||
|
|
||||||
|
# Time labels
|
||||||
|
self.image_code.append(
|
||||||
|
'<text x="%s" y="%s" fill="white" font-size="20" font-family="Liberation Sans">%s</text>' %
|
||||||
(i * (image_width // 8) + 5, image_height - 45, i * 3)
|
(i * (image_width // 8) + 5, image_height - 45, i * 3)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 37 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 412 KiB After Width: | Height: | Size: 373 KiB |
Reference in New Issue
Block a user