diff --git a/src/versions/solarfm-0.0.1/SolarFM/solarfm/signal_classes/mixins/ui/WidgetFileActionMixin.py b/src/versions/solarfm-0.0.1/SolarFM/solarfm/signal_classes/mixins/ui/WidgetFileActionMixin.py index d829cb6..1969125 100644 --- a/src/versions/solarfm-0.0.1/SolarFM/solarfm/signal_classes/mixins/ui/WidgetFileActionMixin.py +++ b/src/versions/solarfm-0.0.1/SolarFM/solarfm/signal_classes/mixins/ui/WidgetFileActionMixin.py @@ -4,7 +4,7 @@ import os # Lib imports import gi gi.require_version('Gtk', '3.0') -from gi.repository import Gtk, GObject, Gio +from gi.repository import Gtk, GObject, GLib, Gio # Application imports @@ -244,7 +244,7 @@ class WidgetFileActionMixin: def move_files(self, files, target): self.handle_files(files, "move", target) - # NOTE: Gtk recommends using fail flow than pre check existence which is more + # NOTE: Gtk recommends using fail flow than pre check which is more # race condition proof. They're right; but, they can't even delete # directories properly. So... f**k them. I'll do it my way. def handle_files(self, paths, action, _target_path=None): @@ -273,8 +273,7 @@ class WidgetFileActionMixin: if _file.query_exists(): if not overwrite_all and not rename_auto_all: - self.exists_file_label.set_label(_file.get_basename()) - self.exists_file_field.set_text(_file.get_basename()) + self.setup_exists_data(file, _file) response = self.show_exists_page() if response == "overwrite_all": @@ -344,6 +343,45 @@ class WidgetFileActionMixin: self.exists_file_rename_bttn.set_sensitive(False) + def setup_exists_data(self, from_file, to_file): + from_info = from_file.query_info("standard::*,time::modified", 0, cancellable=None) + to_info = to_file.query_info("standard::*,time::modified", 0, cancellable=None) + exists_file_diff_from = self.builder.get_object("exists_file_diff_from") + exists_file_diff_to = self.builder.get_object("exists_file_diff_to") + exists_file_from = self.builder.get_object("exists_file_from") + exists_file_to = self.builder.get_object("exists_file_to") + from_date = from_info.get_modification_date_time() + to_date = to_info.get_modification_date_time() + from_size = from_info.get_size() + to_size = to_info.get_size() + + exists_file_from.set_label(from_file.get_parent().get_path()) + exists_file_to.set_label(to_file.get_parent().get_path()) + self.exists_file_label.set_label(to_file.get_basename()) + self.exists_file_field.set_text(to_file.get_basename()) + + # Returns: -1, 0 or 1 if dt1 is less than, equal to or greater than dt2. + age = GLib.DateTime.compare(from_date, to_date) + age_text = "( same time )" + if age == -1: + age_text = "older" + if age == 1: + age_text = "newer" + + size_text = "( same size )" + if from_size < to_size: + size_text = "smaller" + if from_size > to_size: + size_text = "larger" + + from_label_text = f"{age_text} & {size_text}" + if age_text != "( same time )" or size_text != "( same size )": + from_label_text = f"{from_date.format('%F %R')} {self.sizeof_fmt(from_size)} ( {from_size} bytes ) ( {age_text} & {size_text} )" + to_label_text = f"{to_date.format('%F %R')} {self.sizeof_fmt(to_size)} ( {to_size} bytes )" + + exists_file_diff_from.set_text(from_label_text) + exists_file_diff_to.set_text(to_label_text) + def rename_proc(self, gio_file): full_path = gio_file.get_path() diff --git a/src/versions/solarfm-0.0.1/SolarFM/solarfm/solarfm.zip b/src/versions/solarfm-0.0.1/SolarFM/solarfm/solarfm.zip new file mode 100644 index 0000000..b5b954d Binary files /dev/null and b/src/versions/solarfm-0.0.1/SolarFM/solarfm/solarfm.zip differ diff --git a/user_config/usr/share/solarfm/Main_Window.glade b/user_config/usr/share/solarfm/Main_Window.glade index 84d6a2a..712ca82 100644 --- a/user_config/usr/share/solarfm/Main_Window.glade +++ b/user_config/usr/share/solarfm/Main_Window.glade @@ -903,6 +903,103 @@ SolarFM is developed on Atom, git, and using Python 3+ with Gtk GObject introspe True False + 15 + 10 + + + True + False + Moving From: + + + False + True + 0 + + + + + True + False + + + True + True + 1 + + + + + False + True + 1 + + + + + True + False + 0 + + + True + True + 2 + + + + + True + False + 20 + 10 + + + True + False + Moving To: + + + False + True + 0 + + + + + True + False + + + True + True + 1 + + + + + False + True + 3 + + + + + True + False + 0 + + + True + True + 4 + + + + + True + False + 20 True @@ -930,12 +1027,9 @@ SolarFM is developed on Atom, git, and using Python 3+ with Gtk GObject introspe False True - 1 + 5 - - - True @@ -945,7 +1039,7 @@ SolarFM is developed on Atom, git, and using Python 3+ with Gtk GObject introspe False True - 3 + 6 @@ -1008,7 +1102,7 @@ SolarFM is developed on Atom, git, and using Python 3+ with Gtk GObject introspe False True - 4 + 7