on xenial help sign in
merge trunk
commitb8e26ab45c9a1fa0337fd2002d047d6661f9d112 authorMichael Zanetti <michael.zanetti@canonical.com> dateThu 19 Dec 2013, 14:18 (13 years ago) parente9630e05a3f9f4
385 files changed+2451−822
.bzrignore+1−4 CMakeLists.txt+11−72 CODING+2−2 Notifications/Notification.qml−295 data/CMakeLists.txt+7 unity8.desktop.in → data/unity8.desktop.in data/unity8.override+1 debian/changelog+26 debian/unity8-autopilot.install+1 debian/unity8-private.install+1−1 include/CMakeLists.txt+1 paths.h.in → include/paths.h.in+42−3 plugins/CMakeLists.txt+1−1 plugins/ListViewWithPageHeader/CMakeLists.txt → plugins/DashViews/CMakeLists.txt+6−5 plugins/ListViewWithPageHeader/listviewwithpageheader.cpp → plugins/DashViews/listviewwithpageheader.cpp plugins/ListViewWithPageHeader/listviewwithpageheader.h → plugins/DashViews/listviewwithpageheader.h plugins/ListViewWithPageHeader/plugin.cpp → plugins/DashViews/plugin.cpp+4−2 plugins/ListViewWithPageHeader/plugin.h → plugins/DashViews/plugin.h+3−3 plugins/DashViews/qmldir+3 plugins/DashViews/verticaljournal.cpp+590 plugins/DashViews/verticaljournal.h+182 plugins/LightDM/CMakeLists.txt+1 plugins/LightDM/UsersModel.h+1−1 plugins/ListViewWithPageHeader/qmldir−3 plugins/Unity/Indicators/CMakeLists.txt−1 plugins/Unity/Indicators/Messaging/qml/MessageMenuItemFactory.qml+85−60 plugins/Unity/Indicators/Messaging/qml/SimpleTextMessage.qml+2−1 plugins/Unity/Indicators/Messaging/qml/SnapDecision.qml+2−2 plugins/Unity/Indicators/indicatorsmanager.cpp+1−1 plugins/Unity/Indicators/indicatorsmodel.cpp+4−3 plugins/Unity/Indicators/plugin.cpp−2 plugins/Unity/Indicators/qml/IndicatorPage.qml+18−4 plugins/Unity/Indicators/qml/MenuItemFactory.qml+138−85 plugins/Utils/CMakeLists.txt+1 plugins/Utils/plugin.cpp+3 plugins/Unity/Indicators/timeformatter.cpp → plugins/Utils/timeformatter.cpp+30−1 plugins/Unity/Indicators/timeformatter.h → plugins/Utils/timeformatter.h+15−3 po/ast.po+6−6 po/my.po+10−10 po/tr.po+7−7 Bottombar/Bottombar.qml → qml/Bottombar/Bottombar.qml Bottombar/HudButton.qml → qml/Bottombar/HudButton.qml Bottombar/graphics/hud@20.png → qml/Bottombar/graphics/hud@20.png Bottombar/graphics/hud_invoke_button_active@20.png → qml/Bottombar/graphics/hud_invoke_button_active@20.png qml/CMakeLists.txt+22 Components/AnimationControllerWithSignals.qml → qml/Components/AnimationControllerWithSignals.qml Components/ApplicationManagerWrapper.qml → qml/Components/ApplicationManagerWrapper.qml Components/ApplicationScreenshot.qml → qml/Components/ApplicationScreenshot.qml Components/ApplicationsModelStageFiltered.qml → qml/Components/ApplicationsModelStageFiltered.qml Components/BaseCarouselDelegate.qml → qml/Components/BaseCarouselDelegate.qml Components/Carousel.qml → qml/Components/Carousel.qml Components/Circle.qml → qml/Components/Circle.qml Components/DragHandle.qml → qml/Components/DragHandle.qml Components/DraggingArea.qml → qml/Components/DraggingArea.qml Components/EdgeDemo.qml → qml/Components/EdgeDemo.qml Components/EdgeDemoOverlay.qml → qml/Components/EdgeDemoOverlay.qml Components/EdgeDragArea.qml → qml/Components/EdgeDragArea.qml Components/EdgeDragEvaluator.qml → qml/Components/EdgeDragEvaluator.qml Components/FilterGrid.qml → qml/Components/FilterGrid.qml Components/LazyImage.qml → qml/Components/LazyImage.qml Components/ListItems/Base.qml → qml/Components/ListItems/Base.qml Components/ListItems/Header.qml → qml/Components/ListItems/Header.qml Components/ListItems/Highlight.qml → qml/Components/ListItems/Highlight.qml Components/ListItems/ThinDivider.qml → qml/Components/ListItems/ThinDivider.qml Components/ListItems/VerticalThinDivider.qml → qml/Components/ListItems/VerticalThinDivider.qml Components/ListItems/graphics/ListItemDividerHorizontal@18.png → qml/Components/ListItems/graphics/ListItemDividerHorizontal@18.png Components/ListItems/graphics/ListItemDividerVertical@18.png → qml/Components/ListItems/graphics/ListItemDividerVertical@18.png Components/OpenEffect.qml → qml/Components/OpenEffect.qml Components/PageHeader.qml → qml/Components/PageHeader.qml Components/PinPadButton.qml → qml/Components/PinPadButton.qml Components/RatingStars.qml → qml/Components/RatingStars.qml Components/ResponsiveFlowView.qml → qml/Components/ResponsiveFlowView.qml Components/ResponsiveGridView.qml → qml/Components/ResponsiveGridView.qml Components/Revealer.qml → qml/Components/Revealer.qml Components/SearchHistoryModel.qml → qml/Components/SearchHistoryModel.qml Components/Showable.qml → qml/Components/Showable.qml Components/Stage.qml → qml/Components/Stage.qml Components/StandardAnimation.qml → qml/Components/StandardAnimation.qml Components/Tile.qml → qml/Components/Tile.qml Components/TileStyle.qml → qml/Components/TileStyle.qml Components/UbuntuShapeForItem.qml → qml/Components/UbuntuShapeForItem.qml Components/VolumeControl.qml → qml/Components/VolumeControl.qml Components/WrongPasswordAnimation.qml → qml/Components/WrongPasswordAnimation.qml Components/carousel.js → qml/Components/carousel.js Components/graphics/PageHeaderBaseDivider@18.png → qml/Components/graphics/PageHeaderBaseDivider@18.png Components/graphics/PageHeaderBaseDivider@18.sci → qml/Components/graphics/PageHeaderBaseDivider@18.sci Components/graphics/close@20.png → qml/Components/graphics/close@20.png Components/graphics/icon_star_off@20.png → qml/Components/graphics/icon_star_off@20.png Components/graphics/icon_star_on@20.png → qml/Components/graphics/icon_star_on@20.png Components/graphics/non-selected@18.png → qml/Components/graphics/non-selected@18.png Components/graphics/non-selected@18.sci → qml/Components/graphics/non-selected@18.sci Dash/Apps/AppPreview.qml → qml/Dash/Apps/AppPreview.qml Dash/Apps/CloseIcon.qml → qml/Dash/Apps/CloseIcon.qml Dash/Apps/DashPluginFilterGrid.qml → qml/Dash/Apps/DashPluginFilterGrid.qml Dash/Apps/FrequentlyUsedAppsModel.qml → qml/Dash/Apps/FrequentlyUsedAppsModel.qml Dash/Apps/RunningApplicationTile.qml → qml/Dash/Apps/RunningApplicationTile.qml Dash/Apps/RunningApplicationsGrid.qml → qml/Dash/Apps/RunningApplicationsGrid.qml Dash/Apps/graphics/close_btn@9.png → qml/Dash/Apps/graphics/close_btn@9.png Dash/Dash.qml → qml/Dash/Dash.qml Dash/DashApps.qml → qml/Dash/DashApps.qml Dash/DashBar.qml → qml/Dash/DashBar.qml Dash/DashCarousel.qml → qml/Dash/DashCarousel.qml Dash/DashContent.qml → qml/Dash/DashContent.qml Dash/DashFilterGrid.qml → qml/Dash/DashFilterGrid.qml+3−2 Dash/DashHome.qml → qml/Dash/DashHome.qml Dash/DashPreview.qml → qml/Dash/DashPreview.qml Dash/DashPreviewPlaceholder.qml → qml/Dash/DashPreviewPlaceholder.qml Dash/DashRenderer.qml → qml/Dash/DashRenderer.qml+2−2 Dash/Generic/FlatTileStyle.qml → qml/Dash/Generic/FlatTileStyle.qml Dash/Generic/GenericCarousel.qml → qml/Dash/Generic/GenericCarousel.qml Dash/Generic/GenericFilterGrid.qml → qml/Dash/Generic/GenericFilterGrid.qml Dash/Generic/GenericFilterGridPotrait.qml → qml/Dash/Generic/GenericFilterGridPotrait.qml Dash/Generic/GenericPreview.qml → qml/Dash/Generic/GenericPreview.qml Dash/Generic/WeatherFilterGrid.qml → qml/Dash/Generic/WeatherFilterGrid.qml Dash/GenericScopeView.qml → qml/Dash/GenericScopeView.qml Dash/Movie/MoviePreview.qml → qml/Dash/Movie/MoviePreview.qml Dash/Music/CarouselDelegateMusic.qml → qml/Dash/Music/CarouselDelegateMusic.qml Dash/Music/MusicCarousel.qml → qml/Dash/Music/MusicCarousel.qml Dash/Music/MusicFilterGrid.qml → qml/Dash/Music/MusicFilterGrid.qml Dash/Music/MusicPreview.qml → qml/Dash/Music/MusicPreview.qml Dash/Music/MusicTileStyle.qml → qml/Dash/Music/MusicTileStyle.qml Dash/Music/graphics/music_progress_bg.png → qml/Dash/Music/graphics/music_progress_bg.png Dash/PreviewDelegateMapper.qml → qml/Dash/PreviewDelegateMapper.qml Dash/Previews/Header.qml → qml/Dash/Previews/Header.qml Dash/Previews/Reviews.qml → qml/Dash/Previews/Reviews.qml Dash/ScopeDelegateMapper.qml → qml/Dash/ScopeDelegateMapper.qml Dash/ScopeListView.qml → qml/Dash/ScopeListView.qml+1−1 Dash/SearchableResultModel.qml → qml/Dash/SearchableResultModel.qml Dash/Video/CarouselDelegateVideo.qml → qml/Dash/Video/CarouselDelegateVideo.qml Dash/Video/VideoCarousel.qml → qml/Dash/Video/VideoCarousel.qml Dash/Video/VideoFilterGrid.qml → qml/Dash/Video/VideoFilterGrid.qml Dash/Video/VideoTileStyle.qml → qml/Dash/Video/VideoTileStyle.qml Dash/Video/graphics/icon_button_amazon@20.png → qml/Dash/Video/graphics/icon_button_amazon@20.png Dash/Video/graphics/icon_button_u1@20.png → qml/Dash/Video/graphics/icon_button_u1@20.png Dash/Video/graphics/movie_icon_holder@27.png → qml/Dash/Video/graphics/movie_icon_holder@27.png Dash/graphics/header_handlearrow2@20.png → qml/Dash/graphics/header_handlearrow2@20.png Dash/graphics/header_handlearrow@20.png → qml/Dash/graphics/header_handlearrow@20.png Dash/graphics/icon_clear@20.png → qml/Dash/graphics/icon_clear@20.png Dash/graphics/icon_listview_clear@20.png → qml/Dash/graphics/icon_listview_clear@20.png Dash/graphics/icon_search_active@20.png → qml/Dash/graphics/icon_search_active@20.png Dash/graphics/icon_search_inactive@20.png → qml/Dash/graphics/icon_search_inactive@20.png Dash/graphics/phone/screenshots/browser@12.png → qml/Dash/graphics/phone/screenshots/browser@12.png Dash/graphics/phone/screenshots/camera@12.png → qml/Dash/graphics/phone/screenshots/camera@12.png Dash/graphics/phone/screenshots/facebook@12.png → qml/Dash/graphics/phone/screenshots/facebook@12.png Dash/graphics/phone/screenshots/gallery@12.png → qml/Dash/graphics/phone/screenshots/gallery@12.png Dash/graphics/phone/screenshots/map@12.png → qml/Dash/graphics/phone/screenshots/map@12.png Dash/graphics/phone/screenshots/music@12.png → qml/Dash/graphics/phone/screenshots/music@12.png Dash/graphics/phone/screenshots/phone@12.png → qml/Dash/graphics/phone/screenshots/phone@12.png Dash/graphics/phone/screenshots/settings@12.png → qml/Dash/graphics/phone/screenshots/settings@12.png Dash/graphics/phone/screenshots/twitter@12.png → qml/Dash/graphics/phone/screenshots/twitter@12.png Dash/graphics/play_button@18.png → qml/Dash/graphics/play_button@18.png Dash/graphics/play_button_active@18.png → qml/Dash/graphics/play_button_active@18.png Dash/graphics/play_button_active_big@20.png → qml/Dash/graphics/play_button_active_big@20.png Dash/graphics/play_button_big@20.png → qml/Dash/graphics/play_button_big@20.png Dash/graphics/tablet/icon_close_preview@20.png → qml/Dash/graphics/tablet/icon_close_preview@20.png Dash/graphics/tooltip_arrow@27.png → qml/Dash/graphics/tooltip_arrow@27.png Greeter/Clock.qml → qml/Greeter/Clock.qml Greeter/Dot.qml → qml/Greeter/Dot.qml Greeter/Gradient.js → qml/Greeter/Gradient.js Greeter/Greeter.qml → qml/Greeter/Greeter.qml Greeter/GreeterContent.qml → qml/Greeter/GreeterContent.qml Greeter/Infographics.qml → qml/Greeter/Infographics.qml Greeter/Lockscreen.qml → qml/Greeter/Lockscreen.qml+2−2 Greeter/LoginList.qml → qml/Greeter/LoginList.qml Greeter/ObjectPositioner.qml → qml/Greeter/ObjectPositioner.qml Greeter/PassphraseLockscreen.qml → qml/Greeter/PassphraseLockscreen.qml Greeter/PinLockscreen.qml → qml/Greeter/PinLockscreen.qml Greeter/graphics/dot_empty.png → qml/Greeter/graphics/dot_empty.png Greeter/graphics/dot_filled.png → qml/Greeter/graphics/dot_filled.png Greeter/graphics/dot_pointer.png → qml/Greeter/graphics/dot_pointer.png Greeter/graphics/icon_arrow.png → qml/Greeter/graphics/icon_arrow.png Greeter/graphics/infographic_circle_back.png → qml/Greeter/graphics/infographic_circle_back.png Hud/Hud.qml → qml/Hud/Hud.qml Hud/HudParametrizedActionsPage.qml → qml/Hud/HudParametrizedActionsPage.qml Hud/Result.qml → qml/Hud/Result.qml Hud/ResultList.qml → qml/Hud/ResultList.qml Hud/SearchBar.qml → qml/Hud/SearchBar.qml Hud/ShowingAnimation.qml → qml/Hud/ShowingAnimation.qml Hud/SliderLabel.qml → qml/Hud/SliderLabel.qml Hud/SoundAmplitudeDelegate.qml → qml/Hud/SoundAmplitudeDelegate.qml Hud/SoundAmplitudeVisual.qml → qml/Hud/SoundAmplitudeVisual.qml Hud/ToolBar.qml → qml/Hud/ToolBar.qml Hud/ToolBarIcon.qml → qml/Hud/ToolBarIcon.qml Hud/graphics/divider@20.png → qml/Hud/graphics/divider@20.png Hud/graphics/divider@20.sci → qml/Hud/graphics/divider@20.sci Hud/graphics/dropshadow_right@20.png → qml/Hud/graphics/dropshadow_right@20.png Hud/graphics/help@20.png → qml/Hud/graphics/help@20.png Hud/graphics/hud_bg@20.png → qml/Hud/graphics/hud_bg@20.png Hud/graphics/hud_handlearrow@20.png → qml/Hud/graphics/hud_handlearrow@20.png Hud/graphics/hud_handlebar@20.png → qml/Hud/graphics/hud_handlebar@20.png Hud/graphics/icon_arrow@20.png → qml/Hud/graphics/icon_arrow@20.png Hud/graphics/icon_clear@20.png → qml/Hud/graphics/icon_clear@20.png Hud/graphics/icon_search@20.png → qml/Hud/graphics/icon_search@20.png Hud/graphics/microphone@20.png → qml/Hud/graphics/microphone@20.png Hud/graphics/popup_triangle@20.png → qml/Hud/graphics/popup_triangle@20.png Hud/graphics/settings@20.png → qml/Hud/graphics/settings@20.png Hud/graphics/undo@20.png → qml/Hud/graphics/undo@20.png Hud/graphics/view-fullscreen@20.png → qml/Hud/graphics/view-fullscreen@20.png Launcher/FoldingLauncherDelegate.qml → qml/Launcher/FoldingLauncherDelegate.qml Launcher/Launcher.qml → qml/Launcher/Launcher.qml+3−3 Launcher/LauncherDelegate.qml → qml/Launcher/LauncherDelegate.qml Launcher/LauncherPanel.qml → qml/Launcher/LauncherPanel.qml+2−2 Launcher/graphics/focused_app_arrow@30.png → qml/Launcher/graphics/focused_app_arrow@30.png Launcher/graphics/highlight@18.png → qml/Launcher/graphics/highlight@18.png Launcher/graphics/home@18.png → qml/Launcher/graphics/home@18.png Launcher/graphics/launcher_bg@30.png → qml/Launcher/graphics/launcher_bg@30.png Launcher/graphics/launcher_bg@30.sci → qml/Launcher/graphics/launcher_bg@30.sci Launcher/graphics/non-selected@18.png → qml/Launcher/graphics/non-selected@18.png Launcher/graphics/non-selected@18.sci → qml/Launcher/graphics/non-selected@18.sci Launcher/graphics/notification@30.png → qml/Launcher/graphics/notification@30.png Launcher/graphics/notification@30.sci → qml/Launcher/graphics/notification@30.sci Launcher/graphics/progressbar-fill@30.png → qml/Launcher/graphics/progressbar-fill@30.png Launcher/graphics/progressbar-fill@30.sci → qml/Launcher/graphics/progressbar-fill@30.sci Launcher/graphics/progressbar-trough@30.png → qml/Launcher/graphics/progressbar-trough@30.png Launcher/graphics/progressbar-trough@30.sci → qml/Launcher/graphics/progressbar-trough@30.sci Launcher/graphics/quicklist_tooltip@30.png → qml/Launcher/graphics/quicklist_tooltip@30.png Launcher/graphics/selected@18.png → qml/Launcher/graphics/selected@18.png Launcher/graphics/selected@18.sci → qml/Launcher/graphics/selected@18.sci Launcher/graphics/triangle@18.png → qml/Launcher/graphics/triangle@18.png qml/Notifications/Notification.qml+325 Notifications/NotificationMenuItemFactory.qml → qml/Notifications/NotificationMenuItemFactory.qml+9−2 Notifications/Notifications.qml → qml/Notifications/Notifications.qml+3−1 Notifications/ShapedIcon.qml → qml/Notifications/ShapedIcon.qml Panel/IndicatorItem.qml → qml/Panel/IndicatorItem.qml Panel/IndicatorRow.qml → qml/Panel/IndicatorRow.qml Panel/Indicators.qml → qml/Panel/Indicators.qml Panel/Indicators/DefaultIndicatorPage.qml → qml/Panel/Indicators/DefaultIndicatorPage.qml Panel/Indicators/DefaultIndicatorWidget.qml → qml/Panel/Indicators/DefaultIndicatorWidget.qml Panel/Indicators/client/IndicatorsClient.qml → qml/Panel/Indicators/client/IndicatorsClient.qml Panel/Indicators/client/IndicatorsList.qml → qml/Panel/Indicators/client/IndicatorsList.qml Panel/Indicators/client/IndicatorsPage.qml → qml/Panel/Indicators/client/IndicatorsPage.qml Panel/Indicators/client/IndicatorsTree.qml → qml/Panel/Indicators/client/IndicatorsTree.qml Panel/MenuContent.qml → qml/Panel/MenuContent.qml Panel/Panel.qml → qml/Panel/Panel.qml+22 Panel/PanelBackground.qml → qml/Panel/PanelBackground.qml Panel/PanelSeparatorLine.qml → qml/Panel/PanelSeparatorLine.qml Panel/SearchIndicator.qml → qml/Panel/SearchIndicator.qml Panel/graphics/Battery@18.png → qml/Panel/graphics/Battery@18.png Panel/graphics/Bluetooth@18.png → qml/Panel/graphics/Bluetooth@18.png Panel/graphics/Clock@18.png → qml/Panel/graphics/Clock@18.png Panel/graphics/Location@18.png → qml/Panel/graphics/Location@18.png Panel/graphics/Messages@18.png → qml/Panel/graphics/Messages@18.png Panel/graphics/Network@18.png → qml/Panel/graphics/Network@18.png Panel/graphics/Sound@18.png → qml/Panel/graphics/Sound@18.png Panel/graphics/Sync@18.png → qml/Panel/graphics/Sync@18.png Panel/graphics/System@18.png → qml/Panel/graphics/System@18.png Panel/graphics/Time@18.png → qml/Panel/graphics/Time@18.png Panel/graphics/VerticalDivider@18.png → qml/Panel/graphics/VerticalDivider@18.png Panel/graphics/handle@12.png → qml/Panel/graphics/handle@12.png Panel/graphics/handle@12.sci → qml/Panel/graphics/handle@12.sci Panel/graphics/rectangular_dropshadow@30.png → qml/Panel/graphics/rectangular_dropshadow@30.png Panel/graphics/rectangular_dropshadow@30.sci → qml/Panel/graphics/rectangular_dropshadow@30.sci Panel/graphics/search@12.png → qml/Panel/graphics/search@12.png Panel/graphics/time_and_date@18.png → qml/Panel/graphics/time_and_date@18.png Shell.qml → qml/Shell.qml+11−5 SideStage/SideStage.qml → qml/SideStage/SideStage.qml SideStage/SidestageHandle.qml → qml/SideStage/SidestageHandle.qml SideStage/graphics/sidestage_handle@20.png → qml/SideStage/graphics/sidestage_handle@20.png SideStage/graphics/sidestage_handle@20.sci → qml/SideStage/graphics/sidestage_handle@20.sci graphics/12_10_background_wide@12.png → qml/graphics/12_10_background_wide@12.png graphics/applicationIcons/browser@18.png → qml/graphics/applicationIcons/browser@18.png graphics/applicationIcons/calendar@18.png → qml/graphics/applicationIcons/calendar@18.png graphics/applicationIcons/camera@18.png → qml/graphics/applicationIcons/camera@18.png graphics/applicationIcons/contacts-app@18.png → qml/graphics/applicationIcons/contacts-app@18.png graphics/applicationIcons/dash@18.png → qml/graphics/applicationIcons/dash@18.png graphics/applicationIcons/evernote@18.png → qml/graphics/applicationIcons/evernote@18.png graphics/applicationIcons/facebook@18.png → qml/graphics/applicationIcons/facebook@18.png graphics/applicationIcons/gallery@18.png → qml/graphics/applicationIcons/gallery@18.png graphics/applicationIcons/gmail@18.png → qml/graphics/applicationIcons/gmail@18.png graphics/applicationIcons/map@18.png → qml/graphics/applicationIcons/map@18.png graphics/applicationIcons/messages-app@18.png → qml/graphics/applicationIcons/messages-app@18.png graphics/applicationIcons/notepad@18.png → qml/graphics/applicationIcons/notepad@18.png graphics/applicationIcons/phone-app@18.png → qml/graphics/applicationIcons/phone-app@18.png graphics/applicationIcons/pinterest@18.png → qml/graphics/applicationIcons/pinterest@18.png graphics/applicationIcons/soundcloud@18.png → qml/graphics/applicationIcons/soundcloud@18.png graphics/applicationIcons/system-settings@18.png → qml/graphics/applicationIcons/system-settings@18.png graphics/applicationIcons/twitter@18.png → qml/graphics/applicationIcons/twitter@18.png graphics/applicationIcons/weather@18.png → qml/graphics/applicationIcons/weather@18.png graphics/applicationIcons/wikipedia@18.png → qml/graphics/applicationIcons/wikipedia@18.png graphics/applicationIcons/youtube@18.png → qml/graphics/applicationIcons/youtube@18.png graphics/avatars/amanda@12.png → qml/graphics/avatars/amanda@12.png graphics/avatars/anna_olsson@12.png → qml/graphics/avatars/anna_olsson@12.png graphics/avatars/funky@12.png → qml/graphics/avatars/funky@12.png graphics/clock@18.png → qml/graphics/clock@18.png graphics/phone_background.jpg → qml/graphics/phone_background.jpg graphics/tablet_background.jpg → qml/graphics/tablet_background.jpg run+1−1 runtests.sh+1−13 ApplicationArguments.h → src/ApplicationArguments.h src/CMakeLists.txt+27 MouseTouchAdaptor.cpp → src/MouseTouchAdaptor.cpp MouseTouchAdaptor.h → src/MouseTouchAdaptor.h src/Panel/Indicators/client/CMakeLists.txt−4 src/Panel/Indicators/client/indicatorsclient.cpp+3−37 main.cpp → src/main.cpp+3−43 tests/autopilot/.project+17 tests/autopilot/.pydevproject+8 tests/autopilot/unity8/application_lifecycle/tests/test_application_lifecycle.py+7−6 tests/autopilot/unity8/process_helpers.py+17−1 tests/autopilot/unity8/shell/tests/test_lock_screen.py+9−8 tests/autopilot/unity8/shell/tests/test_notifications.py+1−1 tests/mocks/LightDM/CMakeLists.txt+1 tests/mocks/LightDM/demo/CMakeLists.txt−1 tests/mocks/Unity/Application/ApplicationManager.cpp+4−3 tests/mocks/Unity/Application/CMakeLists.txt−1 tests/mocks/Unity/Launcher/CMakeLists.txt−1 tests/mocks/Unity/fake_scope.cpp+2−2 tests/mocks/libusermetrics/CMakeLists.txt+4 tests/mocks/libusermetrics/UserMetrics.cpp+1−1 tests/plugins/AccountsService/CMakeLists.txt+6−1 tests/plugins/CMakeLists.txt+1−1 tests/plugins/ListViewWithPageHeader/CMakeLists.txt → tests/plugins/DashViews/CMakeLists.txt+16−5 tests/plugins/ListViewWithPageHeader/listviewwithpageheadertest.cpp → tests/plugins/DashViews/listviewwithpageheadertest.cpp+1−1 tests/plugins/ListViewWithPageHeader/test.qml → tests/plugins/DashViews/listviewwithpageheadertest.qml+1−1 tests/plugins/ListViewWithPageHeader/listviewwithpageheadertestsection.cpp → tests/plugins/DashViews/listviewwithpageheadertestsection.cpp+1−1 tests/plugins/ListViewWithPageHeader/test_section.qml → tests/plugins/DashViews/listviewwithpageheadertestsection.qml+1−1 tests/plugins/ListViewWithPageHeader/listviewwithpageheadertestsectionexternalmodel.cpp → tests/plugins/DashViews/listviewwithpageheadertestsectionexternalmodel.cpp+1−1 tests/plugins/ListViewWithPageHeader/test_sectionexternalmodel.qml → tests/plugins/DashViews/listviewwithpageheadertestsectionexternalmodel.qml+1−1 tests/plugins/ListViewWithPageHeader/tst_listviewwithpageheaderqml.qml → tests/plugins/DashViews/tst_listviewwithpageheaderqml.qml+1−1 tests/plugins/DashViews/verticaljournaltest.cpp+315 tests/plugins/DashViews/verticaljournaltest.qml+44 tests/plugins/DashViews/verticaljournaltry.cpp+90 tests/plugins/DashViews/verticaljournaltry.qml+100 tests/plugins/Ubuntu/Gestures/CMakeLists.txt+1 tests/plugins/Unity/Indicators/CMakeLists.txt−1 tests/plugins/Unity/Indicators/indicatorsmanagertest.cpp+2−1 tests/plugins/Unity/Indicators/indicatorsmodeltest.cpp+2−1 tests/plugins/Unity/Indicators/menucontentactivatortest.cpp−1 tests/plugins/Unity/Indicators/unitymenumodelstacktest.cpp−1 tests/plugins/Unity/Launcher/launchermodeltest.cpp+1 tests/plugins/Utils/CMakeLists.txt+1 tests/plugins/Unity/Indicators/timeformattertest.cpp → tests/plugins/Utils/timeformattertest.cpp+13 tests/qmltests/Components/CMakeLists.txt+1 tests/qmltests/Components/RevealingRectangle.qml+1−1 tests/qmltests/Components/tst_AnimationControllerWithSignals.qml+1−1 tests/qmltests/Components/tst_Carousel.qml+1−1 tests/qmltests/Components/tst_DragHandle.qml+1−1 tests/qmltests/Components/tst_DragHandle/HorizontalShowable.qml+1−1 tests/qmltests/Components/tst_DragHandle/VerticalShowable.qml+1−1 tests/qmltests/Components/tst_DraggingArea.qml+1−1 tests/qmltests/Components/tst_EdgeDemoOverlay.qml+1−1 tests/qmltests/Components/tst_FilterGrid.qml+1−1 tests/qmltests/Components/tst_LazyImage.qml+1−1 tests/qmltests/Components/tst_LazyImage/ImageControls.qml+1−1 tests/qmltests/Components/tst_OpenEffect.qml+1−1 tests/qmltests/Components/tst_PageHeader.qml+1−1 tests/qmltests/Components/tst_RatingStars.qml+1−1 tests/qmltests/Components/tst_ResponsiveFlowView.qml+1−1 tests/qmltests/Components/tst_ResponsiveGridView.qml+1−1 tests/qmltests/Components/tst_Showable.qml+1−1 tests/qmltests/Components/tst_Stage.qml+1−1 tests/qmltests/Components/tst_Tile.qml+1−1 tests/qmltests/Dash/Apps/tst_AppPreview.qml+1−1 tests/qmltests/Dash/Apps/tst_RunningApplicationsGrid.qml+1−1 tests/qmltests/Dash/Movie/tst_MoviePreview.qml+1−1 tests/qmltests/Dash/Music/tst_MusicPreview.qml+1−1 tests/qmltests/Dash/qml/FakeScopeView.qml+1−1 tests/qmltests/Dash/tst_Dash.qml+6−6 tests/qmltests/Dash/tst_DashBar.qml+1−1 tests/qmltests/Dash/tst_DashContent.qml+6−6 tests/qmltests/Dash/tst_DashPreview.qml+1−1 tests/qmltests/Dash/tst_FilterGrids.qml+3−3 tests/qmltests/Dash/tst_GenericPreview.qml+1−1 tests/qmltests/Dash/tst_GenericScopeView.qml+35−5 tests/qmltests/Greeter/tst_Clock.qml+1−1 tests/qmltests/Greeter/tst_Infographics.qml+1−1 tests/qmltests/Greeter/tst_Lockscreen.qml+1−1 tests/qmltests/Greeter/tst_Phone.qml+3−3 tests/qmltests/Greeter/tst_Tablet.qml+1−1 tests/qmltests/Hud/tst_Hud.qml+1−1 tests/qmltests/Hud/tst_Result.qml+1−1 tests/qmltests/Launcher/tst_Launcher.qml+7−7 tests/qmltests/Notifications/tst_Notifications.qml+4−5 tests/qmltests/Panel/Indicators/tst_DefaultIndicatorWidget.qml+1−1 tests/qmltests/Panel/tst_IndicatorItem.qml+1−1 tests/qmltests/Panel/tst_IndicatorRow.qml+1−1 tests/qmltests/Panel/tst_Indicators.qml+2−2 tests/qmltests/Panel/tst_MenuContent.qml+1−1 tests/qmltests/Panel/tst_Panel.qml+15−1 tests/qmltests/Panel/tst_SearchIndicator.qml+1−1 tests/qmltests/SideStage/tst_SideStage.qml+1−1 tests/qmltests/tst_Shell.qml+3−3 tests/uqmlscene/CMakeLists.txt+6−1 tests/uqmlscene/main.cpp+1−1 tests/utils/modules/Unity/Test/CMakeLists.txt+4
.bzrignore+1−4
@@ -3,8 +3,5 @@
33# QtCreator project files
44/*.user
55# Eclipse project files
6−/.project
7−/.cproject
8−/.settings
9−/.pydevproject
6+.settings
107message.txt
CMakeLists.txt+11−72
@@ -69,17 +69,6 @@ if(SHELL_PLUGINDIR STREQUAL "")
6969 message(FATAL_ERROR "Could not determine plugin import dir.")
7070endif()
7171
72−configure_file(paths.h.in ${CMAKE_CURRENT_BINARY_DIR}/paths.h @ONLY)
73−
74−pkg_check_modules(UNITY-MIR REQUIRED unity-mir)
75−
76−include_directories(
77− ${CMAKE_CURRENT_BINARY_DIR}
78− ${CMAKE_CURRENT_SOURCE_DIR}
79− ${Qt5Gui_PRIVATE_INCLUDE_DIRS}
80− ${UNITY-MIR_INCLUDE_DIRS}
81− )
82−
8372set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
8473
8574set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fno-permissive -pedantic -Wall -Wextra")
@@ -108,72 +97,22 @@ declare_autopilot_test(shell unity8.shell ${CMAKE_SOURCE_DIR}/tests/autopilot/)
10897
10998set(SHELL_APP unity8)
11099
111−set(shell_app_HDRS
112− )
113−
114−add_executable(${SHELL_APP}
115− ${shellapplication_MOC_SRCS}
116− ApplicationArguments.h
117− main.cpp
118− MouseTouchAdaptor.cpp
119− )
120−
121−qt5_use_modules(${SHELL_APP} Qml Quick Test)
122−pkg_check_modules(XCB REQUIRED xcb)
123−
124−if (NOT "${XCB_INCLUDE_DIRS}" STREQUAL "")
125− set_target_properties(${SHELL_APP} PROPERTIES INCLUDE_DIRECTORIES ${XCB_INCLUDE_DIRS})
126−endif()
127−
128−target_link_libraries(${SHELL_APP}
129− ${Qt5Qml_LIBRARIES}
130− ${Qt5Quick_LIBRARIES}
131− ${XCB_LDFLAGS}
132− ${CMAKE_DL_LIBS}
133− )
134−
135−# install binaries
136−install(TARGETS ${SHELL_APP}
137− RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
138− )
139−
140−# install top level qml and js files
141−file(GLOB QML_JS_FILES *.qml *.js)
142−
143−install(FILES ${QML_JS_FILES}
144− DESTINATION ${SHELL_APP_DIR}
145− )
100+include_directories(
101+ ${CMAKE_SOURCE_DIR}/include
102+ ${CMAKE_BINARY_DIR}/include
103+)
146104
147105# add subdirectories to build
106+add_subdirectory(include)
107+add_subdirectory(src)
108+add_subdirectory(qml)
148109add_subdirectory(tests)
149110add_subdirectory(plugins)
150−add_subdirectory(src)
151111
152−# install subdirectories
153−set(QML_DIRS
154− Bottombar
155− Components
156− Dash
157− graphics
158− Greeter
159− Hud
160− Panel
161− Launcher
162− SideStage
163− Notifications
164− )
165−
166−install(DIRECTORY ${QML_DIRS}
167− DESTINATION ${SHELL_APP_DIR}
168− )
169−
170−# generate desktop file
171−configure_file(${SHELL_APP}.desktop.in ${CMAKE_CURRENT_BINARY_DIR}/${SHELL_APP}.desktop @ONLY)
172−
173−# install desktop file
174−install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${SHELL_APP}.desktop
175− DESTINATION ${CMAKE_INSTALL_DATADIR}/applications
176− )
112+#
113+# Data files
114+#
115+add_subdirectory(data)
177116
178117#
179118# Translation
CODING+2−2
@@ -1,7 +1,7 @@
11Building Unity 8
22================
33
4−Only Ubuntu 13.10 (saucy) is supported as a developement environment.
4+Only Ubuntu 14.04 (trusty) is supported as a developement environment.
55
66download source
77---------------
@@ -68,7 +68,7 @@ Notes
6868
6969Running Unity 8 on devices
7070==========================
71−- Ubuntu Touch builds are currently only available in 13.10 flavour
71+- Ubuntu Touch builds are currently only available in 14.04 flavour
7272- supported hardware should match one of those listed here
7373 https://wiki.ubuntu.com/Touch/Devices#Running_fine
7474- follow the Ubuntu Touch install instructions for your chosen device
Notifications/Notification.qmldeleted−295
@@ -1,295 +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 as published by
6− * the Free Software Foundation; version 3.
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−
17−import QtQuick 2.0
18−import Ubuntu.Components 0.1
19−import Unity.Notifications 1.0
20−import QMenuModel 0.1
21−import Utils 0.1
22−
23−UbuntuShape {
24− id: notification
25−
26− property alias iconSource: icon.fileSource
27− property alias secondaryIconSource: secondaryIcon.source
28− property alias summary: summaryLabel.text
29− property alias body: bodyLabel.text
30− property var actions
31− property var notificationId
32− property var type
33− property var hints
34− property var notification
35−
36− objectName: "background"
37− implicitHeight: type != Notification.PlaceHolder ? contentColumn.height + contentColumn.spacing * 2 : 0
38− color: Qt.rgba(0.132, 0.117, 0.109, 0.97)
39− opacity: 0
40− radius: "medium"
41−
42− clip: true
43− visible: type != Notification.PlaceHolder
44−
45− UnityMenuModelPaths {
46− id: paths
47−
48− source: hints["x-canonical-private-menu-model"]
49−
50− busNameHint: "busName"
51− actionsHint: "actions"
52− menuObjectPathHint: "menuPath"
53− }
54−
55− UnityMenuModel {
56− id: unityMenuModel
57−
58− busName: paths.busName
59− actions: paths.actions
60− menuObjectPath: paths.menuObjectPath
61− }
62−
63− Behavior on implicitHeight {
64− id: heightBehavior
65−
66− enabled: false
67− UbuntuNumberAnimation {
68− duration: UbuntuAnimation.SnapDuration
69− }
70− }
71−
72− // delay enabling height behavior until the add transition is complete
73− onOpacityChanged: if (opacity == 1) heightBehavior.enabled = true
74−
75− MouseArea {
76− id: interactiveArea
77−
78− anchors.fill: contentColumn
79− objectName: "interactiveArea"
80− enabled: notification.type == Notification.Interactive
81− onClicked: notification.notification.invokeAction(actionRepeater.itemAt(0).actionId)
82− }
83−
84− Column {
85− id: contentColumn
86−
87− anchors {
88− left: parent.left
89− right: parent.right
90− top: parent.top
91− margins: spacing
92− }
93−
94− spacing: units.gu(1)
95−
96− Row {
97− id: topRow
98−
99− spacing: contentColumn.spacing
100− anchors {
101− left: parent.left
102− right: parent.right
103− }
104−
105− ShapedIcon {
106− id: icon
107−
108− objectName: "icon"
109− width: units.gu(6)
110− height: units.gu(6)
111− shaped: notification.hints["x-canonical-non-shaped-icon"] == "true" ? false : true
112− visible: iconSource !== undefined && iconSource != ""
113− }
114−
115− Image {
116− id: secondaryIcon
117−
118− objectName: "secondaryIcon"
119− width: units.gu(2)
120− height: units.gu(2)
121− visible: source !== undefined && source != ""
122− fillMode: Image.PreserveAspectCrop
123− }
124−
125− Column {
126− id: labelColumn
127− width: parent.width - x
128−
129− anchors.verticalCenter: (icon.visible && !bodyLabel.visible) ? icon.verticalCenter : undefined
130−
131− Label {
132− id: summaryLabel
133−
134− objectName: "summaryLabel"
135− anchors {
136− left: parent.left
137− right: parent.right
138− }
139− fontSize: "medium"
140− font.bold: true
141− color: Theme.palette.selected.backgroundText
142− elide: Text.ElideRight
143− }
144−
145− Label {
146− id: bodyLabel
147−
148− objectName: "bodyLabel"
149− anchors {
150− left: parent.left
151− right: parent.right
152− }
153− visible: body != ""
154− fontSize: "small"
155− color: Theme.palette.selected.backgroundText
156− opacity: 0.6
157− wrapMode: Text.WordWrap
158− maximumLineCount: 10
159− elide: Text.ElideRight
160− }
161− }
162− }
163−
164− Column {
165− objectName: "dialogListView"
166− spacing: units.gu(2)
167−
168− visible: count > 0
169−
170− anchors.left: parent.left; anchors.right: parent.right
171−
172− Repeater {
173− model: unityMenuModel
174−
175− NotificationMenuItemFactory {
176− anchors.left: parent.left; anchors.right: parent.right
177−
178− menuModel: unityMenuModel
179− menuData: model
180− menuIndex: index
181− }
182− }
183− }
184−
185− Item {
186− id: buttonRow
187−
188− objectName: "buttonRow"
189− anchors {
190− left: parent.left
191− right: parent.right
192− }
193− visible: notification.type == Notification.SnapDecision && actionRepeater.count > 0
194− height: units.gu(5)
195−
196− property real buttonWidth: (width - contentColumn.spacing) / 2
197− property bool expanded
198−
199− Button {
200− id: leftButton
201−
202− objectName: "button1"
203− width: parent.expanded ? parent.width : parent.buttonWidth
204− anchors {
205− top: parent.top
206− bottom: parent.bottom
207− }
208− text: notification.type == Notification.SnapDecision && actionRepeater.count >= 2 ? actionRepeater.itemAt(1).actionLabel : ""
209− gradient: UbuntuColors.greyGradient
210− onClicked: {
211− if (actionRepeater.count > 2) {
212− buttonRow.expanded = !buttonRow.expanded
213− } else {
214− notification.notification.invokeAction(actionRepeater.itemAt(1).actionId)
215− }
216− }
217−
218− Behavior on width {
219− UbuntuNumberAnimation {
220− duration: UbuntuAnimation.SnapDuration
221− }
222− }
223− }
224−
225− Button {
226− id: rightButton
227−
228− objectName: "button0"
229− anchors {
230− left: leftButton.right
231− leftMargin: contentColumn.spacing
232− right: parent.right
233− }
234− text: notification.type == Notification.SnapDecision && actionRepeater.count >= 1 ? actionRepeater.itemAt(0).actionLabel : ""
235− anchors {
236− top: parent.top
237− bottom: parent.bottom
238− }
239− gradient: notification.hints["x-canonical-private-button-tint"] == "true" ? UbuntuColors.orangeGradient : UbuntuColors.greyGradient
240− visible: width > 0
241− onClicked: notification.notification.invokeAction(actionRepeater.itemAt(0).actionId)
242− }
243− }
244−
245− Column {
246− objectName: "buttonColumn"
247− spacing: contentColumn.spacing
248− anchors {
249− left: parent.left
250− right: parent.right
251− }
252−
253− // calculate initial position before Column takes over
254− y: buttonRow.y + buttonRow.height + contentColumn.spacing
255−
256− visible: notification.type == Notification.SnapDecision
257− height: buttonRow.expanded ? implicitHeight : 0
258−
259− Repeater {
260− id: actionRepeater
261−
262− model: notification.actions
263− delegate: Loader {
264− id: loader
265−
266− property string actionId: id
267− property string actionLabel: label
268−
269− anchors {
270− left: parent.left
271− right: parent.right
272− }
273−
274− Component {
275− id: actionButton
276−
277− Button {
278− objectName: "button" + index
279− anchors {
280− left: parent.left
281− right: parent.right
282− }
283−
284− text: loader.actionLabel
285− height: units.gu(5)
286− gradient: UbuntuColors.greyGradient
287− onClicked: notification.notification.invokeAction(loader.actionId)
288− }
289− }
290− sourceComponent: (index == 0 || index == 1) ? undefined : actionButton
291− }
292− }
293− }
294− }
295−}
data/CMakeLists.txtnew file+7
@@ -0,0 +1,7 @@
1+# generate desktop file
2+configure_file(${SHELL_APP}.desktop.in ${CMAKE_CURRENT_BINARY_DIR}/${SHELL_APP}.desktop @ONLY)
3+
4+# install desktop file
5+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${SHELL_APP}.desktop
6+ DESTINATION ${CMAKE_INSTALL_DATADIR}/applications
7+ )
unity8.desktop.in → data/unity8.desktop.inrenamed

The content is the same.

data/unity8.overridenew file+1
@@ -0,0 +1 @@
1+kill timeout 30
debian/changelog+26
@@ -1,3 +1,29 @@
1+unity8 (7.84+14.04.20131212-0ubuntu1) trusty; urgency=low
2+
3+ [ Michał Sawicz ]
4+ * Add PyDev project files for autopilot tests. Also tweak .bzrignore
5+ to not ignore generic Eclipse project definitions.
6+ * Retry unlocking the greeter three times.
7+ * Reduce code duplication and clean up CMakeLists and includes in
8+ indicator tests.
9+
10+ [ Nick Dedekind ]
11+ * Replaced indicator page dynamic menuSelected binding with Connection
12+ to listview selectedIndex property. (LP: #1243146)
13+ * Indicators close when menu items are activated. (LP: #1238182)
14+ * Fixed up connections for changes to model data. (LP: #1253810)
15+
16+ [ Albert Astals ]
17+ * dashItemSelected -> showDashHome Because we are not using the index
18+ at all in the upper layers.
19+ * Fix filtering colllapsing/expanding again Also the delegate creation
20+ range stuff flows up->down not down->up so rearrange the bindings.
21+
22+ [ Ubuntu daily release ]
23+ * Automatic snapshot from revision 590
24+
25+ -- Ubuntu daily release <ps-jenkins@lists.canonical.com> Thu, 12 Dec 2013 21:41:19 +0000
26+
127unity8 (7.84+14.04.20131206.1-0ubuntu1) trusty; urgency=low
228
329 [ Michal Hruby ]
debian/unity8-autopilot.install+1
@@ -1 +1,2 @@
11usr/lib/python*/*/unity*
2+data/unity8.override usr/share/upstart/sessions
debian/unity8-private.install+1−1
@@ -1,7 +1,7 @@
11usr/lib/*/unity8/qml/AccountsService
22usr/lib/*/unity8/qml/HudClient
33usr/lib/*/unity8/qml/LightDM
4−usr/lib/*/unity8/qml/ListViewWithPageHeader
4+usr/lib/*/unity8/qml/DashViews
55usr/lib/*/unity8/qml/Powerd
66usr/lib/*/unity8/qml/SessionBroadcast
77usr/lib/*/unity8/qml/Ubuntu
include/CMakeLists.txtnew file+1
@@ -0,0 +1 @@
1+configure_file(paths.h.in ${CMAKE_CURRENT_BINARY_DIR}/paths.h @ONLY)
paths.h.in → include/paths.h.inrenamed+42−3
@@ -23,6 +23,8 @@
2323// Qt
2424#include <QtCore/QCoreApplication>
2525#include <QtCore/QDir>
26+#include <QtGui/QIcon>
27+#include <QtQml/QQmlEngine>
2628#include <QStandardPaths>
2729
2830inline bool isRunningInstalled() {
@@ -39,11 +41,11 @@ inline QString translationDirectory() {
3941 }
4042}
4143
42−inline QString shellAppDirectory() {
44+inline QString qmlDirectory() {
4345 if (isRunningInstalled()) {
4446 return QString("@CMAKE_INSTALL_PREFIX@/@SHELL_APP_DIR@/");
4547 } else {
46− return QString("@CMAKE_SOURCE_DIR@/");
48+ return QString("@CMAKE_SOURCE_DIR@/qml/");
4749 }
4850}
4951
@@ -77,7 +79,7 @@ inline QStringList shellDataDirs() {
7779 }
7880 else {
7981 // append so by default we use xdg files.
80− dirs.append(shellAppDirectory());
82+ dirs.append(qmlDirectory());
8183 }
8284 return dirs;
8385}
@@ -86,4 +88,41 @@ inline QString sourceDirectory() {
8688 return QString("@CMAKE_SOURCE_DIR@/");
8789}
8890
91+inline void prependImportPaths(QQmlEngine *engine, const QStringList &paths)
92+{
93+ QStringList importPathList = engine->importPathList();
94+ for (int i = paths.count() -1; i >= 0; i--) {
95+ // don't duplicate
96+ const QString& path = paths[i];
97+ QStringList::iterator iter = qFind(importPathList.begin(), importPathList.end(), path);
98+ if (iter == importPathList.end()) {
99+ engine->addImportPath(path);
100+ }
101+ }
102+}
103+
104+/* When you append and import path to the list of import paths it will be the *last*
105+ place where Qt will search for QML modules.
106+ The usual QQmlEngine::addImportPath() actually prepends the given path.*/
107+inline void appendImportPaths(QQmlEngine *engine, const QStringList &paths)
108+{
109+ QStringList importPathList = engine->importPathList();
110+ Q_FOREACH(const QString& path, paths) {
111+ // don't duplicate
112+ QStringList::iterator iter = qFind(importPathList.begin(), importPathList.end(), path);
113+ if (iter == importPathList.end()) {
114+ importPathList.append(path);
115+ }
116+ }
117+ engine->setImportPathList(importPathList);
118+}
119+
120+inline void resolveIconTheme() {
121+ const char *ubuntuIconTheme = getenv("UBUNTU_ICON_THEME");
122+ if (ubuntuIconTheme == NULL) {
123+ ubuntuIconTheme = "ubuntu-mobile";
124+ }
125+ QIcon::setThemeName(ubuntuIconTheme);
126+}
127+
89128#endif
plugins/CMakeLists.txt+1−1
@@ -1,7 +1,7 @@
11add_subdirectory(AccountsService)
22add_subdirectory(HudClient)
33add_subdirectory(LightDM)
4−add_subdirectory(ListViewWithPageHeader)
4+add_subdirectory(DashViews)
55add_subdirectory(Powerd)
66add_subdirectory(SessionBroadcast)
77add_subdirectory(Ubuntu)
plugins/ListViewWithPageHeader/CMakeLists.txt → plugins/DashViews/CMakeLists.txtrenamed+6−5
@@ -24,19 +24,20 @@ remove_definitions(-DQT_NO_KEYWORDS)
2424set(QMLPLUGIN_SRC
2525 plugin.cpp
2626 listviewwithpageheader.cpp
27+ verticaljournal.cpp
2728 )
2829
29−add_library(ListViewWithPageHeader-qml MODULE
30+add_library(DashViews-qml MODULE
3031 ${QMLPLUGIN_SRC}
3132 )
3233
33−target_link_libraries(ListViewWithPageHeader-qml
34+target_link_libraries(DashViews-qml
3435 ${Qt5Gui_LIBRARIES}
3536 ${Qt5Quick_LIBRARIES}
3637 )
3738
38−qt5_use_modules(ListViewWithPageHeader-qml Qml Quick)
39+qt5_use_modules(DashViews-qml Qml Quick)
3940
4041# export the qmldir qmltypes and plugin files
41−export_qmlfiles(ListViewWithPageHeader ListViewWithPageHeader)
42−export_qmlplugin(ListViewWithPageHeader 0.1 ListViewWithPageHeader TARGETS ListViewWithPageHeader-qml)
42+export_qmlfiles(DashViews DashViews)
43+export_qmlplugin(DashViews 0.1 DashViews TARGETS DashViews-qml)
plugins/ListViewWithPageHeader/listviewwithpageheader.cpp → plugins/DashViews/listviewwithpageheader.cpprenamed

The content is the same.

plugins/ListViewWithPageHeader/listviewwithpageheader.h → plugins/DashViews/listviewwithpageheader.hrenamed

The content is the same.

plugins/ListViewWithPageHeader/plugin.cpp → plugins/DashViews/plugin.cpprenamed+4−2
@@ -18,12 +18,14 @@
1818#include "plugin.h"
1919
2020#include "listviewwithpageheader.h"
21+#include "verticaljournal.h"
2122
2223#include <QAbstractItemModel>
2324
24−void ListViewWithPageHeaderPlugin::registerTypes(const char *uri)
25+void DashViewsPlugin::registerTypes(const char *uri)
2526{
26− Q_ASSERT(uri == QLatin1String("ListViewWithPageHeader"));
27+ Q_ASSERT(uri == QLatin1String("DashViews"));
2728 qmlRegisterType<QAbstractItemModel>();
2829 qmlRegisterType<ListViewWithPageHeader>(uri, 0, 1, "ListViewWithPageHeader");
30+ qmlRegisterType<VerticalJournal>(uri, 0, 1, "VerticalJournal");
2931}
plugins/ListViewWithPageHeader/plugin.h → plugins/DashViews/plugin.hrenamed+3−3
@@ -15,13 +15,13 @@
1515 *
1616 */
1717
18−#ifndef LISTVIEWWITHPAGEHEADER_PLUGIN_H
19−#define LISTVIEWWITHPAGEHEADER_PLUGIN_H
18+#ifndef DASHVIEWS_PLUGIN_H
19+#define DASHVIEWS_PLUGIN_H
2020
2121#include <QtQml/QQmlEngine>
2222#include <QtQml/QQmlExtensionPlugin>
2323
24−class ListViewWithPageHeaderPlugin : public QQmlExtensionPlugin
24+class DashViewsPlugin : public QQmlExtensionPlugin
2525{
2626 Q_OBJECT
2727 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
plugins/DashViews/qmldirnew file+3
@@ -0,0 +1,3 @@
1+module DashViews
2+plugin DashViews-qml
3+typeinfo plugin.qmltypes
plugins/DashViews/verticaljournal.cppnew file+590
@@ -0,0 +1,590 @@
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 as published by
6+ * the Free Software Foundation; version 3.
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+
17+/*
18+ * The implementation is centered around m_columnVisibleItems
19+ * that holds a vector of lists. There's a list for each of the
20+ * columns the view has. In the list the items of the column are
21+ * ordered as they appear topdown in the view. m_indexColumnMap is
22+ * used when re-building the list up since given a position
23+ * in the middle of the list and the need to create the previous does
24+ * not give us enough information to know in which column we have
25+ * to position the item so that when we reach the item the view is
26+ * correctly layouted at 0 for all the columns
27+ */
28+#include "verticaljournal.h"
29+
30+#include <qqmlengine.h>
31+#pragma GCC diagnostic push
32+#pragma GCC diagnostic ignored "-pedantic"
33+#if (QT_VERSION < QT_VERSION_CHECK(5, 1, 0))
34+#include <private/qquickvisualdatamodel_p.h>
35+#else
36+#include <private/qqmldelegatemodel_p.h>
37+#include <qqmlinfo.h>
38+#endif
39+#include <private/qquickitem_p.h>
40+#pragma GCC diagnostic pop
41+
42+static const qreal bufferRatio = 0.5;
43+
44+VerticalJournal::VerticalJournal()
45+ : m_delegateModel(nullptr)
46+ , m_asyncRequestedIndex(-1)
47+ , m_columnWidth(0)
48+ , m_columnSpacing(0)
49+ , m_rowSpacing(0)
50+ , m_delegateCreationBegin(0)
51+ , m_delegateCreationEnd(0)
52+ , m_delegateCreationBeginValid(false)
53+ , m_delegateCreationEndValid(false)
54+ , m_needsRelayout(false)
55+ , m_delegateValidated(false)
56+ , m_implicitHeightDirty(false)
57+{
58+ connect(this, SIGNAL(widthChanged()), this, SLOT(relayout()));
59+ connect(this, SIGNAL(heightChanged()), this, SLOT(onHeightChanged()));
60+}
61+
62+QAbstractItemModel *VerticalJournal::model() const
63+{
64+ return m_delegateModel ? m_delegateModel->model().value<QAbstractItemModel *>() : nullptr;
65+}
66+
67+void VerticalJournal::setModel(QAbstractItemModel *model)
68+{
69+ if (model != this->model()) {
70+ if (!m_delegateModel) {
71+ createDelegateModel();
72+ } else {
73+#if (QT_VERSION < QT_VERSION_CHECK(5, 1, 0))
74+ disconnect(m_delegateModel, SIGNAL(modelUpdated(QQuickChangeSet,bool)), this, SLOT(onModelUpdated(QQuickChangeSet,bool)));
75+ }
76+ m_delegateModel->setModel(QVariant::fromValue<QAbstractItemModel *>(model));
77+ connect(m_delegateModel, SIGNAL(modelUpdated(QQuickChangeSet,bool)), this, SLOT(onModelUpdated(QQuickChangeSet,bool)));
78+#else
79+ disconnect(m_delegateModel, SIGNAL(modelUpdated(QQmlChangeSet,bool)), this, SLOT(onModelUpdated(QQmlChangeSet,bool)));
80+ }
81+ m_delegateModel->setModel(QVariant::fromValue<QAbstractItemModel *>(model));
82+ connect(m_delegateModel, SIGNAL(modelUpdated(QQmlChangeSet,bool)), this, SLOT(onModelUpdated(QQmlChangeSet,bool)));
83+#endif
84+
85+ cleanupExistingItems();
86+
87+ Q_EMIT modelChanged();
88+ polish();
89+ }
90+}
91+
92+QQmlComponent *VerticalJournal::delegate() const
93+{
94+ return m_delegateModel ? m_delegateModel->delegate() : nullptr;
95+}
96+
97+void VerticalJournal::setDelegate(QQmlComponent *delegate)
98+{
99+ if (delegate != this->delegate()) {
100+ if (!m_delegateModel) {
101+ createDelegateModel();
102+ }
103+
104+ cleanupExistingItems();
105+
106+ m_delegateModel->setDelegate(delegate);
107+
108+ Q_EMIT delegateChanged();
109+ m_delegateValidated = false;
110+ polish();
111+ }
112+}
113+
114+qreal VerticalJournal::columnWidth() const
115+{
116+ return m_columnWidth;
117+}
118+
119+void VerticalJournal::setColumnWidth(qreal columnWidth)
120+{
121+ if (columnWidth != m_columnWidth) {
122+ m_columnWidth = columnWidth;
123+ Q_EMIT columnWidthChanged();
124+
125+ if (isComponentComplete()) {
126+ Q_FOREACH(const auto &column, m_columnVisibleItems) {
127+ Q_FOREACH(const ViewItem &item, column) {
128+ item.m_item->setWidth(columnWidth);
129+ }
130+ }
131+ relayout();
132+ }
133+ }
134+}
135+
136+qreal VerticalJournal::columnSpacing() const
137+{
138+ return m_columnSpacing;
139+}
140+
141+void VerticalJournal::setColumnSpacing(qreal columnSpacing)
142+{
143+ if (columnSpacing != m_columnSpacing) {
144+ m_columnSpacing = columnSpacing;
145+ Q_EMIT columnSpacingChanged();
146+
147+ if (isComponentComplete()) {
148+ relayout();
149+ }
150+ }
151+}
152+
153+qreal VerticalJournal::rowSpacing() const
154+{
155+ return m_rowSpacing;
156+}
157+
158+void VerticalJournal::setRowSpacing(qreal rowSpacing)
159+{
160+ if (rowSpacing != m_rowSpacing) {
161+ m_rowSpacing = rowSpacing;
162+ Q_EMIT rowSpacingChanged();
163+
164+ if (isComponentComplete()) {
165+ relayout();
166+ }
167+ }
168+}
169+
170+qreal VerticalJournal::delegateCreationBegin() const
171+{
172+ return m_delegateCreationBegin;
173+}
174+
175+void VerticalJournal::setDelegateCreationBegin(qreal begin)
176+{
177+ m_delegateCreationBeginValid = true;
178+ if (m_delegateCreationBegin == begin)
179+ return;
180+ m_delegateCreationBegin = begin;
181+ if (isComponentComplete()) {
182+ polish();
183+ }
184+ emit delegateCreationBeginChanged();
185+}
186+
187+void VerticalJournal::resetDelegateCreationBegin()
188+{
189+ m_delegateCreationBeginValid = false;
190+ if (m_delegateCreationBegin == 0)
191+ return;
192+ m_delegateCreationBegin = 0;
193+ if (isComponentComplete()) {
194+ polish();
195+ }
196+ emit delegateCreationBeginChanged();
197+}
198+
199+qreal VerticalJournal::delegateCreationEnd() const
200+{
201+ return m_delegateCreationEnd;
202+}
203+
204+void VerticalJournal::setDelegateCreationEnd(qreal end)
205+{
206+ m_delegateCreationEndValid = true;
207+ if (m_delegateCreationEnd == end)
208+ return;
209+ m_delegateCreationEnd = end;
210+ if (isComponentComplete()) {
211+ polish();
212+ }
213+ emit delegateCreationEndChanged();
214+}
215+
216+void VerticalJournal::resetDelegateCreationEnd()
217+{
218+ m_delegateCreationEndValid = false;
219+ if (m_delegateCreationEnd == 0)
220+ return;
221+ m_delegateCreationEnd = 0;
222+ if (isComponentComplete()) {
223+ polish();
224+ }
225+ emit delegateCreationEndChanged();
226+}
227+
228+void VerticalJournal::createDelegateModel()
229+{
230+#if (QT_VERSION < QT_VERSION_CHECK(5, 1, 0))
231+ m_delegateModel = new QQuickVisualDataModel(qmlContext(this), this);
232+ connect(m_delegateModel, SIGNAL(createdItem(int,QQuickItem*)), this, SLOT(itemCreated(int,QQuickItem*)));
233+#else
234+ m_delegateModel = new QQmlDelegateModel(qmlContext(this), this);
235+ connect(m_delegateModel, SIGNAL(createdItem(int,QObject*)), this, SLOT(itemCreated(int,QObject*)));
236+#endif
237+ if (isComponentComplete())
238+ m_delegateModel->componentComplete();
239+}
240+
241+void VerticalJournal::refill()
242+{
243+ if (!isComponentComplete()) {
244+ return;
245+ }
246+
247+ const bool delegateRangesValid = m_delegateCreationBeginValid && m_delegateCreationEndValid;
248+ const qreal from = delegateRangesValid ? m_delegateCreationBegin : 0;
249+ const qreal to = delegateRangesValid ? m_delegateCreationEnd : from + height();
250+ const qreal buffer = (to - from) * bufferRatio;
251+ const qreal bufferFrom = from - buffer;
252+ const qreal bufferTo = to + buffer;
253+
254+ bool added = addVisibleItems(from, to, false);
255+ bool removed = removeNonVisibleItems(bufferFrom, bufferTo);
256+ added |= addVisibleItems(bufferFrom, bufferTo, true);
257+
258+ if (added || removed) {
259+ m_implicitHeightDirty = true;
260+ }
261+}
262+
263+void VerticalJournal::findBottomModelIndexToAdd(int *modelIndex, qreal *yPos)
264+{
265+ *modelIndex = 0;
266+ *yPos = std::numeric_limits<qreal>::max();
267+
268+ Q_FOREACH(const auto &column, m_columnVisibleItems) {
269+ if (!column.isEmpty()) {
270+ const ViewItem &item = column.last();
271+ *yPos = qMin(*yPos, item.y() + item.height() + m_rowSpacing);
272+ *modelIndex = qMax(*modelIndex, item.m_modelIndex + 1);
273+ } else {
274+ *yPos = 0;
275+ }
276+ }
277+}
278+
279+void VerticalJournal::findTopModelIndexToAdd(int *modelIndex, qreal *yPos)
280+{
281+ *modelIndex = INT_MAX;
282+ *yPos = std::numeric_limits<qreal>::lowest();
283+ int columnToAddTo = -1;
284+
285+ // Find the topmost free column
286+ for (int i = 0; i < m_columnVisibleItems.count(); ++i) {
287+ const auto &column = m_columnVisibleItems[i];
288+ if (!column.isEmpty()) {
289+ const ViewItem &item = column.first();
290+ const auto itemTopPos = item.y() - m_rowSpacing;
291+ if (itemTopPos > *yPos) {
292+ *yPos = itemTopPos;
293+ *modelIndex = item.m_modelIndex - 1;
294+ columnToAddTo = i;
295+ }
296+ }
297+ }
298+
299+ if (*modelIndex > 0) {
300+ Q_ASSERT(m_indexColumnMap.contains(*modelIndex));
301+ while (m_indexColumnMap[*modelIndex] != columnToAddTo) {
302+ // We found out that we have to add to columnToAddTo
303+ // and thought that we had to add *modelIndex, but history tells
304+ // it is not correct, so find up from *modelIndex until we found the index
305+ // that has to end up in columnToAddTo
306+ *modelIndex = *modelIndex - 1;
307+ Q_ASSERT(m_indexColumnMap.contains(*modelIndex));
308+ }
309+ }
310+}
311+
312+bool VerticalJournal::addVisibleItems(qreal fillFrom, qreal fillTo, bool asynchronous)
313+{
314+ if (!delegate())
315+ return false;
316+
317+ if (m_delegateModel->count() == 0)
318+ return false;
319+
320+ int modelIndex;
321+ qreal yPos;
322+ findBottomModelIndexToAdd(&modelIndex, &yPos);
323+ bool changed = false;
324+ while (modelIndex < m_delegateModel->count() && yPos <= fillTo) {
325+ if (!createItem(modelIndex, asynchronous))
326+ break;
327+
328+ changed = true;
329+ findBottomModelIndexToAdd(&modelIndex, &yPos);
330+ }
331+
332+ findTopModelIndexToAdd(&modelIndex, &yPos);
333+ while (modelIndex >= 0 && yPos > fillFrom) {
334+ if (!createItem(modelIndex, asynchronous))
335+ break;
336+
337+ changed = true;
338+ findTopModelIndexToAdd(&modelIndex, &yPos);
339+ }
340+
341+ return changed;
342+}
343+
344+bool VerticalJournal::removeNonVisibleItems(qreal bufferFrom, qreal bufferTo)
345+{
346+ bool changed = false;
347+
348+ for (int i = 0; i < m_columnVisibleItems.count(); ++i) {
349+ QList<ViewItem> &column = m_columnVisibleItems[i];
350+ while (!column.isEmpty() && column.first().y() + column.first().height() < bufferFrom) {
351+ releaseItem(column.takeFirst());
352+ changed = true;
353+ }
354+
355+ while (!column.isEmpty() && column.last().y() > bufferTo) {
356+ releaseItem(column.takeLast());
357+ changed = true;
358+ }
359+ }
360+
361+ return changed;
362+}
363+
364+QQuickItem *VerticalJournal::createItem(int modelIndex, bool asynchronous)
365+{
366+ if (asynchronous && m_asyncRequestedIndex != -1)
367+ return nullptr;
368+
369+ m_asyncRequestedIndex = -1;
370+#if (QT_VERSION < QT_VERSION_CHECK(5, 1, 0))
371+ QQuickItem *item = m_delegateModel->item(modelIndex, asynchronous);
372+#else
373+ QObject* object = m_delegateModel->object(modelIndex, asynchronous);
374+ QQuickItem *item = qmlobject_cast<QQuickItem*>(object);
375+#endif
376+ if (!item) {
377+#if (QT_VERSION < QT_VERSION_CHECK(5, 1, 0))
378+ m_asyncRequestedIndex = modelIndex;
379+#else
380+ if (object) {
381+ m_delegateModel->release(object);
382+ if (!m_delegateValidated) {
383+ m_delegateValidated = true;
384+ QObject* delegateObj = delegate();
385+ qmlInfo(delegateObj ? delegateObj : this) << "Delegate must be of Item type";
386+ }
387+ } else {
388+ m_asyncRequestedIndex = modelIndex;
389+ }
390+#endif
391+ return nullptr;
392+ } else {
393+ if (item->width() != m_columnWidth) {
394+ qWarning() << "Item" << modelIndex << "width is not the one that the columnWidth mandates, resetting it";
395+ item->setWidth(m_columnWidth);
396+ }
397+ positionItem(modelIndex, item);
398+ return item;
399+ }
400+}
401+
402+void VerticalJournal::positionItem(int modelIndex, QQuickItem *item)
403+{
404+ // Check if we add it to the bottom of existing column items
405+ const QList<ViewItem> &firstColumn = m_columnVisibleItems[0];
406+ qreal columnToAddY = !firstColumn.isEmpty() ? firstColumn.last().y() + firstColumn.last().height() : -m_rowSpacing;
407+ int columnToAddTo = 0;
408+ for (int i = 1; i < m_columnVisibleItems.count(); ++i) {
409+ const QList<ViewItem> &column = m_columnVisibleItems[i];
410+ const qreal iY = !column.isEmpty() ? column.last().y() + column.last().height() : -m_rowSpacing;
411+ if (iY < columnToAddY) {
412+ columnToAddTo = i;
413+ columnToAddY = iY;
414+ }
415+ }
416+
417+ const QList<ViewItem> &columnToAdd = m_columnVisibleItems[columnToAddTo];
418+ if (columnToAdd.isEmpty() || columnToAdd.last().m_modelIndex < modelIndex) {
419+ item->setX(columnToAddTo * (m_columnWidth + m_columnSpacing));
420+ item->setY(columnToAddY + m_rowSpacing);
421+
422+ m_columnVisibleItems[columnToAddTo] << ViewItem(item, modelIndex);
423+ m_indexColumnMap[modelIndex] = columnToAddTo;
424+ } else {
425+ Q_ASSERT(m_indexColumnMap.contains(modelIndex));
426+ columnToAddTo = m_indexColumnMap[modelIndex];
427+ columnToAddY = m_columnVisibleItems[columnToAddTo].first().y();
428+
429+ item->setX(columnToAddTo * (m_columnWidth + m_columnSpacing));
430+ item->setY(columnToAddY - m_rowSpacing - item->height());
431+
432+ m_columnVisibleItems[columnToAddTo].prepend(ViewItem(item, modelIndex));
433+ }
434+}
435+
436+void VerticalJournal::cleanupExistingItems()
437+{
438+ // Cleanup the existing items
439+ for (int i = 0; i < m_columnVisibleItems.count(); ++i) {
440+ QList<ViewItem> &column = m_columnVisibleItems[i];
441+ Q_FOREACH(const ViewItem &item, column)
442+ releaseItem(item);
443+ column.clear();
444+ }
445+ m_indexColumnMap.clear();
446+}
447+
448+void VerticalJournal::releaseItem(const ViewItem &item)
449+{
450+#if (QT_VERSION < QT_VERSION_CHECK(5, 1, 0))
451+ QQuickVisualModel::ReleaseFlags flags = m_delegateModel->release(item.m_item);
452+ if (flags & QQuickVisualModel::Destroyed) {
453+#else
454+ QQmlDelegateModel::ReleaseFlags flags = m_delegateModel->release(item.m_item);
455+ if (flags & QQmlDelegateModel::Destroyed) {
456+#endif
457+ item.m_item->setParentItem(nullptr);
458+ }
459+}
460+
461+void VerticalJournal::calculateImplicitHeight()
462+{
463+ m_implicitHeightDirty = false;
464+
465+ int lastModelIndex = -1;
466+ qreal bottomMostY = 0;
467+ Q_FOREACH(const auto &column, m_columnVisibleItems) {
468+ if (!column.isEmpty()) {
469+ const ViewItem &item = column.last();
470+ lastModelIndex = qMax(lastModelIndex, item.m_modelIndex);
471+ bottomMostY = qMax(bottomMostY, item.y() + item.height());
472+ }
473+ }
474+ if (lastModelIndex >= 0) {
475+ const double averageHeight = bottomMostY / (lastModelIndex + 1);
476+ setImplicitHeight(bottomMostY + averageHeight * (model()->rowCount() - lastModelIndex - 1));
477+ } else {
478+ setImplicitHeight(0);
479+ }
480+}
481+
482+#if (QT_VERSION < QT_VERSION_CHECK(5, 1, 0))
483+void VerticalJournal::itemCreated(int modelIndex, QQuickItem *item)
484+{
485+#else
486+void VerticalJournal::itemCreated(int modelIndex, QObject *object)
487+{
488+ QQuickItem *item = qmlobject_cast<QQuickItem*>(object);
489+ if (!item) {
490+ qWarning() << "VerticalJournal::itemCreated got a non item for index" << modelIndex;
491+ return;
492+ }
493+#endif
494+ item->setParentItem(this);
495+ if (modelIndex == m_asyncRequestedIndex) {
496+ createItem(modelIndex, false);
497+ m_implicitHeightDirty = true;
498+ polish();
499+ }
500+}
501+
502+#if (QT_VERSION < QT_VERSION_CHECK(5, 1, 0))
503+void VerticalJournal::onModelUpdated(const QQuickChangeSet & /*changeSet*/, bool reset)
504+#else
505+void VerticalJournal::onModelUpdated(const QQmlChangeSet & /*changeSet*/, bool reset)
506+#endif
507+{
508+ // TODO Add support for additions/removals at end that are not reset calls
509+ // TODO Add a test for reset
510+ if (reset) {
511+ cleanupExistingItems();
512+ }
513+ polish();
514+}
515+
516+
517+void VerticalJournal::relayout()
518+{
519+ m_needsRelayout = true;
520+ polish();
521+}
522+
523+void VerticalJournal::onHeightChanged()
524+{
525+ polish();
526+}
527+
528+void VerticalJournal::updatePolish()
529+{
530+ if (!model())
531+ return;
532+
533+ if (m_needsRelayout) {
534+ m_implicitHeightDirty = true;
535+
536+ QList<ViewItem> allItems;
537+ Q_FOREACH(const auto &column, m_columnVisibleItems)
538+ allItems << column;
539+
540+ qSort(allItems);
541+
542+ const int nColumns = qMax(1., floor((double)(width() + m_columnSpacing) / (m_columnWidth + m_columnSpacing)));
543+ m_columnVisibleItems.resize(nColumns);
544+ m_indexColumnMap.clear();
545+ for (int i = 0; i < nColumns; ++i)
546+ m_columnVisibleItems[i].clear();
547+
548+ // If the first of allItems doesn't contain index 0 we need to drop them
549+ // all since we can't consistently relayout without the first item being there
550+
551+ if (!allItems.isEmpty()) {
552+ if (allItems.first().m_modelIndex == 0) {
553+ Q_FOREACH(const ViewItem &item, allItems)
554+ positionItem(item.m_modelIndex, item.m_item);
555+ } else {
556+ Q_FOREACH(const ViewItem &item, allItems)
557+ releaseItem(item);
558+ }
559+ }
560+
561+ m_needsRelayout = false;
562+ }
563+
564+ refill();
565+
566+ const bool delegateRangesValid = m_delegateCreationBeginValid && m_delegateCreationEndValid;
567+ const qreal from = delegateRangesValid ? m_delegateCreationBegin : 0;
568+ const qreal to = delegateRangesValid ? m_delegateCreationEnd : from + height();
569+ Q_FOREACH(const auto &column, m_columnVisibleItems) {
570+ Q_FOREACH(const ViewItem &item, column) {
571+ QQuickItemPrivate::get(item.m_item)->setCulled(item.y() + item.height() <= from || item.y() >= to);
572+ }
573+ }
574+
575+ if (m_implicitHeightDirty) {
576+ calculateImplicitHeight();
577+ }
578+}
579+
580+void VerticalJournal::componentComplete()
581+{
582+ if (m_delegateModel)
583+ m_delegateModel->componentComplete();
584+
585+ QQuickItem::componentComplete();
586+
587+ m_needsRelayout = true;
588+
589+ polish();
590+}
plugins/DashViews/verticaljournal.hnew file+182
@@ -0,0 +1,182 @@
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 as published by
6+ * the Free Software Foundation; version 3.
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+
17+#ifndef VERTICALJOURNAL_H
18+#define VERTICALJOURNAL_H
19+
20+#include <QQuickItem>
21+
22+class QAbstractItemModel;
23+class QQmlComponent;
24+#if (QT_VERSION < QT_VERSION_CHECK(5, 1, 0))
25+class QQuickChangeSet;
26+class QQuickVisualDataModel;
27+#else
28+class QQmlChangeSet;
29+class QQmlDelegateModel;
30+#endif
31+
32+ /** A vertical journal is a view that creates delegates
33+ * based on a model and layouts them in columns following
34+ * a top-left most position rule.
35+ *
36+ * The number of columns is calculated using the width of
37+ * the view itself, the columnWidth (i.e. the width of each individual delegate)
38+ * and the columnSpacing between columns.
39+ *
40+ * All delegates are forced to columnWidth if they don't have it.
41+ *
42+ * The first nColumns items are layouted at row 0 from column 0
43+ * to column nColumns-1 in order. After that every new item
44+ * is positioned in the column which provides the free topmost
45+ * position as possible. If more than one column tie in providing
46+ * the topmost free position the leftmost column will be used.
47+ *
48+ * Example:
49+ *
50+ * +-----+ +-----+ +-----+
51+ * | | | 2 | | |
52+ * | | | | | |
53+ * | 1 | +-----+ | 3 |
54+ * | | +-----+ | |
55+ * | | | | +-----+
56+ * +-----+ | 4 | +-----+
57+ * +-----+ | | | 5 |
58+ * | 6 | +-----+ | |
59+ * | | +-----+
60+ * +-----+
61+ *
62+ */
63+ class VerticalJournal : public QQuickItem
64+{
65+ Q_OBJECT
66+
67+ Q_PROPERTY(QAbstractItemModel *model READ model WRITE setModel NOTIFY modelChanged)
68+ Q_PROPERTY(QQmlComponent *delegate READ delegate WRITE setDelegate NOTIFY delegateChanged)
69+ Q_PROPERTY(qreal columnWidth READ columnWidth WRITE setColumnWidth NOTIFY columnWidthChanged)
70+ Q_PROPERTY(qreal columnSpacing READ columnSpacing WRITE setColumnSpacing NOTIFY columnSpacingChanged)
71+ Q_PROPERTY(qreal rowSpacing READ rowSpacing WRITE setRowSpacing NOTIFY rowSpacingChanged)
72+ Q_PROPERTY(qreal delegateCreationBegin READ delegateCreationBegin
73+ WRITE setDelegateCreationBegin
74+ NOTIFY delegateCreationBeginChanged
75+ RESET resetDelegateCreationBegin)
76+ Q_PROPERTY(qreal delegateCreationEnd READ delegateCreationEnd
77+ WRITE setDelegateCreationEnd
78+ NOTIFY delegateCreationEndChanged
79+ RESET resetDelegateCreationEnd)
80+
81+friend class VerticalJournalTest;
82+
83+public:
84+ VerticalJournal();
85+
86+ QAbstractItemModel *model() const;
87+ void setModel(QAbstractItemModel *model);
88+
89+ QQmlComponent *delegate() const;
90+ void setDelegate(QQmlComponent *delegate);
91+
92+ qreal columnWidth() const;
93+ void setColumnWidth(qreal columnWidth);
94+
95+ qreal columnSpacing() const;
96+ void setColumnSpacing(qreal columnSpacing);
97+
98+ qreal rowSpacing() const;
99+ void setRowSpacing(qreal rowSpacing);
100+
101+ qreal delegateCreationBegin() const;
102+ void setDelegateCreationBegin(qreal);
103+ void resetDelegateCreationBegin();
104+
105+ qreal delegateCreationEnd() const;
106+ void setDelegateCreationEnd(qreal);
107+ void resetDelegateCreationEnd();
108+
109+Q_SIGNALS:
110+ void modelChanged();
111+ void delegateChanged();
112+ void columnWidthChanged();
113+ void columnSpacingChanged();
114+ void rowSpacingChanged();
115+ void delegateCreationBeginChanged();
116+ void delegateCreationEndChanged();
117+
118+protected:
119+ void updatePolish();
120+ void componentComplete();
121+
122+private Q_SLOTS:
123+#if (QT_VERSION < QT_VERSION_CHECK(5, 1, 0))
124+ void itemCreated(int modelIndex, QQuickItem *item);
125+ void onModelUpdated(const QQuickChangeSet &changeSet, bool reset);
126+#else
127+ void itemCreated(int modelIndex, QObject *object);
128+ void onModelUpdated(const QQmlChangeSet &changeSet, bool reset);
129+#endif
130+ void relayout();
131+ void onHeightChanged();
132+
133+private:
134+ class ViewItem
135+ {
136+ public:
137+ ViewItem(QQuickItem *item, int modelIndex) : m_item(item), m_modelIndex(modelIndex) {}
138+ qreal x() const { return m_item->x(); }
139+ qreal y() const { return m_item->y(); }
140+ qreal height() const { return m_item->height(); }
141+ bool operator<(const ViewItem &v) const { return m_modelIndex < v.m_modelIndex; }
142+
143+ QQuickItem *m_item;
144+ int m_modelIndex;
145+ };
146+
147+ void createDelegateModel();
148+ void refill();
149+ void findBottomModelIndexToAdd(int *modelIndex, qreal *yPos);
150+ void findTopModelIndexToAdd(int *modelIndex, qreal *yPos);
151+ bool addVisibleItems(qreal fillFrom, qreal fillTo, bool asynchronous);
152+ bool removeNonVisibleItems(qreal bufferFrom, qreal bufferTo);
153+ QQuickItem *createItem(int modelIndex, bool asynchronous);
154+ void positionItem(int modelIndex, QQuickItem *item);
155+ void cleanupExistingItems();
156+ void releaseItem(const ViewItem &item);
157+ void calculateImplicitHeight();
158+
159+#if (QT_VERSION < QT_VERSION_CHECK(5, 1, 0))
160+ QQuickVisualDataModel *m_delegateModel;
161+#else
162+ QQmlDelegateModel *m_delegateModel;
163+#endif
164+
165+ // Index we are waiting because we requested it asynchronously
166+ int m_asyncRequestedIndex;
167+
168+ QVector<QList<ViewItem>> m_columnVisibleItems;
169+ QHash<int, int> m_indexColumnMap;
170+ int m_columnWidth;
171+ int m_columnSpacing;
172+ int m_rowSpacing;
173+ qreal m_delegateCreationBegin;
174+ qreal m_delegateCreationEnd;
175+ bool m_delegateCreationBeginValid;
176+ bool m_delegateCreationEndValid;
177+ bool m_needsRelayout;
178+ bool m_delegateValidated;
179+ bool m_implicitHeightDirty;
180+};
181+
182+#endif
plugins/LightDM/CMakeLists.txt+1
@@ -10,6 +10,7 @@ pkg_check_modules(LIBUSERMETRICSOUTPUT REQUIRED libusermetricsoutput-1)
1010include_directories(
1111 ${CMAKE_CURRENT_SOURCE_DIR}
1212 ${CMAKE_CURRENT_BINARY_DIR}
13+ ${CMAKE_SOURCE_DIR}/plugins/Utils
1314 ${CMAKE_SOURCE_DIR}/tests/mocks/LightDM
1415 #${LIBLIGHTDM_INCLUDE_DIRS}
1516 ${LIBUSERMETRICSOUTPUT_INCLUDE_DIRS}
plugins/LightDM/UsersModel.h+1−1
@@ -23,7 +23,7 @@
2323#ifndef UNITY_USERSMODEL_H
2424#define UNITY_USERSMODEL_H
2525
26−#include "plugins/Utils/qsortfilterproxymodelqml.h"
26+#include <qsortfilterproxymodelqml.h>
2727#include <QtCore/QObject>
2828
2929class UsersModel : public QSortFilterProxyModelQML
plugins/ListViewWithPageHeader/qmldirdeleted−3
@@ -1,3 +0,0 @@
1−module ListViewWithPageHeader
2−plugin ListViewWithPageHeader-qml
3−typeinfo plugin.qmltypes
plugins/Unity/Indicators/CMakeLists.txt−1
@@ -36,7 +36,6 @@ set(IndicatorsQML_SOURCES
3636 unitymenumodelcache.cpp
3737 unitymenumodelstack.cpp
3838 visibleindicatorsmodel.cpp
39− timeformatter.cpp
4039)
4140add_definitions(-DUNITYINDICATORS_LIBRARY)
4241
plugins/Unity/Indicators/Messaging/qml/MessageMenuItemFactory.qml+85−60
@@ -24,124 +24,145 @@ import Unity.Indicators 0.1 as Indicators
2424import QMenuModel 0.1 as QMenuModel
2525
2626Indicators.BaseMenuItem {
27− id: menuItem
28− property var actionsDescription: menu ? menu.ext.xCanonicalMessageActions : undefined
27+ id: messageFactoryItem
28+ property var menuModel: null
29+ property QtObject menuData: null
30+ property int menuIndex: -1
2931
30− implicitHeight: contents.status == Loader.Ready ? contents.item.implicitHeight : 0
32+ property var extendedData: menuData && menuData.ext || undefined
33+ property var actionsDescription: getExtendedProperty(extendedData, "xCanonicalMessageActions", undefined)
3134
32− property var model: null
35+ onMenuModelChanged: {
36+ loadAttributes();
37+ }
38+ onMenuIndexChanged: {
39+ loadAttributes();
40+ }
3341
34− Loader {
35− id: contents
36− anchors.fill: parent
42+ function loadAttributes() {
43+ if (!menuModel || menuIndex == undefined) return;
3744
38− sourceComponent: loadMessage(actionsDescription);
45+ menuModel.loadExtendedAttributes(menuIndex, {'x-canonical-time': 'int64',
46+ 'x-canonical-text': 'string',
47+ 'x-canonical-message-actions': 'variant',
48+ 'icon': 'icon',
49+ 'x-canonical-app-icon': 'icon'});
50+ }
3951
40− // Binding all properties for the item, to make sure that any change in the
41− // property will be propagated to the contents.item at any time
42− Binding {
43− target: contents.item
44− property: "menuSelected"
45− value: menuSelected
46− when: (contents.status == Loader.Ready)
52+ function getExtendedProperty(object, propertyName, defaultValue) {
53+ if (object && object.hasOwnProperty(propertyName)) {
54+ return object[propertyName];
4755 }
56+ return defaultValue;
57+ }
4858
49− Binding {
50− target: contents.item
51− property: "menu"
52− value: menu
53− when: (contents.status == Loader.Ready)
54− }
59+ implicitHeight: contents.status == Loader.Ready ? contents.item.implicitHeight : 0
5560
56− Connections {
57− target: contents.item ? contents.item : null
58− onSelectMenu: selectMenu()
59− onDeselectMenu: deselectMenu()
60− }
61+ Loader {
62+ id: contents
63+ anchors.fill: parent
64+
65+ sourceComponent: loadMessage(actionsDescription);
6166
6267 Component {
6368 id: simpleTextMessage
6469 SimpleTextMessage {
6570 // text
66− title: menu && menu.label ? menu.label : ""
67− time: menu ? menu.ext.xCanonicalTime : 0
68− message: menu && menu.ext.xCanonicalText ? menu.ext.xCanonicalText : ""
71+ title: menuData && menuData.label || ""
72+ time: getExtendedProperty(extendedData, "xCanonicalTime", 0)
73+ message: getExtendedProperty(extendedData, "xCanonicalText", "")
6974 // icons
70− avatar: menu && menu.ext.icon !== undefined ? menu.ext.icon : "qrc:/indicators/artwork/messaging/default_contact.png"
71− appIcon: menu && menu.ext.xCanonicalAppIcon !== undefined ? menu.ext.xCanonicalAppIcon : "qrc:/indicators/artwork/messaging/default_app.svg"
75+ avatar: getExtendedProperty(extendedData, "icon", "qrc:/indicators/artwork/messaging/default_contact.png")
76+ appIcon: getExtendedProperty(extendedData, "xCanonicalAppIcon", "qrc:/indicators/artwork/messaging/default_app.svg")
7277
7378 onActivateApp: {
74− menuItem.model.activate(modelIndex, true);
79+ menuModel.activate(menuIndex, true);
80+ shell.hideIndicatorMenu(UbuntuAnimation.FastDuration);
7581 }
7682 onDismiss: {
77− menuItem.model.activate(modelIndex, false);
83+ menuModel.activate(menuIndex, false);
7884 }
85+
86+ menuSelected: messageFactoryItem.menuSelected
87+ onSelectMenu: messageFactoryItem.selectMenu()
88+ onDeselectMenu: messageFactoryItem.deselectMenu()
7989 }
8090 }
8191 Component {
8292 id: textMessage
8393 TextMessage {
94+ property var replyActionDescription: actionsDescription && actionsDescription.length > 0 ? actionsDescription[0] : undefined
95+
8496 property var replyAction: QMenuModel.UnityMenuAction {
85− model: menuItem.model
86− index: modelIndex
87− name: menu && actionsDescription[0].name ? actionsDescription[0].name : ""
97+ model: menuModel
98+ index: menuIndex
99+ name: getExtendedProperty(replyActionDescription, "name", "")
88100 }
89101
90102 // text
91− title: menu && menu.label ? menu.label : ""
92− time: menu ? menu.ext.xCanonicalTime : 0
93− message: menu && menu.ext.xCanonicalText ? menu.ext.xCanonicalText : ""
94− replyButtonText: actionsDescription && actionsDescription[0].label ? actionsDescription[0].label : "Send"
103+ title: menuData && menuData.label || ""
104+ time: getExtendedProperty(extendedData, "xCanonicalTime", 0)
105+ message: getExtendedProperty(extendedData, "xCanonicalText", "")
106+ replyButtonText: getExtendedProperty(replyActionDescription, "label", "Send")
95107 // icons
96− avatar: menu && menu.ext.icon !== undefined ? menu.ext.icon : "qrc:/indicators/artwork/messaging/default_contact.png"
97− appIcon: menu && menu.ext.xCanonicalAppIcon !== undefined ? menu.ext.xCanonicalAppIcon : "qrc:/indicators/artwork/messaging/default_app.svg"
108+ avatar: getExtendedProperty(extendedData, "icon", "qrc:/indicators/artwork/messaging/default_contact.png")
109+ appIcon: getExtendedProperty(extendedData, "xCanonicalAppIcon", "qrc:/indicators/artwork/messaging/default_app.svg")
98110 // actions
99111 replyEnabled: replyAction.valid && replyAction.enabled
100112
101113 onActivateApp: {
102− menuItem.model.activate(modelIndex, true);
114+ menuModel.activate(menuIndex, true);
115+ shell.hideIndicatorMenu(UbuntuAnimation.FastDuration);
103116 }
104117 onDismiss: {
105− menuItem.model.activate(modelIndex, false);
118+ menuModel.activate(menuIndex, false);
106119 }
107120 onReply: {
108121 replyAction.activate(value);
109122 }
123+
124+ menuSelected: messageFactoryItem.menuSelected
125+ onSelectMenu: messageFactoryItem.selectMenu()
126+ onDeselectMenu: messageFactoryItem.deselectMenu()
110127 }
111128 }
112129 Component {
113130 id: snapDecision
114131 SnapDecision {
132+ property var activateActionDescription: actionsDescription && actionsDescription.length > 0 ? actionsDescription[0] : undefined
133+ property var replyActionDescription: actionsDescription && actionsDescription.length > 1 ? actionsDescription[1] : undefined
134+
115135 property var activateAction: QMenuModel.UnityMenuAction {
116− model: menuItem.model
117− index: modelIndex
118− name: menu && actionsDescription[0].name ? actionsDescription[0].name : ""
136+ model: menuModel
137+ index: menuIndex
138+ name: getExtendedProperty(activateActionDescription, "name", "")
119139 }
120140 property var replyAction: QMenuModel.UnityMenuAction {
121− model: menuItem.model
122− index: modelIndex
123− name: menu && actionsDescription[1].name ? actionsDescription[1].name : ""
141+ model: menuModel
142+ index: menuIndex
143+ name: getExtendedProperty(replyActionDescription, "name", "")
124144 }
125145
126146 // text
127− title: menu && menu.label ? menu.label : ""
128− time: menu ? menu.ext.xCanonicalTime : ""
129− message: menu && menu.ext.xCanonicalText ? menu.ext.xCanonicalText : ""
130− actionButtonText: actionsDescription && actionsDescription[0].label ? actionsDescription[0].label : "Call back"
131− replyButtonText: actionsDescription && actionsDescription[1].label ? actionsDescription[1].label : "Send"
132− replyMessages: actionsDescription && actionsDescription[1]["parameter-hint"] ? actionsDescription[1]["parameter-hint"] : ""
147+ title: menuData && menuData.label || ""
148+ time: getExtendedProperty(extendedData, "xCanonicalTime", 0)
149+ message: getExtendedProperty(extendedData, "xCanonicalText", "")
150+ actionButtonText: getExtendedProperty(activateActionDescription, "label", "Call back")
151+ replyButtonText: getExtendedProperty(replyActionDescription, "label", "Send")
152+ replyMessages: getExtendedProperty(replyActionDescription, "parameter-hint", "")
133153 // icons
134− avatar: menu && menu.ext.icon !== undefined ? menu.ext.icon : "qrc:/indicators/artwork/messaging/default_contact.png"
135− appIcon: menu && menu.ext.xCanonicalAppIcon !== undefined ? menu.ext.xCanonicalAppIcon : "qrc:/indicators/artwork/messaging/default_app.svg"
154+ avatar: getExtendedProperty(extendedData, "icon", "qrc:/indicators/artwork/messaging/default_contact.png")
155+ appIcon: getExtendedProperty(extendedData, "xCanonicalAppIcon", "qrc:/indicators/artwork/messaging/default_app.svg")
136156 // actions
137157 activateEnabled: activateAction.valid && activateAction.enabled
138158 replyEnabled: replyAction.valid && replyAction.enabled
139159
140160 onActivateApp: {
141− menuItem.model.activate(modelIndex, true);
161+ menuModel.activate(menuIndex, true);
162+ shell.hideIndicatorMenu(UbuntuAnimation.FastDuration);
142163 }
143164 onDismiss: {
144− menuItem.model.activate(modelIndex, false);
165+ menuModel.activate(menuIndex, false);
145166 }
146167 onActivate: {
147168 activateAction.activate();
@@ -149,6 +170,10 @@ Indicators.BaseMenuItem {
149170 onReply: {
150171 replyAction.activate(value);
151172 }
173+
174+ menuSelected: messageFactoryItem.menuSelected
175+ onSelectMenu: messageFactoryItem.selectMenu()
176+ onDeselectMenu: messageFactoryItem.deselectMenu()
152177 }
153178 }
154179 }
plugins/Unity/Indicators/Messaging/qml/SimpleTextMessage.qml+2−1
@@ -21,6 +21,7 @@
2121import QtQuick 2.0
2222import Ubuntu.Components 0.1
2323import Unity.Indicators 0.1
24+import Utils 0.1 as Utils
2425
2526HeroMessage {
2627 id: __heroMessage
@@ -50,7 +51,7 @@ HeroMessage {
5051 opacity: 0.0
5152 enabled: false
5253
53− TimeFormatter {
54+ Utils.TimeFormatter {
5455 id: timeFormatter
5556 time: __heroMessage.time
5657 format: "hh:mm - MMM dd"
plugins/Unity/Indicators/Messaging/qml/SnapDecision.qml+2−2
@@ -20,8 +20,8 @@
2020
2121import QtQuick 2.0
2222import Ubuntu.Components 0.1
23−import Unity.Indicators 0.1 as Indicators
2423import Unity.Indicators 0.1
24+import Utils 0.1 as Utils
2525
2626HeroMessage {
2727 id: snapDecision
@@ -59,7 +59,7 @@ HeroMessage {
5959 height: units.gu(4)
6060 opacity: 0.0
6161
62− TimeFormatter {
62+ Utils.TimeFormatter {
6363 id: timeFormatter
6464 time: snapDecision.time
6565 format: "hh:mm - MMM dd"
plugins/Unity/Indicators/indicatorsmanager.cpp+1−1
@@ -24,7 +24,7 @@
2424#include <upstart.h>
2525#include <nih/alloc.h>
2626
27−#include "paths.h"
27+#include <paths.h>
2828
2929const QString profile = "phone";
3030
plugins/Unity/Indicators/indicatorsmodel.cpp+4−3
@@ -21,7 +21,8 @@
2121#include "indicatorsmanager.h"
2222#include "indicator.h"
2323#include "indicators.h"
24−#include "paths.h"
24+
25+#include <paths.h>
2526
2627#include <QQmlContext>
2728#include <QQmlEngine>
@@ -248,9 +249,9 @@ QVariant IndicatorsModel::data(const QModelIndex &index, int role) const
248249 }
249250 break;
250251 case IndicatorsModelRole::WidgetSource:
251− return shellAppDirectory()+"/Panel/Indicators/DefaultIndicatorWidget.qml";
252+ return qmlDirectory()+"/Panel/Indicators/DefaultIndicatorWidget.qml";
252253 case IndicatorsModelRole::PageSource:
253− return shellAppDirectory()+"/Panel/Indicators/DefaultIndicatorPage.qml";
254+ return qmlDirectory()+"/Panel/Indicators/DefaultIndicatorPage.qml";
254255 default:
255256 break;
256257 }
plugins/Unity/Indicators/plugin.cpp−2
@@ -33,7 +33,6 @@
3333#include "unitymenumodelcache.h"
3434#include "unitymenumodelstack.h"
3535#include "visibleindicatorsmodel.h"
36−#include "timeformatter.h"
3736
3837static QObject* menuModelCacheSingleton(QQmlEngine* engine, QJSEngine* scriptEngine) {
3938 Q_UNUSED(engine);
@@ -52,7 +51,6 @@ void Indicators2Plugin::registerTypes(const char *uri)
5251 qmlRegisterType<RootActionState>(uri, 0, 1, "RootActionState");
5352 qmlRegisterType<ModelPrinter>(uri, 0, 1, "ModelPrinter");
5453 qmlRegisterType<VisibleIndicatorsModel>(uri, 0, 1, "VisibleIndicatorsModel");
55− qmlRegisterType<TimeFormatter>(uri, 0, 1, "TimeFormatter");
5654
5755 qmlRegisterSingletonType<UnityMenuModelCache>(uri, 0, 1, "UnityMenuModelCache", menuModelCacheSingleton);
5856
plugins/Unity/Indicators/qml/IndicatorPage.qml+18−4
@@ -140,12 +140,15 @@ IndicatorBase {
140140
141141 onLoaded: {
142142 if (item.hasOwnProperty("menuSelected")) {
143− item.menuSelected = Qt.binding(function() { return mainMenu.selectedIndex == index; });
143+ item.menuSelected = mainMenu.selectedIndex == index;
144144 item.selectMenu.connect(function() { mainMenu.selectedIndex = index; });
145145 item.deselectMenu.connect(function() { mainMenu.selectedIndex = -1; });
146146 }
147− if (item.hasOwnProperty("menu")) {
148− item.menu = Qt.binding(function() { return model; });
147+ if (item.hasOwnProperty("menuData")) {
148+ item.menuData = Qt.binding(function() { return model; });
149+ }
150+ if (item.hasOwnProperty("menuIndex")) {
151+ item.menuIndex = Qt.binding(function() { return modelIndex; });
149152 }
150153 }
151154
@@ -154,13 +157,24 @@ IndicatorBase {
154157 property: "objectName"
155158 value: model.action
156159 }
160+
161+ // TODO: Fixes lp#1243146
162+ // This is a workaround for a Qt bug. https://bugreports.qt-project.org/browse/QTBUG-34351
163+ Connections {
164+ target: mainMenu
165+ onSelectedIndexChanged: {
166+ if (loader.item && loader.item.hasOwnProperty("menuSelected")) {
167+ loader.item.menuSelected = mainMenu.selectedIndex == index;
168+ }
169+ }
170+ }
157171 }
158172 }
159173 }
160174
161175 MenuItemFactory {
162176 id: factory
163− model: mainMenu.model
177+ menuModel: mainMenu.model ? mainMenu.model : null
164178 }
165179
166180 Components.Label {
plugins/Unity/Indicators/qml/MenuItemFactory.qml+138−85
@@ -22,11 +22,12 @@ import Unity.Indicators 0.1 as Indicators
2222import Unity.Indicators.Network 0.1 as ICNetwork
2323import Unity.Indicators.Messaging 0.1 as ICMessaging
2424import QMenuModel 0.1 as QMenuModel
25+import Ubuntu.Components 0.1
2526
2627Item {
2728 id: menuFactory
2829
29− property var model: null
30+ property var menuModel: null
3031
3132 property var _map: {
3233 "unity.widgets.systemsettings.tablet.volumecontrol" : sliderMenu,
@@ -49,38 +50,55 @@ Item {
4950 "unity.widgets.systemsettings.tablet.accesspoint" : accessPoint,
5051 }
5152
53+ function getExtendedProperty(object, propertyName, defaultValue) {
54+ if (object && object.hasOwnProperty(propertyName)) {
55+ return object[propertyName];
56+ }
57+ return defaultValue;
58+ }
59+
5260 Component { id: divMenu; Indicators.DivMenuItem {} }
5361
5462 Component {
5563 id: sliderMenu;
5664 Indicators.SliderMenuItem {
57− property QtObject menu: null
65+ property QtObject menuData: null
66+ property var menuModel: menuFactory.menuModel
67+ property int menuIndex: -1
68+ property var extendedData: menuData && menuData.ext || undefined
5869
59− text: menu && menu.label ? menu.label : ""
60− icon: menu && menu.icon ? menu.icon : ""
61− minIcon: menu && menu.ext.minIcon ? menu.ext.minIcon : ""
62− maxIcon: menu && menu.ext.maxIcon ? menu.ext.maxIcon : ""
70+ text: menuData && menuData.label || ""
71+ iconSource: menuData && menuData.icon || ""
72+ minIcon: getExtendedProperty(extendedData, "minIcon", "")
73+ maxIcon: getExtendedProperty(extendedData, "maxIcon", "")
6374
64− minimumValue: menu.ext.minValue ? menu.ext.minValue : 0.0
75+ minimumValue: getExtendedProperty(extendedData, "minValue", 0.0)
6576 maximumValue: {
66− var maximum = menu.ext.maxValue ? menu.ext.maxValue : 1.0
77+ var maximum = getExtendedProperty(extendedData, "maxValue", 1.0);
6778 if (maximum <= minimumValue) {
6879 return minimumValue + 1;
6980 }
7081 return maximum;
7182 }
72− value: menu ? menu.actionState : 0.0
73− enabled: menu ? menu.sensitive : false
83+ value: menuData && menuData.actionState || 0.0
84+ enabled: menuData && menuData.sensitive || false
7485
75− Component.onCompleted: {
76− model.loadExtendedAttributes(modelIndex, {'min-value': 'double',
77− 'max-value': 'double',
78− 'min-icon': 'icon',
79− 'max-icon': 'icon'});
86+ onMenuModelChanged: {
87+ loadAttributes();
88+ }
89+ onMenuIndexChanged: {
90+ loadAttributes();
8091 }
81−
8292 onChangeState: {
83− model.changeState(modelIndex, value);
93+ menuModel.changeState(menuIndex, value);
94+ }
95+
96+ function loadAttributes() {
97+ if (!menuModel || menuIndex == undefined) return;
98+ menuModel.loadExtendedAttributes(menuIndex, {'min-value': 'double',
99+ 'max-value': 'double',
100+ 'min-icon': 'icon',
101+ 'max-icon': 'icon'});
84102 }
85103 }
86104 }
@@ -88,50 +106,57 @@ Item {
88106 Component {
89107 id: buttonMenu;
90108 Indicators.ButtonMenuItem {
91− property QtObject menu: null
109+ property QtObject menuData: null
110+ property var menuModel: menuFactory.menuModel
111+ property int menuIndex: -1
92112
93− text: menu && menu.label ? menu.label : ""
94− enabled: menu ? menu.sensitive : false
113+ text: menuData && menuData.label || ""
114+ enabled: menuData && menuData.sensitive || false
95115
96116 onActivate: {
97− model.activate(modelIndex);
117+ menuModel.activate(menuIndex);
118+ shell.hideIndicatorMenu(UbuntuAnimation.FastDuration);
98119 }
99120 }
100121 }
101122 Component {
102123 id: sectionMenu;
103124 Indicators.SectionMenuItem {
104− property QtObject menu: null
125+ property QtObject menuData: null
126+ property var menuIndex: undefined
105127
106− text: menu && menu.label ? menu.label : ""
128+ text: menuData && menuData.label || ""
107129 }
108130 }
109131
110132 Component {
111133 id: progressMenu;
112134 Indicators.ProgressMenuItem {
113− property QtObject menu: null
135+ property QtObject menuData: null
136+ property int menuIndex: -1
114137
115− text: menu && menu.label ? menu.label : ""
116− icon: menu ? menu.icon : ""
117− value : menu ? menu.actionState : 0.0
118− enabled: menu ? menu.sensitive : false
138+ text: menuData && menuData.label || ""
139+ iconSource: menuData && menuData.icon || ""
140+ value : menuData && menuData.actionState || 0.0
141+ enabled: menuData && menuData.sensitive || false
119142 }
120143 }
121144
122145 Component {
123146 id: standardMenu;
124147 Indicators.StandardMenuItem {
125− property QtObject menu: null
148+ property QtObject menuData: null
149+ property int menuIndex: -1
126150
127− text: menu && menu.label ? menu.label : ""
128− icon: menu && menu.icon ? menu.icon : ""
129− checkable: menu ? (menu.isCheck || menu.isRadio) : false
130− checked: checkable ? menu.isToggled : false
131− enabled: menu ? menu.sensitive : false
151+ text: menuData && menuData.label || ""
152+ iconSource: menuData && menuData.icon || ""
153+ enabled: menuData && menuData.sensitive || false
154+ checkable: menuData ? (menuData.isCheck || menuData.isRadio) : false
155+ checked: checkable ? menuData.isToggled : false
132156
133157 onActivate: {
134− model.activate(modelIndex);
158+ menuModel.activate(menuIndex);
159+ shell.hideIndicatorMenu(UbuntuAnimation.BriskDuration);
135160 }
136161 }
137162 }
@@ -139,15 +164,17 @@ Item {
139164 Component {
140165 id: switchMenu;
141166 Indicators.SwitchMenuItem {
142− property QtObject menu: null
167+ property QtObject menuData: null
168+ property int menuIndex: -1
143169
144− text: menu && menu.label ? menu.label : ""
145− icon: menu && menu.icon ? menu.icon : ""
146− checked: menu ? menu.isToggled : false
147− enabled: menu ? menu.sensitive : false
170+ text: menuData && menuData.label || ""
171+ iconSource: menuData && menuData.icon || ""
172+ enabled: menuData && menuData.sensitive || false
173+ checked: menuData ? menuData.isToggled : false
148174
149175 onActivate: {
150− model.activate(modelIndex);
176+ menuModel.activate(menuIndex);
177+ shell.hideIndicatorMenu(UbuntuAnimation.BriskDuration);
151178 }
152179 }
153180 }
@@ -155,13 +182,24 @@ Item {
155182 Component {
156183 id: wifiSection;
157184 Indicators.SectionMenuItem {
158− property QtObject menu: null
185+ property QtObject menuData: null
186+ property var menuModel: menuFactory.menuModel
187+ property int menuIndex: -1
188+ property var extendedData: menuData && menuData.ext || undefined
189+
190+ text: menuData && menuData.label || ""
191+ busy: getExtendedProperty(extendedData, "xCanonicalBusyAction", false)
159192
160− text: menu && menu.label ? menu.label : ""
161− busy: menu ? menu.ext.xCanonicalBusyAction : false
193+ onMenuModelChanged: {
194+ loadAttributes();
195+ }
196+ onMenuIndexChanged: {
197+ loadAttributes();
198+ }
162199
163− Component.onCompleted: {
164− model.loadExtendedAttributes(modelIndex, {'x-canonical-busy-action': 'bool'});
200+ function loadAttributes() {
201+ if (!menuModel || menuIndex == undefined) return;
202+ menuModel.loadExtendedAttributes(menuIndex, {'x-canonical-busy-action': 'bool'})
165203 }
166204 }
167205 }
@@ -169,27 +207,40 @@ Item {
169207 Component {
170208 id: accessPoint;
171209 ICNetwork.AccessPoint {
172− property QtObject menu: null
210+ property QtObject menuData: null
211+ property var menuModel: menuFactory.menuModel
212+ property int menuIndex: -1
213+ property var extendedData: menuData && menuData.ext || undefined
214+
173215 property var strengthAction: QMenuModel.UnityMenuAction {
174− model: menuFactory.model ? menuFactory.model : null
175− index: modelIndex
176− name: menu ? menu.ext.xCanonicalWifiApStrengthAction : ""
216+ model: menuModel
217+ index: menuIndex
218+ name: getExtendedProperty(extendedData, "xCanonicalWifiApStrengthAction", "")
177219 }
178220
179− text: menu && menu.label ? menu.label : ""
180− secure: menu ? menu.ext.xCanonicalWifiApIsSecure : false
181− adHoc: menu ? menu.ext.xCanonicalWifiApIsAdhoc : false
182− checked: menu ? menu.isToggled : false
221+ text: menuData && menuData.label || ""
222+ enabled: menuData && menuData.sensitive || false
223+ secure: getExtendedProperty(extendedData, "xCanonicalWifiApIsSecure", false)
224+ adHoc: getExtendedProperty(extendedData, "xCanonicalWifiApIsAdhoc", false)
225+ checked: menuData ? menuData.isToggled : false
183226 signalStrength: strengthAction.valid ? strengthAction.state : 0
184− enabled: menu ? menu.sensitive : false
185227
186− Component.onCompleted: {
187− model.loadExtendedAttributes(modelIndex, {'x-canonical-wifi-ap-is-adhoc': 'bool',
188− 'x-canonical-wifi-ap-is-secure': 'bool',
189− 'x-canonical-wifi-ap-strength-action': 'string'});
228+ onMenuModelChanged: {
229+ loadAttributes();
230+ }
231+ onMenuIndexChanged: {
232+ loadAttributes();
190233 }
191234 onActivate: {
192− model.activate(modelIndex);
235+ menuModel.activate(menuIndex);
236+ shell.hideIndicatorMenu(UbuntuAnimation.BriskDuration);
237+ }
238+
239+ function loadAttributes() {
240+ if (!menuModel || menuIndex == undefined) return;
241+ menuModel.loadExtendedAttributes(menuIndex, {'x-canonical-wifi-ap-is-adhoc': 'bool',
242+ 'x-canonical-wifi-ap-is-secure': 'bool',
243+ 'x-canonical-wifi-ap-strength-action': 'string'});
193244 }
194245 }
195246 }
@@ -197,37 +248,40 @@ Item {
197248 Component {
198249 id: messageItem
199250 ICMessaging.MessageMenuItemFactory {
200−
201− property QtObject menu: null
202− model: menuFactory.model ? menuFactory.model : null
203−
204− Component.onCompleted: {
205− model.loadExtendedAttributes(modelIndex, {'x-canonical-time': 'int64',
206− 'x-canonical-text': 'string',
207− 'x-canonical-message-actions': 'variant',
208− 'icon': 'icon',
209− 'x-canonical-app-icon': 'icon'});
210− }
251+ menuModel: menuFactory.menuModel
211252 }
212253 }
213254
214255 Component {
215256 id: groupedMessage
216257 ICMessaging.GroupedMessage {
217− property QtObject menu: null
218−
219− title: menu && menu.label ? menu.label : ""
220− count: menu && menu.actionState[0] ? menu.actionState[0] : "0"
221− appIcon: menu && menu.ext.icon !== undefined ? menu.ext.icon : "qrc:/indicators/artwork/messaging/default_app.svg"
222−
223− Component.onCompleted: {
224− model.loadExtendedAttributes(modelIndex, {'icon': 'icon'});
258+ property QtObject menuData: null
259+ property var menuModel: menuFactory.menuModel
260+ property int menuIndex: -1
261+ property var extendedData: menuData && menuData.ext || undefined
262+
263+ title: menuData && menuData.label || ""
264+ appIcon: getExtendedProperty(extendedData, "icon", "qrc:/indicators/artwork/messaging/default_app.svg")
265+ count: menuData && menuData.actionState.length > 0 ? menuData.actionState[0] : "0"
266+ enabled: menuData && menuData.sensitive || false
267+
268+ onMenuModelChanged: {
269+ loadAttributes();
270+ }
271+ onMenuIndexChanged: {
272+ loadAttributes();
225273 }
226274 onActivateApp: {
227− model.activate(modelIndex, true);
275+ menuModel.activate(menuIndex, true);
276+ shell.hideIndicatorMenu(UbuntuAnimation.FastDuration);
228277 }
229278 onDismiss: {
230− model.activate(modelIndex, false);
279+ menuModel.activate(menuIndex, false);
280+ }
281+
282+ function loadAttributes() {
283+ if (!menuModel || menuIndex == undefined) return;
284+ menuModel.loadExtendedAttributes(modelIndex, {'icon': 'icon'});
231285 }
232286 }
233287 }
@@ -238,10 +292,9 @@ Item {
238292 if (component !== undefined) {
239293 return component;
240294 }
241− } else {
242− if (modelData.isSeparator) {
243− return divMenu;
244− }
295+ }
296+ if (modelData.isSeparator) {
297+ return divMenu;
245298 }
246299 return standardMenu;
247300 }
plugins/Utils/CMakeLists.txt+1
@@ -16,6 +16,7 @@ set(QMLPLUGIN_SRC
1616 mediaartcache.cpp
1717 qlimitproxymodelqml.cpp
1818 qsortfilterproxymodelqml.cpp
19+ timeformatter.cpp
1920 unitymenumodelpaths.cpp
2021 plugin.cpp
2122 )
plugins/Utils/plugin.cpp+3
@@ -30,6 +30,7 @@
3030#include "bottombarvisibilitycommunicatorshell.h"
3131#include "qlimitproxymodelqml.h"
3232#include "qsortfilterproxymodelqml.h"
33+#include "timeformatter.h"
3334#include "unitymenumodelpaths.h"
3435
3536static const char* BOTTOM_BAR_VISIBILITY_COMMUNICATOR_DBUS_PATH = "/BottomBarVisibilityCommunicator";
@@ -42,6 +43,8 @@ void UtilsPlugin::registerTypes(const char *uri)
4243 qmlRegisterType<QLimitProxyModelQML>(uri, 0, 1, "LimitProxyModel");
4344 qmlRegisterType<QSortFilterProxyModelQML>(uri, 0, 1, "SortFilterProxyModel");
4445 qmlRegisterType<UnityMenuModelPaths>(uri, 0, 1, "UnityMenuModelPaths");
46+ qmlRegisterType<TimeFormatter>(uri, 0, 1, "TimeFormatter");
47+ qmlRegisterType<GDateTimeFormatter>(uri, 0, 1, "GDateTimeFormatter");
4548 qmlRegisterUncreatableType<BottomBarVisibilityCommunicatorShell>(uri, 0, 1, "BottomBarVisibilityCommunicatorShell", "Can't create BottomBarVisibilityCommunicatorShell");
4649}
4750
plugins/Unity/Indicators/timeformatter.cpp → plugins/Utils/timeformatter.cpprenamed+30−1
@@ -167,6 +167,35 @@ void TimeFormatter::setTime(qint64 time)
167167
168168void TimeFormatter::update()
169169{
170− priv->timeString = QDateTime::fromMSecsSinceEpoch(priv->time / 1000).toString(priv->format);
170+ priv->timeString = formatTime();
171171 Q_EMIT timeStringChanged(priv->timeString);
172172}
173+
174+QString TimeFormatter::formatTime() const
175+{
176+ return QDateTime::fromMSecsSinceEpoch(time() / 1000).toString(format());
177+}
178+
179+GDateTimeFormatter::GDateTimeFormatter(QObject* parent)
180+: TimeFormatter(parent)
181+{
182+}
183+
184+QString GDateTimeFormatter::formatTime() const
185+{
186+ gchar* time_string;
187+ GDateTime* datetime;
188+ QByteArray formatBytes = format().toUtf8();
189+
190+ datetime = g_date_time_new_from_unix_local(time());
191+ if (!datetime) {
192+ return "";
193+ }
194+
195+ time_string = g_date_time_format(datetime, formatBytes.constData());
196+ QString formattedTime(QString::fromUtf8(time_string));
197+
198+ g_free(time_string);
199+ g_date_time_unref(datetime);
200+ return formattedTime;
201+}
plugins/Unity/Indicators/timeformatter.h → plugins/Utils/timeformatter.hrenamed+15−3
@@ -19,10 +19,10 @@
1919#ifndef TIME_FORMATTER_H
2020#define TIME_FORMATTER_H
2121
22−#include "unityindicatorsglobal.h"
2322#include <QObject>
2423
25−class UNITYINDICATORS_EXPORT TimeFormatter : public QObject
24+// TODO - bug #1260728
25+class TimeFormatter : public QObject
2626{
2727 Q_OBJECT
2828 Q_PROPERTY(QString format READ format WRITE setFormat NOTIFY formatChanged)
@@ -31,7 +31,7 @@ class UNITYINDICATORS_EXPORT TimeFormatter : public QObject
3131
3232public:
3333 TimeFormatter(QObject *parent = 0);
34− ~TimeFormatter();
34+ virtual ~TimeFormatter();
3535
3636 QString format() const;
3737 QString timeString() const;
@@ -47,8 +47,20 @@ Q_SIGNALS:
4747 void timeStringChanged(const QString &timeString);
4848 void timeChanged(qint64 time);
4949
50+protected:
51+ virtual QString formatTime() const;
52+
5053private:
5154 struct TimeFormatterPrivate *priv;
5255};
5356
57+class GDateTimeFormatter : public TimeFormatter
58+{
59+public:
60+ GDateTimeFormatter(QObject *parent = 0);
61+
62+protected:
63+ virtual QString formatTime() const;
64+};
65+
5466#endif
po/ast.po+6−6
@@ -8,15 +8,15 @@ msgstr ""
88"Project-Id-Version: unity8\n"
99"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
1010"POT-Creation-Date: 2013-11-29 09:21+0100\n"
11−"PO-Revision-Date: 2013-10-03 14:02+0000\n"
11+"PO-Revision-Date: 2013-12-11 20:45+0000\n"
1212"Last-Translator: ivarela <ivarela@ubuntu.com>\n"
1313"Language-Team: Asturian <ast@li.org>\n"
1414"MIME-Version: 1.0\n"
1515"Content-Type: text/plain; charset=UTF-8\n"
1616"Content-Transfer-Encoding: 8bit\n"
1717"Plural-Forms: nplurals=2; plural=n != 1;\n"
18−"X-Launchpad-Export-Date: 2013-11-30 05:33+0000\n"
19−"X-Generator: Launchpad (build 16856)\n"
18+"X-Launchpad-Export-Date: 2013-12-12 06:02+0000\n"
19+"X-Generator: Launchpad (build 16869)\n"
2020
2121#: Components/EdgeDemoOverlay.qml:151
2222msgid "Skip intro"
@@ -141,7 +141,7 @@ msgstr "Falando…"
141141
142142#: Notifications/NotificationMenuItemFactory.qml:89
143143msgid "Show password"
144−msgstr ""
144+msgstr "Amosar contraseña"
145145
146146#: Panel/SearchIndicator.qml:27
147147msgid "Search"
@@ -150,11 +150,11 @@ msgstr "Guetar"
150150#: plugins/Unity/Launcher/launcheritem.cpp:43
151151#: plugins/Unity/Launcher/launcheritem.cpp:73
152152msgid "Lock to Launcher"
153−msgstr ""
153+msgstr "Caltener nel Llanzador"
154154
155155#: plugins/Unity/Launcher/launcheritem.cpp:73
156156msgid "Unlock from Launcher"
157−msgstr ""
157+msgstr "Nun caltener nel llanzador"
158158
159159#: Shell.qml:439
160160#, qt-format
po/my.po+10−10
@@ -8,15 +8,15 @@ msgstr ""
88"Project-Id-Version: unity\n"
99"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
1010"POT-Creation-Date: 2013-11-29 09:21+0100\n"
11−"PO-Revision-Date: 2013-10-09 11:35+0000\n"
11+"PO-Revision-Date: 2013-12-12 11:12+0000\n"
1212"Last-Translator: Pyae Sone <Unknown>\n"
1313"Language-Team: Burmese <my@li.org>\n"
1414"MIME-Version: 1.0\n"
1515"Content-Type: text/plain; charset=UTF-8\n"
1616"Content-Transfer-Encoding: 8bit\n"
1717"Plural-Forms: nplurals=1; plural=0;\n"
18−"X-Launchpad-Export-Date: 2013-11-30 05:33+0000\n"
19−"X-Generator: Launchpad (build 16856)\n"
18+"X-Launchpad-Export-Date: 2013-12-13 06:46+0000\n"
19+"X-Generator: Launchpad (build 16869)\n"
2020
2121#: Components/EdgeDemoOverlay.qml:151
2222msgid "Skip intro"
@@ -104,16 +104,16 @@ msgstr "မှတ်ချက်များ-"
104104
105105#: Greeter/Lockscreen.qml:149
106106msgid "Emergency Call"
107−msgstr ""
107+msgstr "အရေးပေါ်ခေါ်မည်"
108108
109109#: Greeter/PassphraseLockscreen.qml:59
110110#, qt-format
111111msgid "Hello %1"
112−msgstr ""
112+msgstr "ဟဲလို %1"
113113
114114#: Greeter/PassphraseLockscreen.qml:59
115115msgid "Hello"
116−msgstr ""
116+msgstr "ဟဲလို"
117117
118118#: Hud/HudParametrizedActionsPage.qml:132
119119msgid "Confirm"
@@ -137,7 +137,7 @@ msgstr "ပြောနေသည်"
137137
138138#: Notifications/NotificationMenuItemFactory.qml:89
139139msgid "Show password"
140−msgstr ""
140+msgstr "စကားဝှက်ကိုပြ"
141141
142142#: Panel/SearchIndicator.qml:27
143143msgid "Search"
@@ -146,13 +146,13 @@ msgstr "ရှာဖွေ"
146146#: plugins/Unity/Launcher/launcheritem.cpp:43
147147#: plugins/Unity/Launcher/launcheritem.cpp:73
148148msgid "Lock to Launcher"
149−msgstr ""
149+msgstr "Launcher တွင်ထားမည်"
150150
151151#: plugins/Unity/Launcher/launcheritem.cpp:73
152152msgid "Unlock from Launcher"
153−msgstr ""
153+msgstr "Launcher မှဖြုတ်မည်"
154154
155155#: Shell.qml:439
156156#, qt-format
157157msgid "Please enter %1"
158−msgstr ""
158+msgstr "%1ကိုရိုက်ထည့်ပါ"
po/tr.po+7−7
@@ -8,15 +8,15 @@ msgstr ""
88"Project-Id-Version: unity\n"
99"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
1010"POT-Creation-Date: 2013-11-29 09:21+0100\n"
11−"PO-Revision-Date: 2013-10-01 13:21+0000\n"
12−"Last-Translator: Volkan Gezer <Unknown>\n"
11+"PO-Revision-Date: 2013-12-12 16:06+0000\n"
12+"Last-Translator: Arda Ünlü <aarda.uunlu@gmail.com>\n"
1313"Language-Team: Turkish <tr@li.org>\n"
1414"MIME-Version: 1.0\n"
1515"Content-Type: text/plain; charset=UTF-8\n"
1616"Content-Transfer-Encoding: 8bit\n"
1717"Plural-Forms: nplurals=2; plural=n != 1;\n"
18−"X-Launchpad-Export-Date: 2013-11-30 05:33+0000\n"
19−"X-Generator: Launchpad (build 16856)\n"
18+"X-Launchpad-Export-Date: 2013-12-13 06:46+0000\n"
19+"X-Generator: Launchpad (build 16869)\n"
2020
2121#: Components/EdgeDemoOverlay.qml:151
2222msgid "Skip intro"
@@ -138,7 +138,7 @@ msgstr "Konuşuyor..."
138138
139139#: Notifications/NotificationMenuItemFactory.qml:89
140140msgid "Show password"
141−msgstr ""
141+msgstr "Parolayı göster"
142142
143143#: Panel/SearchIndicator.qml:27
144144msgid "Search"
@@ -147,11 +147,11 @@ msgstr "Ara"
147147#: plugins/Unity/Launcher/launcheritem.cpp:43
148148#: plugins/Unity/Launcher/launcheritem.cpp:73
149149msgid "Lock to Launcher"
150−msgstr ""
150+msgstr "Başlatıcıya Sabitle"
151151
152152#: plugins/Unity/Launcher/launcheritem.cpp:73
153153msgid "Unlock from Launcher"
154−msgstr ""
154+msgstr "Başlatıcıdan Ayır"
155155
156156#: Shell.qml:439
157157#, qt-format
Bottombar/Bottombar.qml → qml/Bottombar/Bottombar.qmlrenamed

The content is the same.

Bottombar/HudButton.qml → qml/Bottombar/HudButton.qmlrenamed

The content is the same.

Bottombar/graphics/hud@20.png → qml/Bottombar/graphics/hud@20.pngrenamed

Binary file not shown.

Bottombar/graphics/hud_invoke_button_active@20.png → qml/Bottombar/graphics/hud_invoke_button_active@20.pngrenamed

Binary file not shown.

qml/CMakeLists.txtnew file+22
@@ -0,0 +1,22 @@
1+file(GLOB QML_JS_FILES *.qml *.js)
2+
3+install(FILES ${QML_JS_FILES}
4+ DESTINATION ${SHELL_APP_DIR}
5+ )
6+
7+set(QML_DIRS
8+ Bottombar
9+ Components
10+ Dash
11+ graphics
12+ Greeter
13+ Hud
14+ Panel
15+ Launcher
16+ SideStage
17+ Notifications
18+ )
19+
20+install(DIRECTORY ${QML_DIRS}
21+ DESTINATION ${SHELL_APP_DIR}
22+ )
Components/AnimationControllerWithSignals.qml → qml/Components/AnimationControllerWithSignals.qmlrenamed

The content is the same.

Components/ApplicationManagerWrapper.qml → qml/Components/ApplicationManagerWrapper.qmlrenamed

The content is the same.

Components/ApplicationScreenshot.qml → qml/Components/ApplicationScreenshot.qmlrenamed

The content is the same.

Components/ApplicationsModelStageFiltered.qml → qml/Components/ApplicationsModelStageFiltered.qmlrenamed

The content is the same.

Components/BaseCarouselDelegate.qml → qml/Components/BaseCarouselDelegate.qmlrenamed

The content is the same.

Components/Carousel.qml → qml/Components/Carousel.qmlrenamed

The content is the same.

Components/Circle.qml → qml/Components/Circle.qmlrenamed

The content is the same.

Components/DragHandle.qml → qml/Components/DragHandle.qmlrenamed

The content is the same.

Components/DraggingArea.qml → qml/Components/DraggingArea.qmlrenamed

The content is the same.

Components/EdgeDemo.qml → qml/Components/EdgeDemo.qmlrenamed

The content is the same.

Components/EdgeDemoOverlay.qml → qml/Components/EdgeDemoOverlay.qmlrenamed

The content is the same.

Components/EdgeDragArea.qml → qml/Components/EdgeDragArea.qmlrenamed

The content is the same.

Components/EdgeDragEvaluator.qml → qml/Components/EdgeDragEvaluator.qmlrenamed

The content is the same.

Components/FilterGrid.qml → qml/Components/FilterGrid.qmlrenamed

The content is the same.

Components/LazyImage.qml → qml/Components/LazyImage.qmlrenamed

The content is the same.

Components/ListItems/Base.qml → qml/Components/ListItems/Base.qmlrenamed

The content is the same.

Components/ListItems/Header.qml → qml/Components/ListItems/Header.qmlrenamed

The content is the same.

Components/ListItems/Highlight.qml → qml/Components/ListItems/Highlight.qmlrenamed

The content is the same.

Components/ListItems/ThinDivider.qml → qml/Components/ListItems/ThinDivider.qmlrenamed

The content is the same.

Components/ListItems/VerticalThinDivider.qml → qml/Components/ListItems/VerticalThinDivider.qmlrenamed

The content is the same.

Components/ListItems/graphics/ListItemDividerHorizontal@18.png → qml/Components/ListItems/graphics/ListItemDividerHorizontal@18.pngrenamed

Binary file not shown.

Components/ListItems/graphics/ListItemDividerVertical@18.png → qml/Components/ListItems/graphics/ListItemDividerVertical@18.pngrenamed

Binary file not shown.

Components/OpenEffect.qml → qml/Components/OpenEffect.qmlrenamed

The content is the same.

Components/PageHeader.qml → qml/Components/PageHeader.qmlrenamed

The content is the same.

Components/PinPadButton.qml → qml/Components/PinPadButton.qmlrenamed

The content is the same.

Components/RatingStars.qml → qml/Components/RatingStars.qmlrenamed

The content is the same.

Components/ResponsiveFlowView.qml → qml/Components/ResponsiveFlowView.qmlrenamed

The content is the same.

Components/ResponsiveGridView.qml → qml/Components/ResponsiveGridView.qmlrenamed

The content is the same.

Components/Revealer.qml → qml/Components/Revealer.qmlrenamed

The content is the same.

Components/SearchHistoryModel.qml → qml/Components/SearchHistoryModel.qmlrenamed

The content is the same.

Components/Showable.qml → qml/Components/Showable.qmlrenamed

The content is the same.

Components/Stage.qml → qml/Components/Stage.qmlrenamed

The content is the same.

Components/StandardAnimation.qml → qml/Components/StandardAnimation.qmlrenamed

The content is the same.

Components/Tile.qml → qml/Components/Tile.qmlrenamed

The content is the same.

Components/TileStyle.qml → qml/Components/TileStyle.qmlrenamed

The content is the same.

Components/UbuntuShapeForItem.qml → qml/Components/UbuntuShapeForItem.qmlrenamed

The content is the same.

Components/VolumeControl.qml → qml/Components/VolumeControl.qmlrenamed

The content is the same.

Components/WrongPasswordAnimation.qml → qml/Components/WrongPasswordAnimation.qmlrenamed

The content is the same.

Components/carousel.js → qml/Components/carousel.jsrenamed

The content is the same.

Components/graphics/PageHeaderBaseDivider@18.png → qml/Components/graphics/PageHeaderBaseDivider@18.pngrenamed

Binary file not shown.

Components/graphics/PageHeaderBaseDivider@18.sci → qml/Components/graphics/PageHeaderBaseDivider@18.scirenamed

The content is the same.

Components/graphics/close@20.png → qml/Components/graphics/close@20.pngrenamed

Binary file not shown.

Components/graphics/icon_star_off@20.png → qml/Components/graphics/icon_star_off@20.pngrenamed

Binary file not shown.

Components/graphics/icon_star_on@20.png → qml/Components/graphics/icon_star_on@20.pngrenamed

Binary file not shown.

Components/graphics/non-selected@18.png → qml/Components/graphics/non-selected@18.pngrenamed

Binary file not shown.

Components/graphics/non-selected@18.sci → qml/Components/graphics/non-selected@18.scirenamed

The content is the same.

Dash/Apps/AppPreview.qml → qml/Dash/Apps/AppPreview.qmlrenamed

The content is the same.

Dash/Apps/CloseIcon.qml → qml/Dash/Apps/CloseIcon.qmlrenamed

The content is the same.

Dash/Apps/DashPluginFilterGrid.qml → qml/Dash/Apps/DashPluginFilterGrid.qmlrenamed

The content is the same.

Dash/Apps/FrequentlyUsedAppsModel.qml → qml/Dash/Apps/FrequentlyUsedAppsModel.qmlrenamed

The content is the same.

Dash/Apps/RunningApplicationTile.qml → qml/Dash/Apps/RunningApplicationTile.qmlrenamed

The content is the same.

Dash/Apps/RunningApplicationsGrid.qml → qml/Dash/Apps/RunningApplicationsGrid.qmlrenamed

The content is the same.

Dash/Apps/graphics/close_btn@9.png → qml/Dash/Apps/graphics/close_btn@9.pngrenamed

Binary file not shown.

Dash/Dash.qml → qml/Dash/Dash.qmlrenamed

The content is the same.

Dash/DashApps.qml → qml/Dash/DashApps.qmlrenamed

The content is the same.

Dash/DashBar.qml → qml/Dash/DashBar.qmlrenamed

The content is the same.

Dash/DashCarousel.qml → qml/Dash/DashCarousel.qmlrenamed

The content is the same.

Dash/DashContent.qml → qml/Dash/DashContent.qmlrenamed

The content is the same.

Dash/DashFilterGrid.qml → qml/Dash/DashFilterGrid.qmlrenamed+3−2
@@ -35,8 +35,6 @@ DashRenderer {
3535 rows: filter ? filterGrid.collapsedRowCount : filterGrid.uncollapsedRowCount
3636 currentItem: filterGrid.currentItem
3737 expandable: filterGrid.expandable
38− delegateCreationBegin: filterGrid.delegateCreationBegin
39− delegateCreationEnd: filterGrid.delegateCreationEnd
4038 height: filterGrid.height
4139 margins: filterGrid.margins
4240 uncollapsedHeight: filterGrid.uncollapsedHeight
@@ -56,9 +54,12 @@ DashRenderer {
5654 model: dashFilterGrid.model
5755 filter: dashFilterGrid.filter
5856 highlightIndex: dashFilterGrid.highlightIndex
57+ delegateCreationBegin: dashFilterGrid.delegateCreationBegin
58+ delegateCreationEnd: dashFilterGrid.delegateCreationEnd
5959
6060 onFilterChanged: {
6161 dashFilterGrid.filter = filter
62+ filter = Qt.binding(function() { return dashFilterGrid.filter })
6263 }
6364 }
6465}
Dash/DashHome.qml → qml/Dash/DashHome.qmlrenamed

The content is the same.

Dash/DashPreview.qml → qml/Dash/DashPreview.qmlrenamed

The content is the same.

Dash/DashPreviewPlaceholder.qml → qml/Dash/DashPreviewPlaceholder.qmlrenamed

The content is the same.

Dash/DashRenderer.qml → qml/Dash/DashRenderer.qmlrenamed+2−2
@@ -38,9 +38,9 @@ Item {
3838
3939 property int uncollapsedHeight: height
4040
41− property real delegateCreationBegin
41+ property var delegateCreationBegin: undefined
4242
43− property real delegateCreationEnd
43+ property var delegateCreationEnd: undefined
4444
4545 property real verticalSpacing: 0
4646
Dash/Generic/FlatTileStyle.qml → qml/Dash/Generic/FlatTileStyle.qmlrenamed

The content is the same.

Dash/Generic/GenericCarousel.qml → qml/Dash/Generic/GenericCarousel.qmlrenamed

The content is the same.

Dash/Generic/GenericFilterGrid.qml → qml/Dash/Generic/GenericFilterGrid.qmlrenamed

The content is the same.

Dash/Generic/GenericFilterGridPotrait.qml → qml/Dash/Generic/GenericFilterGridPotrait.qmlrenamed

The content is the same.

Dash/Generic/GenericPreview.qml → qml/Dash/Generic/GenericPreview.qmlrenamed

The content is the same.

Dash/Generic/WeatherFilterGrid.qml → qml/Dash/Generic/WeatherFilterGrid.qmlrenamed

The content is the same.

Dash/GenericScopeView.qml → qml/Dash/GenericScopeView.qmlrenamed

The content is the same.

Dash/Movie/MoviePreview.qml → qml/Dash/Movie/MoviePreview.qmlrenamed

The content is the same.

Dash/Music/CarouselDelegateMusic.qml → qml/Dash/Music/CarouselDelegateMusic.qmlrenamed

The content is the same.

Dash/Music/MusicCarousel.qml → qml/Dash/Music/MusicCarousel.qmlrenamed

The content is the same.

Dash/Music/MusicFilterGrid.qml → qml/Dash/Music/MusicFilterGrid.qmlrenamed

The content is the same.

Dash/Music/MusicPreview.qml → qml/Dash/Music/MusicPreview.qmlrenamed

The content is the same.

Dash/Music/MusicTileStyle.qml → qml/Dash/Music/MusicTileStyle.qmlrenamed

The content is the same.

Dash/Music/graphics/music_progress_bg.png → qml/Dash/Music/graphics/music_progress_bg.pngrenamed

Binary file not shown.

Dash/PreviewDelegateMapper.qml → qml/Dash/PreviewDelegateMapper.qmlrenamed

The content is the same.

Dash/Previews/Header.qml → qml/Dash/Previews/Header.qmlrenamed

The content is the same.

Dash/Previews/Reviews.qml → qml/Dash/Previews/Reviews.qmlrenamed

The content is the same.

Dash/ScopeDelegateMapper.qml → qml/Dash/ScopeDelegateMapper.qmlrenamed

The content is the same.

Dash/ScopeListView.qml → qml/Dash/ScopeListView.qmlrenamed+1−1
@@ -15,7 +15,7 @@
1515 */
1616
1717import QtQuick 2.0
18−import ListViewWithPageHeader 0.1
18+import DashViews 0.1
1919
2020ListViewWithPageHeader {
2121 maximumFlickVelocity: height * 10
Dash/SearchableResultModel.qml → qml/Dash/SearchableResultModel.qmlrenamed

The content is the same.

Dash/Video/CarouselDelegateVideo.qml → qml/Dash/Video/CarouselDelegateVideo.qmlrenamed

The content is the same.

Dash/Video/VideoCarousel.qml → qml/Dash/Video/VideoCarousel.qmlrenamed

The content is the same.

Dash/Video/VideoFilterGrid.qml → qml/Dash/Video/VideoFilterGrid.qmlrenamed

The content is the same.

Dash/Video/VideoTileStyle.qml → qml/Dash/Video/VideoTileStyle.qmlrenamed

The content is the same.

Dash/Video/graphics/icon_button_amazon@20.png → qml/Dash/Video/graphics/icon_button_amazon@20.pngrenamed

Binary file not shown.

Dash/Video/graphics/icon_button_u1@20.png → qml/Dash/Video/graphics/icon_button_u1@20.pngrenamed

Binary file not shown.

Dash/Video/graphics/movie_icon_holder@27.png → qml/Dash/Video/graphics/movie_icon_holder@27.pngrenamed

Binary file not shown.

Dash/graphics/header_handlearrow2@20.png → qml/Dash/graphics/header_handlearrow2@20.pngrenamed

Binary file not shown.

Dash/graphics/header_handlearrow@20.png → qml/Dash/graphics/header_handlearrow@20.pngrenamed

Binary file not shown.

Dash/graphics/icon_clear@20.png → qml/Dash/graphics/icon_clear@20.pngrenamed

Binary file not shown.

Dash/graphics/icon_listview_clear@20.png → qml/Dash/graphics/icon_listview_clear@20.pngrenamed

Binary file not shown.

Dash/graphics/icon_search_active@20.png → qml/Dash/graphics/icon_search_active@20.pngrenamed

Binary file not shown.

Dash/graphics/icon_search_inactive@20.png → qml/Dash/graphics/icon_search_inactive@20.pngrenamed

Binary file not shown.

Dash/graphics/phone/screenshots/browser@12.png → qml/Dash/graphics/phone/screenshots/browser@12.pngrenamed

Binary file not shown.

Dash/graphics/phone/screenshots/camera@12.png → qml/Dash/graphics/phone/screenshots/camera@12.pngrenamed

Binary file not shown.

Dash/graphics/phone/screenshots/facebook@12.png → qml/Dash/graphics/phone/screenshots/facebook@12.pngrenamed

Binary file not shown.

Dash/graphics/phone/screenshots/gallery@12.png → qml/Dash/graphics/phone/screenshots/gallery@12.pngrenamed

Binary file not shown.

Dash/graphics/phone/screenshots/map@12.png → qml/Dash/graphics/phone/screenshots/map@12.pngrenamed

Binary file not shown.

Dash/graphics/phone/screenshots/music@12.png → qml/Dash/graphics/phone/screenshots/music@12.pngrenamed

Binary file not shown.

Dash/graphics/phone/screenshots/phone@12.png → qml/Dash/graphics/phone/screenshots/phone@12.pngrenamed

Binary file not shown.

Dash/graphics/phone/screenshots/settings@12.png → qml/Dash/graphics/phone/screenshots/settings@12.pngrenamed

Binary file not shown.

Dash/graphics/phone/screenshots/twitter@12.png → qml/Dash/graphics/phone/screenshots/twitter@12.pngrenamed

Binary file not shown.

Dash/graphics/play_button@18.png → qml/Dash/graphics/play_button@18.pngrenamed

Binary file not shown.

Dash/graphics/play_button_active@18.png → qml/Dash/graphics/play_button_active@18.pngrenamed

Binary file not shown.

Dash/graphics/play_button_active_big@20.png → qml/Dash/graphics/play_button_active_big@20.pngrenamed

Binary file not shown.

Dash/graphics/play_button_big@20.png → qml/Dash/graphics/play_button_big@20.pngrenamed

Binary file not shown.

Dash/graphics/tablet/icon_close_preview@20.png → qml/Dash/graphics/tablet/icon_close_preview@20.pngrenamed

Binary file not shown.

Dash/graphics/tooltip_arrow@27.png → qml/Dash/graphics/tooltip_arrow@27.pngrenamed

Binary file not shown.

Greeter/Clock.qml → qml/Greeter/Clock.qmlrenamed

The content is the same.

Greeter/Dot.qml → qml/Greeter/Dot.qmlrenamed

The content is the same.

Greeter/Gradient.js → qml/Greeter/Gradient.jsrenamed

The content is the same.

Greeter/Greeter.qml → qml/Greeter/Greeter.qmlrenamed

The content is the same.

Greeter/GreeterContent.qml → qml/Greeter/GreeterContent.qmlrenamed

The content is the same.

Greeter/Infographics.qml → qml/Greeter/Infographics.qmlrenamed

The content is the same.

Greeter/Lockscreen.qml → qml/Greeter/Lockscreen.qmlrenamed+2−2
@@ -30,9 +30,9 @@ Showable {
3030 // In case the Lockscreen can show a greeter message, this is the username
3131 property string username: ""
3232
33− // As the numeric PIN pad doesn't have a OK button by design, we need to auto-confirm on a certain length.
33+ // Set this to a value greater 0 to enable auto-confirm behavior for the lockscreen.
3434 // This is ignored by the alphaNumeric lockscreen as that one is confirmed with pressing enter on the OSK.
35− property int pinLength: 4
35+ property int pinLength: -1
3636
3737 property url background: ""
3838
Greeter/LoginList.qml → qml/Greeter/LoginList.qmlrenamed

The content is the same.

Greeter/ObjectPositioner.qml → qml/Greeter/ObjectPositioner.qmlrenamed

The content is the same.

Greeter/PassphraseLockscreen.qml → qml/Greeter/PassphraseLockscreen.qmlrenamed

The content is the same.

Greeter/PinLockscreen.qml → qml/Greeter/PinLockscreen.qmlrenamed

The content is the same.

Greeter/graphics/dot_empty.png → qml/Greeter/graphics/dot_empty.pngrenamed

Binary file not shown.

Greeter/graphics/dot_filled.png → qml/Greeter/graphics/dot_filled.pngrenamed

Binary file not shown.

Greeter/graphics/dot_pointer.png → qml/Greeter/graphics/dot_pointer.pngrenamed

Binary file not shown.

Greeter/graphics/icon_arrow.png → qml/Greeter/graphics/icon_arrow.pngrenamed

Binary file not shown.

Greeter/graphics/infographic_circle_back.png → qml/Greeter/graphics/infographic_circle_back.pngrenamed

Binary file not shown.

Hud/Hud.qml → qml/Hud/Hud.qmlrenamed

The content is the same.

Hud/HudParametrizedActionsPage.qml → qml/Hud/HudParametrizedActionsPage.qmlrenamed

The content is the same.

Hud/Result.qml → qml/Hud/Result.qmlrenamed

The content is the same.

Hud/ResultList.qml → qml/Hud/ResultList.qmlrenamed

The content is the same.

Hud/SearchBar.qml → qml/Hud/SearchBar.qmlrenamed

The content is the same.

Hud/ShowingAnimation.qml → qml/Hud/ShowingAnimation.qmlrenamed

The content is the same.

Hud/SliderLabel.qml → qml/Hud/SliderLabel.qmlrenamed

The content is the same.

Hud/SoundAmplitudeDelegate.qml → qml/Hud/SoundAmplitudeDelegate.qmlrenamed

The content is the same.

Hud/SoundAmplitudeVisual.qml → qml/Hud/SoundAmplitudeVisual.qmlrenamed

The content is the same.

Hud/ToolBar.qml → qml/Hud/ToolBar.qmlrenamed

The content is the same.

Hud/ToolBarIcon.qml → qml/Hud/ToolBarIcon.qmlrenamed

The content is the same.

Hud/graphics/divider@20.png → qml/Hud/graphics/divider@20.pngrenamed

Binary file not shown.

Hud/graphics/divider@20.sci → qml/Hud/graphics/divider@20.scirenamed

The content is the same.

Hud/graphics/dropshadow_right@20.png → qml/Hud/graphics/dropshadow_right@20.pngrenamed

Binary file not shown.

Hud/graphics/help@20.png → qml/Hud/graphics/help@20.pngrenamed

Binary file not shown.

Hud/graphics/hud_bg@20.png → qml/Hud/graphics/hud_bg@20.pngrenamed

Binary file not shown.

Hud/graphics/hud_handlearrow@20.png → qml/Hud/graphics/hud_handlearrow@20.pngrenamed

Binary file not shown.

Hud/graphics/hud_handlebar@20.png → qml/Hud/graphics/hud_handlebar@20.pngrenamed

Binary file not shown.

Hud/graphics/icon_arrow@20.png → qml/Hud/graphics/icon_arrow@20.pngrenamed

Binary file not shown.

Hud/graphics/icon_clear@20.png → qml/Hud/graphics/icon_clear@20.pngrenamed

Binary file not shown.

Hud/graphics/icon_search@20.png → qml/Hud/graphics/icon_search@20.pngrenamed

Binary file not shown.

Hud/graphics/microphone@20.png → qml/Hud/graphics/microphone@20.pngrenamed

Binary file not shown.

Hud/graphics/popup_triangle@20.png → qml/Hud/graphics/popup_triangle@20.pngrenamed

Binary file not shown.

Hud/graphics/settings@20.png → qml/Hud/graphics/settings@20.pngrenamed

Binary file not shown.

Hud/graphics/undo@20.png → qml/Hud/graphics/undo@20.pngrenamed

Binary file not shown.

Hud/graphics/view-fullscreen@20.png → qml/Hud/graphics/view-fullscreen@20.pngrenamed

Binary file not shown.

Launcher/FoldingLauncherDelegate.qml → qml/Launcher/FoldingLauncherDelegate.qmlrenamed

The content is the same.

Launcher/Launcher.qml → qml/Launcher/Launcher.qmlrenamed+3−3
@@ -41,7 +41,7 @@ Item {
4141 signal dash()
4242
4343 // emitted when the dash icon in the launcher has been tapped
44− signal dashItemSelected()
44+ signal showDashHome()
4545
4646 onStateChanged: {
4747 if (state == "") {
@@ -161,9 +161,9 @@ Item {
161161 root.state = ""
162162 launcherApplicationSelected(appId)
163163 }
164− onDashItemSelected: {
164+ onShowDashHome: {
165165 root.state = ""
166− root.dashItemSelected(index)
166+ root.showDashHome();
167167 }
168168
169169 onPreventHidingChanged: {
Launcher/LauncherDelegate.qml → qml/Launcher/LauncherDelegate.qmlrenamed

The content is the same.

Launcher/LauncherPanel.qml → qml/Launcher/LauncherPanel.qmlrenamed+2−2
@@ -36,7 +36,7 @@ Item {
3636 property int highlightIndex: -1
3737
3838 signal applicationSelected(string appId)
39− signal dashItemSelected(int index)
39+ signal showDashHome()
4040
4141 BorderImage {
4242 id: background
@@ -57,7 +57,7 @@ Item {
5757 id: dashItem
5858 width: parent.width
5959 height: units.gu(7)
60− onClicked: root.dashItemSelected(0)
60+ onClicked: root.showDashHome()
6161 z: 1
6262 Image {
6363 objectName: "dashItem"
Launcher/graphics/focused_app_arrow@30.png → qml/Launcher/graphics/focused_app_arrow@30.pngrenamed

Binary file not shown.

Launcher/graphics/highlight@18.png → qml/Launcher/graphics/highlight@18.pngrenamed

Binary file not shown.

Launcher/graphics/home@18.png → qml/Launcher/graphics/home@18.pngrenamed

Binary file not shown.

Launcher/graphics/launcher_bg@30.png → qml/Launcher/graphics/launcher_bg@30.pngrenamed

Binary file not shown.

Launcher/graphics/launcher_bg@30.sci → qml/Launcher/graphics/launcher_bg@30.scirenamed

The content is the same.

Launcher/graphics/non-selected@18.png → qml/Launcher/graphics/non-selected@18.pngrenamed

Binary file not shown.

Launcher/graphics/non-selected@18.sci → qml/Launcher/graphics/non-selected@18.scirenamed

The content is the same.

Launcher/graphics/notification@30.png → qml/Launcher/graphics/notification@30.pngrenamed

Binary file not shown.

Launcher/graphics/notification@30.sci → qml/Launcher/graphics/notification@30.scirenamed

The content is the same.

Launcher/graphics/progressbar-fill@30.png → qml/Launcher/graphics/progressbar-fill@30.pngrenamed

Binary file not shown.

Launcher/graphics/progressbar-fill@30.sci → qml/Launcher/graphics/progressbar-fill@30.scirenamed

The content is the same.

Launcher/graphics/progressbar-trough@30.png → qml/Launcher/graphics/progressbar-trough@30.pngrenamed

Binary file not shown.

Launcher/graphics/progressbar-trough@30.sci → qml/Launcher/graphics/progressbar-trough@30.scirenamed

The content is the same.

Launcher/graphics/quicklist_tooltip@30.png → qml/Launcher/graphics/quicklist_tooltip@30.pngrenamed

Binary file not shown.

Launcher/graphics/selected@18.png → qml/Launcher/graphics/selected@18.pngrenamed

Binary file not shown.

Launcher/graphics/selected@18.sci → qml/Launcher/graphics/selected@18.scirenamed

The content is the same.

Launcher/graphics/triangle@18.png → qml/Launcher/graphics/triangle@18.pngrenamed

Binary file not shown.

qml/Notifications/Notification.qmlnew file+325
@@ -0,0 +1,325 @@
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 as published by
6+ * the Free Software Foundation; version 3.
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+
17+import QtQuick 2.0
18+import Ubuntu.Components 0.1
19+import Unity.Notifications 1.0
20+import QMenuModel 0.1
21+import Utils 0.1
22+
23+Item {
24+ id: notification
25+
26+ property alias iconSource: icon.fileSource
27+ property alias secondaryIconSource: secondaryIcon.source
28+ property alias summary: summaryLabel.text
29+ property alias body: bodyLabel.text
30+ property var actions
31+ property var notificationId
32+ property var type
33+ property var hints
34+ property var notification
35+ property color color
36+ property bool fullscreen
37+
38+ fullscreen: false
39+ objectName: "background"
40+ implicitHeight: type != Notification.PlaceHolder ? (fullscreen ? notificationList.fullHeight : contentColumn.height + contentColumn.spacing * 4) : 0
41+
42+ color: Qt.rgba(0.132, 0.117, 0.109, 0.97)
43+ opacity: 0
44+
45+ clip: fullscreen ? false : true
46+ visible: type != Notification.PlaceHolder
47+
48+ UbuntuShape {
49+ id: shapedBack
50+
51+ visible: !fullscreen
52+ anchors.fill: parent
53+ anchors.margins: notificationList.margin
54+ color: parent.color
55+ opacity: parent.opacity
56+ radius: "medium"
57+ }
58+
59+ Rectangle {
60+ id: nonShapedBack
61+
62+ visible: fullscreen
63+ anchors.fill: parent
64+ color: parent.color
65+ opacity: parent.opacity
66+ }
67+
68+ Item {
69+ id: contents
70+ anchors.fill: fullscreen ? nonShapedBack : shapedBack
71+
72+ UnityMenuModelPaths {
73+ id: paths
74+
75+ source: hints["x-canonical-private-menu-model"]
76+
77+ busNameHint: "busName"
78+ actionsHint: "actions"
79+ menuObjectPathHint: "menuPath"
80+ }
81+
82+ UnityMenuModel {
83+ id: unityMenuModel
84+
85+ busName: paths.busName
86+ actions: paths.actions
87+ menuObjectPath: paths.menuObjectPath
88+ }
89+
90+ Behavior on implicitHeight {
91+ id: heightBehavior
92+
93+ enabled: false
94+ UbuntuNumberAnimation {
95+ duration: UbuntuAnimation.SnapDuration
96+ }
97+ }
98+
99+ // delay enabling height behavior until the add transition is complete
100+ onOpacityChanged: if (opacity == 1) heightBehavior.enabled = true
101+
102+ MouseArea {
103+ id: interactiveArea
104+
105+ anchors.fill: contentColumn
106+ objectName: "interactiveArea"
107+ enabled: notification.type == Notification.Interactive
108+ onClicked: notification.notification.invokeAction(actionRepeater.itemAt(0).actionId)
109+ }
110+
111+ Column {
112+ id: contentColumn
113+
114+ anchors {
115+ left: parent.left
116+ right: parent.right
117+ top: parent.top
118+ margins: fullscreen ? 0 : spacing
119+ }
120+
121+ spacing: units.gu(1)
122+
123+ Row {
124+ id: topRow
125+
126+ spacing: contentColumn.spacing
127+ anchors {
128+ left: parent.left
129+ right: parent.right
130+ }
131+
132+ ShapedIcon {
133+ id: icon
134+
135+ objectName: "icon"
136+ width: units.gu(6)
137+ height: units.gu(6)
138+ shaped: notification.hints["x-canonical-non-shaped-icon"] == "true" ? false : true
139+ visible: iconSource !== undefined && iconSource != ""
140+ }
141+
142+ Image {
143+ id: secondaryIcon
144+
145+ objectName: "secondaryIcon"
146+ width: units.gu(2)
147+ height: units.gu(2)
148+ visible: source !== undefined && source != ""
149+ fillMode: Image.PreserveAspectCrop
150+ }
151+
152+ Column {
153+ id: labelColumn
154+ width: parent.width - x
155+
156+ anchors.verticalCenter: (icon.visible && !bodyLabel.visible) ? icon.verticalCenter : undefined
157+
158+ Label {
159+ id: summaryLabel
160+
161+ objectName: "summaryLabel"
162+ anchors {
163+ left: parent.left
164+ right: parent.right
165+ }
166+ fontSize: "medium"
167+ font.bold: true
168+ color: Theme.palette.selected.backgroundText
169+ elide: Text.ElideRight
170+ }
171+
172+ Label {
173+ id: bodyLabel
174+
175+ objectName: "bodyLabel"
176+ anchors {
177+ left: parent.left
178+ right: parent.right
179+ }
180+ visible: body != ""
181+ fontSize: "small"
182+ color: Theme.palette.selected.backgroundText
183+ opacity: 0.6
184+ wrapMode: Text.WordWrap
185+ maximumLineCount: 10
186+ elide: Text.ElideRight
187+ }
188+ }
189+ }
190+
191+ Column {
192+ objectName: "dialogListView"
193+ spacing: units.gu(2)
194+
195+ visible: count > 0
196+
197+ anchors.left: parent.left; anchors.right: parent.right
198+ anchors.top: fullscreen ? parent.top : undefined
199+ anchors.bottom: fullscreen ? parent.bottom : undefined
200+
201+ Repeater {
202+ model: unityMenuModel
203+
204+ NotificationMenuItemFactory {
205+ anchors.left: parent.left; anchors.right: parent.right
206+
207+ menuModel: unityMenuModel
208+ menuData: model
209+ menuIndex: index
210+ }
211+ }
212+ }
213+
214+ Item {
215+ id: buttonRow
216+
217+ objectName: "buttonRow"
218+ anchors {
219+ left: parent.left
220+ right: parent.right
221+ }
222+ visible: notification.type == Notification.SnapDecision && actionRepeater.count > 0
223+ height: units.gu(5)
224+
225+ property real buttonWidth: (width - contentColumn.spacing) / 2
226+ property bool expanded
227+
228+ Button {
229+ id: leftButton
230+
231+ objectName: "button1"
232+ width: parent.expanded ? parent.width : parent.buttonWidth
233+ anchors {
234+ top: parent.top
235+ bottom: parent.bottom
236+ }
237+ text: notification.type == Notification.SnapDecision && actionRepeater.count >= 2 ? actionRepeater.itemAt(1).actionLabel : ""
238+ gradient: UbuntuColors.greyGradient
239+ onClicked: {
240+ if (actionRepeater.count > 2) {
241+ buttonRow.expanded = !buttonRow.expanded
242+ } else {
243+ notification.notification.invokeAction(actionRepeater.itemAt(1).actionId)
244+ }
245+ }
246+
247+ Behavior on width {
248+ UbuntuNumberAnimation {
249+ duration: UbuntuAnimation.SnapDuration
250+ }
251+ }
252+ }
253+
254+ Button {
255+ id: rightButton
256+
257+ objectName: "button0"
258+ anchors {
259+ left: leftButton.right
260+ leftMargin: contentColumn.spacing
261+ right: parent.right
262+ }
263+ text: notification.type == Notification.SnapDecision && actionRepeater.count >= 1 ? actionRepeater.itemAt(0).actionLabel : ""
264+ anchors {
265+ top: parent.top
266+ bottom: parent.bottom
267+ }
268+ gradient: notification.hints["x-canonical-private-button-tint"] == "true" ? UbuntuColors.orangeGradient : UbuntuColors.greyGradient
269+ visible: width > 0
270+ onClicked: notification.notification.invokeAction(actionRepeater.itemAt(0).actionId)
271+ }
272+ }
273+
274+ Column {
275+ objectName: "buttonColumn"
276+ spacing: contentColumn.spacing
277+ anchors {
278+ left: parent.left
279+ right: parent.right
280+ }
281+
282+ // calculate initial position before Column takes over
283+ y: buttonRow.y + buttonRow.height + contentColumn.spacing
284+
285+ visible: notification.type == Notification.SnapDecision && buttonRow.expanded
286+ height: buttonRow.expanded ? implicitHeight : 0
287+
288+ Repeater {
289+ id: actionRepeater
290+
291+ model: notification.actions
292+ delegate: Loader {
293+ id: loader
294+
295+ property string actionId: id
296+ property string actionLabel: label
297+
298+ anchors {
299+ left: parent.left
300+ right: parent.right
301+ }
302+
303+ Component {
304+ id: actionButton
305+
306+ Button {
307+ objectName: "button" + index
308+ anchors {
309+ left: parent.left
310+ right: parent.right
311+ }
312+
313+ text: loader.actionLabel
314+ height: units.gu(5)
315+ gradient: UbuntuColors.greyGradient
316+ onClicked: notification.notification.invokeAction(loader.actionId)
317+ }
318+ }
319+ sourceComponent: (index == 0 || index == 1) ? undefined : actionButton
320+ }
321+ }
322+ }
323+ }
324+ }
325+}
Notifications/NotificationMenuItemFactory.qml → qml/Notifications/NotificationMenuItemFactory.qmlrenamed+9−2
@@ -28,7 +28,6 @@ Loader {
2828 property QtObject menuModel: null
2929 property QtObject menuData: null
3030 property int menuIndex
31− property var notification
3231
3332 property var _map: {
3433 "com.canonical.snapdecision.textfield": textfield,
@@ -44,6 +43,10 @@ Loader {
4443 }
4544 }
4645
46+ Component.onCompleted: {
47+ notification.fullscreen = menuData.type == "com.canonical.snapdecision.pinlock"
48+ }
49+
4750 Component {
4851 id: textfield
4952
@@ -94,8 +97,12 @@ Loader {
9497
9598 Component {
9699 id: pinLock
97− PinLockscreen {
100+
101+ Lockscreen {
98102 anchors.left: parent.left; anchors.right: parent.right
103+ height: notificationList.fullHeight
104+ placeholderText: i18n.tr("Please enter SIM PIN")
105+ background: shell.background
99106
100107 onEntered: {
101108 menuModel.changeState(menuIndex, passphrase);
Notifications/Notifications.qml → qml/Notifications/Notifications.qmlrenamed+3−1
@@ -24,7 +24,9 @@ ListView {
2424 objectName: "notificationList"
2525 interactive: false
2626
27− spacing: units.gu(.5)
27+ property real margin
28+ property real fullHeight
29+
2830 delegate: Notification {
2931 objectName: "notification" + index
3032 anchors {
Notifications/ShapedIcon.qml → qml/Notifications/ShapedIcon.qmlrenamed

The content is the same.

Panel/IndicatorItem.qml → qml/Panel/IndicatorItem.qmlrenamed

The content is the same.

Panel/IndicatorRow.qml → qml/Panel/IndicatorRow.qmlrenamed

The content is the same.

Panel/Indicators.qml → qml/Panel/Indicators.qmlrenamed

The content is the same.

Panel/Indicators/DefaultIndicatorPage.qml → qml/Panel/Indicators/DefaultIndicatorPage.qmlrenamed

The content is the same.

Panel/Indicators/DefaultIndicatorWidget.qml → qml/Panel/Indicators/DefaultIndicatorWidget.qmlrenamed

The content is the same.

Panel/Indicators/client/IndicatorsClient.qml → qml/Panel/Indicators/client/IndicatorsClient.qmlrenamed

The content is the same.

Panel/Indicators/client/IndicatorsList.qml → qml/Panel/Indicators/client/IndicatorsList.qmlrenamed

The content is the same.

Panel/Indicators/client/IndicatorsPage.qml → qml/Panel/Indicators/client/IndicatorsPage.qmlrenamed

The content is the same.

Panel/Indicators/client/IndicatorsTree.qml → qml/Panel/Indicators/client/IndicatorsTree.qmlrenamed

The content is the same.

Panel/MenuContent.qml → qml/Panel/MenuContent.qmlrenamed

The content is the same.

Panel/Panel.qml → qml/Panel/Panel.qmlrenamed+22
@@ -31,6 +31,28 @@ Item {
3131
3232 signal searchClicked
3333
34+ function hideIndicatorMenu(delay) {
35+ if (delay !== undefined) {
36+ hideTimer.interval = delay;
37+ hideTimer.start();
38+ } else {
39+ indicatorsMenu.hide();
40+ }
41+ }
42+
43+ Timer {
44+ id: hideTimer
45+ running: false
46+ onTriggered: {
47+ indicatorsMenu.hide();
48+ }
49+ }
50+
51+ Connections {
52+ target: indicatorsMenu
53+ onShown: hideTimer.stop()
54+ }
55+
3456 PanelBackground {
3557 id: panelBackground
3658 anchors {
Panel/PanelBackground.qml → qml/Panel/PanelBackground.qmlrenamed

The content is the same.

Panel/PanelSeparatorLine.qml → qml/Panel/PanelSeparatorLine.qmlrenamed

The content is the same.

Panel/SearchIndicator.qml → qml/Panel/SearchIndicator.qmlrenamed

The content is the same.

Panel/graphics/Battery@18.png → qml/Panel/graphics/Battery@18.pngrenamed

Binary file not shown.

Panel/graphics/Bluetooth@18.png → qml/Panel/graphics/Bluetooth@18.pngrenamed

Binary file not shown.

Panel/graphics/Clock@18.png → qml/Panel/graphics/Clock@18.pngrenamed

Binary file not shown.

Panel/graphics/Location@18.png → qml/Panel/graphics/Location@18.pngrenamed

Binary file not shown.

Panel/graphics/Messages@18.png → qml/Panel/graphics/Messages@18.pngrenamed

Binary file not shown.

Panel/graphics/Network@18.png → qml/Panel/graphics/Network@18.pngrenamed

Binary file not shown.

Panel/graphics/Sound@18.png → qml/Panel/graphics/Sound@18.pngrenamed

Binary file not shown.

Panel/graphics/Sync@18.png → qml/Panel/graphics/Sync@18.pngrenamed

Binary file not shown.

Panel/graphics/System@18.png → qml/Panel/graphics/System@18.pngrenamed

Binary file not shown.

Panel/graphics/Time@18.png → qml/Panel/graphics/Time@18.pngrenamed

Binary file not shown.

Panel/graphics/VerticalDivider@18.png → qml/Panel/graphics/VerticalDivider@18.pngrenamed

Binary file not shown.

Panel/graphics/handle@12.png → qml/Panel/graphics/handle@12.pngrenamed

Binary file not shown.

Panel/graphics/handle@12.sci → qml/Panel/graphics/handle@12.scirenamed

The content is the same.

Panel/graphics/rectangular_dropshadow@30.png → qml/Panel/graphics/rectangular_dropshadow@30.pngrenamed

Binary file not shown.

Panel/graphics/rectangular_dropshadow@30.sci → qml/Panel/graphics/rectangular_dropshadow@30.scirenamed

The content is the same.

Panel/graphics/search@12.png → qml/Panel/graphics/search@12.pngrenamed

Binary file not shown.

Panel/graphics/time_and_date@18.png → qml/Panel/graphics/time_and_date@18.pngrenamed

Binary file not shown.

Shell.qml → qml/Shell.qmlrenamed+11−5
@@ -44,7 +44,7 @@ FocusScope {
4444 height: tablet ? units.gu(100) : applicationArguments.hasGeometry() ? applicationArguments.height() : units.gu(71)
4545
4646 property real edgeSize: units.gu(2)
47− property url defaultBackground: shell.width >= units.gu(60) ? "graphics/tablet_background.jpg" : "graphics/phone_background.jpg"
47+ property url defaultBackground: Qt.resolvedUrl(shell.width >= units.gu(60) ? "graphics/tablet_background.jpg" : "graphics/phone_background.jpg")
4848 property url background
4949 readonly property real panelHeight: panel.panelHeight
5050
@@ -272,6 +272,7 @@ FocusScope {
272272 width: parent.width
273273 height: parent.height - panel.panelHeight
274274 background: shell.background
275+ pinLength: 4
275276
276277 onEntered: LightDM.Greeter.respond(passphrase);
277278 onCancel: greeter.show()
@@ -392,6 +393,10 @@ FocusScope {
392393 stages.hide()
393394 }
394395
396+ function hideIndicatorMenu(delay) {
397+ panel.hideIndicatorMenu(delay);
398+ }
399+
395400 Item {
396401 id: overlay
397402
@@ -484,7 +489,7 @@ FocusScope {
484489 dragAreaWidth: shell.edgeSize
485490 available: (!greeter.shown || greeter.narrowMode) && edgeDemo.launcherEnabled
486491
487− onDashItemSelected: {
492+ onShowDashHome: {
488493 if (edgeDemo.running)
489494 return;
490495
@@ -517,13 +522,14 @@ FocusScope {
517522 id: notifications
518523
519524 model: NotificationBackend.Model
525+ margin: units.gu(1)
526+ fullHeight: parent.height - panel.panelHeight
527+
520528 anchors {
521529 top: parent.top
522530 right: parent.right
523531 bottom: parent.bottom
524− leftMargin: units.gu(1)
525− rightMargin: units.gu(1)
526− topMargin: panel.panelHeight + units.gu(1)
532+ topMargin: panel.panelHeight
527533 }
528534 states: [
529535 State {
SideStage/SideStage.qml → qml/SideStage/SideStage.qmlrenamed

The content is the same.

SideStage/SidestageHandle.qml → qml/SideStage/SidestageHandle.qmlrenamed

The content is the same.

SideStage/graphics/sidestage_handle@20.png → qml/SideStage/graphics/sidestage_handle@20.pngrenamed

Binary file not shown.

SideStage/graphics/sidestage_handle@20.sci → qml/SideStage/graphics/sidestage_handle@20.scirenamed

The content is the same.

graphics/12_10_background_wide@12.png → qml/graphics/12_10_background_wide@12.pngrenamed

Binary file not shown.

graphics/applicationIcons/browser@18.png → qml/graphics/applicationIcons/browser@18.pngrenamed

Binary file not shown.

graphics/applicationIcons/calendar@18.png → qml/graphics/applicationIcons/calendar@18.pngrenamed

Binary file not shown.

graphics/applicationIcons/camera@18.png → qml/graphics/applicationIcons/camera@18.pngrenamed

Binary file not shown.

graphics/applicationIcons/contacts-app@18.png → qml/graphics/applicationIcons/contacts-app@18.pngrenamed

Binary file not shown.

graphics/applicationIcons/dash@18.png → qml/graphics/applicationIcons/dash@18.pngrenamed

Binary file not shown.

graphics/applicationIcons/evernote@18.png → qml/graphics/applicationIcons/evernote@18.pngrenamed

Binary file not shown.

graphics/applicationIcons/facebook@18.png → qml/graphics/applicationIcons/facebook@18.pngrenamed

Binary file not shown.

graphics/applicationIcons/gallery@18.png → qml/graphics/applicationIcons/gallery@18.pngrenamed

Binary file not shown.

graphics/applicationIcons/gmail@18.png → qml/graphics/applicationIcons/gmail@18.pngrenamed

Binary file not shown.

graphics/applicationIcons/map@18.png → qml/graphics/applicationIcons/map@18.pngrenamed

Binary file not shown.

graphics/applicationIcons/messages-app@18.png → qml/graphics/applicationIcons/messages-app@18.pngrenamed

Binary file not shown.

graphics/applicationIcons/notepad@18.png → qml/graphics/applicationIcons/notepad@18.pngrenamed

Binary file not shown.

graphics/applicationIcons/phone-app@18.png → qml/graphics/applicationIcons/phone-app@18.pngrenamed

Binary file not shown.

graphics/applicationIcons/pinterest@18.png → qml/graphics/applicationIcons/pinterest@18.pngrenamed

Binary file not shown.

graphics/applicationIcons/soundcloud@18.png → qml/graphics/applicationIcons/soundcloud@18.pngrenamed

Binary file not shown.

graphics/applicationIcons/system-settings@18.png → qml/graphics/applicationIcons/system-settings@18.pngrenamed

Binary file not shown.

graphics/applicationIcons/twitter@18.png → qml/graphics/applicationIcons/twitter@18.pngrenamed

Binary file not shown.

graphics/applicationIcons/weather@18.png → qml/graphics/applicationIcons/weather@18.pngrenamed

Binary file not shown.

graphics/applicationIcons/wikipedia@18.png → qml/graphics/applicationIcons/wikipedia@18.pngrenamed

Binary file not shown.

graphics/applicationIcons/youtube@18.png → qml/graphics/applicationIcons/youtube@18.pngrenamed

Binary file not shown.

graphics/avatars/amanda@12.png → qml/graphics/avatars/amanda@12.pngrenamed

Binary file not shown.

graphics/avatars/anna_olsson@12.png → qml/graphics/avatars/anna_olsson@12.pngrenamed

Binary file not shown.

graphics/avatars/funky@12.png → qml/graphics/avatars/funky@12.pngrenamed

Binary file not shown.

graphics/clock@18.png → qml/graphics/clock@18.pngrenamed

Binary file not shown.

graphics/phone_background.jpg → qml/graphics/phone_background.jpgrenamed

Binary file not shown.

graphics/tablet_background.jpg → qml/graphics/tablet_background.jpgrenamed

Binary file not shown.

run+1−1
@@ -3,7 +3,7 @@
33. /etc/environment
44export QML2_IMPORT_PATH
55
6−QML_PHONE_SHELL_PATH=./builddir/unity8
6+QML_PHONE_SHELL_PATH=./builddir/src/unity8
77GDB=false
88FAKE=false
99PINLOCK=false
runtests.sh+1−13
@@ -26,19 +26,7 @@
2626# floating point operations and xml writing is natively supported.
2727
2828
29−if test -e Shell.qml; then
30− echo In-source build detected.
31− SRCDIR=`pwd`
32−elif test -e ../Shell.qml; then
33− echo Out-of-source build detected. Found source dir at ..
34− SRCDIR=`pwd`/..
35−else
36− echo Out-of-source build detected. Source dir not found at ..
37− echo Only in-source builds or out-of-source builds with source dir at .. are supported.
38− exit 1
39−fi
40−
41−cd $SRCDIR
29+SRCDIR=`dirname "$(readlink -f "$0")"`
4230
4331file_list=""
4432
ApplicationArguments.h → src/ApplicationArguments.hrenamed

The content is the same.

src/CMakeLists.txt+27
@@ -1 +1,28 @@
1+pkg_check_modules(UNITY-MIR REQUIRED unity-mir)
2+
3+include_directories(
4+ ${Qt5Gui_PRIVATE_INCLUDE_DIRS}
5+ ${UNITY-MIR_INCLUDE_DIRS}
6+)
7+
8+add_executable(${SHELL_APP}
9+ ApplicationArguments.h
10+ main.cpp
11+ MouseTouchAdaptor.cpp
12+ )
13+
14+qt5_use_modules(${SHELL_APP} Gui Qml Quick Test)
15+pkg_check_modules(XCB REQUIRED xcb)
16+
17+if (NOT "${XCB_INCLUDE_DIRS}" STREQUAL "")
18+ set_target_properties(${SHELL_APP} PROPERTIES INCLUDE_DIRECTORIES ${XCB_INCLUDE_DIRS})
19+
20+ target_link_libraries(${SHELL_APP} ${XCB_LDFLAGS})
21+endif()
22+
23+# install binaries
24+install(TARGETS ${SHELL_APP}
25+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
26+ )
27+
128add_subdirectory(Panel)
MouseTouchAdaptor.cpp → src/MouseTouchAdaptor.cpprenamed

The content is the same.

MouseTouchAdaptor.h → src/MouseTouchAdaptor.hrenamed

The content is the same.

src/Panel/Indicators/client/CMakeLists.txt−4
@@ -14,10 +14,6 @@ add_executable(${INDICATORS_CLIENT_APP}
1414 ${INDICATORS_CLIENT_HEADERS}
1515)
1616
17−include_directories(
18− ${CMAKE_BINARY_DIR}
19−)
20−
2117qt5_use_modules(${INDICATORS_CLIENT_APP} Core Widgets Quick)
2218set_target_properties(${INDICATORS_CLIENT_APP} PROPERTIES COMPILE_FLAGS -fPIC)
2319
src/Panel/Indicators/client/indicatorsclient.cpp+3−37
@@ -19,48 +19,14 @@
1919 */
2020
2121#include "indicatorsclient.h"
22−#include "paths.h"
22+
23+#include <paths.h>
2324
2425#include <QQuickView>
2526#include <QQmlContext>
2627#include <QQmlEngine>
2728#include <QDebug>
2829
29−namespace {
30−
31−void prependImportPaths(QQmlEngine *engine, const QStringList &paths)
32−{
33− QStringList importPathList = engine->importPathList();
34− for (int i = paths.count()-1; i >= 0; i--) {
35− importPathList.prepend(paths[i]);
36− }
37− engine->setImportPathList(importPathList);
38−}
39−
40−/* When you append and import path to the list of import paths it will be the *last*
41− place where Qt will search for QML modules.
42− The usual QQmlEngine::addImportPath() actually prepends the given path.*/
43−void appendImportPaths(QQmlEngine *engine, const QStringList &paths)
44−{
45− QStringList importPathList = engine->importPathList();
46− Q_FOREACH(const QString& path, paths) {
47− // don't duplicate
48− QStringList::iterator iter = qFind(importPathList.begin(), importPathList.end(), path);
49− if (iter == importPathList.end()) {
50− importPathList.append(path);
51− }
52− }
53− engine->setImportPathList(importPathList);
54−}
55−
56−void resolveIconTheme() {
57− QString ubuntuIconTheme = getenv("UBUNTU_ICON_THEME");
58− if (ubuntuIconTheme.isEmpty()) {
59− QIcon::setThemeName("ubuntu-mobile");
60− }
61−}
62−} // namespace
63−
6430IndicatorsClient::IndicatorsClient(int &argc, char **argv)
6531 : QObject(0),
6632 m_view(0)
@@ -71,7 +37,7 @@ IndicatorsClient::IndicatorsClient(int &argc, char **argv)
7137 QStringList args = m_application->arguments();
7238
7339 m_view = new QQuickView;
74− m_view->engine()->setBaseUrl(QUrl::fromLocalFile(::shellAppDirectory()+"Panel/Indicators/client/"));
40+ m_view->engine()->setBaseUrl(QUrl::fromLocalFile(::qmlDirectory()+"Panel/Indicators/client/"));
7541 prependImportPaths(m_view->engine(), ::overrideImportPaths());
7642 appendImportPaths(m_view->engine(), ::fallbackImportPaths());
7743
main.cpp → src/main.cpprenamed+3−43
@@ -19,7 +19,6 @@
1919
2020// Qt
2121#include <QtQuick/QQuickView>
22−#include <QtGui/QIcon>
2322#include <QtGui/QGuiApplication>
2423#include <QtQml/QQmlEngine>
2524#include <QtQml/QQmlContext>
@@ -31,51 +30,12 @@
3130#include <csignal>
3231
3332// local
34−#include "paths.h"
33+#include <paths.h>
3534#include "MouseTouchAdaptor.h"
3635#include "ApplicationArguments.h"
3736
3837#include <unity-mir/qmirserver.h>
3938
40−namespace {
41−
42−void prependImportPaths(QQmlEngine *engine, const QStringList &paths)
43−{
44− QStringList importPathList = engine->importPathList();
45− for (int i = paths.count() -1; i >= 0; i--) {
46− // don't duplicate
47− const QString& path = paths[i];
48− QStringList::iterator iter = qFind(importPathList.begin(), importPathList.end(), path);
49− if (iter == importPathList.end()) {
50− engine->addImportPath(path);
51− }
52− }
53−}
54−
55−/* When you append and import path to the list of import paths it will be the *last*
56− place where Qt will search for QML modules.
57− The usual QQmlEngine::addImportPath() actually prepends the given path.*/
58−void appendImportPaths(QQmlEngine *engine, const QStringList &paths)
59−{
60− QStringList importPathList = engine->importPathList();
61− Q_FOREACH(const QString& path, paths) {
62− // don't duplicate
63− QStringList::iterator iter = qFind(importPathList.begin(), importPathList.end(), path);
64− if (iter == importPathList.end()) {
65− importPathList.append(path);
66− }
67− }
68− engine->setImportPathList(importPathList);
69−}
70−
71−void resolveIconTheme() {
72− const char *ubuntuIconTheme = getenv("UBUNTU_ICON_THEME");
73− if (ubuntuIconTheme == NULL) {
74− ubuntuIconTheme = "ubuntu-mobile";
75− }
76− QIcon::setThemeName(ubuntuIconTheme);
77−}
78−} // namespace {
7939
8040int startShell(int argc, const char** argv, void* server)
8141{
@@ -126,7 +86,7 @@ int startShell(int argc, const char** argv, void* server)
12686 QQuickView* view = new QQuickView();
12787 view->setResizeMode(QQuickView::SizeRootObjectToView);
12888 view->setTitle("Qml Phone Shell");
129− view->engine()->setBaseUrl(QUrl::fromLocalFile(::shellAppDirectory()));
89+ view->engine()->setBaseUrl(QUrl::fromLocalFile(::qmlDirectory()));
13090 view->rootContext()->setContextProperty("applicationArguments", &qmlArgs);
13191 if (args.contains(QLatin1String("-frameless"))) {
13292 view->setFlags(Qt::FramelessWindowHint);
@@ -149,7 +109,7 @@ int startShell(int argc, const char** argv, void* server)
149109 nativeInterface->setProperty("ubuntuSessionType", 1);
150110 view->setProperty("role", 2); // INDICATOR_ACTOR_ROLE
151111
152− QUrl source("Shell.qml");
112+ QUrl source(::qmlDirectory()+"Shell.qml");
153113 prependImportPaths(view->engine(), ::overrideImportPaths());
154114 appendImportPaths(view->engine(), ::fallbackImportPaths());
155115
tests/autopilot/.projectnew file+17
@@ -0,0 +1,17 @@
1+<?xml version="1.0" encoding="UTF-8"?>
2+<projectDescription>
3+ <name>Unity8 Autopilot</name>
4+ <comment></comment>
5+ <projects>
6+ </projects>
7+ <buildSpec>
8+ <buildCommand>
9+ <name>org.python.pydev.PyDevBuilder</name>
10+ <arguments>
11+ </arguments>
12+ </buildCommand>
13+ </buildSpec>
14+ <natures>
15+ <nature>org.python.pydev.pythonNature</nature>
16+ </natures>
17+</projectDescription>
tests/autopilot/.pydevprojectnew file+8
@@ -0,0 +1,8 @@
1+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+<?eclipse-pydev version="1.0"?><pydev_project>
3+<pydev_pathproperty name="org.python.pydev.PROJECT_SOURCE_PATH">
4+<path>/Unity8 Autopilot</path>
5+</pydev_pathproperty>
6+<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.7</pydev_property>
7+<pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Default</pydev_property>
8+</pydev_project>
tests/autopilot/unity8/application_lifecycle/tests/test_application_lifecycle.py+7−6
@@ -21,6 +21,7 @@
2121
2222from __future__ import absolute_import
2323
24+from unity8.process_helpers import unlock_unity
2425from unity8.shell import disable_qml_mocking
2526from unity8.shell.tests import UnityTestCase, _get_device_emulation_scenarios
2627
@@ -78,8 +79,8 @@ class ApplicationLifecycleTests(UnityTestCase):
7879 @disable_qml_mocking
7980 def test_can_launch_application(self):
8081 """Must be able to launch an application."""
81− self.launch_unity()
82− self.main_window.get_greeter().swipe()
82+ unity_proxy = self.launch_unity()
83+ unlock_unity(unity_proxy)
8384
8485 app = self._launch_app("messaging-app")
8586
@@ -92,8 +93,8 @@ class ApplicationLifecycleTests(UnityTestCase):
9293 @disable_qml_mocking
9394 def test_can_launch_multiple_applications(self):
9495 """A second application launched must be focused."""
95− self.launch_unity()
96− self.main_window.get_greeter().swipe()
96+ unity_proxy = self.launch_unity()
97+ unlock_unity(unity_proxy)
9798
9899 self._launch_app("messaging-app")
99100 self.assertThat(
@@ -113,8 +114,8 @@ class ApplicationLifecycleTests(UnityTestCase):
113114 brought back to the focused state.
114115
115116 """
116− self.launch_unity()
117− self.main_window.get_greeter().swipe()
117+ unity_proxy = self.launch_unity()
118+ unlock_unity(unity_proxy)
118119
119120 self._launch_app("messaging-app")
120121 self.assertThat(
tests/autopilot/unity8/process_helpers.py+17−1
@@ -69,7 +69,23 @@ def unlock_unity(unity_proxy_obj=None):
6969 greeter = main_window.get_greeter()
7070 if greeter.created == False:
7171 raise RuntimeWarning("Greeter appears to be already unlocked.")
72− greeter.swipe()
72+
73+ # Because of potential input jerkiness under heavy load,
74+ # retry unlocking the greeter two times.
75+ # https://bugs.launchpad.net/ubuntu/+bug/1260113
76+
77+ retries = 3
78+ while retries > 0:
79+ try:
80+ greeter.swipe()
81+ except AssertionError:
82+ retries -= 1
83+ if retries == 0:
84+ raise
85+ logger.info("Failed to unlock greeter, trying again...")
86+ else:
87+ logger.info("Greeter unlocked, continuing.")
88+ break
7389
7490
7591def restart_unity_with_testability(*args):
tests/autopilot/unity8/shell/tests/test_lock_screen.py+9−8
@@ -20,6 +20,7 @@
2020
2121from __future__ import absolute_import
2222
23+from unity8.process_helpers import unlock_unity
2324from unity8.shell import with_lightdm_mock
2425from unity8.shell.tests import UnityTestCase, _get_device_emulation_scenarios
2526
@@ -40,11 +41,11 @@ class TestLockscreen(UnityTestCase):
4041 @with_lightdm_mock("single-pin")
4142 def test_can_unlock_pin_screen(self):
4243 """Must be able to unlock the PIN entry lock screen."""
43− self.launch_unity()
44+ unity_proxy = self.launch_unity()
4445 greeter = self.main_window.get_greeter()
4546
4647 if greeter.narrowMode:
47− greeter.swipe()
48+ unlock_unity(unity_proxy)
4849 lockscreen = self._wait_for_lockscreen()
4950 self._enter_pincode("1234")
5051 self.assertThat(lockscreen.shown, Eventually(Equals(False)))
@@ -55,11 +56,11 @@ class TestLockscreen(UnityTestCase):
5556 @with_lightdm_mock("single-passphrase")
5657 def test_can_unlock_passphrase_screen(self):
5758 """Must be able to unlock the passphrase entry screen."""
58− self.launch_unity()
59+ unity_proxy = self.launch_unity()
5960 greeter = self.main_window.get_greeter()
6061
6162 if greeter.narrowMode:
62− greeter.swipe()
63+ unlock_unity(unity_proxy)
6364 lockscreen = self._wait_for_lockscreen()
6465 self._enter_pin_passphrase("password")
6566 self.assertThat(lockscreen.shown, Eventually(Equals(False)))
@@ -70,11 +71,11 @@ class TestLockscreen(UnityTestCase):
7071 @with_lightdm_mock("single-pin")
7172 def test_pin_screen_wrong_code(self):
7273 """Entering the wrong pin code must not dismiss the lock screen."""
73− self.launch_unity()
74+ unity_proxy = self.launch_unity()
7475 greeter = self.main_window.get_greeter()
7576
7677 if greeter.narrowMode:
77− greeter.swipe()
78+ unlock_unity(unity_proxy)
7879 lockscreen = self._wait_for_lockscreen()
7980 self._enter_pincode("4321")
8081 pinentryField = self.main_window.get_pinentryField()
@@ -89,11 +90,11 @@ class TestLockscreen(UnityTestCase):
8990 @with_lightdm_mock("single-passphrase")
9091 def test_passphrase_screen_wrong_password(self):
9192 """Entering the wrong password must not dismiss the lock screen."""
92− self.launch_unity()
93+ unity_proxy = self.launch_unity()
9394 greeter = self.main_window.get_greeter()
9495
9596 if greeter.narrowMode:
96− greeter.swipe()
97+ unlock_unity(unity_proxy)
9798 lockscreen = self._wait_for_lockscreen()
9899 self._enter_pin_passphrase("foobar")
99100 pinentryField = self.main_window.get_pinentryField()
tests/autopilot/unity8/shell/tests/test_notifications.py+1−1
@@ -65,7 +65,7 @@ class NotificationsBase(UnityTestCase):
6565 def _get_notifications_list(self):
6666 main_view = self.main_window.get_qml_view()
6767 return main_view.select_single(
68− "QQuickListView",
68+ "Notifications",
6969 objectName='notificationList'
7070 )
7171
tests/mocks/LightDM/CMakeLists.txt+1
@@ -13,6 +13,7 @@ add_subdirectory(single-passphrase)
1313include_directories(
1414 ${CMAKE_CURRENT_SOURCE_DIR}
1515 ${CMAKE_CURRENT_BINARY_DIR}
16+ ${CMAKE_SOURCE_DIR}/plugins/Utils
1617 ${CMAKE_SOURCE_DIR}/tests/mocks/libusermetrics
1718)
1819
tests/mocks/LightDM/demo/CMakeLists.txt−1
@@ -1,4 +1,3 @@
1−include(FindPkgConfig)
21pkg_check_modules(LIBUSERMETRICSOUTPUT REQUIRED libusermetricsoutput-1)
32
43set(LibLightDM_SOURCES
tests/mocks/Unity/Application/ApplicationManager.cpp+4−3
@@ -16,7 +16,8 @@
1616
1717#include "ApplicationManager.h"
1818#include "ApplicationInfo.h"
19−#include "paths.h"
19+
20+#include <paths.h>
2021
2122#include <QDir>
2223#include <QGuiApplication>
@@ -307,7 +308,7 @@ void ApplicationManager::generateQmlStrings(ApplicationInfo *application)
307308 " smooth: true\n"
308309 " fillMode: Image.PreserveAspectCrop\n"
309310 "}").arg(topMargin)
310− .arg(shellAppDirectory())
311+ .arg(qmlDirectory())
311312 .arg(application->icon().toString());
312313 application->setWindowQml(windowQml);
313314
@@ -318,7 +319,7 @@ void ApplicationManager::generateQmlStrings(ApplicationInfo *application)
318319 " source: \"file://%1/Dash/graphics/phone/screenshots/%2.png\"\n"
319320 " smooth: true\n"
320321 " fillMode: Image.PreserveAspectCrop\n"
321− "}").arg(shellAppDirectory())
322+ "}").arg(qmlDirectory())
322323 .arg(application->icon().toString());
323324 application->setImageQml(imageQml);
324325}
tests/mocks/Unity/Application/CMakeLists.txt−1
@@ -1,4 +1,3 @@
1−include(FindPkgConfig)
21pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application)
32
43set(FakeUnityApplicationQml_SOURCES
tests/mocks/Unity/Launcher/CMakeLists.txt−1
@@ -1,4 +1,3 @@
1−include(FindPkgConfig)
21pkg_check_modules(LAUNCHER_API REQUIRED unity-shell-launcher=3)
32
43add_definitions(-DTOP_SRCDIR="${CMAKE_SOURCE_DIR}")
tests/mocks/Unity/fake_scope.cpp+2−2
@@ -16,7 +16,7 @@
1616
1717#include "fake_scope.h"
1818#include "fake_preview.h"
19−#include "paths.h"
19+#include <paths.h>
2020
2121#include <dee.h>
2222
@@ -236,7 +236,7 @@ DeeModel* create_results_model(unsigned category_count, unsigned result_count) {
236236
237237 dee_model_append(results_model,
238238 ("uri://result."+std::to_string(i)).c_str(),
239− (shellAppDirectory() + "graphics/applicationIcons/dash.png").toLatin1().data(),
239+ (qmlDirectory() + "graphics/applicationIcons/dash.png").toLatin1().data(),
240240 category,
241241 0,
242242 "application/x-desktop",
tests/mocks/libusermetrics/CMakeLists.txt+4
@@ -8,6 +8,10 @@ add_library(MockUserMetrics SHARED ${mock_SOURCES})
88
99qt5_use_modules(MockUserMetrics Gui)
1010
11+include_directories(
12+ ${CMAKE_SOURCE_DIR}/plugins/Utils
13+)
14+
1115set_target_properties(MockUserMetrics PROPERTIES
1216 OUTPUT_NAME usermetricsoutput
1317 VERSION 1)
tests/mocks/libusermetrics/UserMetrics.cpp+1−1
@@ -17,7 +17,7 @@
1717 */
1818
1919#include "UserMetrics.h"
20−#include "plugins/Utils/qvariantlistmodel.h"
20+#include <qvariantlistmodel.h>
2121
2222#include <QtCore/QDir>
2323#include <QtCore/QString>
tests/plugins/AccountsService/CMakeLists.txt+6−1
@@ -1,6 +1,11 @@
1+if(DEFINED ENV{DEB_BUILD_MULTIARCH})
2+ set(QDBUSXML2CPP_EXECUTABLE "/usr/lib/$ENV{DEB_BUILD_MULTIARCH}/qt5/bin/qdbusxml2cpp")
3+else()
4+ FIND_PROGRAM(QDBUSXML2CPP_EXECUTABLE qdbusxml2cpp)
5+endif()
16macro(make_dbus_class NAME INTERFACE)
27 if(${CMAKE_CURRENT_SOURCE_DIR}/interfaces.xml IS_NEWER_THAN ${CMAKE_CURRENT_BINARY_DIR}/${NAME}Adaptor.h)
3− execute_process(COMMAND qdbusxml2cpp -c ${NAME}Adaptor -a ${CMAKE_CURRENT_BINARY_DIR}/${NAME}Adaptor ${CMAKE_CURRENT_SOURCE_DIR}/interfaces.xml ${INTERFACE})
8+ execute_process(COMMAND ${QDBUSXML2CPP_EXECUTABLE} -c ${NAME}Adaptor -a ${CMAKE_CURRENT_BINARY_DIR}/${NAME}Adaptor ${CMAKE_CURRENT_SOURCE_DIR}/interfaces.xml ${INTERFACE})
49 endif()
510endmacro(make_dbus_class)
611
tests/plugins/CMakeLists.txt+1−1
@@ -1,6 +1,6 @@
11add_subdirectory(AccountsService)
22add_subdirectory(LightDM)
3−add_subdirectory(ListViewWithPageHeader)
3+add_subdirectory(DashViews)
44add_subdirectory(Ubuntu)
55add_subdirectory(Unity)
66add_subdirectory(Utils)
tests/plugins/ListViewWithPageHeader/CMakeLists.txt → tests/plugins/DashViews/CMakeLists.txtrenamed+16−5
@@ -16,30 +16,40 @@ include_directories(
1616 ${Qt5Quick_INCLUDE_DIRS}
1717 ${Qt5Quick_PRIVATE_INCLUDE_DIRS}
1818 ${Qt5V8_PRIVATE_INCLUDE_DIR}
19− ${CMAKE_CURRENT_SOURCE_DIR}/../../../plugins/ListViewWithPageHeader
19+ ${CMAKE_CURRENT_SOURCE_DIR}/../../../plugins/DashViews
2020 ${CMAKE_CURRENT_BINARY_DIR}
2121 )
2222
2323remove_definitions(-DQT_NO_KEYWORDS)
2424
25−add_definitions(-DLISTVIEWWITHPAGEHEADER_FOLDER="${CMAKE_CURRENT_SOURCE_DIR}")
25+add_definitions(-DDASHVIEWSTEST_FOLDER="${CMAKE_CURRENT_SOURCE_DIR}")
2626add_definitions(-DBUILT_PLUGINS_DIR="${CMAKE_BINARY_DIR}/plugins")
2727
28−add_executable(listviewwithpageheadertestExec listviewwithpageheadertest.cpp ${CMAKE_CURRENT_SOURCE_DIR}/../../../plugins/ListViewWithPageHeader/listviewwithpageheader.cpp)
28+add_executable(listviewwithpageheadertestExec listviewwithpageheadertest.cpp ${CMAKE_CURRENT_SOURCE_DIR}/../../../plugins/DashViews/listviewwithpageheader.cpp)
2929qt5_use_modules(listviewwithpageheadertestExec Test Core Qml)
3030target_link_libraries(listviewwithpageheadertestExec ${Qt5Gui_LIBRARIES} ${Qt5Quick_LIBRARIES})
3131add_custom_target(testlistviewwithpageheader ${CMAKE_CURRENT_BINARY_DIR}/listviewwithpageheadertestExec -o ${CMAKE_BINARY_DIR}/testlistviewwithpageheader.xml,xunitxml -o -,txt)
3232
33−add_executable(listviewwithpageheadertestsectionExec listviewwithpageheadertestsection.cpp ${CMAKE_CURRENT_SOURCE_DIR}/../../../plugins/ListViewWithPageHeader/listviewwithpageheader.cpp)
33+add_executable(listviewwithpageheadertestsectionExec listviewwithpageheadertestsection.cpp ${CMAKE_CURRENT_SOURCE_DIR}/../../../plugins/DashViews/listviewwithpageheader.cpp)
3434qt5_use_modules(listviewwithpageheadertestsectionExec Test Core Qml)
3535target_link_libraries(listviewwithpageheadertestsectionExec ${Qt5Gui_LIBRARIES} ${Qt5Quick_LIBRARIES})
3636add_custom_target(testlistviewwithpageheadersection ${CMAKE_CURRENT_BINARY_DIR}/listviewwithpageheadertestsectionExec -o ${CMAKE_BINARY_DIR}/testlistviewwithpageheadersection.xml,xunitxml -o -,txt)
3737
38−add_executable(listviewwithpageheadertestsectionexternalmodelExec listviewwithpageheadertestsectionexternalmodel.cpp ${CMAKE_CURRENT_SOURCE_DIR}/../../../plugins/ListViewWithPageHeader/listviewwithpageheader.cpp)
38+add_executable(listviewwithpageheadertestsectionexternalmodelExec listviewwithpageheadertestsectionexternalmodel.cpp ${CMAKE_CURRENT_SOURCE_DIR}/../../../plugins/DashViews/listviewwithpageheader.cpp)
3939qt5_use_modules(listviewwithpageheadertestsectionexternalmodelExec Test Core Qml)
4040target_link_libraries(listviewwithpageheadertestsectionexternalmodelExec ${Qt5Gui_LIBRARIES} ${Qt5Quick_LIBRARIES})
4141add_custom_target(testlistviewwithpageheadersectionexternalmodel ${CMAKE_CURRENT_BINARY_DIR}/listviewwithpageheadertestsectionexternalmodelExec -o ${CMAKE_BINARY_DIR}/testlistviewwithpageheadersectionexternalmodel.xml,xunitxml -o -,txt)
4242
43+add_executable(verticaljournaltestExec verticaljournaltest.cpp ${CMAKE_CURRENT_SOURCE_DIR}/../../../plugins/DashViews/verticaljournal.cpp)
44+qt5_use_modules(verticaljournaltestExec Test Core Qml)
45+target_link_libraries(verticaljournaltestExec ${Qt5Gui_LIBRARIES} ${Qt5Quick_LIBRARIES})
46+add_custom_target(testVerticalJournal ${CMAKE_CURRENT_BINARY_DIR}/verticaljournaltestExec -o ${CMAKE_BINARY_DIR}/testVerticalJournal.xml,xunitxml -o -,txt)
47+
48+add_executable(verticaljournaltryExec verticaljournaltry.cpp ${CMAKE_CURRENT_SOURCE_DIR}/../../../plugins/DashViews/verticaljournal.cpp)
49+qt5_use_modules(verticaljournaltryExec Test Core Qml)
50+target_link_libraries(verticaljournaltryExec ${Qt5Gui_LIBRARIES} ${Qt5Quick_LIBRARIES})
51+add_custom_target(tryVerticalJournal ${CMAKE_CURRENT_BINARY_DIR}/verticaljournaltryExec -o ${CMAKE_BINARY_DIR}/testVerticalJournal.xml,xunitxml -o -,txt)
52+
4353set(qmltest_DEFAULT_NO_ADD_TEST TRUE)
4454add_qml_test(. listviewwithpageheaderqml IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins)
4555
@@ -47,3 +57,4 @@ add_dependencies(qmluitests testlistviewwithpageheader)
4757add_dependencies(qmluitests testlistviewwithpageheadersection)
4858add_dependencies(qmluitests testlistviewwithpageheadersectionexternalmodel)
4959add_dependencies(qmluitests testlistviewwithpageheaderqml)
60+add_dependencies(qmluitests testVerticalJournal)
tests/plugins/ListViewWithPageHeader/listviewwithpageheadertest.cpp → tests/plugins/DashViews/listviewwithpageheadertest.cpprenamed+1−1
@@ -118,7 +118,7 @@ private Q_SLOTS:
118118 {
119119 view = new QQuickView();
120120 view->engine()->addImportPath(BUILT_PLUGINS_DIR);
121− view->setSource(QUrl::fromLocalFile(LISTVIEWWITHPAGEHEADER_FOLDER "/test.qml"));
121+ view->setSource(QUrl::fromLocalFile(DASHVIEWSTEST_FOLDER "/listviewwithpageheadertest.qml"));
122122 lvwph = dynamic_cast<ListViewWithPageHeader*>(view->rootObject()->findChild<QQuickFlickable*>());
123123#if (QT_VERSION < QT_VERSION_CHECK(5, 1, 0))
124124 model = view->rootObject()->findChild<QQuickListModel*>();
tests/plugins/ListViewWithPageHeader/test.qml → tests/plugins/DashViews/listviewwithpageheadertest.qmlrenamed+1−1
@@ -15,7 +15,7 @@
1515 */
1616
1717import QtQuick 2.0
18−import ListViewWithPageHeader 0.1
18+import DashViews 0.1
1919
2020Rectangle {
2121 width: 300
tests/plugins/ListViewWithPageHeader/listviewwithpageheadertestsection.cpp → tests/plugins/DashViews/listviewwithpageheadertestsection.cpprenamed+1−1
@@ -133,7 +133,7 @@ private Q_SLOTS:
133133 {
134134 view = new QQuickView();
135135 view->engine()->addImportPath(BUILT_PLUGINS_DIR);
136− view->setSource(QUrl::fromLocalFile(LISTVIEWWITHPAGEHEADER_FOLDER "/test_section.qml"));
136+ view->setSource(QUrl::fromLocalFile(DASHVIEWSTEST_FOLDER "/listviewwithpageheadertestsection.qml"));
137137 lvwph = dynamic_cast<ListViewWithPageHeader*>(view->rootObject()->findChild<QQuickFlickable*>());
138138#if (QT_VERSION < QT_VERSION_CHECK(5, 1, 0))
139139 model = view->rootObject()->findChild<QQuickListModel*>();
tests/plugins/ListViewWithPageHeader/test_section.qml → tests/plugins/DashViews/listviewwithpageheadertestsection.qmlrenamed+1−1
@@ -15,7 +15,7 @@
1515 */
1616
1717import QtQuick 2.0
18−import ListViewWithPageHeader 0.1
18+import DashViews 0.1
1919
2020Rectangle {
2121 width: 300
tests/plugins/ListViewWithPageHeader/listviewwithpageheadertestsectionexternalmodel.cpp → tests/plugins/DashViews/listviewwithpageheadertestsectionexternalmodel.cpprenamed+1−1
@@ -173,7 +173,7 @@ private Q_SLOTS:
173173 {
174174 view = new QQuickView();
175175 view->engine()->addImportPath(BUILT_PLUGINS_DIR);
176− view->setSource(QUrl::fromLocalFile(LISTVIEWWITHPAGEHEADER_FOLDER "/test_sectionexternalmodel.qml"));
176+ view->setSource(QUrl::fromLocalFile(DASHVIEWSTEST_FOLDER "/listviewwithpageheadertestsectionexternalmodel.qml"));
177177 lvwph = dynamic_cast<ListViewWithPageHeader*>(view->rootObject()->findChild<QQuickFlickable*>());
178178 QVERIFY(lvwph);
179179 view->show();
tests/plugins/ListViewWithPageHeader/test_sectionexternalmodel.qml → tests/plugins/DashViews/listviewwithpageheadertestsectionexternalmodel.qmlrenamed+1−1
@@ -15,7 +15,7 @@
1515 */
1616
1717import QtQuick 2.0
18−import ListViewWithPageHeader 0.1
18+import DashViews 0.1
1919
2020Rectangle {
2121 width: 300
tests/plugins/ListViewWithPageHeader/tst_listviewwithpageheaderqml.qml → tests/plugins/DashViews/tst_listviewwithpageheaderqml.qmlrenamed+1−1
@@ -16,7 +16,7 @@
1616
1717import QtQuick 2.0
1818import QtTest 1.0
19−import ListViewWithPageHeader 0.1
19+import DashViews 0.1
2020
2121Rectangle {
2222 width: 300
tests/plugins/DashViews/verticaljournaltest.cppnew file+315
@@ -0,0 +1,315 @@
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 as published by
6+ * the Free Software Foundation; version 3.
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+
17+#include <QQuickView>
18+#include <QtTestGui>
19+#include <QDebug>
20+#include <QGuiApplication>
21+#include <QQuickView>
22+#include <QtQml/qqml.h>
23+#include <QStringListModel>
24+#include <QQmlContext>
25+#include <QQmlEngine>
26+#pragma GCC diagnostic push
27+#pragma GCC diagnostic ignored "-pedantic"
28+#include <private/qquickitem_p.h>
29+#pragma GCC diagnostic pop
30+
31+#include "verticaljournal.h"
32+
33+class QHeightModel : public QStringListModel {
34+public:
35+ QHash<int, QByteArray> roleNames() const
36+ {
37+ QHash<int, QByteArray> roles;
38+ roles.insert(Qt::DisplayRole, "modelHeight");
39+ return roles;
40+ }
41+};
42+
43+class VerticalJournalTest : public QObject
44+{
45+ Q_OBJECT
46+
47+private:
48+ void verifyItem(const VerticalJournal::ViewItem &item, int modelIndex, qreal x, qreal y, bool visible)
49+ {
50+ QTRY_COMPARE(item.m_modelIndex, modelIndex);
51+ QTRY_COMPARE(item.x(), x);
52+ QTRY_COMPARE(item.y(), y);
53+ QTRY_COMPARE(item.height(), heightList[modelIndex].toDouble());
54+ QTRY_COMPARE(QQuickItemPrivate::get(item.m_item)->culled, !visible);
55+ }
56+
57+ void checkInitialPositions()
58+ {
59+ QTRY_COMPARE(vj->m_columnVisibleItems.count(), 3);
60+ QTRY_COMPARE(vj->m_columnVisibleItems[0].count(), 5);
61+ QTRY_COMPARE(vj->m_columnVisibleItems[1].count(), 7);
62+ QTRY_COMPARE(vj->m_columnVisibleItems[2].count(), 6);
63+ verifyItem(vj->m_columnVisibleItems[0][0], 0, 0, 0, true);
64+ verifyItem(vj->m_columnVisibleItems[1][0], 1, 160, 0, true);
65+ verifyItem(vj->m_columnVisibleItems[2][0], 2, 320, 0, true);
66+ verifyItem(vj->m_columnVisibleItems[1][1], 3, 160, 60, true);
67+ verifyItem(vj->m_columnVisibleItems[1][2], 4, 160, 80, true);
68+ verifyItem(vj->m_columnVisibleItems[0][1], 5, 0, 110, true);
69+ verifyItem(vj->m_columnVisibleItems[1][3], 6, 160, 130, true);
70+ verifyItem(vj->m_columnVisibleItems[2][1], 7, 320, 135, true);
71+ verifyItem(vj->m_columnVisibleItems[0][2], 8, 0, 190, true);
72+ verifyItem(vj->m_columnVisibleItems[2][2], 9, 320, 255, true);
73+ verifyItem(vj->m_columnVisibleItems[2][3], 10, 320, 285, true);
74+ verifyItem(vj->m_columnVisibleItems[2][4], 11, 320, 315, true);
75+ verifyItem(vj->m_columnVisibleItems[1][4], 12, 160, 340, true);
76+ verifyItem(vj->m_columnVisibleItems[0][3], 13, 0, 360, true);
77+ verifyItem(vj->m_columnVisibleItems[2][5], 14, 320, 390, true);
78+ verifyItem(vj->m_columnVisibleItems[1][5], 15, 160, 430, false);
79+ verifyItem(vj->m_columnVisibleItems[0][4], 16, 0, 570, false);
80+ verifyItem(vj->m_columnVisibleItems[1][6], 17, 160, 570, false);
81+ QCOMPARE(vj->implicitHeight(), 970. + 2. * 970. / 18.);
82+ }
83+
84+private Q_SLOTS:
85+ void init()
86+ {
87+ view = new QQuickView();
88+ view->setResizeMode(QQuickView::SizeRootObjectToView);
89+ view->engine()->addImportPath(BUILT_PLUGINS_DIR);
90+
91+ model = new QHeightModel();
92+ heightList.clear();
93+ heightList << "100" << "50" << "125" << "10" << "40" << "70" << "200" << "110" << "160" << "20" << "20" << "65" << "80" << "200" << "300" << "130" << "400" << "300" << "500" << "10";
94+ model->setStringList(heightList);
95+
96+ view->setSource(QUrl::fromLocalFile(DASHVIEWSTEST_FOLDER "/verticaljournaltest.qml"));
97+
98+ view->show();
99+ view->resize(470, 400);
100+ QTest::qWaitForWindowExposed(view);
101+
102+ vj = dynamic_cast<VerticalJournal*>(view->rootObject()->findChild<QObject*>("vj"));
103+ vj->setModel(model);
104+
105+ checkInitialPositions();
106+ }
107+
108+ void cleanup()
109+ {
110+ delete view;
111+ delete model;
112+ }
113+
114+ void testWidthResize()
115+ {
116+ view->resize(629, 400);
117+ QTRY_COMPARE(vj->width(), 629.);
118+
119+ // This is exactly the same block as above as nothing changed, just white space on the right
120+ checkInitialPositions();
121+
122+ view->resize(630, 400);
123+
124+ QTRY_COMPARE(vj->m_columnVisibleItems.count(), 4);
125+ QTRY_COMPARE(vj->m_columnVisibleItems[0].count(), 4);
126+ QTRY_COMPARE(vj->m_columnVisibleItems[1].count(), 7);
127+ QTRY_COMPARE(vj->m_columnVisibleItems[2].count(), 4);
128+ QTRY_COMPARE(vj->m_columnVisibleItems[3].count(), 5);
129+ verifyItem(vj->m_columnVisibleItems[0][0], 0, 0, 0, true);
130+ verifyItem(vj->m_columnVisibleItems[1][0], 1, 160, 0, true);
131+ verifyItem(vj->m_columnVisibleItems[2][0], 2, 320, 0, true);
132+ verifyItem(vj->m_columnVisibleItems[3][0], 3, 480, 0, true);
133+ verifyItem(vj->m_columnVisibleItems[3][1], 4, 480, 20, true);
134+ verifyItem(vj->m_columnVisibleItems[1][1], 5, 160, 60, true);
135+ verifyItem(vj->m_columnVisibleItems[3][2], 6, 480, 70, true);
136+ verifyItem(vj->m_columnVisibleItems[0][1], 7, 0, 110, true);
137+ verifyItem(vj->m_columnVisibleItems[2][1], 8, 320, 135, true);
138+ verifyItem(vj->m_columnVisibleItems[1][2], 9, 160, 140, true);
139+ verifyItem(vj->m_columnVisibleItems[1][3], 10, 160, 170, true);
140+ verifyItem(vj->m_columnVisibleItems[1][4], 11, 160, 200, true);
141+ verifyItem(vj->m_columnVisibleItems[0][2], 12, 0, 230, true);
142+ verifyItem(vj->m_columnVisibleItems[1][5], 13, 160, 275, true);
143+ verifyItem(vj->m_columnVisibleItems[3][3], 14, 480, 280, true);
144+ verifyItem(vj->m_columnVisibleItems[2][2], 15, 320, 305, true);
145+ verifyItem(vj->m_columnVisibleItems[0][3], 16, 0, 320, true);
146+ verifyItem(vj->m_columnVisibleItems[2][3], 17, 320, 445, false);
147+ verifyItem(vj->m_columnVisibleItems[1][6], 18, 160, 485, false);
148+ verifyItem(vj->m_columnVisibleItems[3][4], 19, 480, 590, false);
149+ QTRY_COMPARE(vj->implicitHeight(), 985.);
150+
151+ view->resize(470, 400);
152+
153+ // This is exactly the same block as the first again
154+ checkInitialPositions();
155+ }
156+
157+ void testColumnSpacing()
158+ {
159+ vj->setColumnSpacing(11);
160+
161+ QTRY_COMPARE(vj->m_needsRelayout, false);
162+ QTRY_COMPARE(vj->m_columnVisibleItems.count(), 2);
163+ QTRY_COMPARE(vj->m_columnVisibleItems[0].count(), 7);
164+ QTRY_COMPARE(vj->m_columnVisibleItems[1].count(), 7);
165+ verifyItem(vj->m_columnVisibleItems[0][0], 0, 0, 0, true);
166+ verifyItem(vj->m_columnVisibleItems[1][0], 1, 161, 0, true);
167+ verifyItem(vj->m_columnVisibleItems[1][1], 2, 161, 60, true);
168+ verifyItem(vj->m_columnVisibleItems[0][1], 3, 0, 110, true);
169+ verifyItem(vj->m_columnVisibleItems[0][2], 4, 0, 130, true);
170+ verifyItem(vj->m_columnVisibleItems[0][3], 5, 0, 180, true);
171+ verifyItem(vj->m_columnVisibleItems[1][2], 6, 161, 195, true);
172+ verifyItem(vj->m_columnVisibleItems[0][4], 7, 0, 260, true);
173+ verifyItem(vj->m_columnVisibleItems[0][5], 8, 0, 380, true);
174+ verifyItem(vj->m_columnVisibleItems[1][3], 9, 161, 405, false);
175+ verifyItem(vj->m_columnVisibleItems[1][4], 10, 161, 435, false);
176+ verifyItem(vj->m_columnVisibleItems[1][5], 11, 161, 465, false);
177+ verifyItem(vj->m_columnVisibleItems[1][6], 12, 161, 540, false);
178+ verifyItem(vj->m_columnVisibleItems[0][6], 13, 0, 550, false);
179+ QCOMPARE(vj->implicitHeight(), 750. + 6. * 750. / 14.);
180+
181+ vj->setColumnSpacing(10);
182+ QTRY_COMPARE(vj->m_needsRelayout, false);
183+
184+ // This is exactly the same block as the first again
185+ checkInitialPositions();
186+ }
187+
188+ void testRowSpacing()
189+ {
190+ vj->setRowSpacing(11);
191+
192+ QTRY_COMPARE(vj->m_needsRelayout, false);
193+ QTRY_COMPARE(vj->m_columnVisibleItems.count(), 3);
194+ QTRY_COMPARE(vj->m_columnVisibleItems[0].count(), 5);
195+ QTRY_COMPARE(vj->m_columnVisibleItems[1].count(), 7);
196+ QTRY_COMPARE(vj->m_columnVisibleItems[2].count(), 6);
197+ verifyItem(vj->m_columnVisibleItems[0][0], 0, 0, 0, true);
198+ verifyItem(vj->m_columnVisibleItems[1][0], 1, 160, 0, true);
199+ verifyItem(vj->m_columnVisibleItems[2][0], 2, 320, 0, true);
200+ verifyItem(vj->m_columnVisibleItems[1][1], 3, 160, 61, true);
201+ verifyItem(vj->m_columnVisibleItems[1][2], 4, 160, 82, true);
202+ verifyItem(vj->m_columnVisibleItems[0][1], 5, 0, 111, true);
203+ verifyItem(vj->m_columnVisibleItems[1][3], 6, 160, 133, true);
204+ verifyItem(vj->m_columnVisibleItems[2][1], 7, 320, 136, true);
205+ verifyItem(vj->m_columnVisibleItems[0][2], 8, 0, 192, true);
206+ verifyItem(vj->m_columnVisibleItems[2][2], 9, 320, 257, true);
207+ verifyItem(vj->m_columnVisibleItems[2][3], 10, 320, 288, true);
208+ verifyItem(vj->m_columnVisibleItems[2][4], 11, 320, 319, true);
209+ verifyItem(vj->m_columnVisibleItems[1][4], 12, 160, 344, true);
210+ verifyItem(vj->m_columnVisibleItems[0][3], 13, 0, 363, true);
211+ verifyItem(vj->m_columnVisibleItems[2][5], 14, 320, 395, true);
212+ verifyItem(vj->m_columnVisibleItems[1][5], 15, 160, 435, false);
213+ verifyItem(vj->m_columnVisibleItems[0][4], 16, 0, 574, false);
214+ verifyItem(vj->m_columnVisibleItems[1][6], 17, 160, 576, false);
215+ QCOMPARE(vj->implicitHeight(), 974. + 2. * 974. / 18.);
216+
217+ vj->setRowSpacing(10);
218+ QTRY_COMPARE(vj->m_needsRelayout, false);
219+
220+ // This is exactly the same block as the first again
221+ checkInitialPositions();
222+ }
223+
224+ void testDelegateCreationRanges()
225+ {
226+ vj->setDelegateCreationBegin(200);
227+ vj->setDelegateCreationEnd(view->height());
228+
229+ QTRY_COMPARE(vj->m_columnVisibleItems.count(), 3);
230+ QTRY_COMPARE(vj->m_columnVisibleItems[0].count(), 4);
231+ QTRY_COMPARE(vj->m_columnVisibleItems[1].count(), 4);
232+ QTRY_COMPARE(vj->m_columnVisibleItems[2].count(), 6);
233+ verifyItem(vj->m_columnVisibleItems[0][0], 0, 0, 0, false);
234+ verifyItem(vj->m_columnVisibleItems[2][0], 2, 320, 0, false);
235+ verifyItem(vj->m_columnVisibleItems[1][0], 4, 160, 80, false);
236+ verifyItem(vj->m_columnVisibleItems[0][1], 5, 0, 110, false);
237+ verifyItem(vj->m_columnVisibleItems[1][1], 6, 160, 130, true);
238+ verifyItem(vj->m_columnVisibleItems[2][1], 7, 320, 135, true);
239+ verifyItem(vj->m_columnVisibleItems[0][2], 8, 0, 190, true);
240+ verifyItem(vj->m_columnVisibleItems[2][2], 9, 320, 255, true);
241+ verifyItem(vj->m_columnVisibleItems[2][3], 10, 320, 285, true);
242+ verifyItem(vj->m_columnVisibleItems[2][4], 11, 320, 315, true);
243+ verifyItem(vj->m_columnVisibleItems[1][2], 12, 160, 340, true);
244+ verifyItem(vj->m_columnVisibleItems[0][3], 13, 0, 360, true);
245+ verifyItem(vj->m_columnVisibleItems[2][5], 14, 320, 390, true);
246+ verifyItem(vj->m_columnVisibleItems[1][3], 15, 160, 430, false);
247+ QCOMPARE(vj->implicitHeight(), 690. + 4. * 690. / 16.);
248+
249+ vj->resetDelegateCreationBegin();
250+ vj->resetDelegateCreationEnd();
251+
252+ // This is exactly the same block as the first again
253+ checkInitialPositions();
254+ }
255+
256+
257+ void testColumnWidthChange()
258+ {
259+ vj->setColumnWidth(200);
260+ QTRY_COMPARE(vj->m_columnVisibleItems.count(), 2);
261+ QTRY_COMPARE(vj->m_columnVisibleItems[0].count(), 7);
262+ QTRY_COMPARE(vj->m_columnVisibleItems[1].count(), 7);
263+ verifyItem(vj->m_columnVisibleItems[0][0], 0, 0, 0, true);
264+ verifyItem(vj->m_columnVisibleItems[1][0], 1, 210, 0, true);
265+ verifyItem(vj->m_columnVisibleItems[1][1], 2, 210, 60, true);
266+ verifyItem(vj->m_columnVisibleItems[0][1], 3, 0, 110, true);
267+ verifyItem(vj->m_columnVisibleItems[0][2], 4, 0, 130, true);
268+ verifyItem(vj->m_columnVisibleItems[0][3], 5, 0, 180, true);
269+ verifyItem(vj->m_columnVisibleItems[1][2], 6, 210, 195, true);
270+ verifyItem(vj->m_columnVisibleItems[0][4], 7, 0, 260, true);
271+ verifyItem(vj->m_columnVisibleItems[0][5], 8, 0, 380, true);
272+ verifyItem(vj->m_columnVisibleItems[1][3], 9, 210, 405, false);
273+ verifyItem(vj->m_columnVisibleItems[1][4], 10, 210, 435, false);
274+ verifyItem(vj->m_columnVisibleItems[1][5], 11, 210, 465, false);
275+ verifyItem(vj->m_columnVisibleItems[1][6], 12, 210, 540, false);
276+ verifyItem(vj->m_columnVisibleItems[0][6], 13, 0, 550, false);
277+ QCOMPARE(vj->implicitHeight(), 750. + 6. * 750. / 14.);
278+
279+ vj->setColumnWidth(150);
280+
281+ // This is exactly the same block as the first again
282+ checkInitialPositions();
283+ }
284+
285+ void testChangeModel()
286+ {
287+ QHeightModel model2;
288+ QStringList list2;
289+ list2 << "100" << "50" << "25" << "25" << "50" << "50";
290+ model2.setStringList(list2);
291+ vj->setModel(&model2);
292+ heightList = list2;
293+
294+ QTRY_COMPARE(vj->m_columnVisibleItems.count(), 3);
295+ QTRY_COMPARE(vj->m_columnVisibleItems[0].count(), 1);
296+ QTRY_COMPARE(vj->m_columnVisibleItems[1].count(), 2);
297+ QTRY_COMPARE(vj->m_columnVisibleItems[2].count(), 3);
298+ verifyItem(vj->m_columnVisibleItems[0][0], 0, 0, 0, true);
299+ verifyItem(vj->m_columnVisibleItems[1][0], 1, 160, 0, true);
300+ verifyItem(vj->m_columnVisibleItems[2][0], 2, 320, 0, true);
301+ verifyItem(vj->m_columnVisibleItems[2][1], 3, 320, 35, true);
302+ verifyItem(vj->m_columnVisibleItems[1][1], 4, 160, 60, true);
303+ verifyItem(vj->m_columnVisibleItems[2][2], 5, 320, 70, true);
304+ }
305+
306+private:
307+ QQuickView *view;
308+ VerticalJournal *vj;
309+ QStringList heightList;
310+ QHeightModel *model;
311+};
312+
313+QTEST_MAIN(VerticalJournalTest)
314+
315+#include "verticaljournaltest.moc"
tests/plugins/DashViews/verticaljournaltest.qmlnew file+44
@@ -0,0 +1,44 @@
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 as published by
6+ * the Free Software Foundation; version 3.
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+
17+import QtQuick 2.1
18+import DashViews 0.1
19+
20+Item {
21+
22+ VerticalJournal {
23+ id: vj
24+ objectName: "vj"
25+ anchors.fill: parent
26+ columnWidth: 150
27+ columnSpacing: 10
28+ rowSpacing: 10
29+
30+ delegate: Rectangle {
31+ property real randomValue: Math.random()
32+ width: 150
33+ color: randomValue < 0.3 ? "green" : randomValue < 0.6 ? "blue" : "red";
34+ height: modelHeight
35+ border.width: 3
36+
37+ Text {
38+ text: index + "\ny: " + parent.y + "\nheight: " + parent.height
39+ x: 10
40+ y: 10
41+ }
42+ }
43+ }
44+}
tests/plugins/DashViews/verticaljournaltry.cppnew file+90
@@ -0,0 +1,90 @@
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 as published by
6+ * the Free Software Foundation; version 3.
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+
17+#include <QQuickView>
18+#include <QDebug>
19+#include <QGuiApplication>
20+#include <QQuickView>
21+#include <QtQml/qqml.h>
22+#include <QStringListModel>
23+#include <QQmlContext>
24+#include <QQmlEngine>
25+#include <QGuiApplication>
26+
27+#include "verticaljournal.h"
28+
29+class QHeightModel : public QStringListModel {
30+ Q_OBJECT
31+public:
32+ QHash<int, QByteArray> roleNames() const
33+ {
34+ QHash<int, QByteArray> roles;
35+ roles.insert(Qt::DisplayRole, "modelHeight");
36+ return roles;
37+ }
38+
39+public slots:
40+ void add(int height)
41+ {
42+ if (height <= 0) {
43+ height = 50 + 50. * qrand() / RAND_MAX ;
44+ }
45+ QStringList sl = stringList();
46+ sl << QString::number(height);
47+ setStringList(sl);
48+ }
49+
50+ void remove()
51+ {
52+ QStringList sl = stringList();
53+ if (!sl.isEmpty()) {
54+ sl.removeLast();
55+ setStringList(sl);
56+ }
57+ }
58+};
59+
60+int main(int argc, char *argv[])
61+{
62+ QGuiApplication a(argc, argv);
63+
64+ QQuickView *view = new QQuickView();
65+ view->setResizeMode(QQuickView::SizeRootObjectToView);
66+ view->engine()->addImportPath(BUILT_PLUGINS_DIR);
67+
68+ QHeightModel model;
69+ QStringList heightList;
70+ heightList << "100" << "50" << "125";
71+ model.setStringList(heightList);
72+
73+ QStringListModel listModel;
74+ listModel.setStringList(QStringList() << QString());
75+
76+ view->rootContext()->setContextProperty("listModel", &listModel);
77+ view->rootContext()->setContextProperty("vjModel", &model);
78+
79+ view->setSource(QUrl::fromLocalFile(DASHVIEWSTEST_FOLDER "/verticaljournaltry.qml"));
80+
81+ view->show();
82+ view->resize(530, 400);
83+
84+ QObject::connect(view->rootObject(), SIGNAL(add(int)), &model, SLOT(add(int)));
85+ QObject::connect(view->rootObject(), SIGNAL(remove()), &model, SLOT(remove()));
86+
87+ return a.exec();
88+}
89+
90+#include "verticaljournaltry.moc"
tests/plugins/DashViews/verticaljournaltry.qmlnew file+100
@@ -0,0 +1,100 @@
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 as published by
6+ * the Free Software Foundation; version 3.
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+
17+import QtQuick 2.1
18+import DashViews 0.1
19+
20+Item {
21+ id: root
22+ signal add(int height)
23+ signal remove()
24+
25+ ListViewWithPageHeader {
26+ id: lvwph
27+ model: listModel
28+ height: parent.height
29+ width: parent.width - controls.width
30+
31+ delegate: VerticalJournal {
32+ id: vj
33+ model: vjModel
34+ columnWidth: 100
35+ columnSpacing: 10
36+ rowSpacing: 10
37+ width: parent.width
38+ height: implicitHeight > 100 ? implicitHeight : 100
39+ delegateCreationBegin: lvwph.contentY
40+ delegateCreationEnd: lvwph.contentY + lvwph.height
41+
42+ delegate: Rectangle {
43+ width: 100
44+ color: "red";
45+ height: modelHeight
46+ border.width: 3
47+
48+ Text {
49+ text: index + "\ny: " + parent.y + "\nheight: " + parent.height
50+ x: 10
51+ y: 10
52+ }
53+ }
54+ }
55+ }
56+
57+ Rectangle {
58+ id: controls
59+ height: parent.height
60+ width: 100
61+ anchors.right: parent.right
62+ color: "gray"
63+ opacity: 0.4
64+
65+ Rectangle {
66+ id: addButton
67+ height: 50
68+ width: parent.width
69+ color: "blue"
70+ Text {
71+ text: "Add"
72+ anchors.centerIn: parent
73+ }
74+ MouseArea {
75+ anchors.fill: parent
76+ onClicked: root.add(addField.text)
77+ }
78+ }
79+ TextInput {
80+ id: addField
81+ anchors.top: addButton.bottom
82+ height: 30
83+ width: parent.width
84+ }
85+ Rectangle {
86+ anchors.top: addField.bottom
87+ height: 50
88+ width: parent.width
89+ color: "red"
90+ Text {
91+ text: "Remove"
92+ anchors.centerIn: parent
93+ }
94+ MouseArea {
95+ anchors.fill: parent
96+ onClicked: root.remove()
97+ }
98+ }
99+ }
100+}
tests/plugins/Ubuntu/Gestures/CMakeLists.txt+1
@@ -3,6 +3,7 @@ include(QmlTest)
33include_directories(
44 ${CMAKE_SOURCE_DIR}/plugins/Ubuntu/Gestures
55 ${CMAKE_CURRENT_BINARY_DIR}
6+ ${Qt5Gui_PRIVATE_INCLUDE_DIRS}
67 )
78
89file(GLOB qmlFiles *.qml)
tests/plugins/Unity/Indicators/CMakeLists.txt−1
@@ -40,4 +40,3 @@ indicator_test(indicatorsmodeltest ADDITIONAL_LIBS IndicatorsQml)
4040indicator_test(menucontentactivatortest ADDITIONAL_CPPS ${INDICATORS_DIR}/menucontentactivator.cpp)
4141indicator_test(unitymenumodelstacktest ADDITIONAL_CPPS ${TEST_DIR}/mocks/QMenuModel/unitymenumodel.cpp ${INDICATORS_DIR}/unitymenumodelstack.cpp)
4242indicator_test(rootactionstatetest ADDITIONAL_LIBS IndicatorsQml)
43−indicator_test(timeformattertest ADDITIONAL_LIBS IndicatorsQml)
tests/plugins/Unity/Indicators/indicatorsmanagertest.cpp+2−1
@@ -18,7 +18,8 @@
1818 */
1919
2020#include "indicatorsmanager.h"
21−#include "paths.h"
21+
22+#include <paths.h>
2223
2324#include <QtTest>
2425#include <QDebug>
tests/plugins/Unity/Indicators/indicatorsmodeltest.cpp+2−1
@@ -19,7 +19,8 @@
1919
2020#include "indicatorsmodel.h"
2121#include "indicators.h"
22−#include "paths.h"
22+
23+#include <paths.h>
2324
2425#include <QtTest>
2526#include <QDebug>
tests/plugins/Unity/Indicators/menucontentactivatortest.cpp−1
@@ -18,7 +18,6 @@
1818 */
1919
2020#include "menucontentactivator.h"
21−#include "paths.h"
2221
2322#include <QtTest>
2423#include <QDebug>
tests/plugins/Unity/Indicators/unitymenumodelstacktest.cpp−1
@@ -18,7 +18,6 @@
1818 */
1919
2020#include "indicatorsmanager.h"
21−#include "paths.h"
2221#include "unitymenumodelstack.h"
2322
2423#include <QtTest>
tests/plugins/Unity/Launcher/launchermodeltest.cpp+1
@@ -94,6 +94,7 @@ public:
9494 endRemoveRows();
9595 }
9696 void updateScreenshot(const QString &appId) { Q_UNUSED(appId); }
97+ void activateApplication(const QString &appId) { Q_UNUSED(appId); }
9798
9899private:
99100 QList<MockApp*> m_list;
tests/plugins/Utils/CMakeLists.txt+1
@@ -24,4 +24,5 @@ endmacro(run_tests)
2424run_tests(
2525 qlimitproxymodeltest
2626 qsortfilterproxymodeltest
27+ timeformattertest
2728 )
tests/plugins/Unity/Indicators/timeformattertest.cpp → tests/plugins/Utils/timeformattertest.cpprenamed+13
@@ -48,6 +48,19 @@ private Q_SLOTS:
4848
4949 QCOMPARE(formatter.timeString(), time.toString(format));
5050 }
51+
52+ void testFormatStrF()
53+ {
54+ const QString format = "%d-%m-%Y %I:%M%p";
55+
56+ QDateTime time = QDateTime::currentDateTime();
57+
58+ GDateTimeFormatter formatter;
59+ formatter.setTime(time.toMSecsSinceEpoch() / 1000); // strftime in seconds since epoc
60+ formatter.setFormat(format);
61+
62+ QCOMPARE(formatter.timeString(), time.toString("dd-MM-yyyy hh:mmAP"));
63+ }
5164};
5265
5366QTEST_GUILESS_MAIN(TimeFormatterTest)
tests/qmltests/Components/CMakeLists.txt+1
@@ -3,6 +3,7 @@
33include_directories(
44 ${CMAKE_SOURCE_DIR}/plugins/Ubuntu/Gestures
55 ${CMAKE_CURRENT_BINARY_DIR}
6+ ${Qt5Gui_PRIVATE_INCLUDE_DIRS}
67 )
78
89set(testCommand
tests/qmltests/Components/RevealingRectangle.qml+1−1
@@ -16,7 +16,7 @@
1616
1717import QtQuick 2.0
1818import Ubuntu.Components 0.1
19−import "../../../Components"
19+import "../../../qml/Components"
2020
2121Item {
2222 id: revealingRectangle
tests/qmltests/Components/tst_AnimationControllerWithSignals.qml+1−1
@@ -16,7 +16,7 @@
1616
1717import QtQuick 2.0
1818import QtTest 1.0
19−import "../../../Components"
19+import "../../../qml/Components"
2020
2121TestCase {
2222 id: testCase
tests/qmltests/Components/tst_Carousel.qml+1−1
@@ -16,7 +16,7 @@
1616
1717import QtQuick 2.0
1818import QtTest 1.0
19−import "../../../Components/carousel.js" as Carousel
19+import "../../../qml/Components/carousel.js" as Carousel
2020
2121TestCase {
2222 id: root
tests/qmltests/Components/tst_DragHandle.qml+1−1
@@ -15,7 +15,7 @@
1515 */
1616
1717import QtQuick 2.0
18−import "../../../Components"
18+import "../../../qml/Components"
1919import "tst_DragHandle"
2020import Ubuntu.Components 0.1
2121import Ubuntu.Gestures 0.1
tests/qmltests/Components/tst_DragHandle/HorizontalShowable.qml+1−1
@@ -15,7 +15,7 @@
1515 */
1616
1717import QtQuick 2.0
18−import "../../../../Components"
18+import "../../../../qml/Components"
1919import Ubuntu.Components 0.1
2020import Ubuntu.Gestures 0.1
2121
tests/qmltests/Components/tst_DragHandle/VerticalShowable.qml+1−1
@@ -15,7 +15,7 @@
1515 */
1616
1717import QtQuick 2.0
18−import "../../../../Components"
18+import "../../../../qml/Components"
1919import Ubuntu.Components 0.1
2020import Ubuntu.Gestures 0.1
2121
tests/qmltests/Components/tst_DraggingArea.qml+1−1
@@ -16,7 +16,7 @@
1616
1717import QtQuick 2.0
1818import QtTest 1.0
19−import "../../../Components"
19+import "../../../qml/Components"
2020
2121/*
2222 There will be a green rectangle in the center of the
tests/qmltests/Components/tst_EdgeDemoOverlay.qml+1−1
@@ -17,7 +17,7 @@
1717import QtQuick 2.0
1818import QtTest 1.0
1919import Unity.Test 0.1 as UT
20−import "../../../Components"
20+import "../../../qml/Components"
2121
2222Item {
2323 id: root
tests/qmltests/Components/tst_FilterGrid.qml+1−1
@@ -16,7 +16,7 @@
1616
1717import QtQuick 2.0
1818import QtTest 1.0
19−import "../../../Components"
19+import "../../../qml/Components"
2020import Ubuntu.Components.ListItems 0.1 as ListItem
2121import Ubuntu.Components 0.1
2222import Unity.Test 0.1 as UT
tests/qmltests/Components/tst_LazyImage.qml+1−1
@@ -16,7 +16,7 @@
1616
1717import QtQuick 2.0
1818import QtTest 1.0
19−import "../../../Components"
19+import "../../../qml/Components"
2020import Ubuntu.Components 0.1
2121import Unity.Test 0.1 as UT
2222import "tst_LazyImage"
tests/qmltests/Components/tst_LazyImage/ImageControls.qml+1−1
@@ -16,7 +16,7 @@
1616
1717import QtQuick 2.0
1818import Ubuntu.Components 0.1
19−import "../../../../Components"
19+import "../../../../qml/Components"
2020
2121Row {
2222 property LazyImage image
tests/qmltests/Components/tst_OpenEffect.qml+1−1
@@ -16,7 +16,7 @@
1616
1717import QtQuick 2.0
1818import QtTest 1.0
19−import "../../../Components"
19+import "../../../qml/Components"
2020
2121TestCase {
2222 name: "OpenEffectTest"
tests/qmltests/Components/tst_PageHeader.qml+1−1
@@ -17,7 +17,7 @@
1717import QtQuick 2.0
1818import QtTest 1.0
1919import ".."
20−import "../../../Components"
20+import "../../../qml/Components"
2121import Ubuntu.Components 0.1
2222import Unity 0.1
2323import Unity.Test 0.1 as UT
tests/qmltests/Components/tst_RatingStars.qml+1−1
@@ -16,7 +16,7 @@
1616
1717import QtQuick 2.0
1818import QtTest 1.0
19−import "../../../Components"
19+import "../../../qml/Components"
2020
2121TestCase {
2222 name: "RatingStars"
tests/qmltests/Components/tst_ResponsiveFlowView.qml+1−1
@@ -17,7 +17,7 @@
1717import QtQuick 2.0
1818import QtTest 1.0
1919import ".."
20−import "../../../Components"
20+import "../../../qml/Components"
2121import Ubuntu.Components.ListItems 0.1 as ListItem
2222import Ubuntu.Components 0.1
2323import Unity.Test 0.1 as UT
tests/qmltests/Components/tst_ResponsiveGridView.qml+1−1
@@ -17,7 +17,7 @@
1717import QtQuick 2.0
1818import QtTest 1.0
1919import ".."
20−import "../../../Components"
20+import "../../../qml/Components"
2121import Ubuntu.Components.ListItems 0.1 as ListItem
2222import Ubuntu.Components 0.1
2323import Unity.Test 0.1 as UT
tests/qmltests/Components/tst_Showable.qml+1−1
@@ -19,7 +19,7 @@ import QtTest 1.0
1919import Ubuntu.Components 0.1
2020import Unity.Test 0.1 as UT
2121import ".."
22−import "../../../Components"
22+import "../../../qml/Components"
2323
2424/*
2525 There will be 3 stacked rectangles, red, green & blue. Initially they
tests/qmltests/Components/tst_Stage.qml+1−1
@@ -17,7 +17,7 @@
1717import QtQuick 2.0
1818import QtTest 1.0
1919import ".."
20−import "../../../Components"
20+import "../../../qml/Components"
2121import Unity.Application 0.1
2222import Ubuntu.Components 0.1
2323import Unity.Test 0.1 as UT
tests/qmltests/Components/tst_Tile.qml+1−1
@@ -17,7 +17,7 @@
1717import QtQuick 2.0
1818import QtTest 1.0
1919import ".."
20−import "../../../Components"
20+import "../../../qml/Components"
2121import Ubuntu.Components 0.1
2222import Unity.Test 0.1 as UT
2323
tests/qmltests/Dash/Apps/tst_AppPreview.qml+1−1
@@ -17,7 +17,7 @@
1717import QtQuick 2.0
1818import QtTest 1.0
1919import Ubuntu.Components 0.1
20−import "../../../../Dash/Apps"
20+import "../../../../qml/Dash/Apps"
2121import Unity.Test 0.1 as UT
2222
2323Item {
tests/qmltests/Dash/Apps/tst_RunningApplicationsGrid.qml+1−1
@@ -16,7 +16,7 @@
1616
1717import QtQuick 2.0
1818import QtTest 1.0
19−import "../../../../Dash/Apps"
19+import "../../../../qml/Dash/Apps"
2020import Unity.Test 0.1 as UT
2121
2222Item {
tests/qmltests/Dash/Movie/tst_MoviePreview.qml+1−1
@@ -16,7 +16,7 @@
1616
1717import QtQuick 2.0
1818import QtTest 1.0
19−import "../../../../Dash/Movie"
19+import "../../../../qml/Dash/Movie"
2020import Unity.Test 0.1 as UT
2121
2222Item {
tests/qmltests/Dash/Music/tst_MusicPreview.qml+1−1
@@ -16,7 +16,7 @@
1616
1717import QtQuick 2.0
1818import QtTest 1.0
19−import "../../../../Dash/Music"
19+import "../../../../qml/Dash/Music"
2020import Unity.Test 0.1 as UT
2121import QtMultimedia 5.0
2222
tests/qmltests/Dash/qml/FakeScopeView.qml+1−1
@@ -17,7 +17,7 @@
1717import QtQuick 2.0
1818import Unity 0.1
1919
20−import "../../../../Dash"
20+import "../../../../qml/Dash"
2121
2222GenericScopeView {
2323 id: fakeScopeView
tests/qmltests/Dash/tst_Dash.qml+6−6
@@ -16,7 +16,7 @@
1616
1717import QtQuick 2.0
1818import QtTest 1.0
19−import "../../../Dash"
19+import "../../../qml/Dash"
2020import Ubuntu.Components 0.1
2121import Unity.Test 0.1 as UT
2222
@@ -36,12 +36,12 @@ Item {
3636 ScopeDelegateMapper {
3737 id: scopeDelegateMapper
3838 scopeDelegateMapping: {
39− "MockScope1": "../tests/qmltests/Dash/qml/fake_scopeView1.qml",
40− "MockScope2": "../tests/qmltests/Dash/qml/fake_scopeView2.qml",
41− "home.scope": "../tests/qmltests/Dash/qml/fake_scopeView3.qml",
42− "applications.scope": "../tests/qmltests/Dash/qml/fake_scopeView4.qml"
39+ "MockScope1": Qt.resolvedUrl("qml/fake_scopeView1.qml"),
40+ "MockScope2": Qt.resolvedUrl("qml/fake_scopeView2.qml"),
41+ "home.scope": Qt.resolvedUrl("qml/fake_scopeView3.qml"),
42+ "applications.scope": Qt.resolvedUrl("qml/fake_scopeView4.qml")
4343 }
44− genericScope: "../tests/qmltests/Dash/qml/fake_generic_scopeView.qml"
44+ genericScope: Qt.resolvedUrl("qml/fake_generic_scopeView.qml")
4545 }
4646
4747 UT.UnityTestCase {
tests/qmltests/Dash/tst_DashBar.qml+1−1
@@ -18,7 +18,7 @@ import QtQuick 2.0
1818import QtTest 1.0
1919import Unity 0.1
2020import ".."
21−import "../../../Dash"
21+import "../../../qml/Dash"
2222import Ubuntu.Components 0.1
2323import Unity.Test 0.1 as UT
2424
tests/qmltests/Dash/tst_DashContent.qml+6−6
@@ -16,7 +16,7 @@
1616
1717import QtQuick 2.0
1818import QtTest 1.0
19−import "../../../Dash"
19+import "../../../qml/Dash"
2020import Ubuntu.Components 0.1
2121import Unity 0.1
2222import Unity.Test 0.1 as UT
@@ -64,12 +64,12 @@ Item {
6464 ScopeDelegateMapper {
6565 id: scopeDelegateMapper
6666 scopeDelegateMapping: {
67− "MockScope1": "../tests/qmltests/Dash/qml/fake_scopeView1.qml",
68− "MockScope2": "../tests/qmltests/Dash/qml/fake_scopeView2.qml",
69− "home.scope": "../tests/qmltests/Dash/qml/fake_scopeView3.qml",
70− "applications.scope": "../tests/qmltests/Dash/qml/fake_scopeView4.qml"
67+ "MockScope1": Qt.resolvedUrl("qml/fake_scopeView1.qml"),
68+ "MockScope2": Qt.resolvedUrl("qml/fake_scopeView2.qml"),
69+ "home.scope": Qt.resolvedUrl("qml/fake_scopeView3.qml"),
70+ "applications.scope": Qt.resolvedUrl("qml/fake_scopeView4.qml")
7171 }
72− genericScope: "../tests/qmltests/Dash/qml/fake_generic_scopeView.qml"
72+ genericScope: Qt.resolvedUrl("qml/fake_generic_scopeView.qml")
7373 }
7474
7575 function clear_scope_status() {
tests/qmltests/Dash/tst_DashPreview.qml+1−1
@@ -17,7 +17,7 @@
1717import QtQuick 2.0
1818import QtTest 1.0
1919import ".."
20−import "../../../Dash"
20+import "../../../qml/Dash"
2121import Ubuntu.Components 0.1
2222import Unity.Test 0.1 as UT
2323
tests/qmltests/Dash/tst_FilterGrids.qml+3−3
@@ -16,7 +16,7 @@
1616
1717import QtQuick 2.0
1818import QtTest 1.0
19−import "../../../Dash/Video"
19+import "../../../qml/Dash/Video"
2020import Ubuntu.Components.ListItems 0.1 as ListItem
2121import Ubuntu.Components 0.1
2222import Unity.Test 0.1 as UT
@@ -46,7 +46,7 @@ Rectangle {
4646 Button {
4747 anchors {left: parent.left; right: parent.right; margins: units.gu(1) }
4848 text: testCase.test_clicked_signal_data()[index].tag
49− onClicked: gridLoader.source = "../../../Dash/" + testCase.test_clicked_signal_data()[index].component
49+ onClicked: gridLoader.source = "../../../qml/Dash/" + testCase.test_clicked_signal_data()[index].component
5050 }
5151 }
5252 }
@@ -114,7 +114,7 @@ Rectangle {
114114
115115 function test_clicked_signal(data) {
116116 gridLoader.source = "";
117− gridLoader.source = "../../../Dash/" + data.component;
117+ gridLoader.source = "../../../qml/Dash/" + data.component;
118118
119119 // Wait until the FilterGrid is loaded by the loader
120120 tryCompare(gridLoader, "status", Loader.Ready);
tests/qmltests/Dash/tst_GenericPreview.qml+1−1
@@ -16,7 +16,7 @@
1616
1717import QtQuick 2.0
1818import QtTest 1.0
19−import "../../../Dash/Generic"
19+import "../../../qml/Dash/Generic"
2020import Unity.Test 0.1 as UT
2121
2222Item {
tests/qmltests/Dash/tst_GenericScopeView.qml+35−5
@@ -18,8 +18,8 @@ import QtQuick 2.0
1818import QtTest 1.0
1919import Unity 0.1
2020import ".."
21−import "../../../Dash"
22−import "../../../Components"
21+import "../../../qml/Dash"
22+import "../../../qml/Components"
2323import Ubuntu.Components 0.1
2424import Unity.Test 0.1 as UT
2525
@@ -79,14 +79,14 @@ Item {
7979 var categoryListView = findChild(genericScopeView, "categoryListView");
8080 categoryListView.positionAtBeginning();
8181
82− var tile = findChild(genericScopeView, "delegate0");
82+ var tile = findChild(findChild(genericScopeView, "0"), "delegate0");
8383 mouseClick(tile, tile.width / 2, tile.height / 2);
8484 var openEffect = findChild(genericScopeView, "openEffect");
8585 tryCompare(openEffect, "gap", 1);
8686 }
8787
8888 function checkArrowPosition(index) {
89− var tile = findChild(genericScopeView, "delegate" + index);
89+ var tile = findChild(findChild(genericScopeView, "0"), "delegate" + index);
9090 var tileCenter = tile.x + tile.width/2;
9191 var pointerArrow = findChild(genericScopeView, "pointerArrow");
9292 var pointerArrowCenter = pointerArrow.x + pointerArrow.width/2;
@@ -141,7 +141,7 @@ Item {
141141 categoryListView.flick(0, -units.gu(80));
142142 tryCompare(categoryListView.flicking, false);
143143
144− var tile = findChild(genericScopeView, "delegate0");
144+ var tile = findChild(findChild(genericScopeView, "0"), "delegate0");
145145 mouseClick(tile, tile.width / 2, tile.height - 1);
146146 var openEffect = findChild(genericScopeView, "openEffect");
147147 tryCompare(openEffect, "gap", 1);
@@ -276,6 +276,36 @@ Item {
276276 closePreview();
277277 tryCompare(previewListView, "open", false);
278278 }
279+
280+ function test_filter_expand_expand() {
281+ // wait for the item to be there
282+ tryCompareFunction(function() { return findChild(genericScopeView, "dashSectionHeader2") != undefined; }, true);
283+
284+ var categoryListView = findChild(genericScopeView, "categoryListView");
285+ categoryListView.contentY = categoryListView.height;
286+
287+ var header2 = findChild(genericScopeView, "dashSectionHeader2")
288+ var category2 = findChild(genericScopeView, "dashCategory2")
289+ var category2FilterGrid = category2.children[0].children[0].children[0];
290+ verify(UT.Util.isInstanceOf(category2FilterGrid, "FilterGrid"));
291+
292+ waitForRendering(header2);
293+ verify(category2.expandable);
294+ verify(category2.filtered);
295+
296+ mouseClick(header2, header2.width / 2, header2.height / 2);
297+ tryCompare(category2, "filtered", false);
298+ tryCompare(category2FilterGrid, "filter", false);
299+
300+ categoryListView.positionAtBeginning();
301+
302+ var header0 = findChild(genericScopeView, "dashSectionHeader0")
303+ var category0 = findChild(genericScopeView, "dashCategory0")
304+ mouseClick(header0, header0.width / 2, header0.height / 2);
305+ tryCompare(category0, "filtered", false);
306+ tryCompare(category2, "filtered", true);
307+ tryCompare(category2FilterGrid, "filter", true);
308+ }
279309 }
280310 }
281311}
tests/qmltests/Greeter/tst_Clock.qml+1−1
@@ -17,7 +17,7 @@
1717import QtQuick 2.0
1818import QtTest 1.0
1919import ".."
20−import "../../../Greeter"
20+import "../../../qml/Greeter"
2121import Ubuntu.Components 0.1
2222import QMenuModel 0.1
2323import Unity.Test 0.1 as UT
tests/qmltests/Greeter/tst_Infographics.qml+1−1
@@ -17,7 +17,7 @@
1717import QtQuick 2.0
1818import QtTest 1.0
1919import ".."
20−import "../../../Greeter"
20+import "../../../qml/Greeter"
2121import Ubuntu.Components 0.1
2222import Unity.Test 0.1 as UT
2323import LightDM 0.1 as LightDM
tests/qmltests/Greeter/tst_Lockscreen.qml+1−1
@@ -17,7 +17,7 @@
1717import QtQuick 2.0
1818import QtTest 1.0
1919import ".."
20−import "../../../Greeter"
20+import "../../../qml/Greeter"
2121import Ubuntu.Components 0.1
2222import LightDM 0.1 as LightDM
2323import Unity.Test 0.1 as UT
tests/qmltests/Greeter/tst_Phone.qml+3−3
@@ -17,7 +17,7 @@
1717import QtQuick 2.0
1818import QtTest 1.0
1919import ".."
20−import "../../../Greeter"
20+import "../../../qml/Greeter"
2121import AccountsService 0.1
2222import LightDM 0.1 as LightDM
2323import Ubuntu.Components 0.1
@@ -33,7 +33,7 @@ Item {
3333 height: parent.height
3434 x: 0; y: 0
3535
36− defaultBackground: "../../../graphics/phone_background.jpg"
36+ defaultBackground: Qt.resolvedUrl("../../../qml/graphics/phone_background.jpg")
3737
3838 property int minX: 0
3939
@@ -135,7 +135,7 @@ Item {
135135
136136 function test_background_data() {
137137 return [
138− {tag: "set", accounts: "../tests/data/unity/backgrounds/blue.png", expected: "blue.png"},
138+ {tag: "set", accounts: Qt.resolvedUrl("../../data/unity/backgrounds/blue.png"), expected: "blue.png"},
139139 {tag: "unset", accounts: "", expected: "background.jpg"},
140140 {tag: "invalid", accounts: "invalid", expected: "background.jpg"},
141141 ]
tests/qmltests/Greeter/tst_Tablet.qml+1−1
@@ -17,7 +17,7 @@
1717import QtQuick 2.0
1818import QtTest 1.0
1919import ".."
20−import "../../../Greeter"
20+import "../../../qml/Greeter"
2121import Ubuntu.Components 0.1
2222import LightDM 0.1 as LightDM
2323import Unity.Test 0.1 as UT
tests/qmltests/Hud/tst_Hud.qml+1−1
@@ -17,7 +17,7 @@
1717import QtQuick 2.0
1818import QtTest 1.0
1919import ".."
20−import "../../../Hud"
20+import "../../../qml/Hud"
2121import HudClient 0.1
2222import Unity.Test 0.1 as UT
2323
tests/qmltests/Hud/tst_Result.qml+1−1
@@ -17,7 +17,7 @@
1717import QtQuick 2.0
1818import QtTest 1.0
1919import ".."
20−import "../../../Hud"
20+import "../../../qml/Hud"
2121import Unity.Test 0.1 as UT
2222
2323Rectangle {
tests/qmltests/Launcher/tst_Launcher.qml+7−7
@@ -18,7 +18,7 @@ import QtQuick 2.0
1818import QtTest 1.0
1919import Unity.Test 0.1 as UT
2020import ".."
21−import "../../../Launcher"
21+import "../../../qml/Launcher"
2222import Unity.Launcher 0.1
2323
2424/* Nothing is shown at first. If you drag from left edge you will bring up the
@@ -41,9 +41,9 @@ Item {
4141 lastSelectedApplication = appId
4242 }
4343
44− property int dashItemSelected_count: 0
45− onDashItemSelected: {
46− dashItemSelected_count++;
44+ property int showDashHome_count: 0
45+ onShowDashHome: {
46+ showDashHome_count++;
4747 }
4848
4949 property int maxPanelX: 0
@@ -138,9 +138,9 @@ Item {
138138 }
139139
140140 /* If I click on the dash icon on the launcher
141− Launcher::dashItemSelected signal should be emitted */
141+ Launcher::showDashHome signal should be emitted */
142142 function test_clickingOnDashIconCausesSignalEmission() {
143− launcher.dashItemSelected_count = 0
143+ launcher.showDashHome_count = 0
144144
145145 revealer.dragLauncherIntoView()
146146
@@ -149,7 +149,7 @@ Item {
149149
150150 mouseClick(dashIcon, dashIcon.width/2, dashIcon.height/2)
151151
152− tryCompare(launcher, "dashItemSelected_count", 1)
152+ tryCompare(launcher, "showDashHome_count", 1)
153153
154154 // Tapping on the dash icon also dismisses the launcher
155155 revealer.waitUntilLauncherDisappears()
tests/qmltests/Notifications/tst_Notifications.qml+4−5
@@ -17,7 +17,7 @@
1717import QtQuick 2.0
1818import QtTest 1.0
1919import ".."
20−import "../../../Notifications"
20+import "../../../qml/Notifications"
2121import Ubuntu.Components 0.1
2222import Unity.Test 0.1
2323import Unity.Notifications 1.0
@@ -140,8 +140,10 @@ Row {
140140 Notifications {
141141 id: notifications
142142
143+ margin: units.gu(1)
144+ fullHeight: parent.height
145+
143146 anchors.fill: parent
144− anchors.margins: units.gu(1)
145147 model: mockModel
146148 }
147149 }
@@ -401,9 +403,6 @@ Row {
401403 actionSpy.wait()
402404 compare(actionSpy.signalArguments[0][0], data.actions[0]["id"], "got wrong id for interactive action")
403405 compare(clickThroughSpy.count, 0, "click on interactive notification fell through")
404− } else {
405− mouseClick(notification, notification.width / 2, notification.height / 2)
406− clickThroughSpy.wait()
407406 }
408407
409408 compare(secondaryIcon.visible, data.secondaryIconVisible, "secondary-icon visibility is incorrect")
tests/qmltests/Panel/Indicators/tst_DefaultIndicatorWidget.qml+1−1
@@ -18,7 +18,7 @@ import QtQuick 2.0
1818import QtTest 1.0
1919import Unity.Test 0.1 as UT
2020import QMenuModel 0.1
21−import "../../../../Panel/Indicators"
21+import "../../../../qml/Panel/Indicators"
2222
2323Item {
2424 id: testView
tests/qmltests/Panel/tst_IndicatorItem.qml+1−1
@@ -17,7 +17,7 @@
1717import QtQuick 2.0
1818import QtTest 1.0
1919import ".."
20−import "../../../Panel"
20+import "../../../qml/Panel"
2121import Ubuntu.Components 0.1
2222import Unity.Test 0.1 as UT
2323
tests/qmltests/Panel/tst_IndicatorRow.qml+1−1
@@ -18,7 +18,7 @@ import QtQuick 2.0
1818import QtTest 1.0
1919import Unity.Test 0.1 as UT
2020import ".."
21−import "../../../Panel"
21+import "../../../qml/Panel"
2222import Unity.Indicators 0.1 as Indicators
2323
2424/*
tests/qmltests/Panel/tst_Indicators.qml+2−2
@@ -18,8 +18,8 @@ import QtQuick 2.0
1818import QtTest 1.0
1919import Unity.Test 0.1 as UT
2020import ".."
21−import "../../../Panel"
22−import "../../../Components"
21+import "../../../qml/Panel"
22+import "../../../qml/Components"
2323
2424/*
2525 This tests the Indicators component by using a fake model to stage data in the indicators
tests/qmltests/Panel/tst_MenuContent.qml+1−1
@@ -18,7 +18,7 @@ import QtQuick 2.0
1818import QtTest 1.0
1919import Unity.Test 0.1 as UT
2020import ".."
21−import "../../../Panel"
21+import "../../../qml/Panel"
2222import Unity.Indicators 0.1 as Indicators
2323
2424Item {
tests/qmltests/Panel/tst_Panel.qml+15−1
@@ -18,7 +18,7 @@ import QtQuick 2.0
1818import QtTest 1.0
1919import Unity.Test 0.1 as UT
2020import ".."
21−import "../../../Panel"
21+import "../../../qml/Panel"
2222
2323/*
2424 This tests the Panel component using a fake model to stage data in the indicators
@@ -264,5 +264,19 @@ Item {
264264
265265 compare(indicatorRow.currentItem, indicatorItemFirst, "First indicator should still be the current item");
266266 }
267+
268+ function test_hideIndicatorMenu_data() {
269+ return [ {tag: "no-delay", delay: undefined },
270+ {tag: "delayed", delay: 200 }
271+ ];
272+ }
273+
274+ function test_hideIndicatorMenu(data) {
275+ panel.indicators.show();
276+ compare(panel.indicators.shown, true);
277+
278+ panel.hideIndicatorMenu(data.delay);
279+ tryCompare(panel.indicators, "shown", false);
280+ }
267281 }
268282}
tests/qmltests/Panel/tst_SearchIndicator.qml+1−1
@@ -17,7 +17,7 @@
1717import QtQuick 2.0
1818import QtTest 1.0
1919import ".."
20−import "../../../Panel"
20+import "../../../qml/Panel"
2121import Ubuntu.Components 0.1
2222import Unity.Test 0.1 as UT
2323
tests/qmltests/SideStage/tst_SideStage.qml+1−1
@@ -18,7 +18,7 @@ import QtQuick 2.0
1818import QtTest 1.0
1919import Unity.Test 0.1 as UT
2020import ".."
21−import "../../../SideStage"
21+import "../../../qml/SideStage"
2222import Ubuntu.Components 0.1
2323
2424UT.UnityTestCase {
tests/qmltests/tst_Shell.qml+3−3
@@ -24,7 +24,7 @@ import Unity.Application 0.1
2424import Unity.Test 0.1 as UT
2525import Powerd 0.1
2626
27−import "../.."
27+import "../../qml"
2828
2929Item {
3030 width: shell.width
@@ -469,8 +469,8 @@ Item {
469469
470470 function test_background_data() {
471471 return [
472− {tag: "red", url: "tests/data/unity/backgrounds/red.png", expectedUrl: "tests/data/unity/backgrounds/red.png"},
473− {tag: "blue", url: "tests/data/unity/backgrounds/blue.png", expectedUrl: "tests/data/unity/backgrounds/blue.png"},
472+ {tag: "red", url: Qt.resolvedUrl("../data/unity/backgrounds/red.png"), expectedUrl: "tests/data/unity/backgrounds/red.png"},
473+ {tag: "blue", url: Qt.resolvedUrl("../data/unity/backgrounds/blue.png"), expectedUrl: "tests/data/unity/backgrounds/blue.png"},
474474 {tag: "invalid", url: "invalid", expectedUrl: shell.defaultBackground},
475475 {tag: "empty", url: "", expectedUrl: shell.defaultBackground}
476476 ]
tests/uqmlscene/CMakeLists.txt+6−1
@@ -1,12 +1,17 @@
11add_executable(uqmlscene
22 ${shellapplication_MOC_SRCS}
33 main.cpp
4− ../../MouseTouchAdaptor.cpp
4+ ${CMAKE_SOURCE_DIR}/src/MouseTouchAdaptor.cpp
55 )
66
77qt5_use_modules(uqmlscene Qml Quick Test)
88pkg_check_modules(XCB REQUIRED xcb)
99
10+include_directories(
11+ ${CMAKE_SOURCE_DIR}/src
12+ ${Qt5Gui_PRIVATE_INCLUDE_DIRS}
13+)
14+
1015if (NOT "${XCB_INCLUDE_DIRS}" STREQUAL "")
1116 set_target_properties(uqmlscene PROPERTIES INCLUDE_DIRECTORIES ${XCB_INCLUDE_DIRS})
1217endif()
tests/uqmlscene/main.cpp+1−1
@@ -63,7 +63,7 @@
6363#include <QtCore/QTranslator>
6464#include <QtCore/QLibraryInfo>
6565
66−#include "../../MouseTouchAdaptor.h"
66+#include <MouseTouchAdaptor.h>
6767
6868#ifdef QML_RUNTIME_TESTING
6969class RenderStatistics
tests/utils/modules/Unity/Test/CMakeLists.txt+4
@@ -1,5 +1,9 @@
11add_definitions(-DQT_NO_KEYWORDS)
22
3+include_directories(
4+ ${Qt5Gui_PRIVATE_INCLUDE_DIRS}
5+)
6+
37set(UnityTestQML_SOURCES
48 testutil.cpp
59 plugin.cpp