Merge lp:~rpadovani/webbrowser-app/remember-height-width-destkop into lp:webbrowser-app

Proposed by Riccardo Padovani
Status: Rejected
Rejected by: Florian Boucault
Proposed branch: lp:~rpadovani/webbrowser-app/remember-height-width-destkop
Merge into: lp:webbrowser-app
Diff against target: 74 lines (+30/-0)
2 files modified
src/app/webbrowser/Browser.qml (+16/-0)
src/app/webbrowser/webbrowser-app.qml (+14/-0)
To merge this branch: bzr merge lp:~rpadovani/webbrowser-app/remember-height-width-destkop
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing
Ubuntu Phablet Team Pending
Review via email: mp+256004@code.launchpad.net

Commit message

Remember position (x and y), height and width on desktop at restart

Description of the change

Remember position (x and y), height and width on desktop at restart.

When you click reset in settings, it reset height and width but not the position. Does it make sense? Should I reset all 4? (or no one of them)?

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Olivier Tilloy (osomon) wrote :

I think it would be ok to reset all 4 values.

This would need to be implemented for the webapp container as well, i.e. at BrowserWindow level (src/app/BrowserWindow.qml), and thus I guess it would make sense to store those values separately. The documentation for Qt.labs.settings isn’t really clear about that, so this would need to be tested: can we have two separate Settings object instances, each with a group of different properties, and have all of them written to the same file? If so, then we could have a generic Settings instance in BrowserWindow.qml for x, y, width and height, and the rest of the app-specific settings in Browser.qml.

967. By Riccardo Padovani

Reset also x and y size on reset settings

Revision history for this message
Riccardo Padovani (rpadovani) wrote :

> I think it would be ok to reset all 4 values.

Done.

About Webapps, I thought about them, my doubt is: if we add a new settings object in the BrowserWindow.qml (and let's say it works) then how do we access it from Browser.qml to reset properties?

Maybe is better to create a new Settings object to WebApp.qml? (And maybe in future allow webapps to create settings)?

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Florian Boucault (fboucault) wrote :

Unmerged revisions

967. By Riccardo Padovani

Reset also x and y size on reset settings

966. By Riccardo Padovani

Remember height, width and position at next restart on desktop

965. By Launchpad Translations on behalf of phablet-team

Launchpad automatic translations update.

964. By Launchpad Translations on behalf of phablet-team

Launchpad automatic translations update.

963. By Launchpad Translations on behalf of phablet-team

Launchpad automatic translations update.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/app/webbrowser/Browser.qml'
--- src/app/webbrowser/Browser.qml 2015-04-22 10:25:50 +0000
+++ src/app/webbrowser/Browser.qml 2015-04-27 07:25:56 +0000
@@ -34,6 +34,10 @@
3434
35 property var historyModel: (historyModelLoader.status == Loader.Ready) ? historyModelLoader.item : null35 property var historyModel: (historyModelLoader.status == Loader.Ready) ? historyModelLoader.item : null
36 property var bookmarksModel: (bookmarksModelLoader.status == Loader.Ready) ? bookmarksModelLoader.item : null36 property var bookmarksModel: (bookmarksModelLoader.status == Loader.Ready) ? bookmarksModelLoader.item : null
37 property alias browserWidth: settings.width
38 property alias browserHeight: settings.height
39 property alias browserX: settings.x
40 property alias browserY: settings.y
3741
38 property bool newSession: false42 property bool newSession: false
3943
@@ -82,12 +86,20 @@
82 property string searchEngine: settingsDefaults.searchEngine86 property string searchEngine: settingsDefaults.searchEngine
83 property string allowOpenInBackgroundTab: settingsDefaults.allowOpenInBackgroundTab87 property string allowOpenInBackgroundTab: settingsDefaults.allowOpenInBackgroundTab
84 property bool restoreSession: settingsDefaults.restoreSession88 property bool restoreSession: settingsDefaults.restoreSession
89 property int height: settingsDefaults.height
90 property int width: settingsDefaults.width
91 property int x: settingsDefaults.x
92 property int y: settingsDefaults.y
8593
86 function restoreDefaults() {94 function restoreDefaults() {
87 homepage = settingsDefaults.homepage95 homepage = settingsDefaults.homepage
88 searchEngine = settingsDefaults.searchEngine96 searchEngine = settingsDefaults.searchEngine
89 allowOpenInBackgroundTab = settingsDefaults.allowOpenInBackgroundTab97 allowOpenInBackgroundTab = settingsDefaults.allowOpenInBackgroundTab
90 restoreSession = settingsDefaults.restoreSession98 restoreSession = settingsDefaults.restoreSession
99 height = settingsDefaults.height
100 width = settingsDefaults.width
101 x = settingsDefaults.x
102 y = settingsDefaults.y
91 }103 }
92 }104 }
93105
@@ -98,6 +110,10 @@
98 readonly property string searchEngine: "google"110 readonly property string searchEngine: "google"
99 readonly property string allowOpenInBackgroundTab: "default"111 readonly property string allowOpenInBackgroundTab: "default"
100 readonly property bool restoreSession: true112 readonly property bool restoreSession: true
113 readonly property int height: 600
114 readonly property int width: 800
115 readonly property int x: 0
116 readonly property int y: 0
101 }117 }
102118
103 Item {119 Item {
104120
=== modified file 'src/app/webbrowser/webbrowser-app.qml'
--- src/app/webbrowser/webbrowser-app.qml 2015-03-23 22:35:12 +0000
+++ src/app/webbrowser/webbrowser-app.qml 2015-04-27 07:25:56 +0000
@@ -25,9 +25,23 @@
2525
26 property alias urls: browser.initialUrls26 property alias urls: browser.initialUrls
27 property alias newSession: browser.newSession27 property alias newSession: browser.newSession
28 property alias browserHeight: browser.browserHeight
29 property alias browserWidth: browser.browserWidth
30 property alias browserX: browser.browserX
31 property alias browserY: browser.browserY
2832
29 currentWebview: browser.currentWebview33 currentWebview: browser.currentWebview
3034
35 height: browserHeight
36 width: browserWidth
37 x: browserX
38 y: browserY
39
40 Binding { target: window; property: "browserHeight"; value: height }
41 Binding { target: window; property: "browserWidth"; value: width }
42 Binding { target: window; property: "browserX"; value: x }
43 Binding { target: window; property: "browserY"; value: y }
44
31 title: {45 title: {
32 if (browser.title) {46 if (browser.title) {
33 // TRANSLATORS: %1 refers to the current page’s title47 // TRANSLATORS: %1 refers to the current page’s title

Subscribers

People subscribed via source and target branches

to status/vote changes: