From 34056b10063cc0bcabbc4dc486fd3d8fcd1570e6 Mon Sep 17 00:00:00 2001 From: DYefremov Date: Fri, 24 Dec 2021 00:15:17 +0300 Subject: [PATCH] minor rework of recordings tab --- app/ui/control.glade | 444 +++++++++++++++++++++---------------------- app/ui/control.py | 11 +- 2 files changed, 224 insertions(+), 231 deletions(-) diff --git a/app/ui/control.glade b/app/ui/control.glade index f1aad24c..d9bde410 100644 --- a/app/ui/control.glade +++ b/app/ui/control.glade @@ -1158,81 +1158,66 @@ Author: Dmitriy Yefremov + + - + True False - 0.49000000953674316 - in + vertical - + True - False - 5 - 5 - 2 - 5 - vertical + True + True - + True False - 5 - 5 - 5 - 5 - 5 + 0.49000000953674316 + in - + True - True - True - Remove - True - + False + 5 + 5 + 5 + vertical - + True False - user-trash-symbolic - - - - - False - True - 0 - - - - - - - - False - True - 0 - - - - - True - False - 5 - 5 - 5 - 5 - - - False - center - - - True - True - edit-find-symbolic - False - False + 5 + 5 + 5 + 5 + 5 + + + True + True + True + Remove + True + + + + True + False + user-trash-symbolic + + + + + False + True + 0 + + + + + False @@ -1241,196 +1226,198 @@ Author: Dmitriy Yefremov - + True - False True - True + in - + True - False - down + True + recordings_model + both + 5 + + + + multiple + + + + + 100 + Service + 0.5 + + + 0.49000000953674316 + + + 0 + + + + + + + autosize + 150 + Title + 0.5 + + + 5 + end + + + 1 + + + + + + + 100 + Time + 0.5 + + + 5 + + + 2 + + + + + + + 100 + Length + 0.5 + + + 0.49000000953674316 + + + 3 + + + + + + + True + 100 + File + True + 0.5 + + + end + + + 4 + + + + + + + True + Description + True + 0.5 + + + end + + + 5 + + + + - False - False + True + True 1 - + + 24 True - False - True - True + False + 10 + 10 + 5 - + True False - up + document-properties + + False + True + 0 + + + + + True + False + 0 + + + False + True + 1 + + + + False - False + True 2 - - - False - True - 0 - - - + + + True + False + Recordings + - False - True - 1 + True + True - + True - True - True - - - True - True - in - - - True - True - recordings_model - both - 5 - - - - multiple - - - - - 100 - Service - 0.5 - - - 0.49000000953674316 - - - 0 - - - - - - - autosize - 150 - Title - 0.5 - - - 5 - end - - - 1 - - - - - - - 100 - Time - 0.5 - - - 5 - - - 2 - - - - - - - 100 - Length - 0.5 - - - 0.49000000953674316 - - - 3 - - - - - - - True - 100 - File - True - 0.5 - - - end - - - 4 - - - - - - - True - Description - True - 0.5 - - - end - - - 5 - - - - - - - - - True - True - - + False + 0.49000000953674316 + in 250 True True + 5 + 5 + 5 in 100 @@ -1438,6 +1425,7 @@ Author: Dmitriy Yefremov True True rec_paths_model + False 1 True True @@ -1479,26 +1467,26 @@ Author: Dmitriy Yefremov - - False - True - + + + + True + False + Paths + - True - True - 2 + False + True - - - - True - False - Recordings - + + True + True + 2 + diff --git a/app/ui/control.py b/app/ui/control.py index edce1072..eabc35c1 100644 --- a/app/ui/control.py +++ b/app/ui/control.py @@ -658,14 +658,16 @@ class RecordingsTool(Gtk.Box): handlers = {"on_path_press": self.on_path_press, "on_path_activated": self.on_path_activated, "on_recordings_activated": self.on_recordings_activated, - "on_recording_remove": self.on_recording_remove} + "on_recording_remove": self.on_recording_remove, + "on_recordings_model_changed": self.on_recordings_model_changed} builder = get_builder(UI_RESOURCES_PATH + "control.glade", handlers, - objects=("recordings_frame", "recordings_model", "rec_paths_model")) + objects=("recordings_box", "recordings_model", "rec_paths_model")) self._rec_view = builder.get_object("recordings_view") self._paths_view = builder.get_object("recordings_paths_view") self._paned = builder.get_object("recordings_paned") - self.pack_start(builder.get_object("recordings_frame"), True, True, 0) + self._recordings_count_label = builder.get_object("recordings_count_label") + self.pack_start(builder.get_object("recordings_box"), True, True, 0) if settings.alternate_layout: self.on_layout_changed(app, True) @@ -788,6 +790,9 @@ class RecordingsTool(Gtk.Box): self._app.show_error_message(resp) break + def on_recordings_model_changed(self, model, path, itr=None): + self._recordings_count_label.set_text(str(len(model))) + def on_playback(self, box, state): """ Updates state of the UI elements for playback mode. """ if self._settings.play_streams_mode is PlayStreamsMode.BUILT_IN: