Merge lp:~midori/midori/noSessionOnStartup into lp:midori

Proposed by Cris Dywan
Status: Merged
Approved by: Cris Dywan
Approved revision: 6485
Merged at revision: 6486
Proposed branch: lp:~midori/midori/noSessionOnStartup
Merge into: lp:midori
Diff against target: 81 lines (+32/-7)
2 files modified
extensions/delayed-load.vala (+0/-3)
extensions/tabby.vala (+32/-4)
To merge this branch: bzr merge lp:~midori/midori/noSessionOnStartup
Reviewer Review Type Date Requested Status
Cris Dywan Approve
André Stösel Approve
Review via email: mp+195482@code.launchpad.net

Commit message

Open speed dial or homepage according to preference

To post a comment you must log in.
Revision history for this message
gue5t gue5t (gue5t) wrote :

Tested without regressions, but it seems that if the startup preference is Speed Dial or Homepage, then a new session is added to the tabby db file without removing the old ones.

lp:~midori/midori/noSessionOnStartup updated
6485. By André Stösel

check MidoriStartup before delaying pages

Revision history for this message
André Stösel (ivaldi) wrote :

Maybe we should use Midori.MidoriStartup.DELAYED_PAGES as default value?

review: Approve
Revision history for this message
Cris Dywan (kalikiana) wrote :

Let's leave the defaults as they are and re-visit this in the next cycle, if there's a chance that we merge the settings it would be pointless to move the cheese back and forth now.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'extensions/delayed-load.vala'
--- extensions/delayed-load.vala 2013-11-07 23:50:46 +0000
+++ extensions/delayed-load.vala 2013-11-19 20:42:17 +0000
@@ -31,9 +31,6 @@
31 }31 }
3232
33 public void activated (Midori.App app) {33 public void activated (Midori.App app) {
34 /* FIXME: override behavior without changing the preference */
35 app.settings.load_on_startup = Midori.MidoriStartup.DELAYED_PAGES;
36
37 foreach (Midori.Browser browser in app.get_browsers ()) {34 foreach (Midori.Browser browser in app.get_browsers ()) {
38 browser_added (browser);35 browser_added (browser);
39 }36 }
4037
=== modified file 'extensions/tabby.vala'
--- extensions/tabby.vala 2013-11-19 19:30:54 +0000
+++ extensions/tabby.vala 2013-11-19 20:42:17 +0000
@@ -144,6 +144,11 @@
144 unowned GLib.List<unowned Katze.Item> u_items = items;144 unowned GLib.List<unowned Katze.Item> u_items = items;
145145
146 bool delay = false;146 bool delay = false;
147 bool should_delay = false;
148
149 int load_on_startup;
150 APP.settings.get ("load-on-startup", out load_on_startup);
151 should_delay = load_on_startup == Midori.MidoriStartup.DELAYED_PAGES;
147152
148 this.state = SessionState.RESTORING;153 this.state = SessionState.RESTORING;
149154
@@ -162,7 +167,7 @@
162167
163 t_item.set_meta_integer ("append", 1);168 t_item.set_meta_integer ("append", 1);
164169
165 if (delay)170 if (delay && should_delay)
166 t_item.set_meta_integer ("delay", Midori.Delay.DELAYED);171 t_item.set_meta_integer ("delay", Midori.Delay.DELAYED);
167 else172 else
168 delay = true;173 delay = true;
@@ -643,7 +648,24 @@
643 private class Manager : Midori.Extension {648 private class Manager : Midori.Extension {
644 private Base.Storage storage;649 private Base.Storage storage;
645 private bool load_session () {650 private bool load_session () {
646 this.storage.restore_last_sessions ();651 /* Using get here to avoid MidoriMidoriStartup in generated C with Vala 0.20.1 */
652 int load_on_startup;
653 APP.settings.get ("load-on-startup", out load_on_startup);
654 if (load_on_startup == Midori.MidoriStartup.BLANK_PAGE) {
655 Midori.Browser browser = APP.create_browser ();
656 APP.add_browser (browser);
657 /* The API from the old days says blank but means speed dial */
658 browser.add_uri ("about:dial");
659 browser.show ();
660 } else if (load_on_startup == Midori.MidoriStartup.HOMEPAGE) {
661 Midori.Browser browser = APP.create_browser ();
662 APP.add_browser (browser);
663 browser.add_uri ("about:home");
664 browser.show ();
665 } else {
666 this.storage.restore_last_sessions ();
667 }
668
647 return false;669 return false;
648 }670 }
649671
@@ -685,8 +707,14 @@
685 GLib.warning ("missing session");707 GLib.warning ("missing session");
686 } else {708 } else {
687 session.close ();709 session.close ();
688 if (browser.destroy_with_parent) {710
689 /* remove js popup sessions */711 /* Using get here to avoid MidoriMidoriStartup in generated C with Vala 0.20.1 */
712 int load_on_startup;
713 APP.settings.get ("load-on-startup", out load_on_startup);
714
715 if (browser.destroy_with_parent
716 || load_on_startup < Midori.MidoriStartup.LAST_OPEN_PAGES) {
717 /* Remove js popups and close if not restoring on startup */
690 session.remove ();718 session.remove ();
691 }719 }
692 }720 }

Subscribers

People subscribed via source and target branches

to all changes: