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
1=== modified file 'extensions/delayed-load.vala'
2--- extensions/delayed-load.vala 2013-11-07 23:50:46 +0000
3+++ extensions/delayed-load.vala 2013-11-19 20:42:17 +0000
4@@ -31,9 +31,6 @@
5 }
6
7 public void activated (Midori.App app) {
8- /* FIXME: override behavior without changing the preference */
9- app.settings.load_on_startup = Midori.MidoriStartup.DELAYED_PAGES;
10-
11 foreach (Midori.Browser browser in app.get_browsers ()) {
12 browser_added (browser);
13 }
14
15=== modified file 'extensions/tabby.vala'
16--- extensions/tabby.vala 2013-11-19 19:30:54 +0000
17+++ extensions/tabby.vala 2013-11-19 20:42:17 +0000
18@@ -144,6 +144,11 @@
19 unowned GLib.List<unowned Katze.Item> u_items = items;
20
21 bool delay = false;
22+ bool should_delay = false;
23+
24+ int load_on_startup;
25+ APP.settings.get ("load-on-startup", out load_on_startup);
26+ should_delay = load_on_startup == Midori.MidoriStartup.DELAYED_PAGES;
27
28 this.state = SessionState.RESTORING;
29
30@@ -162,7 +167,7 @@
31
32 t_item.set_meta_integer ("append", 1);
33
34- if (delay)
35+ if (delay && should_delay)
36 t_item.set_meta_integer ("delay", Midori.Delay.DELAYED);
37 else
38 delay = true;
39@@ -643,7 +648,24 @@
40 private class Manager : Midori.Extension {
41 private Base.Storage storage;
42 private bool load_session () {
43- this.storage.restore_last_sessions ();
44+ /* Using get here to avoid MidoriMidoriStartup in generated C with Vala 0.20.1 */
45+ int load_on_startup;
46+ APP.settings.get ("load-on-startup", out load_on_startup);
47+ if (load_on_startup == Midori.MidoriStartup.BLANK_PAGE) {
48+ Midori.Browser browser = APP.create_browser ();
49+ APP.add_browser (browser);
50+ /* The API from the old days says blank but means speed dial */
51+ browser.add_uri ("about:dial");
52+ browser.show ();
53+ } else if (load_on_startup == Midori.MidoriStartup.HOMEPAGE) {
54+ Midori.Browser browser = APP.create_browser ();
55+ APP.add_browser (browser);
56+ browser.add_uri ("about:home");
57+ browser.show ();
58+ } else {
59+ this.storage.restore_last_sessions ();
60+ }
61+
62 return false;
63 }
64
65@@ -685,8 +707,14 @@
66 GLib.warning ("missing session");
67 } else {
68 session.close ();
69- if (browser.destroy_with_parent) {
70- /* remove js popup sessions */
71+
72+ /* Using get here to avoid MidoriMidoriStartup in generated C with Vala 0.20.1 */
73+ int load_on_startup;
74+ APP.settings.get ("load-on-startup", out load_on_startup);
75+
76+ if (browser.destroy_with_parent
77+ || load_on_startup < Midori.MidoriStartup.LAST_OPEN_PAGES) {
78+ /* Remove js popups and close if not restoring on startup */
79 session.remove ();
80 }
81 }

Subscribers

People subscribed via source and target branches

to all changes: