[gnome-music/wip/jfelder/selection-misc-cleanups] Use unselect_all everywhere
- From: Jean Felder <jfelder src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/wip/jfelder/selection-misc-cleanups] Use unselect_all everywhere
- Date: Thu, 9 Jan 2020 20:36:12 +0000 (UTC)
commit cb91c25c2c69734290bbc6731c5ab129969d30ed
Author: Jean Felder <jfelder src gnome org>
Date: Thu Jan 9 21:28:54 2020 +0100
Use unselect_all everywhere
There is a mix of "select_none" and "unselect_all" all over the
codebase. Use "unselect_all" only for consistency.
gnomemusic/widgets/albumwidget.py | 4 ++--
gnomemusic/widgets/artistalbumswidget.py | 4 ++--
gnomemusic/widgets/artistalbumwidget.py | 4 ++--
gnomemusic/widgets/disclistboxwidget.py | 14 +++++++-------
gnomemusic/window.py | 12 ++++++------
5 files changed, 19 insertions(+), 19 deletions(-)
---
diff --git a/gnomemusic/widgets/albumwidget.py b/gnomemusic/widgets/albumwidget.py
index fdd744ba..21c92803 100644
--- a/gnomemusic/widgets/albumwidget.py
+++ b/gnomemusic/widgets/albumwidget.py
@@ -192,8 +192,8 @@ class AlbumWidget(Gtk.EventBox):
def select_all(self):
self._disc_list_box.select_all()
- def select_none(self):
- self._disc_list_box.select_none()
+ def unselect_all(self):
+ self._disc_list_box.unselect_all()
@GObject.Property(
type=Grl.Media, default=None, flags=GObject.ParamFlags.READABLE)
diff --git a/gnomemusic/widgets/artistalbumswidget.py b/gnomemusic/widgets/artistalbumswidget.py
index 7a3a689e..d396fe41 100644
--- a/gnomemusic/widgets/artistalbumswidget.py
+++ b/gnomemusic/widgets/artistalbumswidget.py
@@ -113,10 +113,10 @@ class ArtistAlbumsWidget(Gtk.ListBox):
widget.select_all()
@log
- def select_none(self):
+ def unselect_all(self):
"""Deselect all items"""
for widget in self._widgets:
- widget.select_none()
+ widget.unselect_all()
@GObject.Property(type=str, flags=GObject.ParamFlags.READABLE)
def artist(self):
diff --git a/gnomemusic/widgets/artistalbumwidget.py b/gnomemusic/widgets/artistalbumwidget.py
index 1b89fe83..11f685ac 100644
--- a/gnomemusic/widgets/artistalbumwidget.py
+++ b/gnomemusic/widgets/artistalbumwidget.py
@@ -129,6 +129,6 @@ class ArtistAlbumWidget(Gtk.Box):
self._disc_list_box.select_all()
@log
- def select_none(self):
+ def unselect_all(self):
"""Deselect all items"""
- self._disc_list_box.select_none()
+ self._disc_list_box.unselect_all()
diff --git a/gnomemusic/widgets/disclistboxwidget.py b/gnomemusic/widgets/disclistboxwidget.py
index ee891d0f..e843fa53 100644
--- a/gnomemusic/widgets/disclistboxwidget.py
+++ b/gnomemusic/widgets/disclistboxwidget.py
@@ -83,13 +83,13 @@ class DiscBox(Gtk.ListBoxRow):
self._list_box.foreach(child_select_all)
- def select_none(self):
+ def unselect_all(self):
"""Deselect all songs"""
- def child_select_none(child):
+ def child_unselect_all(child):
song_widget = child.get_child()
song_widget.props.coresong.props.selected = False
- self._list_box.foreach(child_select_none)
+ self._list_box.foreach(child_unselect_all)
def _create_widget(self, coresong):
song_widget = SongWidget(coresong)
@@ -154,12 +154,12 @@ class DiscListBox(Gtk.ListBox):
self.foreach(child_select_all)
- def select_none(self):
+ def unselect_all(self):
"""Deselect all songs"""
- def child_select_none(child):
- child.select_none()
+ def child_unselect_all(child):
+ child.unselect_all()
- self.foreach(child_select_none)
+ self.foreach(child_unselect_all)
@GObject.Property(type=bool, default=False)
def selection_mode(self):
diff --git a/gnomemusic/window.py b/gnomemusic/window.py
index 05ebab87..d0aa08cc 100644
--- a/gnomemusic/window.py
+++ b/gnomemusic/window.py
@@ -87,9 +87,9 @@ class Window(Gtk.ApplicationWindow):
select_all = Gio.SimpleAction.new('select_all', None)
select_all.connect('activate', self._select_all)
self.add_action(select_all)
- select_none = Gio.SimpleAction.new('select_none', None)
- select_none.connect('activate', self._select_none)
- self.add_action(select_none)
+ unselect_all = Gio.SimpleAction.new('unselect_all', None)
+ unselect_all.connect('activate', self._unselect_all)
+ self.add_action(unselect_all)
self.set_size_request(200, 100)
WindowPlacement(self)
@@ -312,7 +312,7 @@ class Window(Gtk.ApplicationWindow):
view.select_all()
@log
- def _select_none(self, action=None, param=None):
+ def _unselect_all(self, action=None, param=None):
if not self.props.selection_mode:
return
if self._headerbar.props.state == HeaderBar.State.MAIN:
@@ -320,7 +320,7 @@ class Window(Gtk.ApplicationWindow):
view.unselect_all()
else:
view = self.props.active_view.get_visible_child()
- view.select_none()
+ view.unselect_all()
@log
def _on_key_press(self, widget, event):
@@ -372,7 +372,7 @@ class Window(Gtk.ApplicationWindow):
# Ctrl+Shift+<KEY>
elif modifiers == shift_ctrl_mask:
if keyval == Gdk.KEY_A:
- self._select_none()
+ self._unselect_all()
# Alt+<KEY>
elif modifiers == mod1_mask:
# Go back from child view on Alt + Left
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]