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

Proposed by Viko Adi Rahmawan
Status: Rejected
Rejected by: Danielle Foré
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 Needs Fixing
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.
Revision history for this message
Cody Garver (codygarver) wrote :

Needs trunk merged in and conflicts resolved

review: Needs Fixing
Revision history for this message
Danielle Foré (danrabbit) wrote :

Rejecting since it seems to be abandoned

Unmerged revisions

550. By Viko Adi Rahmawan

move subtitle font listening to playerpage

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/Widgets/PlayerPage.vala'
--- src/Widgets/PlayerPage.vala 2015-10-31 19:47:46 +0000
+++ src/Widgets/PlayerPage.vala 2015-11-01 17:28:24 +0000
@@ -212,6 +212,8 @@
212212
213 stage.notify["allocation"].connect (() => {allocate_bottombar ();});213 stage.notify["allocation"].connect (() => {allocate_bottombar ();});
214214
215 settings.changed.connect (on_setting_changed);
216
215 add (clutter);217 add (clutter);
216218
217 show_all ();219 show_all ();
@@ -246,6 +248,8 @@
246 if (sub_uri != null)248 if (sub_uri != null)
247 video_player.set_subtitle_uri (sub_uri);249 video_player.set_subtitle_uri (sub_uri);
248250
251 video_player.subtitle_font = get_audience_font ();
252
249 App.get_instance ().set_window_title (get_title (uri));253 App.get_instance ().set_window_title (get_title (uri));
250 video_player.relayout ();254 video_player.relayout ();
251255
@@ -523,5 +527,28 @@
523 Idle.add (update_aspect_ratio);527 Idle.add (update_aspect_ratio);
524 }528 }
525529
530 void update_subtitle_font () {
531 debug ("Updating subtitle font");
532 var font = get_audience_font ();
533
534 if (get_audience_font () == "") {
535 font = get_gnome_font ();
536 }
537 video_player.subtitle_font = font;
538 }
539
540 string get_audience_font () {
541 return settings.subtitle_font;
542 }
543
544 string get_gnome_font () {
545 var gnome_settings = new GLib.Settings ("org.gnome.desktop.interface");
546 return gnome_settings.get_string ("font-name");
547 }
548
549 void on_setting_changed () {
550 if (video_player.subtitle_font != get_audience_font ())
551 update_subtitle_font ();
552 }
526 }553 }
527}554}
528555
=== modified file 'src/Widgets/VideoPlayer.vala'
--- src/Widgets/VideoPlayer.vala 2015-09-21 18:11:20 +0000
+++ src/Widgets/VideoPlayer.vala 2015-11-01 17:28:24 +0000
@@ -239,10 +239,6 @@
239 video_sink.texture = video;239 video_sink.texture = video;
240 playbin.video_sink = video_sink;240 playbin.video_sink = video_sink;
241 add_child(video);241 add_child(video);
242 update_subtitle_font ();
243 settings.changed.connect (() => {
244 update_subtitle_font ();
245 });
246242
247 playbin.about_to_finish.connect (() => {243 playbin.about_to_finish.connect (() => {
248 if (!at_end) {244 if (!at_end) {
@@ -522,16 +518,5 @@
522 }518 }
523 debug ("scaling to %ux%u", video_width, video_height);519 debug ("scaling to %ux%u", video_width, video_height);
524 }520 }
525
526 void update_subtitle_font () {
527 debug ("Updating subtitle font");
528 var font = settings.subtitle_font;
529
530 if (font == "") {
531 var gnome_settings = new GLib.Settings ("org.gnome.desktop.interface");
532 font = gnome_settings.get_string ("font-name");
533 }
534 subtitle_font = font;
535 }
536 }521 }
537}522}

Subscribers

People subscribed via source and target branches