[gnome-music/wip/mschraal/emptyview-new-initial-state] emptyview: Drop former initial-state
- From: Marinus Schraal <mschraal src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/wip/mschraal/emptyview-new-initial-state] emptyview: Drop former initial-state
- Date: Tue, 3 Aug 2021 11:52:25 +0000 (UTC)
commit f7659315f46049ad094219ea29a0e79af866e590
Author: Marinus Schraal <mschraal gnome org>
Date: Tue Aug 3 13:21:18 2021 +0200
emptyview: Drop former initial-state
Drop the initial-state which was one-time shown on the initial run of
Music.
data/icons/initial-state.png | Bin 270678 -> 0 bytes
data/org.gnome.Music.gresource.xml | 1 -
data/org.gnome.Music.gschema.xml | 5 -----
data/ui/AboutDialog.ui.in | 4 +---
gnomemusic/views/emptyview.py | 32 ++++++++++++--------------------
gnomemusic/window.py | 8 +-------
6 files changed, 14 insertions(+), 36 deletions(-)
---
diff --git a/data/org.gnome.Music.gresource.xml b/data/org.gnome.Music.gresource.xml
index b66dfea44..48dc79772 100644
--- a/data/org.gnome.Music.gresource.xml
+++ b/data/org.gnome.Music.gresource.xml
@@ -3,7 +3,6 @@
<gresource prefix="/org/gnome/Music">
<file alias="gtk/help-overlay.ui" preprocess="xml-stripblanks">ui/help-overlay.ui</file>
<file>org.gnome.Music.css</file>
- <file>icons/initial-state.png</file>
<file>icons/welcome-music.svg</file>
<file preprocess="xml-stripblanks">ui/AboutDialog.ui</file>
<file preprocess="xml-stripblanks">ui/AlbumCover.ui</file>
diff --git a/data/org.gnome.Music.gschema.xml b/data/org.gnome.Music.gschema.xml
index ae9c43ac8..31eed34b4 100644
--- a/data/org.gnome.Music.gschema.xml
+++ b/data/org.gnome.Music.gschema.xml
@@ -33,11 +33,6 @@
<summary>Enable ReplayGain</summary>
<description>Enables or disables ReplayGain for albums</description>
</key>
- <key type="b" name="did-initial-state">
- <default>false</default>
- <summary>Inital state has been displayed</summary>
- <description>Set to true when initial state has been displayed</description>
- </key>
<key type="b" name="inhibit-suspend">
<default>false</default>
<summary>Inhibit system suspend</summary>
diff --git a/data/ui/AboutDialog.ui.in b/data/ui/AboutDialog.ui.in
index 431e7f916..ac47222f5 100644
--- a/data/ui/AboutDialog.ui.in
+++ b/data/ui/AboutDialog.ui.in
@@ -16,9 +16,7 @@ GNOME Music is distributed in the hope that it will be useful, but WITHOUT ANY W
You should have received a copy of the GNU General Public License along with GNOME Music; if not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-The GNOME Music authors hereby grant permission for non-GPL compatible GStreamer plugins to be used and
distributed together with GStreamer and GNOME Music. This permission is above and beyond the permissions
granted by the GPL license by which GNOME Music is covered. If you modify this code, you may extend this
exception to your version of the code, but you are not obligated to do so. If you do not wish to do so,
delete this exception statement from your version.
-
-“Magic of the vinyl” by Sami Pyylampi image is licensed by CC-BY-SA 2.0
https://www.flickr.com/photos/_spy_/12270839403</property>
+The GNOME Music authors hereby grant permission for non-GPL compatible GStreamer plugins to be used and
distributed together with GStreamer and GNOME Music. This permission is above and beyond the permissions
granted by the GPL license by which GNOME Music is covered. If you modify this code, you may extend this
exception to your version of the code, but you are not obligated to do so. If you do not wish to do so,
delete this exception statement from your version.</property>
<property name="authors">Abhinav Singh
Adam Blanchet
Adrian Solom
diff --git a/gnomemusic/views/emptyview.py b/gnomemusic/views/emptyview.py
index 187bdf3fb..dd49147a7 100644
--- a/gnomemusic/views/emptyview.py
+++ b/gnomemusic/views/emptyview.py
@@ -32,20 +32,20 @@ from gi.repository import GLib, GObject, Gtk, Tracker
class EmptyView(Gtk.Stack):
"""Empty view when there is no music to display
- This view can have three states
- INITIAL means that Music app has never been initialized and no music
- has been found
- EMPTY means that no music has been found at startup
- SEARCH is the empty search view: no music found during a search
+ This view can have several states
+
+ EMPTY: No music has been found at startup (default)
+ SEARCH: No music found with a user search
+ NO_TRACKER: Tracker is unavailable
+ TRACKER_OUTDATED: Tracker version is too old
"""
class State(IntEnum):
"""Enum for EmptyView state."""
- INITIAL = 0
- EMPTY = 1
- SEARCH = 2
- NO_TRACKER = 3
- TRACKER_OUTDATED = 4
+ EMPTY = 0
+ SEARCH = 1
+ NO_TRACKER = 2
+ TRACKER_OUTDATED = 3
__gtype_name__ = "EmptyView"
@@ -74,7 +74,7 @@ class EmptyView(Gtk.Stack):
folder_text = _("The contents of your {} will appear here.")
self._content_text = folder_text.format(href_text)
- self._state = EmptyView.State.INITIAL
+ self._state = EmptyView.State.EMPTY
@GObject.Property(type=int, default=0, minimum=0, maximum=4)
def state(self):
@@ -92,9 +92,7 @@ class EmptyView(Gtk.Stack):
:param int value: new state
"""
self._state = value
- if self._state == EmptyView.State.INITIAL:
- self._set_initial_state()
- elif self._state == EmptyView.State.EMPTY:
+ if self._state == EmptyView.State.EMPTY:
self._set_empty_state()
elif self._state == EmptyView.State.SEARCH:
self._set_search_state()
@@ -103,12 +101,6 @@ class EmptyView(Gtk.Stack):
elif self._state == EmptyView.State.TRACKER_OUTDATED:
self._set_tracker_outdated_state()
- def _set_initial_state(self):
- self._status_page.props.title = _("Hey DJ")
- self._status_page.props.description = self._content_text
-
- self._status_page.props.icon_name = "initial-state"
-
def _set_empty_state(self):
self._status_page.props.title = _("Welcome to Music")
self._status_page.props.description = self._content_text
diff --git a/gnomemusic/window.py b/gnomemusic/window.py
index 91f28c1c3..d20a90fc3 100644
--- a/gnomemusic/window.py
+++ b/gnomemusic/window.py
@@ -180,8 +180,6 @@ class Window(Handy.ApplicationWindow):
2000, self._on_songs_available, None, None)
def _switch_to_empty_view(self):
- did_initial_state = self._settings.get_boolean('did-initial-state')
-
state = self._app.props.coregrilo.props.tracker_available
empty_view = self.views[View.EMPTY]
empty_view.props.visible = True
@@ -189,11 +187,8 @@ class Window(Handy.ApplicationWindow):
empty_view.props.state = EmptyView.State.NO_TRACKER
elif state == TrackerState.OUTDATED:
empty_view.props.state = EmptyView.State.TRACKER_OUTDATED
- elif did_initial_state:
- empty_view.props.state = EmptyView.State.EMPTY
else:
- # FIXME: On switch back this view does not show properly.
- empty_view.props.state = EmptyView.State.INITIAL
+ empty_view.props.state = EmptyView.State.EMPTY
self._headerbar.props.state = HeaderBar.State.EMPTY
@@ -225,7 +220,6 @@ class Window(Handy.ApplicationWindow):
self._on_songs_available(None, None)
def _switch_to_player_view(self):
- self._settings.set_boolean('did-initial-state', True)
self._on_notify_model_id = self._stack.connect(
'notify::visible-child', self._on_notify_mode)
self.connect('destroy', self._notify_mode_disconnect)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]