Merge lp:~artmello/gallery-app/gallery-app-sdk_1_3 into lp:gallery-app

Proposed by Arthur Mello
Status: Merged
Approved by: Renato Araujo Oliveira Filho
Approved revision: 1271
Merged at revision: 1243
Proposed branch: lp:~artmello/gallery-app/gallery-app-sdk_1_3
Merge into: lp:gallery-app
Diff against target: 3436 lines (+589/-1177)
83 files modified
rc/qml/AlbumEditor/AlbumCoverMenu.qml (+3/-3)
rc/qml/AlbumEditor/AlbumEditMenu.qml (+4/-4)
rc/qml/AlbumEditor/AlbumEditor.qml (+10/-20)
rc/qml/AlbumViewer/AlbumCover.qml (+3/-3)
rc/qml/AlbumViewer/AlbumCoverList.qml (+2/-2)
rc/qml/AlbumViewer/AlbumInternals/AlbumPageContents.qml (+2/-2)
rc/qml/AlbumViewer/AlbumInternals/AlbumPageFlipper.qml (+2/-2)
rc/qml/AlbumViewer/AlbumInternals/AlbumPageFlipperPage.qml (+2/-2)
rc/qml/AlbumViewer/AlbumInternals/AlbumPageLayout.qml (+2/-2)
rc/qml/AlbumViewer/AlbumInternals/AlbumPageLayoutAdd.qml (+2/-2)
rc/qml/AlbumViewer/AlbumInternals/AlbumPageLayoutLeftDoubleLandscape.qml (+2/-2)
rc/qml/AlbumViewer/AlbumInternals/AlbumPageLayoutLeftPortrait.qml (+2/-2)
rc/qml/AlbumViewer/AlbumInternals/AlbumPageLayoutRightDoubleLandscape.qml (+2/-2)
rc/qml/AlbumViewer/AlbumInternals/AlbumPageLayoutRightPortrait.qml (+2/-2)
rc/qml/AlbumViewer/AlbumInternals/FramePortrait.qml (+2/-2)
rc/qml/AlbumViewer/AlbumOpener.qml (+2/-2)
rc/qml/AlbumViewer/AlbumPageComponent.qml (+2/-2)
rc/qml/AlbumViewer/AlbumPageIndicator.qml (+3/-3)
rc/qml/AlbumViewer/AlbumPreviewComponent.qml (+2/-2)
rc/qml/AlbumViewer/AlbumSpreadViewer.qml (+2/-2)
rc/qml/AlbumViewer/AlbumViewer.qml (+35/-39)
rc/qml/AlbumViewer/AlbumViewerAnimated.qml (+3/-3)
rc/qml/AlbumViewer/AlbumViewerTransition.qml (+0/-404)
rc/qml/AlbumViewer/AlbumViewerTransitionPortraitPage.qml (+0/-171)
rc/qml/AlbumsOverview.qml (+59/-46)
rc/qml/Components/AspectArea.qml (+2/-2)
rc/qml/Components/Checkerboard.qml (+3/-10)
rc/qml/Components/CheckerboardDelegate.qml (+2/-2)
rc/qml/Components/DeleteDialog.qml (+4/-4)
rc/qml/Components/DeleteOrDeleteWithContentsDialog.qml (+5/-5)
rc/qml/Components/EventCard.qml (+4/-4)
rc/qml/Components/MediaGrid.qml (+7/-5)
rc/qml/Components/MediaSelector.qml (+3/-3)
rc/qml/Components/MouseAreaWithMultipoint.qml (+2/-2)
rc/qml/Components/PopupAlbumPicker.qml (+4/-4)
rc/qml/Components/SwipeArea.qml (+3/-3)
rc/qml/Components/TextEditOnClick.qml (+2/-2)
rc/qml/EventsOverview.qml (+63/-30)
rc/qml/GalleryApplication.qml (+4/-4)
rc/qml/LoadingScreen.qml (+3/-10)
rc/qml/MainScreen.qml (+21/-18)
rc/qml/MediaViewer/ExtrasPhotoEditorPage.qml (+5/-5)
rc/qml/MediaViewer/GalleryPhotoComponent.qml (+2/-2)
rc/qml/MediaViewer/GalleryPhotoEditorPage.qml (+4/-4)
rc/qml/MediaViewer/MediaListView.qml (+3/-3)
rc/qml/MediaViewer/MediaViewer.qml (+25/-14)
rc/qml/MediaViewer/PhotoEditor.qml (+4/-4)
rc/qml/MediaViewer/PhotoEditor/ActionsBar.qml (+4/-4)
rc/qml/MediaViewer/PhotoEditor/BusyIndicator.qml (+2/-2)
rc/qml/MediaViewer/PhotoEditor/CropCorner.qml (+3/-3)
rc/qml/MediaViewer/PhotoEditor/CropDragArea.qml (+2/-2)
rc/qml/MediaViewer/PhotoEditor/CropInteractor.qml (+3/-3)
rc/qml/MediaViewer/PhotoEditor/CropOverlay.qml (+3/-3)
rc/qml/MediaViewer/PhotoEditor/EditStack.qml (+3/-3)
rc/qml/MediaViewer/PhotoEditor/ExposureAdjuster.qml (+3/-3)
rc/qml/MediaViewer/PhotoViewerTransition.qml (+2/-2)
rc/qml/MediaViewer/PopupPhotoViewer.qml (+26/-10)
rc/qml/MediaViewer/SingleMediaViewer.qml (+6/-6)
rc/qml/OrganicView/OrganicAlbumView.qml (+2/-2)
rc/qml/OrganicView/OrganicItemInteraction.qml (+3/-3)
rc/qml/OrganicView/OrganicMediaList.qml (+7/-6)
rc/qml/OrganicView/OrganicView.qml (+3/-10)
rc/qml/PhotosOverview.qml (+62/-37)
rc/qml/PickerScreen.qml (+3/-11)
rc/qml/Utility/DissolveAnimation.qml (+2/-2)
rc/qml/Utility/EditingHUD.qml (+3/-3)
rc/qml/Utility/ExpandAnimation.qml (+2/-2)
rc/qml/Utility/FadeInAnimation.qml (+2/-2)
rc/qml/Utility/FadeOutAnimation.qml (+2/-2)
rc/qml/Utility/PhotosToolbarActions.qml (+0/-57)
rc/qml/Utility/SelectionState.qml (+2/-2)
rc/qml/Utility/SelectionToolbarAction.qml (+0/-82)
src/photo/photo.cpp (+1/-0)
src/photo/photo.h (+4/-1)
tests/autopilot/gallery_app/emulators/album_view.py (+27/-0)
tests/autopilot/gallery_app/emulators/photo_viewer.py (+35/-12)
tests/autopilot/gallery_app/emulators/picker_screen.py (+3/-3)
tests/autopilot/gallery_app/tests/test_album_editor.py (+1/-1)
tests/autopilot/gallery_app/tests/test_album_view.py (+22/-14)
tests/autopilot/gallery_app/tests/test_albums_view.py (+2/-3)
tests/autopilot/gallery_app/tests/test_events_view.py (+2/-3)
tests/autopilot/gallery_app/tests/test_photo_viewer.py (+15/-9)
tests/autopilot/gallery_app/tests/test_photos_view.py (+2/-3)
To merge this branch: bzr merge lp:~artmello/gallery-app/gallery-app-sdk_1_3
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing
Renato Araujo Oliveira Filho (community) Approve
Review via email: mp+276163@code.launchpad.net

Commit message

Update QML code to work with Ubuntu.Components 1.3

Description of the change

Update QML code to work with Ubuntu.Components 1.3

To post a comment you must log in.
1247. By Arthur Mello

Fix camera icon on Photos/Events view

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
1248. By Arthur Mello

Fix header on AlbumViewer and PopupPhotoViewer
Fix camera icon on AlbumsOverview

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
1249. By Arthur Mello

Toggle header visibility

1250. By Arthur Mello

Fix typo

1251. By Arthur Mello

Fix toggle fullscreen

1252. By Arthur Mello

Fix header visibility and fullscreen on AlbumViewer

1253. By Arthur Mello

Fix check for camera button on PhotosView

1254. By Arthur Mello

Fix camera button check for events view

1255. By Arthur Mello

Fix check for camera button in Albums view

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
1256. By Arthur Mello

Fix aspect ratio of thumbnails for Events/Photos overview

1257. By Arthur Mello

Make share picker header equal from MediaViewer and Photos/Events view

1258. By Arthur Mello

Fix PickerScreen

1259. By Arthur Mello

Fix AP tests for PopupPhotoViewer

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
1260. By Arthur Mello

Fix AP tests related with AlbumViewer

1261. By Arthur Mello

Fix flake8 issues

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
1262. By Arthur Mello

Fix AP tests

1263. By Arthur Mello

Fix canBeEdited property to remove warning log message

1264. By Arthur Mello

Fix header issue on PopupPhotoViewer

1265. By Arthur Mello

Remove legacy code from old album viewer animations not used anymore

1266. By Arthur Mello

Move AlbumEditor to a Loader

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
1267. By Arthur Mello

Update version for other Ubuntu imports

Revision history for this message
Renato Araujo Oliveira Filho (renatofilho) :
1268. By Arthur Mello

Update all QtQuick imports

Revision history for this message
Renato Araujo Oliveira Filho (renatofilho) :
1269. By Arthur Mello

Fix typo

1270. By Arthur Mello

Fix more QtQuick imports

1271. By Arthur Mello

Fix GalleryApplication import

Revision history for this message
Renato Araujo Oliveira Filho (renatofilho) wrote :

code looks good.

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== removed file 'rc/img/background-paper.png'
0Binary files rc/img/background-paper.png 2012-06-06 19:42:55 +0000 and rc/img/background-paper.png 1970-01-01 00:00:00 +0000 differ0Binary files rc/img/background-paper.png 2012-06-06 19:42:55 +0000 and rc/img/background-paper.png 1970-01-01 00:00:00 +0000 differ
=== removed file 'rc/img/camera@18.png'
1Binary files rc/img/camera@18.png 2012-12-06 10:33:29 +0000 and rc/img/camera@18.png 1970-01-01 00:00:00 +0000 differ1Binary files rc/img/camera@18.png 2012-12-06 10:33:29 +0000 and rc/img/camera@18.png 1970-01-01 00:00:00 +0000 differ
=== removed file 'rc/img/select@18.png'
2Binary files rc/img/select@18.png 2012-12-06 10:33:29 +0000 and rc/img/select@18.png 1970-01-01 00:00:00 +0000 differ2Binary files rc/img/select@18.png 2012-12-06 10:33:29 +0000 and rc/img/select@18.png 1970-01-01 00:00:00 +0000 differ
=== modified file 'rc/qml/AlbumEditor/AlbumCoverMenu.qml'
--- rc/qml/AlbumEditor/AlbumCoverMenu.qml 2015-02-16 22:52:55 +0000
+++ rc/qml/AlbumEditor/AlbumCoverMenu.qml 2015-11-05 19:26:06 +0000
@@ -17,9 +17,9 @@
17 * Eric Gregory <eric@yorba.org>17 * Eric Gregory <eric@yorba.org>
18 */18 */
1919
20import QtQuick 2.020import QtQuick 2.4
21import Ubuntu.Components.Popups 0.121import Ubuntu.Components.Popups 1.3
22import Ubuntu.Components.ListItems 0.1 as ListItem22import Ubuntu.Components.ListItems 1.3 as ListItem
23import "../AlbumViewer"23import "../AlbumViewer"
2424
25/*!25/*!
2626
=== modified file 'rc/qml/AlbumEditor/AlbumEditMenu.qml'
--- rc/qml/AlbumEditor/AlbumEditMenu.qml 2013-07-17 12:52:46 +0000
+++ rc/qml/AlbumEditor/AlbumEditMenu.qml 2015-11-05 19:26:06 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (C) 2012 Canonical Ltd2 * Copyright (C) 2012-2015 Canonical Ltd
3 *3 *
4 * This program is free software: you can redistribute it and/or modify4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as5 * it under the terms of the GNU General Public License version 3 as
@@ -17,9 +17,9 @@
17 * Eric Gregory <eric@yorba.org>17 * Eric Gregory <eric@yorba.org>
18 */18 */
1919
20import QtQuick 2.020import QtQuick 2.4
21import Ubuntu.Components.Popups 0.121import Ubuntu.Components.Popups 1.3
22import Ubuntu.Components.ListItems 0.1 as ListItem22import Ubuntu.Components.ListItems 1.3 as ListItem
2323
24/*!24/*!
25 Popover to show the context menu for an album25 Popover to show the context menu for an album
2626
=== modified file 'rc/qml/AlbumEditor/AlbumEditor.qml'
--- rc/qml/AlbumEditor/AlbumEditor.qml 2014-12-11 01:37:01 +0000
+++ rc/qml/AlbumEditor/AlbumEditor.qml 2015-11-05 19:26:06 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (C) 2011-2012 Canonical Ltd2 * Copyright (C) 2011-2015 Canonical Ltd
3 *3 *
4 * This program is free software: you can redistribute it and/or modify4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as5 * it under the terms of the GNU General Public License version 3 as
@@ -18,10 +18,10 @@
18 * Eric Gregory <eric@yorba.org>18 * Eric Gregory <eric@yorba.org>
19 */19 */
2020
21import QtQuick 2.021import QtQuick 2.4
22import Gallery 1.022import Gallery 1.0
23import Ubuntu.Components 1.123import Ubuntu.Components 1.3
24import Ubuntu.Components.Popups 0.124import Ubuntu.Components.Popups 1.3
25import "../../js/GalleryUtility.js" as GalleryUtility25import "../../js/GalleryUtility.js" as GalleryUtility
26import "../../js/GraphicsRoutines.js" as GraphicsRoutines26import "../../js/GraphicsRoutines.js" as GraphicsRoutines
27import "../AlbumViewer"27import "../AlbumViewer"
@@ -87,8 +87,6 @@
87 */87 */
88 property real canonicalHeight: units.gu(80)88 property real canonicalHeight: units.gu(80)
8989
90 property Rectangle backgroundGlass: overviewGlass
91
92 property bool showAlbumCover: true90 property bool showAlbumCover: true
9391
94 /*!92 /*!
@@ -119,16 +117,6 @@
119 editorRect = GalleryUtility.getRectRelativeTo(cover.internalRect, albumEditor);117 editorRect = GalleryUtility.getRectRelativeTo(cover.internalRect, albumEditor);
120 }118 }
121119
122 Rectangle {
123 id: overviewGlass
124 width: parent.width
125 height: header ? parent.height - header.height : parent.height
126 y: header.height
127
128 color: "black"
129 opacity: 0.0
130 }
131
132 onAlbumChanged: resetEditorRect() // HACK: works, but not conceptually correct.120 onAlbumChanged: resetEditorRect() // HACK: works, but not conceptually correct.
133 onWidthChanged: resetEditorRect()121 onWidthChanged: resetEditorRect()
134 onHeightChanged: resetEditorRect()122 onHeightChanged: resetEditorRect()
@@ -143,10 +131,12 @@
143 acceptedButtons: Qt.LeftButton | Qt.RightButton131 acceptedButtons: Qt.LeftButton | Qt.RightButton
144 anchors.fill: parent132 anchors.fill: parent
145 onPressed: {133 onPressed: {
146 coverMenu.hide();134 if (coverMenu) {
135 coverMenu.hide();
136 }
147 cover.editingDone();137 cover.editingDone();
148 closeAlbum();138 if(album.newAlbum)
149139 albumModel.destroyAlbum(album);
150 albumEditor.closeRequested(albumEditor.album, false);140 albumEditor.closeRequested(albumEditor.album, false);
151 }141 }
152 }142 }
@@ -155,7 +145,7 @@
155 id: coverArea145 id: coverArea
156146
157 x: (parent.width - width) / 2147 x: (parent.width - width) / 2
158 y: Math.max((parent.height - height) / 2, minimumTopMargin, header.height)148 y: Math.max((parent.height - height) / 2, minimumTopMargin)
159149
160 width: GraphicsRoutines.clamp(150 width: GraphicsRoutines.clamp(
161 preferredCoverWidth, minimumCoverWidth, canonicalWidth)151 preferredCoverWidth, minimumCoverWidth, canonicalWidth)
162152
=== modified file 'rc/qml/AlbumViewer/AlbumCover.qml'
--- rc/qml/AlbumViewer/AlbumCover.qml 2014-10-10 01:24:24 +0000
+++ rc/qml/AlbumViewer/AlbumCover.qml 2015-11-05 19:26:06 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (C) 2012 Canonical Ltd2 * Copyright (C) 2012-2015 Canonical Ltd
3 *3 *
4 * This program is free software: you can redistribute it and/or modify4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as5 * it under the terms of the GNU General Public License version 3 as
@@ -19,9 +19,9 @@
19 * Eric Gregory <eric@yorba.org>19 * Eric Gregory <eric@yorba.org>
20 */20 */
2121
22import QtQuick 2.022import QtQuick 2.4
23import Gallery 1.023import Gallery 1.0
24import Ubuntu.Components 0.124import Ubuntu.Components 1.3
25import "../Components"25import "../Components"
2626
27/*!27/*!
2828
=== modified file 'rc/qml/AlbumViewer/AlbumCoverList.qml'
--- rc/qml/AlbumViewer/AlbumCoverList.qml 2013-06-20 11:54:49 +0000
+++ rc/qml/AlbumViewer/AlbumCoverList.qml 2015-11-05 19:26:06 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (C) 2012 Canonical Ltd2 * Copyright (C) 2012-2015 Canonical Ltd
3 *3 *
4 * This program is free software: you can redistribute it and/or modify4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as5 * it under the terms of the GNU General Public License version 3 as
@@ -17,7 +17,7 @@
17 * Eric Gregory <eric@yorba.org>17 * Eric Gregory <eric@yorba.org>
18 */18 */
1919
20import QtQuick 2.020import QtQuick 2.4
21import Gallery 1.021import Gallery 1.0
2222
23/*!23/*!
2424
=== modified file 'rc/qml/AlbumViewer/AlbumInternals/AlbumPageContents.qml'
--- rc/qml/AlbumViewer/AlbumInternals/AlbumPageContents.qml 2014-03-19 15:15:28 +0000
+++ rc/qml/AlbumViewer/AlbumInternals/AlbumPageContents.qml 2015-11-05 19:26:06 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (C) 2012 Canonical Ltd2 * Copyright (C) 2012-2015 Canonical Ltd
3 *3 *
4 * This program is free software: you can redistribute it and/or modify4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as5 * it under the terms of the GNU General Public License version 3 as
@@ -17,7 +17,7 @@
17 * Charles Lindsay <chaz@yorba.org>17 * Charles Lindsay <chaz@yorba.org>
18 */18 */
1919
20import QtQuick 2.020import QtQuick 2.4
21import Gallery 1.021import Gallery 1.0
22import ".."22import ".."
2323
2424
=== modified file 'rc/qml/AlbumViewer/AlbumInternals/AlbumPageFlipper.qml'
--- rc/qml/AlbumViewer/AlbumInternals/AlbumPageFlipper.qml 2013-03-06 10:36:54 +0000
+++ rc/qml/AlbumViewer/AlbumInternals/AlbumPageFlipper.qml 2015-11-05 19:26:06 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (C) 2012 Canonical Ltd2 * Copyright (C) 2012-2015 Canonical Ltd
3 *3 *
4 * This program is free software: you can redistribute it and/or modify4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as5 * it under the terms of the GNU General Public License version 3 as
@@ -17,7 +17,7 @@
17 * Charles Lindsay <chaz@yorba.org>17 * Charles Lindsay <chaz@yorba.org>
18 */18 */
1919
20import QtQuick 2.020import QtQuick 2.4
21import Gallery 1.021import Gallery 1.0
22import "../../../js/Gallery.js" as Gallery22import "../../../js/Gallery.js" as Gallery
2323
2424
=== modified file 'rc/qml/AlbumViewer/AlbumInternals/AlbumPageFlipperPage.qml'
--- rc/qml/AlbumViewer/AlbumInternals/AlbumPageFlipperPage.qml 2013-03-06 10:36:54 +0000
+++ rc/qml/AlbumViewer/AlbumInternals/AlbumPageFlipperPage.qml 2015-11-05 19:26:06 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (C) 2012 Canonical Ltd2 * Copyright (C) 2012-2015 Canonical Ltd
3 *3 *
4 * This program is free software: you can redistribute it and/or modify4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as5 * it under the terms of the GNU General Public License version 3 as
@@ -17,7 +17,7 @@
17 * Charles Lindsay <chaz@yorba.org>17 * Charles Lindsay <chaz@yorba.org>
18 */18 */
1919
20import QtQuick 2.020import QtQuick 2.4
21import ".."21import ".."
2222
23// A page included inside the AlbumPageFlipper; see notes there. Tightly23// A page included inside the AlbumPageFlipper; see notes there. Tightly
2424
=== modified file 'rc/qml/AlbumViewer/AlbumInternals/AlbumPageLayout.qml'
--- rc/qml/AlbumViewer/AlbumInternals/AlbumPageLayout.qml 2013-03-06 10:36:54 +0000
+++ rc/qml/AlbumViewer/AlbumInternals/AlbumPageLayout.qml 2015-11-05 19:26:06 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (C) 2012 Canonical Ltd2 * Copyright (C) 2012-2015 Canonical Ltd
3 *3 *
4 * This program is free software: you can redistribute it and/or modify4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as5 * it under the terms of the GNU General Public License version 3 as
@@ -17,7 +17,7 @@
17 * Charles Lindsay <chaz@yorba.org>17 * Charles Lindsay <chaz@yorba.org>
18 */18 */
1919
20import QtQuick 2.020import QtQuick 2.4
2121
22// AlbumPageLayouts are all loaded from AlbumPageContents, and should inherit22// AlbumPageLayouts are all loaded from AlbumPageContents, and should inherit
23// its properties.23// its properties.
2424
=== modified file 'rc/qml/AlbumViewer/AlbumInternals/AlbumPageLayoutAdd.qml'
--- rc/qml/AlbumViewer/AlbumInternals/AlbumPageLayoutAdd.qml 2013-03-06 10:36:54 +0000
+++ rc/qml/AlbumViewer/AlbumInternals/AlbumPageLayoutAdd.qml 2015-11-05 19:26:06 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (C) 2011-2012 Canonical Ltd2 * Copyright (C) 2011-2015 Canonical Ltd
3 *3 *
4 * This program is free software: you can redistribute it and/or modify4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as5 * it under the terms of the GNU General Public License version 3 as
@@ -17,7 +17,7 @@
17 * Eric Gregory <eric@yorba.org>17 * Eric Gregory <eric@yorba.org>
18 */18 */
1919
20import QtQuick 2.020import QtQuick 2.4
2121
22// This page layout is used only for empty albums.22// This page layout is used only for empty albums.
23AlbumPageLayout {23AlbumPageLayout {
2424
=== modified file 'rc/qml/AlbumViewer/AlbumInternals/AlbumPageLayoutLeftDoubleLandscape.qml'
--- rc/qml/AlbumViewer/AlbumInternals/AlbumPageLayoutLeftDoubleLandscape.qml 2013-03-06 10:36:54 +0000
+++ rc/qml/AlbumViewer/AlbumInternals/AlbumPageLayoutLeftDoubleLandscape.qml 2015-11-05 19:26:06 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (C) 2011 Canonical Ltd2 * Copyright (C) 2011-2015 Canonical Ltd
3 *3 *
4 * This program is free software: you can redistribute it and/or modify4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as5 * it under the terms of the GNU General Public License version 3 as
@@ -18,7 +18,7 @@
18 * Charles Lindsay <chaz@yorba.org>18 * Charles Lindsay <chaz@yorba.org>
19 */19 */
2020
21import QtQuick 2.021import QtQuick 2.4
2222
23/*!23/*!
24*/24*/
2525
=== modified file 'rc/qml/AlbumViewer/AlbumInternals/AlbumPageLayoutLeftPortrait.qml'
--- rc/qml/AlbumViewer/AlbumInternals/AlbumPageLayoutLeftPortrait.qml 2013-03-06 10:36:54 +0000
+++ rc/qml/AlbumViewer/AlbumInternals/AlbumPageLayoutLeftPortrait.qml 2015-11-05 19:26:06 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (C) 2011 Canonical Ltd2 * Copyright (C) 2011-2015 Canonical Ltd
3 *3 *
4 * This program is free software: you can redistribute it and/or modify4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as5 * it under the terms of the GNU General Public License version 3 as
@@ -18,7 +18,7 @@
18 * Charles Lindsay <chaz@yorba.org>18 * Charles Lindsay <chaz@yorba.org>
19 */19 */
2020
21import QtQuick 2.021import QtQuick 2.4
2222
23/*!23/*!
24*/24*/
2525
=== modified file 'rc/qml/AlbumViewer/AlbumInternals/AlbumPageLayoutRightDoubleLandscape.qml'
--- rc/qml/AlbumViewer/AlbumInternals/AlbumPageLayoutRightDoubleLandscape.qml 2013-03-06 10:36:54 +0000
+++ rc/qml/AlbumViewer/AlbumInternals/AlbumPageLayoutRightDoubleLandscape.qml 2015-11-05 19:26:06 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (C) 2012 Canonical Ltd2 * Copyright (C) 2012-2015 Canonical Ltd
3 *3 *
4 * This program is free software: you can redistribute it and/or modify4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as5 * it under the terms of the GNU General Public License version 3 as
@@ -17,7 +17,7 @@
17 * Charles Lindsay <chaz@yorba.org>17 * Charles Lindsay <chaz@yorba.org>
18 */18 */
1919
20import QtQuick 2.020import QtQuick 2.4
2121
22/*!22/*!
23*/23*/
2424
=== modified file 'rc/qml/AlbumViewer/AlbumInternals/AlbumPageLayoutRightPortrait.qml'
--- rc/qml/AlbumViewer/AlbumInternals/AlbumPageLayoutRightPortrait.qml 2013-03-06 10:36:54 +0000
+++ rc/qml/AlbumViewer/AlbumInternals/AlbumPageLayoutRightPortrait.qml 2015-11-05 19:26:06 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (C) 2011 Canonical Ltd2 * Copyright (C) 2011-2015 Canonical Ltd
3 *3 *
4 * This program is free software: you can redistribute it and/or modify4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as5 * it under the terms of the GNU General Public License version 3 as
@@ -18,7 +18,7 @@
18 * Charles Lindsay <chaz@yorba.org>18 * Charles Lindsay <chaz@yorba.org>
19 */19 */
2020
21import QtQuick 2.021import QtQuick 2.4
2222
23/*!23/*!
24*/24*/
2525
=== modified file 'rc/qml/AlbumViewer/AlbumInternals/FramePortrait.qml'
--- rc/qml/AlbumViewer/AlbumInternals/FramePortrait.qml 2015-03-27 23:12:41 +0000
+++ rc/qml/AlbumViewer/AlbumInternals/FramePortrait.qml 2015-11-05 19:26:06 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (C) 2011 Canonical Ltd2 * Copyright (C) 2011-2015 Canonical Ltd
3 *3 *
4 * This program is free software: you can redistribute it and/or modify4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as5 * it under the terms of the GNU General Public License version 3 as
@@ -17,7 +17,7 @@
17 * Jim Nelson <jim@yorba.org>17 * Jim Nelson <jim@yorba.org>
18 */18 */
1919
20import QtQuick 2.020import QtQuick 2.4
21import Gallery 1.021import Gallery 1.0
22import "../../../js/Gallery.js" as Gallery22import "../../../js/Gallery.js" as Gallery
2323
2424
=== modified file 'rc/qml/AlbumViewer/AlbumOpener.qml'
--- rc/qml/AlbumViewer/AlbumOpener.qml 2013-06-20 11:54:49 +0000
+++ rc/qml/AlbumViewer/AlbumOpener.qml 2015-11-05 19:26:06 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (C) 2012 Canonical Ltd2 * Copyright (C) 2012-2015 Canonical Ltd
3 *3 *
4 * This program is free software: you can redistribute it and/or modify4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as5 * it under the terms of the GNU General Public License version 3 as
@@ -17,7 +17,7 @@
17 * Charles Lindsay <chaz@yorba.org>17 * Charles Lindsay <chaz@yorba.org>
18 */18 */
1919
20import QtQuick 2.020import QtQuick 2.4
21import Gallery 1.021import Gallery 1.0
2222
23// A component to show an album thumbnail in closed or open state, and23// A component to show an album thumbnail in closed or open state, and
2424
=== modified file 'rc/qml/AlbumViewer/AlbumPageComponent.qml'
--- rc/qml/AlbumViewer/AlbumPageComponent.qml 2013-06-20 11:54:49 +0000
+++ rc/qml/AlbumViewer/AlbumPageComponent.qml 2015-11-05 19:26:06 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (C) 2012 Canonical Ltd2 * Copyright (C) 2012-2015 Canonical Ltd
3 *3 *
4 * This program is free software: you can redistribute it and/or modify4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as5 * it under the terms of the GNU General Public License version 3 as
@@ -18,7 +18,7 @@
18 * Charles Lindsay <chaz@yorba.org>18 * Charles Lindsay <chaz@yorba.org>
19 */19 */
2020
21import QtQuick 2.021import QtQuick 2.4
22import Gallery 1.022import Gallery 1.0
23import "AlbumInternals"23import "AlbumInternals"
24import "../../js/Gallery.js" as Gallery24import "../../js/Gallery.js" as Gallery
2525
=== modified file 'rc/qml/AlbumViewer/AlbumPageIndicator.qml'
--- rc/qml/AlbumViewer/AlbumPageIndicator.qml 2013-06-20 11:54:49 +0000
+++ rc/qml/AlbumViewer/AlbumPageIndicator.qml 2015-11-05 19:26:06 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (C) 2012 Canonical Ltd2 * Copyright (C) 2012-2015 Canonical Ltd
3 *3 *
4 * This program is free software: you can redistribute it and/or modify4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as5 * it under the terms of the GNU General Public License version 3 as
@@ -18,9 +18,9 @@
18 * Eric Gregory <eric@yorba.org>18 * Eric Gregory <eric@yorba.org>
19 */19 */
2020
21import QtQuick 2.021import QtQuick 2.4
22import Gallery 1.022import Gallery 1.0
23import Ubuntu.Components 0.123import Ubuntu.Components 1.3
2424
25/*!25/*!
26*/26*/
2727
=== modified file 'rc/qml/AlbumViewer/AlbumPreviewComponent.qml'
--- rc/qml/AlbumViewer/AlbumPreviewComponent.qml 2013-06-20 11:54:49 +0000
+++ rc/qml/AlbumViewer/AlbumPreviewComponent.qml 2015-11-05 19:26:06 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (C) 2011 Canonical Ltd2 * Copyright (C) 2011-2015 Canonical Ltd
3 *3 *
4 * This program is free software: you can redistribute it and/or modify4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as5 * it under the terms of the GNU General Public License version 3 as
@@ -18,7 +18,7 @@
18 * Charles Lindsay <chaz@yorba.org>18 * Charles Lindsay <chaz@yorba.org>
19 */19 */
2020
21import QtQuick 2.021import QtQuick 2.4
2222
23/*!23/*!
24*/24*/
2525
=== modified file 'rc/qml/AlbumViewer/AlbumSpreadViewer.qml'
--- rc/qml/AlbumViewer/AlbumSpreadViewer.qml 2013-06-20 11:54:49 +0000
+++ rc/qml/AlbumViewer/AlbumSpreadViewer.qml 2015-11-05 19:26:06 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (C) 2012 Canonical Ltd2 * Copyright (C) 2012-2015 Canonical Ltd
3 *3 *
4 * This program is free software: you can redistribute it and/or modify4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as5 * it under the terms of the GNU General Public License version 3 as
@@ -18,7 +18,7 @@
18 * Charles Lindsay <chaz@yorba.org>18 * Charles Lindsay <chaz@yorba.org>
19 */19 */
2020
21import QtQuick 2.021import QtQuick 2.4
22import Gallery 1.022import Gallery 1.0
23import "../../js/GalleryUtility.js" as GalleryUtility23import "../../js/GalleryUtility.js" as GalleryUtility
24import "AlbumInternals"24import "AlbumInternals"
2525
=== modified file 'rc/qml/AlbumViewer/AlbumViewer.qml'
--- rc/qml/AlbumViewer/AlbumViewer.qml 2015-02-09 13:18:07 +0000
+++ rc/qml/AlbumViewer/AlbumViewer.qml 2015-11-05 19:26:06 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (C) 2011 Canonical Ltd2 * Copyright (C) 2011-2015 Canonical Ltd
3 *3 *
4 * This program is free software: you can redistribute it and/or modify4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as5 * it under the terms of the GNU General Public License version 3 as
@@ -18,8 +18,8 @@
18 * Lucas Beeler <lucas@yorba.org>18 * Lucas Beeler <lucas@yorba.org>
19 */19 */
2020
21import QtQuick 2.021import QtQuick 2.4
22import Ubuntu.Components 1.122import Ubuntu.Components 1.3
23import Gallery 1.023import Gallery 1.0
24import "../../js/Gallery.js" as Gallery24import "../../js/Gallery.js" as Gallery
25import "../../js/GalleryUtility.js" as GalleryUtility25import "../../js/GalleryUtility.js" as GalleryUtility
@@ -106,11 +106,6 @@
106106
107 title: i18n.tr("Album")107 title: i18n.tr("Album")
108108
109 Image {
110 anchors.fill: parent
111 source: "../../img/background-paper.png"
112 }
113
114 function closeAlbum() {109 function closeAlbum() {
115 if (photoViewerLoader.item && photoViewerLoader.item.isPoppedUp) {110 if (photoViewerLoader.item && photoViewerLoader.item.isPoppedUp) {
116 photoViewerLoader.item.closePopupPhotoViewer();111 photoViewerLoader.item.closePopupPhotoViewer();
@@ -195,12 +190,17 @@
195 if (hit.objectName === "addButton")190 if (hit.objectName === "addButton")
196 showMediaSelector();191 showMediaSelector();
197 else if (!hit.mediaSource) {192 else if (!hit.mediaSource) {
198 overview.toggleHeaderVisibility();193 albumViewer.header.visible = !albumViewer.header.visible;
194 if (!APP.desktopMode)
195 setFullScreen(!albumViewer.header.visible);
199 return;196 return;
200 }197 }
201198
202 albumViewer.mediaCurrentlyInView = hit.mediaSource.path;199 albumViewer.mediaCurrentlyInView = hit.mediaSource.path;
203 photoViewerLoader.fadeOpen(hit.mediaSource);200 photoViewerLoader.fadeOpen(hit.mediaSource);
201 photoViewerLoader.item.header.visible = false;
202 if (!APP.desktopMode)
203 setFullScreen(true);
204 }204 }
205205
206 // Long press/right click.206 // Long press/right click.
@@ -311,7 +311,6 @@
311 onOpened: {311 onOpened: {
312 photoViewerLoader.item.title = albumViewer.title;312 photoViewerLoader.item.title = albumViewer.title;
313 overview.pushPage(target);313 overview.pushPage(target);
314 overview.setHeaderVisibility(false);
315 }314 }
316 onCloseRequested: {315 onCloseRequested: {
317 albumViewer.mediaCurrentlyInView = "";316 albumViewer.mediaCurrentlyInView = "";
@@ -322,6 +321,7 @@
322 }321 }
323322
324 photoViewerLoader.item.fadeClosed();323 photoViewerLoader.item.fadeClosed();
324 albumViewer.header.visible = true;
325 }325 }
326 onClosed: {326 onClosed: {
327 overview.popPage();327 overview.popPage();
@@ -362,36 +362,32 @@
362 }362 }
363 }363 }
364364
365 /// Contains the actions for the toolbar in the album view365 header: PageHeader {
366 head.actions: [366 objectName: "albumViewerHeader"
367 Action {367 title: albumViewer.title
368 objectName: "addButton"368 /// Contains the actions for the toolbar in the album view
369 text: i18n.tr("Add to album") // text in HUD369 trailingActionBar.actions: [
370 iconName: "add"370 Action {
371 onTriggered: showMediaSelector();371 objectName: "addButton"
372 },372 text: i18n.tr("Add to album") // text in HUD
373 Action {373 iconName: "add"
374 objectName: "deleteButton"374 onTriggered: showMediaSelector();
375 text: i18n.tr("Delete")375 },
376 iconName: "delete"376 Action {
377 onTriggered: {377 objectName: "deleteButton"
378 albumTrashDialog.album = album;378 text: i18n.tr("Delete")
379 albumTrashDialog.show();379 iconName: "delete"
380 onTriggered: {
381 albumTrashDialog.album = album;
382 albumTrashDialog.show();
383 }
380 }384 }
385 ]
386
387 leadingActionBar.actions: Action {
388 objectName: "backButton"
389 iconName: "back"
390 onTriggered: __close();
381 }391 }
382 ]
383
384 head.backAction: Action {
385 iconName: "back"
386 onTriggered: __close();
387 }
388
389 Rectangle {
390 id: headerBackground
391
392 width: parent.width
393 height: header.height
394
395 visible: header.visible
396 }392 }
397}393}
398394
=== modified file 'rc/qml/AlbumViewer/AlbumViewerAnimated.qml'
--- rc/qml/AlbumViewer/AlbumViewerAnimated.qml 2014-06-09 23:17:03 +0000
+++ rc/qml/AlbumViewer/AlbumViewerAnimated.qml 2015-11-05 19:26:06 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (C) 2013 Canonical Ltd2 * Copyright (C) 2013-2015 Canonical Ltd
3 *3 *
4 * This program is free software: you can redistribute it and/or modify4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as5 * it under the terms of the GNU General Public License version 3 as
@@ -14,8 +14,8 @@
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */15 */
1616
17import QtQuick 2.017import QtQuick 2.4
18import Ubuntu.Components 0.118import Ubuntu.Components 1.3
19import Gallery 1.019import Gallery 1.0
2020
21/*! @brief AlbumViewerAnimated shows an album, and performs animations when opening and closing21/*! @brief AlbumViewerAnimated shows an album, and performs animations when opening and closing
2222
=== removed file 'rc/qml/AlbumViewer/AlbumViewerTransition.qml'
--- rc/qml/AlbumViewer/AlbumViewerTransition.qml 2014-03-19 12:10:38 +0000
+++ rc/qml/AlbumViewer/AlbumViewerTransition.qml 1970-01-01 00:00:00 +0000
@@ -1,404 +0,0 @@
1/*
2 * Copyright (C) 2011 Canonical Ltd
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors:
17 * Charles Lindsay <chaz@yorba.org>
18 */
19
20import QtQuick 2.0
21import Gallery 1.0
22import "../../js/Gallery.js" as Gallery
23import "../Utility"
24
25// Some custom components and animations that we want to invoke whenever we
26// bring up the album viewer.
27Item {
28 id: albumViewerTransition
29
30 /*!
31 */
32 signal transitionToAlbumViewerCompleted()
33 /*!
34 */
35 signal transitionFromAlbumViewerCompleted()
36 /*!
37 */
38 signal dissolveCompleted(variant fadeOutTarget, variant fadeInTarget)
39
40 /*!
41 */
42 property Album album
43 /*!
44 */
45 property Rectangle backgroundGlass
46 /*!
47 */
48 property int duration: Gallery.SLOW_DURATION
49 /*!
50 */
51 property int easing: Easing.InQuint
52 /*!
53 */
54 property bool isPortrait
55
56 // Read-only
57 /*!
58 */
59 property bool animationRunning: showAlbumViewerAnimation.running ||
60 hideAlbumViewerAnimation.running || dissolveAlbumViewerTransition.running
61
62 // internal
63 /*!
64 */
65 property bool hideStayingOpen
66 /*!
67 */
68 property variant expandAlbum: albumOpenerLandscape
69 /*!
70 */
71 property bool flipOnClose: isPortrait
72
73 /*!
74 */
75 function transitionToAlbumViewer(album, thumbnailRect) {
76 albumViewerTransition.album = album;
77 expandAlbum = albumOpenerLandscape;
78
79 expandAlbum.insideLeftPage = (isPortrait
80 ? album.currentPage // Anything -- invisible.
81 : expandAlbum.defaultInsideLeftPage);
82 expandAlbum.insideRightPage = (isPortrait
83 ? album.currentPage
84 : expandAlbum.defaultInsideRightPage);
85
86 expandAlbum.x = thumbnailRect.x;
87 expandAlbum.y = thumbnailRect.y;
88 expandAlbum.width = thumbnailRect.width;
89 expandAlbum.height = thumbnailRect.height;
90
91 expandAlbum.showCover = album.closed;
92
93 showAlbumViewerAnimation.screenRect = getFullscreenRect(album.closed);
94 showAlbumViewerAnimation.start();
95 }
96
97 /*!
98 */
99 function transitionFromAlbumViewer(album, thumbnailRect, stayOpen, viewingPage) {
100 // Set up portrait mode even-numbered page close transition.
101 albumOpenerPortrait.viewingPage = viewingPage;
102 flipOnClose = isPortrait && viewingPage !== album.currentPage && stayOpen &&
103 !viewingPage == 0;
104
105 albumViewerTransition.album = album;
106 expandAlbum = flipOnClose ? albumOpenerPortrait : albumOpenerLandscape;
107
108 expandAlbum.insideLeftPage = (isPortrait
109 ? viewingPage // Anything -- invisible.
110 : expandAlbum.defaultInsideLeftPage);
111 expandAlbum.insideRightPage = (isPortrait
112 ? viewingPage
113 : expandAlbum.defaultInsideRightPage);
114
115 var rect = getFullscreenRect(!stayOpen);
116 expandAlbum.x = rect.x;
117 expandAlbum.y = rect.y;
118 expandAlbum.width = rect.width;
119 expandAlbum.height = rect.height;
120
121 hideStayingOpen = stayOpen;
122 albumOpenerLandscape.showCover = !stayOpen || viewingPage == 0;
123
124 /* The Album preview doesn't like when the album is set to page zero,
125 it actually expects its property closed to be set to true in that case.
126 But we cant set that during the animation or it will think we're
127 flipping to closed, so we set it at the end */
128 hideAlbumViewerAnimation.setAlbumClosedAtEnd = viewingPage == 0;
129 hideAlbumViewerAnimation.thumbnailRect = thumbnailRect;
130 hideAlbumViewerAnimation.start();
131 }
132
133 /*!
134 */
135 function dissolve(fadeOutTarget, fadeInTarget) {
136 dissolveAlbumViewerTransition.fadeOutTarget = fadeOutTarget || dissolveDummy;
137 dissolveAlbumViewerTransition.fadeInTarget = fadeInTarget || dissolveDummy;
138 dissolveAlbumViewerTransition.start();
139 }
140
141 // internal
142 function getFullscreenRect(portraitHalfOpen) {
143 var rect = {"x": 0, "y": 0, "width": 0, "height": 0};
144
145 // This code is kind of hacky. There's just lots of special casing that we
146 // need, and it didn't seem worth it to come up with a cleaner abstraction
147 // for what amounts to one-off animation code.
148
149 // We have to compensate for the frame, present in the animation but not in
150 // the album viewer.
151 var frameWidth = width * expandAlbum.frameToContentWidth;
152 // Normally, the spread's width is half of how it appears when open.
153 if (!isPortrait)
154 frameWidth /= 2;
155 var frameHeight = height * expandAlbum.frameToContentHeight;
156
157 // Normally, we center it. For portrait, we set it flush on one side or
158 // the other (if it'll be half-open, flush left, otherwise right; this is
159 // because of our thumbnail image having a border on only one side).
160 if (isPortrait)
161 rect.x = (portraitHalfOpen ? 0 : width - frameWidth);
162 else
163 rect.x = (width - frameWidth) / 2;
164 rect.y = (height - frameHeight) / 2; // Centered.
165 rect.width = frameWidth;
166 rect.height = frameHeight;
167
168 // Move the thing left 1/4 of the thing's width. This is to match the
169 // opener, which slides right 1/4 of the way at its "half-open" state
170 // (actually, 0.25 openFraction).
171 if (isPortrait && portraitHalfOpen)
172 rect.x -= frameWidth / 4;
173
174 return rect;
175 }
176
177 AlbumOpener {
178 id: albumOpenerLandscape
179
180 album: parent.album
181 isPreview: true
182 contentHasPreviewFrame: true
183
184 visible: false
185 load: visible
186 }
187
188 AlbumViewerTransitionPortraitPage {
189 id: albumOpenerPortrait
190
191 album: parent.album
192 isPreview: true
193 contentHasPreviewFrame: true
194
195 visible: false
196 load: visible
197 }
198
199 SequentialAnimation {
200 id: showAlbumViewerAnimation
201
202 property var screenRect: {"x": 0, "y": 0, "width": 0, "height": 0}
203
204 PropertyAction { target: expandAlbum; property: "visible"; value: true; }
205
206 ParallelAnimation {
207 ExpandAnimation {
208 target: expandAlbum
209 endX: showAlbumViewerAnimation.screenRect.x
210 endY: showAlbumViewerAnimation.screenRect.y
211 endWidth: showAlbumViewerAnimation.screenRect.width
212 endHeight: showAlbumViewerAnimation.screenRect.height
213 duration: albumViewerTransition.duration
214 easingType: albumViewerTransition.easing
215 }
216
217 NumberAnimation {
218 target: expandAlbum
219 property: "openFraction"
220 from: (album && album.closed ? 0 : 1)
221 to: isPortrait ? (album && album.closed ? 0.25 : 1) : 0.5
222 duration: albumViewerTransition.duration
223 easing.type: albumViewerTransition.easing
224 }
225
226 NumberAnimation {
227 target: expandAlbum
228 property: "topMargin"
229 from: expandAlbum.previewTopMargin
230 to: expandAlbum.pageTopMargin
231 duration: albumViewerTransition.duration
232 easing.type: albumViewerTransition.easing
233 }
234 NumberAnimation {
235 target: expandAlbum
236 property: "bottomMargin"
237 from: expandAlbum.previewBottomMargin
238 to: expandAlbum.pageBottomMargin
239 duration: albumViewerTransition.duration
240 easing.type: albumViewerTransition.easing
241 }
242 NumberAnimation {
243 target: expandAlbum
244 property: "gutterMargin"
245 from: expandAlbum.previewGutterMargin
246 to: expandAlbum.pageGutterMargin
247 duration: albumViewerTransition.duration
248 easing.type: albumViewerTransition.easing
249 }
250 NumberAnimation {
251 target: expandAlbum
252 property: "outerMargin"
253 from: expandAlbum.previewOuterMargin
254 to: expandAlbum.pageOuterMargin
255 duration: albumViewerTransition.duration
256 easing.type: albumViewerTransition.easing
257 }
258 NumberAnimation {
259 target: expandAlbum
260 property: "insideMargin"
261 from: expandAlbum.previewInsideMargin
262 to: expandAlbum.pageInsideMargin
263 duration: albumViewerTransition.duration
264 easing.type: albumViewerTransition.easing
265 }
266
267 FadeInAnimation {
268 target: backgroundGlass
269 duration: albumViewerTransition.duration
270 easingType: albumViewerTransition.easing
271 }
272 }
273
274 PropertyAction { target: expandAlbum; property: "visible"; value: false; }
275 PropertyAction { target: backgroundGlass; property: "visible"; value: false; }
276
277 onRunningChanged: {
278 if (running)
279 return;
280
281 album.closed = false;
282 if (album.currentPage == album.firstValidCurrentPage)
283 album.currentPage = album.firstContentPage;
284
285 transitionToAlbumViewerCompleted();
286 }
287 }
288
289 SequentialAnimation {
290 id: hideAlbumViewerAnimation
291
292 property variant thumbnailRect: {"x": 0, "y": 0, "width": 0, "height": 0}
293 property bool setAlbumClosedAtEnd: false
294
295 PropertyAction { target: expandAlbum; property: "visible"; value: true; }
296
297 ParallelAnimation {
298 ExpandAnimation {
299 target: expandAlbum
300 endX: hideAlbumViewerAnimation.thumbnailRect.x
301 endY: hideAlbumViewerAnimation.thumbnailRect.y
302 endWidth: hideAlbumViewerAnimation.thumbnailRect.width
303 endHeight: hideAlbumViewerAnimation.thumbnailRect.height
304 duration: albumViewerTransition.duration
305 easingType: albumViewerTransition.easing
306 }
307
308 NumberAnimation {
309 target: expandAlbum
310 property: "openFraction"
311
312 from: {
313 if (flipOnClose)
314 return 0;
315 else if (isPortrait)
316 return (hideStayingOpen ? 1 : 0.25); // same as "to" property
317 else
318 return 0.5;
319 }
320
321 to: flipOnClose ? 1 : (hideStayingOpen ? 1 : 0)
322
323 duration: albumViewerTransition.duration
324 easing.type: albumViewerTransition.easing
325 }
326
327 NumberAnimation {
328 target: expandAlbum
329 property: "topMargin"
330 from: expandAlbum.pageTopMargin
331 to: expandAlbum.previewTopMargin
332 duration: albumViewerTransition.duration
333 easing.type: albumViewerTransition.easing
334 }
335 NumberAnimation {
336 target: expandAlbum
337 property: "bottomMargin"
338 from: expandAlbum.pageBottomMargin
339 to: expandAlbum.previewBottomMargin
340 duration: albumViewerTransition.duration
341 easing.type: albumViewerTransition.easing
342 }
343 NumberAnimation {
344 target: expandAlbum
345 property: "gutterMargin"
346 from: expandAlbum.pageGutterMargin
347 to: expandAlbum.previewGutterMargin
348 duration: albumViewerTransition.duration
349 easing.type: albumViewerTransition.easing
350 }
351 NumberAnimation {
352 target: expandAlbum
353 property: "outerMargin"
354 from: expandAlbum.pageOuterMargin
355 to: expandAlbum.previewOuterMargin
356 duration: albumViewerTransition.duration
357 easing.type: albumViewerTransition.easing
358 }
359 NumberAnimation {
360 target: expandAlbum
361 property: "insideMargin"
362 from: expandAlbum.pageInsideMargin
363 to: expandAlbum.previewInsideMargin
364 duration: albumViewerTransition.duration
365 easing.type: albumViewerTransition.easing
366 }
367
368 FadeOutAnimation {
369 target: backgroundGlass
370 duration: albumViewerTransition.duration
371 easingType: albumViewerTransition.easing
372 }
373 }
374
375 PropertyAction { target: expandAlbum; property: "visible"; value: false; }
376
377 onRunningChanged: {
378 if (running)
379 return;
380
381 if (album)
382 album.closed = !hideStayingOpen || setAlbumClosedAtEnd;
383
384 transitionFromAlbumViewerCompleted();
385 }
386 }
387
388 DissolveAnimation {
389 id: dissolveAlbumViewerTransition
390
391 fadeOutTarget: dissolveDummy
392 fadeInTarget: dissolveDummy
393 easingType: albumViewerTransition.easing
394
395 onRunningChanged: {
396 if (!running)
397 dissolveCompleted(fadeOutTarget, fadeInTarget);
398 }
399 }
400
401 Item {
402 id: dissolveDummy
403 }
404}
4050
=== removed file 'rc/qml/AlbumViewer/AlbumViewerTransitionPortraitPage.qml'
--- rc/qml/AlbumViewer/AlbumViewerTransitionPortraitPage.qml 2013-06-20 11:54:49 +0000
+++ rc/qml/AlbumViewer/AlbumViewerTransitionPortraitPage.qml 1970-01-01 00:00:00 +0000
@@ -1,171 +0,0 @@
1/*
2 * Copyright (C) 2012 Canonical Ltd
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors:
17 * Eric Gregory <eric@yorba.org>
18 */
19
20import QtQuick 2.0
21import Gallery 1.0
22import "../Components"
23
24// AlbumViewerTransitionPortraitPage is just like AlbumOpener, except it only
25// shows one page at a time. This is intended for use in AlbumViewerTransition
26// as a replacement for AlbumOpener when used in portrait mode and closing
27// an even-numbered page.
28Item {
29 id: albumViewerTransitionPortraitPage
30
31 // public
32 property Album album
33 /*!
34 */
35 property bool isPreview: false
36 /*!
37 */
38 property bool contentHasPreviewFrame: false
39 /*!
40 */
41 property int viewingPage
42
43 /*!
44 */
45 property int insideLeftPage: defaultInsideLeftPage
46 /*!
47 */
48 property int insideRightPage: defaultInsideRightPage
49
50 // Here, openFraction refers to how "flipped" the page is, rather than
51 // how open the album is.
52 property real openFraction: 0
53
54 /*!
55 */
56 property real topMargin: previewTopMargin
57 /*!
58 */
59 property real bottomMargin: previewBottomMargin
60 /*!
61 */
62 property real gutterMargin: previewGutterMargin
63 /*!
64 */
65 property real outerMargin: previewOuterMargin
66 /*!
67 */
68 property real insideMargin: previewInsideMargin
69
70 // readonly
71 /*!
72 */
73 property bool isFlipping: (openFraction != 0 && openFraction != 1)
74 /*!
75 */
76 property alias frameToContentWidth: page.frameToContentWidth
77 /*!
78 */
79 property alias frameToContentHeight: page.frameToContentHeight
80
81 /*!
82 */
83 property alias load: page.load
84
85 /*!
86 */
87 property int defaultInsideLeftPage: page.leftPageForCurrent(currentOrFirstContentPage)
88 /*!
89 */
90 property int defaultInsideRightPage: page.rightPageForCurrent(currentOrFirstContentPage)
91
92 /*!
93 */
94 property alias pageTopMargin: page.pageTopMargin
95 /*!
96 */
97 property alias pageBottomMargin: page.pageBottomMargin
98 /*!
99 */
100 property alias pageGutterMargin: page.pageGutterMargin
101 /*!
102 */
103 property alias pageOuterMargin: page.pageOuterMargin
104 /*!
105 */
106 property alias pageInsideMargin: page.pageInsideMargin
107
108 /*!
109 */
110 property alias previewTopMargin: page.previewTopMargin
111 /*!
112 */
113 property alias previewBottomMargin: page.previewBottomMargin
114 /*!
115 */
116 property alias previewGutterMargin: page.previewGutterMargin
117 /*!
118 */
119 property alias previewOuterMargin: page.previewOuterMargin
120 /*!
121 */
122 property alias previewInsideMargin: page.previewInsideMargin
123
124 // internal
125 /*!
126 */
127 property int currentOrFirstContentPage: (!album
128 ? -1
129 : (album.currentPage == album.firstValidCurrentPage
130 ? album.firstContentPage
131 : album.currentPage))
132
133 onAlbumChanged: openFraction = (!album || album.closed ? 0 : 1)
134
135 Connections {
136 target: album
137 ignoreUnknownSignals: true
138 onClosedChanged: openFraction = (album.closed ? 0 : 1)
139 }
140
141 Item {
142 id: shifter
143
144 x: width * openFraction // Shift it over as it opens so the visuals stay centered.
145 y: 0
146 width: parent.width
147 height: parent.height
148
149 AlbumPageComponent {
150 id: page
151
152 anchors.fill: parent
153
154 album: albumViewerTransitionPortraitPage.album
155
156 frontPage: viewingPage
157 backPage: album !== null ? album.currentPage : viewingPage
158
159 isPreview: albumOpenerPortrait.isPreview
160 contentHasPreviewFrame: albumViewerTransitionPortraitPage.contentHasPreviewFrame
161
162 flipFraction: -openFraction
163
164 topMargin: albumViewerTransitionPortraitPage.topMargin
165 bottomMargin: albumViewerTransitionPortraitPage.bottomMargin
166 gutterMargin: albumViewerTransitionPortraitPage.gutterMargin
167 outerMargin: albumViewerTransitionPortraitPage.outerMargin
168 insideMargin: albumViewerTransitionPortraitPage.insideMargin
169 }
170 }
171}
1720
=== modified file 'rc/qml/AlbumsOverview.qml'
--- rc/qml/AlbumsOverview.qml 2015-02-09 13:18:07 +0000
+++ rc/qml/AlbumsOverview.qml 2015-11-05 19:26:06 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (C) 2013 Canonical Ltd2 * Copyright (C) 2013-2015 Canonical Ltd
3 *3 *
4 * This program is free software: you can redistribute it and/or modify4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as5 * it under the terms of the GNU General Public License version 3 as
@@ -14,8 +14,8 @@
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */15 */
1616
17import QtQuick 2.017import QtQuick 2.4
18import Ubuntu.Components 0.118import Ubuntu.Components 1.3
19import Gallery 1.019import Gallery 1.0
20import "AlbumEditor"20import "AlbumEditor"
21import "AlbumViewer"21import "AlbumViewer"
@@ -64,9 +64,6 @@
64 onActiveChanged: {64 onActiveChanged: {
65 if (active) {65 if (active) {
66 root.visible = true;66 root.visible = true;
67 // FIXME: contentY is not correct after we return of an AlbumViewer animation
68 if (contentY != 0)
69 contentY = header.height * -1;
70 }67 }
71 }68 }
7269
@@ -181,9 +178,9 @@
181 setFullScreen(true);178 setFullScreen(true);
182 overview.pushPage(albumViewer);179 overview.pushPage(albumViewer);
183 if (object.containedCount > 0)180 if (object.containedCount > 0)
184 overview.setHeaderVisibility(false);181 albumViewer.header.visible = false;
185 else182 else
186 overview.setHeaderVisibility(true);183 albumViewer.header.visible = true;
187 }184 }
188 else185 else
189 albumViewer.visible = true186 albumViewer.visible = true
@@ -208,10 +205,7 @@
208205
209 visible: false206 visible: false
210207
211 onEditClicked: {208 onEditClicked: albumEditorLoader.load(album)
212 albumEditor.album = album
213 overview.pushPage(albumEditor)
214 }
215209
216 onDeleteClicked: {210 onDeleteClicked: {
217 albumTrashDialog.album = album211 albumTrashDialog.album = album
@@ -228,34 +222,27 @@
228 }222 }
229223
230 /// Contains the actions for the toolbar in the albums tab224 /// Contains the actions for the toolbar in the albums tab
231 tools: ToolbarItems {225 head.actions: [
232 id: albumOverviewTools226 Action {
233 ToolbarButton {227 objectName: "addButton"
234 action: Action {228 text: i18n.tr("Add new album") // Text in HUD
235 objectName: "addButton"229 iconName: "add"
236 text: i18n.tr("Add new album") // Text in HUD230 onTriggered: {
237 iconName: "add"231 var album = albumCollectionModel.createOrphan();
238 onTriggered: {232 album.title = i18n.tr("New Photo Album");
239 var album = albumCollectionModel.createOrphan();233 album.subtitle = i18n.tr("Subtitle");
240 album.title = i18n.tr("New Photo Album");
241 album.subtitle = i18n.tr("Subtitle");
242234
243 albumEditor.album = album;235 albumEditorLoader.load(album)
244 overview.pushPage(albumEditor);236 }
245 }237 },
246 }238 Action {
247 text: i18n.tr("Add") // text in toolbar239 objectName: "cameraButton"
248 }240 text: i18n.tr("Camera")
249 ToolbarButton {241 visible: !APP.desktopMode
250 action: Action {242 iconName: "camera-app-symbolic"
251 objectName: "cameraButton"243 onTriggered: Qt.openUrlExternally("appid://com.ubuntu.camera/camera/current-user-version")
252 text: i18n.tr("Camera")244 }
253 visible: !APP.desktopMode245 ]
254 iconSource: Qt.resolvedUrl("../img/camera.png")
255 onTriggered: Qt.openUrlExternally("appid://com.ubuntu.camera/camera/current-user-version")
256 }
257 }
258 }
259246
260 AlbumViewer {247 AlbumViewer {
261 id: albumViewer248 id: albumViewer
@@ -268,13 +255,39 @@
268 onQuickCloseRequested: isAlbumOpened = false;255 onQuickCloseRequested: isAlbumOpened = false;
269 }256 }
270257
271 AlbumEditor {258 Loader {
272 id: albumEditor259 id: albumEditorLoader
273 objectName: "albumEditor"
274 anchors.fill: parent260 anchors.fill: parent
275 visible: false 261
276262 property var album
277 onMediaSelectorHidden: albumEditorCheckerboardHidden(newScrollPos);263
278 onCloseRequested: overview.popPage();264 onStatusChanged: {
265 if (status === Loader.Ready) {
266 albumEditorLoader.item.album = albumEditorLoader.album
267 overview.pushPage(albumEditorLoader.item)
268 }
269 }
270
271 function load(album) {
272 albumEditorLoader.album = album
273 sourceComponent = albumEditorComponent
274 }
275
276 Component {
277 id: albumEditorComponent
278 AlbumEditor {
279 id: albumEditor
280 objectName: "albumEditor"
281 anchors.fill: parent
282 visible: false
283
284 onMediaSelectorHidden: albumEditorCheckerboardHidden(newScrollPos);
285 onCloseRequested: {
286 overview.popPage()
287 albumEditorLoader.album = null
288 albumEditorLoader.sourceComponent = null
289 }
290 }
291 }
279 }292 }
280}293}
281294
=== modified file 'rc/qml/Components/AspectArea.qml'
--- rc/qml/Components/AspectArea.qml 2013-06-20 11:54:49 +0000
+++ rc/qml/Components/AspectArea.qml 2015-11-05 19:26:06 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (C) 2012 Canonical Ltd2 * Copyright (C) 2012-2015 Canonical Ltd
3 *3 *
4 * This program is free software: you can redistribute it and/or modify4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as5 * it under the terms of the GNU General Public License version 3 as
@@ -17,7 +17,7 @@
17 * Charles Lindsay <chaz@yorba.org>17 * Charles Lindsay <chaz@yorba.org>
18 */18 */
1919
20import QtQuick 2.020import QtQuick 2.4
2121
22// An item that contains an inside area the maximum size of a particular aspect22// An item that contains an inside area the maximum size of a particular aspect
23// ratio (similar to the Image.PreserveAspectFit fillMode of QtQuick's Image23// ratio (similar to the Image.PreserveAspectFit fillMode of QtQuick's Image
2424
=== modified file 'rc/qml/Components/Checkerboard.qml'
--- rc/qml/Components/Checkerboard.qml 2013-06-20 11:54:49 +0000
+++ rc/qml/Components/Checkerboard.qml 2015-11-05 19:26:06 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (C) 2011 Canonical Ltd2 * Copyright (C) 2011-2015 Canonical Ltd
3 *3 *
4 * This program is free software: you can redistribute it and/or modify4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as5 * it under the terms of the GNU General Public License version 3 as
@@ -19,8 +19,8 @@
19 * Charles Lindsay <chaz@yorba.org>19 * Charles Lindsay <chaz@yorba.org>
20 */20 */
2121
22import QtQuick 2.022import QtQuick 2.4
23import Ubuntu.Components 0.123import Ubuntu.Components 1.3
24import "../../js/Gallery.js" as Gallery24import "../../js/Gallery.js" as Gallery
25import "../../js/GalleryUtility.js" as GalleryUtility25import "../../js/GalleryUtility.js" as GalleryUtility
26import "../Utility"26import "../Utility"
@@ -197,13 +197,6 @@
197197
198 clip: true198 clip: true
199199
200 Image {
201 anchors.fill: parent
202
203 source: "../../img/background-paper.png"
204 fillMode: Image.Tile
205 }
206
207 GridView {200 GridView {
208 id: grid201 id: grid
209 objectName: "grid"202 objectName: "grid"
210203
=== modified file 'rc/qml/Components/CheckerboardDelegate.qml'
--- rc/qml/Components/CheckerboardDelegate.qml 2013-06-20 11:54:49 +0000
+++ rc/qml/Components/CheckerboardDelegate.qml 2015-11-05 19:26:06 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (C) 2012 Canonical Ltd2 * Copyright (C) 2012-2015 Canonical Ltd
3 *3 *
4 * This program is free software: you can redistribute it and/or modify4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as5 * it under the terms of the GNU General Public License version 3 as
@@ -17,7 +17,7 @@
17 * Charles Lindsay <chaz@yorba.org>17 * Charles Lindsay <chaz@yorba.org>
18 */18 */
1919
20import QtQuick 2.020import QtQuick 2.4
21import "../../js/GalleryUtility.js" as GalleryUtility21import "../../js/GalleryUtility.js" as GalleryUtility
2222
23// A child delegate for a Checkerboard. Tightly coupled to Checkerboard due to23// A child delegate for a Checkerboard. Tightly coupled to Checkerboard due to
2424
=== modified file 'rc/qml/Components/DeleteDialog.qml'
--- rc/qml/Components/DeleteDialog.qml 2014-08-13 14:28:00 +0000
+++ rc/qml/Components/DeleteDialog.qml 2015-11-05 19:26:06 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (C) 2013 Canonical Ltd2 * Copyright (C) 2013-2015 Canonical Ltd
3 *3 *
4 * This program is free software: you can redistribute it and/or modify4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as5 * it under the terms of the GNU General Public License version 3 as
@@ -14,9 +14,9 @@
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */15 */
1616
17import QtQuick 2.017import QtQuick 2.4
18import Ubuntu.Components 0.118import Ubuntu.Components 1.3
19import Ubuntu.Components.Popups 0.119import Ubuntu.Components.Popups 1.3
20import "../../js/Gallery.js" as Gallery20import "../../js/Gallery.js" as Gallery
2121
22/*!22/*!
2323
=== modified file 'rc/qml/Components/DeleteOrDeleteWithContentsDialog.qml'
--- rc/qml/Components/DeleteOrDeleteWithContentsDialog.qml 2014-04-17 00:22:15 +0000
+++ rc/qml/Components/DeleteOrDeleteWithContentsDialog.qml 2015-11-05 19:26:06 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (C) 2012 Canonical Ltd2 * Copyright (C) 2012-2015 Canonical Ltd
3 *3 *
4 * This program is free software: you can redistribute it and/or modify4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as5 * it under the terms of the GNU General Public License version 3 as
@@ -17,10 +17,10 @@
17 * Eric Gregory <eric@yorba.org>17 * Eric Gregory <eric@yorba.org>
18 */18 */
1919
20import QtQuick 2.020import QtQuick 2.4
21import Ubuntu.Components 0.121import Ubuntu.Components 1.3
22import Ubuntu.Components.Popups 0.122import Ubuntu.Components.Popups 1.3
23import Ubuntu.Components.ListItems 0.1 as ListItem23import Ubuntu.Components.ListItems 1.3 as ListItem
24import Gallery 1.024import Gallery 1.0
2525
26/*!26/*!
2727
=== modified file 'rc/qml/Components/EventCard.qml'
--- rc/qml/Components/EventCard.qml 2015-05-21 10:13:59 +0000
+++ rc/qml/Components/EventCard.qml 2015-11-05 19:26:06 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (C) 2012 Canonical Ltd2 * Copyright (C) 2012-2015 Canonical Ltd
3 *3 *
4 * This program is free software: you can redistribute it and/or modify4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as5 * it under the terms of the GNU General Public License version 3 as
@@ -20,8 +20,8 @@
20 * Lucas Beeler <lucas@yorba.org>20 * Lucas Beeler <lucas@yorba.org>
21 */21 */
2222
23import QtQuick 2.023import QtQuick 2.4
24import Ubuntu.Components 0.124import Ubuntu.Components 1.3
25import "../../js/Gallery.js" as Gallery25import "../../js/Gallery.js" as Gallery
26import "../Utility"26import "../Utility"
2727
@@ -37,7 +37,7 @@
37 */37 */
3838
39 radius: "medium"39 radius: "medium"
40 color: "#dddddd"40 backgroundColor: "#dddddd"
41 opacity: 0.841 opacity: 0.8
4242
43 width: units.gu(12)43 width: units.gu(12)
4444
=== modified file 'rc/qml/Components/MediaGrid.qml'
--- rc/qml/Components/MediaGrid.qml 2015-07-27 22:39:25 +0000
+++ rc/qml/Components/MediaGrid.qml 2015-11-05 19:26:06 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (C) 2013 Canonical Ltd2 * Copyright (C) 2013-2015 Canonical Ltd
3 *3 *
4 * This program is free software: you can redistribute it and/or modify4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as5 * it under the terms of the GNU General Public License version 3 as
@@ -14,8 +14,9 @@
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */15 */
1616
17import QtQuick 2.017import QtQuick 2.4
18import Ubuntu.Components 0.118import Ubuntu.Components 1.3
19import Ubuntu.Thumbnailer 0.1
19import Gallery 1.020import Gallery 1.0
20import "../OrganicView"21import "../OrganicView"
21import "../Utility"22import "../Utility"
@@ -79,9 +80,10 @@
79 height: photosGrid.thumbnailSize80 height: photosGrid.thumbnailSize
8081
81 radius: "medium"82 radius: "medium"
82 property bool isLoading: image.status === Image.Loading83 property bool isLoading: source.status === Image.Loading
8384
84 image: Image {85 sourceFillMode: UbuntuShape.PreserveAspectCrop
86 source: Image {
85 id: thumbImage87 id: thumbImage
86 source: "image://thumbnailer/" + mediaSource.path + "?at=" + Date.now()88 source: "image://thumbnailer/" + mediaSource.path + "?at=" + Date.now()
87 asynchronous: true89 asynchronous: true
8890
=== modified file 'rc/qml/Components/MediaSelector.qml'
--- rc/qml/Components/MediaSelector.qml 2014-08-27 02:20:58 +0000
+++ rc/qml/Components/MediaSelector.qml 2015-11-05 19:26:06 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (C) 2013 Canonical Ltd2 * Copyright (C) 2013-2015 Canonical Ltd
3 *3 *
4 * This program is free software: you can redistribute it and/or modify4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as5 * it under the terms of the GNU General Public License version 3 as
@@ -14,9 +14,9 @@
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */15 */
1616
17import QtQuick 2.017import QtQuick 2.4
18import Gallery 1.018import Gallery 1.0
19import Ubuntu.Components 1.119import Ubuntu.Components 1.3
20import "../../js/Gallery.js" as Gallery20import "../../js/Gallery.js" as Gallery
21import "../OrganicView"21import "../OrganicView"
22import "../Utility"22import "../Utility"
2323
=== modified file 'rc/qml/Components/MouseAreaWithMultipoint.qml'
--- rc/qml/Components/MouseAreaWithMultipoint.qml 2014-04-04 21:34:42 +0000
+++ rc/qml/Components/MouseAreaWithMultipoint.qml 2015-11-05 19:26:06 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (C) 2014 Canonical Ltd2 * Copyright (C) 2014-2015 Canonical Ltd
3 *3 *
4 * This program is free software: you can redistribute it and/or modify4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as5 * it under the terms of the GNU General Public License version 3 as
@@ -14,7 +14,7 @@
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */15 */
1616
17import QtQuick 2.017import QtQuick 2.4
18Item {18Item {
19 id: mouseAreaWithMultipoint19 id: mouseAreaWithMultipoint
2020
2121
=== modified file 'rc/qml/Components/PopupAlbumPicker.qml'
--- rc/qml/Components/PopupAlbumPicker.qml 2014-09-02 09:28:39 +0000
+++ rc/qml/Components/PopupAlbumPicker.qml 2015-11-05 19:26:06 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (C) 2011 Canonical Ltd2 * Copyright (C) 2011-2015 Canonical Ltd
3 *3 *
4 * This program is free software: you can redistribute it and/or modify4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as5 * it under the terms of the GNU General Public License version 3 as
@@ -18,10 +18,10 @@
18 * Charles Lindsay <chaz@yorba.org>18 * Charles Lindsay <chaz@yorba.org>
19 */19 */
2020
21import QtQuick 2.021import QtQuick 2.4
22import Gallery 1.022import Gallery 1.0
23import Ubuntu.Components 0.123import Ubuntu.Components 1.3
24import Ubuntu.Components.Popups 0.124import Ubuntu.Components.Popups 1.3
25import "../AlbumViewer"25import "../AlbumViewer"
26import "../../js/Gallery.js" as Gallery26import "../../js/Gallery.js" as Gallery
2727
2828
=== modified file 'rc/qml/Components/SwipeArea.qml'
--- rc/qml/Components/SwipeArea.qml 2013-06-20 11:54:49 +0000
+++ rc/qml/Components/SwipeArea.qml 2015-11-05 19:26:06 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (C) 2012 Canonical Ltd2 * Copyright (C) 2012-2015 Canonical Ltd
3 *3 *
4 * This program is free software: you can redistribute it and/or modify4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as5 * it under the terms of the GNU General Public License version 3 as
@@ -18,8 +18,8 @@
18 * Charles Lindsay <chaz@yorba.org>18 * Charles Lindsay <chaz@yorba.org>
19 */19 */
2020
21import QtQuick 2.021import QtQuick 2.4
22import Ubuntu.Components 0.122import Ubuntu.Components 1.3
2323
24// Because some QML components' natural swiping motion requires custom24// Because some QML components' natural swiping motion requires custom
25// event handling, this emulates it and allows for programmatic control25// event handling, this emulates it and allows for programmatic control
2626
=== modified file 'rc/qml/Components/TextEditOnClick.qml'
--- rc/qml/Components/TextEditOnClick.qml 2014-10-08 15:16:02 +0000
+++ rc/qml/Components/TextEditOnClick.qml 2015-11-05 19:26:06 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (C) 2012 Canonical Ltd2 * Copyright (C) 2012-2015 Canonical Ltd
3 *3 *
4 * This program is free software: you can redistribute it and/or modify4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as5 * it under the terms of the GNU General Public License version 3 as
@@ -17,7 +17,7 @@
17 * Eric Gregory <eric@yorba.org>17 * Eric Gregory <eric@yorba.org>
18 */18 */
1919
20import QtQuick 2.020import QtQuick 2.4
2121
22// Editable text area that becomes editable when clicked. Editing ends when22// Editable text area that becomes editable when clicked. Editing ends when
23// enter is pressed or when done() is called. The isEditing property indicates23// enter is pressed or when done() is called. The isEditing property indicates
2424
=== modified file 'rc/qml/EventsOverview.qml'
--- rc/qml/EventsOverview.qml 2014-11-07 12:51:32 +0000
+++ rc/qml/EventsOverview.qml 2015-11-05 19:26:06 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (C) 2012 Canonical Ltd2 * Copyright (C) 2012-2015 Canonical Ltd
3 *3 *
4 * This program is free software: you can redistribute it and/or modify4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as5 * it under the terms of the GNU General Public License version 3 as
@@ -14,11 +14,11 @@
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */15 */
1616
17import QtQuick 2.017import QtQuick 2.4
18import Ubuntu.Components 0.118import Ubuntu.Components 1.3
19import Ubuntu.Components.Popups 0.119import Ubuntu.Components.Popups 1.3
20import Gallery 1.020import Gallery 1.0
21import Ubuntu.Content 0.121import Ubuntu.Content 1.3
22import "Components"22import "Components"
23import "OrganicView"23import "OrganicView"
24import "Utility"24import "Utility"
@@ -102,9 +102,61 @@
102 }102 }
103 }103 }
104104
105 property Item overviewTools: PhotosToolbarActions {105 property list<Action> overviewActions: [
106 selection: organicEventView.selection106 Action {
107 }107 objectName: "selectButton"
108 text: i18n.tr("Select")
109 iconName: "select"
110 enabled: selection !== null
111 onTriggered: selection.inSelectionMode = true;
112 },
113 Action {
114 objectName: "cameraButton"
115 text: i18n.tr("Camera")
116 visible: !APP.desktopMode
117 iconName: "camera-app-symbolic"
118 onTriggered: Qt.openUrlExternally("appid://com.ubuntu.camera/camera/current-user-version")
119 }
120 ]
121
122 property list<Action> selectActions: [
123 Action {
124 id: addButton
125 objectName: "addButton"
126
127 text: i18n.tr("Add")
128 iconName: "add"
129 enabled: selection.selectedCount > 0
130 onTriggered: __albumPicker = PopupUtils.open(Qt.resolvedUrl("Components/PopupAlbumPicker.qml"),
131 null,
132 {contentHeight: organicEventView.__pickerContentHeight});
133
134 },
135 Action {
136 objectName: "deleteButton"
137
138 text: i18n.tr("Delete")
139 iconName: "delete"
140 enabled: selection.selectedCount > 0
141 onTriggered: PopupUtils.open(deleteDialog, null);
142 },
143 Action {
144 objectName: "shareButton"
145 text: i18n.tr("Share")
146 iconName: "share"
147 enabled: selection.selectedMediaCount == 1
148 onTriggered: {
149 overview.pushPage(sharePicker)
150 sharePicker.visible = true;
151 }
152 }
153 ]
154
155 property Action selectBackAction: Action {
156 text: i18n.tr("Cancel")
157 iconName: "back"
158 onTriggered: organicEventView.leaveSelectionMode();
159 }
108160
109 property int __pickerContentHeight: height - units.gu(20)161 property int __pickerContentHeight: height - units.gu(20)
110 property PopupAlbumPicker __albumPicker162 property PopupAlbumPicker __albumPicker
@@ -116,29 +168,10 @@
116 }168 }
117 }169 }
118170
119 property Item selectionTools: SelectionToolbarAction {
120 selection: organicEventView.selection
121
122 onCancelClicked: {
123 organicEventView.leaveSelectionMode();
124 }
125 onAddClicked: {
126 __albumPicker = PopupUtils.open(Qt.resolvedUrl("Components/PopupAlbumPicker.qml"),
127 null,
128 {contentHeight: organicEventView.__pickerContentHeight});
129 }
130 onDeleteClicked: {
131 PopupUtils.open(deleteDialog, null);
132 }
133
134 onShareClicked: {
135 overview.pushPage(sharePicker);
136 sharePicker.visible = true;
137 }
138 }
139
140 property bool selectionMode: selection.inSelectionMode171 property bool selectionMode: selection.inSelectionMode
141 tools: selectionMode ? selectionTools : overviewTools172
173 head.actions: selectionMode ? selectActions : overviewActions
174 head.backAction: selectionMode ? selectBackAction : null
142175
143 Component {176 Component {
144 id: contentItemComp177 id: contentItemComp
145178
=== modified file 'rc/qml/GalleryApplication.qml'
--- rc/qml/GalleryApplication.qml 2015-02-02 18:54:14 +0000
+++ rc/qml/GalleryApplication.qml 2015-11-05 19:26:06 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (C) 2011 Canonical Ltd2 * Copyright (C) 2011-2015 Canonical Ltd
3 *3 *
4 * This program is free software: you can redistribute it and/or modify4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as5 * it under the terms of the GNU General Public License version 3 as
@@ -19,10 +19,10 @@
19 * Charles Lindsay <chaz@yorba.org19 * Charles Lindsay <chaz@yorba.org
20 */20 */
2121
22import QtQuick 2.022import QtQuick 2.4
23import QtQuick.Window 2.023import QtQuick.Window 2.2
24import "../js/Gallery.js" as Gallery24import "../js/Gallery.js" as Gallery
25import Ubuntu.Components 0.1 // Necessary to make filename@GU.ext images load25import Ubuntu.Components 1.3 // Necessary to make filename@GU.ext images load
2626
27Item {27Item {
28 id: application28 id: application
2929
=== modified file 'rc/qml/LoadingScreen.qml'
--- rc/qml/LoadingScreen.qml 2014-09-12 13:41:48 +0000
+++ rc/qml/LoadingScreen.qml 2015-11-05 19:26:06 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (C) 2012 Canonical Ltd2 * Copyright (C) 2012-2015 Canonical Ltd
3 *3 *
4 * This program is free software: you can redistribute it and/or modify4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as5 * it under the terms of the GNU General Public License version 3 as
@@ -17,19 +17,12 @@
17 * Charles Lindsay <chaz@yorba.org17 * Charles Lindsay <chaz@yorba.org
18 */18 */
1919
20import QtQuick 2.020import QtQuick 2.4
21import Ubuntu.Components 0.121import Ubuntu.Components 1.3
22
2322
24Page {23Page {
25 id: loadingScreen24 id: loadingScreen
2625
27 Image {
28 anchors.fill: parent
29 source: "../img/background-paper.png"
30 fillMode: Image.Tile
31 }
32
33 Column {26 Column {
34 anchors.centerIn: parent27 anchors.centerIn: parent
35 width: parent.width28 width: parent.width
3629
=== modified file 'rc/qml/MainScreen.qml'
--- rc/qml/MainScreen.qml 2015-08-05 22:55:43 +0000
+++ rc/qml/MainScreen.qml 2015-11-05 19:26:06 +0000
@@ -17,8 +17,8 @@
17 * Charles Lindsay <chaz@yorba.org17 * Charles Lindsay <chaz@yorba.org
18 */18 */
1919
20import QtQuick 2.020import QtQuick 2.4
21import Ubuntu.Components 0.121import Ubuntu.Components 1.3
22import Ubuntu.Unity.Action 1.0 as UnityActions22import Ubuntu.Unity.Action 1.0 as UnityActions
23import Gallery 1.023import Gallery 1.0
24import "../js/GalleryUtility.js" as GalleryUtility24import "../js/GalleryUtility.js" as GalleryUtility
@@ -29,8 +29,6 @@
29 id: overview29 id: overview
30 objectName: "overview"30 objectName: "overview"
3131
32 useDeprecatedToolbar: false
33
34 anchors.fill: parent32 anchors.fill: parent
35 applicationName: "com.ubuntu.gallery"33 applicationName: "com.ubuntu.gallery"
36 automaticOrientation: application.automaticOrientation34 automaticOrientation: application.automaticOrientation
@@ -73,19 +71,6 @@
73 }71 }
74 }72 }
7573
76 function setHeaderVisibility(visible, toggleFullscreen)
77 {
78 toggleFullscreen = typeof toggleFullscreen !== 'undefined' ? toggleFullscreen : true
79 header.visible = visible;
80 if (!APP.desktopMode && toggleFullscreen)
81 setFullScreenTimer.start();
82 }
83
84 function toggleHeaderVisibility()
85 {
86 setHeaderVisibility(!header.visible);
87 }
88
89 Component.onCompleted: {74 Component.onCompleted: {
90 pageStack.push(tabs);75 pageStack.push(tabs);
91 }76 }
@@ -113,7 +98,7 @@
113 eventsOverviewLoader.item.positionViewAtBeginning();98 eventsOverviewLoader.item.positionViewAtBeginning();
114 }99 }
115100
116 setHeaderVisibility(true);101 header.visible = true;
117102
118 tabs.selectedTabIndex = 1;103 tabs.selectedTabIndex = 1;
119 }104 }
@@ -177,7 +162,18 @@
177 id: eventsOverview162 id: eventsOverview
178 anchors.fill: parent163 anchors.fill: parent
179164
165 Connections {
166 target: photoViewerLoader.item
167 onCloseRequested: {
168 eventsOverview.head.visible = true;
169 eventsOverview.head.locked = false;
170 }
171 }
172
180 onMediaSourcePressed: {173 onMediaSourcePressed: {
174 eventsOverview.head.visible = false;
175 eventsOverview.head.locked = true;
176
181 photoViewerLoader.load();177 photoViewerLoader.load();
182 overview.mediaCurrentlyInView = mediaSource.path;178 overview.mediaCurrentlyInView = mediaSource.path;
183179
@@ -220,9 +216,16 @@
220 Connections {216 Connections {
221 target: photoViewerLoader.item217 target: photoViewerLoader.item
222 onSelected: positionViewAtSelected(index);218 onSelected: positionViewAtSelected(index);
219 onCloseRequested: {
220 photosOverview.head.visible = true;
221 photosOverview.head.locked = false;
222 }
223 } 223 }
224224
225 onMediaSourcePressed: {225 onMediaSourcePressed: {
226 photosOverview.head.visible = false;
227 photosOverview.head.locked = true;
228
226 photoViewerLoader.load();229 photoViewerLoader.load();
227 overview.mediaCurrentlyInView = mediaSource.path;230 overview.mediaCurrentlyInView = mediaSource.path;
228231
229232
=== modified file 'rc/qml/MediaViewer/ExtrasPhotoEditorPage.qml'
--- rc/qml/MediaViewer/ExtrasPhotoEditorPage.qml 2015-02-27 15:28:54 +0000
+++ rc/qml/MediaViewer/ExtrasPhotoEditorPage.qml 2015-11-05 19:26:06 +0000
@@ -1,9 +1,5 @@
1import QtQuick 2.0
2import Ubuntu.Components 1.1
3import Ubuntu.Components.Extras 0.2 as Extras
4
5/*1/*
6 * Copyright (C) 2014 Canonical Ltd2 * Copyright (C) 2014-2015 Canonical Ltd
7 *3 *
8 * This program is free software: you can redistribute it and/or modify4 * This program is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 3 as5 * it under the terms of the GNU General Public License version 3 as
@@ -18,6 +14,10 @@
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 */15 */
2016
17import QtQuick 2.4
18import Ubuntu.Components 1.3
19import Ubuntu.Components.Extras 0.2 as Extras
20
21Page {21Page {
22 id: page22 id: page
23 property string photo23 property string photo
2424
=== modified file 'rc/qml/MediaViewer/GalleryPhotoComponent.qml'
--- rc/qml/MediaViewer/GalleryPhotoComponent.qml 2015-07-03 22:54:32 +0000
+++ rc/qml/MediaViewer/GalleryPhotoComponent.qml 2015-11-05 19:26:06 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (C) 2011-2012 Canonical Ltd2 * Copyright (C) 2011-2015 Canonical Ltd
3 *3 *
4 * This program is free software: you can redistribute it and/or modify4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as5 * it under the terms of the GNU General Public License version 3 as
@@ -19,7 +19,7 @@
19 * Eric Gregory <eric@yorba.org>19 * Eric Gregory <eric@yorba.org>
20 */20 */
2121
22import QtQuick 2.022import QtQuick 2.4
2323
24// Basic photo component. Can be used on its own, or as a delegate24// Basic photo component. Can be used on its own, or as a delegate
25// for PhotoViewer.25// for PhotoViewer.
2626
=== modified file 'rc/qml/MediaViewer/GalleryPhotoEditorPage.qml'
--- rc/qml/MediaViewer/GalleryPhotoEditorPage.qml 2015-02-27 20:13:30 +0000
+++ rc/qml/MediaViewer/GalleryPhotoEditorPage.qml 2015-11-05 19:26:06 +0000
@@ -1,8 +1,5 @@
1import QtQuick 2.0
2import Ubuntu.Components 1.1
3
4/*1/*
5 * Copyright (C) 2014 Canonical Ltd2 * Copyright (C) 2014-2015 Canonical Ltd
6 *3 *
7 * This program is free software: you can redistribute it and/or modify4 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 3 as5 * it under the terms of the GNU General Public License version 3 as
@@ -17,6 +14,9 @@
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */15 */
1916
17import QtQuick 2.4
18import Ubuntu.Components 1.3
19
20Page {20Page {
21 id: page21 id: page
22 property string photo22 property string photo
2323
=== modified file 'rc/qml/MediaViewer/MediaListView.qml'
--- rc/qml/MediaViewer/MediaListView.qml 2014-04-08 00:27:12 +0000
+++ rc/qml/MediaViewer/MediaListView.qml 2015-11-05 19:26:06 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (C) 2011-2012 Canonical Ltd2 * Copyright (C) 2011-2015 Canonical Ltd
3 *3 *
4 * This program is free software: you can redistribute it and/or modify4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as5 * it under the terms of the GNU General Public License version 3 as
@@ -19,8 +19,8 @@
19 * Eric Gregory <eric@yorba.org>19 * Eric Gregory <eric@yorba.org>
20 */20 */
2121
22import QtQuick 2.022import QtQuick 2.4
23import Ubuntu.Components 0.123import Ubuntu.Components 1.3
24import "../Components"24import "../Components"
2525
26// Displays a flickable photo stream.26// Displays a flickable photo stream.
2727
=== modified file 'rc/qml/MediaViewer/MediaViewer.qml'
--- rc/qml/MediaViewer/MediaViewer.qml 2015-03-18 00:14:57 +0000
+++ rc/qml/MediaViewer/MediaViewer.qml 2015-11-05 19:26:06 +0000
@@ -18,12 +18,12 @@
18 * Lucas Beeler <lucas@yorba.org>18 * Lucas Beeler <lucas@yorba.org>
19 */19 */
2020
21import QtQuick 2.021import QtQuick 2.4
22import Gallery 1.022import Gallery 1.0
23import Ubuntu.Components 1.123import Ubuntu.Components 1.3
24import Ubuntu.Components.Popups 0.124import Ubuntu.Components.Popups 1.3
25import Ubuntu.Components.ListItems 0.1 as ListItem25import Ubuntu.Components.ListItems 1.3 as ListItem
26import Ubuntu.Content 0.126import Ubuntu.Content 1.3
27import "../Components"27import "../Components"
28import "../Utility"28import "../Utility"
29import "../../js/Gallery.js" as Gallery29import "../../js/Gallery.js" as Gallery
@@ -74,6 +74,9 @@
74 */74 */
75 signal editRequested(variant photo)75 signal editRequested(variant photo)
7676
77 signal setHeaderVisibilityRequested(bool visibility)
78 signal toggleHeaderVisibilityRequested()
79
77 /*!80 /*!
78 */81 */
79 function setCurrentIndex(index) {82 function setCurrentIndex(index) {
@@ -163,7 +166,7 @@
163 return 1.0 - Math.abs((galleryPhotoViewer.contentX - x) / width);166 return 1.0 - Math.abs((galleryPhotoViewer.contentX - x) / width);
164 }167 }
165168
166 onClicked: overview.toggleHeaderVisibility()169 onClicked: viewerWrapper.toggleHeaderVisibilityRequested()
167 }170 }
168171
169 // Don't allow flicking while the chrome is actively displaying a popup172 // Don't allow flicking while the chrome is actively displaying a popup
@@ -177,22 +180,23 @@
177 ContentItem {}180 ContentItem {}
178 }181 }
179182
180 Rectangle {183 Page {
181 id: sharePicker184 id: sharePicker
182 anchors.fill: parent
183 visible: false185 visible: false
186 title: i18n.tr("Share to")
184187
185 onVisibleChanged: overview.setHeaderVisibility(!visible, false)188 onVisibleChanged: viewerWrapper.setHeaderVisibilityRequested(!visible)
186189
187 ContentPeerPicker {190 ContentPeerPicker {
188 objectName: "sharePicker"191 objectName: "sharePicker"
192 showTitle: false
189 anchors.fill: parent193 anchors.fill: parent
190 visible: parent.visible
191 contentType: galleryPhotoViewer.media.type === MediaSource.Video ? ContentType.Videos : ContentType.Pictures194 contentType: galleryPhotoViewer.media.type === MediaSource.Video ? ContentType.Videos : ContentType.Pictures
192 handler: ContentHandler.Share195 handler: ContentHandler.Share
193196
194 onPeerSelected: {197 onPeerSelected: {
195 parent.visible = false;198 overview.popPage();
199 sharePicker.visible = false;
196 var curTransfer = peer.request();200 var curTransfer = peer.request();
197 if (curTransfer.state === ContentTransfer.InProgress)201 if (curTransfer.state === ContentTransfer.InProgress)
198 {202 {
@@ -200,7 +204,10 @@
200 curTransfer.state = ContentTransfer.Charged;204 curTransfer.state = ContentTransfer.Charged;
201 }205 }
202 }206 }
203 onCancelPressed: parent.visible = false;207 onCancelPressed: {
208 overview.popPage();
209 sharePicker.visible = false;
210 }
204 }211 }
205 }212 }
206213
@@ -317,7 +324,7 @@
317 path = path.replace("file://", "")324 path = path.replace("file://", "")
318 var editor;325 var editor;
319 try {326 try {
320 Qt.createQmlObject('import QtQuick 2.0; import Ubuntu.Components.Extras 0.2; Item {}', viewerWrapper);327 Qt.createQmlObject('import QtQuick 2.4; import Ubuntu.Components.Extras 0.2; Item {}', viewerWrapper);
321 console.log("Loading PhotoEditor Components from Extras");328 console.log("Loading PhotoEditor Components from Extras");
322 editor = overview.pushPage(Qt.resolvedUrl("ExtrasPhotoEditorPage.qml"), { photo: path });329 editor = overview.pushPage(Qt.resolvedUrl("ExtrasPhotoEditorPage.qml"), { photo: path });
323 } catch (e) {330 } catch (e) {
@@ -356,11 +363,15 @@
356 text: i18n.tr("Share")363 text: i18n.tr("Share")
357 iconName: "share"364 iconName: "share"
358 visible: !APP.desktopMode365 visible: !APP.desktopMode
359 onTriggered: sharePicker.visible = true;366 onTriggered: {
367 overview.pushPage(sharePicker)
368 sharePicker.visible = true;
369 }
360 }370 }
361 ]371 ]
362 372
363 property Action backAction: Action {373 property Action backAction: Action {
374 objectName: "backButton"
364 iconName: "back"375 iconName: "back"
365 onTriggered: {376 onTriggered: {
366 galleryPhotoViewer.currentItem.reset();377 galleryPhotoViewer.currentItem.reset();
367378
=== modified file 'rc/qml/MediaViewer/PhotoEditor.qml'
--- rc/qml/MediaViewer/PhotoEditor.qml 2015-03-02 14:55:22 +0000
+++ rc/qml/MediaViewer/PhotoEditor.qml 2015-11-05 19:26:06 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (C) 2014 Canonical Ltd2 * Copyright (C) 2014-2015 Canonical Ltd
3 *3 *
4 * This program is free software: you can redistribute it and/or modify4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as5 * it under the terms of the GNU General Public License version 3 as
@@ -14,9 +14,9 @@
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */15 */
1616
17import QtQuick 2.317import QtQuick 2.4
18import Ubuntu.Components 1.118import Ubuntu.Components 1.3
19import Ubuntu.Components.Popups 1.019import Ubuntu.Components.Popups 1.3
20import Gallery 1.020import Gallery 1.0
21import "PhotoEditor"21import "PhotoEditor"
2222
2323
=== modified file 'rc/qml/MediaViewer/PhotoEditor/ActionsBar.qml'
--- rc/qml/MediaViewer/PhotoEditor/ActionsBar.qml 2015-02-26 21:00:19 +0000
+++ rc/qml/MediaViewer/PhotoEditor/ActionsBar.qml 2015-11-05 19:26:06 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (C) 2014 Canonical Ltd2 * Copyright (C) 2014-2015 Canonical Ltd
3 *3 *
4 * This program is free software: you can redistribute it and/or modify4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as5 * it under the terms of the GNU General Public License version 3 as
@@ -14,9 +14,9 @@
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */15 */
1616
17import QtQuick 2.317import QtQuick 2.4
18import Ubuntu.Components 1.118import Ubuntu.Components 1.3
19import Ubuntu.Components.ListItems 1.0 as ListItem19import Ubuntu.Components.ListItems 1.3 as ListItem
2020
21Column {21Column {
22 id: bar22 id: bar
2323
=== modified file 'rc/qml/MediaViewer/PhotoEditor/BusyIndicator.qml'
--- rc/qml/MediaViewer/PhotoEditor/BusyIndicator.qml 2015-02-26 21:00:19 +0000
+++ rc/qml/MediaViewer/PhotoEditor/BusyIndicator.qml 2015-11-05 19:26:06 +0000
@@ -14,8 +14,8 @@
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */15 */
1616
17import QtQuick 2.017import QtQuick 2.4
18import Ubuntu.Components 0.118import Ubuntu.Components 1.3
1919
20Item {20Item {
21 id: busy21 id: busy
2222
=== modified file 'rc/qml/MediaViewer/PhotoEditor/CropCorner.qml'
--- rc/qml/MediaViewer/PhotoEditor/CropCorner.qml 2015-02-26 21:00:19 +0000
+++ rc/qml/MediaViewer/PhotoEditor/CropCorner.qml 2015-11-05 19:26:06 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (C) 2012 Canonical Ltd2 * Copyright (C) 2012-2015 Canonical Ltd
3 *3 *
4 * This program is free software: you can redistribute it and/or modify4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as5 * it under the terms of the GNU General Public License version 3 as
@@ -17,8 +17,8 @@
17 * Charles Lindsay <chaz@yorba.org>17 * Charles Lindsay <chaz@yorba.org>
18 */18 */
1919
20import QtQuick 2.320import QtQuick 2.4
21import Ubuntu.Components 1.121import Ubuntu.Components 1.3
2222
23// A corner of a CropFrame.23// A corner of a CropFrame.
24Item {24Item {
2525
=== modified file 'rc/qml/MediaViewer/PhotoEditor/CropDragArea.qml'
--- rc/qml/MediaViewer/PhotoEditor/CropDragArea.qml 2015-02-26 21:00:19 +0000
+++ rc/qml/MediaViewer/PhotoEditor/CropDragArea.qml 2015-11-05 19:26:06 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (C) 2012 Canonical Ltd2 * Copyright (C) 2012-2015 Canonical Ltd
3 *3 *
4 * This program is free software: you can redistribute it and/or modify4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as5 * it under the terms of the GNU General Public License version 3 as
@@ -17,7 +17,7 @@
17 * Charles Lindsay <chaz@yorba.org>17 * Charles Lindsay <chaz@yorba.org>
18 */18 */
1919
20import QtQuick 2.320import QtQuick 2.4
2121
22// A MouseArea meant to drag a corner/edge of a crop area.22// A MouseArea meant to drag a corner/edge of a crop area.
23MouseArea {23MouseArea {
2424
=== modified file 'rc/qml/MediaViewer/PhotoEditor/CropInteractor.qml'
--- rc/qml/MediaViewer/PhotoEditor/CropInteractor.qml 2015-02-26 21:00:19 +0000
+++ rc/qml/MediaViewer/PhotoEditor/CropInteractor.qml 2015-11-05 19:26:06 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (C) 2012 Canonical Ltd2 * Copyright (C) 2012-2015 Canonical Ltd
3 *3 *
4 * This program is free software: you can redistribute it and/or modify4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as5 * it under the terms of the GNU General Public License version 3 as
@@ -18,8 +18,8 @@
18 * Lucas Beeler <lucas@yorba.org>18 * Lucas Beeler <lucas@yorba.org>
19 */19 */
2020
21import QtQuick 2.321import QtQuick 2.4
22import Ubuntu.Components 1.122import Ubuntu.Components 1.3
23import "GraphicsRoutines.js" as GraphicsRoutines23import "GraphicsRoutines.js" as GraphicsRoutines
2424
25/*!25/*!
2626
=== modified file 'rc/qml/MediaViewer/PhotoEditor/CropOverlay.qml'
--- rc/qml/MediaViewer/PhotoEditor/CropOverlay.qml 2015-02-26 21:00:19 +0000
+++ rc/qml/MediaViewer/PhotoEditor/CropOverlay.qml 2015-11-05 19:26:06 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (C) 2012 Canonical Ltd2 * Copyright (C) 2012-2015 Canonical Ltd
3 *3 *
4 * This program is free software: you can redistribute it and/or modify4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as5 * it under the terms of the GNU General Public License version 3 as
@@ -18,8 +18,8 @@
18 * Lucas Beeler <lucas@yorba.org>18 * Lucas Beeler <lucas@yorba.org>
19 */19 */
2020
21import QtQuick 2.321import QtQuick 2.4
22import Ubuntu.Components 1.122import Ubuntu.Components 1.3
23import "GraphicsRoutines.js" as GraphicsRoutines23import "GraphicsRoutines.js" as GraphicsRoutines
2424
25/* A CropOverlay is a semi-transparent surface that floats over the photo. It25/* A CropOverlay is a semi-transparent surface that floats over the photo. It
2626
=== modified file 'rc/qml/MediaViewer/PhotoEditor/EditStack.qml'
--- rc/qml/MediaViewer/PhotoEditor/EditStack.qml 2015-02-26 21:00:19 +0000
+++ rc/qml/MediaViewer/PhotoEditor/EditStack.qml 2015-11-05 19:26:06 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (C) 2014 Canonical Ltd2 * Copyright (C) 2014-2015 Canonical Ltd
3 *3 *
4 * This program is free software: you can redistribute it and/or modify4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as5 * it under the terms of the GNU General Public License version 3 as
@@ -14,8 +14,8 @@
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */15 */
1616
17import QtQuick 2.317import QtQuick 2.4
18import Ubuntu.Components 1.118import Ubuntu.Components 1.3
19import Gallery 1.019import Gallery 1.0
2020
21Item {21Item {
2222
=== modified file 'rc/qml/MediaViewer/PhotoEditor/ExposureAdjuster.qml'
--- rc/qml/MediaViewer/PhotoEditor/ExposureAdjuster.qml 2015-02-26 21:00:19 +0000
+++ rc/qml/MediaViewer/PhotoEditor/ExposureAdjuster.qml 2015-11-05 19:26:06 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (C) 2014 Canonical Ltd2 * Copyright (C) 2014-2015 Canonical Ltd
3 *3 *
4 * This program is free software: you can redistribute it and/or modify4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as5 * it under the terms of the GNU General Public License version 3 as
@@ -14,8 +14,8 @@
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */15 */
1616
17import QtQuick 2.317import QtQuick 2.4
18import Ubuntu.Components 1.118import Ubuntu.Components 1.3
1919
20// When the photo editor uses a proper PageStack this will switch back to being20// When the photo editor uses a proper PageStack this will switch back to being
21// an Item as it will not need to cover what is below it.21// an Item as it will not need to cover what is below it.
2222
=== modified file 'rc/qml/MediaViewer/PhotoViewerTransition.qml'
--- rc/qml/MediaViewer/PhotoViewerTransition.qml 2013-06-20 11:54:49 +0000
+++ rc/qml/MediaViewer/PhotoViewerTransition.qml 2015-11-05 19:26:06 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (C) 2011 Canonical Ltd2 * Copyright (C) 2011-2015 Canonical Ltd
3 *3 *
4 * This program is free software: you can redistribute it and/or modify4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as5 * it under the terms of the GNU General Public License version 3 as
@@ -17,7 +17,7 @@
17 * Charles Lindsay <chaz@yorba.org>17 * Charles Lindsay <chaz@yorba.org>
18 */18 */
1919
20import QtQuick 2.020import QtQuick 2.4
21import "../Utility"21import "../Utility"
22import "../../js/GraphicsRoutines.js" as GraphicsRoutines22import "../../js/GraphicsRoutines.js" as GraphicsRoutines
2323
2424
=== modified file 'rc/qml/MediaViewer/PopupPhotoViewer.qml'
--- rc/qml/MediaViewer/PopupPhotoViewer.qml 2015-02-12 13:48:42 +0000
+++ rc/qml/MediaViewer/PopupPhotoViewer.qml 2015-11-05 19:26:06 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (C) 2011 Canonical Ltd2 * Copyright (C) 2011-2015 Canonical Ltd
3 *3 *
4 * This program is free software: you can redistribute it and/or modify4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as5 * it under the terms of the GNU General Public License version 3 as
@@ -17,8 +17,8 @@
17 * Charles Lindsay <chaz@yorba.org>17 * Charles Lindsay <chaz@yorba.org>
18 */18 */
1919
20import QtQuick 2.020import QtQuick 2.4
21import Ubuntu.Components 1.121import Ubuntu.Components 1.3
22import "../Utility"22import "../Utility"
2323
24// A PhotoViewer that is opened and closed with the PhotoViewerTransition.24// A PhotoViewer that is opened and closed with the PhotoViewerTransition.
@@ -89,12 +89,21 @@
89 viewer.closeMediaViewer();89 viewer.closeMediaViewer();
90 }90 }
9191
92 head.actions: {92 head.visible: false
93 if (selection && selection.inSelectionMode)93 head.locked: true
94 return selectActions;94
95 return viewer.actions;95 header: PageHeader {
96 objectName: "photoViewerHeader"
97
98 title: popupPhotoViewer.title
99 trailingActionBar.actions: {
100 if (selection && selection.inSelectionMode)
101 return selectActions;
102 return viewer.actions;
103 }
104
105 leadingActionBar.actions: viewer.backAction
96 }106 }
97 head.backAction: viewer.backAction
98107
99 MediaViewer {108 MediaViewer {
100 id: viewer109 id: viewer
@@ -114,6 +123,13 @@
114 onIsReadyChanged: updateVisibility()123 onIsReadyChanged: updateVisibility()
115 onOpenCompletedChanged: updateVisibility()124 onOpenCompletedChanged: updateVisibility()
116125
126 onSetHeaderVisibilityRequested: popupPhotoViewer.header.visible = visibility
127 onToggleHeaderVisibilityRequested: {
128 popupPhotoViewer.header.visible = !popupPhotoViewer.header.visible
129 if (!APP.desktopMode)
130 setFullScreen(!popupPhotoViewer.header.visible);
131 }
132
117 // Internal133 // Internal
118 function updateVisibility() {134 function updateVisibility() {
119 if (isReady && openCompleted) {135 if (isReady && openCompleted) {
@@ -135,9 +151,9 @@
135 setFullScreen(true);151 setFullScreen(true);
136 overview.pushPage(popupPhotoViewer);152 overview.pushPage(popupPhotoViewer);
137 if (selection && selection.inSelectionMode)153 if (selection && selection.inSelectionMode)
138 overview.setHeaderVisibility(true);154 popupPhotoViewer.header.visible = true;
139 else155 else
140 overview.setHeaderVisibility(false);156 popupPhotoViewer.header.visible = false;
141 opened();157 opened();
142 }158 }
143159
144160
=== modified file 'rc/qml/MediaViewer/SingleMediaViewer.qml'
--- rc/qml/MediaViewer/SingleMediaViewer.qml 2015-09-15 17:12:45 +0000
+++ rc/qml/MediaViewer/SingleMediaViewer.qml 2015-11-05 19:26:06 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright 2014 Canonical Ltd.2 * Copyright 2014-2015 Canonical Ltd.
3 *3 *
4 * This program is free software; you can redistribute it and/or modify4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by5 * it under the terms of the GNU General Public License as published by
@@ -14,12 +14,12 @@
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */15 */
1616
17import QtQuick 2.217import QtQuick 2.4
18import QtMultimedia 5.018import QtMultimedia 5.0
19import Ubuntu.Components 1.019import Ubuntu.Components 1.3
20import Ubuntu.Components.ListItems 1.0 as ListItems20import Ubuntu.Components.ListItems 1.3 as ListItems
21import Ubuntu.Components.Popups 1.021import Ubuntu.Components.Popups 1.3
22import Ubuntu.Content 0.122import Ubuntu.Content 1.3
23import Ubuntu.Thumbnailer 0.123import Ubuntu.Thumbnailer 0.1
24import Gallery 1.024import Gallery 1.0
25import "../Components"25import "../Components"
2626
=== modified file 'rc/qml/OrganicView/OrganicAlbumView.qml'
--- rc/qml/OrganicView/OrganicAlbumView.qml 2013-06-26 08:59:08 +0000
+++ rc/qml/OrganicView/OrganicAlbumView.qml 2015-11-05 19:26:06 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (C) 2012 Canonical Ltd2 * Copyright (C) 2012-2015 Canonical Ltd
3 *3 *
4 * This program is free software: you can redistribute it and/or modify4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as5 * it under the terms of the GNU General Public License version 3 as
@@ -17,7 +17,7 @@
17 * Charles Lindsay <chaz@yorba.org>17 * Charles Lindsay <chaz@yorba.org>
18 */18 */
1919
20import QtQuick 2.020import QtQuick 2.4
21import Gallery 1.021import Gallery 1.0
22import "../Utility"22import "../Utility"
23import "../../js/GalleryUtility.js" as GalleryUtility23import "../../js/GalleryUtility.js" as GalleryUtility
2424
=== modified file 'rc/qml/OrganicView/OrganicItemInteraction.qml'
--- rc/qml/OrganicView/OrganicItemInteraction.qml 2015-02-16 16:25:08 +0000
+++ rc/qml/OrganicView/OrganicItemInteraction.qml 2015-11-05 19:26:06 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (C) 2012 Canonical Ltd2 * Copyright (C) 2012-2015 Canonical Ltd
3 *3 *
4 * This program is free software: you can redistribute it and/or modify4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as5 * it under the terms of the GNU General Public License version 3 as
@@ -17,8 +17,8 @@
17 * Charles Lindsay <chaz@yorba.org>17 * Charles Lindsay <chaz@yorba.org>
18 */18 */
1919
20import QtQuick 2.020import QtQuick 2.4
21import Ubuntu.Components 0.121import Ubuntu.Components 1.3
22import "../Utility"22import "../Utility"
2323
24// The user interaction and selection handling for items in the24// The user interaction and selection handling for items in the
2525
=== modified file 'rc/qml/OrganicView/OrganicMediaList.qml'
--- rc/qml/OrganicView/OrganicMediaList.qml 2015-07-27 22:48:49 +0000
+++ rc/qml/OrganicView/OrganicMediaList.qml 2015-11-05 19:26:06 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (C) 2012 Canonical Ltd2 * Copyright (C) 2012-2015 Canonical Ltd
3 *3 *
4 * This program is free software: you can redistribute it and/or modify4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as5 * it under the terms of the GNU General Public License version 3 as
@@ -17,9 +17,9 @@
17 * Charles Lindsay <chaz@yorba.org>17 * Charles Lindsay <chaz@yorba.org>
18 */18 */
1919
20import QtQuick 2.020import QtQuick 2.4
21import Gallery 1.021import Gallery 1.0
22import Ubuntu.Components 0.122import Ubuntu.Components 1.3
23import Ubuntu.Thumbnailer 0.123import Ubuntu.Thumbnailer 0.1
24import "../Components"24import "../Components"
25import "../Utility"25import "../Utility"
@@ -132,7 +132,7 @@
132 UbuntuShape {132 UbuntuShape {
133 id: thumbnail133 id: thumbnail
134134
135 property bool isLoading: image.status === Image.Loading135 property bool isLoading: source.status === Image.Loading
136136
137 x: __photoX[patternPhoto]137 x: __photoX[patternPhoto]
138 y: __photosTopMargin + __photoY[patternPhoto]138 y: __photosTopMargin + __photoY[patternPhoto]
@@ -164,11 +164,12 @@
164 }164 }
165 }165 }
166166
167 visible: image.status === Image.Ready167 visible: source.status === Image.Ready
168168
169 radius: "medium"169 radius: "medium"
170170
171 image: Image {171 sourceFillMode: UbuntuShape.PreserveAspectCrop
172 source: Image {
172 id: thumbImage173 id: thumbImage
173 source: "image://thumbnailer/" + model.mediaSource.path + "?at=" + Date.now()174 source: "image://thumbnailer/" + model.mediaSource.path + "?at=" + Date.now()
174 asynchronous: true175 asynchronous: true
175176
=== modified file 'rc/qml/OrganicView/OrganicView.qml'
--- rc/qml/OrganicView/OrganicView.qml 2014-11-07 12:51:32 +0000
+++ rc/qml/OrganicView/OrganicView.qml 2015-11-05 19:26:06 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (C) 2012 Canonical Ltd2 * Copyright (C) 2012-2015 Canonical Ltd
3 *3 *
4 * This program is free software: you can redistribute it and/or modify4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as5 * it under the terms of the GNU General Public License version 3 as
@@ -17,8 +17,8 @@
17 * Charles Lindsay <chaz@yorba.org>17 * Charles Lindsay <chaz@yorba.org>
18 */18 */
1919
20import QtQuick 2.020import QtQuick 2.4
21import Ubuntu.Components 1.121import Ubuntu.Components 1.3
22import "../Utility"22import "../Utility"
23import "../../js/Gallery.js" as Gallery23import "../../js/Gallery.js" as Gallery
2424
@@ -61,13 +61,6 @@
61 positionEventsAtBeginning()61 positionEventsAtBeginning()
62 }62 }
6363
64 Image {
65 anchors.fill: parent
66
67 source: "../../img/background-paper.png"
68 fillMode: Image.Tile
69 }
70
71 ListView {64 ListView {
72 id: organicList65 id: organicList
7366
7467
=== modified file 'rc/qml/PhotosOverview.qml'
--- rc/qml/PhotosOverview.qml 2015-02-12 13:48:42 +0000
+++ rc/qml/PhotosOverview.qml 2015-11-05 19:26:06 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (C) 2012 Canonical Ltd2 * Copyright (C) 2012-2015 Canonical Ltd
3 *3 *
4 * This program is free software: you can redistribute it and/or modify4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as5 * it under the terms of the GNU General Public License version 3 as
@@ -17,11 +17,11 @@
17 * Jim Nelson <jim@yorba.org>17 * Jim Nelson <jim@yorba.org>
18 */18 */
1919
20import QtQuick 2.020import QtQuick 2.4
21import Gallery 1.021import Gallery 1.0
22import Ubuntu.Components 0.122import Ubuntu.Components 1.3
23import Ubuntu.Components.Popups 0.123import Ubuntu.Components.Popups 1.3
24import Ubuntu.Content 0.124import Ubuntu.Content 1.3
25import "Components"25import "Components"
26import "OrganicView"26import "OrganicView"
27import "Utility"27import "Utility"
@@ -59,14 +59,8 @@
5959
60 property string pageTitle60 property string pageTitle
6161
62 tools: inSelectionMode ? d.selectionTools : d.overviewTools62 head.actions: inSelectionMode ? d.selectActions : d.overviewActions
6363 head.backAction: inSelectionMode ? d.selectBackAction : null
64 Image {
65 anchors.fill: parent
66
67 source: "../img/background-paper.png"
68 fillMode: Image.Tile
69 }
7064
71 MediaGrid {65 MediaGrid {
72 id: photosGrid66 id: photosGrid
@@ -128,30 +122,61 @@
128 model: photosOverview.model122 model: photosOverview.model
129 }123 }
130124
131 property Item overviewTools: PhotosToolbarActions {125 property list<Action> overviewActions: [
132 selection: d.selection126 Action {
133 }127 objectName: "selectButton"
134128 text: i18n.tr("Select")
135 property Item selectionTools: SelectionToolbarAction {129 iconName: "select"
136 selection: d.selection130 enabled: d.selection !== null
137131 onTriggered: d.selection.inSelectionMode = true;
138 onCancelClicked: {132 },
139 photosOverview.leaveSelectionMode();133 Action {
140 }134 objectName: "cameraButton"
141 onAddClicked: {135 text: i18n.tr("Camera")
142 __albumPicker = PopupUtils.open(Qt.resolvedUrl("Components/PopupAlbumPicker.qml"),136 visible: !APP.desktopMode
143 null,137 iconName: "camera-app-symbolic"
144 {contentHeight: photosOverview.__pickerContentHeight});138 onTriggered: Qt.openUrlExternally("appid://com.ubuntu.camera/camera/current-user-version")
145 }139 }
146 onDeleteClicked: {140 ]
147 PopupUtils.open(deleteDialog, null);141
148 }142 property list<Action> selectActions: [
149143 Action {
150 onShareClicked: {144 id: addButton
151 overview.pushPage(sharePicker)145 objectName: "addButton"
152 sharePicker.visible = true;146
153 }147 text: i18n.tr("Add")
154 }148 iconName: "add"
149 enabled: d.selection.selectedCount > 0
150 onTriggered: __albumPicker = PopupUtils.open(Qt.resolvedUrl("Components/PopupAlbumPicker.qml"),
151 null,
152 {contentHeight: photosOverview.__pickerContentHeight});
153
154 },
155 Action {
156 objectName: "deleteButton"
157
158 text: i18n.tr("Delete")
159 iconName: "delete"
160 enabled: d.selection.selectedCount > 0
161 onTriggered: PopupUtils.open(deleteDialog, null);
162 },
163 Action {
164 objectName: "shareButton"
165 text: i18n.tr("Share")
166 iconName: "share"
167 enabled: d.selection.selectedMediaCount == 1
168 onTriggered: {
169 overview.pushPage(sharePicker)
170 sharePicker.visible = true;
171 }
172 }
173 ]
174
175 property Action selectBackAction: Action {
176 text: i18n.tr("Cancel")
177 iconName: "back"
178 onTriggered: photosOverview.leaveSelectionMode();
179 }
155 }180 }
156181
157 Component {182 Component {
158183
=== modified file 'rc/qml/PickerScreen.qml'
--- rc/qml/PickerScreen.qml 2015-02-09 19:48:24 +0000
+++ rc/qml/PickerScreen.qml 2015-11-05 19:26:06 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (C) 2013 Canonical Ltd2 * Copyright (C) 2013-2015 Canonical Ltd
3 *3 *
4 * This program is free software: you can redistribute it and/or modify4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as5 * it under the terms of the GNU General Public License version 3 as
@@ -14,8 +14,8 @@
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */15 */
1616
17import QtQuick 2.017import QtQuick 2.4
18import Ubuntu.Components 1.118import Ubuntu.Components 1.3
19import Gallery 1.019import Gallery 1.0
20import "Components"20import "Components"
21import "OrganicView"21import "OrganicView"
@@ -30,8 +30,6 @@
30 id: overview30 id: overview
31 objectName: "pickerMainView"31 objectName: "pickerMainView"
3232
33 useDeprecatedToolbar: false
34
35 function setHeaderVisibility(visible)33 function setHeaderVisibility(visible)
36 {34 {
37 header.visible = visible; 35 header.visible = visible;
@@ -173,12 +171,6 @@
173 onSelected: photosGrid.positionViewAtIndex(index, GridView.Contain);171 onSelected: photosGrid.positionViewAtIndex(index, GridView.Contain);
174 }172 }
175173
176 Image {
177 anchors.fill: parent
178 source: "../img/background-paper.png"
179 fillMode: Image.Tile
180 }
181
182 MediaGrid {174 MediaGrid {
183 id: photosGrid175 id: photosGrid
184 anchors.fill: parent176 anchors.fill: parent
185177
=== modified file 'rc/qml/Utility/DissolveAnimation.qml'
--- rc/qml/Utility/DissolveAnimation.qml 2013-06-20 11:54:49 +0000
+++ rc/qml/Utility/DissolveAnimation.qml 2015-11-05 19:26:06 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (C) 2011-2012 Canonical Ltd2 * Copyright (C) 2011-2015 Canonical Ltd
3 *3 *
4 * This program is free software: you can redistribute it and/or modify4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as5 * it under the terms of the GNU General Public License version 3 as
@@ -17,7 +17,7 @@
17 * Charles Lindsay <chaz@yorba.org>17 * Charles Lindsay <chaz@yorba.org>
18 */18 */
1919
20import QtQuick 2.020import QtQuick 2.4
2121
22// Fades in the fadeInTarget while fading out the fadeOutTarget.22// Fades in the fadeInTarget while fading out the fadeOutTarget.
23/*!23/*!
2424
=== modified file 'rc/qml/Utility/EditingHUD.qml'
--- rc/qml/Utility/EditingHUD.qml 2013-09-09 09:52:01 +0000
+++ rc/qml/Utility/EditingHUD.qml 2015-11-05 19:26:06 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (C) 2013 Canonical Ltd2 * Copyright (C) 2013-2015 Canonical Ltd
3 *3 *
4 * This program is free software: you can redistribute it and/or modify4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as5 * it under the terms of the GNU General Public License version 3 as
@@ -14,9 +14,9 @@
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */15 */
1616
17import QtQuick 2.017import QtQuick 2.4
18import Gallery 1.018import Gallery 1.0
19import Ubuntu.Components 0.119import Ubuntu.Components 1.3
20import Ubuntu.Unity.Action 1.0 as UnityActions20import Ubuntu.Unity.Action 1.0 as UnityActions
2121
22/*!22/*!
2323
=== modified file 'rc/qml/Utility/ExpandAnimation.qml'
--- rc/qml/Utility/ExpandAnimation.qml 2013-06-20 11:54:49 +0000
+++ rc/qml/Utility/ExpandAnimation.qml 2015-11-05 19:26:06 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (C) 2011 Canonical Ltd2 * Copyright (C) 2011-2015 Canonical Ltd
3 *3 *
4 * This program is free software: you can redistribute it and/or modify4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as5 * it under the terms of the GNU General Public License version 3 as
@@ -17,7 +17,7 @@
17 * Charles Lindsay <chaz@yorba.org>17 * Charles Lindsay <chaz@yorba.org>
18 */18 */
1919
20import QtQuick 2.020import QtQuick 2.4
2121
22// Moves the position and size of the target to the end values.22// Moves the position and size of the target to the end values.
23/*!23/*!
2424
=== modified file 'rc/qml/Utility/FadeInAnimation.qml'
--- rc/qml/Utility/FadeInAnimation.qml 2013-06-20 11:54:49 +0000
+++ rc/qml/Utility/FadeInAnimation.qml 2015-11-05 19:26:06 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (C) 2011-2012 Canonical Ltd2 * Copyright (C) 2011-2015 Canonical Ltd
3 *3 *
4 * This program is free software: you can redistribute it and/or modify4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as5 * it under the terms of the GNU General Public License version 3 as
@@ -17,7 +17,7 @@
17 * Charles Lindsay <chaz@yorba.org>17 * Charles Lindsay <chaz@yorba.org>
18 */18 */
1919
20import QtQuick 2.020import QtQuick 2.4
2121
22// Sets the target to visible at the startOpacity, animates to the endOpacity.22// Sets the target to visible at the startOpacity, animates to the endOpacity.
23SequentialAnimation {23SequentialAnimation {
2424
=== modified file 'rc/qml/Utility/FadeOutAnimation.qml'
--- rc/qml/Utility/FadeOutAnimation.qml 2013-06-20 11:54:49 +0000
+++ rc/qml/Utility/FadeOutAnimation.qml 2015-11-05 19:26:06 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (C) 2011-2012 Canonical Ltd2 * Copyright (C) 2011-2015 Canonical Ltd
3 *3 *
4 * This program is free software: you can redistribute it and/or modify4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as5 * it under the terms of the GNU General Public License version 3 as
@@ -17,7 +17,7 @@
17 * Charles Lindsay <chaz@yorba.org>17 * Charles Lindsay <chaz@yorba.org>
18 */18 */
1919
20import QtQuick 2.020import QtQuick 2.4
2121
22// Sets the target to visible at the startOpacity, animates to the endOpacity,22// Sets the target to visible at the startOpacity, animates to the endOpacity,
23// then returns the startOpacity but with visible set to false.23// then returns the startOpacity but with visible set to false.
2424
=== removed file 'rc/qml/Utility/PhotosToolbarActions.qml'
--- rc/qml/Utility/PhotosToolbarActions.qml 2014-08-26 21:54:25 +0000
+++ rc/qml/Utility/PhotosToolbarActions.qml 1970-01-01 00:00:00 +0000
@@ -1,57 +0,0 @@
1/*
2 * Copyright (C) 2013 Canonical Ltd
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.0
18import Ubuntu.Components 0.1
19
20/*!
21 The actions for the toolbar for the event and photos view
22 */
23ToolbarItems {
24 id: root
25 /// The selection state item to use for enable / disable the select mode
26 property SelectionState selection: null
27
28 /// Emittedt when the camera action was triggered
29 signal startCamera()
30
31 ToolbarButton {
32 action: Action {
33 objectName: "selectButton"
34 text: i18n.tr("Select")
35 iconSource: Qt.resolvedUrl("../../img/select.png")
36 enabled: root.selection !== null
37 onTriggered: root.selection.inSelectionMode = true;
38 }
39 }
40 ToolbarButton {
41 objectName: "importButton"
42 action: Action {
43 text: i18n.tr("Import")
44 iconSource: Qt.resolvedUrl("../../img/import-image.png")
45 visible: false
46 }
47 }
48 ToolbarButton {
49 action: Action {
50 objectName: "cameraButton"
51 text: i18n.tr("Camera")
52 visible: !APP.desktopMode
53 iconSource: Qt.resolvedUrl("../../img/camera.png")
54 onTriggered: Qt.openUrlExternally("appid://com.ubuntu.camera/camera/current-user-version")
55 }
56 }
57}
580
=== modified file 'rc/qml/Utility/SelectionState.qml'
--- rc/qml/Utility/SelectionState.qml 2014-10-06 19:47:10 +0000
+++ rc/qml/Utility/SelectionState.qml 2015-11-05 19:26:06 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (C) 2012 Canonical Ltd2 * Copyright (C) 2012-2015 Canonical Ltd
3 *3 *
4 * This program is free software: you can redistribute it and/or modify4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as5 * it under the terms of the GNU General Public License version 3 as
@@ -17,7 +17,7 @@
17 * Charles Lindsay <chaz@yorba.org>17 * Charles Lindsay <chaz@yorba.org>
18 */18 */
1919
20import QtQuick 2.020import QtQuick 2.4
21import Gallery 1.021import Gallery 1.0
2222
23// Holds all the state for selection between the Organic views, and some other23// Holds all the state for selection between the Organic views, and some other
2424
=== removed file 'rc/qml/Utility/SelectionToolbarAction.qml'
--- rc/qml/Utility/SelectionToolbarAction.qml 2014-09-15 16:32:40 +0000
+++ rc/qml/Utility/SelectionToolbarAction.qml 1970-01-01 00:00:00 +0000
@@ -1,82 +0,0 @@
1/*
2 * Copyright (C) 2013 Canonical Ltd
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.0
18import Ubuntu.Components 0.1
19import Ubuntu.Components.Popups 0.1
20
21/*!
22 The actions for the toolbar for the event and photos view in select mode
23 */
24ToolbarItems {
25 id: root
26 /// The selection state item
27 property SelectionState selection: null
28
29 /// Emitted when cancel was clicked
30 signal cancelClicked()
31 /// Emitted when add was clicked
32 /// @param caller the item that caused the call (was clicked)
33 signal addClicked(var caller)
34 ///Emitted when delete was clicked
35 signal deleteClicked()
36 ///Emitted when share was clicked
37 signal shareClicked()
38
39 // in selection mode, never hide the toolbar:
40 opened: true
41 locked: true
42
43 ToolbarButton {
44 id: addButton
45 objectName: "addButton"
46 action: Action {
47 text: i18n.tr("Add")
48 iconName: "add"
49 enabled: root.selection.selectedCount > 0
50 onTriggered: root.addClicked(addButton);
51 }
52 }
53 ToolbarButton {
54 action: Action {
55 objectName: "deleteButton"
56 text: i18n.tr("Delete")
57 iconName: "delete"
58 enabled: root.selection.selectedCount > 0
59 onTriggered:root.deleteClicked();
60 }
61 }
62 ToolbarButton {
63 action: Action {
64 objectName: "shareButton"
65 text: i18n.tr("Share")
66 iconName: "share"
67 enabled: root.selection.selectedMediaCount == 1
68 onTriggered: root.shareClicked();
69 }
70 }
71
72 back: Button {
73 objectName: "cancelButton"
74 action: Action {
75 text: i18n.tr("Cancel")
76 iconName: "back"
77 onTriggered: {
78 root.cancelClicked();
79 }
80 }
81 }
82}
830
=== modified file 'src/photo/photo.cpp'
--- src/photo/photo.cpp 2015-08-20 22:26:08 +0000
+++ src/photo/photo.cpp 2015-11-05 19:26:06 +0000
@@ -77,6 +77,7 @@
77{77{
78 QByteArray format = QImageReader(file.filePath()).format();78 QByteArray format = QImageReader(file.filePath()).format();
79 m_fileFormat = QString(format).toLower();79 m_fileFormat = QString(format).toLower();
80 Q_EMIT canBeEditedChanged();
80 if (m_fileFormat == "jpg") // Why does Qt expose two different names here?81 if (m_fileFormat == "jpg") // Why does Qt expose two different names here?
81 m_fileFormat = "jpeg";82 m_fileFormat = "jpeg";
82}83}
8384
=== modified file 'src/photo/photo.h'
--- src/photo/photo.h 2015-01-19 11:45:31 +0000
+++ src/photo/photo.h 2015-11-05 19:26:06 +0000
@@ -35,7 +35,7 @@
35{35{
36 Q_OBJECT36 Q_OBJECT
3737
38 Q_PROPERTY(bool canBeEdited READ canBeEdited)38 Q_PROPERTY(bool canBeEdited READ canBeEdited NOTIFY canBeEditedChanged)
39public:39public:
40 explicit Photo(const QFileInfo& file);40 explicit Photo(const QFileInfo& file);
41 virtual ~Photo();41 virtual ~Photo();
@@ -56,6 +56,9 @@
56 bool fileFormatHasMetadata() const;56 bool fileFormatHasMetadata() const;
57 bool fileFormatHasOrientation() const;57 bool fileFormatHasOrientation() const;
5858
59signals:
60 void canBeEditedChanged();
61
59protected:62protected:
60 virtual void destroySource(bool destroyBacking, bool asOrphan);63 virtual void destroySource(bool destroyBacking, bool asOrphan);
6164
6265
=== modified file 'tests/autopilot/gallery_app/emulators/album_view.py'
--- tests/autopilot/gallery_app/emulators/album_view.py 2015-04-15 17:45:14 +0000
+++ tests/autopilot/gallery_app/emulators/album_view.py 2015-11-05 19:26:06 +0000
@@ -11,6 +11,7 @@
11from testtools.matchers import GreaterThan, LessThan, Equals, Is11from testtools.matchers import GreaterThan, LessThan, Equals, Is
12from autopilot.matchers import Eventually12from autopilot.matchers import Eventually
1313
14from autopilot.introspection.dbus import StateNotFoundError
14from autopilot import logging as autopilot_logging15from autopilot import logging as autopilot_logging
1516
16from gallery_app.emulators.gallery_utils import(17from gallery_app.emulators.gallery_utils import(
@@ -219,3 +220,29 @@
219 i.source).split('?')[0]220 i.source).split('?')[0]
220 self.pointing_device.click_object(photo)221 self.pointing_device.click_object(photo)
221 return path222 return path
223
224 def _get_header(self):
225 return self.app.select_single('PageHeader',
226 objectName='albumViewerHeader')
227
228 def _open_overflow(self):
229 overflow_button = self._get_header().select_single(
230 objectName='overflow_action_button')
231 self.pointing_device.click_object(overflow_button)
232 return self.get_root_instance().wait_select_single(
233 objectName='actions_overflow_panel',
234 visible=True)
235
236 def click_action_button(self, action_object_name):
237 header = self._get_header()
238 header.visible.wait_for(True)
239
240 try:
241 object_name = action_object_name + "_action_button"
242 button = header.select_single(objectName=object_name)
243 self.pointing_device.click_object(button)
244 except StateNotFoundError:
245 object_name = action_object_name + "_button"
246 popover = self._open_overflow()
247 button = popover.select_single(objectName=object_name)
248 self.pointing_device.click_object(button)
222249
=== modified file 'tests/autopilot/gallery_app/emulators/photo_viewer.py'
--- tests/autopilot/gallery_app/emulators/photo_viewer.py 2015-04-16 22:01:54 +0000
+++ tests/autopilot/gallery_app/emulators/photo_viewer.py 2015-11-05 19:26:06 +0000
@@ -7,6 +7,7 @@
77
8import logging8import logging
99
10from autopilot.introspection.dbus import StateNotFoundError
10import autopilot.logging11import autopilot.logging
11import ubuntuuitoolkit12import ubuntuuitoolkit
1213
@@ -21,12 +22,42 @@
2122
2223
23class PopupPhotoViewer(ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase):24class PopupPhotoViewer(ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase):
25 def _get_header(self):
26 main = self.get_root_instance().select_single(main_screen.MainScreen)
27 return main.select_single('PageHeader',
28 objectName='photoViewerHeader')
29
30 def _open_overflow(self):
31 overflow_button = self._get_header().select_single(
32 objectName='overflow_action_button')
33 self.pointing_device.click_object(overflow_button)
34 return self.get_root_instance().wait_select_single(
35 objectName='actions_overflow_panel',
36 visible=True)
37
38 def click_action_button(self, action_object_name):
39 header = self._get_header()
40 if not header.visible:
41 main = self.get_root_instance().select_single(
42 main_screen.MainScreen)
43 x, y, w, h = main.globalRect
44 self.pointing_device.move(x + (w // 2), y + (h // 2))
45 self.pointing_device.click()
46 header.visible.wait_for(True)
47
48 try:
49 object_name = action_object_name + "_action_button"
50 button = header.select_single(objectName=object_name)
51 self.pointing_device.click_object(button)
52 except StateNotFoundError:
53 object_name = action_object_name + "_button"
54 popover = self._open_overflow()
55 button = popover.select_single(objectName=object_name)
56 self.pointing_device.click_object(button)
2457
25 @autopilot.logging.log_action(logger.info)58 @autopilot.logging.log_action(logger.info)
26 def delete_current_photo(self, confirm=True):59 def delete_current_photo(self, confirm=True):
27 header = self.get_root_instance().select_single(60 self.click_action_button("deleteButton")
28 main_screen.MainScreen).get_header()
29 header.click_action_button("deleteButton")
30 if confirm:61 if confirm:
31 self.confirm_delete_photo()62 self.confirm_delete_photo()
32 else:63 else:
@@ -66,17 +97,9 @@
66 return self.app.wait_select_single("PopupAlbumPicker",97 return self.app.wait_select_single("PopupAlbumPicker",
67 objectName="popupAlbumPicker")98 objectName="popupAlbumPicker")
6899
69 def get_content_peer_picker_cancel_button(self):
70 """Returns the ContentPeerPicker cancel button."""
71 return self.get_share_peer_picker().wait_select_single(
72 "Button",
73 objectName="contentPeerPickerCancelButton",
74 visible=True)
75
76 def get_share_peer_picker(self):100 def get_share_peer_picker(self):
77 """Returns the photo viewer share picker."""101 """Returns the photo viewer share picker."""
78 return self.app.wait_select_single("ContentPeerPicker10",102 return self.app.wait_select_single(objectName="sharePicker",
79 objectName="sharePicker",
80 visible=True)103 visible=True)
81104
82 def get_photo_editor(self):105 def get_photo_editor(self):
83106
=== modified file 'tests/autopilot/gallery_app/emulators/picker_screen.py'
--- tests/autopilot/gallery_app/emulators/picker_screen.py 2015-04-15 17:45:14 +0000
+++ tests/autopilot/gallery_app/emulators/picker_screen.py 2015-11-05 19:26:06 +0000
@@ -12,7 +12,7 @@
12class PickerScreen(toolkit_emulators.MainView):12class PickerScreen(toolkit_emulators.MainView):
1313
14 def pick_button(self):14 def pick_button(self):
15 return self.select_single(objectName="pickButton_header_button")15 return self.select_single(objectName="pickButton_action_button")
1616
17 def get_photos_tab_button(self):17 def get_photos_tab_button(self):
18 """Returns the photos tab."""18 """Returns the photos tab."""
@@ -39,14 +39,14 @@
39 Return the Page object representing the photos39 Return the Page object representing the photos
40 """40 """
41 self.switch_to_tab('photosTab')41 self.switch_to_tab('photosTab')
42 return self.select_single(Page11, objectName='photosPage')42 return self.select_single(Page, objectName='photosPage')
4343
44 def click_pick_button(self):44 def click_pick_button(self):
45 """Click on the pick button"""45 """Click on the pick button"""
46 self.pointing_device.click_object(self.pick_button())46 self.pointing_device.click_object(self.pick_button())
4747
4848
49class Page11(PickerScreen):49class Page(PickerScreen):
50 """Class to represent photos page view from picker screen"""50 """Class to represent photos page view from picker screen"""
5151
52 def _get_named_photo_element(self, photo_name):52 def _get_named_photo_element(self, photo_name):
5353
=== modified file 'tests/autopilot/gallery_app/tests/test_album_editor.py'
--- tests/autopilot/gallery_app/tests/test_album_editor.py 2015-04-14 14:38:00 +0000
+++ tests/autopilot/gallery_app/tests/test_album_editor.py 2015-11-05 19:26:06 +0000
@@ -96,7 +96,7 @@
96 self.pointing_device.move(x + 40, y + h + 40)96 self.pointing_device.move(x + 40, y + h + 40)
97 self.pointing_device.click()97 self.pointing_device.click()
9898
99 self.main_view.get_header().click_custom_back_button()99 self.album_view.click_action_button("backButton")
100 self.album_view.ensure_album_view_fully_closed()100 self.album_view.ensure_album_view_fully_closed()
101101
102 # now open to add a photo102 # now open to add a photo
103103
=== modified file 'tests/autopilot/gallery_app/tests/test_album_view.py'
--- tests/autopilot/gallery_app/tests/test_album_view.py 2015-02-17 10:23:02 +0000
+++ tests/autopilot/gallery_app/tests/test_album_view.py 2015-11-05 19:26:06 +0000
@@ -15,6 +15,7 @@
15from gallery_app.emulators.albums_view import AlbumsView15from gallery_app.emulators.albums_view import AlbumsView
16from gallery_app.emulators.media_selector import MediaSelector16from gallery_app.emulators.media_selector import MediaSelector
17from gallery_app.emulators.photo_viewer import PhotoViewer17from gallery_app.emulators.photo_viewer import PhotoViewer
18from gallery_app.emulators.photo_viewer import PopupPhotoViewer
18from gallery_app.emulators import album_editor19from gallery_app.emulators import album_editor
19from gallery_app.tests import GalleryTestCase20from gallery_app.tests import GalleryTestCase
2021
@@ -88,7 +89,7 @@
88 self.pointing_device.click()89 self.pointing_device.click()
8990
90 # open media selector but cancel91 # open media selector but cancel
91 self.main_view.get_header().click_action_button("addButton")92 self.album_view.click_action_button("addButton")
92 self.media_selector.ensure_fully_open()93 self.media_selector.ensure_fully_open()
9394
94 self.main_view.get_header().click_custom_back_button()95 self.main_view.get_header().click_custom_back_button()
@@ -98,7 +99,7 @@
98 self.assertThat(num_photos, Equals(num_photos_start))99 self.assertThat(num_photos, Equals(num_photos_start))
99100
100 # open media selector and add a photo101 # open media selector and add a photo
101 self.main_view.get_header().click_action_button("addButton")102 self.album_view.click_action_button("addButton")
102 self.media_selector.ensure_fully_open()103 self.media_selector.ensure_fully_open()
103104
104 photo = self.media_selector.get_second_photo()105 photo = self.media_selector.get_second_photo()
@@ -123,7 +124,9 @@
123 photo_view = self.album_view.get_album_photo_view()124 photo_view = self.album_view.get_album_photo_view()
124 self.assertThat(photo_view.visible, Eventually(Equals(True)))125 self.assertThat(photo_view.visible, Eventually(Equals(True)))
125126
126 self.main_view.get_header().click_action_button("deleteButton")127 photo_viewer_popup = self.main_view.wait_select_single(
128 PopupPhotoViewer, visible=True)
129 photo_viewer_popup.click_action_button("deleteButton")
127 self.album_view.click_remove_from_album_remove_button()130 self.album_view.click_remove_from_album_remove_button()
128131
129 self.assertThat(lambda: self.album_view.number_of_photos(),132 self.assertThat(lambda: self.album_view.number_of_photos(),
@@ -145,7 +148,9 @@
145 photo_view = self.album_view.get_album_photo_view()148 photo_view = self.album_view.get_album_photo_view()
146 self.assertThat(photo_view.visible, Eventually(Equals(True)))149 self.assertThat(photo_view.visible, Eventually(Equals(True)))
147150
148 self.main_view.get_header().click_action_button("deleteButton")151 photo_viewer_popup = self.main_view.wait_select_single(
152 PopupPhotoViewer, visible=True)
153 photo_viewer_popup.click_action_button("deleteButton")
149 self.album_view.click_remove_from_album_delete_button()154 self.album_view.click_remove_from_album_delete_button()
150155
151 self.assertThat(lambda: self.album_view.number_of_photos(),156 self.assertThat(lambda: self.album_view.number_of_photos(),
@@ -167,10 +172,13 @@
167 photo_view = self.album_view.get_album_photo_view()172 photo_view = self.album_view.get_album_photo_view()
168 self.assertThat(photo_view.visible, Eventually(Equals(True)))173 self.assertThat(photo_view.visible, Eventually(Equals(True)))
169174
170 self.main_view.get_header().click_action_button("deleteButton")175 photo_viewer_popup = self.main_view.wait_select_single(
176 PopupPhotoViewer, visible=True)
177 photo_viewer_popup.click_action_button("deleteButton")
178
171 self.album_view.click_remove_from_album_cancel_button()179 self.album_view.click_remove_from_album_cancel_button()
172180
173 self.main_view.get_header().click_custom_back_button()181 photo_viewer_popup.click_action_button("backButton")
174182
175 self.assertThat(lambda: self.album_view.number_of_photos(),183 self.assertThat(lambda: self.album_view.number_of_photos(),
176 Eventually(Equals(num_photos_start)))184 Eventually(Equals(num_photos_start)))
@@ -179,29 +187,29 @@
179 Eventually(Equals(True)))187 Eventually(Equals(True)))
180188
181 def test_add_photo_to_new_album(self):189 def test_add_photo_to_new_album(self):
190 albums = self.albums_view.number_of_albums_in_albums_view()
182 self.main_view.get_header().click_action_button("addButton")191 self.main_view.get_header().click_action_button("addButton")
183 self.ui_update()192 self.ui_update()
184193
185 editor = self.app.select_single(album_editor.AlbumEditor)194 editor = self.app.select_single(album_editor.AlbumEditor)
186 editor.ensure_fully_open()195 editor.ensure_fully_open()
187 editor.close()196 editor.add_photos()
188
189 num_photos_start = self.album_view.number_of_photos()
190 self.assertThat(num_photos_start, Equals(0))
191
192 plus = self.album_view.get_plus_icon_empty_album()
193 self.click_item(plus)
194 self.media_selector.ensure_fully_open()197 self.media_selector.ensure_fully_open()
195198
196 photo = self.media_selector.get_second_photo()199 photo = self.media_selector.get_second_photo()
197 checkbox = photo.select_single(objectName="selectionCheckbox")200 checkbox = photo.select_single(objectName="selectionCheckbox")
198 self.click_item(checkbox)201 self.click_item(checkbox)
199 self.main_view.get_header().click_action_button("addButton")202 self.main_view.get_header().click_action_button("addButton")
203 self.ui_update()
204 self.assertThat(
205 lambda: self.albums_view.number_of_albums_in_albums_view(),
206 Eventually(Equals(albums+1))
207 )
200208
201 self.open_first_album()209 self.open_first_album()
202 self.assertThat(210 self.assertThat(
203 lambda: self.album_view.number_of_photos(),211 lambda: self.album_view.number_of_photos(),
204 Eventually(Equals(num_photos_start + 1)))212 Eventually(Equals(1)))
205213
206 @skip("Temporarily disable as it fails in some cases, supposedly due to "214 @skip("Temporarily disable as it fails in some cases, supposedly due to "
207 "problems with the infrastructure")215 "problems with the infrastructure")
208216
=== modified file 'tests/autopilot/gallery_app/tests/test_albums_view.py'
--- tests/autopilot/gallery_app/tests/test_albums_view.py 2015-02-17 10:23:02 +0000
+++ tests/autopilot/gallery_app/tests/test_albums_view.py 2015-11-05 19:26:06 +0000
@@ -59,10 +59,9 @@
59 super(TestAlbumsView, self).tearDown()59 super(TestAlbumsView, self).tearDown()
6060
61 def check_header_button_exist(self, button):61 def check_header_button_exist(self, button):
62 header = self.main_view.get_header()62 buttonName = button + "_action_button"
63 buttonName = button + "_header_button"
64 try:63 try:
65 header.select_single(objectName=buttonName)64 self.main_view.select_single(objectName=buttonName)
66 except StateNotFoundError:65 except StateNotFoundError:
67 return False66 return False
68 return True67 return True
6968
=== modified file 'tests/autopilot/gallery_app/tests/test_events_view.py'
--- tests/autopilot/gallery_app/tests/test_events_view.py 2015-02-27 19:17:38 +0000
+++ tests/autopilot/gallery_app/tests/test_events_view.py 2015-11-05 19:26:06 +0000
@@ -62,10 +62,9 @@
62 self.main_view.get_header().click_action_button("selectButton")62 self.main_view.get_header().click_action_button("selectButton")
6363
64 def check_header_button_exist(self, button):64 def check_header_button_exist(self, button):
65 header = self.main_view.get_header()65 buttonName = button + "_action_button"
66 buttonName = button + "_header_button"
67 try:66 try:
68 header.select_single(objectName=buttonName)67 self.main_view.select_single(objectName=buttonName)
69 except StateNotFoundError:68 except StateNotFoundError:
70 return False69 return False
71 return True70 return True
7271
=== modified file 'tests/autopilot/gallery_app/tests/test_photo_viewer.py'
--- tests/autopilot/gallery_app/tests/test_photo_viewer.py 2015-04-16 21:54:59 +0000
+++ tests/autopilot/gallery_app/tests/test_photo_viewer.py 2015-11-05 19:26:06 +0000
@@ -95,19 +95,21 @@
9595
96 def test_nav_bar_back_button(self):96 def test_nav_bar_back_button(self):
97 """Clicking the back button must close the photo."""97 """Clicking the back button must close the photo."""
98 self.main_view.get_header().click_custom_back_button()98 photo_viewer_popup = self.main_view.select_single(
99 photo_viewer = self.photo_viewer.get_main_photo_viewer()99 photo_viewer.PopupPhotoViewer)
100 self.assertThat(photo_viewer.visible, Eventually(Equals(False)))100 photo_viewer_popup.click_action_button("backButton")
101 viewer = self.photo_viewer.get_main_photo_viewer()
102 self.assertThat(viewer.visible, Eventually(Equals(False)))
101103
102 @skipIf(model() == 'Desktop', 'Share not supported on desktop')104 @skipIf(model() == 'Desktop', 'Share not supported on desktop')
103 def test_share_button(self):105 def test_share_button(self):
104 """Clicking the share button must show the ContentPeerPicker."""106 """Clicking the share button must show the ContentPeerPicker."""
105 self.main_view.get_header().click_action_button("shareButton")107 photo_viewer_popup = self.main_view.select_single(
108 photo_viewer.PopupPhotoViewer)
109 photo_viewer_popup.click_action_button("shareButton")
106 share_picker = self.photo_viewer.get_share_peer_picker()110 share_picker = self.photo_viewer.get_share_peer_picker()
107 self.assertThat(share_picker.visible, Eventually(Equals(True)))111 self.assertThat(share_picker.visible, Eventually(Equals(True)))
108 cancel_button = \112 self.main_view.get_header().click_back_button()
109 self.photo_viewer.get_content_peer_picker_cancel_button()
110 self.click_item(cancel_button)
111 self.assertThat(share_picker.visible, Eventually(Equals(False)))113 self.assertThat(share_picker.visible, Eventually(Equals(False)))
112114
113 def test_delete_photo_must_remove_it_from_filesystem(self):115 def test_delete_photo_must_remove_it_from_filesystem(self):
@@ -147,7 +149,9 @@
147149
148 def test_nav_bar_album_picker_button(self):150 def test_nav_bar_album_picker_button(self):
149 """Clicking the album picker must show the picker dialog."""151 """Clicking the album picker must show the picker dialog."""
150 self.main_view.get_header().click_action_button("addButton")152 photo_viewer_popup = self.main_view.select_single(
153 photo_viewer.PopupPhotoViewer)
154 photo_viewer_popup.click_action_button("addButton")
151 album_picker = self.photo_viewer.get_popup_album_picker()155 album_picker = self.photo_viewer.get_popup_album_picker()
152 self.assertThat(album_picker.visible, Eventually(Equals(True)))156 self.assertThat(album_picker.visible, Eventually(Equals(True)))
153157
@@ -228,7 +232,9 @@
228 self.media_view = self.app.select_single(MediaViewer)232 self.media_view = self.app.select_single(MediaViewer)
229233
230 def click_edit_button(self):234 def click_edit_button(self):
231 self.main_view.get_header().click_action_button("editButton")235 photo_viewer_popup = self.main_view.select_single(
236 photo_viewer.PopupPhotoViewer)
237 photo_viewer_popup.click_action_button("editButton")
232 photo_editor = self.photo_viewer.get_photo_editor()238 photo_editor = self.photo_viewer.get_photo_editor()
233 self.assertThat(photo_editor.visible, (Eventually(Equals(True))))239 self.assertThat(photo_editor.visible, (Eventually(Equals(True))))
234 self.assertThat(photo_editor.opacity, (Eventually(Equals(1))))240 self.assertThat(photo_editor.opacity, (Eventually(Equals(1))))
235241
=== modified file 'tests/autopilot/gallery_app/tests/test_photos_view.py'
--- tests/autopilot/gallery_app/tests/test_photos_view.py 2015-02-16 16:27:44 +0000
+++ tests/autopilot/gallery_app/tests/test_photos_view.py 2015-11-05 19:26:06 +0000
@@ -63,10 +63,9 @@
63 self.click_item(checkbox)63 self.click_item(checkbox)
6464
65 def check_header_button_exist(self, button):65 def check_header_button_exist(self, button):
66 header = self.main_view.get_header()66 buttonName = button + "_action_button"
67 buttonName = button + "_header_button"
68 try:67 try:
69 header.select_single(objectName=buttonName)68 self.main_view.select_single(objectName=buttonName)
70 except StateNotFoundError:69 except StateNotFoundError:
71 return False70 return False
72 return True71 return True

Subscribers

People subscribed via source and target branches