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
1=== modified file 'src/app/webbrowser/Browser.qml'
2--- src/app/webbrowser/Browser.qml 2015-04-22 10:25:50 +0000
3+++ src/app/webbrowser/Browser.qml 2015-04-27 07:25:56 +0000
4@@ -34,6 +34,10 @@
5
6 property var historyModel: (historyModelLoader.status == Loader.Ready) ? historyModelLoader.item : null
7 property var bookmarksModel: (bookmarksModelLoader.status == Loader.Ready) ? bookmarksModelLoader.item : null
8+ property alias browserWidth: settings.width
9+ property alias browserHeight: settings.height
10+ property alias browserX: settings.x
11+ property alias browserY: settings.y
12
13 property bool newSession: false
14
15@@ -82,12 +86,20 @@
16 property string searchEngine: settingsDefaults.searchEngine
17 property string allowOpenInBackgroundTab: settingsDefaults.allowOpenInBackgroundTab
18 property bool restoreSession: settingsDefaults.restoreSession
19+ property int height: settingsDefaults.height
20+ property int width: settingsDefaults.width
21+ property int x: settingsDefaults.x
22+ property int y: settingsDefaults.y
23
24 function restoreDefaults() {
25 homepage = settingsDefaults.homepage
26 searchEngine = settingsDefaults.searchEngine
27 allowOpenInBackgroundTab = settingsDefaults.allowOpenInBackgroundTab
28 restoreSession = settingsDefaults.restoreSession
29+ height = settingsDefaults.height
30+ width = settingsDefaults.width
31+ x = settingsDefaults.x
32+ y = settingsDefaults.y
33 }
34 }
35
36@@ -98,6 +110,10 @@
37 readonly property string searchEngine: "google"
38 readonly property string allowOpenInBackgroundTab: "default"
39 readonly property bool restoreSession: true
40+ readonly property int height: 600
41+ readonly property int width: 800
42+ readonly property int x: 0
43+ readonly property int y: 0
44 }
45
46 Item {
47
48=== modified file 'src/app/webbrowser/webbrowser-app.qml'
49--- src/app/webbrowser/webbrowser-app.qml 2015-03-23 22:35:12 +0000
50+++ src/app/webbrowser/webbrowser-app.qml 2015-04-27 07:25:56 +0000
51@@ -25,9 +25,23 @@
52
53 property alias urls: browser.initialUrls
54 property alias newSession: browser.newSession
55+ property alias browserHeight: browser.browserHeight
56+ property alias browserWidth: browser.browserWidth
57+ property alias browserX: browser.browserX
58+ property alias browserY: browser.browserY
59
60 currentWebview: browser.currentWebview
61
62+ height: browserHeight
63+ width: browserWidth
64+ x: browserX
65+ y: browserY
66+
67+ Binding { target: window; property: "browserHeight"; value: height }
68+ Binding { target: window; property: "browserWidth"; value: width }
69+ Binding { target: window; property: "browserX"; value: x }
70+ Binding { target: window; property: "browserY"; value: y }
71+
72 title: {
73 if (browser.title) {
74 // TRANSLATORS: %1 refers to the current page’s title

Subscribers

People subscribed via source and target branches

to status/vote changes: