Merge lp:~vikoadi/audience/move-subtitle-font-to-playerpage into lp:~audience-members/audience/trunk

Proposed by Viko Adi Rahmawan on 2015-11-01
Status: Rejected
Rejected by: Daniel Fore on 2017-04-21
Proposed branch: lp:~vikoadi/audience/move-subtitle-font-to-playerpage
Merge into: lp:~audience-members/audience/trunk
Diff against target: 82 lines (+27/-15)
2 files modified
src/Widgets/PlayerPage.vala (+27/-0)
src/Widgets/VideoPlayer.vala (+0/-15)
To merge this branch: bzr merge lp:~vikoadi/audience/move-subtitle-font-to-playerpage
Reviewer Review Type Date Requested Status
Cody Garver 2015-11-01 Needs Fixing on 2016-02-23
Review via email: mp+276347@code.launchpad.net

Commit message

move subtitle font listening to playerpage

Description of the change

move subtitle font listening to playerpage

VideoPlayer should not listen to gsetting

To post a comment you must log in.
Cody Garver (codygarver) wrote :

Needs trunk merged in and conflicts resolved

review: Needs Fixing
Daniel Fore (danrabbit) wrote :

Rejecting since it seems to be abandoned

Unmerged revisions

550. By Viko Adi Rahmawan on 2015-11-01

move subtitle font listening to playerpage

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/Widgets/PlayerPage.vala'
2--- src/Widgets/PlayerPage.vala 2015-10-31 19:47:46 +0000
3+++ src/Widgets/PlayerPage.vala 2015-11-01 17:28:24 +0000
4@@ -212,6 +212,8 @@
5
6 stage.notify["allocation"].connect (() => {allocate_bottombar ();});
7
8+ settings.changed.connect (on_setting_changed);
9+
10 add (clutter);
11
12 show_all ();
13@@ -246,6 +248,8 @@
14 if (sub_uri != null)
15 video_player.set_subtitle_uri (sub_uri);
16
17+ video_player.subtitle_font = get_audience_font ();
18+
19 App.get_instance ().set_window_title (get_title (uri));
20 video_player.relayout ();
21
22@@ -523,5 +527,28 @@
23 Idle.add (update_aspect_ratio);
24 }
25
26+ void update_subtitle_font () {
27+ debug ("Updating subtitle font");
28+ var font = get_audience_font ();
29+
30+ if (get_audience_font () == "") {
31+ font = get_gnome_font ();
32+ }
33+ video_player.subtitle_font = font;
34+ }
35+
36+ string get_audience_font () {
37+ return settings.subtitle_font;
38+ }
39+
40+ string get_gnome_font () {
41+ var gnome_settings = new GLib.Settings ("org.gnome.desktop.interface");
42+ return gnome_settings.get_string ("font-name");
43+ }
44+
45+ void on_setting_changed () {
46+ if (video_player.subtitle_font != get_audience_font ())
47+ update_subtitle_font ();
48+ }
49 }
50 }
51
52=== modified file 'src/Widgets/VideoPlayer.vala'
53--- src/Widgets/VideoPlayer.vala 2015-09-21 18:11:20 +0000
54+++ src/Widgets/VideoPlayer.vala 2015-11-01 17:28:24 +0000
55@@ -239,10 +239,6 @@
56 video_sink.texture = video;
57 playbin.video_sink = video_sink;
58 add_child(video);
59- update_subtitle_font ();
60- settings.changed.connect (() => {
61- update_subtitle_font ();
62- });
63
64 playbin.about_to_finish.connect (() => {
65 if (!at_end) {
66@@ -522,16 +518,5 @@
67 }
68 debug ("scaling to %ux%u", video_width, video_height);
69 }
70-
71- void update_subtitle_font () {
72- debug ("Updating subtitle font");
73- var font = settings.subtitle_font;
74-
75- if (font == "") {
76- var gnome_settings = new GLib.Settings ("org.gnome.desktop.interface");
77- font = gnome_settings.get_string ("font-name");
78- }
79- subtitle_font = font;
80- }
81 }
82 }

Subscribers

People subscribed via source and target branches