on xenial help sign in
1003 files changed+57254−91175
since splitsnapshots
unifiedsplit
.bazaar/Makefile−6 .bazaar/plugins/makecheck_unity_phablet.py−51 .bzr-builddeb/default.conf−2 .bzrignore−7 .gitignore+7 CMakeLists.txt+31−13 CODING+188 CODING.md−74 Jenkinsfile+2−71 README.md+18−38 build.sh+16 clickable.yaml+153 cmake/modules/QmlPlugins.cmake−148 cmake/modules/QmlTest.cmake+188−12 data/CMakeLists.txt−9 data/com.canonical.Unity.gschema.xml+1−1 data/com.canonical.Unity8.gschema.xml+18−8 data/unity8-dash.conf−26 data/unity8-dash.desktop.in−9 data/unity8-dash.png data/unity8-dash.svg−326 data/unity8-dash.url-dispatcher−6 data/unity8-greeter-wrapper+7−4 data/unity8.conf+2−1 debian/changelog+395−24 debian/control+211−191 debian/rules+21−7 debian/shlibs.local+1 debian/tests/control+5−4 debian/tests/qmluitests.sh+4−14 debian/unity-scope-tool.install−2 debian/unity8-common.install−1 debian/unity8-greeter.install+1−1 debian/unity8-private.install+1−3 debian/unity8-fake-env.install → debian/unity8-tests.install+4−1 debian/unity8-tests.lintian-overrides+1 debian/unity8.install+7−11 debian/usr.bin.unity8-dash−21 include/paths.h.in+26−1 plugins/AccountsService/AccountsService.cpp+1−30 plugins/AccountsService/AccountsService.h+1−17 plugins/AccountsService/CMakeLists.txt+1−2 plugins/AccountsService/com.canonical.unity.AccountsService.xml+6 plugins/CMakeLists.txt+1−3 plugins/Cursor/CMakeLists.txt+1−2 plugins/Cursor/CursorImageInfo.cpp+1−2 plugins/Cursor/CursorImageProvider.cpp+2 plugins/Dash/AudioProgressBar.qml−54 plugins/Dash/CMakeLists.txt−47 plugins/Dash/CardAttributes.qml−71 plugins/Dash/CardAudioProgress.qml−59 plugins/Dash/CardCreator.js−999 plugins/Dash/CardCreatorCache.qml−40 plugins/Dash/CardSocialActions.qml−94 plugins/Dash/CroppedImageMinimumSourceSize.qml−38 plugins/Dash/DashAudioPlayer.qml−120 plugins/Dash/ScopeStyle.qml−102 plugins/Dash/abstractdashview.cpp−359 plugins/Dash/abstractdashview.h−128 plugins/Dash/graphics/music_progress_bg.png plugins/Dash/horizontaljournal.cpp−239 plugins/Dash/horizontaljournal.h−63 plugins/Dash/listviewwithpageheader.cpp−1394 plugins/Dash/listviewwithpageheader.h−218 plugins/Dash/organicgrid.cpp−259 plugins/Dash/organicgrid.h−91 plugins/Dash/plugin.cpp−70 plugins/Dash/plugin.h−33 plugins/Dash/qmldir−11 plugins/Dash/verticaljournal.cpp−279 plugins/Dash/verticaljournal.h−103 plugins/GlobalShortcut/CMakeLists.txt+1−1 plugins/GlobalShortcut/globalshortcut.cpp+15−4 plugins/GlobalShortcut/globalshortcut.h+5 plugins/GlobalShortcut/globalshortcutregistry.cpp+14−4 plugins/Greeter/Unity/Launcher/CMakeLists.txt+1−3 plugins/Greeter/Unity/Launcher/launcheritem.cpp+19 plugins/Greeter/Unity/Launcher/launcheritem.h+4 plugins/Greeter/Unity/Launcher/quicklistmodel.cpp+2 plugins/ImageCache/CMakeLists.txt−8 plugins/ImageCache/ImageCache.cpp−135 plugins/ImageCache/ImageCache.h−53 plugins/ImageCache/qmldir−2 plugins/LightDM/CMakeLists.txt+1−1 plugins/LightDM/DBusGreeterList.cpp+3−3 plugins/LightDM/DBusGreeterList.h+1−1 plugins/LightDM/FullLightDM/CMakeLists.txt+6−2 plugins/LightDM/Greeter.cpp+144−14 plugins/LightDM/Greeter.h+17−10 plugins/LightDM/GreeterPrivate.h+13−7 plugins/LightDM/IntegratedLightDM/CMakeLists.txt+1−1 plugins/LightDM/IntegratedLightDM/liblightdm/CMakeLists.txt+3−4 plugins/LightDM/IntegratedLightDM/liblightdm/Greeter.cpp+7−4 plugins/LightDM/IntegratedLightDM/liblightdm/Greeter.h+2−2 plugins/LightDM/IntegratedLightDM/liblightdm/GreeterPrivate.cpp+27−22 plugins/LightDM/IntegratedLightDM/liblightdm/GreeterPrivate.h+1 plugins/LightDM/IntegratedLightDM/liblightdm/SessionsModel.cpp−1 plugins/LightDM/IntegratedLightDM/liblightdm/SessionsModel.h+2−2 plugins/LightDM/IntegratedLightDM/liblightdm/UsersModel.h+1−2 plugins/LightDM/PromptsModel.cpp+97 plugins/LightDM/PromptsModel.h+70 plugins/LightDM/SessionsModel.cpp+1−2 plugins/LightDM/SessionsModel.h+5−7 plugins/LightDM/UsersModel.cpp+176−9 plugins/LightDM/UsersModel.h+6−8 plugins/LightDM/plugin.cpp+12−4 plugins/Lights/CMakeLists.txt+8−2 plugins/Lights/HfdLights.cpp+62 plugins/Unity/DashCommunicator/plugin.h → plugins/Lights/HfdLights.h+17−9 plugins/Lights/LegacyLights.cpp+91 tests/mocks/Unity/DashCommunicator/plugin.h → plugins/Lights/LegacyLights.h+19−8 plugins/Lights/Lights.cpp−65 plugins/Lights/Lights.h+5−9 plugins/Lights/plugin.cpp+20−1 plugins/Powerd/CMakeLists.txt+4−2 plugins/Powerd/Powerd.h+2−2 plugins/ScreenshotDirectory/CMakeLists.txt+1−1 plugins/SessionBroadcast/CMakeLists.txt+1−2 plugins/UInput/CMakeLists.txt+1−1 plugins/UInput/uinput.h+1−1 plugins/Ubuntu/CMakeLists.txt−2 plugins/Ubuntu/DownloadDaemonListener/CMakeLists.txt+4−2 plugins/Ubuntu/Gestures/CMakeLists.txt+2−4 plugins/Ubuntu/Gestures/Direction.h+1−1 plugins/Ubuntu/Gestures/TouchGestureArea.cpp+6−5 plugins/Ubuntu/Gestures/TouchGestureArea.h+1−1 plugins/Ubuntu/Payments/CMakeLists.txt−20 plugins/Ubuntu/Payments/Payments.cpp−136 plugins/Ubuntu/Payments/Payments.h−69 plugins/Ubuntu/Payments/qmldir−3 plugins/Ubuntu/SystemImage/CMakeLists.txt−15 plugins/Ubuntu/SystemImage/SystemImage.cpp−155 plugins/Ubuntu/SystemImage/SystemImage.h−84 plugins/Ubuntu/SystemImage/plugin.cpp−28 plugins/Ubuntu/SystemImage/qmldir−3 plugins/Unity/ApplicationMenu/CMakeLists.txt+19 plugins/Unity/ApplicationMenu/applicationmenuregistry.cpp+141 plugins/Unity/ApplicationMenu/applicationmenuregistry.h+83 plugins/Unity/ApplicationMenu/com.ubuntu.MenuRegistrar.xml+83 plugins/Unity/ApplicationMenu/dbusapplicationmenuregistry.cpp+44 plugins/Ubuntu/SystemImage/plugin.h → plugins/Unity/ApplicationMenu/dbusapplicationmenuregistry.h+12−9 plugins/Unity/ApplicationMenu/plugin.cpp+42 plugins/Ubuntu/Payments/plugin.h → plugins/Unity/ApplicationMenu/plugin.h+6−5 plugins/Unity/ApplicationMenu/qmldir+3 plugins/Unity/CMakeLists.txt+1−1 plugins/Unity/Connectivity/CMakeLists.txt+1−1 plugins/Unity/DashCommunicator/CMakeLists.txt−25 plugins/Unity/DashCommunicator/dashcommunicator.cpp−58 plugins/Unity/DashCommunicator/dashcommunicatorservice.cpp−30 plugins/Unity/DashCommunicator/dashcommunicatorservice.h−38 plugins/Unity/DashCommunicator/dashconnection.cpp−63 plugins/Unity/DashCommunicator/dashconnection.h−37 plugins/Unity/DashCommunicator/dbusdashcommunicatorservice.cpp−35 plugins/Unity/DashCommunicator/dbusdashcommunicatorservice.h−39 plugins/Unity/DashCommunicator/plugin.cpp−32 plugins/Unity/DashCommunicator/qmldir−3 plugins/Unity/Indicators/CMakeLists.txt+4−2 plugins/Unity/Indicators/indicators.h+5−5 plugins/Unity/Indicators/indicatorsmanager.h−2 plugins/Unity/Indicators/indicatorsmodel.cpp+13 plugins/Unity/Indicators/indicatorsmodel.h+9−1 plugins/Unity/Indicators/sharedunitymenumodel.cpp+4 plugins/Unity/InputInfo/CMakeLists.txt+1−2 plugins/Unity/InputInfo/qinputinfo.h+2−3 plugins/Unity/Launcher/CMakeLists.txt+7−3 plugins/Unity/Launcher/appdrawermodel.cpp+192 plugins/Unity/Launcher/appdrawermodel.h+64 plugins/Unity/Launcher/launcheritem.cpp+56−7 plugins/Unity/Launcher/launcheritem.h+10−2 plugins/Unity/Launcher/launchermodel.cpp+57−57 plugins/Unity/Launcher/launchermodel.h+3−15 plugins/Unity/Launcher/plugin.cpp+2−1 plugins/Unity/Launcher/quicklistentry.cpp+11 plugins/Unity/Launcher/quicklistentry.h+4 plugins/Unity/Launcher/quicklistmodel.cpp+9 plugins/Unity/Launcher/quicklistmodel.h+1 plugins/Unity/Launcher/ualwrapper.cpp+74 plugins/ImageCache/plugin.h → plugins/Unity/Launcher/ualwrapper.h+15−10 plugins/Unity/Launcher/xdgwatcher.cpp+129 plugins/Unity/Launcher/xdgwatcher.h+46 plugins/Unity/Platform/CMakeLists.txt+1−1 plugins/Unity/Platform/platform.cpp+16−2 plugins/Unity/Session/CMakeLists.txt+1−1 plugins/Unity/Session/dbusunitysessionservice.cpp+75−4 plugins/Unity/Session/dbusunitysessionservice.h+18−4 plugins/Unity/Session/plugin.cpp+1 plugins/Utils/CMakeLists.txt+10−4 plugins/Utils/ElapsedTimer.h+1−1 plugins/Utils/Timer.cpp+5−2 plugins/Utils/Timer.h+5−6 plugins/Utils/URLDispatcher.cpp+5−2 plugins/Utils/WindowInputMonitor.cpp+3 plugins/Utils/appdrawerproxymodel.cpp+189 plugins/Utils/appdrawerproxymodel.h+87 plugins/Utils/deviceconfigparser.cpp+18 plugins/Utils/deviceconfigparser.h+3 plugins/Utils/easingcurve.h−1 plugins/Utils/expressionfiltermodel.cpp+49 plugins/Utils/expressionfiltermodel.h+42 plugins/Utils/globalfunctions.cpp+5 plugins/Utils/globalfunctions.h+2 plugins/Utils/plugin.cpp+9−1 plugins/Utils/quicklistproxymodel.cpp+72 plugins/Utils/quicklistproxymodel.h+52 plugins/Utils/tabfocusfence.cpp+72 plugins/Utils/tabfocusfence.h+38 plugins/Utils/unitysortfilterproxymodelqml.h+5 plugins/Utils/windowstatestorage.cpp+316−124 plugins/Utils/windowstatestorage.h+19−17 plugins/WindowManager/AvailableDesktopArea.cpp+50 plugins/Unity/DashCommunicator/dashcommunicator.h → plugins/WindowManager/AvailableDesktopArea.h+14−21 plugins/WindowManager/CMakeLists.txt+14−2 plugins/WindowManager/InputMethodManager.cpp+56 plugins/WindowManager/InputMethodManager.h+55 plugins/WindowManager/TopLevelSurfaceList.cpp−481 plugins/WindowManager/TopLevelSurfaceList.h−223 plugins/WindowManager/TopLevelWindowModel.cpp+782 plugins/WindowManager/TopLevelWindowModel.h+308 plugins/WindowManager/Window.cpp+277 plugins/WindowManager/Window.h+176 tests/mocks/LightDM/IntegratedLightDM/QLightDM/Greeter → plugins/WindowManager/WindowManagerGlobal.h+8−2 plugins/WindowManager/WindowManagerPlugin.cpp+19−3 plugins/WindowManager/WindowMargins.cpp+74 plugins/WindowManager/WindowMargins.h+59 plugins/Wizard/CMakeLists.txt+4−2 plugins/Wizard/System.cpp+1−4 plugins/Wizard/Utils/CMakeLists.txt+1−1 plugins/Wizard/test.sh−18 po/aa.po+224−354 po/am.po+369−369 po/ar.po+469−519 po/ast.po+470−494 po/az.po+226−351 po/be.po+422−504 po/bg.po+207−349 po/bn.po+410−503 po/br.po+336−373 po/bs.po+268−359 po/ca.po+385−377 po/ca@valencia.po+252−362 po/ce.po+184−339 po/ckb.po+203−348 po/co.po+289−358 po/cs.po+467−456 po/cy.po+268−360 po/da.po+344−431 po/de.po+383−378 po/el.po+391−453 po/en_AU.po+394−363 po/en_GB.po+349−370 po/en_US.po+184−339 po/eo.po+233−344 po/es.po+400−395 po/et.po+816 po/eu.po+274−365 po/fa.po+426−398 po/fi.po+379−373 po/fo.po+253−353 po/fr.po+385−381 po/ga.po+261−358 po/gd.po+351−374 po/gl.po+399−400 po/gu.po+184−339 po/gv.po+217−348 po/he.po+402−498 po/hi.po+197−344 po/hr.po+361−412 po/hu.po+402−405 po/hy.po+312−441 po/ia.po+351−372 po/id.po+259−370 po/is.po+232−359 po/it.po+384−378 po/ja.po+298−415 po/kk.po+841 po/km.po+270−360 po/kn.po+191−344 po/ko.po+397−481 po/ku.po+226−351 po/ky.po+191−343 po/lo.po+190−342 po/lt.po+453−442 po/lv.po+274−366 po/ml.po+203−348 po/mr.po+207−344 po/ms.po+308−366 po/my.po+240−346 po/nb.po+387−391 po/ne.po+188−340 po/nl.po+427−426 po/nn.po+184−339 po/oc.po+343−367 po/or.po+184−339 po/pa.po+271−361 po/pl.po+386−382 po/pt.po+383−377 po/pt_BR.po+388−467 po/ro.po+274−367 po/ru.po+387−382 po/sc.po+401−470 po/shn.po+184−339 po/si.po+211−355 po/sk.po+399−401 po/sl.po+336−371 po/sq.po+261−352 po/sr.po+350−371 po/sv.po+384−386 po/sw.po+251−356 po/ta.po+203−348 po/te.po+211−350 po/th.po+204−357 po/tr.po+411−381 po/ug.po+316−369 po/uk.po+349−377 po/unity8.pot+184−339 po/update-unity-pot+17 po/ur.po+206−358 po/uz.po+184−338 po/vi.po+184−338 po/wo.po+274−365 po/xh.po+184−339 po/zh_CN.po+377−376 po/zh_HK.po+220−350 po/zh_TW.po+376−371 qml/ApplicationMenus/ApplicationMenuItemFactory.qml+135 tests/plugins/ImageCache/test.qml → qml/ApplicationMenus/ApplicationMenusLimits.qml+6−5 qml/ApplicationMenus/MenuBar.qml+513 qml/ApplicationMenus/MenuItem.qml+146 qml/ApplicationMenus/MenuNavigator.qml+101 qml/ApplicationMenus/MenuPopup.qml+510 qml/ApplicationMenus/RegisteredApplicationMenuModel.qml+56 qml/ApplicationMenus/qmldir+1 qml/CMakeLists.txt+1−1 qml/Components/Background.qml+1−1 qml/Components/BaseCarouselDelegate.qml−42 qml/Components/Carousel.qml−335 qml/Components/Dialogs.qml+93−27 qml/Components/DragHandle.qml+1 qml/Components/EdgeBarrier.qml+1 qml/Components/EdgeBarrierController.qml+1 qml/Panel/Handle.qml → qml/Components/Handle.qml+1 qml/Components/InputMethod.qml+6−4 qml/Components/ItemGrabber.qml+1−1 qml/Components/KeyboardShortcutsOverlay.qml+19−17 qml/Components/KeymapSwitcher.qml+19−8 qml/Components/Lockscreen.qml+5−1 qml/Components/ModeSwitchWarningDialog.qml+8−2 qml/Components/PanelState/PanelState.qml+6−3 qml/Components/PhysicalKeysMapper.qml+4−4 qml/Components/ResponsiveGridView.qml−98 qml/Components/ResponsiveVerticalJournal.qml−81 qml/Components/ScrollCalculator.qml+21−2 qml/Components/ShellDialog.qml+27−12 qml/Components/Showable.qml+15−12 qml/Components/VirtualTouchPad.qml+269−1 qml/Components/Wallpaper.qml+68−16 qml/Components/WallpaperResolver.qml+17−6 qml/Components/WindowControlButtons.qml+2 qml/Dash/CardCarousel.qml−74 qml/Dash/CardGrid.qml−84 qml/Dash/CardHorizontalList.qml−66 qml/Dash/CardTool.qml−298 qml/Dash/CardVerticalJournal.qml−85 qml/Dash/Dash.qml−381 qml/Dash/DashBackground.qml−36 qml/Dash/DashCategoryBase.qml−54 qml/Dash/DashContent.qml−211 qml/Dash/DashContentTabBarStyle.qml−24 qml/Dash/DashNavigation.qml−199 qml/Dash/DashNavigationHeader.qml−73 qml/Dash/DashNavigationList.qml−118 qml/Dash/DashPageHeader.qml−448 qml/Dash/DashRenderer.qml−66 qml/Dash/DashSectionHeader.qml−64 qml/Dash/Filters/FilterExpandableWidget.qml−97 qml/Dash/Filters/FilterOptionSelector.qml−97 qml/Dash/Filters/FilterRangeInput.qml−136 qml/Dash/Filters/FilterValueSlider.qml−87 qml/Dash/Filters/FilterWidget.qml−32 qml/Dash/Filters/FilterWidgetFactory.qml−89 qml/Dash/FiltersPopover.qml−106 qml/Dash/GenericScopeView.qml−797 qml/Dash/PageHeaderExtraPanel.qml−201 qml/Dash/PreviewView.qml−76 qml/Dash/Previews/Preview.qml−145 qml/Dash/Previews/PreviewActionButton.qml−27 qml/Dash/Previews/PreviewActionCombo.qml−79 qml/Dash/Previews/PreviewActions.qml−73 qml/Dash/Previews/PreviewAudioPlayback.qml−151 qml/Dash/Previews/PreviewComment.qml−86 qml/Dash/Previews/PreviewCommentInput.qml−88 qml/Dash/Previews/PreviewExpandable.qml−104 qml/Dash/Previews/PreviewHeader.qml−170 qml/Dash/Previews/PreviewIconActions.qml−88 qml/Dash/Previews/PreviewImageGallery.qml−150 qml/Dash/Previews/PreviewInlineVideo.qml−112 qml/Dash/Previews/PreviewMediaToolbar.qml−57 qml/Dash/Previews/PreviewOverlay.qml−166 qml/Dash/Previews/PreviewPayments.qml−81 qml/Dash/Previews/PreviewProgress.qml−74 qml/Dash/Previews/PreviewRatingDisplay.qml−117 qml/Dash/Previews/PreviewRatingEdit.qml−83 qml/Dash/Previews/PreviewRatingInput.qml−207 qml/Dash/Previews/PreviewRatingSingleDisplay.qml−73 qml/Dash/Previews/PreviewSingleton/qmldir−1 qml/Dash/Previews/PreviewTable.qml−91 qml/Dash/Previews/PreviewTextSummary.qml−78 qml/Dash/Previews/PreviewVideoPlayback.qml−87 qml/Dash/Previews/PreviewWidget.qml−60 qml/Dash/Previews/PreviewWidgetFactory.qml−101 qml/Dash/Previews/PreviewZoomableImage.qml−103 qml/Dash/ScopeListView.qml−28 qml/Dash/ScopeSettings/ScopeSetting.qml−46 qml/Dash/ScopeSettings/ScopeSettingBoolean.qml−63 qml/Dash/ScopeSettings/ScopeSettingList.qml−50 qml/Dash/ScopeSettings/ScopeSettingString.qml−89 qml/Dash/ScopeSettings/ScopeSettingsWidgetFactory.qml−61 qml/Dash/ScopeSettingsPage.qml−72 qml/Dash/ScopesList.qml−125 qml/Dash/ScopesListCategory.qml−181 qml/Dash/ScopesListCategoryItem.qml−115 qml/Dash/graphics/dark_background.jpg qml/Dash/graphics/header_handlearrow2@27.png qml/Dash/graphics/header_handlearrow@27.png qml/Dash/graphics/icon_clear@20.png qml/Dash/graphics/icon_search_active@20.png qml/Dash/graphics/icon_search_inactive@20.png qml/Dash/graphics/overview_hint@30.png qml/Dash/graphics/pixel.png qml/Dash/graphics/play_button@18.png qml/Dash/graphics/play_button_active@18.png qml/Dash/graphics/play_button_active_big@20.png qml/Dash/graphics/play_button_big@20.png qml/Dash/graphics/rectangular_dropshadow@30.png qml/Dash/graphics/rectangular_dropshadow@30.sci−5 qml/Dash/graphics/tabbarchevron@27.png qml/Dash/graphics/tablet/icon_close_preview@20.png qml/Dash/graphics/tooltip_arrow@27.png qml/DeviceConfiguration.qml+12 qml/DisabledScreenNotice.qml+3−55 qml/Greeter/ButtonPrompt.qml+51 qml/Greeter/Circle.qml+1−1 qml/Greeter/CoverPage.qml+32−11 qml/Greeter/FullLightDMImpl.qml+1 qml/Greeter/Greeter.qml+79−78 qml/Greeter/GreeterPrompt.qml+66−167 qml/Greeter/GreeterView.qml+534 qml/Greeter/IntegratedLightDMImpl.qml+1 qml/Greeter/LightDMService.qml+4−4 qml/Greeter/LoginAreaContainer.qml+3−3 qml/Greeter/LoginList.qml+111−191 qml/Greeter/NarrowView.qml−294 qml/Greeter/PinPrompt.qml+184 qml/Greeter/PromptList.qml+151 qml/Greeter/SessionsList.qml+36−18 qml/Greeter/ShimGreeter.qml+2 qml/Greeter/TextPrompt.qml+198 qml/Greeter/WideView.qml−213 qml/Launcher/BackgroundBlur.qml+81 qml/Launcher/Drawer.qml+413 qml/Launcher/DrawerGridView.qml+85 qml/Launcher/Launcher.qml+245−54 qml/Launcher/LauncherDelegate.qml+9−12 qml/Launcher/LauncherPanel.qml+89−36 qml/Dash/PullToRefreshScopeStyle.qml → qml/Launcher/PullToRefreshScopeStyle.qml qml/Launcher/graphics/home.svg+243 qml/Launcher/graphics/home@18.png qml/Launcher/graphics/launcher-app-focus-ring.svg−12 qml/Notifications/Notification.qml+8−3 qml/Notifications/NotificationButton.qml+2−1 qml/Notifications/SwipeToAct.qml+4 qml/OrientedShell.qml+26−7 qml/Panel/ActiveCallHint.qml+3 qml/Dash/ScopeSettings/ScopeSettingNumber.qml → qml/Panel/FakePanelMenu.qml+8−3 qml/Panel/IndicatorPage.qml−188 qml/Panel/IndicatorItem.qml → qml/Panel/Indicators/IndicatorItem.qml+16−3 qml/Panel/Indicators/MenuItemFactory.qml → qml/Panel/Indicators/IndicatorMenuItemFactory.qml+30−12 qml/Panel/Indicators/IndicatorsLight.qml+185−12 qml/Panel/Indicators/client/IndicatorRepresentation.qml+18−5 qml/Panel/MenuContent.qml+12−12 qml/Panel/Panel.qml+372−95 qml/Panel/IndicatorsBar.qml → qml/Panel/PanelBar.qml+87−36 qml/Panel/IndicatorItemRow.qml → qml/Panel/PanelItemRow.qml+65−106 qml/Panel/IndicatorsMenu.qml → qml/Panel/PanelMenu.qml+80−36 qml/Panel/PanelMenuPage.qml+226 qml/Rotation/RotationStates.qml+2−5 qml/ScopeTool.qml−165 qml/Shell.qml+254−115 qml/Stage/AbstractStage.qml−93 qml/Stage/ApplicationWindow.qml+16−4 qml/Stage/ChildWindow.qml+203 qml/Stage/ChildWindowRepeater.qml+39 qml/Stage/ChildWindowTree.qml+138 qml/Stage/DecoratedWindow.qml+97−44 qml/Stage/DesktopSpread.qml−576 qml/Stage/DesktopSpreadDelegate.qml−126 qml/Stage/FakeMaximizeDelegate.qml+7−7 qml/Stage/MoveHandler.qml+46−33 qml/Stage/PhoneStage.qml−806 qml/Stage/SideStage.qml+10−6 qml/Stage/Splash.qml+4−4 qml/Stage/Spread/Spread.qml+11 qml/Stage/Spread/WindowedRightEdgeMaths.qml+19−4 qml/Stage/SpreadDelegate.qml−424 qml/Stage/SpreadMaths.qml−164 qml/Stage/Stage.qml+566−294 qml/Stage/StageMaths.qml+23−9 qml/Stage/StagedFullscreenPolicy.qml+7−13 qml/Stage/TabletStage.qml−1201 qml/Stage/TopLevelSurfaceRepeater.qml−67 qml/Stage/TransformedSpreadDelegate.qml−391 qml/Stage/TransformedTabletSpreadDelegate.qml−437 qml/Stage/WindowControlsOverlay.qml+23−26 qml/Stage/WindowDecoration.qml+83−19 qml/Stage/WindowInfoItem.qml+16 qml/Stage/WindowResizeArea.qml+15−73 qml/Stage/WindowStateSaver.qml+64 qml/Stage/WindowedFullscreenPolicy.qml+4−12 qml/Tutorial/Tutorial.qml+1 qml/Tutorial/TutorialContent.qml+61−43 qml/Tutorial/TutorialLeft.qml+1−1 qml/Tutorial/TutorialLeftLong.qml+3−3 qml/Tutorial/TutorialRight.qml+2−3 qml/Tutorial/TutorialTop.qml+2−2 qml/Wizard/Pages.qml+45−6 qml/Wizard/Pages/10-welcome.qml+1 qml/Wizard/Pages/30-wifi.qml+6−10 qml/Wizard/Pages/50-timezone.qml+9−11 qml/Wizard/Pages/76-app-update.qml−246 qml/Wizard/Pages/78-firmware-update.qml.disabled+1−1 qml/Wizard/Pages/79-system-update.qml+4−12 qml/Wizard/Pages/ClickUpdateDelegate.qml−26 qml/Wizard/Pages/DownloadHandler.qml−204 qml/Wizard/Pages/GlobalUpdateControls.qml−138 qml/Wizard/Pages/UpdateDelegate.qml−389 src/ApplicationArguments.h+5 src/CMakeLists.txt+15−6 src/Dash/CMakeLists.txt−29 src/Dash/main.cpp−146 src/DebuggingController.cpp+92 src/DebuggingController.h+57 src/MouseTouchAdaptor.cpp+28−1 src/MouseTouchAdaptor.h+1 src/Panel/CMakeLists.txt−3 src/Panel/Indicators/CMakeLists.txt−1 src/ShellApplication.cpp+22−5 src/ShellApplication.h+1−3 src/ShellView.cpp+22 src/libunity8-private/CMakeLists.txt+1−1 src/libunity8-private/abstractdbusservicemonitor.h+1−1 src/main.cpp+10−2 tests/CMakeLists.txt+30−11 tests/autopilot/unity8/dash.py−263 tests/autopilot/unity8/fixture_setup.py+1−1 tests/autopilot/unity8/shell/fixture_setup.py+1−27 tests/autopilot/unity8/shell/tests/__init__.py+1−1 tests/autopilot/unity8/shell/tests/test_helpers.py−123 tests/autopilot/unity8/shell/tests/test_rotation.py+3−3 tests/copyright/check_copyright.sh+35−4 tests/data/unity/backgrounds/20x30.png tests/data/unity/backgrounds/black.png tests/graphics/screenshots/gallery@12.png tests/mocks/AccountsService/AccountsService.cpp+2−39 tests/mocks/AccountsService/AccountsService.h+4−27 tests/mocks/AccountsService/CMakeLists.txt+4−5 tests/mocks/Biometryd/CMakeLists.txt+1−1 tests/mocks/Biometryd/MockOperation.h−1 tests/mocks/CMakeLists.txt+16−16 tests/mocks/Cursor/CMakeLists.txt+1−1 tests/mocks/GSettings.1.0/CMakeLists.txt+1−2 tests/mocks/GSettings.1.0/fake_gsettings.cpp+25−27 tests/mocks/GSettings.1.0/fake_gsettings.h+9−9 tests/mocks/LightDM/CMakeLists.txt−1 tests/mocks/LightDM/IntegratedLightDM/CMakeLists.txt−51 tests/mocks/LightDM/IntegratedLightDM/MockGreeter.cpp−51 tests/mocks/LightDM/IntegratedLightDM/MockGreeter.h−42 tests/mocks/LightDM/IntegratedLightDM/MockSessionsModel.cpp−66 tests/mocks/LightDM/IntegratedLightDM/MockSessionsModel.h−44 tests/mocks/LightDM/IntegratedLightDM/MockUsersModel.cpp−44 tests/mocks/LightDM/IntegratedLightDM/QLightDM/SessionsModel−17 tests/mocks/LightDM/IntegratedLightDM/QLightDM/UsersModel−17 tests/mocks/LightDM/IntegratedLightDM/liblightdm/CMakeLists.txt−20 tests/mocks/LightDM/IntegratedLightDM/liblightdm/Greeter.cpp−201 tests/mocks/LightDM/IntegratedLightDM/liblightdm/UsersModel.cpp−123 tests/mocks/LightDM/IntegratedLightDM/plugin.cpp−79 tests/mocks/LightDM/IntegratedLightDM/plugin.h−32 tests/mocks/LightDM/IntegratedLightDM/qmldir−2 tests/mocks/LightDMController/CMakeLists.txt+14 tests/mocks/Ubuntu/SystemImage/plugin.cpp → tests/mocks/LightDMController/plugin.cpp+11−10 tests/mocks/Ubuntu/Payments/plugin.h → tests/mocks/LightDMController/plugin.h+4−6 tests/mocks/LightDMController/qmldir+2 tests/mocks/Lights/CMakeLists.txt+1−1 tests/mocks/Lights/Lights.h+1−1 tests/mocks/MeeGo/QOfono/CMakeLists.txt+1−1 tests/mocks/Powerd/CMakeLists.txt+1−1 tests/mocks/Powerd/Powerd.h+2−2 tests/mocks/QMenuModel/CMakeLists.txt+1−2 tests/mocks/QMenuModel/dbus-enums.h+2−3 tests/mocks/QMenuModel/unitymenumodel.cpp+78−13 tests/mocks/QMenuModel/unitymenumodel.h+12−1 tests/mocks/QtMultimedia/CMakeLists.txt+1−1 tests/mocks/QtMultimedia/mediaplayer.cpp+2−2 tests/mocks/QtMultimedia/mediaplayer.h+6−6 tests/mocks/QtMultimedia/videooutput.h+1−1 tests/mocks/SessionBroadcast/CMakeLists.txt+1−1 tests/mocks/UInput/CMakeLists.txt+1−1 tests/mocks/UInput/mockuinput.h+1−1 tests/mocks/Ubuntu/CMakeLists.txt−2 tests/mocks/Ubuntu/Connectivity/CMakeLists.txt+1−1 tests/mocks/Ubuntu/Connectivity/networking-status.cpp+7−1 tests/mocks/Ubuntu/Connectivity/networking-status.h+7−6 tests/mocks/Ubuntu/DownloadDaemonListener/CMakeLists.txt+1−1 tests/mocks/Ubuntu/Payments/CMakeLists.txt−10 tests/mocks/Ubuntu/Payments/MockPayments.cpp−95 tests/mocks/Ubuntu/Payments/MockPayments.h−62 tests/mocks/Ubuntu/Payments/qmldir−3 tests/mocks/Ubuntu/SystemImage/CMakeLists.txt−10 tests/mocks/Ubuntu/SystemImage/MockSystemImage.cpp−50 tests/mocks/Ubuntu/SystemImage/MockSystemImage.h−56 tests/mocks/Ubuntu/SystemImage/qmldir−3 tests/mocks/Ubuntu/SystemSettings/CMakeLists.txt+1 tests/mocks/Ubuntu/SystemSettings/SecurityPrivacy/CMakeLists.txt+2−2 tests/mocks/Ubuntu/SystemSettings/SecurityPrivacy/MockSecurityPrivacy.h+1−1 tests/mocks/Ubuntu/SystemSettings/Update/CMakeLists.txt+1 plugins/Ubuntu/Payments/plugin.cpp → tests/mocks/Ubuntu/SystemSettings/Update/MockSystemImage.qml+11−9 tests/mocks/Ubuntu/SystemSettings/Update/qmldir+2 tests/mocks/Ubuntu/Telephony/CMakeLists.txt+1−1 tests/mocks/Unity/Application/ApplicationInfo.cpp+61−27 tests/mocks/Unity/Application/ApplicationInfo.h+8−9 tests/mocks/Unity/Application/ApplicationManager.cpp+114−64 tests/mocks/Unity/Application/ApplicationManager.h+32−10 tests/mocks/Unity/Application/CMakeLists.txt+4−4 tests/mocks/Unity/Application/MirMock.cpp+13 tests/mocks/Unity/Application/MirMock.h+4 tests/mocks/Unity/Application/MirSurface.cpp+121−82 tests/mocks/Unity/Application/MirSurface.h+45−27 tests/mocks/Unity/Application/MirSurfaceItem.cpp+24−9 tests/mocks/Unity/Application/MirSurfaceItem.h+1−2 tests/mocks/Unity/Application/MirSurfaceListModel.cpp+17−39 tests/mocks/Unity/Application/MirSurfaceListModel.h+7−15 tests/mocks/Unity/Application/SurfaceManager.cpp+186−31 tests/mocks/Unity/Application/SurfaceManager.h+32−10 tests/mocks/Unity/Application/VirtualKeyboard.cpp+5−4 tests/mocks/Unity/Application/plugin.cpp+3−33 tests/mocks/Unity/Application/resources/Kate.qml+49 tests/mocks/Unity/Application/resources/KateDialog.qml+48 qml/Dash/DashApplication.qml → tests/mocks/Unity/Application/resources/KateMenu.qml+17−15 tests/mocks/Unity/Application/resources/surfaces.qrc+3 tests/mocks/Unity/ApplicationMenu/CMakeLists.txt+18 tests/mocks/Unity/ApplicationMenu/mockapplicationmenuregistry.cpp+47 tests/mocks/Unity/ApplicationMenu/mockapplicationmenuregistry.h+41 plugins/ImageCache/plugin.cpp → tests/mocks/Unity/ApplicationMenu/plugin.cpp+14−11 tests/mocks/Ubuntu/SystemImage/plugin.h → tests/mocks/Unity/ApplicationMenu/plugin.h+6−5 tests/mocks/Unity/ApplicationMenu/qmldir+3 tests/mocks/Unity/CMakeLists.txt+2−63 tests/mocks/Unity/Connectivity/CMakeLists.txt+1−1 tests/mocks/Unity/DashCommunicator/CMakeLists.txt−18 tests/mocks/Unity/DashCommunicator/dashcommunicator.cpp−42 tests/mocks/Unity/DashCommunicator/dashcommunicator.h−39 tests/mocks/Unity/DashCommunicator/dashcommunicatorservice.cpp−46 tests/mocks/Unity/DashCommunicator/dashcommunicatorservice.h−41 tests/mocks/Unity/DashCommunicator/plugin.cpp−31 tests/mocks/Unity/DashCommunicator/qmldir−3 tests/mocks/Unity/Indicators/CMakeLists.txt+4−1 tests/mocks/Unity/Indicators/IndicatorsModel.qml+30−12 tests/mocks/Unity/Indicators/fakeindicatorsmodel.h−1 tests/mocks/Unity/Indicators/fakeindicatorsmodeldata.js+23−6 tests/mocks/Unity/InputInfo/CMakeLists.txt+1−1 tests/mocks/Unity/InputInfo/qinputdeviceinfo_mock.cpp+6−2 tests/mocks/Unity/Launcher/CMakeLists.txt+5−3 tests/mocks/Unity/Launcher/MockAppDrawerModel.cpp+98 tests/mocks/Unity/fake_filters.h → tests/mocks/Unity/Launcher/MockAppDrawerModel.h+14−17 tests/mocks/Unity/Launcher/MockLauncherItem.cpp+27−1 tests/mocks/Unity/Launcher/MockLauncherItem.h+9 tests/mocks/Unity/Launcher/MockLauncherModel.cpp+4−1 tests/mocks/Unity/Launcher/MockLauncherModel.h+1−1 tests/mocks/Unity/Launcher/MockQuickListModel.cpp+3−1 tests/mocks/Unity/Launcher/MockQuickListModel.h+2 tests/mocks/Unity/Launcher/plugin.cpp+4 tests/mocks/Unity/Notifications/CMakeLists.txt+1−1 tests/mocks/Unity/Notifications/MockActionModel.h+1−1 tests/mocks/Unity/Notifications/MockNotification.h+2−1 tests/mocks/Unity/Platform/CMakeLists.txt+1 qml/Dash/Previews/PreviewSingleton/PreviewSingleton.qml → tests/mocks/Unity/Platform/MockPlatform.qml+6−3 tests/mocks/Unity/Platform/qmldir+2 tests/mocks/Unity/Screens/CMakeLists.txt+1−1 tests/mocks/Unity/Screens/screens.cpp+1−1 tests/mocks/Unity/Screens/screens.h+1−1 tests/mocks/Unity/fake_categories.cpp−165 tests/mocks/Unity/fake_categories.h−54 tests/mocks/Unity/fake_expandablefilterwidget.cpp−53 tests/mocks/Unity/fake_expandablefilterwidget.h−48 tests/mocks/Unity/fake_filters.cpp−136 tests/mocks/Unity/fake_navigation.cpp−123 tests/mocks/Unity/fake_navigation.h−61 tests/mocks/Unity/fake_optionselectorfilter.cpp−70 tests/mocks/Unity/fake_optionselectorfilter.h−54 tests/mocks/Unity/fake_optionselectoroptions.cpp−90 tests/mocks/Unity/fake_optionselectoroptions.h−49 tests/mocks/Unity/fake_previewmodel.cpp−103 tests/mocks/Unity/fake_previewmodel.h−58 tests/mocks/Unity/fake_previewwidgetmodel.cpp−97 tests/mocks/Unity/fake_previewwidgetmodel.h−47 tests/mocks/Unity/fake_rangeinputfilter.cpp−167 tests/mocks/Unity/fake_rangeinputfilter.h−79 tests/mocks/Unity/fake_resultsmodel.cpp−92 tests/mocks/Unity/fake_resultsmodel.h−52 tests/mocks/Unity/fake_scope.cpp−372 tests/mocks/Unity/fake_scope.h−128 tests/mocks/Unity/fake_scopes.cpp−280 tests/mocks/Unity/fake_scopes.h−83 tests/mocks/Unity/fake_scopesoverview.cpp−340 tests/mocks/Unity/fake_scopesoverview.h−117 tests/mocks/Unity/fake_settingsmodel.cpp−95 tests/mocks/Unity/fake_settingsmodel.h−54 tests/mocks/Unity/fake_unity_plugin.cpp−62 tests/mocks/Unity/fake_unity_plugin.h−34 tests/mocks/Unity/fake_valuesliderfilter.cpp−84 tests/mocks/Unity/fake_valuesliderfilter.h−55 tests/mocks/Unity/fake_valueslidervalues.cpp−51 tests/mocks/Unity/fake_valueslidervalues.h−36 tests/mocks/Unity/qmldir−3 tests/mocks/Utils/CMakeLists.txt+12−3 tests/mocks/Utils/plugin.cpp+9−1 tests/mocks/Utils/windowstatestorage.cpp+23 tests/mocks/Utils/windowstatestorage.h+6−3 tests/mocks/Wizard/CMakeLists.txt+2−2 tests/mocks/Wizard/MockSystem.cpp+19−4 tests/mocks/Wizard/MockSystem.h+11−1 tests/mocks/Wizard/mockplugin.cpp+2 tests/mocks/liblightdm/CMakeLists.txt+18 tests/mocks/LightDM/IntegratedLightDM/liblightdm/GreeterPrivate.cpp → tests/mocks/liblightdm/GreeterPrivate.cpp tests/mocks/LightDM/IntegratedLightDM/liblightdm/GreeterPrivate.h → tests/mocks/liblightdm/GreeterPrivate.h tests/mocks/liblightdm/MockController.cpp+192 tests/mocks/liblightdm/MockController.h+106 tests/mocks/liblightdm/MockGreeter.cpp+316 tests/mocks/LightDM/IntegratedLightDM/liblightdm/Greeter.h → tests/mocks/liblightdm/MockGreeter.h+10−23 tests/mocks/LightDM/IntegratedLightDM/liblightdm/SessionsModel.cpp → tests/mocks/liblightdm/MockSessionsModel.cpp+39−42 tests/mocks/LightDM/IntegratedLightDM/liblightdm/SessionsModel.h → tests/mocks/liblightdm/MockSessionsModel.h+11−19 tests/mocks/liblightdm/MockUsersModel.cpp+220 tests/mocks/LightDM/IntegratedLightDM/liblightdm/UsersModel.h → tests/mocks/liblightdm/MockUsersModel.h+9−18 tests/mocks/LightDM/IntegratedLightDM/liblightdm/SessionsModelPrivate.cpp → tests/mocks/liblightdm/SessionsModelPrivate.cpp+1−1 tests/mocks/LightDM/IntegratedLightDM/liblightdm/SessionsModelPrivate.h → tests/mocks/liblightdm/SessionsModelPrivate.h tests/mocks/LightDM/IntegratedLightDM/liblightdm/UsersModelPrivate.cpp → tests/mocks/liblightdm/UsersModelPrivate.cpp+23−23 tests/mocks/LightDM/IntegratedLightDM/liblightdm/UsersModelPrivate.h → tests/mocks/liblightdm/UsersModelPrivate.h tests/mocks/liblightdm/demo/CMakeLists.txt+1−1 tests/mocks/libusermetrics/CMakeLists.txt+2−1 tests/mocks/libusermetrics/ColorTheme.cpp+4 tests/mocks/libusermetrics/UserMetrics.cpp+5 tests/plugins/AccountsService/CMakeLists.txt+8−2 tests/plugins/AccountsService/PropertiesServer.cpp+1−1 tests/plugins/AccountsService/client.cpp+6−34 tests/plugins/CMakeLists.txt+2−3 tests/plugins/Dash/CMakeLists.txt−79 tests/plugins/Dash/cardcreator/1.res−82 tests/plugins/Dash/cardcreator/1.res.cardcreator−69 tests/plugins/Dash/cardcreator/1.tst−4 tests/plugins/Dash/cardcreator/10.res−129 tests/plugins/Dash/cardcreator/10.res.cardcreator−127 tests/plugins/Dash/cardcreator/10.tst−4 tests/plugins/Dash/cardcreator/11.res−176 tests/plugins/Dash/cardcreator/11.res.cardcreator−160 tests/plugins/Dash/cardcreator/11.tst−4 tests/plugins/Dash/cardcreator/12.res−108 tests/plugins/Dash/cardcreator/12.res.cardcreator−95 tests/plugins/Dash/cardcreator/12.tst−4 tests/plugins/Dash/cardcreator/2.res−128 tests/plugins/Dash/cardcreator/2.res.cardcreator−126 tests/plugins/Dash/cardcreator/2.tst−4 tests/plugins/Dash/cardcreator/3.res−90 tests/plugins/Dash/cardcreator/3.res.cardcreator−86 tests/plugins/Dash/cardcreator/3.tst−4 tests/plugins/Dash/cardcreator/4.res−111 tests/plugins/Dash/cardcreator/4.res.cardcreator−99 tests/plugins/Dash/cardcreator/4.tst−4 tests/plugins/Dash/cardcreator/5.res−102 tests/plugins/Dash/cardcreator/5.res.cardcreator−99 tests/plugins/Dash/cardcreator/5.tst−4 tests/plugins/Dash/cardcreator/6.res−127 tests/plugins/Dash/cardcreator/6.res.cardcreator−116 tests/plugins/Dash/cardcreator/6.tst−4 tests/plugins/Dash/cardcreator/7.res−141 tests/plugins/Dash/cardcreator/7.res.cardcreator−139 tests/plugins/Dash/cardcreator/7.tst−4 tests/plugins/Dash/cardcreator/8.res−109 tests/plugins/Dash/cardcreator/8.res.cardcreator−97 tests/plugins/Dash/cardcreator/8.tst−4 tests/plugins/Dash/cardcreator/9.res−120 tests/plugins/Dash/cardcreator/9.res.cardcreator−109 tests/plugins/Dash/cardcreator/9.tst−4 tests/plugins/Dash/cardcreatortest.cpp−121 tests/plugins/Dash/cardcreatortest.qml−29 tests/plugins/Dash/horizontaljournaltest.cpp−487 tests/plugins/Dash/horizontaljournaltest.qml−44 tests/plugins/Dash/horizontaljournaltry.cpp−89 tests/plugins/Dash/horizontaljournaltry.qml−120 tests/plugins/Dash/listviewwithpageheadersectionexternalmodeltest.cpp−243 tests/plugins/Dash/listviewwithpageheadersectiontest.cpp−2210 tests/plugins/Dash/listviewwithpageheadertest.cpp−2036 tests/plugins/Dash/listviewwithpageheadertest.qml−96 tests/plugins/Dash/listviewwithpageheadertestsection.qml−119 tests/plugins/Dash/listviewwithpageheadertestsectionexternalmodel.qml−76 tests/plugins/Dash/organicgridtest.cpp−530 tests/plugins/Dash/organicgridtest.qml−44 tests/plugins/Dash/organicgridtry.cpp−97 tests/plugins/Dash/organicgridtry.qml−114 tests/plugins/Dash/tst_CardAttributes.qml−57 tests/plugins/Dash/tst_CroppedImageMinimumSourceSize.qml−56 tests/plugins/Dash/tst_ListViewWithPageHeaderQML.qml−140 tests/plugins/Dash/tst_ScopeStyle.qml−188 tests/plugins/Dash/verticaljournaltest.cpp−561 tests/plugins/Dash/verticaljournaltest.qml−45 tests/plugins/Dash/verticaljournaltry.cpp−89 tests/plugins/Dash/verticaljournaltry.qml−121 tests/plugins/GlobalShortcut/CMakeLists.txt+12−7 tests/plugins/GlobalShortcut/GlobalShortcutTest.cpp+3−2 tests/plugins/Greeter/Unity/Launcher/CMakeLists.txt+5−22 tests/plugins/Greeter/Unity/Launcher/launchermodelastest.cpp+4−1 tests/plugins/ImageCache/CMakeLists.txt−20 tests/plugins/ImageCache/graphics/wide.jpg tests/plugins/ImageCache/test.cpp−214 tests/plugins/LightDM/IntegratedLightDM/CMakeLists.txt+58−14 tests/plugins/LightDM/IntegratedLightDM/dbus.cpp+22−12 tests/plugins/LightDM/IntegratedLightDM/greeter.qml+2−7 tests/plugins/LightDM/IntegratedLightDM/promptsmodel.cpp+175 tests/plugins/LightDM/IntegratedLightDM/sessionsmodel.cpp+19−13 tests/plugins/LightDM/IntegratedLightDM/usersmodel.cpp+100−16 tests/plugins/SessionBroadcast/CMakeLists.txt+8−2 tests/plugins/Ubuntu/Gestures/CMakeLists.txt+12−6 tests/plugins/Ubuntu/Gestures/GestureTest.cpp+12−2 tests/plugins/Ubuntu/Gestures/tst_FloatingFlickable.qml+1−1 tests/plugins/Ubuntu/Gestures/tst_TouchGate.cpp+14−3 tests/plugins/Ubuntu/Gestures/tst_TouchGestureArea.cpp+30 tests/plugins/Unity/CMakeLists.txt+1 tests/plugins/Unity/Indicators/CMakeLists.txt+12−2 tests/plugins/Unity/Indicators/IndicatorsManagerTest.cpp+1−1 tests/plugins/Unity/Indicators/IndicatorsModelTest.cpp+1−1 tests/plugins/Unity/Launcher/CMakeLists.txt+48−4 tests/plugins/Unity/Launcher/appdrawermodeltest.cpp+68 tests/plugins/Unity/Launcher/launchermodeltest.cpp+113−11 tests/plugins/Unity/Launcher/ualwrapper.cpp+58 tests/plugins/Unity/Launcher/ualwrapper.h+55 tests/mocks/Ubuntu/Payments/plugin.cpp → tests/plugins/Unity/Launcher/xdgwatcher.cpp+24−7 tests/mocks/LightDM/IntegratedLightDM/MockUsersModel.h → tests/plugins/Unity/Launcher/xdgwatcher.h+17−17 tests/plugins/Unity/Platform/CMakeLists.txt+30 tests/plugins/Unity/Platform/platformtest.cpp+142 tests/plugins/Unity/Session/CMakeLists.txt+21−3 tests/plugins/Unity/Session/LogindServer.cpp+10 tests/plugins/Unity/Session/LogindServer.h+5 tests/plugins/Unity/Session/interfaces.xml+12 tests/plugins/Unity/Session/preload.c+43 tests/plugins/Unity/Session/sessionbackendtest.cpp+130−11 tests/plugins/Utils/CMakeLists.txt+13−5 tests/plugins/Utils/DeviceConfigParserTest.cpp+7−1 tests/plugins/Utils/ModelTest.cpp+2−1 tests/plugins/Utils/WindowInputMonitorTest.cpp+107−10 tests/plugins/Utils/WindowStateStorageTest.cpp+121 tests/plugins/WindowManager/CMakeLists.txt+36 tests/plugins/WindowManager/UnityApplicationMocks.h+211 tests/plugins/WindowManager/tst_TopLevelWindowModel.cpp+193 tests/plugins/Wizard/CMakeLists.txt+8−2 tests/qmltests/ApplicationMenuDataLoader.qml+99 tests/qmltests/ApplicationMenus/tst_MenuBar.qml+437 tests/qmltests/ApplicationMenus/tst_MenuPopup.qml+361 tests/qmltests/CMakeLists.txt+28−53 tests/qmltests/Components/CMakeLists.txt+26−7 tests/qmltests/Components/tst_Carousel.qml−292 tests/qmltests/Components/tst_Dialogs.qml−1 tests/qmltests/Components/tst_DragHandle.cpp+23−4 tests/qmltests/Components/tst_DraggingArea.qml+6−6 tests/qmltests/Components/tst_EdgeDragEvaluator.cpp+4−2 tests/qmltests/Components/tst_Lockscreen.qml+11−9 tests/qmltests/Components/tst_MediaServices.qml+5−4 tests/qmltests/Components/tst_PhysicalKeysMapper.qml+7−6 tests/qmltests/Components/tst_Rating.qml+1−1 tests/qmltests/Components/tst_ResponsiveGridView.qml−157 tests/qmltests/Components/tst_ResponsiveVerticalJournal.qml−183 tests/qmltests/Components/tst_SharingPicker.qml+3−3 tests/qmltests/Components/tst_Showable.qml+13 tests/qmltests/Components/tst_VirtualTouchPad.qml+55−1 tests/qmltests/Components/tst_Wallpaper.qml+118 tests/qmltests/Components/tst_WallpaperResolver.qml+104−18 tests/qmltests/Components/tst_ZoomableImage.qml+1−1 tests/qmltests/Dash/CardHelpers.js−115 tests/qmltests/Dash/Filters/tst_FilterExpandableWidget.qml−99 tests/qmltests/Dash/Filters/tst_FilterOptionSelector.qml−96 tests/qmltests/Dash/Filters/tst_FilterRangeInput.qml−247 tests/qmltests/Dash/Filters/tst_FilterValueSlider.qml−101 tests/qmltests/Dash/Filters/tst_FilterWidgetFactory.qml−59 tests/qmltests/Dash/Previews/MockPreviewWidget.qml−27 tests/qmltests/Dash/Previews/tst_Preview.qml−151 tests/qmltests/Dash/Previews/tst_PreviewActions.qml−262 tests/qmltests/Dash/Previews/tst_PreviewAudioPlayback.qml−182 tests/qmltests/Dash/Previews/tst_PreviewComment.qml−84 tests/qmltests/Dash/Previews/tst_PreviewCommentInput.qml−113 tests/qmltests/Dash/Previews/tst_PreviewExpandable.qml−358 tests/qmltests/Dash/Previews/tst_PreviewHeader.qml−183 tests/qmltests/Dash/Previews/tst_PreviewIconActions.qml−136 tests/qmltests/Dash/Previews/tst_PreviewImageGallery.qml−147 tests/qmltests/Dash/Previews/tst_PreviewInlineVideo.qml−155 tests/qmltests/Dash/Previews/tst_PreviewMediaToolbar.qml−69 tests/qmltests/Dash/Previews/tst_PreviewPayments.qml−203 tests/qmltests/Dash/Previews/tst_PreviewProgress.qml−100 tests/qmltests/Dash/Previews/tst_PreviewRatingDisplay.qml−123 tests/qmltests/Dash/Previews/tst_PreviewRatingDisplayCreationRanges.qml−131 tests/qmltests/Dash/Previews/tst_PreviewRatingEdit.qml−87 tests/qmltests/Dash/Previews/tst_PreviewRatingInput.qml−246 tests/qmltests/Dash/Previews/tst_PreviewTable.qml−147 tests/qmltests/Dash/Previews/tst_PreviewTextSummary.qml−87 tests/qmltests/Dash/Previews/tst_PreviewVideoPlayback.qml−61 tests/qmltests/Dash/Previews/tst_PreviewWidgetFactory.qml−104 tests/qmltests/Dash/Previews/tst_PreviewZoomableImage.qml−138 tests/qmltests/Dash/ScopeSettings/tst_ScopeSettingBoolean.qml−62 tests/qmltests/Dash/ScopeSettings/tst_ScopeSettingList.qml−84 tests/qmltests/Dash/ScopeSettings/tst_ScopeSettingNumber.qml−98 tests/qmltests/Dash/ScopeSettings/tst_ScopeSettingString.qml−88 tests/qmltests/Dash/ScopeSettings/tst_ScopeSettingsWidgetFactory.qml−65 tests/qmltests/Dash/artwork/avatar@12.png tests/qmltests/Dash/artwork/background.png tests/qmltests/Dash/artwork/checkers.png tests/qmltests/Dash/artwork/emblem.png tests/qmltests/Dash/artwork/music-player-design.png tests/qmltests/Dash/tst_Card.qml−682 tests/qmltests/Dash/tst_CardBenchmark.qml−95 tests/qmltests/Dash/tst_CardCarousel.qml−111 tests/qmltests/Dash/tst_CardTool.qml−379 tests/qmltests/Dash/tst_Dash.qml−693 tests/qmltests/Dash/tst_DashContent.qml−730 tests/qmltests/Dash/tst_DashPageHeader.qml−357 tests/qmltests/Dash/tst_DashShell.qml−145 tests/qmltests/Dash/tst_GenericScopeView.qml−722 tests/qmltests/Dash/tst_PageHeader/logo-ubuntu-orange.svg−60 tests/qmltests/Dash/tst_PreviewView.qml−122 tests/qmltests/Greeter/TestView.qml+16−22 tests/qmltests/Greeter/tst_Greeter.qml+80−140 tests/qmltests/Greeter/tst_GreeterView.qml+1366 tests/qmltests/Greeter/tst_Infographics.qml+1−11 tests/qmltests/Greeter/tst_NarrowView.qml−589 tests/qmltests/Greeter/tst_WideView.qml−757 tests/qmltests/Launcher/tst_Drawer.qml+520 tests/qmltests/Launcher/tst_Launcher.qml+259−85 tests/qmltests/Notifications/tst_Notifications.qml+27−21 tests/qmltests/Notifications/tst_OptionToggle.qml+12−6 tests/qmltests/Notifications/tst_SwipeToAct.qml+15−8 tests/qmltests/Notifications/tst_VisualSnapDecisionsQueue.qml+3−3 tests/qmltests/Panel/tst_IndicatorItem.qml → tests/qmltests/Panel/Indicators/tst_IndicatorItem.qml+1−1 tests/qmltests/Panel/Indicators/tst_MenuItemFactory.qml → tests/qmltests/Panel/Indicators/tst_IndicatorMenuItemFactory.qml+41−82 tests/qmltests/Panel/Indicators/tst_IndicatorsLight.qml+168−8 tests/qmltests/Panel/IndicatorTest.qml → tests/qmltests/Panel/PanelTest.qml−5 tests/qmltests/Panel/PanelUI.qml+286 tests/qmltests/Panel/tst_ActiveCallHint.qml+29−10 tests/qmltests/Panel/tst_MenuContent.qml+16−4 tests/qmltests/Panel/tst_Panel.qml+419−235 tests/qmltests/Panel/tst_IndicatorsBar.qml → tests/qmltests/Panel/tst_PanelBar.qml+24−33 tests/qmltests/Panel/tst_IndicatorItemRow.qml → tests/qmltests/Panel/tst_PanelItemRow.qml+38−34 tests/qmltests/Panel/tst_IndicatorsMenu.qml → tests/qmltests/Panel/tst_PanelMenu.qml+91−34 tests/qmltests/Panel/tst_IndicatorPage.qml → tests/qmltests/Panel/tst_PanelMenuPage.qml+53−47 tests/qmltests/Panel/tst_PanelSmallScreen.qml+133 tests/qmltests/Stage/ApplicationCheckBox.qml+8−8 tests/qmltests/Stage/tst_ApplicationWindow.qml+15−32 tests/qmltests/Stage/tst_DecoratedWindow.qml+40−5 tests/qmltests/Stage/tst_DesktopStage.qml+417−141 tests/qmltests/Stage/tst_PhoneStage.qml+118−102 tests/qmltests/Stage/tst_QMLTopLevelWindowModel.qml+191 tests/qmltests/Stage/tst_SpreadDelegate.qml−423 tests/qmltests/Stage/tst_SurfaceContainer.qml+13−8 tests/qmltests/Stage/tst_TabletStage.qml+151−141 tests/qmltests/Stage/tst_WindowDecoration.qml+244 tests/qmltests/Stage/tst_WindowResizeArea.qml+22−78 tests/qmltests/Tutorial/tst_Tutorial.qml+205−184 tests/qmltests/Wizard/tst_Wizard.qml+101−128 tests/qmltests/tst_DisabledScreenNotice.qml+23−9 tests/qmltests/tst_OrientedShell.qml+410−274 tests/qmltests/tst_Shell.qml+1329−794 tests/qmltests/tst_ShellWithPin.qml+122−190 tests/scripts/alert-launcher-icon.sh+16 tests/scripts/get-progress.sh+16 tests/scripts/list-launcher-icons.sh+16 tests/scripts/set-count-visible.sh+16 tests/scripts/set-count.sh+16 tests/scripts/set-progress.sh+16 tests/uqmlscene/CMakeLists.txt+14−2 tests/uqmlscene/main.cpp+7−3 tests/utils/modules/Unity/Test/CMakeLists.txt+5−5 tests/utils/modules/Unity/Test/MouseTouchEmulationCheckbox.qml+1−1 tests/utils/modules/Unity/Test/StageTestCase.qml+64 tests/utils/modules/Unity/Test/TouchEventSequenceWrapper.cpp+18 tests/utils/modules/Unity/Test/UnityTestCase.qml+10−20 tests/utils/modules/Unity/Test/qmldir+2−1 tests/utils/modules/Unity/Test/testutil.cpp+1−1 tools/CMakeLists.txt+2−12 src/Panel/Indicators/client/CMakeLists.txt → tools/indicatorsclient/CMakeLists.txt+1−1 src/Panel/Indicators/client/indicatorsclient.cpp → tools/indicatorsclient/indicatorsclient.cpp src/Panel/Indicators/client/indicatorsclient.h → tools/indicatorsclient/indicatorsclient.h src/Panel/Indicators/client/main.cpp → tools/indicatorsclient/main.cpp tools/menutool/CMakeLists.txt+5 tools/menutool/README+11 tools/menutool/menutool.cpp+62 tools/menutool/menutool.qml+118 tools/registry-tracker.cpp−146 tools/registry-tracker.h−49 tools/scopetool.cpp−116 tools/unlock-device+16
.bazaar/Makefiledeleted−6
@@ -1,6 +0,0 @@
1−install:
2− mkdir -p ~/.bazaar/plugins
3− cp plugins/* ~/.bazaar/plugins
4−
5−uninstall:
6− rm ~/.bazaar/plugins/makecheck_unity_phablet.py*
.bazaar/plugins/makecheck_unity_phablet.pydeleted−51
@@ -1,51 +0,0 @@
1−#!/usr/bin/python
2−# Copyright 2013, 2014 Canonical Ltd.
3−#
4−# This program is free software; you can redistribute it and/or modify
5−# it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
12−#
13−# You should have received a copy of the GNU Lesser General Public License
14−# along with this program. If not, see <http://www.gnu.org/licenses/>.
15−
16−import os
17−import subprocess
18−from bzrlib import branch
19−from bzrlib.urlutils import local_path_from_url
20−
21−
22−def execute_makecheck(
23− local_branch, master_branch, old_revision_number, old_revision_id,
24− future_revision_number, future_revision_id, tree_delta, future_tree):
25− if not master_branch.basis_tree().has_filename("qml/Shell.qml"):
26− return
27−
28− os.chdir(local_path_from_url(master_branch.base))
29−
30− print "Executing 'make -C builddir test'.."
31− os.environ['CTEST_OUTPUT_ON_FAILURE'] = "1"
32− if (subprocess.call("make -C builddir test", shell=True) != 0):
33−
34− print("\n\n*** Warning ***\n\n"
35− "Basic tests failed. This commit will not pass continuous "
36− "integration.")
37−
38− branch = local_branch or master_branch
39− revision = branch.repository.get_revision(future_revision_id)
40− msg_file = open('message.txt', 'w')
41− msg_file.write(revision.message)
42− msg_file.close()
43−
44− print("\n\nSaved commit message to $SRC_DIR/message.txt.")
45− print("You can uncommit this revision, fix the tests and reuse your "
46− "message running:\n\nbzr commit -F message.txt\n\n")
47− elif os.path.isfile("message.txt"):
48− os.remove("message.txt")
49−
50−branch.Branch.hooks.install_named_hook(
51− 'pre_commit', execute_makecheck, 'make check pre-commit')
.bzr-builddeb/default.confdeleted−2
@@ -1,2 +0,0 @@
1−[BUILDDEB]
2−split = True
.bzrignoredeleted−7
@@ -1,7 +0,0 @@
1−# default build dir
2−/builddir
3−# QtCreator project files
4−/*.user
5−# Eclipse project files
6−.settings
7−message.txt
.gitignore+7
@@ -2,8 +2,15 @@
22/builddir
33# QtCreator project files
44/*.user
5+*.qmlc
6+*.jsc
57# Eclipse project files
68/.project
79/.cproject
810/.settings
911/.pydevproject
12+# KDevelop project Files
13+/.kdev4/
14+/build/
15+/*.kdev4
16+.clickable/
CMakeLists.txt+31−13
@@ -40,6 +40,19 @@ if(cmake_build_type_lower MATCHES coverage)
4040 ENABLE_COVERAGE_REPORT(TARGETS ${SHELL_APP} FILTER /usr/include ${CMAKE_SOURCE_DIR}/tests/* ${CMAKE_BINARY_DIR}/*)
4141endif()
4242
43+find_package (ECM 1.7.0 QUIET NO_MODULE)
44+if (ECM_FOUND)
45+ # Provides us with -DECM_ENABLE_SANITIZERS='X'
46+ # Where X can be address, thread, memory, leak, undefined
47+ include("${ECM_MODULE_DIR}/ECMEnableSanitizers.cmake")
48+endif()
49+
50+if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
51+ if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "5.0.0")
52+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wsuggest-override" )
53+ endif()
54+endif()
55+
4356# Make sure we have all the needed symbols
4457set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-z,defs")
4558set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,-z,defs")
@@ -49,22 +62,31 @@ add_custom_target(cppcheck COMMAND cppcheck --enable=all -q --error-exitcode=2
4962 ${CMAKE_SOURCE_DIR}/src ${CMAKE_SOURCE_DIR}/tests)
5063
5164include(FindPkgConfig)
52−find_package(Qt5Core 5.4 REQUIRED)
53−find_package(Qt5Qml 5.4 REQUIRED)
54−find_package(Qt5Quick 5.4 REQUIRED)
55−find_package(Qt5Gui 5.4 REQUIRED)
56−find_package(Qt5DBus 5.4 REQUIRED)
57−find_package(Qt5Concurrent 5.4 REQUIRED)
58−find_package(Qt5Sql 5.4 REQUIRED)
59−
60−pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=22)
65+find_package(Qt5Core 5.6 REQUIRED)
66+find_package(Qt5Qml 5.6 REQUIRED)
67+find_package(Qt5Quick 5.6 REQUIRED)
68+find_package(Qt5Gui 5.6 REQUIRED)
69+find_package(Qt5DBus 5.6 REQUIRED)
70+find_package(Qt5Concurrent 5.6 REQUIRED)
71+find_package(Qt5Sql 5.6 REQUIRED)
72+find_package(Qt5Test 5.6 REQUIRED)
73+find_package(Qt5Svg 5.6 REQUIRED)
74+find_package(Qt5Network 5.6 REQUIRED)
75+find_package(Qt5Xml 5.6 REQUIRED)
76+
77+pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=27)
6178pkg_check_modules(GEONAMES REQUIRED geonames>=0.2)
6279pkg_check_modules(GIO REQUIRED gio-2.0>=2.32)
6380pkg_check_modules(GLIB REQUIRED glib-2.0>=2.32)
81+pkg_check_modules(LAUNCHER_API REQUIRED unity-shell-launcher=13)
6482pkg_check_modules(QMENUMODEL REQUIRED qmenumodel)
6583pkg_check_modules(GD3 REQUIRED gnome-desktop-3.0)
6684pkg_check_modules(UAL REQUIRED ubuntu-app-launch-2)
6785pkg_check_modules(UBUNTUGESTURES REQUIRED UbuntuGestures)
86+pkg_check_modules(QTDBUSTEST REQUIRED
87+ libqtdbustest-1
88+ libqtdbusmock-1
89+ )
6890
6991### Check UbuntuGestures private headers. No pkg-config (.pc) file is provided for them
7092find_path(UBUNTUGESTUREPRIV
@@ -126,8 +148,6 @@ include(autopilot)
126148declare_autopilot_test(shell unity8.shell ${CMAKE_SOURCE_DIR}/tests/autopilot/)
127149
128150set(SHELL_APP unity8)
129−set(DASH_APP unity8-dash)
130−set(SCOPE_TOOL unity-scope-tool)
131151set(INDICATORS_CLIENT_APP indicators-client)
132152set(GREETER_APP unity8-greeter)
133153set(MOCK_INDICATOR_SERVICE_APP unity-mock-indicator-service)
@@ -138,8 +158,6 @@ include_directories(
138158 ${APPLICATION_API_INCLUDE_DIRS}
139159)
140160
141−set(ARTIFACTS_DIR "" CACHE PATH "Store test artifacts in this directory.")
142−
143161# Quiet logger
144162set(QUIET_LOGGER OFF CACHE BOOL "Disable test output on stdout.")
145163if(NOT QUIET_LOGGER)
CODINGnew file+188
@@ -0,0 +1,188 @@
1+Building Unity 8
2+================
3+
4+Only Ubuntu 14.04 (trusty) is supported as a developement environment.
5+
6+download source
7+---------------
8+- create a parent folder to not pollute your setup. so that you can have different unity
9+ branches there (trunk, WIP etc)
10+
11+ $ mkdir ~/unity8
12+
13+- fetch Unity 8 source
14+ $ sudo apt-get install bzr
15+ $ bzr branch lp:unity8 ~/unity8/trunk
16+ $ cd ~/unity8/trunk
17+
18+install dependencies and build Unity 8
19+--------------------
20+
21+$ cd ~/unity8/trunk
22+$ ./build.sh
23+
24+ If its your first time, this will install the required dependencies to build and
25+ build it.
26+
27+ You might want to also install unity-scope-home and unity-scope-click which
28+ are technically "recommends", not strict dependencies
29+
30+You may also rebuild with the -c for clean, which just deletes the build
31+directory.
32+
33+
34+Running Unity 8 on your desktop
35+===============================
36+
37+run the Unity 8 shell
38+---------------------
39+$ cd ~/unity8/trunk
40+$ cd builddir
41+
42+Each component of unity8 can be ran independently for development and testing
43+For example:
44+$ make tryShell
45+$ make tryLauncher
46+$ make tryLockscreen
47+
48+Check out the tests/qmltests/ directory for a list of things that can be ran.
49+
50+Notes
51+-----
52+- to navigate, utilize the mouse left button as you would your finger
53+- a three point drag (for side stage operations) can be performed by using
54+ the Shift+Control+Alt (all together) keyboard modifiers while using the mouse.
55+- to get the translations work, currently you have to do make install to
56+ put the *.mo files into correct structure. We'll look for a better solution
57+ later.
58+ $ cd builddir; make install
59+- if you wish to populate contacts
60+ $ sudo apt-get install gir1.2-ebook-1.2
61+ $ manage-address-book.py create
62+ this will:
63+ - Create an EDS address book
64+ - Populate the address book with sample data
65+
66+
67+Running Unity 8 on devices
68+==========================
69+
70+Running unity8 on a device should be done using crossbuilder.
71+Go to
72+* https://launchpad.net/crossbuilder and
73+* https://wiki.ubuntu.com/Touch/Crossbuilder
74+for more details on crossbuilder.
75+
76+unity8 will automatically restart on the phone once deployment
77+has finished due to post-build-steps set up in this repository.
78+
79+Coding guidelines
80+=================
81+The work-in-progress coding guidelines are available under:
82+https://launchpad.net/canonical-client-development-guidelines
83+
84+
85+Development Environment
86+=======================
87+QtCreator (available via the Software Center) is the best IDE to hack on
88+Unity 8.
89+
90+If using VIM, make sure you install some syntax highlighting for QML, like
91+https://github.com/peterhoeg/vim-qml
92+
93+Running tests
94+=============
95+
96+Tests are run from the build directory (which will be ./builddir if you used
97+the ./build.sh script).
98+
99+To run the tests that do not require any graphical capability and therefore
100+are pretty fast run:
101+
102+$ make test
103+
104+or, alternatively:
105+
106+$ ctest
107+
108+To run all graphical tests, which can take a couple of minutes:
109+
110+$ make uitests
111+
112+To run the tests for a single component/class:
113+
114+$ make testComponentName
115+
116+So, for the DragHandle component that would be:
117+
118+$ make testDragHandle
119+
120+To run the tests for a single component/class under gdb (so you can catch SEGFAULTS)
121+
122+$ make gdbtestComponentName
123+
124+To run a single test function of a single component/class:
125+
126+$ make testComponentName FUNCTION="TestCaseName::functionName"
127+
128+To run a test application that allow you to manually test or to simply try out
129+a given component:
130+
131+$ make tryComponentName
132+
133+So to try out, for instance, the DragHandle component, you would do:
134+
135+$ make tryDragHandle
136+
137+NB: Manual test or interation doesn't make sense for all components or classes,
138+particularly the non-graphical ones. In such cases no "tryFoo" make target is
139+provided.
140+
141+Running autopilot tests
142+=======================
143+
144+Autopilot tests are run from the build directory (which will be ./builddir if you used
145+the ./build.sh script).
146+
147+$ make autopilot
148+
149+If you want you can also run tests individually, for that you need to install first,
150+otherwise the tests will run on the system-installed version
151+
152+$ make install
153+
154+To see the list of existing autopilot tests you can do
155+
156+$ PYTHONPATH=../tests/autopilot autopilot3 list unity8
157+
158+And then run a single test with
159+
160+$ PYTHONPATH=../tests/autopilot autopilot3 run unity8.some.very.long.test.name
161+
162+or run them all with
163+
164+$ PYTHONPATH=../tests/autopilot autopilot3 run unity8
165+
166+Debugging techniques
167+====================
168+
169+Unity8 heavily uses Qt and with that Qt debugging techniques mostly apply in the
170+same fashion. There are, however, some additional unity8-specific notes:
171+
172+* Enable/disable Qt scenegraph visualizer on the fly:
173+
174+ $ qdbus com.canonical.Unity8.Debugging /com/canonical/Unity8/Debugging SetSceneGraphVisualizer <mode>
175+
176+ This is equivalent to exporting QSG_VISUALIZE=<mode> before running unity8, except it does it on the
177+ fly.
178+
179+* Toggle slow animations on the fly:
180+
181+ $ qdbus com.canonical.Unity8.Debugging /com/canonical/Unity8/Debugging SetSlowAnimations <true|false>
182+
183+* Change logging filter rules on the fly:
184+
185+ $ qdbus com.canonical.Unity8.Debugging /com/canonical/Unity8/Debugging SetLoggingFilterRules <filter>
186+
187+ This is equivalent to exporting QT_LOGGING_RULES or defining them in QT_LOGGING_CONF, except it does
188+ it on the fly.
CODING.mddeleted−74
@@ -1,74 +0,0 @@
1−# Unity8 development docs
2−
3−It is recommended to use [crossbuilder](#crosscompile) for platform-independent building. You can also [build natively](#build-natively), but keep in mind that you will have to install lots of dependencies on your host OS.
4−
5−## Crosscompile
6−
7−To crosscompile, we have a tool called [crossbuilder](https://github.com/ubports/crossbuilder), this will automatically build and deploy to the device. [Here's how to set it up](https://docs.ubports.com/en/latest/systemdev/testing-locally.html#cross-building-with-crossbuilder).
8−
9−To build deb package just run:
10−```
11−crossbuilder
12−```
13−
14−or if you want to build without packaging:
15−```
16−crossbuilder --no-deb
17−```
18−
19−Use crossbuilder shell if you want to define your own cmake options. (this will not automaticly deploy to your device!)
20−```
21−crossbuilder shell
22−cd unity8
23−mkdir build-arm
24−cmake .. {OPTION(S)}
25−make
26−```
27−
28−For these changes to take effect, you will need to restart unity8, you can do this with `restart unity8` or reboot the device.
29−
30−You dont need to rebuild if changes is made to QML files, you can simply adb push the qml files and copy them to there location, then restart unity8.
31−
32−QML folder for unity8 is `/usr/share/unity8`.
33−
34−# Build natively
35−
36−## Install deps
37−
38−You need to add repo.ubports.com to your sources.list.
39−
40−Here is an example for bionic:
41−```
42−sudo apt install gnupg
43−echo "deb http://repo.ubports.com/ bionic main" | sudo tee /etc/apt/sources.list.d/ubports.list
44−wget http://repo.ubports.com/keyring.gpg -O - | sudo apt-key add
45−sudo apt update
46−```
47−
48−Then run mk-build-tools to install all the dependencies needed to build unity8.
49−```
50−sudo mk-build-deps -i
51−```
52−
53−## Build
54−
55−Then make build directory `mkdir build && cd build`
56−
57−Then run cmake `cmake ..` here you can also provide your build options
58−
59−Now its the fun part, build! `make -j4` (-j defines number of threads to build on)
60−
61−# Tests
62−
63−To run tests,
64−
65−```
66−make test
67−```
68−
69−You can also specify the differnet test targets to run with `make tryComponentName and make testComponentName`
70−
71−# Doxygen docs
72−
73−You can also install docs from the bionic or xenial repo that inclues a auto-generated docs including class infomation. This package is called unity8-doc and will be installed to `/usr/share/doc/unity8` here there will be an index.html, open this in your browser.
74−
Jenkinsfile+2−71
@@ -1,71 +1,2 @@
1−pipeline {
2− agent any
3− stages {
4− stage('Build source') {
5− steps {
6− sh '/usr/bin/build-source.sh'
7− stash(name: 'source', includes: '*.gz,*.bz2,*.xz,*.deb,*.dsc,*.changes,*.buildinfo,lintian.txt')
8− cleanWs(cleanWhenAborted: true, cleanWhenFailure: true, cleanWhenNotBuilt: true, cleanWhenSuccess: true, cleanWhenUnstable: true, deleteDirs: true)
9− }
10− }
11− stage('Build binary - armhf') {
12− steps {
13− parallel(
14− "Build binary - armhf": {
15− node(label: 'arm64') {
16− cleanWs(cleanWhenAborted: true, cleanWhenFailure: true, cleanWhenNotBuilt: true, cleanWhenSuccess: true, cleanWhenUnstable: true, deleteDirs: true)
17− unstash 'source'
18− sh '''export architecture="armhf"
19− export DEBBUILDOPTS="-sa"
20− export SKIP_ARCH_BUILD=false
21− export SKIP_SOURCE_REMOVAL=true
22−build-binary.sh'''
23− stash(includes: '*.gz,*.bz2,*.xz,*.deb,*.dsc,*.changes,*.buildinfo,lintian.txt', name: 'build-armhf')
24− cleanWs(cleanWhenAborted: true, cleanWhenFailure: true, cleanWhenNotBuilt: true, cleanWhenSuccess: true, cleanWhenUnstable: true, deleteDirs: true)
25− }
26−
27−
28− },
29− "Build binary - arm64": {
30− node(label: 'arm64') {
31− cleanWs(cleanWhenAborted: true, cleanWhenFailure: true, cleanWhenNotBuilt: true, cleanWhenSuccess: true, cleanWhenUnstable: true, deleteDirs: true)
32− unstash 'source'
33− sh '''export architecture="arm64"
34− export DEBBUILDOPTS="-sa"
35− export SKIP_ARCH_BUILD=false
36− export SKIP_SOURCE_REMOVAL=true
37− build-binary.sh'''
38− stash(includes: '*.gz,*.bz2,*.xz,*.deb,*.dsc,*.changes,*.buildinfo,lintian.txt', name: 'build-arm64')
39− cleanWs(cleanWhenAborted: true, cleanWhenFailure: true, cleanWhenNotBuilt: true, cleanWhenSuccess: true, cleanWhenUnstable: true, deleteDirs: true)
40− }
41− },
42− "Build binary - amd64": {
43− node(label: 'amd64') {
44− cleanWs(cleanWhenAborted: true, cleanWhenFailure: true, cleanWhenNotBuilt: true, cleanWhenSuccess: true, cleanWhenUnstable: true, deleteDirs: true)
45− unstash 'source'
46− sh '''export architecture="amd64"
47− build-binary.sh'''
48− stash(includes: '*.gz,*.bz2,*.xz,*.deb,*.dsc,*.changes,*.buildinfo,lintian.txt', name: 'build-amd64')
49− cleanWs(cleanWhenAborted: true, cleanWhenFailure: true, cleanWhenNotBuilt: true, cleanWhenSuccess: true, cleanWhenUnstable: true, deleteDirs: true)
50− }
51− }
52− )
53− }
54− }
55− stage('Results') {
56− steps {
57− cleanWs(cleanWhenAborted: true, cleanWhenFailure: true, cleanWhenNotBuilt: true, cleanWhenSuccess: true, cleanWhenUnstable: true, deleteDirs: true)
58− unstash 'build-armhf'
59− unstash 'build-arm64'
60− unstash 'build-amd64'
61− archiveArtifacts(artifacts: '*.gz,*.bz2,*.xz,*.deb,*.dsc,*.changes,*.buildinfo', fingerprint: true, onlyIfSuccessful: true)
62− sh '''/usr/bin/build-repo.sh'''
63− }
64− }
65− stage('Cleanup') {
66− steps {
67− cleanWs(cleanWhenAborted: true, cleanWhenFailure: true, cleanWhenNotBuilt: true, cleanWhenSuccess: true, cleanWhenUnstable: true, deleteDirs: true)
68− }
69− }
70− }
71−}
1+@Library('ubports-build-tools') _
2+buildAndProvideDebianPackage()
README.md+18−38
@@ -1,51 +1,31 @@
1−# Unity8
1+# Lomiri
22
3−A convergent desktop environment.
3+Lomiri is the operating environment for everywhere. It is able to span the gaps between touch, mouse, and keyboard; between phones, tablets, and workstations; and look good doing it.
44
5+If you want to contribute to Lomiri on Ubuntu Touch, you've come to the right place. If you want to package Lomiri for other operating systems, you'll be better served by the main branch on the repository that we're migrating to: https://gitlab.com/ubports/core/lomiri
56
6−[![Unity 8](http://ubuntufun.de/wp-content/uploads/2016/05/screenshot20160518_232322980.png)](https://unity8.io)
7+Lomiri has been renamed from Unity8. Most of the software on-device in Ubuntu Touch based on Ubuntu 16.04 is still called `unity8`.
78
9+## Where to report issues
810
9−### How to install
11+Issues related to the version of Lomiri that currently runs on Ubuntu Touch devices may still be reported on this repository. We will move these reports to the GitLab repository as part of our final migration.
1012
11−The latest development preview of Unity8 for desktop can be installed on Ubuntu 16.04 (xenial) and 18.04 (bionic) as follows:
13+## Developing Lomiri on Ubuntu Touch
1214
13−1. Run the install script
14−```
15−bash <(wget -qO- https://raw.githubusercontent.com/ubports/unity8-desktop-install-tools/master/install.sh)
16−```
17−2. Reboot, select "unity8" at the login prompt, and enjoy :)
15+This repository contains the code for Lomiri currently running on Ubuntu Touch. If you would like to modify this version of Lomiri, follow the steps below. If you would like to modify Lomiri in another operating system, check out our new repository: https://gitlab.com/ubports/core/lomiri
1816
17+Lomiri can be built and its test suite run using [`clickable`](https://clickable-ut.dev). This is a convenient method to try out most graphical changes to Lomiri without an annoying redeployment process. If you wish to test your changes on your device or make changes that are more difficult to test without real hardware, check out [Making changes and testing locally on the UBports documentation](https://docs.ubports.com/en/latest/systemdev/testing-locally.html). If not, read on.
1918
20−**NOTE:** The above installation instructions currently only work on Ubuntu 16.04 (xenial) and 18.04 (bionic). Please be aware that the script will install the latest *development preview* of Unity8 for desktop. ***Expect bugs!*** Only install this preview if you understand the risks and are willing/able to fix your system if the preview breaks anything. You are advised *not* to install this preview onto a production system.
19+Before you start, [install Clickable](https://clickable-ut.dev/en/latest/install.html).
2120
22−See [CODING](CODING.md) for build instructions.
21+Now, clone this repository to your computer: `git clone https://github.com/ubports/unity8.git`
2322
23+Move into this directory: `cd unity8`
2424
25−### Where to report issues
25+Now you can use the full suite of tools provided by this repository's [clickable.yaml](clickable.yaml). For example:
2626
27−Issues related to the version of Unity8 for desktop (the latest development preview) installed using the above instructions should be reported on the [Unity8 issue tracker](https://github.com/ubports/unity8/issues) in *this* repository.
28−
29−Note that issues related to the version of Unity8 that currently runs on Ubuntu Touch devices should *NOT* be reported in this repository, but instead should be reported on the [Ubuntu Touch issue tracker](https://github.com/ubports/ubuntu-touch/issues). This will change once Ubuntu Touch moves to the latest version of Unity8.
30−
31−
32−### What works / what does not work
33−
34−*This list is incomplete, please help improve it*
35−
36−What works:
37−- Most Wayland apps work
38−- Many report being able to log in using LightDM, but may require a few attempts
39−
40−Does not work:
41−- Most Xapps don't (yet) work
42−- Proprietary drivers don't (yet) work
43−- Many report being unable to log in using GDM
44−
45−
46−### Get involved
47−
48−* [Kanban-Board](https://github.com/ubports/unity8/projects/1)
49−* If you are interesting in helping us in any way you can join [Unity8 Forum](https://forums.ubports.com/category/36/unity8).
50−* For reporting bugs or filing feature-requests, please use the project’s [issues page](https://github.com/ubports/unity8/issues).
51−* For IM you can join our Telegram group [for Developer users](https://t.me/UBports_Unity8).
27+* `clickable ide qtcreator` will open QtCreator with this repository open as a project. You can edit and build the project this way, but running the tests will be a bit difficult.
28+* `clickable build --libs --verbose` will build Lomiri in the same environment as it would receive in Ubuntu Touch.
29+* `clickable test --libs` will run the entire Lomiri test suite. This test suite includes graphical tests (which are run on a virtual, invisible desktop) and non-graphical unit tests. These tests make sure Lomiri functions as prescribed and prevents new bugs from being added. You should run them before you create a PR on this repository. This command takes about 7 minutes on an Intel i7-8550U, so plan your time accordingly and use the next two options to reduce the number of times you need to run the whole test suite...
30+* `clickable ide 'cd build/x86_64-linux-gnu/unity8/ && make tryShell'` and similar commands that replace the `Shell` with another test target defined in [tests/qmltests/CMakeLists.txt](tests/qmltests/CMakeLists.txt) allow trying out some Lomiri components in a mock environment. You can use this to try out your changes to Lomiri as you develop.
31+* `clickable ide 'cd build/x86_64-linux-gnu/unity8/ && make xvfbtestShell'` and similar commands that replace the `Shell` with another test target defined in [tests/qmltests/CMakeLists.txt](tests/qmltests/CMakeLists.txt) allow running a single TestCase. You can remove the `xvfb` part of the make target to run the test case graphically, which might help you see what is causing the test to fail.
build.sh+16
@@ -1,5 +1,21 @@
11#!/bin/sh
22
3+#
4+# Copyright (C) 2017 Canonical Ltd
5+#
6+# This program is free software: you can redistribute it and/or modify
7+# it under the terms of the GNU General Public License version 3 as
8+# published by the Free Software Foundation.
9+#
10+# This program is distributed in the hope that it will be useful,
11+# but WITHOUT ANY WARRANTY; without even the implied warranty of
12+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+# GNU General Public License for more details.
14+#
15+# You should have received a copy of the GNU General Public License
16+# along with this program. If not, see <http://www.gnu.org/licenses/>.
17+#
18+
319SETUP=false
420CLEAN=false
521NUM_JOBS=$(( `grep -c ^processor /proc/cpuinfo` + 1 ))
clickable.yamlnew file+153
@@ -0,0 +1,153 @@
1+clickable_minimum_required: '7'
2+builder: custom
3+build: echo Run \'clickable build --libs --verbose\' to build && false
4+restrict_arch: amd64
5+libraries:
6+ unity8:
7+ builder: cmake
8+ src_dir: "${ROOT}"
9+ test: make xvfballtests -j${NUM_PROCS}
10+ dependencies_host:
11+ - android-headers
12+ - cmake
13+ - cmake-extras
14+ - dbus-test-runner
15+ - debhelper
16+ - dh-apparmor
17+ - doxyqml
18+ - g++:native
19+ - gdb
20+ - graphviz
21+ - gsettings-ubuntu-schemas
22+ - libandroid-properties-dev
23+ - libconnectivity-qt1-dev
24+ - libevdev-dev
25+ - libgeonames-dev
26+ - libgl1-mesa-dev
27+ - libgl1-mesa-dri
28+ - libgles2-mesa-dev
29+ - libglib2.0-dev
30+ - libgnome-desktop-3-12
31+ - libgnome-desktop-3-dev
32+ - libgsettings-qt-dev
33+ - libhardware-dev
34+ - liblightdm-qt5-3-dev
35+ - libpam0g-dev
36+ - libpulse-dev
37+ - libqmenumodel-dev
38+ - libqt5sql5-sqlite
39+ - libqt5svg5-dev
40+ - libqt5xmlpatterns5-dev
41+ - libqtdbusmock1-dev
42+ - libqtdbustest1-dev
43+ - libsystemsettings-dev
44+ - libubuntu-app-launch2-dev
45+ - libubuntu-download-manager-common-dev
46+ - libubuntugestures5-dev
47+ - libubuntugestures5-private-dev
48+ - libudev-dev
49+ - libudm-common-dev
50+ - libunity-api-dev
51+ - libusermetricsoutput1-dev
52+ - libx11-dev
53+ - libxcb1-dev
54+ - libxi-dev
55+ - pkg-config
56+ - python3-all:any
57+ - python3-setuptools:native
58+ - qml-module-qt-labs-folderlistmodel
59+ - qml-module-qt-labs-settings
60+ - qml-module-qtmultimedia
61+ - qml-module-qtqml-statemachine
62+ - qml-module-qtquick-layouts
63+ - qml-module-qtquick-xmllistmodel
64+ - qml-module-qtquick2
65+ - qml-module-qtsysteminfo
66+ - qml-module-qttest
67+ - qml-module-ubuntu-components
68+ - qml-module-ubuntu-layouts
69+ - qml-module-ubuntu-settings-components
70+ - qml-module-ubuntu-test
71+ - qtbase5-dev
72+ - qtbase5-dev-tools
73+ - qtbase5-private-dev
74+ - qtdbustest-runner
75+ - qtdeclarative5-dev
76+ - qtdeclarative5-dev-tools
77+ - qtdeclarative5-private-dev
78+ - qtdeclarative5-ubuntu-content1
79+ - ttf-ubuntu-font-family
80+ - ubports-wallpapers
81+ - xvfb
82+dependencies_target:
83+ - android-headers
84+ - cmake
85+ - cmake-extras
86+ - dbus-test-runner
87+ - debhelper
88+ - dh-apparmor
89+ - doxyqml
90+ - g++:native
91+ - gdb
92+ - graphviz
93+ - gsettings-ubuntu-schemas
94+ - libandroid-properties-dev
95+ - libconnectivity-qt1-dev
96+ - libevdev-dev
97+ - libgeonames-dev
98+ - libgl1-mesa-dev
99+ - libgl1-mesa-dri
100+ - libgles2-mesa-dev
101+ - libglib2.0-dev
102+ - libgnome-desktop-3-12
103+ - libgnome-desktop-3-dev
104+ - libgsettings-qt-dev
105+ - libhardware-dev
106+ - liblightdm-qt5-3-dev
107+ - libpam0g-dev
108+ - libpulse-dev
109+ - libqmenumodel-dev
110+ - libqt5sql5-sqlite
111+ - libqt5svg5-dev
112+ - libqt5xmlpatterns5-dev
113+ - libqtdbusmock1-dev
114+ - libqtdbustest1-dev
115+ - libsystemsettings-dev
116+ - libubuntu-app-launch2-dev
117+ - libubuntu-download-manager-common-dev
118+ - libubuntugestures5-dev
119+ - libubuntugestures5-private-dev
120+ - libudev-dev
121+ - libudm-common-dev
122+ - libunity-api-dev
123+ - libusermetricsoutput1-dev
124+ - libx11-dev
125+ - libxcb1-dev
126+ - libxi-dev
127+ - pkg-config
128+ - python3-all:any
129+ - python3-setuptools:native
130+ - qml-module-qt-labs-folderlistmodel
131+ - qml-module-qt-labs-settings
132+ - qml-module-qtmultimedia
133+ - qml-module-qtqml-statemachine
134+ - qml-module-qtquick-layouts
135+ - qml-module-qtquick-xmllistmodel
136+ - qml-module-qtquick2
137+ - qml-module-qtsysteminfo
138+ - qml-module-qttest
139+ - qml-module-ubuntu-components
140+ - qml-module-ubuntu-layouts
141+ - qml-module-ubuntu-settings-components
142+ - qml-module-ubuntu-test
143+ - qtbase5-dev
144+ - qtbase5-dev-tools
145+ - qtbase5-private-dev
146+ - qtdbustest-runner
147+ - qtdeclarative5-dev
148+ - qtdeclarative5-dev-tools
149+ - qtdeclarative5-private-dev
150+ - qtdeclarative5-ubuntu-content1
151+ - ttf-ubuntu-font-family
152+ - ubports-wallpapers
153+ - xvfb
cmake/modules/QmlPlugins.cmakedeleted−148
@@ -1,148 +0,0 @@
1−# If you need to override the qmlplugindump binary, create the qmlplugin executable
2−# target before loading this plugin.
3−
4−if(NOT TARGET qmlplugindump)
5− find_program(qmlplugindump_exe qmlplugindump)
6−
7− if(NOT qmlplugindump_exe)
8− msg(FATAL_ERROR "Could not locate qmlplugindump.")
9− endif()
10−
11− add_executable(qmlplugindump IMPORTED)
12− set_target_properties(qmlplugindump PROPERTIES IMPORTED_LOCATION ${qmlplugindump_exe})
13−endif()
14−
15−#
16−# A custom target for building the qmltypes files manually.
17−#
18−if (NOT TARGET qmltypes)
19− add_custom_target(qmltypes)
20−endif()
21−
22−# Creates a target for copying resource files into build dir and optionally installing them.
23−#
24−# Files will be copied into ${BINARY_DIR}/${path} or ${CMAKE_CURRENT_BINARY_DIR} and installed
25−# into ${DESTINATION}/${path}.
26−#
27−# Resource file names are matched against {*.{qml,js,jpg,png,sci,svg},qmldir}.
28−#
29−# export_qmlfiles(plugin path
30−# [SEARCH_PATH path] # Path to search for resources in (defaults to ${CMAKE_CURRENT_SOURCE_DIR})
31−# [BINARY_DIR path]
32−# [DESTINATION path]
33−# [TARGET_PREFIX string] # Will be prefixed to the target name
34−# )
35−#
36−# Created target:
37−# - ${TARGET_PREFIX}${plugin}-qmlfiles - Copies resources into the binary dir.
38−
39−macro(export_qmlfiles PLUGIN PATH)
40− set(single SEARCH_PATH BINARY_DIR DESTINATION TARGET_PREFIX)
41− cmake_parse_arguments(QMLFILES "" "${single}" "" ${ARGN})
42−
43− if(NOT QMLFILES_SEARCH_PATH)
44− set(QMLFILES_SEARCH_PATH ${CMAKE_CURRENT_SOURCE_DIR})
45− endif()
46−
47− if(QMLFILES_BINARY_DIR)
48− set(qmlfiles_dir ${QMLFILES_BINARY_DIR}/${PATH})
49− else()
50− set(qmlfiles_dir ${CMAKE_CURRENT_BINARY_DIR})
51− endif()
52−
53− file(GLOB QMLFILES
54− ${QMLFILES_SEARCH_PATH}/*.qml
55− ${QMLFILES_SEARCH_PATH}/*.js
56− ${QMLFILES_SEARCH_PATH}/*.jpg
57− ${QMLFILES_SEARCH_PATH}/*.png
58− ${QMLFILES_SEARCH_PATH}/*.sci
59− ${QMLFILES_SEARCH_PATH}/*.svg
60− ${QMLFILES_SEARCH_PATH}/*.qmltypes
61− ${QMLFILES_SEARCH_PATH}/qmldir
62− )
63−
64− execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${qmlfiles_dir})
65−
66− # copy the files
67− add_custom_target(${QMLFILES_TARGET_PREFIX}${PLUGIN}-qmlfiles ALL
68− COMMAND cp ${QMLFILES} ${qmlfiles_dir}
69− DEPENDS ${QMLFILES}
70− SOURCES ${QMLFILES}
71− )
72−
73− if(QMLFILES_DESTINATION)
74− # install the qmlfiles file.
75− install(FILES ${QMLFILES}
76− DESTINATION ${QMLFILES_DESTINATION}/${PATH}
77− )
78− endif()
79−endmacro()
80−
81−
82−# Creates a target for generating the typeinfo file for a QML plugin and/or installs the plugin
83−# targets.
84−#
85−# Files will be copied into ${BINARY_DIR}/${path} or ${CMAKE_CURRENT_BINARY_DIR} and installed
86−# into ${DESTINATION}/${path}. If you don't pass BINARY_DIR, it's assumed that current source
87−# path ends with ${path}.
88−#
89−# The generated file will be named after the last segment of the plugin name, e.g. Foo.qmltypes.
90−#
91−# export_qmlplugin(plugin version path
92−# [BINARY_DIR path]
93−# [DESTINATION path]
94−# [TARGET_PREFIX string] # Will be prefixed to the target name
95−# [ENVIRONMENT string] # Will be added to qmlplugindump's env
96−# [TARGETS target1 [target2 ...]] # Targets to depend on and install (e.g. the plugin shared object)
97−# [NO_TYPES] # Do not create the qmltypes target
98−# )
99−#
100−# Created target:
101−# - ${TARGET_PREFIX}${plugin}-qmltypes - Generates the qmltypes file in the source dir.
102−# It will be made a dependency of the "qmltypes" target.
103−
104−macro(export_qmlplugin PLUGIN VERSION PATH)
105− set(options NO_TYPES)
106− set(single BINARY_DIR DESTINATION TARGET_PREFIX ENVIRONMENT)
107− set(multi TARGETS)
108− cmake_parse_arguments(QMLPLUGIN "${options}" "${single}" "${multi}" ${ARGN})
109−
110− if(QMLPLUGIN_BINARY_DIR)
111− set(qmlplugin_dir ${QMLPLUGIN_BINARY_DIR}/${PATH})
112− else()
113− # Find import path to point qmlplugindump at
114− string(REGEX REPLACE "/${PATH}$" "" QMLPLUGIN_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}")
115− set(qmlplugin_dir ${CMAKE_CURRENT_BINARY_DIR})
116− endif()
117−
118− if(NOT QMLPLUGIN_NO_TYPES)
119− # Relative path for the module
120− string(REPLACE "${CMAKE_BINARY_DIR}/" "" QMLPLUGIN_MODULE_DIR "${QMLPLUGIN_BINARY_DIR}")
121−
122− # Find the last segment of the plugin name to use as qmltypes basename
123− string(REGEX MATCH "[^.]+$" plugin_suffix ${PLUGIN})
124− set(target_prefix ${QMLPLUGIN_TARGET_PREFIX}${PLUGIN})
125− set(qmltypes_path ${CMAKE_CURRENT_SOURCE_DIR}/${plugin_suffix}.qmltypes)
126−
127− add_custom_target(${target_prefix}-qmltypes
128− COMMAND env ${QMLPLUGIN_ENVIRONMENT} $<TARGET_FILE:qmlplugindump> -notrelocatable
129− ${PLUGIN} ${VERSION} ${QMLPLUGIN_MODULE_DIR} > ${qmltypes_path}
130− WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
131− )
132− add_dependencies(${target_prefix}-qmltypes ${target_prefix}-qmlfiles ${QMLPLUGIN_TARGETS})
133− add_dependencies(qmltypes ${target_prefix}-qmltypes)
134− endif()
135−
136− set_target_properties(${QMLPLUGIN_TARGETS} PROPERTIES
137− ARCHIVE_OUTPUT_DIRECTORY ${qmlplugin_dir}
138− LIBRARY_OUTPUT_DIRECTORY ${qmlplugin_dir}
139− RUNTIME_OUTPUT_DIRECTORY ${qmlplugin_dir}
140− )
141−
142− if (QMLPLUGIN_DESTINATION)
143− # Install additional targets
144− install(TARGETS ${QMLPLUGIN_TARGETS}
145− DESTINATION ${QMLPLUGIN_DESTINATION}/${PATH}
146− )
147− endif()
148−endmacro()
cmake/modules/QmlTest.cmake+188−12
@@ -55,6 +55,55 @@ function(add_qml_test PATH COMPONENT_NAME)
5555endfunction()
5656
5757
58+# add_qml_test_data(path component_name
59+# [...]
60+# )
61+#
62+# Install file called ${component_name} (or ${component_name}.qml) under
63+# ${path}.
64+
65+function(add_qml_test_data PATH COMPONENT_NAME)
66+ cmake_parse_arguments(TEST "" "DESTINATION" "" ${ARGN})
67+
68+ set(filename "${CMAKE_CURRENT_SOURCE_DIR}/${PATH}/${COMPONENT_NAME}")
69+
70+ if (IS_DIRECTORY "${filename}")
71+ # As a convenience, allow specifying a directory and we will install
72+ # all files in the dir. We do it this way rather than passing
73+ # DIRECTORY to install() because we want to process any qml files.
74+ file(GLOB subfiles RELATIVE "${filename}" "${filename}/*")
75+ foreach(subfile ${subfiles})
76+ add_qml_test_data("${PATH}/${COMPONENT_NAME}" "${subfile}")
77+ endforeach()
78+ return()
79+ endif()
80+
81+ if (NOT EXISTS "${filename}")
82+ set(filename "${filename}.qml")
83+ set(COMPONENT_NAME "${COMPONENT_NAME}.qml")
84+ endif()
85+
86+ if ("${filename}" MATCHES "\\.qml$")
87+ file(READ "${filename}" contents)
88+ string(REGEX REPLACE "(\"[./]*)/qml(/|\")" "\\1\\2" contents "${contents}")
89+ # this is for (at least) cardcreatortest which pulls in an architecture-specific
90+ # import into the plugins directory (which is a 'qml' once installed).
91+ string(REGEX REPLACE "(import \"[./]*)/plugins(/|\")" "\\1/qml\\2" contents "${contents}")
92+ set(filename "${CMAKE_CURRENT_BINARY_DIR}/${PATH}/${COMPONENT_NAME}")
93+ file(WRITE "${filename}" "${contents}")
94+ endif()
95+
96+ if (TEST_DESTINATION)
97+ set(DESTINATION "${TEST_DESTINATION}")
98+ else()
99+ file(RELATIVE_PATH relcurpath "${CMAKE_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}")
100+ set(DESTINATION "${SHELL_APP_DIR}/${relcurpath}/${PATH}")
101+ endif()
102+
103+ install(FILES "${filename}" DESTINATION "${DESTINATION}")
104+endfunction()
105+
106+
58107# add_qml_unittest(path component_name
59108# [...]
60109# )
@@ -71,6 +120,10 @@ function(add_qml_unittest PATH COMPONENT_NAME)
71120 ${ARGN}
72121 ARGS -input ${CMAKE_CURRENT_SOURCE_DIR}/${PATH}/tst_${COMPONENT_NAME}.qml ${QMLTEST_ARGS}
73122 )
123+
124+ if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${PATH}/tst_${COMPONENT_NAME}.qml")
125+ add_qml_test_data("${PATH}" "tst_${COMPONENT_NAME}.qml")
126+ endif()
74127endfunction()
75128
76129
@@ -91,6 +144,10 @@ function(add_manual_qml_test PATH COMPONENT_NAME)
91144 ${ARGN}
92145 ARGS ${CMAKE_CURRENT_SOURCE_DIR}/${PATH}/tst_${COMPONENT_NAME}.qml ${QMLTEST_ARGS}
93146 )
147+
148+ if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${PATH}/tst_${COMPONENT_NAME}.qml")
149+ add_qml_test_data("${PATH}" "tst_${COMPONENT_NAME}.qml")
150+ endif()
94151endfunction()
95152
96153
@@ -108,8 +165,7 @@ endfunction()
108165#
109166# Logging options in the standard form of "-o filename,format"
110167# will be appended to the arguments list, prefixed with ARG_PREFIX.
111−# XUnitXML files will be stored in current binary dir or under
112−# ARTIFACTS_DIR, if set.
168+# XUnitXML files will be stored in current binary dir.
113169#
114170# Three targets will be created:
115171# - test${component_name} - Runs the test
@@ -122,14 +178,8 @@ function(add_executable_test COMPONENT_NAME TARGET)
122178 cmake_parse_arguments(QMLTEST "${QMLTEST_OPTIONS}" "${QMLTEST_SINGLE}" "${QMLTEST_MULTI}" ${ARGN})
123179 mangle_arguments()
124180
125− if(ARTIFACTS_DIR)
126− file(RELATIVE_PATH path ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
127− file(MAKE_DIRECTORY ${ARTIFACTS_DIR}/${path})
128− set(file_logger -o ${ARTIFACTS_DIR}/${path}/test${COMPONENT_NAME}.xml,xunitxml)
129− else()
130− file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
131− set(file_logger -o ${CMAKE_CURRENT_BINARY_DIR}/test${COMPONENT_NAME}.xml,xunitxml)
132− endif()
181+ file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
182+ set(file_logger -o ${CMAKE_CURRENT_BINARY_DIR}/test${COMPONENT_NAME}.xml,xunitxml)
133183
134184 bake_arguments("${QMLTEST_ARG_PREFIX}" args ${iterations} ${file_logger} ${STDOUT_LOGGER})
135185
@@ -151,7 +201,7 @@ function(add_executable_test COMPONENT_NAME TARGET)
151201 add_qmltest_target(xvfbtest${COMPONENT_NAME} ${TARGET}
152202 COMMAND $<TARGET_FILE:xvfb-run> --server-args "-screen 0 1024x768x24" --auto-servernum ${qmltest_command}
153203 ${depends}
154− ENVIRONMENT QML2_IMPORT_PATH=${imports} ${QMLTEST_ENVIRONMENT} LD_PRELOAD=/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}/mesa/libGL.so.1
204+ ENVIRONMENT QT_QPA_PLATFORM=xcb QML2_IMPORT_PATH=${imports} LD_PRELOAD=/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}/mesa/libGL.so.1 ${QMLTEST_ENVIRONMENT}
155205 TARGETS ${xvfb_targets}
156206 )
157207 endif()
@@ -207,8 +257,129 @@ function(add_manual_test COMPONENT_NAME TARGET)
207257endfunction()
208258
209259
260+# add_meta_test(target)
261+#
262+# Adds a test target that will run one of our "meta" test targets, like
263+# xvfbuitests. This script will run the specified suite of tests on an
264+# installed system.
265+
266+function(add_meta_test TARGET_NAME)
267+ cmake_parse_arguments(TEST "SERIAL" "" "DEPENDS" ${ARGN})
268+
269+ add_custom_target(${TARGET_NAME})
270+
271+ set(filename "${CMAKE_BINARY_DIR}/tests/scripts/${TARGET_NAME}.sh")
272+ if(TEST_SERIAL)
273+ file(WRITE "${filename}" "#!/bin/sh\n\n")
274+ else()
275+ file(WRITE "${filename}" "#!/usr/bin/parallel --shebang --no-notice\n\n")
276+ endif()
277+
278+ add_meta_dependencies(${TARGET_NAME} DEPENDS ${TEST_DEPENDS})
279+ # else we will write the rest of the script as we add cmake targets
280+
281+ install(FILES "${filename}"
282+ PERMISSIONS OWNER_EXECUTE OWNER_READ OWNER_WRITE
283+ GROUP_EXECUTE GROUP_READ
284+ WORLD_EXECUTE WORLD_READ
285+ DESTINATION "${SHELL_PRIVATE_LIBDIR}/tests/scripts"
286+ )
287+endfunction()
288+
289+
210290################### INTERNAL ####################
211291
292+function(install_test_script TARGET_NAME)
293+ cmake_parse_arguments(TEST "" "" "COMMAND;ENVIRONMENT" ${ARGN})
294+
295+ # Now write the above test into a shell script that we can run on an
296+ # installed system.
297+ set(script "#!/bin/sh\n\nset -x\n\n")
298+ foreach(ONE_ENV ${TEST_ENVIRONMENT})
299+ set(script "${script}export ${ONE_ENV}\n")
300+ endforeach()
301+ set(script "${script}export UNITY_TESTING_DATADIR=\"${CMAKE_INSTALL_PREFIX}/${SHELL_APP_DIR}\"\n")
302+ set(script "${script}export UNITY_TESTING_LIBDIR=\"${CMAKE_INSTALL_PREFIX}/${SHELL_PRIVATE_LIBDIR}\"\n")
303+ set(script "${script}\n")
304+ set(script "${script}XML_ARGS=\n")
305+ set(script "${script}if [ -n \"\$ARTIFACTS_DIR\" ]; then\n")
306+ set(script "${script} XML_ARGS=\"@XML_ARGS@\"\n")
307+ set(script "${script} mkdir -p \"@XML_DIR@\"\n")
308+ set(script "${script} touch \"@XML_FILE@\"\n")
309+ set(script "${script}fi\n")
310+ set(script "${script}\n")
311+ foreach(ONE_CMD ${TEST_COMMAND})
312+ set(script "${script}'${ONE_CMD}' ")
313+ endforeach()
314+ set(script "${script}\"\$@\"") # Allow passing arguments if desired
315+
316+ set(filename "${CMAKE_BINARY_DIR}/tests/scripts/${TARGET_NAME}.sh")
317+
318+ # Generate script to file then read it back to resolve any generator
319+ # expressions before we try to replace paths.
320+ file(GENERATE
321+ OUTPUT "${filename}"
322+ CONTENT "${script}"
323+ )
324+
325+ # Do replacement at install time to save needless work and to make sure
326+ # we are modifying file after generate step above (which doesn't happen
327+ # immediately). We can't use a custom-defined function or macro here...
328+ # So instead we use a giant ugly code block.
329+
330+ # START OF CODE BLOCK --------------------------------------------------
331+ install(CODE "
332+ file(READ \"${filename}\" replacestr)
333+
334+ # Now some replacements...
335+ # tests like to write xml output to our builddir; we don't need that, but we do want them in ARTIFACTS_DIR
336+ string(REGEX MATCH \"( '--parameter')? '-o'( '--parameter')? '[^']*,xunitxml' \" xmlargs \"\${replacestr}\")
337+ string(REGEX REPLACE \"( '--parameter')? '-o'( '--parameter')? '[^']*,xunitxml' \" \" \\\$XML_ARGS \" replacestr \"\${replacestr}\")
338+ string(REGEX REPLACE \"'[^']*/tests/\" \"'\\\$ARTIFACTS_DIR/tests/\" xmlargs \"\${xmlargs}\")
339+ string(REGEX REPLACE \".*'([^']*),xunitxml'.*\" \"\\\\1\" xmlfile \"\${xmlargs}\")
340+ string(REGEX REPLACE \"(.*)/[^/]*\" \"\\\\1\" xmldir \"\${xmlfile}\")
341+ string(REGEX REPLACE \"'\" \"\" xmlargs \"\${xmlargs}\") # strip single quotes
342+ string(REGEX REPLACE \"@XML_ARGS@\" \"\${xmlargs}\" replacestr \"\${replacestr}\")
343+ string(REGEX REPLACE \"@XML_DIR@\" \"\${xmldir}\" replacestr \"\${replacestr}\")
344+ string(REGEX REPLACE \"@XML_FILE@\" \"\${xmlfile}\" replacestr \"\${replacestr}\")
345+ # replace build/source roots with their install paths
346+ string(REPLACE \"${CMAKE_BINARY_DIR}/libs\" \"${CMAKE_INSTALL_PREFIX}/${SHELL_PRIVATE_LIBDIR}\" replacestr \"\${replacestr}\")
347+ string(REPLACE \"${CMAKE_BINARY_DIR}/plugins\" \"${CMAKE_INSTALL_PREFIX}/${SHELL_INSTALL_QML}\" replacestr \"\${replacestr}\")
348+ string(REPLACE \"${CMAKE_BINARY_DIR}/tests/libs\" \"${CMAKE_INSTALL_PREFIX}/${SHELL_PRIVATE_LIBDIR}/tests/libs\" replacestr \"\${replacestr}\")
349+ string(REPLACE \"${CMAKE_BINARY_DIR}/tests/mocks\" \"${CMAKE_INSTALL_PREFIX}/${SHELL_INSTALL_QML}/mocks\" replacestr \"\${replacestr}\")
350+ string(REPLACE \"${CMAKE_BINARY_DIR}/tests/plugins\" \"${CMAKE_INSTALL_PREFIX}/${SHELL_PRIVATE_LIBDIR}/tests/plugins\" replacestr \"\${replacestr}\")
351+ string(REPLACE \"${CMAKE_BINARY_DIR}/tests/qmltests\" \"${CMAKE_INSTALL_PREFIX}/${SHELL_PRIVATE_LIBDIR}/tests/qmltests\" replacestr \"\${replacestr}\")
352+ string(REPLACE \"${CMAKE_BINARY_DIR}/tests/uqmlscene\" \"${CMAKE_INSTALL_PREFIX}/${SHELL_PRIVATE_LIBDIR}\" replacestr \"\${replacestr}\")
353+ string(REPLACE \"${CMAKE_BINARY_DIR}/tests/utils/modules\" \"${CMAKE_INSTALL_PREFIX}/${SHELL_INSTALL_QML}/utils\" replacestr \"\${replacestr}\")
354+ string(REPLACE \"${CMAKE_SOURCE_DIR}/tests/plugins\" \"${CMAKE_INSTALL_PREFIX}/${SHELL_APP_DIR}/tests/plugins\" replacestr \"\${replacestr}\")
355+ string(REPLACE \"${CMAKE_SOURCE_DIR}/tests/qmltests\" \"${CMAKE_INSTALL_PREFIX}/${SHELL_APP_DIR}/tests/qmltests\" replacestr \"\${replacestr}\")
356+
357+ file(WRITE \"${filename}\" \"\${replacestr}\")
358+ ")
359+ # END OF CODE BLOCK --------------------------------------------------
360+
361+ install(FILES "${filename}"
362+ PERMISSIONS OWNER_EXECUTE OWNER_READ OWNER_WRITE
363+ GROUP_EXECUTE GROUP_READ
364+ WORLD_EXECUTE WORLD_READ
365+ DESTINATION "${SHELL_PRIVATE_LIBDIR}/tests/scripts"
366+ )
367+endfunction()
368+
369+function(add_meta_dependencies UPSTREAM_TARGET)
370+ cmake_parse_arguments(TEST "" "" "DEPENDS" ${ARGN})
371+
372+ foreach(depend ${TEST_DEPENDS})
373+ add_dependencies(${UPSTREAM_TARGET} ${depend})
374+
375+ # add depend to the meta test script that we will install on system
376+ set(filename "${CMAKE_BINARY_DIR}/tests/scripts/${UPSTREAM_TARGET}.sh")
377+ if (EXISTS "${filename}")
378+ file(APPEND "${filename}" "${CMAKE_INSTALL_PREFIX}/${SHELL_PRIVATE_LIBDIR}/tests/scripts/${depend}.sh \"\$@\" 2>&1\n")
379+ endif()
380+ endforeach()
381+endfunction()
382+
212383# add_qmltest_target(target_name target
213384# COMMAND test_exe [arg1 [...]] # execute this test with arguments
214385# [...] # see above for available arguments:
@@ -231,6 +402,11 @@ function(add_qmltest_target TARGET_NAME TARGET)
231402 DEPENDS ${TARGET} ${QMLTEST_DEPENDS}
232403 )
233404
405+ install_test_script(${TARGET_NAME}
406+ ENVIRONMENT ${QMLTEST_ENVIRONMENT}
407+ COMMAND ${QMLTEST_COMMAND}
408+ )
409+
234410 if(QMLTEST_ADD_TEST)
235411 add_test(
236412 NAME ${TARGET_NAME}
@@ -248,7 +424,7 @@ function(add_qmltest_target TARGET_NAME TARGET)
248424 endif()
249425
250426 foreach(UPSTREAM_TARGET ${QMLTEST_TARGETS})
251− add_dependencies(${UPSTREAM_TARGET} ${TARGET_NAME})
427+ add_meta_dependencies(${UPSTREAM_TARGET} DEPENDS ${TARGET_NAME})
252428 endforeach()
253429endfunction()
254430
data/CMakeLists.txt−9
@@ -1,13 +1,11 @@
11# generate desktop files
22configure_file(${SHELL_APP}.desktop.in ${CMAKE_CURRENT_BINARY_DIR}/${SHELL_APP}.desktop @ONLY)
3−configure_file(${DASH_APP}.desktop.in ${CMAKE_CURRENT_BINARY_DIR}/${DASH_APP}.desktop @ONLY)
43configure_file(${INDICATORS_CLIENT_APP}.desktop.in ${CMAKE_CURRENT_BINARY_DIR}/${INDICATORS_CLIENT_APP}.desktop @ONLY)
54configure_file(${GREETER_APP}.desktop.in ${CMAKE_CURRENT_BINARY_DIR}/${GREETER_APP}.desktop @ONLY)
65
76# install desktop files
87install(FILES
98 ${CMAKE_CURRENT_BINARY_DIR}/${SHELL_APP}.desktop
10− ${CMAKE_CURRENT_BINARY_DIR}/${DASH_APP}.desktop
119 ${CMAKE_CURRENT_BINARY_DIR}/${INDICATORS_CLIENT_APP}.desktop
1210 DESTINATION ${CMAKE_INSTALL_DATADIR}/applications
1311 )
@@ -22,15 +20,8 @@ install(FILES
2220 DESTINATION ${CMAKE_INSTALL_DATADIR}/lightdm/lightdm.conf.d
2321 )
2422
25−# install dash icon
26−install(FILES
27− ${CMAKE_CURRENT_SOURCE_DIR}/${DASH_APP}.png
28− DESTINATION ${SHELL_APP_DIR}/Dash/
29− )
30−
3123add_custom_target(pkgversion ALL COMMAND dpkg-parsechangelog -l${CMAKE_SOURCE_DIR}/debian/changelog --show-field version > ${CMAKE_CURRENT_BINARY_DIR}/version)
3224
3325install(FILES com.canonical.Unity8.gschema.xml DESTINATION ${CMAKE_INSTALL_DATADIR}/glib-2.0/schemas)
3426install(FILES com.canonical.Unity.gschema.xml DESTINATION ${CMAKE_INSTALL_DATADIR}/glib-2.0/schemas)
35−install(FILES unity8-dash.url-dispatcher DESTINATION ${CMAKE_INSTALL_DATADIR}/url-dispatcher/urls)
3627install(FILES ${CMAKE_CURRENT_BINARY_DIR}/version DESTINATION ${CMAKE_INSTALL_LOCALSTATEDIR}/lib/unity8)
data/com.canonical.Unity.gschema.xml+1−1
@@ -164,7 +164,7 @@
164164 'appid://openstore.openstore-team/openstore/current-user-version',
165165 'appid://com.ubuntu.camera/camera/current-user-version',
166166 'appid://com.ubuntu.gallery/gallery/current-user-version',
167− 'application:///webbrowser-app.desktop'
167+ 'application:///morph-browser.desktop'
168168 ]</default>
169169 <summary>List of items that should be shown by default in the launcher</summary>
170170 <description>These items can be: application:///desktop-id.desktop or appid://package/app/current-user-version.</description>
data/com.canonical.Unity8.gschema.xml+18−8
@@ -12,7 +12,7 @@
1212 <description>The usage mode chosen will affect the Window Management behaviour.</description>
1313 </key>
1414 <key type="u" name="edge-barrier-sensitivity">
15− <default>35</default>
15+ <default>50</default>
1616 <range min="1" max="100"/>
1717 <summary>Sensitivity of screen edge barriers for the mouse pointer.</summary>
1818 <description>Some UI actions like revealing the launcher or the applications spread are triggered by pushing the mouse pointer against a screen edge. This key defines how much you have to push in order to trigger the associated action.</description>
@@ -23,7 +23,7 @@
2323 <description>How much you have to push (in grid units)the mouse against an edge barrier when sensibility is 100.</description>
2424 </key>
2525 <key type="u" name="edge-barrier-max-push">
26− <default>60</default>
26+ <default>120</default>
2727 <summary>Maximum push needed to overcome edge barrier</summary>
2828 <description>How much you have to push (in grid units) the mouse against an edge barrier when sensibility is 1.</description>
2929 </key>
@@ -33,7 +33,7 @@
3333 <description>How big (in grid units) the edge-drag sensitive area should be.</description>
3434 </key>
3535 <key type="b" name="autohide-launcher">
36− <default>true</default>
36+ <default>false</default>
3737 <summary>Autohide the launcher</summary>
3838 <description>This will only be applied in windowed mode. In staged mode, the launcher will always hide.</description>
3939 </key>
@@ -43,16 +43,26 @@
4343 <summary>Width of the launcher in grid units.</summary>
4444 <description>Changes the width of the launcher in all usage modes.</description>
4545 </key>
46− <key type="b" name="enable-launcher">
47− <default>true</default>
48− <summary>Enable or disable the launcher</summary>
49− <description>Toggle the availability of the launcher</description>
50− </key>
5146 <key type="b" name="enable-indicator-menu">
5247 <default>true</default>
5348 <summary>Enable or disable the indicator pull down menus</summary>
5449 <description>Toggle the availability of the indicator pull down menus</description>
5550 </key>
51+ <key type="s" name="appstore-uri">
52+ <default>'appid://openstore.openstore-team/openstore/current-user-version'</default>
53+ <summary>The uri to the app store</summary>
54+ <description>This will be used whenever the user triggers an action to open the app store.</description>
55+ </key>
56+ <key type="b" name="always-show-osk">
57+ <default>false</default>
58+ <summary>Force showing/hiding the OSK</summary>
59+ <description>Toggle the visibility of the On Screen Keyboard unconditionally</description>
60+ </key>
61+ <key type="b" name="osk-switch-visible">
62+ <default>false</default>
63+ <summary>Whether the OSK switch should be visible</summary>
64+ <description>Toggle the visibility of the OSK switch</description>
65+ </key>
5666 </schema>
5767
5868 <schema path="/com/canonical/unity8/greeter/" id="com.canonical.Unity8.Greeter" gettext-domain="unity8">
data/unity8-dash.confdeleted−26
@@ -1,26 +0,0 @@
1−description "Unity Shell v8 Dash"
2−author "Michael Zanetti <michael.zanetti@canonical.com>"
3−
4−emits scope-ui-starting
5−
6−start on started unity8
7−stop on stopping unity8
8−
9−kill timeout 120
10−
11−# Focused app is 100 so we want to be less likely to get
12−# killed than the focused app but more than Unity8
13−
14−## FIXME
15−#oom score 50
16−
17−respawn
18−respawn limit unlimited
19−
20−env APP_ID=unity8-dash
21−
22−pre-start script
23− initctl emit scope-ui-starting
24−end script
25−
26−exec ${BINARY:-unity8-dash} $ARGS --desktop_file_hint=unity8-dash.desktop
data/unity8-dash.desktop.indeleted−9
@@ -1,9 +0,0 @@
1−[Desktop Entry]
2−Type=Application
3−Name=Scopes
4−Comment=An interface for using the Scopes system
5−Exec=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_BINDIR@/unity8-dash
6−Terminal=false
7−Icon=@CMAKE_INSTALL_PREFIX@/@SHELL_APP_DIR@/Dash/unity8-dash.png
8−NoDisplay=true
9−X-Ubuntu-Touch=true
data/unity8-dash.pngdeleted

Binary file not shown.

data/unity8-dash.svgdeleted−326
@@ -1,326 +0,0 @@
1−<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2−<!-- Created with Inkscape (http://www.inkscape.org/) -->
3−
4−<svg
5− xmlns:dc="http://purl.org/dc/elements/1.1/"
6− xmlns:cc="http://creativecommons.org/ns#"
7− xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
8− xmlns:svg="http://www.w3.org/2000/svg"
9− xmlns="http://www.w3.org/2000/svg"
10− xmlns:xlink="http://www.w3.org/1999/xlink"
11− xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
12− xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
13− viewBox="0 0 512 512"
14− style="enable-background:new"
15− inkscape:export-ydpi="180"
16− inkscape:export-xdpi="180"
17− inkscape:export-filename="app_shape02.png"
18− sodipodi:docname="apps-scope.svg"
19− inkscape:version="0.91+devel r"
20− version="1.1"
21− id="svg3336"
22− height="512"
23− width="512">
24− <sodipodi:namedview
25− inkscape:snap-global="false"
26− fit-margin-bottom="18"
27− fit-margin-right="0"
28− fit-margin-left="0"
29− fit-margin-top="18"
30− inkscape:snap-grids="true"
31− inkscape:guide-bbox="true"
32− showguides="false"
33− inkscape:snap-center="true"
34− inkscape:snap-object-midpoints="true"
35− inkscape:snap-midpoints="true"
36− inkscape:snap-smooth-nodes="true"
37− inkscape:snap-intersection-paths="true"
38− inkscape:object-nodes="true"
39− inkscape:object-paths="true"
40− inkscape:snap-bbox-midpoints="true"
41− inkscape:snap-bbox-edge-midpoints="true"
42− inkscape:bbox-nodes="true"
43− inkscape:bbox-paths="true"
44− inkscape:snap-bbox="true"
45− showborder="true"
46− inkscape:showpageshadow="false"
47− inkscape:snap-page="true"
48− inkscape:window-maximized="1"
49− inkscape:window-y="24"
50− inkscape:window-x="0"
51− inkscape:window-height="1029"
52− inkscape:window-width="1920"
53− showgrid="false"
54− inkscape:current-layer="layer3"
55− inkscape:document-units="px"
56− inkscape:cy="204.04409"
57− inkscape:cx="-384.5809"
58− inkscape:zoom="0.64"
59− inkscape:pageshadow="2"
60− inkscape:pageopacity="0"
61− borderopacity="1.0"
62− bordercolor="#666666"
63− pagecolor="#4f4f4f"
64− id="base">
65− <inkscape:grid
66− type="xygrid"
67− id="grid811"
68− originx="0"
69− originy="15.999999"
70− visible="true"
71− enabled="true" />
72− <sodipodi:guide
73− orientation="1,0"
74− position="104,176"
75− id="guide819" />
76− <sodipodi:guide
77− orientation="1,0"
78− position="120,160"
79− id="guide821" />
80− <sodipodi:guide
81− orientation="1,0"
82− position="392,144"
83− id="guide823" />
84− <sodipodi:guide
85− orientation="1,0"
86− position="408,144"
87− id="guide825" />
88− <sodipodi:guide
89− orientation="0,1"
90− position="328,408"
91− id="guide827" />
92− <sodipodi:guide
93− orientation="0,1"
94− position="336,392"
95− id="guide829" />
96− <sodipodi:guide
97− orientation="0,1"
98− position="176,120"
99− id="guide831" />
100− <sodipodi:guide
101− orientation="0,1"
102− position="216,104"
103− id="guide833" />
104− <inkscape:grid
105− type="axonomgrid"
106− id="grid835"
107− units="px"
108− empspacing="60"
109− gridanglex="42.9"
110− gridanglez="42.9"
111− spacingy="3.522px"
112− enabled="false"
113− originx="0"
114− originy="16.999996" />
115− <sodipodi:guide
116− orientation="0,1"
117− position="344,376"
118− id="guide4126" />
119− <sodipodi:guide
120− orientation="0,1"
121− position="160,136"
122− id="guide4128" />
123− <sodipodi:guide
124− orientation="1,0"
125− position="136,96"
126− id="guide4130" />
127− <sodipodi:guide
128− orientation="1,0"
129− position="376,136"
130− id="guide4134" />
131− <sodipodi:guide
132− orientation="-0.70710678,0.70710678"
133− position="544,544"
134− id="guide4136" />
135− <sodipodi:guide
136− orientation="1,0"
137− position="256,-32.000001"
138− id="guide4138" />
139− <sodipodi:guide
140− orientation="0,1"
141− position="544,256"
142− id="guide4140" />
143− <sodipodi:guide
144− orientation="0.70710678,0.70710678"
145− position="544,-32.000001"
146− id="guide4142" />
147− <sodipodi:guide
148− orientation="0,1"
149− position="248,15.999999"
150− id="guide4152" />
151− <sodipodi:guide
152− orientation="0,1"
153− position="336,496"
154− id="guide4154" />
155− <sodipodi:guide
156− position="344,96"
157− orientation="1,0"
158− id="guide4361" />
159− <sodipodi:guide
160− position="576,168"
161− orientation="0,1"
162− id="guide4363" />
163− <sodipodi:guide
164− position="168,192"
165− orientation="1,0"
166− id="guide4229" />
167− <sodipodi:guide
168− position="312,344"
169− orientation="0,1"
170− id="guide4233" />
171− <sodipodi:guide
172− position="180.48,-96"
173− orientation="0,1"
174− id="guide4235" />
175− </sodipodi:namedview>
176− <defs
177− id="defs3338">
178− <linearGradient
179− inkscape:collect="always"
180− id="linearGradient4203">
181− <stop
182− style="stop-color:#ea5420;stop-opacity:1"
183− offset="0"
184− id="stop4205" />
185− <stop
186− style="stop-color:#f37e40;stop-opacity:1"
187− offset="1"
188− id="stop4207" />
189− </linearGradient>
190− <clipPath
191− clipPathUnits="userSpaceOnUse"
192− id="clipPath4755">
193− <path
194− style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:0.24899998;fill:#5e2c73;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;enable-background:accumulate"
195− d="M 360,50 594,284 V 215.89844 C 594,70.73665 573.2426,50 427.94531,50 Z"
196− id="path4757"
197− inkscape:connector-curvature="0" />
198− </clipPath>
199− <clipPath
200− clipPathUnits="userSpaceOnUse"
201− id="clipPath4767">
202− <path
203− style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:1;fill:#f6f6f6;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;enable-background:accumulate"
204− d="M 543.8125,454.1875 312.18945,685.81055 367.94531,681 C 512.70468,668.50896 526.55393,654.72881 539,510.10156 Z"
205− id="path4769"
206− inkscape:connector-curvature="0" />
207− </clipPath>
208− <linearGradient
209− inkscape:collect="always"
210− xlink:href="#linearGradient4203"
211− id="linearGradient4209"
212− x1="167.5"
213− y1="17.25"
214− x2="343.25"
215− y2="491"
216− gradientUnits="userSpaceOnUse" />
217− <filter
218− inkscape:collect="always"
219− style="color-interpolation-filters:sRGB"
220− id="filter4220"
221− x="-0.012"
222− width="1.024"
223− y="-0.012"
224− height="1.024">
225− <feGaussianBlur
226− inkscape:collect="always"
227− stdDeviation="1.4390401"
228− id="feGaussianBlur4222" />
229− </filter>
230− <linearGradient
231− inkscape:collect="always"
232− xlink:href="#linearGradient4226"
233− id="linearGradient4232"
234− x1="255.99998"
235− y1="-255.99998"
236− x2="405.35773"
237− y2="-255.99998"
238− gradientUnits="userSpaceOnUse"
239− spreadMethod="reflect" />
240− <linearGradient
241− inkscape:collect="always"
242− id="linearGradient4226">
243− <stop
244− style="stop-color:#a73812;stop-opacity:1"
245− offset="0"
246− id="stop4228" />
247− <stop
248− style="stop-color:#973310;stop-opacity:0"
249− offset="1"
250− id="stop4230" />
251− </linearGradient>
252− <filter
253− inkscape:collect="always"
254− style="color-interpolation-filters:sRGB"
255− id="filter4234"
256− x="-0.096000001"
257− width="1.192"
258− y="-0.096000001"
259− height="1.192">
260− <feGaussianBlur
261− inkscape:collect="always"
262− stdDeviation="11.512321"
263− id="feGaussianBlur4236" />
264− </filter>
265− </defs>
266− <metadata
267− id="metadata3341">
268− <rdf:RDF>
269− <cc:Work
270− rdf:about="">
271− <dc:format>image/svg+xml</dc:format>
272− <dc:type
273− rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
274− <dc:title></dc:title>
275− </cc:Work>
276− </rdf:RDF>
277− </metadata>
278− <g
279− inkscape:groupmode="layer"
280− id="layer3"
281− inkscape:label="Background">
282− <path
283− style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:url(#linearGradient4209);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;enable-background:accumulate"
284− d="M 0 0 L 0 183.89844 L 0 328.10156 L 0 512 L 512 512 L 512 328.10156 L 512 183.89844 L 512 0 L 0 0 z "
285− id="rect4158" />
286− <path
287− style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:0.1;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:8;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;enable-background:accumulate"
288− d="M 0 256 L 0 328.10156 L 0 462.53516 C 0 479.69677 0.052846476 496.03174 0.13085938 512 L 511.86914 512 C 511.94715 496.03174 512 479.69677 512 462.53516 L 512 256 L 0 256 z "
289− id="rect4286" />
290− </g>
291− <g
292− inkscape:groupmode="layer"
293− id="layer1"
294− inkscape:label="Pictogram"
295− style="display:inline"
296− transform="translate(-32,-32)">
297− <circle
298− style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:0.4;fill:#d04616;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:7.99999952;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;filter:url(#filter4220);enable-background:accumulate"
299− id="circle4218"
300− cx="258"
301− cy="-256"
302− r="143.90401"
303− transform="rotate(90,-7.1132638e-7,31.999996)" />
304− <circle
305− transform="rotate(90,-7.1132638e-7,31.999996)"
306− r="143.90401"
307− cy="-256"
308− cx="258"
309− id="circle4224"
310− style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:1;fill:url(#linearGradient4232);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:7.99999952;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;filter:url(#filter4234);enable-background:accumulate" />
311− <circle
312− transform="rotate(90)"
313− r="143.90401"
314− cy="-288"
315− cx="288"
316− id="circle4206"
317− style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:7.99999952;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;enable-background:accumulate" />
318− <path
319− style="display:inline;fill:#ea5420;fill-opacity:1;stroke-width:2.9398191;enable-background:new"
320− id="path4258"
321− d="m 193.9963,269.54024 c -10.19878,0 -18.46137,8.2634 -18.46137,18.46139 0,10.19309 8.26259,18.45568 18.46137,18.45568 10.19311,0 18.45569,-8.26259 18.45569,-18.45568 0,-10.19799 -8.26258,-18.46139 -18.45569,-18.46139 z m 131.78525,83.88906 c -8.82832,5.09898 -11.85536,16.38129 -6.75557,25.20475 5.0933,8.82834 16.37561,11.85455 25.20393,6.75556 8.82752,-5.0933 11.85457,-16.37561 6.75559,-25.20475 -5.0933,-8.82263 -16.38212,-11.84887 -25.20395,-6.75556 z m -91.69319,-65.42767 c 0,-18.24028 9.05999,-34.35498 22.92309,-44.11321 l -13.49406,-22.6012 c -16.14883,10.79461 -28.16435,27.28971 -33.15766,46.60863 5.82648,4.75434 9.55584,11.99194 9.55584,20.10497 0,8.10813 -3.72936,15.34572 -9.55584,20.10006 4.98681,19.32463 17.00232,35.82055 33.15766,46.61514 l 13.49406,-22.60689 c -13.8631,-9.75253 -22.92309,-25.86641 -22.92309,-44.1075 z m 53.91207,-53.91776 c 28.16514,0 51.27274,21.59491 53.69828,49.13495 l 26.30048,-0.38772 c -1.29405,-20.33173 -10.17604,-38.58421 -23.82372,-52.00594 -7.01814,2.65149 -15.12464,2.2459 -22.13139,-1.79314 -7.01894,-4.0504 -11.41969,-10.88319 -12.62271,-18.30044 -6.8214,-1.88254 -14.00046,-2.91323 -21.42257,-2.91323 -12.75925,0 -24.82271,2.99695 -35.53359,8.29836 l 12.82509,22.98243 c 6.89944,-3.21075 14.5963,-5.01526 22.71013,-5.01526 z m 0,107.82982 c -8.11383,0 -15.81069,-1.80533 -22.70931,-5.01528 l -12.82511,22.98163 c 10.71088,5.3079 22.77434,8.30568 35.53442,8.30568 7.42211,0 14.60118,-1.0315 21.42177,-2.91975 1.20301,-7.41724 5.60537,-14.24352 12.6227,-18.30125 7.01161,-4.04555 15.11326,-4.44382 22.13137,-1.79232 13.64769,-13.42174 22.52968,-31.67421 23.82372,-52.00595 l -26.30696,-0.38772 c -2.41986,27.54738 -25.52665,49.13496 -53.6926,49.13496 z m 37.77461,-119.35113 c 8.82834,5.09818 20.11145,2.07845 25.20475,-6.74987 5.099,-8.82833 2.07928,-20.11145 -6.74988,-25.21126 -8.82832,-5.0933 -20.11063,-2.06705 -25.21125,6.76127 -5.09247,8.82345 -2.06625,20.10657 6.75638,25.19986 z"
322− inkscape:connector-curvature="0"
323− inkscape:transform-center-x="16.232534"
324− inkscape:transform-center-y="-0.0024900663" />
325− </g>
326−</svg>
data/unity8-dash.url-dispatcherdeleted−6
@@ -1,6 +0,0 @@
1−[
2− {
3− "protocol": "scope"
4− }
5−]
6−
data/unity8-greeter-wrapper+7−4
@@ -49,9 +49,12 @@ if which ubuntu-touch-session >/dev/null; then
4949 TOUCH_WRAPPER=ubuntu-touch-session
5050fi
5151
52−# Pretend that we're in an ubuntu-touch session, so that indicator-network
53−# will start.
54−export DESKTOP_SESSION=ubuntu-touch
52+# Advertise as a unity8 session, so that indicator-network will start.
53+export XDG_SESSION_DESKTOP=unity8
54+export DESKTOP_SESSION=$XDG_SESSION_DESKTOP
55+
56+set_greeter_var QT_IM_MODULE maliitphablet
57+set_greeter_var QT_QPA_PLATFORM ubuntumirclient
5558
5659# We disable ofono using pulse. It causes problems with racing with the user's
5760# pulse. We need to come up with a better long-term fix for this, because we
@@ -100,7 +103,7 @@ if [ "$(id -u phablet 2>/dev/null)" = "32011" ]; then
100103fi
101104
102105# And finally actually start the greeter
103−exec env QT_QPA_PLATFORM=ubuntumirclient MIR_SERVER_FILE=$SUB_SOCKET $TOUCH_WRAPPER $@ &
106+exec env MIR_SERVER_FILE=$SUB_SOCKET $TOUCH_WRAPPER $@ &
104107CMD_PID=$!
105108wait $CMD_PID
106109CMD_PID=
data/unity8.conf+2−1
@@ -2,6 +2,7 @@ description "Unity Shell v8"
22author "Ricardo Mendoza <ricmm@ubuntu.com>"
33
44emits indicator-services-start
5+emits indicator-services-end
56
67start on ((xsession SESSION=ubuntu-touch) or (xsession SESSION=unity8-mir) or (xsession SESSION=unity8)) and started dbus
78stop on desktop-end
@@ -59,7 +60,6 @@ pre-start script
5960 initctl set-env --global MIR_SERVER_PROMPT_FILE=1
6061
6162 # Disable Qt's stuttering 'touch compression' to fix scrolling smoothness
62−
6363 # issues (LP: #1486341, LP: #1556763). As a bonus, this eliminates most of
6464 # the lag seen in the indicator panel pull-down (LP: #1488327) and also
6565 # reduces lag seen in apps:
@@ -95,4 +95,5 @@ post-stop script
9595 initctl set-env --global MIR_SOCKET=$UNITY_MIR_SOCKET
9696 initctl unset-env --global MIR_SERVER_PROMPT_FILE
9797 initctl emit application-end
98+ initctl emit indicator-services-end
9899end script
debian/changelog+395−24
@@ -1,14 +1,4 @@
1−unity8 (8.17+ubports5) xenial; urgency=medium
2−
3− * Yet more papercuts in Wizard update interaction:
4− * It's not possible to skip the app update page while it's checking for
5− updates, so make it say "Please wait..." while checking
6− * Make Changelog page indicate that the next page is loading after the next
7− button has been clicked. This avoids skipping the app update page.
8−
9−-- Dalton Durst <dalton@ubports.com> Mon, 8 Oct 2018 13:32:13 -0500
10−
11−unity8 (8.17+ubports4) xenial; urgency=medium
1+unity8 (8.20+ubports) xenial; urgency=medium
122
133 * Replace dependency on ubuntu-wallpapers with ubports-wallpapers
144
@@ -16,29 +6,405 @@ unity8 (8.17+ubports4) xenial; urgency=medium
166
177unity8 (8.17+ubports3) xenial; urgency=medium
188
19− * Fix papercuts in Wizard update page interaction:
20− * Remove "Stop" button for app update check
21− * Make "not connected to internet" message more clear
9+ * Imported to UBports
2210
23− -- Dalton Durst <dalton@ubports.com> Fri, 28 Sep 2018 14:08:00 -0500
11+ -- UBports auto importer <infra@ubports.com> Mon, 31 Jul 2017 03:12:43 +0200
2412
25−unity8 (8.17+ubports2) xenial; urgency=medium
13+unity8 (8.15+17.04.20170404.7-0ubuntu2) zesty; urgency=medium
2614
27− * Fix for https://github.com/ubports/ubuntu-touch/issues/624
15+ [ Michael Zanetti ]
16+ * Make the default store uri point to gnome software center
2817
29− -- Dalton Durst <dalton@ubports.com> Fri, 1 Jun 2018 16:14:11 -0500
18+ -- Timo Jyrinki <timo-jyrinki@ubuntu.com> Thu, 06 Apr 2017 10:49:29 +0300
3019
31−unity8 (8.17+ubports1) UNRELEASED; urgency=medium
20+unity8 (8.15+17.04.20170404.7-0ubuntu1) zesty; urgency=medium
3221
33− * No change rebuild to generate sources in ubports repo
22+ [ Albert Astals Cid ]
23+ * Tweak app drawer a bit (LP: #1667570)
3424
35− -- Dan Chapman <dan@ubports.com> Tue, 20 Feb 2018 07:09:11 +0000
25+ [ Josh Arenson ]
26+ * Make some small changes to the greeter's session list
27+ * Handle a user in the greeter having never selected a session better
28+ (LP: #1673199)
3629
37−unity8 (8.16+ubports) xenial; urgency=medium
30+ [ Lukáš Tinkl ]
31+ * Do not occlude windows with an ongoing unmaximize transition (LP:
32+ #1666363)
33+ * Show and implement close buttons for child windows (LP: #1668053)
34+ * Sanitize the logic for pointer vs. touch menus, fixes hiding the
35+ window title in staged mode, when hovering the panel with mouse and
36+ no menus available.
3837
39− * Imported to UBports
38+ [ Michael Zanetti ]
39+ * Don't hide the launcher on super press if it's locked visible (LP:
40+ #1675373)
41+ * fix searchfield selection in drawer (LP: #1677259)
42+ * make sure the stage has focus when going to spread (LP: #1672053,
43+ #1672673, #1676995)
44+ * don't autostart the dash app, but show its .desktop file instead
4045
41− -- UBports auto importer <infra@ubports.com> Mon, 31 Jul 2017 03:12:43 +0200
46+ -- Michał Sawicz <michal.sawicz@canonical.com> Tue, 04 Apr 2017 22:56:06 +0000
47+
48+unity8 (8.15+17.04.20170328.3-0ubuntu1) zesty; urgency=medium
49+
50+ [ Albert Astals Cid ]
51+ * mock: Remove empty property and move invokable
52+ * Tune quicklist item selection
53+ * Fix unminimizing going to the wrong position the second time (LP:
54+ #1671458)
55+ * Remove unclickable gaps on the menubar (LP: #1672722)
56+ * indicators client is a tool
57+ * Make sure we destroy the popups when the item goes away (LP:
58+ #1670338)
59+ * UnityApplicationMocks: Initialize m_state and m_requestedState
60+ * Don't use appInfo after checking it if is null
61+ * Initialize m_privateMode
62+ * Hook up aboutToShow for overflow menus (LP: #1676016)
63+
64+ [ Daniel d'Andrada ]
65+ * Give active focus to child surface qml items (LP: #1671072)
66+ * Satellite child windows (LP: #1673415)
67+ * Tell qtmir/miral about the available desktop area
68+
69+ [ Florian Boucault ]
70+ * WindowStateStorage: use a private QThreadPool to ensure that
71+ WindowStateStorage::saveValue always has a thread available to
72+ execute the query in. (LP: #1675424)
73+
74+ [ Lukáš Tinkl ]
75+ * Protect against loading invalid window geometry (LP: #1674262)
76+ * Remove usage of the deprecated (and non-functional) system-image-
77+ dbus service.
78+ * Implement Ctrl+Alt+T to launch the terminal app (LP: #1673500)
79+ * Only take normal and dialog surface types into account for launcher
80+ items (LP: #1669047)
81+ * Fix the shutdown dialog after recent refactoring in
82+ DBusUnitySessionService (LP: #1676426)
83+
84+ [ Michael Zanetti ]
85+ * drop the grey background behind icons in the drawer (LP: #1675688)
86+
87+ [ Pete Woods ]
88+ * Fix Unity/Platform::isPC, and add tests (LP: #1670657)
89+
90+ -- Michał Sawicz <michal.sawicz@canonical.com> Tue, 28 Mar 2017 21:50:20 +0000
91+
92+unity8 (8.15+17.04.20170321-0ubuntu1) zesty; urgency=medium
93+
94+ [ Albert Astals Cid ]
95+ * Signal aboutToShow (LP: #1664578)
96+ * Support Panel top level items to be disabled (LP: #1670694)
97+ * Improve Launcher ←→ touch menu interaction (LP: #1667620, #1671069)
98+ * Fix real world submenus (e.g. kate) not getting their first item
99+ selected on open (LP: #1666859)
100+
101+ [ Daniel d'Andrada ]
102+ * Really disable the window decoration when in staged mode (LP:
103+ #1670361)
104+ * Don't let clients resize their surfaces while in staged
105+ (phone/tablet) mode (LP: #1670390)
106+ * TopLevelWindowModel: don't put hidden windows in the model (LP:
107+ #1665286)
108+
109+ [ Lukáš Tinkl ]
110+ * Reset always-show-osk gsetting on startup to default value (false
111+ atm)
112+ * Fix the restored-to position with Miral due to the state changes
113+ being async (LP: #1669819)
114+ * Add a cursor name fallback mapping "grabbing" -> "closedhand" for
115+ Breeze
116+ * Fix unsnapping a maximized window from the panel (LP: #1671721)
117+ * Disable altDrag feature outside windowed mode
118+
119+ [ Michael Terry ]
120+ * Don't lock the screen for guest users or users in the nopasswdlogin
121+ group. (LP: #1644237)
122+ * Support GNOME-style logout DBus API (making the Logout, Reboot, and
123+ Shutdown launcher commands work) (LP: #1673229)
124+
125+ [ Michael Zanetti ]
126+ * Add support for closing apps from the spread with "Q" (LP: #1670327)
127+ * hide "private" launcher quicklist entries when the greeter is locked
128+ (LP: #1667649)
129+ * add surface titles to launcher's quicklist (LP: #1661668)
130+ * properly reset the drawer state when cancelling a horizontal drag
131+ (LP: #1669536)
132+ * fix the focus moving correctly between launcher and drawer (LP:
133+ #1669880)
134+ * unfocus the drawer's textfield when it is moved (LP: #1669839)
135+
136+ [ Pete Woods ]
137+ * Fix up indicators-client after refactoring (LP: #1672797)
138+
139+ -- Michał Sawicz <michal.sawicz@canonical.com> Tue, 21 Mar 2017 10:58:13 +0000
140+
141+unity8 (8.15+17.04.20170308-0ubuntu1) zesty; urgency=medium
142+
143+ [ Albert Astals Cid ]
144+ * Let's follow the keyboard order
145+ * Enable the license check (LP: #1590044)
146+ * Show a barebones error message if loading the QML doesn't work
147+ * Make sure cursor is back to normal when closing the window (LP:
148+ #1666158)
149+ * Fix small warning when sensitive is undefined
150+ * Remove unused member variable
151+ * Initialize m_msecsSinceReference
152+ * Add warning if registerService fails
153+ * Move menus Component {} out of the repeater
154+ * Add tool to browse menus of a running app
155+
156+ [ Daniel d'Andrada ]
157+ * Drag child windows with Alt+LeftMouseButton (LP: #1664947)
158+
159+ [ Gerry Boland ]
160+ * TopLevelWindowModel: connect to the OSK surface to know when it goes
161+ away so we can clean up after it. (LP: #1670681)
162+
163+ [ Josh Arenson ]
164+ * Initialize sessionMode to single when mock is reset (LP: #1667463)
165+
166+ [ Lukáš Tinkl ]
167+ * Make the menu string "Back" translatable
168+ * Let the OSK be driven by a switch in indicator-keyboard (LP:
169+ #1521518)
170+ * Disable the tutorial when there's no touchscreen (LP: #1661557)
171+ * Shell chrome fixes (LP: #1658117, #1665723, #1665724, #1669010)
172+ * Cancel the drag as soon as we're entering the spread (LP: #1668642)
173+ * Fix being unable to use window control buttons or menus with touch
174+ (LP: #1667604, #1668387)
175+
176+ [ Michael Terry ]
177+ * Set QT_IM_MODULE in the greeter so that the OSK can come up. (LP:
178+ #1670383)
179+ * Simplify our startup handling of Mir environment variables and set
180+ the right socket path in snappy.
181+
182+ [ Michael Zanetti ]
183+ * Cancel the home key activation if something else is pressed along
184+ with Meta (LP: #1670678)
185+ * close the drawer when something is launched from the launcher (LP:
186+ #1660367)
187+ * use a svg instead of a png for the Launcher's BFB (LP: #1668057)
188+ * change the default setting for the launcher autohiding (LP:
189+ #1670655)
190+
191+ [ Nick Dedekind ]
192+ * Split up Shell::test_spreadDisabled to ensure initial state for each
193+ test.
194+
195+ -- Michał Sawicz <michal.sawicz@canonical.com> Wed, 08 Mar 2017 09:56:46 +0000
196+
197+unity8 (8.15+17.04.20170221-0ubuntu1) zesty; urgency=medium
198+
199+ * Handle ubuntu-app-launch API/ABI break
200+
201+ -- Ken VanDine <ken.vandine@canonical.com> Tue, 21 Feb 2017 13:23:23 +0000
202+
203+unity8 (8.15+17.04.20170216.1-0ubuntu1) zesty; urgency=medium
204+
205+ [ Albert Astals Cid ]
206+ * Make menus items close the menu when clicking on them (LP: #1657082,
207+ #1657399)
208+ * Clicking on an open menu closes it + test
209+ * Make the menus and submenus do not go outside the screen when
210+ popping out
211+ * Auto open submenus on hover (LP: #1657085)
212+ * Make the double click on a menu not be maximize the window below
213+ (LP: #1657079)
214+ * Make the MenuBar InverseMouseArea eat hover events when there's a
215+ popup open (LP: #1657763)
216+ * Make double click on the window decoration maximize (LP: #1657758)
217+ * Eat hover events when the launcher quicklist is open (LP: #1640776)
218+ * Remove TODO now that we require Qt > 5.5
219+ * Serialize two make targets that want to cp to the same target file
220+ (LP: #1660576)
221+ * Remove variable that is always false (LP: #1585910)
222+
223+ [ Daniel d'Andrada ]
224+ * Consolidate launcher API checks
225+
226+ [ Lukáš Tinkl ]
227+ * Fixes for activating minimized windows and restoring fullscreen ones
228+ (LP: #1656808, #1658937, #1658938)
229+
230+ [ Michael Zanetti ]
231+ * move right edge push area up some levels so it can be used on top of
232+ the indicators
233+ * fix minimizing/restoring transitions (LP: #1658936)
234+ * fix some glitches with spread positioning
235+ * fix jumpy animation when closing an item from the spread
236+ * Show the wallpaper while the focused app is moving in staged mode
237+ (LP: #1648251)
238+ * Update the tutorial to mention the app drawer instead of the dash on
239+ long left edge swipe (LP: #1658932)
240+ * prevent hiding the launcher when the mouse hover event is eaten by
241+ the EdgePushArea (LP: #1657045)
242+ * properly invalidate the whole model (LP: #1658190)
243+ * stabilize OrientedShell test (LP: #1658994)
244+
245+ [ Nick Dedekind ]
246+ * Added overflow support to application menus.
247+ * Updated menu colors
248+
249+ -- Michał Sawicz <michal.sawicz@canonical.com> Thu, 16 Feb 2017 13:49:18 +0000
250+
251+unity8 (8.15+17.04.20170206-0ubuntu1) zesty; urgency=medium
252+
253+ [ Daniel d'Andrada ]
254+ * Initial support for child windows (menus, dialogs, tooltips) (LP:
255+ #1543467, #1591384, #1656727)
256+
257+ -- Albert Astals Cid <albert.astals@canonical.com> Mon, 06 Feb 2017 09:12:23 +0000
258+
259+unity8 (8.15+17.04.20170131.1-0ubuntu1) zesty; urgency=medium
260+
261+ [ Rodney Dawes ]
262+ * Remove dependencies on clickscope.
263+
264+ -- Albert Astals Cid <albert.astals@canonical.com> Tue, 31 Jan 2017 14:40:33 +0000
265+
266+unity8 (8.15+17.04.20170124-0ubuntu1) zesty; urgency=medium
267+
268+ [ Albert Astals Cid ]
269+ * Limit tab-focus travelling on dialogs with a fence
270+ * Restore focus to where it was when our ShellDialogs get unloaded
271+ * Update current session after changing the user
272+ * Add keyboard navigation for Indicators
273+ * a window -> the current window
274+ * There's no spreadDelegate_ anymore
275+
276+ [ Daniel d'Andrada ]
277+ * Simplify DecoratedWindow
278+ * Remove unnecessary warning message
279+
280+ [ Josh Arenson ]
281+ * Add a test for the session chooser icon in the greeter's sessions
282+ list
283+
284+ [ Lukáš Tinkl ]
285+ * Fix keymap not being applied on the shell itself (LP: #1626435)
286+ * Shell dialog improvements (kbd focus, mouse eater)
287+ * Start searching directly as you type, w/o having to first
288+ focus/click the search field.
289+ * Add a test for the real implementation of WindowStateStorage
290+ * Use a four finger gesture to open the drawer, much like in u7
291+
292+ [ Michael Terry ]
293+ * Simplify the lightdm mock to make future greeter improvements easier
294+ to test.
295+ * Add support for guest sessions in unity8-greeter.
296+ * Use a model for PAM prompts, supporting more possible interactions.
297+ * Fix grouping of autopkg output and allow optionally passing
298+ arguments to installed test scripts.
299+ * Add support for LightDM hints for manual logins and hiding normal
300+ users.
301+
302+ [ Michael Zanetti ]
303+ * hint the launcher to indicate a successful size change to the user
304+ (LP: #1646457)
305+ * Improvements for the appdrawer (LP: #1648173)
306+ * Adjust home key to still focus the dash instead of messing with the
307+ drawer
308+ * allow 4 finger simulation with mousetouchadaptor
309+
310+ [ Nick Dedekind ]
311+ * Added Alt+F10 shortcut to open app menus. (LP: #1656896)
312+ * Fixed menu layout width calculations. (LP: #1657050)
313+ * Skip Panel::test_drag_indicator_item_down_shows_menu
314+
315+ -- Michał Sawicz <michal.sawicz@canonical.com> Tue, 24 Jan 2017 07:46:58 +0000
316+
317+unity8 (8.15+17.04.20170110.4-0ubuntu1) zesty; urgency=medium
318+
319+ [ Albert Astals Cid ]
320+ * Give focus to one of the buttons of the dialog
321+ * tst_WindowResizeArea: Use default values for mouseFlick speed and
322+ iterations (LP: #1651580)
323+ * Require Qt 5.6 & misc fixes
324+
325+ [ Daniel van Vugt ]
326+ * Deprecate usage of Mir's input resampling, instead opting for: (LP:
327+ #1497105, #1591328)
328+
329+ [ Josh Arenson ]
330+ * Allow the scopes list to automatically scroll when a scope is being
331+ dragged past the bounds of the screen. (LP: #1575319)
332+
333+ [ Lukáš Tinkl ]
334+ * Fix touch window controls being unreachable when the overlay is
335+ being displayed (LP: #1648167)
336+ * Fixup paths for window state storage in snappy environment
337+ * Add Unity.Platform mock for our tests (LP: #1655336)
338+
339+ [ Michael Zanetti ]
340+ * PreviewRatingInput: Use displayText instead of text to
341+ enable/disable the Send button (LP: #1595910)
342+ * Add a D-Bus interface to control some debug facilities on the fly
343+ * some launcher workarounds for the snapping
344+
345+ [ Michał Sawicz ]
346+ * Nuke leftover Platform in IndicatorsManager
347+
348+ [ Nick Dedekind ]
349+ * Added registry for application menus
350+
351+ [ Michael Terry, Nick Dedekind ]
352+ * Run the qmluitests.sh autopkg test against the installed package.
353+
354+ [ Michał Sawicz, Nick Dedekind ]
355+ * Application menus
356+
357+ [ Rodney Dawes ]
358+ * Remove the payments widget and dependency on libpay as no longer
359+ needed.
360+
361+ -- Michał Sawicz <michal.sawicz@canonical.com> Tue, 10 Jan 2017 14:48:42 +0000
362+
363+unity8 (8.15+17.04.20161215-0ubuntu2~1) zesty; urgency=medium
364+
365+ * No change rebuild
366+
367+ -- Timo Jyrinki <timo-jyrinki@ubuntu.com> Wed, 04 Jan 2017 10:54:32 +0200
368+
369+unity8 (8.15+17.04.20161215-0ubuntu1) zesty; urgency=medium
370+
371+ * Let the model deal with some window management decisions (LP:
372+ #1346633)
373+
374+ -- Daniel d'Andrada <daniel.dandrada@canonical.com> Thu, 15 Dec 2016 16:17:29 +0000
375+
376+unity8 (8.15+17.04.20161207.1-0ubuntu1) zesty; urgency=medium
377+
378+ [ Albert Astals Cid ]
379+ * Add the Wsuggest-override flag to gcc
380+ * Add support for compiler sanitizers via ECM
381+ * Use timeStep as delay time (LP: #1642919)
382+ * Bring back fix for 1517830 (LP: #1517830)
383+ * Fix compile warnings in mocks
384+ * Do not hide panel when launching an application if the mouse is on
385+ the panel (LP: #1591311)
386+
387+ [ Daniel d'Andrada ]
388+ * Fix "make tryApplicationWindow"
389+ * Take save/restore functions out of WindowResizeArea
390+
391+ [ Josh Arenson ]
392+ * Enable the greeter to remember which session the user last logged
393+ into (LP: #1631365)
394+
395+ [ Lukáš Tinkl ]
396+ * Fix the Super key not invoking the dash scope home (LP: #1607427)
397+
398+ [ Michael Zanetti ]
399+ * Add the ApplicationDrawer
400+ * tune right edge push (LP: #1646094)
401+ * improve close button visiblity when hovering with the mouse
402+ * Update virtual touchpad visuals and add a tutorial. (LP: #1585220)
403+
404+ [ Pete Woods ]
405+ * MenuItemFactory: Add subtitle support to SwitchItem widget
406+
407+ -- Michał Sawicz <michal.sawicz@canonical.com> Wed, 07 Dec 2016 13:49:24 +0000
42408
43409unity8 (8.15+17.04.20161129-0ubuntu1) zesty; urgency=medium
44410
@@ -7802,3 +8168,8 @@ qml-phone-shell (0.1) quantal; urgency=low
78028168 * Initial release
78038169
78048170 -- Bill Filler <bill.filler@canonical.com> Wed, 10 Oct 2012 10:19:53 -0400
8171+unity8 (8.15+17.04.20170404.7-0ubuntu2) zesty; urgency=medium
8172+
8173+ [ Michael Zanetti ]
8174+ * Make the default store uri point to gnome software center
8175+
debian/control+211−191
@@ -2,242 +2,261 @@ Source: unity8
22Section: x11
33Priority: optional
44Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
5−Build-Depends: android-headers,
6− cmake,
7− dbus-test-runner,
8− debhelper (>= 9),
9− dh-apparmor,
10− doxyqml,
11−# To allow cross-compiling to work, we also must append :native
12−# to g++ so we don't try to run arm g++
13−# on an x86 CPU for example, when cross-compiling.
14− g++:native,
15− graphviz,
16− gsettings-ubuntu-schemas (>= 0.0.2+14.10.20140815),
17− libandroid-properties-dev,
18− libconnectivity-qt1-dev (>= 0.7.1),
19− libevdev-dev,
20− libgeonames-dev (>= 0.2),
21− libgnome-desktop-3-dev,
22− libgl1-mesa-dev[!arm64 !armhf] | libgl-dev[!arm64 !armhf],
23− libgl1-mesa-dri,
24− libgles2-mesa-dev[arm64 armhf],
25− libglib2.0-dev,
26− libgsettings-qt-dev,
27− libhardware-dev,
28− liblightdm-qt5-3-dev,
29− libpam0g-dev,
30− libpulse-dev,
31− libqmenumodel-dev (>= 0.2.10),
32− libqt5svg5-dev,
33− libqt5xmlpatterns5-dev,
34− libsystemsettings-dev,
35− libubuntu-app-launch2-dev,
36− libubuntu-download-manager-common-dev,
37− libubuntugestures5-dev (>= 1.3.2030),
38− libubuntugestures5-private-dev (>= 1.3.2030),
39− libudev-dev,
40− libudm-common-dev,
41− libunity-api-dev (>= 7.120),
42− libusermetricsoutput1-dev,
43−# Need those X11 libs touch emulation from mouse events in manual QML tests on a X11 desktop
44− libx11-dev[!arm64 !armhf],
45− libxcb1-dev[!arm64 !armhf],
46− libxi-dev[!arm64 !armhf],
47−# End of X11 libs
48− pkg-config,
49− python3-all:any,
50− python3-setuptools,
51− qml-module-qt-labs-folderlistmodel,
52− qml-module-qtqml-statemachine,
53− qml-module-qtmultimedia (>= 5.4.1-1ubuntu19~overlay2),
54− qml-module-qtquick-layouts,
55− qml-module-qtquick-xmllistmodel,
56− qml-module-qtquick2,
57− qml-module-qtsysteminfo,
58− qml-module-qttest,
59− qml-module-ubuntu-components (>= 1.3.2030) | qml-module-ubuntu-components-gles (>= 1.3.2030),
60− qt5-default,
61− qtbase5-dev (>= 5.4),
62− qtbase5-dev-tools,
63− qtbase5-private-dev (>= 5.4),
64− qtdeclarative5-dev (>= 5.4),
65− qtdeclarative5-dev-tools,
66− qtdeclarative5-private-dev (>= 5.4),
67− qtdeclarative5-ubuntu-content1,
68− qtdeclarative5-ubuntu-settings-components (>= 0.11),
69− ttf-ubuntu-font-family,
5+Build-Depends:
6+ android-headers,
7+ cmake,
8+ cmake-extras,
9+ dbus-test-runner,
10+ debhelper (>= 9),
11+ dh-apparmor,
12+ doxyqml,
13+ g++:native,
14+ gdb,
15+ graphviz,
16+ gsettings-ubuntu-schemas (>= 0.0.2+14.10.20140815),
17+ libandroid-properties-dev,
18+ libconnectivity-qt1-dev (>= 0.7.1),
19+ libevdev-dev,
20+ libgeonames-dev (>= 0.2),
21+ libgl1-mesa-dev[!arm64 !armhf] | libgl-dev[!arm64 !armhf],
22+ libgl1-mesa-dri,
23+ libgles2-mesa-dev[arm64 armhf],
24+ libglib2.0-dev,
25+ libgnome-desktop-3-dev,
26+ libgsettings-qt-dev,
27+ libhardware-dev,
28+ liblightdm-qt5-3-dev,
29+ libpam0g-dev,
30+ libpulse-dev,
31+ libqmenumodel-dev (>= 0.2.12),
32+ libqt5sql5-sqlite,
33+ libqt5svg5-dev,
34+ libqt5xmlpatterns5-dev,
35+ libqtdbusmock1-dev (>= 0.7),
36+ libqtdbustest1-dev,
37+ libsystemsettings-dev,
38+ libubuntu-app-launch2-dev,
39+ libubuntu-download-manager-common-dev,
40+ libubuntugestures5-dev (>= 1.3.2030),
41+ libubuntugestures5-private-dev (>= 1.3.2030),
42+ libudev-dev,
43+ libudm-common-dev,
44+ libunity-api-dev (>= 8.7),
45+ libusermetricsoutput1-dev,
46+ libx11-dev[!arm64 !armhf],
47+ libxcb1-dev[!arm64 !armhf],
48+ libxi-dev[!arm64 !armhf],
49+ pkg-config,
50+ python3-all:any,
51+ python3-setuptools,
52+ qml-module-qt-labs-folderlistmodel,
53+ qml-module-qt-labs-settings,
54+ qml-module-qtmultimedia (>= 5.6),
55+ qml-module-qtqml-statemachine,
56+ qml-module-qtquick-layouts,
57+ qml-module-qtquick-xmllistmodel,
58+ qml-module-qtquick2,
59+ qml-module-qtsysteminfo,
60+ qml-module-qttest,
61+ qml-module-ubuntu-components (>= 1.3.2030) | qml-module-ubuntu-components-gles (>= 1.3.2030),
62+ qml-module-ubuntu-layouts,
63+ qml-module-ubuntu-settings-components,
64+ qml-module-ubuntu-test,
65+ qtbase5-dev (>= 5.6),
66+ qtbase5-dev-tools,
67+ qtbase5-private-dev (>= 5.6),
68+ qtdbustest-runner,
69+ qtdeclarative5-dev (>= 5.6),
70+ qtdeclarative5-dev-tools,
71+ qtdeclarative5-private-dev (>= 5.6),
72+ qtdeclarative5-ubuntu-content1,
73+ ttf-ubuntu-font-family,
74+ ubports-wallpapers,
75+ xvfb,
7076Standards-Version: 3.9.4
71−Homepage: http://launchpad.net/unity
72−# If you aren't a member of ~unity-team but need to upload
73−# packaging changes, just go ahead. ~unity-team will notice
74−# and sync up the code again.
75−Vcs-Bzr: https://code.launchpad.net/unity8
76−Vcs-Browser: https://bazaar.launchpad.net/~unity-team/unity8/trunk
77+Homepage: https://github.com/ubports/unity8
78+Vcs-Git: https://github.com/ubports/unity8
7779XS-Testsuite: autopkgtest
7880X-Ubuntu-Use-Langpack: yes
7981
8082Package: indicators-client
8183Architecture: any
82−Depends: qmenumodel-qml (>= 0.2.10),
83− qml-module-ubuntu-components (>= 1.3.2030) | qml-module-ubuntu-components-gles (>= 1.3.2030),
84− unity8 (= ${binary:Version}),
85− ${misc:Depends},
86− ${shlibs:Depends},
84+Depends:
85+ qmenumodel-qml (>= 0.2.11),
86+ qml-module-ubuntu-components (>= 1.3.2030) | qml-module-ubuntu-components-gles (>= 1.3.2030),
87+ unity8 (= ${binary:Version}),
88+ ${misc:Depends},
89+ ${shlibs:Depends},
8790Description: Indicators client test application
8891 This package contains the client application for indicators used by autopilot
8992
9093Package: unity8-greeter
9194Architecture: any
92−Depends: unity8 (= ${binary:Version}),
93− unity-system-compositor,
94− ${misc:Depends},
95− ${shlibs:Depends}
96−Recommends: lightdm
97−Provides: lightdm-greeter
95+Depends:
96+ unity-system-compositor,
97+ unity8 (= ${binary:Version}),
98+ ${misc:Depends},
99+ ${shlibs:Depends},
100+Recommends:
101+ lightdm,
102+Provides:
103+ lightdm-greeter,
98104Description: The Unity8 Greeter
99105 The Unity 8 greeter is the primary login greeter for Ubuntu devices.
100106
101−Package: unity-scope-tool
102−Architecture: any
103−Depends: unity8-common (= ${source:Version}),
104− unity8-private (= ${binary:Version}),
105− ${misc:Depends},
106− ${shlibs:Depends},
107−# We do call pkg-config libunity-scopes from the code
108− pkg-config,
109− libunity-scopes-dev,
110−Description: Development tool for Unity scopes
111− This package contains the development tool for new generation Unity scopes, based
112− on Unity8.
113−
114107Package: unity8
115108Architecture: any
116−Provides: indicator-renderer,
117−Depends: dmz-cursor-theme,
118− gsettings-desktop-schemas,
119− libcap2-bin,
120− libglib2.0-bin,
121− qmenumodel-qml (>= 0.2.10),
122− qml-module-biometryd,
123− qml-module-qt-labs-folderlistmodel,
124− qml-module-qtqml-statemachine,
125− qml-module-qtquick-xmllistmodel,
126− qml-module-qtsysteminfo,
127− qtdeclarative5-qtmir-plugin (>= 0.4.8),
128− qtdeclarative5-ubuntu-telephony0.1,
129− ubuntu-system-settings (>= 0.4),
130− unity-launcher-impl-10,
131− unity8-common (= ${source:Version}),
132− unity8-private (= ${binary:Version}),
133− unity8-private | unity-launcher-impl,
134− ${misc:Depends},
135− ${shlibs:Depends},
136−Recommends: indicator-keyboard,
137− indicator-session,
138− unity-greeter-session-broadcast,
139− unity-scope-click,
140−Suggests: unity-scope-mediascanner2,
141−Breaks: indicator-network (<< 0.5.1+14.10.20141014),
142− ubuntu-touch-session (<< 0.107),
143− unity8-greeter (<< 7.89),
144− ubuntu-keyboard (<< 0.100),
145−Replaces: ubuntu-touch-session (<< 0.82~),
146− unity8-greeter (<< 7.89),
147−Conflicts: ubuntu-system-settings-wizard,
109+Provides:
110+ indicator-renderer,
111+Depends:
112+ dmz-cursor-theme,
113+ gsettings-desktop-schemas,
114+ libcap2-bin,
115+ libglib2.0-bin,
116+ qmenumodel-qml (>= 0.2.11),
117+ qml-module-biometryd,
118+ qml-module-qt-labs-folderlistmodel,
119+ qml-module-qt-labs-settings,
120+ qml-module-qtqml-statemachine,
121+ qml-module-qtquick-xmllistmodel,
122+ qml-module-qtsysteminfo,
123+ qtdeclarative5-qtmir-plugin (>= 0.4.8),
124+ qtdeclarative5-ubuntu-telephony0.1,
125+ ubuntu-system-settings (>= 0.4),
126+ unity-launcher-impl-13,
127+ unity8-common (= ${source:Version}),
128+ unity8-private (= ${binary:Version}),
129+ unity8-private | unity-launcher-impl,
130+ ${misc:Depends},
131+ ${shlibs:Depends},
132+Recommends:
133+ indicator-keyboard,
134+ indicator-session,
135+ unity-greeter-session-broadcast,
136+Breaks:
137+ indicator-network (<< 0.5.1+14.10.20141014),
138+ ubuntu-keyboard (<< 0.100),
139+ ubuntu-touch-session (<< 0.107),
140+ unity-scope-tool,
141+ unity8-greeter (<< 7.89),
142+Replaces:
143+ ubuntu-touch-session (<< 0.82~),
144+ unity-scope-tool,
145+ unity8-greeter (<< 7.89),
146+Conflicts:
147+ ubuntu-system-settings-wizard,
148148Description: Unity 8 shell
149149 The Unity 8 shell is the primary user interface for Ubuntu devices.
150150
151151Package: unity8-common
152152Architecture: all
153−Depends: qml-module-qtquick-layouts,
154− qml-module-ubuntu-components (>= 1.3.2030) | qml-module-ubuntu-components-gles (>= 1.3.2030),
155− qml-module-ubuntu-thumbnailer0.1 | ubuntu-thumbnailer-impl,
156− qtdeclarative5-ubuntu-settings-components (>= 0.11),
157− qtdeclarative5-unity-notifications-plugin (>= 0.1.2) | unity-notifications-impl,
158− qttranslations5-l10n,
159− ubuntu-thumbnailer-impl-0,
160− ubports-wallpapers,
161− unity-application-impl-22,
162− unity-notifications-impl-3,
163− unity-plugin-scopes | unity-scopes-impl,
164− unity-scopes-impl-12,
165− unity8-fake-env | unity-application-impl,
166− unity8-schemas,
167− ${misc:Depends},
168−Breaks: unity8 (<< 7.86),
169−Replaces: unity8 (<< 7.86),
153+Depends:
154+ qml-module-qtquick-layouts,
155+ qml-module-ubuntu-components (>= 1.3.2030) | qml-module-ubuntu-components-gles (>= 1.3.2030),
156+ qml-module-ubuntu-settings-components,
157+ qml-module-ubuntu-thumbnailer0.1 | ubuntu-thumbnailer-impl,
158+ qtdeclarative5-unity-notifications-plugin (>= 0.1.2) | unity-notifications-impl,
159+ qttranslations5-l10n,
160+ ubuntu-thumbnailer-impl-0,
161+ unity-application-impl-27,
162+ unity-notifications-impl-3,
163+ unity8-schemas,
164+ unity8-tests | unity-application-impl,
165+ ${misc:Depends},
166+Breaks:
167+ unity8 (<< 7.86),
168+Replaces:
169+ unity8 (<< 7.86),
170170Description: Unity 8 shell (common files)
171171 The Unity 8 shell is the primary user interface for Ubuntu devices.
172172 .
173− This package contains the QML, graphics and locale files shared between
174− unity8 and unity-scope-tool.
173+ This package contains the QML, graphics and locale files for unity8.
175174
176175Package: unity8-autopilot
177176Architecture: all
178−Depends: autopilot-qt5 (>= 1.4),
179− gir1.2-glib-2.0,
180− gir1.2-notify-0.7,
181− libqt5test5,
182− libqt5widgets5,
183− ofono-phonesim,
184− python3-autopilot,
185− python3-evdev,
186− python3-fixtures,
187− python3-gi,
188− qttestability-autopilot (>= 1.4),
189− ubuntu-ui-toolkit-autopilot (>= 1.3.2030),
190− unity-scope-click,
191− unity8 (= ${source:Version}),
192− unity8-fake-env (= ${source:Version}),
193− url-dispatcher-tools,
194− xvfb,
195− ${misc:Depends},
196− ${python3:Depends},
197− ${shlibs:Depends},
177+Depends:
178+ autopilot-qt5 (>= 1.4),
179+ gir1.2-glib-2.0,
180+ gir1.2-notify-0.7,
181+ libqt5test5,
182+ libqt5widgets5,
183+ ofono-phonesim,
184+ python3-autopilot,
185+ python3-evdev,
186+ python3-fixtures,
187+ python3-gi,
188+ qttestability-autopilot (>= 1.4),
189+ ubuntu-ui-toolkit-autopilot (>= 1.3.2030),
190+ unity8 (= ${source:Version}),
191+ unity8-tests (= ${source:Version}),
192+ url-dispatcher-tools,
193+ xvfb,
194+ ${misc:Depends},
195+ ${python3:Depends},
198196Description: Test package for Unity 8 shell
199197 Autopilot tests for the unity8 package
200198
201−Package: unity8-fake-env
199+Package: unity8-tests
202200Architecture: any
203201Multi-Arch: same
204−Pre-Depends: ${misc:Pre-Depends},
205−Depends: ${misc:Depends},
206− ${shlibs:Depends},
207−Provides: unity-application-impl,
208− unity-application-impl-22,
209−Replaces: unity8-autopilot (<< 8.02+15.04.20150422-0ubuntu1)
210−Description: Fake environment for running Unity 8 shell
202+Pre-Depends:
203+ ${misc:Pre-Depends},
204+Depends:
205+ dbus-test-runner,
206+ parallel,
207+ qt5-default,
208+ qtdbustest-runner,
209+ qtdeclarative5-dev-tools,
210+ unity8 (= ${source:Version}),
211+ xvfb,
212+ ${misc:Depends},
213+ ${shlibs:Depends},
214+Provides:
215+ unity-application-impl,
216+ unity-application-impl-27,
217+ unity8-fake-env,
218+Replaces:
219+ unity8-autopilot (<< 8.02+15.04.20150422-0ubuntu1),
220+ unity8-fake-env,
221+Conflicts:
222+ unity8-fake-env,
223+Description: Scripts and mocks for running Unity 8 shell tests
211224 Provides fake implementations of some QML modules used by Unity 8 shell
212− (e.g Ubuntu.Application) so that you can run it in a sandboxed environment.
225+ (e.g Ubuntu.Application) so that you can run it in a sandboxed environment
226+ and scripts to run its test suite.
213227
214228Package: unity8-private
215229Architecture: any
216230Multi-Arch: same
217−Pre-Depends: ${misc:Pre-Depends},
218−Depends: accountsservice-ubuntu-schemas (>= 0.0.7),
219− gsettings-ubuntu-schemas (>= 0.0.2+14.10.20140815),
220− libhardware2,
221− unity8-schemas,
222− qtdeclarative5-gsettings1.0,
223− qml-module-qtmultimedia,
224− ${misc:Depends},
225− ${shlibs:Depends},
226−Provides: unity-launcher-impl,
227− unity-launcher-impl-10,
231+Pre-Depends:
232+ ${misc:Pre-Depends},
233+Depends:
234+ accountsservice-ubuntu-schemas (>= 0.0.7),
235+ gsettings-ubuntu-schemas (>= 0.0.2+14.10.20140815),
236+ libhardware2,
237+ qml-module-qtmultimedia,
238+ qtdeclarative5-gsettings1.0,
239+ unity8-schemas,
240+ ${misc:Depends},
241+ ${shlibs:Depends},
242+Provides:
243+ unity-launcher-impl,
244+ unity-launcher-impl-13,
228245Description: Unity 8 private libs
229246 The Unity 8 shell is the primary user interface for Ubuntu devices.
230247 .
231248 This package contains the private libraries for QML and other components
232249 only used by the shell.
233250
234−
235251Package: unity8-schemas
236252Architecture: all
237253Multi-Arch: foreign
238−Depends: ${misc:Depends},
239−Replaces: unity-schemas (>= 7.3.1+14.10.20140915),
240−Breaks: unity-schemas (>= 7.3.1+14.10.20140915),
254+Depends:
255+ ${misc:Depends},
256+Replaces:
257+ unity-schemas (>= 7.3.1+14.10.20140915),
258+Breaks:
259+ unity-schemas (>= 7.3.1+14.10.20140915),
241260Description: Unity 8 schemas
242261 The Unity 8 shell is the primary user interface for Ubuntu devices.
243262 .
@@ -247,6 +266,7 @@ Package: unity8-doc
247266Section: doc
248267Architecture: all
249268Multi-Arch: foreign
250−Depends: ${misc:Depends},
269+Depends:
270+ ${misc:Depends},
251271Description: Documentation for Unity8
252272 The Unity 8 shell is the primary user interface for Ubuntu devices. (documentation)
debian/rules+21−7
@@ -7,6 +7,12 @@ include /usr/share/dpkg/default.mk
77#export DH_VERBOSE=1
88export DPKG_GENSYMBOLS_CHECK_LEVEL=4
99export NO_PNG_PKG_MANGLE=1
10+export QT_SELECT=qt5
11+
12+DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
13+
14+# Skip tests on the archs they are known to be flaky with current configuration
15+testskip_architectures := arm64 powerpc ppc64el s390x
1016
1117%:
1218 dh $@ --parallel --fail-missing --with python3
@@ -18,7 +24,19 @@ override_dh_auto_configure:
1824
1925override_dh_auto_build:
2026 # doc is not a default target
21− dh_auto_build -- all doc
27+ dh_auto_build -- -O all doc
28+
29+override_dh_auto_test:
30+ # Run the entire test battery
31+ # Parallel tests have a risk of starting xvfb on the same DISPLAY multiple times,
32+ # causing the whole battery to fail.
33+ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
34+ifneq (,$(filter $(DEB_HOST_ARCH),$(testskip_architectures)))
35+ -dh_auto_test --no-parallel -- -O -k xvfballtests
36+else
37+ dh_auto_test --no-parallel -- -O -k xvfballtests
38+endif
39+endif
2240
2341override_dh_install:
2442 # install autopilot tests
@@ -29,15 +47,11 @@ override_dh_install:
2947 cd $(CURDIR)
3048 dh_install -X'*.pyc' --fail-missing
3149
32−override_dh_installdeb:
33− dh_apparmor --profile-name=usr.bin.unity8-dash -punity8-dash
34− dh_installdeb
35−
3650# use private lib directories
3751override_dh_makeshlibs:
38− dh_makeshlibs -Nunity8-private -Nunity8-fake-env
52+ dh_makeshlibs -Nunity8-private -Nunity8-tests
3953
4054override_dh_shlibdeps:
4155 # Some mock libraries link against liblightdm-qt5-3.so which we want to
4256 # avoid, since we only really link against our mock one, not the system one.
43− dh_shlibdeps -XlibMockLightDM-qml.so -XlibMockAccountsService-qml.so
57+ dh_shlibdeps -XlibMockAccountsService-qml.so -Lunity8-private
debian/shlibs.localnew file+1
@@ -0,0 +1 @@
1+libunity8-private 0 unity8-private
debian/tests/control+5−4
@@ -1,10 +1,11 @@
11Tests: qmluitests.sh
22Restrictions: allow-stderr
3−Depends: @,
4− @builddeps@,
5− xvfb,
3+Depends:
4+ dpkg-dev,
5+ unity8-tests,
66
77Tests: autopilot.sh
88Restrictions: allow-stderr,
99 isolation-machine,
10−Depends: unity8-autopilot,
10+Depends:
11+ unity8-autopilot,
debian/tests/qmluitests.sh+4−14
@@ -1,21 +1,11 @@
11#!/bin/sh
2+# -*- Mode: sh; indent-tabs-mode: nil; tab-width: 4 -*-
23
34# log all commands and abort on error
45set -xe
56
6−SHELL_QML_PATH=$(pkg-config --variable=plugindir unity-shell-api)
7−UNITY_SOURCE_DIR=$(readlink -f $(dirname $(readlink -f $0))/../..)
7+DEB_HOST_MULTIARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH)
88
9−dh_auto_configure -- -DCMAKE_INSTALL_LOCALSTATEDIR="/var" \
10− -DARTIFACTS_DIR=${ADT_ARTIFACTS} \
11− -DUNITY_PLUGINPATH=${SHELL_QML_PATH} \
12− -DUNITY_MOCKPATH=${SHELL_QML_PATH}/mocks
13−dh_auto_build --parallel -- -C tests/mocks
14−dh_auto_build --parallel -- -C tests/plugins
15−dh_auto_build --parallel -- -C tests/qmltests
16−dh_auto_build --parallel -- -C tests/uqmlscene
17−dh_auto_build --parallel -- -C tests/utils
9+export ARTIFACTS_DIR="${ADT_ARTIFACTS}"
1810
19−export UNITY_SOURCE_DIR
20−
21−dh_auto_build --parallel -- -k xvfballtests
11+/usr/lib/$DEB_HOST_MULTIARCH/unity8/tests/scripts/xvfballtests.sh
debian/unity-scope-tool.installdeleted−2
@@ -1,2 +0,0 @@
1−usr/bin/unity-scope-tool
2−usr/share/unity8/ScopeTool.qml
debian/unity8-common.install−1
@@ -1,6 +1,5 @@
11usr/share/locale
22usr/share/unity8/Components
3−usr/share/unity8/Dash
43usr/share/unity8/Notifications
54usr/share/unity8/graphics
65var/lib/polkit-1/localauthority/10-vendor.d
debian/unity8-greeter.install+1−1
@@ -1,5 +1,5 @@
1−data/unity8-greeter-wrapper usr/bin/
21data/unity8-greeter-init.conf usr/share/upstart/sessions/
2+data/unity8-greeter-wrapper usr/bin/
33data/unity8-greeter.pkla /var/lib/polkit-1/localauthority/10-vendor.d/
44usr/share/lightdm/greeters/unity8-greeter.desktop
55usr/share/lightdm/lightdm.conf.d/51-unity8-greeter.conf
debian/unity8-private.install+1−3
@@ -1,18 +1,16 @@
11usr/lib/*/libunity8-private.*
22usr/lib/*/unity8/qml/AccountsService
33usr/lib/*/unity8/qml/Cursor
4−usr/lib/*/unity8/qml/Dash
54usr/lib/*/unity8/qml/GlobalShortcut
65usr/lib/*/unity8/qml/Greeter
7−usr/lib/*/unity8/qml/ImageCache
86usr/lib/*/unity8/qml/LightDM
97usr/lib/*/unity8/qml/Lights
108usr/lib/*/unity8/qml/Powerd
119usr/lib/*/unity8/qml/ScreenshotDirectory
1210usr/lib/*/unity8/qml/SessionBroadcast
11+usr/lib/*/unity8/qml/UInput
1312usr/lib/*/unity8/qml/Ubuntu
1413usr/lib/*/unity8/qml/Unity
15−usr/lib/*/unity8/qml/UInput
1614usr/lib/*/unity8/qml/Utils
1715usr/lib/*/unity8/qml/WindowManager
1816usr/lib/*/unity8/qml/Wizard
debian/unity8-fake-env.install → debian/unity8-tests.installrenamed+4−1
@@ -2,5 +2,8 @@ data/unity-mock-indicator-service.conf usr/share/upstart/sessions/
22usr/bin/unity-mock-indicator-service
33usr/lib/*/unity8/qml/mocks
44usr/lib/*/unity8/qml/nonmirplugins
5−usr/lib/*/unity8/qml/scopefakes
5+usr/lib/*/unity8/qml/utils
6+usr/lib/*/unity8/tests
7+usr/lib/*/unity8/uqmlscene
68usr/share/unity8/mocks
9+usr/share/unity8/tests
debian/unity8-tests.lintian-overridesnew file+1
@@ -0,0 +1 @@
1+unity8-tests: unusual-interpreter usr/lib/*/unity8/tests/scripts/*.sh #!/usr/bin/parallel
debian/unity8.install+7−11
@@ -1,23 +1,19 @@
1−debian/usr.bin.unity8-dash etc/apparmor.d
2−var/lib/unity8/version
3−data/unity8-dash.conf usr/share/upstart/sessions/
4−data/unity8-filewatcher.conf usr/share/upstart/sessions/
5−data/unity8.conf usr/share/upstart/sessions/
61data/devices.conf etc/ubuntu/
72data/test.sensors etc/ubuntusensors/
3+data/unity8-filewatcher.conf usr/share/upstart/sessions/
4+data/unity8.conf usr/share/upstart/sessions/
85usr/bin/unity8
9−usr/bin/unity8-dash
10−usr/share/applications/unity8-dash.desktop
116usr/share/applications/unity8.desktop
7+usr/share/unity8/ApplicationMenus
8+usr/share/unity8/DeviceConfiguration.qml
9+usr/share/unity8/DisabledScreenNotice.qml
1210usr/share/unity8/Greeter
1311usr/share/unity8/Launcher
12+usr/share/unity8/OrientedShell.qml
1413usr/share/unity8/Panel
1514usr/share/unity8/Rotation
16−usr/share/unity8/DeviceConfiguration.qml
17−usr/share/unity8/OrientedShell.qml
18−usr/share/unity8/DisabledScreenNotice.qml
1915usr/share/unity8/Shell.qml
2016usr/share/unity8/Stage
2117usr/share/unity8/Tutorial
2218usr/share/unity8/Wizard
23−usr/share/url-dispatcher/urls/unity8-dash.url-dispatcher
19+var/lib/unity8/version
debian/usr.bin.unity8-dashdeleted−21
@@ -1,21 +0,0 @@
1−# vim:syntax=apparmor
2−
3−#include <tunables/global>
4−
5−# v2 compatible wildly permissive profile
6−profile unity8-dash /usr/bin/unity8-dash (attach_disconnected) {
7− capability,
8− network,
9− / rwkl,
10− /** rwlkm,
11− /** pix,
12−
13− mount,
14− remount,
15− umount,
16− pivot_root,
17− dbus,
18− signal,
19− ptrace,
20− unix,
21−}
include/paths.h.in+26−1
@@ -41,7 +41,10 @@ inline QString installRoot() {
4141}
4242
4343inline bool isRunningInstalled() {
44− return !installRoot().isNull();
44+ // Tests don't use the normal binary, so we want to check binary *and*
45+ // the environment. Installed tests have UNITY_TESTING_DATADIR set.
46+ static bool installed_test_env = !qgetenv("UNITY_TESTING_DATADIR").isEmpty();
47+ return !installRoot().isNull() || installed_test_env;
4548}
4649
4750inline QString buildDirectory() {
@@ -62,6 +65,28 @@ inline QString translationDirectory() {
6265 }
6366}
6467
68+inline QString testDataDir() {
69+ // Can't use isRunningInstalled, since tests don't use the normal unity8
70+ // executable. $UNITY_TESTING_DATADIR is set by installed tests.
71+ QString datadir(qgetenv("UNITY_TESTING_DATADIR"));
72+ if (datadir.isEmpty()) {
73+ return sourceDirectory() + "/tests";
74+ } else {
75+ return datadir + "/tests";
76+ }
77+}
78+
79+inline QString testLibDir() {
80+ // Can't use isRunningInstalled, since tests don't use the normal unity8
81+ // executable. $UNITY_TESTING_DATADIR is set by installed tests.
82+ QString libdir(qgetenv("UNITY_TESTING_LIBDIR"));
83+ if (libdir.isEmpty()) {
84+ return buildDirectory() + "/tests";
85+ } else {
86+ return libdir + "/tests";
87+ }
88+}
89+
6590inline QString qmlDirectory() {
6691 if (isRunningInstalled()) {
6792 return installRoot() + QStringLiteral("@CMAKE_INSTALL_PREFIX@/@SHELL_APP_DIR@/");
plugins/AccountsService/AccountsService.cpp+1−30
@@ -25,7 +25,6 @@
2525#include <glib.h>
2626
2727#define IFACE_ACCOUNTS_USER QStringLiteral("org.freedesktop.Accounts.User")
28−#define IFACE_LOCATION_HERE QStringLiteral("com.ubuntu.location.providers.here.AccountsService")
2928#define IFACE_UBUNTU_INPUT QStringLiteral("com.ubuntu.AccountsService.Input")
3029#define IFACE_UBUNTU_SECURITY QStringLiteral("com.ubuntu.AccountsService.SecurityPrivacy")
3130#define IFACE_UBUNTU_SECURITY_OLD QStringLiteral("com.ubuntu.touch.AccountsService.SecurityPrivacy")
@@ -33,7 +32,7 @@
3332#define IFACE_UNITY_PRIVATE QStringLiteral("com.canonical.unity.AccountsService.Private")
3433
3534#define PROP_BACKGROUND_FILE QStringLiteral("BackgroundFile")
36−#define PROP_DEMO_EDGES QStringLiteral("demo-edges")
35+#define PROP_DEMO_EDGES QStringLiteral("DemoEdges2")
3736#define PROP_DEMO_EDGES_COMPLETED QStringLiteral("DemoEdgesCompleted")
3837#define PROP_EMAIL QStringLiteral("Email")
3938#define PROP_ENABLE_FINGERPRINT_IDENTIFICATION QStringLiteral("EnableFingerprintIdentification")
@@ -93,8 +92,6 @@ AccountsService::AccountsService(QObject* parent, const QString &user)
9392 registerProperty(IFACE_ACCOUNTS_USER, PROP_EMAIL, QStringLiteral("emailChanged"));
9493 registerProperty(IFACE_ACCOUNTS_USER, PROP_REAL_NAME, QStringLiteral("realNameChanged"));
9594 registerProperty(IFACE_ACCOUNTS_USER, PROP_INPUT_SOURCES, QStringLiteral("keymapsChanged"));
96− registerProperty(IFACE_LOCATION_HERE, PROP_LICENSE_ACCEPTED, QStringLiteral("hereEnabledChanged"));
97− registerProperty(IFACE_LOCATION_HERE, PROP_LICENSE_BASE_PATH, QStringLiteral("hereLicensePathChanged"));
9895 registerProperty(IFACE_UBUNTU_SECURITY, PROP_ENABLE_FINGERPRINT_IDENTIFICATION, QStringLiteral("enableFingerprintIdentificationChanged"));
9996 registerProperty(IFACE_UBUNTU_SECURITY, PROP_ENABLE_LAUNCHER_WHILE_LOCKED, QStringLiteral("enableLauncherWhileLockedChanged"));
10097 registerProperty(IFACE_UBUNTU_SECURITY, PROP_ENABLE_INDICATORS_WHILE_LOCKED, QStringLiteral("enableIndicatorsWhileLockedChanged"));
@@ -216,32 +213,6 @@ AccountsService::PasswordDisplayHint AccountsService::passwordDisplayHint() cons
216213 return (PasswordDisplayHint)value.toInt();
217214}
218215
219−bool AccountsService::hereEnabled() const
220−{
221− auto value = getProperty(IFACE_LOCATION_HERE, PROP_LICENSE_ACCEPTED);
222− return value.toBool();
223−}
224−
225−void AccountsService::setHereEnabled(bool enabled)
226−{
227− setProperty(IFACE_LOCATION_HERE, PROP_LICENSE_ACCEPTED, enabled);
228−}
229−
230−QString AccountsService::hereLicensePath() const
231−{
232− auto value = getProperty(IFACE_LOCATION_HERE, PROP_LICENSE_BASE_PATH);
233− QString hereLicensePath = value.toString();
234− if (hereLicensePath.isEmpty() || !QFile::exists(hereLicensePath))
235− hereLicensePath = QStringLiteral("");
236− return hereLicensePath;
237−}
238−
239−bool AccountsService::hereLicensePathValid() const
240−{
241− auto value = getProperty(IFACE_LOCATION_HERE, PROP_LICENSE_BASE_PATH);
242− return !value.toString().isNull();
243−}
244−
245216QString AccountsService::realName() const
246217{
247218 auto value = getProperty(IFACE_ACCOUNTS_USER, PROP_REAL_NAME);
plugins/AccountsService/AccountsService.h+1−17
@@ -29,7 +29,6 @@ class QDBusInterface;
2929class AccountsService: public QObject
3030{
3131 Q_OBJECT
32− Q_ENUMS(PasswordDisplayHint)
3332 Q_PROPERTY (QString user
3433 READ user
3534 WRITE setUser
@@ -67,16 +66,6 @@ class AccountsService: public QObject
6766 READ failedFingerprintLogins
6867 WRITE setFailedFingerprintLogins
6968 NOTIFY failedFingerprintLoginsChanged)
70− Q_PROPERTY(bool hereEnabled
71− READ hereEnabled
72− WRITE setHereEnabled
73− NOTIFY hereEnabledChanged)
74− Q_PROPERTY(QString hereLicensePath
75− READ hereLicensePath
76− NOTIFY hereLicensePathChanged)
77− Q_PROPERTY(bool hereLicensePathValid // qml sees a null string as "", so we use proxy setting for that
78− READ hereLicensePathValid
79− NOTIFY hereLicensePathChanged)
8069 Q_PROPERTY(QString realName READ realName WRITE setRealName NOTIFY realNameChanged)
8170 Q_PROPERTY(QString email READ email WRITE setEmail NOTIFY emailChanged)
8271 Q_PROPERTY(QStringList keymaps READ keymaps WRITE setKeymaps NOTIFY keymapsChanged)
@@ -86,6 +75,7 @@ public:
8675 Keyboard,
8776 Numeric,
8877 };
78+ Q_ENUM(PasswordDisplayHint)
8979
9080 explicit AccountsService(QObject *parent = 0, const QString & user = QString());
9181 ~AccountsService() = default;
@@ -106,10 +96,6 @@ public:
10696 void setFailedLogins(uint failedLogins);
10797 uint failedFingerprintLogins() const;
10898 void setFailedFingerprintLogins(uint failedFingerprintLogins);
109− bool hereEnabled() const;
110− void setHereEnabled(bool enabled);
111− QString hereLicensePath() const;
112− bool hereLicensePathValid() const;
11399 QString realName() const;
114100 void setRealName(const QString &realName);
115101 QString email() const;
@@ -129,8 +115,6 @@ Q_SIGNALS:
129115 void passwordDisplayHintChanged();
130116 void failedLoginsChanged();
131117 void failedFingerprintLoginsChanged();
132− void hereEnabledChanged();
133− void hereLicensePathChanged();
134118 void realNameChanged();
135119 void emailChanged();
136120 void keymapsChanged();
plugins/AccountsService/CMakeLists.txt+1−2
@@ -7,9 +7,8 @@ add_library(AccountsService-qml MODULE
77 plugin.cpp
88 )
99
10−qt5_use_modules(AccountsService-qml DBus Qml)
11−
1210target_link_libraries(AccountsService-qml
11+ Qt5::DBus Qt5::Qml
1312 ${GLIB_LIBRARIES}
1413 )
1514
plugins/AccountsService/com.canonical.unity.AccountsService.xml+6
@@ -9,11 +9,17 @@
99 <annotation name="org.freedesktop.Accounts.Authentication.ChangeAny"
1010 value="com.ubuntu.AccountsService.GreeterChangeAny"/>
1111
12+ <!-- Marks that V1 (pre-8.21) edge demos have been run. Legacy value. -->
1213 <!-- Should have been named DemoEdges, sorry folks. -mterry -->
1314 <property name="demo-edges" type="b" access="readwrite">
1415 <annotation name="org.freedesktop.Accounts.DefaultValue" value="true"/>
1516 </property>
1617
18+ <!-- Marks that V2 (post-8.21) edge demos have been run -->
19+ <property name="DemoEdges2" type="b" access="readwrite">
20+ <annotation name="org.freedesktop.Accounts.DefaultValue" value="true"/>
21+ </property>
22+
1723 <!-- List of tutorial pages that have been completed by the user -->
1824 <property name="DemoEdgesCompleted" type="as" access="readwrite">
1925 <annotation name="org.freedesktop.Accounts.DefaultValue" value="[]"/>
plugins/CMakeLists.txt+1−3
@@ -1,4 +1,4 @@
1−include(QmlPlugins)
1+find_package(QmlPlugins)
22
33# Set up and install a plugin for unity8.
44#
@@ -15,10 +15,8 @@ add_subdirectory(AccountsService)
1515add_subdirectory(Cursor)
1616add_subdirectory(GlobalShortcut)
1717add_subdirectory(Greeter)
18−add_subdirectory(ImageCache)
1918add_subdirectory(LightDM)
2019add_subdirectory(Lights)
21−add_subdirectory(Dash)
2220add_subdirectory(Powerd)
2321add_subdirectory(ScreenshotDirectory)
2422add_subdirectory(SessionBroadcast)
plugins/Cursor/CMakeLists.txt+1−2
@@ -26,8 +26,7 @@ add_library(Cursor-qml SHARED
2626target_link_libraries(Cursor-qml
2727 xcursorloader-static
2828 ${QT5PLATFORM_SUPPORT_LDFLAGS}
29+ Qt5::Qml Qt5::Quick Qt5::Svg
2930)
3031
31−qt5_use_modules(Cursor-qml Qml Quick Svg)
32−
3332add_unity8_plugin(Cursor 1.1 Cursor TARGETS Cursor-qml)
plugins/Cursor/CursorImageInfo.cpp+1−2
@@ -108,8 +108,7 @@ int CursorImageInfo::frameDuration() const
108108QUrl CursorImageInfo::imageSource() const
109109{
110110 auto urlString = QString("image://cursor/%1/%2/%3")
111− .arg(m_themeName)
112− .arg(m_cursorName)
111+ .arg(m_themeName, m_cursorName)
113112 .arg(m_cursorHeight);
114113
115114 return QUrl(urlString);
plugins/Cursor/CursorImageProvider.cpp+2
@@ -174,6 +174,8 @@ CursorImageProvider::CursorImageProvider()
174174 m_fallbackNames[QStringLiteral("forbidden")].append(QStringLiteral("not-allowed"));
175175 m_fallbackNames[QStringLiteral("forbidden")].append(QStringLiteral("circle"));
176176
177+ m_fallbackNames[QStringLiteral("grabbing")].append(QStringLiteral("closedhand")); // Breeze
178+
177179 m_fallbackNames[QStringLiteral("hand")].append(QStringLiteral("pointing_hand"));
178180 m_fallbackNames[QStringLiteral("hand")].append(QStringLiteral("pointer"));
179181
plugins/Dash/AudioProgressBar.qmldeleted−54
@@ -1,54 +0,0 @@
1−/*
2− * Copyright 2015 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.4
18−import Ubuntu.Components 1.3
19−import Dash 0.1
20−
21−Item {
22− id: root
23−
24− implicitHeight: progressBarImage.height
25−
26− property url source
27− readonly property double progress: AudioUrlComparer.compare(source, DashAudioPlayer.currentSource) ? DashAudioPlayer.progress : 0
28−
29− Image {
30− id: progressBarImage
31− anchors { left: parent.left; right: parent.right }
32− height: units.dp(6)
33− source: "graphics/music_progress_bg.png"
34− asynchronous: true
35− sourceSize.width: width
36− sourceSize.height: height
37− }
38−
39− UbuntuShape {
40− id: progressBarFill
41− objectName: "progressBarFill"
42−
43− readonly property int maxWidth: progressBarImage.width
44−
45− anchors {
46− left: progressBarImage.left
47− right: progressBarImage.right
48− verticalCenter: progressBarImage.verticalCenter
49− rightMargin: maxWidth - (maxWidth * root.progress)
50− }
51− height: units.dp(2)
52− backgroundColor: theme.palette.normal.activity
53− }
54−}
plugins/Dash/CMakeLists.txtdeleted−47
@@ -1,47 +0,0 @@
1−# There's no cmake var for v8 include path :-/
2−# so create one
3−LIST(GET Qt5Core_INCLUDE_DIRS 0 QtCoreDir0)
4−if(${Qt5Core_VERSION_STRING} VERSION_LESS "5.1.0")
5− SET(Qt5V8_PRIVATE_INCLUDE_DIR ${QtCoreDir0}/../QtV8/${Qt5Core_VERSION_STRING}/QtV8)
6−else()
7− SET(Qt5V8_PRIVATE_INCLUDE_DIR ${QtCoreDir0}/QtV8/${Qt5Core_VERSION_STRING}/QtV8)
8−endif()
9−
10−include_directories(
11− ${CMAKE_CURRENT_SOURCE_DIR}
12− ${CMAKE_CURRENT_BINARY_DIR}
13−)
14−
15−include_directories(
16− SYSTEM
17− ${Qt5Qml_PRIVATE_INCLUDE_DIRS}
18− ${Qt5Quick_PRIVATE_INCLUDE_DIRS}
19− ${Qt5V8_PRIVATE_INCLUDE_DIR}
20−)
21−
22−remove_definitions(-DQT_NO_KEYWORDS)
23−
24−set(QMLPLUGIN_SRC
25− plugin.cpp
26− listviewwithpageheader.cpp
27− abstractdashview.cpp
28− verticaljournal.cpp
29− horizontaljournal.cpp
30− organicgrid.cpp
31− )
32−
33−add_library(Dash-qml MODULE
34− ${QMLPLUGIN_SRC}
35− )
36−
37−target_link_libraries(Dash-qml
38− ${Qt5Gui_LIBRARIES}
39− ${Qt5Quick_LIBRARIES}
40− )
41−
42−qt5_use_modules(Dash-qml Qml Quick Concurrent)
43−
44−add_unity8_plugin(Dash 0.1 Dash TARGETS Dash-qml)
45−
46−install(FILES graphics/music_progress_bg.png DESTINATION ${SHELL_INSTALL_QML}/Dash/graphics/)
47−file(COPY graphics/music_progress_bg.png DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/graphics/)
plugins/Dash/CardAttributes.qmldeleted−71
@@ -1,71 +0,0 @@
1−/*
2− * Copyright 2014 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.4
18−import QtQuick.Layouts 1.1
19−import Ubuntu.Components 1.3
20−
21−GridLayout {
22− id: grid
23− anchors {
24− left: parent.left;
25− right: parent.right;
26− }
27− columns: 2 + repeater.count % 2
28− rowSpacing: units.gu(.5)
29− property alias model: repeater.model
30− property color color: theme.palette.normal.baseText
31− property real fontScale: 1.0
32−
33− Repeater {
34− id: repeater
35− delegate: Row {
36− spacing: units.gu(0.5)
37− readonly property int column: index % grid.columns;
38− Layout.alignment: {
39− if (column == 0) return Qt.AlignLeft;
40− if (column == grid.columns - 1 || index == repeater.count - 1) return Qt.AlignRight;
41− if (column == 1) return Qt.AlignHCenter;
42− }
43− Layout.column: index % grid.columns
44− Layout.row: index / grid.columns
45− Layout.columnSpan: index == repeater.count - 1 && grid.columns == 3 && column == 1 ? 2 : 1
46− Layout.maximumWidth: Math.max(icon.width, label.x + label.implicitWidth)
47− Layout.fillWidth: true
48− height: units.gu(2)
49− Icon {
50− id: icon
51− height: units.gu(2)
52− // FIXME Workaround for bug https://bugs.launchpad.net/ubuntu/+source/ubuntu-ui-toolkit/+bug/1421293
53− width: implicitWidth > 0 && implicitHeight > 0 ? (implicitWidth / implicitHeight * height) : implicitWidth
54− source: "icon" in modelData && modelData["icon"] || ""
55− color: grid.color
56− }
57− Label {
58− id: label
59− width: parent.width - x
60− anchors.verticalCenter: parent.verticalCenter
61− text: "value" in modelData && modelData["value"] || "";
62− elide: Text.ElideRight
63− maximumLineCount: 1
64− font.weight: "style" in modelData && modelData["style"] === "highlighted" ? Font.Bold : Font.Light
65− fontSize: "x-small"
66− font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale)
67− color: grid.color
68− }
69− }
70− }
71−}
plugins/Dash/CardAudioProgress.qmldeleted−59
@@ -1,59 +0,0 @@
1−/*
2− * Copyright 2015 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.4
18−import Ubuntu.Components 1.3
19−import Dash 0.1
20−
21−Item {
22− id: root
23−
24− implicitHeight: positionLabel.y + positionLabel.height
25− visible: AudioUrlComparer.compare(source, DashAudioPlayer.currentSource)
26−
27− property int duration: 0
28− property alias source: progress.source
29− property color color: theme.palette.normal.baseText
30− readonly property int position: root.visible ? DashAudioPlayer.position / 1000 : 0
31−
32− AudioProgressBar {
33− id: progress
34− anchors { left: parent.left; right: parent.right }
35− }
36−
37− Label {
38− id: positionLabel
39− anchors {
40− left: parent.left
41− top: progress.bottom
42− }
43− verticalAlignment: Text.AlignBottom
44− fontSize: "x-small"
45− text: DashAudioPlayer.lengthToString(root.position)
46− color: root.color
47− }
48−
49− Label {
50− anchors {
51− right: parent.right
52− top: progress.bottom
53− }
54− verticalAlignment: Text.AlignBottom
55− fontSize: "x-small"
56− text: DashAudioPlayer.lengthToString(duration)
57− color: root.color
58− }
59−}
plugins/Dash/CardCreator.jsdeleted−999
@@ -1,999 +0,0 @@
1−/*
2− * Copyright (C) 2014 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−.pragma library
18−
19−// %1 is the template["card-background"]["elements"][0]
20−// %2 is the template["card-background"]["elements"][1]
21−// %3 is whether the loader should be asynchronous or not
22−// %4 is the template["card-background"] string
23−var kBackgroundLoaderCode = 'Loader {\n\
24− id: backgroundLoader; \n\
25− objectName: "backgroundLoader"; \n\
26− anchors.fill: parent; \n\
27− asynchronous: %3; \n\
28− visible: status === Loader.Ready; \n\
29− sourceComponent: UbuntuShape { \n\
30− objectName: "background"; \n\
31− radius: "small"; \n\
32− aspect: { \n\
33− switch (root.backgroundShapeStyle) { \n\
34− case "inset": return UbuntuShape.Inset; \n\
35− case "shadow": return UbuntuShape.DropShadow; \n\
36− default: \n\
37− case "flat": return UbuntuShape.Flat; \n\
38− } \n\
39− } \n\
40− backgroundColor: getColor(0) || "white"; \n\
41− secondaryBackgroundColor: getColor(1) || backgroundColor; \n\
42− backgroundMode: UbuntuShape.VerticalGradient; \n\
43− anchors.fill: parent; \n\
44− source: backgroundImage.source ? backgroundImage : null; \n\
45− property real luminance: Style.luminance(backgroundColor); \n\
46− property Image backgroundImage: Image { \n\
47− objectName: "backgroundImage"; \n\
48− source: { \n\
49− if (cardData && typeof cardData["background"] === "string") return cardData["background"]; \n\
50− else return %4; \n\
51− } \n\
52− } \n\
53− function getColor(index) { \n\
54− if (cardData && typeof cardData["background"] === "object" \n\
55− && (cardData["background"]["type"] === "color" || cardData["background"]["type"] === "gradient")) { \n\
56− return cardData["background"]["elements"][index]; \n\
57− } else return index === 0 ? %1 : %2; \n\
58− } \n\
59− } \n\
60− }\n';
61−
62−// %1 is the aspect of the UbuntuShape
63−var kArtUbuntuShapeCode = 'UbuntuShape { \n\
64− anchors.fill: parent; \n\
65− source: artImage; \n\
66− sourceFillMode: UbuntuShape.PreserveAspectCrop; \n\
67− radius: "small"; \n\
68− aspect: %1; \n\
69− }';
70−
71−var kArtProportionalShapeCode = 'ProportionalShape { \n\
72− anchors.left: parent.left; \n\
73− anchors.right: parent.right; \n\
74− source: artImage; \n\
75− aspect: UbuntuShape.DropShadow; \n\
76− }';
77−
78−// %1 is used as anchors of artShapeLoader
79−// %2 is used as image width
80−// %3 is used as image height
81−// %4 is whether the image should be visible
82−// %5 is whether the loader should be asynchronous or not
83−// %6 is the shape code we want to use
84−// %7 is injected as code to artImage
85−// %8 is used as image fallback
86−var kArtShapeHolderCode = 'Loader { \n\
87− id: artShapeLoader; \n\
88− height: root.fixedArtShapeSize.height; \n\
89− width: root.fixedArtShapeSize.width; \n\
90− anchors { %1 } \n\
91− objectName: "artShapeLoader"; \n\
92− readonly property string cardArt: cardData && cardData["art"] || %8; \n\
93− onCardArtChanged: { if (item) { item.image.source = cardArt; } } \n\
94− active: cardArt != ""; \n\
95− asynchronous: %5; \n\
96− visible: status === Loader.Ready; \n\
97− sourceComponent: Item { \n\
98− id: artShape; \n\
99− objectName: "artShape"; \n\
100− visible: image.status === Image.Ready; \n\
101− readonly property alias image: artImage; \n\
102− %6 \n\
103− width: root.fixedArtShapeSize.width; \n\
104− height: root.fixedArtShapeSize.height; \n\
105− CroppedImageMinimumSourceSize { \n\
106− id: artImage; \n\
107− objectName: "artImage"; \n\
108− source: artShapeLoader.cardArt; \n\
109− asynchronous: %5; \n\
110− visible: %4; \n\
111− width: %2; \n\
112− height: %3; \n\
113− %7 \n\
114− } \n\
115− } \n\
116− }\n';
117−
118−// %1 is used as anchors of artShapeLoader
119−// %2 is used as image width
120−// %3 is used as image height
121−// %4 is whether the image should be visible
122−// %5 is whether the loader should be asynchronous or not
123−// %6 is the shape code we want to use
124−// %7 is injected as code to artImage
125−// %8 is used as image fallback
126−var kArtShapeHolderCodeCardToolCard = 'Loader { \n\
127− id: artShapeLoader; \n\
128− anchors { %1 } \n\
129− objectName: "artShapeLoader"; \n\
130− readonly property string cardArt: cardData && cardData["art"] || %8; \n\
131− onCardArtChanged: { if (item) { item.image.source = cardArt; } } \n\
132− active: cardArt != ""; \n\
133− asynchronous: %5; \n\
134− visible: status === Loader.Ready; \n\
135− sourceComponent: Item { \n\
136− id: artShape; \n\
137− objectName: "artShape"; \n\
138− visible: image.status === Image.Ready; \n\
139− readonly property alias image: artImage; \n\
140− %6 \n\
141− width: image.status !== Image.Ready ? 0 : image.width; \n\
142− height: image.status !== Image.Ready ? 0 : image.height; \n\
143− CroppedImageMinimumSourceSize { \n\
144− id: artImage; \n\
145− objectName: "artImage"; \n\
146− source: artShapeLoader.cardArt; \n\
147− asynchronous: %5; \n\
148− visible: %4; \n\
149− width: %2; \n\
150− height: %3; \n\
151− %7 \n\
152− } \n\
153− } \n\
154− }\n';
155−
156−// %1 is anchors.fill
157−// %2 is width
158−// %3 is height
159−// %4 is whether the icon should be asynchronous or not
160−var kAudioButtonCode = 'AbstractButton { \n\
161− id: audioButton; \n\
162− anchors.fill: %1; \n\
163− width: %2; \n\
164− height: %3; \n\
165− readonly property url source: (cardData["quickPreviewData"] && cardData["quickPreviewData"]["uri"]) || ""; \n\
166− UbuntuShape { \n\
167− anchors.fill: parent; \n\
168− visible: parent.pressed; \n\
169− radius: "small"; \n\
170− } \n\
171− Rectangle { \n\
172− color: Qt.rgba(0, 0, 0, 0.5); \n\
173− anchors.centerIn: parent; \n\
174− width: parent.width * 0.5; \n\
175− height: width; \n\
176− radius: width / 2; \n\
177− } \n\
178− Icon { \n\
179− anchors.centerIn: parent; \n\
180− width: parent.width * 0.3; \n\
181− height: width; \n\
182− opacity: 0.9; \n\
183− name: DashAudioPlayer.playing && AudioUrlComparer.compare(parent.source, DashAudioPlayer.currentSource) ? "media-playback-pause" : "media-playback-start"; \n\
184− color: "white"; \n\
185− asynchronous: %4; \n\
186− } \n\
187− onClicked: { \n\
188− if (AudioUrlComparer.compare(source, DashAudioPlayer.currentSource)) { \n\
189− if (DashAudioPlayer.playing) { \n\
190− DashAudioPlayer.pause(); \n\
191− } else { \n\
192− DashAudioPlayer.play(); \n\
193− } \n\
194− } else { \n\
195− var playlist = (cardData["quickPreviewData"] && cardData["quickPreviewData"]["playlist"]) || null; \n\
196− DashAudioPlayer.playSource(source, playlist); \n\
197− } \n\
198− } \n\
199− onPressAndHold: { \n\
200− root.pressAndHold(); \n\
201− } \n\
202− }';
203−
204−// %1 is whether the loader should be asynchronous or not
205−// %2 is the header height code
206−var kOverlayLoaderCode = 'Loader { \n\
207− id: overlayLoader; \n\
208− readonly property real overlayHeight: %2 + units.gu(2); \n\
209− anchors.fill: artShapeLoader; \n\
210− active: artShapeLoader.active && artShapeLoader.item && artShapeLoader.item.image.status === Image.Ready || false; \n\
211− asynchronous: %1; \n\
212− visible: showHeader && status === Loader.Ready; \n\
213− sourceComponent: UbuntuShapeOverlay { \n\
214− id: overlay; \n\
215− property real luminance: Style.luminance(overlayColor); \n\
216− aspect: UbuntuShape.Flat; \n\
217− radius: "small"; \n\
218− overlayColor: cardData && cardData["overlayColor"] || "#99000000"; \n\
219− overlayRect: Qt.rect(0, 1 - overlayLoader.overlayHeight / height, 1, 1); \n\
220− } \n\
221− }\n';
222−
223−// multiple row version of HeaderRowCode
224−function kHeaderRowCodeGenerator() {
225− var kHeaderRowCodeTemplate = 'Row { \n\
226− id: row; \n\
227− objectName: "outerRow"; \n\
228− property real margins: units.gu(1); \n\
229− spacing: margins; \n\
230− %2\
231− anchors { %1 } \n\
232− anchors.right: parent.right; \n\
233− anchors.margins: margins; \n\
234− anchors.rightMargin: 0; \n\
235− data: [ \n\
236− %3 \n\
237− ] \n\
238− }\n';
239− var args = Array.prototype.slice.call(arguments);
240− var isCardTool = args.shift();
241− var heightCode = isCardTool ? "" : "height: root.fixedHeaderHeight; \n";
242− var code = kHeaderRowCodeTemplate.arg(args.shift()).arg(heightCode).arg(args.join(',\n'));
243− return code;
244−}
245−
246−// multiple item version of kHeaderContainerCode
247−function kHeaderContainerCodeGenerator() {
248− var headerContainerCodeTemplate = 'Item { \n\
249− id: headerTitleContainer; \n\
250− anchors { %1 } \n\
251− width: parent.width - x; \n\
252− implicitHeight: %2; \n\
253− data: [ \n\
254− %3 \n\
255− ]\n\
256− }\n';
257− var args = Array.prototype.slice.call(arguments);
258− var code = headerContainerCodeTemplate.arg(args.shift()).arg(args.shift()).arg(args.join(',\n'));
259− return code;
260−}
261−
262−// %1 is used as anchors of mascotShapeLoader
263−// %2 is whether the loader should be asynchronous or not
264−var kMascotShapeLoaderCode = 'Loader { \n\
265− id: mascotShapeLoader; \n\
266− objectName: "mascotShapeLoader"; \n\
267− asynchronous: %2; \n\
268− active: mascotImage.status === Image.Ready; \n\
269− visible: showHeader && active && status === Loader.Ready; \n\
270− width: units.gu(6); \n\
271− height: units.gu(5.625); \n\
272− sourceComponent: UbuntuShape { aspect: UbuntuShape.Flat; image: mascotImage } \n\
273− anchors { %1 } \n\
274− }\n';
275−
276−// %1 is used as anchors of mascotImage
277−// %2 is used as visible of mascotImage
278−// %3 is injected as code to mascotImage
279−// %4 is used as fallback image
280−var kMascotImageCode = 'CroppedImageMinimumSourceSize { \n\
281− id: mascotImage; \n\
282− objectName: "mascotImage"; \n\
283− anchors { %1 } \n\
284− source: cardData && cardData["mascot"] || %4; \n\
285− width: units.gu(6); \n\
286− height: units.gu(5.625); \n\
287− horizontalAlignment: Image.AlignHCenter; \n\
288− verticalAlignment: Image.AlignVCenter; \n\
289− visible: %2; \n\
290− %3 \n\
291− }\n';
292−
293−// %1 is used as anchors of titleLabel
294−// %2 is used as color of titleLabel
295−// %3 is used as extra condition for visible of titleLabel
296−// %4 is used as title width
297−// %5 is used as horizontal alignment
298−var kTitleLabelCode = 'Label { \n\
299− id: titleLabel; \n\
300− objectName: "titleLabel"; \n\
301− anchors { %1 } \n\
302− elide: Text.ElideRight; \n\
303− fontSize: "small"; \n\
304− wrapMode: Text.Wrap; \n\
305− maximumLineCount: 2; \n\
306− font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale); \n\
307− color: %2; \n\
308− visible: showHeader %3; \n\
309− width: %4; \n\
310− text: root.title; \n\
311− font.weight: Font.Normal; \n\
312− horizontalAlignment: %5; \n\
313− }\n';
314−
315−// %1 is used as extra anchors of emblemIcon
316−// %2 is used as color of emblemIcon
317−// FIXME The width code is a
318−// Workaround for bug https://bugs.launchpad.net/ubuntu/+source/ubuntu-ui-toolkit/+bug/1421293
319−var kEmblemIconCode = 'Icon { \n\
320− id: emblemIcon; \n\
321− objectName: "emblemIcon"; \n\
322− anchors { \n\
323− bottom: titleLabel.baseline; \n\
324− right: parent.right; \n\
325− %1 \n\
326− } \n\
327− source: cardData && cardData["emblem"] || ""; \n\
328− color: %2; \n\
329− height: source != "" ? titleLabel.font.pixelSize : 0; \n\
330− width: implicitWidth > 0 && implicitHeight > 0 ? (implicitWidth / implicitHeight * height) : implicitWidth; \n\
331− }\n';
332−
333−// %1 is used as anchors of touchdown effect
334−var kTouchdownCode = 'Loader { \n\
335− active: root.pressed; \n\
336− anchors { %1 } \n\
337− sourceComponent: UbuntuShape { \n\
338− objectName: "touchdown"; \n\
339− anchors.fill: parent; \n\
340− radius: "small"; \n\
341− borderSource: "radius_pressed.sci" \n\
342− } \n\
343− }\n';
344−
345−// %1 is used as anchors of subtitleLabel
346−// %2 is used as color of subtitleLabel
347−var kSubtitleLabelCode = 'Label { \n\
348− id: subtitleLabel; \n\
349− objectName: "subtitleLabel"; \n\
350− anchors { %1 } \n\
351− anchors.topMargin: units.dp(2); \n\
352− elide: Text.ElideRight; \n\
353− maximumLineCount: 1; \n\
354− fontSize: "x-small"; \n\
355− font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale); \n\
356− color: %2; \n\
357− visible: titleLabel.visible && titleLabel.text; \n\
358− text: cardData && cardData["subtitle"] || ""; \n\
359− font.weight: Font.Light; \n\
360− }\n';
361−
362−// %1 is used as anchors of attributesRow
363−// %2 is used as color of attributesRow
364−var kAttributesRowCode = 'CardAttributes { \n\
365− id: attributesRow; \n\
366− objectName: "attributesRow"; \n\
367− anchors { %1 } \n\
368− color: %2; \n\
369− fontScale: root.fontScale; \n\
370− model: cardData && cardData["attributes"]; \n\
371− }\n';
372−
373−// %1 is used as anchors of socialActionsRow
374−// %2 is used as color of socialActionsRow
375−var kSocialActionsRowCode = 'CardSocialActions { \n\
376− id: socialActionsRow; \n\
377− objectName: "socialActionsRow"; \n\
378− anchors { %1 } \n\
379− color: %2; \n\
380− model: cardData && cardData["socialActions"]; \n\
381− onClicked: root.action(actionId); \n\
382− }\n';
383−
384−// %1 is used as top anchor of summary
385−// %2 is used as topMargin anchor of summary
386−// %3 is used as color of summary
387−var kSummaryLabelCode = 'Label { \n\
388− id: summary; \n\
389− objectName: "summaryLabel"; \n\
390− anchors { \n\
391− top: %1; \n\
392− left: parent.left; \n\
393− right: parent.right; \n\
394− margins: units.gu(1); \n\
395− topMargin: %2; \n\
396− } \n\
397− wrapMode: Text.Wrap; \n\
398− maximumLineCount: 5; \n\
399− elide: Text.ElideRight; \n\
400− text: cardData && cardData["summary"] || ""; \n\
401− height: text ? implicitHeight : 0; \n\
402− fontSize: "x-small"; \n\
403− font.weight: Font.Light; \n\
404− color: %3; \n\
405− }\n';
406−
407−// %1 is used as bottom anchor of audio progress bar
408−// %2 is used as left anchor of audio progress bar
409−// %3 is used as text color
410−var kAudioProgressBarCode = 'CardAudioProgress { \n\
411− id: audioProgressBar; \n\
412− duration: (cardData["quickPreviewData"] && cardData["quickPreviewData"]["duration"]) || 0; \n\
413− source: (cardData["quickPreviewData"] && cardData["quickPreviewData"]["uri"]) || ""; \n\
414− anchors { \n\
415− bottom: %1; \n\
416− left: %2; \n\
417− right: parent.right; \n\
418− margins: units.gu(1); \n\
419− } \n\
420− color: %3; \n\
421− }';
422−
423−function sanitizeColor(colorString) {
424− if (colorString !== undefined) {
425− if (colorString.match(/^[#a-z0-9]*$/i) === null) {
426− // This is not the perfect regexp for color
427− // but what we're trying to do here is just protect
428− // against injection so it's ok
429− return "";
430− }
431− }
432− return colorString;
433−}
434−
435−function cardString(template, components, isCardTool, artShapeStyle, categoryLayout) {
436− var code;
437−
438− var templateInteractive = (template == null ? true : (template["non-interactive"] !== undefined ? !template["non-interactive"] : true)) ? "true" : "false";
439−
440− code = 'AbstractButton { \n\
441− id: root; \n\
442− property var cardData; \n\
443− property string backgroundShapeStyle: "flat"; \n\
444− property real fontScale: 1.0; \n\
445− property var scopeStyle: null; \n\
446− readonly property string title: cardData && cardData["title"] || ""; \n\
447− property bool showHeader: true; \n\
448− implicitWidth: childrenRect.width; \n\
449− enabled: %1; \n\
450− \n'.arg(templateInteractive);
451−
452− if (!isCardTool) {
453− code += "property int fixedHeaderHeight: -1; \n\
454− property size fixedArtShapeSize: Qt.size(-1, -1); \n";
455− }
456−
457− var hasArt = components["art"] && components["art"]["field"] || false;
458− var hasSummary = components["summary"] || false;
459− var isConciergeMode = components["art"] && components["art"]["conciergeMode"] || false;
460− var artAndSummary = hasArt && hasSummary && !isConciergeMode;
461− var isHorizontal = template["card-layout"] === "horizontal";
462− var hasBackground = (!isHorizontal && (template["card-background"] || components["background"] || artAndSummary)) ||
463− (hasSummary && (template["card-background"] || components["background"]));
464− var hasTitle = components["title"] || false;
465− var hasMascot = components["mascot"] || false;
466− var hasEmblem = components["emblem"] && !(hasMascot && template["card-size"] === "small") || false;
467− var headerAsOverlay = hasArt && template && template["overlay"] === true && (hasTitle || hasMascot);
468− var hasSubtitle = hasTitle && components["subtitle"] || false;
469− var hasHeaderRow = hasMascot && hasTitle;
470− var hasAttributes = hasTitle && components["attributes"] && components["attributes"]["field"] || false;
471− var hasSocialActions = hasTitle && components["social-actions"] || false;
472− var isAudio = template["quick-preview-type"] === "audio";
473− var asynchronous = isCardTool ? "false" : "true";
474−
475− code += 'signal action(var actionId);\n';
476− if (isAudio) {
477− // For now we only support audio cards with [optional] art, title, subtitle
478− // in horizontal mode
479− // Anything else makes it behave not like an audio card
480− if (hasSummary) isAudio = false;
481− if (!isHorizontal) isAudio = false;
482− if (hasMascot) isAudio = false;
483− if (hasEmblem) isAudio = false;
484− if (headerAsOverlay) isAudio = false;
485− if (hasAttributes) isAudio = false;
486− }
487−
488− if (hasBackground) {
489− var templateCardBackground;
490− if (template && typeof template["card-background"] === "string") {
491− templateCardBackground = 'decodeURI("' + encodeURI(template["card-background"]) + '")';
492− } else {
493− templateCardBackground = '""';
494− }
495−
496− var backgroundElements0;
497− var backgroundElements1;
498− if (template && typeof template["card-background"] === "object" && (template["card-background"]["type"] === "color" || template["card-background"]["type"] === "gradient")) {
499− var element0 = sanitizeColor(template["card-background"]["elements"][0]);
500− var element1 = sanitizeColor(template["card-background"]["elements"][1]);
501− if (element0 !== undefined) {
502− backgroundElements0 = '"%1"'.arg(element0);
503− }
504− if (element1 !== undefined) {
505− backgroundElements1 = '"%1"'.arg(element1);
506− }
507− }
508− code += kBackgroundLoaderCode.arg(backgroundElements0).arg(backgroundElements1).arg(asynchronous).arg(templateCardBackground);
509− }
510−
511− if (hasArt) {
512− var artShapeAspect;
513− if (isCardTool) {
514− code += 'readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1);\n';
515−
516− var artShapeAspect = components["art"] && components["art"]["aspect-ratio"] || 1;
517− if (isNaN(artShapeAspect)) {
518− artShapeAspect = 1;
519− }
520− } else {
521− artShapeAspect = "(root.fixedArtShapeSize.width / root.fixedArtShapeSize.height)";
522− }
523−
524− var widthCode, heightCode;
525− var artAnchors;
526− if (isHorizontal) {
527− artAnchors = 'left: parent.left';
528− if (hasMascot || hasTitle) {
529− widthCode = 'height * ' + artShapeAspect;
530− heightCode = 'headerHeight + 2 * units.gu(1)';
531− } else {
532− // This side of the else is a bit silly, who wants an horizontal layout without mascot and title?
533− // So we define a "random" height of the image height + 2 gu for the margins
534− widthCode = 'height * ' + artShapeAspect
535− heightCode = 'units.gu(7.625)';
536− }
537− } else {
538− artAnchors = 'horizontalCenter: parent.horizontalCenter;';
539− widthCode = 'root.width'
540− heightCode = 'width / ' + artShapeAspect;
541− }
542−
543− var fallback = !isCardTool && components["art"] && components["art"]["fallback"] || "";
544− fallback = encodeURI(fallback);
545− var fallbackStatusCode = "";
546− var fallbackURICode = '""';
547− if (fallback !== "") {
548− // fallbackStatusCode has %8 in it because we want to substitute it for fallbackURICode
549− // which in kArtShapeHolderCode is %8
550− fallbackStatusCode += 'onStatusChanged: if (status === Image.Error) source = %8;';
551− fallbackURICode = 'decodeURI("%1")'.arg(fallback);
552− }
553− var artShapeHolderShapeCode;
554− if (!isConciergeMode) {
555− if (artShapeStyle === "icon") {
556− artShapeHolderShapeCode = kArtProportionalShapeCode;
557− } else {
558− var artShapeHolderShapeAspect;
559− switch (artShapeStyle) {
560− case "inset": artShapeHolderShapeAspect = "UbuntuShape.Inset"; break;
561− case "shadow": artShapeHolderShapeAspect = "UbuntuShape.DropShadow"; break;
562− default:
563− case "flat": artShapeHolderShapeAspect = "UbuntuShape.Flat"; break;
564− }
565− artShapeHolderShapeCode = kArtUbuntuShapeCode.arg(artShapeHolderShapeAspect);
566− }
567− } else {
568− artShapeHolderShapeCode = "";
569− }
570− var artShapeHolderCode = isCardTool ? kArtShapeHolderCodeCardToolCard : kArtShapeHolderCode;
571− code += artShapeHolderCode.arg(artAnchors)
572− .arg(widthCode)
573− .arg(heightCode)
574− .arg(isConciergeMode ? "true" : "false")
575− .arg(asynchronous)
576− .arg(artShapeHolderShapeCode)
577− .arg(fallbackStatusCode)
578− .arg(fallbackURICode);
579− } else if (isCardTool) {
580− code += 'readonly property size artShapeSize: Qt.size(-1, -1);\n'
581− }
582−
583− if (headerAsOverlay) {
584− var headerHeightCode = isCardTool ? "headerHeight" : "root.fixedHeaderHeight";
585− code += kOverlayLoaderCode.arg(asynchronous).arg(headerHeightCode);
586− }
587−
588− var headerVerticalAnchors;
589− if (headerAsOverlay) {
590− headerVerticalAnchors = 'bottom: artShapeLoader.bottom; \n\
591− bottomMargin: units.gu(1);\n';
592− } else {
593− if (hasArt) {
594− if (isHorizontal) {
595− headerVerticalAnchors = 'top: artShapeLoader.top; \n\
596− topMargin: units.gu(1);\n';
597− } else {
598− headerVerticalAnchors = 'top: artShapeLoader.bottom; \n\
599− topMargin: units.gu(1);\n';
600− }
601− } else {
602− headerVerticalAnchors = 'top: parent.top; \n\
603− topMargin: units.gu(1);\n';
604− }
605− }
606−
607− var headerLeftAnchor;
608− var headerLeftAnchorHasMargin = false;
609− if (isHorizontal && hasArt) {
610− headerLeftAnchor = 'left: artShapeLoader.right; \n\
611− leftMargin: units.gu(1);\n';
612− headerLeftAnchorHasMargin = true;
613− } else if (isHorizontal && isAudio) {
614− headerLeftAnchor = 'left: audioButton.right; \n\
615− leftMargin: units.gu(1);\n';
616− headerLeftAnchorHasMargin = true;
617− } else {
618− headerLeftAnchor = 'left: parent.left;\n';
619− }
620−
621− var touchdownOnArtShape = !hasBackground && hasArt && !hasMascot && !hasSummary && !isAudio;
622−
623− if (hasHeaderRow) {
624− code += 'readonly property int headerHeight: row.height;\n'
625− } else if (hasMascot) {
626− code += 'readonly property int headerHeight: mascotImage.height;\n'
627− } else if (hasAttributes) {
628− if (hasTitle && hasSubtitle) {
629− code += 'readonly property int headerHeight: titleLabel.height + subtitleLabel.height + subtitleLabel.anchors.topMargin + attributesRow.height + attributesRow.anchors.topMargin;\n'
630− } else if (hasTitle) {
631− code += 'readonly property int headerHeight: titleLabel.height + attributesRow.height + attributesRow.anchors.topMargin;\n'
632− } else {
633− code += 'readonly property int headerHeight: attributesRow.height;\n'
634− }
635− } else if (isAudio) {
636− if (hasSubtitle) {
637− code += 'readonly property int headerHeight: titleLabel.height + subtitleLabel.height + subtitleLabel.anchors.topMargin + audioProgressBar.height + audioProgressBar.anchors.topMargin;\n'
638− } else if (hasTitle) {
639− code += 'readonly property int headerHeight: titleLabel.height + audioProgressBar.height + audioProgressBar.anchors.topMargin;\n'
640− } else {
641− code += 'readonly property int headerHeight: audioProgressBar.height;\n'
642− }
643− } else if (hasSubtitle) {
644− code += 'readonly property int headerHeight: titleLabel.height + subtitleLabel.height + subtitleLabel.anchors.topMargin;\n'
645− } else if (hasTitle) {
646− code += 'readonly property int headerHeight: titleLabel.height;\n'
647− } else {
648− code += 'readonly property int headerHeight: 0;\n'
649− }
650−
651− var mascotShapeCode = '';
652− var mascotCode = '';
653− if (hasMascot) {
654− var useMascotShape = !hasBackground && !headerAsOverlay;
655− var mascotAnchors = '';
656− if (!hasHeaderRow) {
657− mascotAnchors += headerLeftAnchor;
658− mascotAnchors += headerVerticalAnchors;
659− if (!headerLeftAnchorHasMargin) {
660− mascotAnchors += 'leftMargin: units.gu(1);\n'
661− }
662− } else {
663− mascotAnchors = 'verticalCenter: parent.verticalCenter;'
664− }
665−
666− if (useMascotShape) {
667− mascotShapeCode = kMascotShapeLoaderCode.arg(mascotAnchors).arg(asynchronous);
668− }
669−
670− var mascotImageVisible = useMascotShape ? 'false' : 'showHeader';
671− var fallback = !isCardTool && components["mascot"] && components["mascot"]["fallback"] || "";
672− fallback = encodeURI(fallback);
673− var fallbackStatusCode = "";
674− var fallbackURICode = '""';
675− if (fallback !== "") {
676− // fallbackStatusCode has %4 in it because we want to substitute it for fallbackURICode
677− // which in kMascotImageCode is %4
678− fallbackStatusCode += 'onStatusChanged: if (status === Image.Error) source = %4;';
679− fallbackURICode = 'decodeURI("%1")'.arg(fallback);
680− }
681− mascotCode = kMascotImageCode.arg(mascotAnchors).arg(mascotImageVisible).arg(fallbackStatusCode).arg(fallbackURICode);
682− }
683−
684− var summaryColorWithBackground = 'backgroundLoader.active && backgroundLoader.item && root.scopeStyle ? root.scopeStyle.getTextColor(backgroundLoader.item.luminance) : (backgroundLoader.item && backgroundLoader.item.luminance > 0.7 ? theme.palette.normal.baseText : "white")';
685−
686− var hasTitleContainer = hasTitle && (hasEmblem || (hasMascot && (hasSubtitle || hasAttributes)));
687− var titleSubtitleCode = '';
688− if (hasTitle) {
689− var titleColor;
690− if (headerAsOverlay) {
691− titleColor = 'root.scopeStyle && overlayLoader.item ? root.scopeStyle.getTextColor(overlayLoader.item.luminance) : (overlayLoader.item && overlayLoader.item.luminance > 0.7 ? theme.palette.normal.baseText : "white")';
692− } else if (hasSummary) {
693− titleColor = 'summary.color';
694− } else if (hasBackground) {
695− titleColor = summaryColorWithBackground;
696− } else {
697− titleColor = 'root.scopeStyle ? root.scopeStyle.foreground : theme.palette.normal.baseText';
698− }
699−
700− var titleAnchors;
701− var subtitleAnchors;
702− var attributesAnchors;
703− var titleContainerAnchors;
704− var titleRightAnchor;
705− var titleWidth = "undefined";
706−
707− var extraRightAnchor = '';
708− var extraLeftAnchor = '';
709− if (!touchdownOnArtShape) {
710− extraRightAnchor = 'rightMargin: units.gu(1); \n';
711− extraLeftAnchor = 'leftMargin: units.gu(1); \n';
712− } else if (headerAsOverlay && !hasEmblem) {
713− extraRightAnchor = 'rightMargin: units.gu(1); \n';
714− }
715−
716− if (hasMascot) {
717− titleContainerAnchors = 'verticalCenter: parent.verticalCenter; ';
718− } else {
719− titleContainerAnchors = 'right: parent.right; ';
720− titleContainerAnchors += headerLeftAnchor;
721− titleContainerAnchors += headerVerticalAnchors;
722− if (!headerLeftAnchorHasMargin) {
723− titleContainerAnchors += extraLeftAnchor;
724− }
725− }
726− if (hasEmblem) {
727− titleRightAnchor = 'right: emblemIcon.left; \n\
728− rightMargin: emblemIcon.width > 0 ? units.gu(0.5) : 0; \n';
729− } else {
730− titleRightAnchor = 'right: parent.right; \n'
731− titleRightAnchor += extraRightAnchor;
732− }
733−
734− if (hasTitleContainer) {
735− // Using headerTitleContainer
736− titleAnchors = titleRightAnchor;
737− titleAnchors += 'left: parent.left; \n\
738− top: parent.top;';
739− subtitleAnchors = 'right: parent.right; \n\
740− left: parent.left; \n';
741− subtitleAnchors += extraRightAnchor;
742− if (hasSubtitle) {
743− attributesAnchors = subtitleAnchors + 'top: subtitleLabel.bottom;\n';
744− subtitleAnchors += 'top: titleLabel.bottom;\n';
745− } else {
746− attributesAnchors = subtitleAnchors + 'top: titleLabel.bottom;\n';
747− }
748− } else if (hasMascot) {
749− // Using row without titleContainer
750− titleAnchors = 'verticalCenter: parent.verticalCenter;\n';
751− titleWidth = "parent.width - x";
752− } else {
753− if (headerAsOverlay) {
754− // Using anchors to the overlay
755− titleAnchors = titleRightAnchor;
756− titleAnchors += 'left: parent.left; \n\
757− leftMargin: units.gu(1); \n\
758− top: overlayLoader.top; \n\
759− topMargin: units.gu(1) + overlayLoader.height - overlayLoader.overlayHeight; \n';
760− } else {
761− // Using anchors to the mascot/parent
762− titleAnchors = titleRightAnchor;
763− titleAnchors += headerLeftAnchor;
764− titleAnchors += headerVerticalAnchors;
765− if (!headerLeftAnchorHasMargin) {
766− titleAnchors += extraLeftAnchor;
767− }
768− }
769− subtitleAnchors = 'left: titleLabel.left; \n\
770− leftMargin: titleLabel.leftMargin; \n';
771− subtitleAnchors += extraRightAnchor;
772− if (hasEmblem) {
773− // using container
774− subtitleAnchors += 'right: parent.right; \n';
775− } else {
776− subtitleAnchors += 'right: titleLabel.right; \n';
777− }
778−
779− if (hasSubtitle) {
780− attributesAnchors = subtitleAnchors + 'top: subtitleLabel.bottom;\n';
781− subtitleAnchors += 'top: titleLabel.bottom;\n';
782− } else {
783− attributesAnchors = subtitleAnchors + 'top: titleLabel.bottom;\n';
784− }
785− }
786−
787− var titleAlignment = "Text.AlignHCenter";
788− if (template["card-layout"] === "horizontal"
789− || typeof components["title"] !== "object"
790− || components["title"]["align"] === "left") titleAlignment = "Text.AlignLeft";
791− var keys = ["mascot", "emblem", "subtitle", "attributes", "summary"];
792− for (var key in keys) {
793− key = keys[key];
794− try {
795− if (typeof components[key] === "string"
796− || typeof components[key]["field"] === "string") titleAlignment = "Text.AlignLeft";
797− } catch (e) {
798− continue;
799− }
800− }
801−
802− // code for different elements
803− var titleLabelVisibleExtra = (headerAsOverlay ? '&& overlayLoader.active': '');
804− var titleCode = kTitleLabelCode.arg(titleAnchors).arg(titleColor).arg(titleLabelVisibleExtra).arg(titleWidth).arg(titleAlignment);
805− var subtitleCode;
806− var attributesCode;
807−
808− // code for the title container
809− var containerCode = [];
810− var containerHeight = 'titleLabel.height';
811− containerCode.push(titleCode);
812− if (hasSubtitle) {
813− subtitleCode = kSubtitleLabelCode.arg(subtitleAnchors).arg(titleColor);
814− containerCode.push(subtitleCode);
815− containerHeight += ' + subtitleLabel.height';
816− }
817− if (hasEmblem) {
818− containerCode.push(kEmblemIconCode.arg(extraRightAnchor).arg(titleColor));
819− }
820− if (hasAttributes) {
821− attributesCode = kAttributesRowCode.arg(attributesAnchors).arg(titleColor);
822− containerCode.push(attributesCode);
823− containerHeight += ' + attributesRow.height';
824− }
825−
826− if (hasTitleContainer) {
827− // use container
828− titleSubtitleCode = kHeaderContainerCodeGenerator(titleContainerAnchors, containerHeight, containerCode);
829− } else {
830− // no container
831− titleSubtitleCode = titleCode;
832− if (hasSubtitle) {
833− titleSubtitleCode += subtitleCode;
834− }
835− if (hasAttributes) {
836− titleSubtitleCode += attributesCode;
837− }
838− }
839− }
840−
841− if (hasHeaderRow) {
842− var rowCode = [mascotCode, titleSubtitleCode];
843− if (mascotShapeCode != '') {
844− rowCode.unshift(mascotShapeCode);
845− }
846− code += kHeaderRowCodeGenerator(isCardTool, headerVerticalAnchors + headerLeftAnchor, rowCode)
847− } else {
848− code += mascotShapeCode + mascotCode + titleSubtitleCode;
849− }
850−
851− if (isAudio) {
852− var audioProgressBarLeftAnchor = 'audioButton.right';
853− var audioProgressBarBottomAnchor = 'audioButton.bottom';
854− var audioProgressBarTextColor = 'root.scopeStyle ? root.scopeStyle.foreground : theme.palette.normal.baseText';
855−
856− code += kAudioProgressBarCode.arg(audioProgressBarBottomAnchor)
857− .arg(audioProgressBarLeftAnchor)
858− .arg(audioProgressBarTextColor);
859−
860− var audioButtonAnchorsFill;
861− var audioButtonWidth;
862− var audioButtonHeight;
863− if (hasArt) {
864− audioButtonAnchorsFill = 'artShapeLoader';
865− audioButtonWidth = 'undefined';
866− audioButtonHeight = 'undefined';
867− } else {
868− audioButtonAnchorsFill = 'undefined';
869− audioButtonWidth = 'height';
870− audioButtonHeight = isCardTool ? 'headerHeight + 2 * units.gu(1)'
871− : 'root.fixedHeaderHeight + 2 * units.gu(1)';
872− }
873− code += kAudioButtonCode.arg(audioButtonAnchorsFill).arg(audioButtonWidth).arg(audioButtonHeight).arg(asynchronous);
874− }
875−
876− if (hasSummary) {
877− var summaryTopAnchor;
878− if (isHorizontal && hasArt) summaryTopAnchor = 'artShapeLoader.bottom';
879− else if (headerAsOverlay && hasArt) summaryTopAnchor = 'artShapeLoader.bottom';
880− else if (hasHeaderRow) summaryTopAnchor = 'row.bottom';
881− else if (hasTitleContainer) summaryTopAnchor = 'headerTitleContainer.bottom';
882− else if (hasMascot) summaryTopAnchor = 'mascotImage.bottom';
883− else if (hasAttributes) summaryTopAnchor = 'attributesRow.bottom';
884− else if (hasSubtitle) summaryTopAnchor = 'subtitleLabel.bottom';
885− else if (hasTitle) summaryTopAnchor = 'titleLabel.bottom';
886− else if (hasArt) summaryTopAnchor = 'artShapeLoader.bottom';
887− else summaryTopAnchor = 'parent.top';
888−
889− var summaryColor;
890− if (hasBackground) {
891− summaryColor = summaryColorWithBackground;
892− } else {
893− summaryColor = 'root.scopeStyle ? root.scopeStyle.foreground : theme.palette.normal.baseText';
894− }
895−
896− var summaryTopMargin = (hasMascot || hasSubtitle || hasAttributes ? 'anchors.margins' : '0');
897−
898− code += kSummaryLabelCode.arg(summaryTopAnchor).arg(summaryTopMargin).arg(summaryColor);
899− }
900−
901− if (hasSocialActions) {
902− var socialAnchors;
903− var socialTopAnchor;
904−
905− if (hasSummary) socialTopAnchor = 'summary.bottom;';
906− else if (isHorizontal && hasArt) socialTopAnchor = 'artShapeLoader.bottom;';
907− else if (headerAsOverlay && hasArt) socialTopAnchor = 'artShapeLoader.bottom;';
908− else if (hasHeaderRow) socialTopAnchor = 'row.bottom;';
909− else if (hasTitleContainer) socialTopAnchor = 'headerTitleContainer.bottom;';
910− else if (hasMascot) socialTopAnchor = 'mascotImage.bottom;';
911− else if (hasAttributes) socialTopAnchor = 'attributesRow.bottom;';
912− else if (hasSubtitle) socialTopAnchor = 'subtitleLabel.bottom;';
913− else if (hasTitle) socialTopAnchor = 'titleLabel.bottom;';
914− else if (hasArt) socialTopAnchor = 'artShapeLoader.bottom;';
915− else socialTopAnchor = 'parent.top';
916−
917− socialAnchors = 'top: ' + socialTopAnchor + ' left: parent.left; right: parent.right; topMargin: units.gu(1);'
918−
919− var socialColor;
920− if (hasBackground) {
921− socialColor = summaryColorWithBackground;
922− } else {
923− socialColor = 'root.scopeStyle ? root.scopeStyle.foreground : theme.palette.normal.baseText';
924− }
925−
926− code += kSocialActionsRowCode.arg(socialAnchors).arg(socialColor);
927− }
928−
929− if (artShapeStyle != "shadow" && artShapeStyle != "icon" && !isCardTool) {
930− var touchdownAnchors;
931− if (hasBackground) {
932− touchdownAnchors = 'fill: backgroundLoader';
933− } else if (touchdownOnArtShape) {
934− touchdownAnchors = 'fill: artShapeLoader';
935− } else {
936− touchdownAnchors = 'fill: root'
937− }
938− code += kTouchdownCode.arg(touchdownAnchors);
939− }
940−
941− if (isCardTool || categoryLayout !== "grid") {
942− var implicitHeight = 'implicitHeight: ';
943− if (hasSocialActions) {
944− implicitHeight += 'socialActionsRow.y + socialActionsRow.height + units.gu(1);\n';
945− } else if (hasSummary) {
946− implicitHeight += 'summary.y + summary.height + units.gu(1);\n';
947− } else if (isAudio) {
948− implicitHeight += 'audioButton.height;\n';
949− } else if (headerAsOverlay) {
950− implicitHeight += 'artShapeLoader.height;\n';
951− } else if (hasHeaderRow) {
952− implicitHeight += 'row.y + row.height + units.gu(1);\n';
953− } else if (hasMascot) {
954− implicitHeight += 'mascotImage.y + mascotImage.height;\n';
955− } else if (hasTitleContainer) {
956− implicitHeight += 'headerTitleContainer.y + headerTitleContainer.height + units.gu(1);\n';
957− } else if (hasAttributes) {
958− implicitHeight += 'attributesRow.y + attributesRow.height + units.gu(1);\n';
959− } else if (hasSubtitle) {
960− implicitHeight += 'subtitleLabel.y + subtitleLabel.height + units.gu(1);\n';
961− } else if (hasTitle) {
962− implicitHeight += 'titleLabel.y + titleLabel.height + units.gu(1);\n';
963− } else if (hasArt) {
964− implicitHeight += 'artShapeLoader.height;\n';
965− } else {
966− implicitHeight = '';
967− }
968− } else {
969− implicitHeight = '';
970− }
971−
972− // Close the AbstractButton
973− code += implicitHeight + '}\n';
974−
975− return code;
976−}
977−
978−function createCardComponent(parent, template, components, isCardTool, artShapeStyle, categoryLayout, identifier) {
979− var imports = 'import QtQuick 2.4; \n\
980− import Ubuntu.Components 1.3; \n\
981− import Ubuntu.Settings.Components 0.1; \n\
982− import Dash 0.1;\n\
983− import Utils 0.1;\n';
984− var card = cardString(template, components, isCardTool, artShapeStyle, categoryLayout);
985− var code = imports + 'Component {\n' + card + '}\n';
986−
987− try {
988− return Qt.createQmlObject(code, parent, identifier);
989− } catch (e) {
990− console.error("ERROR: Invalid component created.");
991− console.error("Template:");
992− console.error(JSON.stringify(template));
993− console.error("Components:");
994− console.error(JSON.stringify(components));
995− console.error("Code:");
996− console.error(code);
997− throw e;
998− }
999−}
plugins/Dash/CardCreatorCache.qmldeleted−40
@@ -1,40 +0,0 @@
1−/*
2− * Copyright (C) 2014 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−pragma Singleton
18−import QtQuick 2.4
19−import "CardCreator.js" as CardCreator
20−
21−QtObject {
22− id: root
23−
24− property var cache: new Object();
25−
26− function getCardComponent(template, components, isCardTool, artShapeStyle, categoryLayout) {
27− if (template === undefined || components === undefined)
28− return undefined;
29−
30− var tString = JSON.stringify(template);
31− var cString = JSON.stringify(components);
32− var allString = tString + cString + isCardTool + artShapeStyle + categoryLayout;
33− var component = cache[allString];
34− if (component === undefined) {
35− component = CardCreator.createCardComponent(root, template, components, isCardTool, artShapeStyle, categoryLayout, allString);
36− cache[allString] = component;
37− }
38− return component;
39− }
40−}
plugins/Dash/CardSocialActions.qmldeleted−94
@@ -1,94 +0,0 @@
1−/*
2− * Copyright 2016 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.4
18−import QtQuick.Layouts 1.1
19−import Ubuntu.Components 1.3
20−
21−Column {
22− id: socialActions
23− spacing: units.gu(0.5)
24−
25− property alias model: repeater.model
26− property color color: theme.palette.normal.baseText
27−
28− signal clicked(var actionId)
29−
30− Rectangle {
31− id: divider
32− visible: repeater.count > 0
33− anchors {
34− left: parent.left;
35− right: parent.right;
36− leftMargin:units.dp(1);
37− rightMargin: units.dp(1);
38− }
39− color: Qt.darker(theme.palette.normal.background, 1.12)
40− height: visible ? units.dp(1) : 0
41− }
42−
43− Row {
44− id: row
45− anchors {
46− left: parent.left
47− right: parent.right
48− leftMargin: units.gu(1)
49− rightMargin: units.gu(1)
50− }
51− spacing: units.gu(2)
52− readonly property int visibleItems: {
53− if (width <= units.gu(12)) // small card
54− return 2;
55− else if (width <= units.gu(21)) // medium card
56− return 3;
57− else // large or horizontal card
58− return 4;
59− }
60−
61− Repeater {
62− id: repeater
63− delegate: Loader {
64− height: units.gu(2)
65− active: index < row.visibleItems
66− sourceComponent: AbstractButton {
67− objectName: "delegate" + index
68− height: units.gu(2)
69− width: icon.width
70− Icon {
71− id: icon
72− objectName: "icon"
73−
74− readonly property url urlIcon: modelData && modelData["icon"] || ""
75− readonly property url urlTemporaryIcon: "temporaryIcon" in modelData && modelData["temporaryIcon"] || ""
76−
77− height: units.gu(2)
78− // FIXME Workaround for bug https://bugs.launchpad.net/ubuntu/+source/ubuntu-ui-toolkit/+bug/1421293
79− width: implicitWidth > 0 && implicitHeight > 0 ? (implicitWidth / implicitHeight * height) : implicitWidth
80− source: urlIcon
81− color: socialActions.color
82−
83− onUrlIconChanged: {
84− if (urlIcon) source = urlIcon
85− }
86− }
87−
88− onClicked: socialActions.clicked(modelData["id"]);
89− onPressedChanged: if (pressed && icon.urlTemporaryIcon != "") icon.source = icon.urlTemporaryIcon
90− }
91− }
92− }
93− }
94−}
plugins/Dash/CroppedImageMinimumSourceSize.qmldeleted−38
@@ -1,38 +0,0 @@
1−/*
2− * Copyright (C) 2014, 2015 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.4
18−
19−Image {
20− id: root
21−
22− fillMode: Image.PreserveAspectCrop
23−
24− property bool useHeight: false
25− function updateUseHeight()
26− {
27− // Do not turn into a binding since otherwise the qml
28− // engine complains about binding loops
29− useHeight = (implicitWidth / implicitHeight) > (width / height);
30− }
31−
32− onHeightChanged: updateUseHeight();
33− onWidthChanged: updateUseHeight();
34− onImplicitHeightChanged: updateUseHeight();
35− onImplicitWidthChanged: updateUseHeight();
36−
37− sourceSize: useHeight ? Qt.size(0, height) : Qt.size(width, 0)
38−}
plugins/Dash/DashAudioPlayer.qmldeleted−120
@@ -1,120 +0,0 @@
1−/*
2− * Copyright (C) 2015 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−pragma Singleton
18−import QtQuick 2.4
19−import QtMultimedia 5.6
20−import Dash 0.1
21−
22−QtObject {
23− id: root
24− readonly property real progress: priv.audio ? priv.audio.position / priv.audio.duration : 0.0
25− readonly property bool playing: priv.audio ? priv.audio.playbackState === Audio.PlayingState : false
26− readonly property bool paused: priv.audio ? priv.audio.playbackState === Audio.PausedState : false
27− readonly property bool stopped: priv.audio ? priv.audio.playbackState === Audio.StoppedState : true
28− readonly property int position: priv.audio ? priv.audio.position : 0
29− readonly property url currentSource: priv.audio ? priv.audio.playlist.currentItemSource : ""
30− readonly property Playlist playlist: priv.audio ? priv.audio.playlist : null
31−
32− function playSource(newSource, newPlaylist) {
33− if (!priv.audio) {
34− console.info("DashAudioPlayer: creating player");
35− priv.audio = priv.audioComponent.createObject(root);
36− }
37− stop();
38− priv.audio.playlist.clear();
39− if (newPlaylist) {
40− // Look for newSource in newPlaylist
41− var sourceIndex = -1;
42− for (var i in newPlaylist) {
43− if (AudioUrlComparer.compare(newSource, newPlaylist[i])) {
44− sourceIndex = i;
45− break;
46− }
47− }
48− var urls = [];
49− if (sourceIndex === -1 && newSource != "") {
50− // If the playing song is not in the playlist, add it
51− urls.push(newSource);
52− sourceIndex = 0;
53− }
54− for (var i in newPlaylist) {
55− urls.push(newPlaylist[i]);
56− }
57− priv.audio.playlist.addItems(urls);
58− priv.audio.playlist.currentIndex = sourceIndex;
59− } else {
60− priv.audio.playlist.addItem(newSource);
61− priv.audio.playlist.currentIndex = 0;
62− }
63− play();
64− }
65−
66− function stop() {
67− if (priv.audio) {
68− priv.audio.stop();
69− }
70− }
71−
72− function play() {
73− if (priv.audio) {
74− priv.audio.play();
75− }
76− }
77−
78− function pause() {
79− if (priv.audio) {
80− priv.audio.pause();
81− }
82− }
83−
84− property QtObject priv: QtObject {
85− id: priv
86− property Audio audio: null
87− property Component audioComponent: Component {
88− Audio {
89− playlist: Playlist {
90− objectName: "playlist"
91− }
92− /* Remove player in case of error so it gets recreated next time
93− * we need it. Happens if backend media player restarted, for
94− * instance. qtmultimedia should probably handle this
95− * transparently (LP: #1616425).
96− */
97− onError: {
98− console.warn("DashAudioPlayer: error event (" +
99− priv.audio.errorString + "), destroying");
100− priv.audio.destroy();
101− }
102− }
103− }
104− }
105−
106− function lengthToString(s) {
107− if (typeof(s) !== "number" || s < 0) return "";
108−
109− var sec = "" + s % 60;
110− if (sec.length == 1) sec = "0" + sec;
111− var hour = Math.floor(s / 3600);
112− if (hour < 1) {
113− return Math.floor(s / 60) + ":" + sec;
114− } else {
115− var min = "" + Math.floor(s / 60) % 60;
116− if (min.length == 1) min = "0" + min;
117− return hour + ":" + min + ":" + sec;
118− }
119− }
120−}
plugins/Dash/ScopeStyle.qmldeleted−102
@@ -1,102 +0,0 @@
1−/*
2− * Copyright 2014 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.4
18−import Utils 0.1
19−import GSettings 1.0
20−import Ubuntu.Components 1.3
21−import Ubuntu.Components.Themes 1.3
22−
23−/*! \brief Helper for processing scope customization options.
24−
25− It will take the customizations object passed by the scope and
26− process it to provide the scope UI with data such as colors or
27− image paths.
28− */
29−
30−QtObject {
31−
32− property var gsettings: GSettings {
33− schema.id: "com.ubuntu.touch.system-settings"
34− }
35−
36− /// Style object passed from the scope
37− property var style: Object()
38−
39− /// Color used for text and symbolic icons
40− property color foreground: gsettings.dashBackground ? "white" : ("foreground-color" in style ? style["foreground-color"] : d.defaultDark)
41−
42− /// Luminance of the foreground color
43− readonly property real foregroundLuminance: foreground ? Style.luminance(foreground) : Style.luminance(d.defaultDark)
44−
45− /// Color used for the overall background
46− property color background: "background-color" in style ? style["background-color"] : gsettings.dashBackground ? "transparent" : "#00f5f5f5"
47−
48− /// Luminance of the background color
49− readonly property real backgroundLuminance: background ? Style.luminance(background) : Style.luminance(d.defaultLight)
50−
51− /*! \brief Get the most contrasting available color based on luminance
52− *
53− * If background color is transparent, theme provided colors are taken into account
54− */
55− function getTextColor(luminance) {
56− if (Math.abs(foregroundLuminance - luminance) >
57− Math.abs(d.opaqueBackgroundLuminance - luminance)) {
58− return foreground;
59− } else {
60− return d.opaqueBackground;
61− }
62− }
63−
64− /// Source of the logo image for the header
65− readonly property url headerLogo: "logo" in d.headerStyle ? d.headerStyle["logo"] : ""
66−
67− /// Background style for the header
68− property url headerBackground: "background" in d.headerStyle ? d.headerStyle["background"] : gsettings.dashBackground ? "color:///transparent" : "color:///#ffffff"
69−
70− /// Foreground color for the header
71− property color headerForeground: "foreground-color" in d.headerStyle ? d.headerStyle["foreground-color"] : gsettings.dashBackground ? "white" : foreground
72−
73− /// Color of the header divider
74− property color headerDividerColor: "divider-color" in d.headerStyle ? d.headerStyle["divider-color"] : gsettings.dashBackground ? "transparent" : "#e0e0e0"
75−
76− /// Background style for the navigation
77− property url navigationBackground: "navigation-background" in d.headerStyle ? d.headerStyle["navigation-background"] : gsettings.dashBackground ? "color:///white" : "color:///#f5f5f5"
78−
79− /// Color of the primary preview button
80− readonly property color previewButtonColor: "preview-button-color" in style ? style["preview-button-color"] : theme.palette.normal.positive
81−
82− //! @cond
83− property var d: QtObject {
84− // FIXME: should be taken from the theme
85− readonly property color defaultLight: "white"
86− readonly property color defaultDark: UbuntuColors.darkGrey
87− readonly property real defaultLightLuminance: Style.luminance(defaultLight)
88− readonly property real defaultDarkLuminance: Style.luminance(defaultDark)
89−
90− readonly property color opaqueBackground: {
91− background.a > 0 ?
92− background :
93− (Math.abs(foregroundLuminance - defaultLightLuminance) >
94− Math.abs(foregroundLuminance - defaultDarkLuminance)) ?
95− defaultLight : defaultDark
96− }
97− readonly property real opaqueBackgroundLuminance: Style.luminance(opaqueBackground)
98−
99− readonly property var headerStyle: "page-header" in style ? style["page-header"] : { }
100− }
101− //! @endcond
102−}
plugins/Dash/abstractdashview.cppdeleted−359
@@ -1,359 +0,0 @@
1−/*
2− * Copyright (C) 2013, 2014 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 "abstractdashview.h"
18−
19−#include <private/qquickitem_p.h>
20−
21−AbstractDashView::AbstractDashView()
22− : m_delegateModel(nullptr)
23− , m_asyncRequestedIndex(-1)
24− , m_columnSpacing(0)
25− , m_rowSpacing(0)
26− , m_buffer(320) // Same value used in qquickitemview.cpp in Qt 5.4
27− , m_displayMarginBeginning(0)
28− , m_displayMarginEnd(0)
29− , m_needsRelayout(false)
30− , m_delegateValidated(false)
31− , m_implicitHeightDirty(false)
32−{
33− connect(this, &AbstractDashView::widthChanged, this, &AbstractDashView::relayout);
34− connect(this, &AbstractDashView::heightChanged, this, &AbstractDashView::onHeightChanged);
35−}
36−
37−QAbstractItemModel *AbstractDashView::model() const
38−{
39− return m_delegateModel ? m_delegateModel->model().value<QAbstractItemModel *>() : nullptr;
40−}
41−
42−void AbstractDashView::setModel(QAbstractItemModel *model)
43−{
44− if (model != this->model()) {
45− if (!m_delegateModel) {
46− createDelegateModel();
47− } else {
48− disconnect(m_delegateModel, &QQmlDelegateModel::modelUpdated, this, &AbstractDashView::onModelUpdated);
49− }
50− m_delegateModel->setModel(QVariant::fromValue<QAbstractItemModel *>(model));
51− connect(m_delegateModel, &QQmlDelegateModel::modelUpdated, this, &AbstractDashView::onModelUpdated);
52−
53− cleanupExistingItems();
54−
55− Q_EMIT modelChanged();
56− polish();
57− }
58−}
59−
60−QQmlComponent *AbstractDashView::delegate() const
61−{
62− return m_delegateModel ? m_delegateModel->delegate() : nullptr;
63−}
64−
65−void AbstractDashView::setDelegate(QQmlComponent *delegate)
66−{
67− if (delegate != this->delegate()) {
68− if (!m_delegateModel) {
69− createDelegateModel();
70− }
71−
72− cleanupExistingItems();
73−
74− m_delegateModel->setDelegate(delegate);
75−
76− Q_EMIT delegateChanged();
77− m_delegateValidated = false;
78− polish();
79− }
80−}
81−
82−qreal AbstractDashView::columnSpacing() const
83−{
84− return m_columnSpacing;
85−}
86−
87−void AbstractDashView::setColumnSpacing(qreal columnSpacing)
88−{
89− if (columnSpacing != m_columnSpacing) {
90− m_columnSpacing = columnSpacing;
91− Q_EMIT columnSpacingChanged();
92−
93− if (isComponentComplete()) {
94− relayout();
95− }
96− }
97−}
98−
99−qreal AbstractDashView::rowSpacing() const
100−{
101− return m_rowSpacing;
102−}
103−
104−void AbstractDashView::setRowSpacing(qreal rowSpacing)
105−{
106− if (rowSpacing != m_rowSpacing) {
107− m_rowSpacing = rowSpacing;
108− Q_EMIT rowSpacingChanged();
109−
110− if (isComponentComplete()) {
111− relayout();
112− }
113− }
114−}
115−
116−int AbstractDashView::cacheBuffer() const
117−{
118− return m_buffer;
119−}
120−
121−void AbstractDashView::setCacheBuffer(int buffer)
122−{
123− if (buffer < 0) {
124− qmlInfo(this) << "Cannot set a negative cache buffer";
125− return;
126− }
127−
128− if (m_buffer != buffer) {
129− m_buffer = buffer;
130− if (isComponentComplete()) {
131− polish();
132− }
133− emit cacheBufferChanged();
134− }
135−}
136−
137−qreal AbstractDashView::displayMarginBeginning() const
138−{
139− return m_displayMarginBeginning;
140−}
141−
142−void AbstractDashView::setDisplayMarginBeginning(qreal begin)
143−{
144− if (m_displayMarginBeginning == begin)
145− return;
146− m_displayMarginBeginning = begin;
147− if (isComponentComplete()) {
148− polish();
149− }
150− emit displayMarginBeginningChanged();
151−}
152−
153−qreal AbstractDashView::displayMarginEnd() const
154−{
155− return m_displayMarginEnd;
156−}
157−
158−void AbstractDashView::setDisplayMarginEnd(qreal end)
159−{
160− if (m_displayMarginEnd == end)
161− return;
162− m_displayMarginEnd = end;
163− if (isComponentComplete()) {
164− polish();
165− }
166− emit displayMarginEndChanged();
167−}
168−
169−void AbstractDashView::createDelegateModel()
170−{
171− m_delegateModel = new QQmlDelegateModel(qmlContext(this), this);
172− connect(m_delegateModel, &QQmlDelegateModel::createdItem, this, &AbstractDashView::itemCreated);
173− if (isComponentComplete())
174− m_delegateModel->componentComplete();
175−}
176−
177−void AbstractDashView::refill()
178−{
179− if (!isComponentComplete() || height() < 0) {
180− return;
181− }
182−
183− const qreal from = -m_displayMarginBeginning;
184− const qreal to = height() + m_displayMarginEnd;
185− const qreal bufferFrom = from - m_buffer;
186− const qreal bufferTo = to + m_buffer;
187−
188− bool added = addVisibleItems(from, to, false);
189− bool removed = removeNonVisibleItems(bufferFrom, bufferTo);
190− added |= addVisibleItems(bufferFrom, bufferTo, true);
191−
192− if (added || removed) {
193− m_implicitHeightDirty = true;
194− polish();
195− }
196−}
197−
198−bool AbstractDashView::addVisibleItems(qreal fillFromY, qreal fillToY, bool asynchronous)
199−{
200− if (fillToY <= fillFromY)
201− return false;
202−
203− if (!delegate())
204− return false;
205−
206− if (m_delegateModel->count() == 0)
207− return false;
208−
209− int modelIndex;
210− qreal yPos;
211− findBottomModelIndexToAdd(&modelIndex, &yPos);
212− bool changed = false;
213− while (modelIndex < m_delegateModel->count() && yPos <= fillToY) {
214− if (!createItem(modelIndex, asynchronous))
215− break;
216−
217− changed = true;
218− findBottomModelIndexToAdd(&modelIndex, &yPos);
219− }
220−
221− findTopModelIndexToAdd(&modelIndex, &yPos);
222− while (modelIndex >= 0 && yPos > fillFromY) {
223− if (!createItem(modelIndex, asynchronous))
224− break;
225−
226− changed = true;
227− findTopModelIndexToAdd(&modelIndex, &yPos);
228− }
229−
230− return changed;
231−}
232−
233−QQuickItem *AbstractDashView::createItem(int modelIndex, bool asynchronous)
234−{
235− if (asynchronous && m_asyncRequestedIndex != -1)
236− return nullptr;
237−
238− m_asyncRequestedIndex = -1;
239− QObject* object = m_delegateModel->object(modelIndex, asynchronous ? QQmlIncubator::Asynchronous : QQmlIncubator::AsynchronousIfNested);
240− QQuickItem *item = qmlobject_cast<QQuickItem*>(object);
241− if (!item) {
242− if (object) {
243− m_delegateModel->release(object);
244− if (!m_delegateValidated) {
245− m_delegateValidated = true;
246− QObject* delegateObj = delegate();
247− qmlInfo(delegateObj ? delegateObj : this) << "Delegate must be of Item type";
248− }
249− } else {
250− m_asyncRequestedIndex = modelIndex;
251− }
252− return nullptr;
253− } else {
254− QQuickItemPrivate::get(item)->addItemChangeListener(this, QQuickItemPrivate::Geometry);
255− addItemToView(modelIndex, item);
256− return item;
257− }
258−}
259−
260−void AbstractDashView::releaseItem(QQuickItem *item)
261−{
262− QQuickItemPrivate::get(item)->removeItemChangeListener(this, QQuickItemPrivate::Geometry);
263− QQmlDelegateModel::ReleaseFlags flags = m_delegateModel->release(item);
264− if (flags & QQmlDelegateModel::Destroyed) {
265− item->setParentItem(nullptr);
266− }
267−}
268−
269−void AbstractDashView::setImplicitHeightDirty()
270−{
271− m_implicitHeightDirty = true;
272−}
273−
274−void AbstractDashView::itemCreated(int modelIndex, QObject *object)
275−{
276− QQuickItem *item = qmlobject_cast<QQuickItem*>(object);
277− if (!item) {
278− qWarning() << "AbstractDashView::itemCreated got a non item for index" << modelIndex;
279− return;
280− }
281− item->setParentItem(this);
282−
283− // We only need to call createItem if we are here because of an asynchronous generation
284− // otherwise we are in this slot because createItem is creating the item sync
285− // and thus we don't need to call createItem again, nor need to set m_implicitHeightDirty
286− // and call polish because the sync createItem was called from addVisibleItems that
287− // is called from refill that will already do those if an item was added
288− if (modelIndex == m_asyncRequestedIndex) {
289− createItem(modelIndex, false);
290− m_implicitHeightDirty = true;
291− polish();
292− }
293−}
294−
295−void AbstractDashView::onModelUpdated(const QQmlChangeSet &changeSet, bool reset)
296−{
297− if (reset) {
298− cleanupExistingItems();
299− } else {
300− processModelRemoves(changeSet.removes());
301−
302− // The current AbstractDashViews do not support insertions that are not at the end
303− // so reset if that happens
304− Q_FOREACH(const QQmlChangeSet::Change insert, changeSet.inserts()) {
305− if (insert.index < m_delegateModel->count() - 1) {
306− cleanupExistingItems();
307− break;
308− }
309− }
310− }
311− polish();
312−}
313−
314−
315−void AbstractDashView::relayout()
316−{
317− m_needsRelayout = true;
318− polish();
319−}
320−
321−void AbstractDashView::onHeightChanged()
322−{
323− polish();
324−}
325−
326−void AbstractDashView::updatePolish()
327−{
328− if (!model())
329− return;
330−
331− if (m_needsRelayout) {
332− doRelayout();
333− m_needsRelayout = false;
334− m_implicitHeightDirty = true;
335− }
336−
337− refill();
338−
339− const qreal from = -m_displayMarginBeginning;
340− const qreal to = height() + m_displayMarginEnd;
341− updateItemCulling(from, to);
342−
343− if (m_implicitHeightDirty) {
344− calculateImplicitHeight();
345− m_implicitHeightDirty = false;
346− }
347−}
348−
349−void AbstractDashView::componentComplete()
350−{
351− if (m_delegateModel)
352− m_delegateModel->componentComplete();
353−
354− QQuickItem::componentComplete();
355−
356− m_needsRelayout = true;
357−
358− polish();
359−}
plugins/Dash/abstractdashview.hdeleted−128
@@ -1,128 +0,0 @@
1−/*
2− * Copyright (C) 2013, 2014 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 ABSTRACTDASHVIEW_H
18−#define ABSTRACTDASHVIEW_H
19−
20−#include <QQuickItem>
21−
22−class QAbstractItemModel;
23−class QQmlComponent;
24−
25−#include <private/qqmldelegatemodel_p.h>
26−#include <private/qquickitemchangelistener_p.h>
27−#include <qqmlinfo.h>
28−
29−class AbstractDashView : public QQuickItem, public QQuickItemChangeListener
30−{
31− Q_OBJECT
32−
33− Q_PROPERTY(QAbstractItemModel *model READ model WRITE setModel NOTIFY modelChanged)
34− Q_PROPERTY(QQmlComponent *delegate READ delegate WRITE setDelegate NOTIFY delegateChanged)
35− Q_PROPERTY(qreal columnSpacing READ columnSpacing WRITE setColumnSpacing NOTIFY columnSpacingChanged)
36− Q_PROPERTY(qreal rowSpacing READ rowSpacing WRITE setRowSpacing NOTIFY rowSpacingChanged)
37− Q_PROPERTY(int cacheBuffer READ cacheBuffer WRITE setCacheBuffer NOTIFY cacheBufferChanged)
38− Q_PROPERTY(qreal displayMarginBeginning READ displayMarginBeginning
39− WRITE setDisplayMarginBeginning
40− NOTIFY displayMarginBeginningChanged)
41− Q_PROPERTY(qreal displayMarginEnd READ displayMarginEnd
42− WRITE setDisplayMarginEnd
43− NOTIFY displayMarginEndChanged)
44−
45−friend class VerticalJournalTest;
46−friend class HorizontalJournalTest;
47−friend class OrganicGridTest;
48−
49−public:
50− AbstractDashView();
51−
52− QAbstractItemModel *model() const;
53− void setModel(QAbstractItemModel *model);
54−
55− QQmlComponent *delegate() const;
56− void setDelegate(QQmlComponent *delegate);
57−
58− qreal columnSpacing() const;
59− void setColumnSpacing(qreal columnSpacing);
60−
61− qreal rowSpacing() const;
62− void setRowSpacing(qreal rowSpacing);
63−
64− int cacheBuffer() const;
65− void setCacheBuffer(int);
66−
67− qreal displayMarginBeginning() const;
68− void setDisplayMarginBeginning(qreal);
69−
70− qreal displayMarginEnd() const;
71− void setDisplayMarginEnd(qreal);
72−
73−Q_SIGNALS:
74− void modelChanged();
75− void delegateChanged();
76− void columnSpacingChanged();
77− void rowSpacingChanged();
78− void cacheBufferChanged();
79− void displayMarginBeginningChanged();
80− void displayMarginEndChanged();
81−
82−protected Q_SLOTS:
83− void relayout();
84−
85−protected:
86− void updatePolish() override;
87− void componentComplete() override;
88−
89− void releaseItem(QQuickItem *item);
90− void setImplicitHeightDirty();
91−
92−private Q_SLOTS:
93− void itemCreated(int modelIndex, QObject *object);
94− void onModelUpdated(const QQmlChangeSet &changeSet, bool reset);
95− void onHeightChanged();
96−
97−private:
98− void createDelegateModel();
99− void refill();
100− bool addVisibleItems(qreal fillFromY, qreal fillToY, bool asynchronous);
101− QQuickItem *createItem(int modelIndex, bool asynchronous);
102−
103− virtual void findBottomModelIndexToAdd(int *modelIndex, qreal *yPos) = 0;
104− virtual void findTopModelIndexToAdd(int *modelIndex, qreal *yPos) = 0;
105− virtual void addItemToView(int modelIndex, QQuickItem *item) = 0;
106− virtual bool removeNonVisibleItems(qreal bufferFromY, qreal bufferToY) = 0;
107− virtual void cleanupExistingItems() = 0;
108− virtual void doRelayout() = 0;
109− virtual void updateItemCulling(qreal visibleFromY, qreal visibleToY) = 0;
110− virtual void calculateImplicitHeight() = 0;
111− virtual void processModelRemoves(const QVector<QQmlChangeSet::Change> &removes) = 0;
112−
113− QQmlDelegateModel *m_delegateModel;
114−
115− // Index we are waiting because we requested it asynchronously
116− int m_asyncRequestedIndex;
117−
118− int m_columnSpacing;
119− int m_rowSpacing;
120− int m_buffer;
121− qreal m_displayMarginBeginning;
122− qreal m_displayMarginEnd;
123− bool m_needsRelayout;
124− bool m_delegateValidated;
125− bool m_implicitHeightDirty;
126−};
127−
128−#endif
plugins/Dash/graphics/music_progress_bg.pngdeleted

Binary file not shown.

plugins/Dash/horizontaljournal.cppdeleted−239
@@ -1,239 +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−/*
18− * The implementation is centered around m_visibleItems
19− * that a list for each of the items in the view.
20− * m_firstVisibleIndex is the index of the first item in m_visibleItems
21− * m_lastInRowIndexPosition is a map that contains the x position
22− * of items that are the last ones of a row so we can reconstruct the rows
23− * when building back
24− */
25−
26−#include "horizontaljournal.h"
27−
28−#include <qqmlengine.h>
29−#include <qqmlinfo.h>
30−#include <private/qqmldelegatemodel_p.h>
31−#include <private/qquickitem_p.h>
32−
33−HorizontalJournal::HorizontalJournal()
34− : m_firstVisibleIndex(-1)
35− , m_rowHeight(0)
36−{
37−}
38−
39−qreal HorizontalJournal::rowHeight() const
40−{
41− return m_rowHeight;
42−}
43−
44−void HorizontalJournal::setRowHeight(qreal rowHeight)
45−{
46− if (rowHeight != m_rowHeight) {
47− m_rowHeight = rowHeight;
48− Q_EMIT rowHeightChanged();
49−
50− if (isComponentComplete()) {
51− Q_FOREACH(QQuickItem *item, m_visibleItems) {
52− item->setHeight(rowHeight);
53− }
54− relayout();
55− }
56− }
57−}
58−
59−void HorizontalJournal::findBottomModelIndexToAdd(int *modelIndex, qreal *yPos)
60−{
61− if (m_visibleItems.isEmpty()) {
62− *modelIndex = 0;
63− *yPos = 0;
64− } else {
65− *modelIndex = m_firstVisibleIndex + m_visibleItems.count();
66− if (m_lastInRowIndexPosition.contains(*modelIndex - 1)) {
67− *yPos = m_visibleItems.last()->y() + m_rowHeight + rowSpacing();
68− } else {
69− *yPos = m_visibleItems.last()->y();
70− }
71− }
72−}
73−
74−void HorizontalJournal::findTopModelIndexToAdd(int *modelIndex, qreal *yPos)
75−{
76− if (m_visibleItems.isEmpty()) {
77− *modelIndex = -1;
78− *yPos = INT_MIN;
79− } else {
80− *modelIndex = m_firstVisibleIndex - 1;
81− if (m_lastInRowIndexPosition.contains(*modelIndex)) {
82− *yPos = m_visibleItems.first()->y() - rowSpacing() - m_rowHeight;
83− } else {
84− *yPos = m_visibleItems.first()->y();
85− }
86− }
87−}
88−
89−bool HorizontalJournal::removeNonVisibleItems(qreal bufferFromY, qreal bufferToY)
90−{
91− bool changed = false;
92−
93− while (!m_visibleItems.isEmpty() && m_visibleItems.first()->y() + m_rowHeight < bufferFromY) {
94− releaseItem(m_visibleItems.takeFirst());
95− changed = true;
96− m_firstVisibleIndex++;
97− }
98−
99− while (!m_visibleItems.isEmpty() && m_visibleItems.last()->y() > bufferToY) {
100− releaseItem(m_visibleItems.takeLast());
101− changed = true;
102− m_lastInRowIndexPosition.remove(m_firstVisibleIndex + m_visibleItems.count());
103− }
104−
105− if (m_visibleItems.isEmpty()) {
106− m_firstVisibleIndex = -1;
107− }
108−
109− return changed;
110−}
111−
112−void HorizontalJournal::addItemToView(int modelIndex, QQuickItem *item)
113−{
114− if (item->height() != m_rowHeight) {
115− qWarning() << "Item" << modelIndex << "height is not the one that the rowHeight mandates, resetting it";
116− item->setHeight(m_rowHeight);
117− }
118−
119− if (m_visibleItems.isEmpty()) {
120− Q_ASSERT(modelIndex == 0);
121− item->setY(0);
122− item->setX(0);
123− m_visibleItems << item;
124− m_firstVisibleIndex = 0;
125− } else {
126− // modelIndex has to be either m_firstVisibleIndex - 1 or m_firstVisibleIndex + m_visibleItems.count()
127− if (modelIndex == m_firstVisibleIndex + m_visibleItems.count()) {
128− QQuickItem *lastItem = m_visibleItems.last();
129− if (lastItem->x() + lastItem->width() + columnSpacing() + item->width() <= width()) {
130− // Fits in the row
131− item->setY(lastItem->y());
132− item->setX(lastItem->x() + lastItem->width() + columnSpacing());
133− } else {
134− // Starts a new row
135− item->setY(lastItem->y() + m_rowHeight + rowSpacing());
136− item->setX(0);
137− m_lastInRowIndexPosition[modelIndex - 1] = lastItem->x();
138− }
139− m_visibleItems << item;
140− } else if (modelIndex == m_firstVisibleIndex - 1) {
141− QQuickItem *firstItem = m_visibleItems.first();
142− if (m_lastInRowIndexPosition.contains(modelIndex)) {
143− // It is the last item of its row, so start a new one since we're going back
144− item->setY(firstItem->y() - rowSpacing() - m_rowHeight);
145− item->setX(m_lastInRowIndexPosition[modelIndex]);
146− } else {
147− item->setY(firstItem->y());
148− item->setX(firstItem->x() - columnSpacing() - item->width());
149− }
150− m_firstVisibleIndex = modelIndex;
151− m_visibleItems.prepend(item);
152− } else {
153− qWarning() << "HorizontalJournal::addItemToView - Got unexpected modelIndex"
154− << modelIndex << m_firstVisibleIndex << m_visibleItems.count();
155− }
156− }
157−}
158−
159−void HorizontalJournal::cleanupExistingItems()
160−{
161− // Cleanup the existing items
162− Q_FOREACH(QQuickItem *item, m_visibleItems)
163− releaseItem(item);
164− m_visibleItems.clear();
165− m_lastInRowIndexPosition.clear();
166− m_firstVisibleIndex = -1;
167− setImplicitHeightDirty();
168−}
169−
170−void HorizontalJournal::calculateImplicitHeight()
171−{
172− if (m_firstVisibleIndex >= 0) {
173− const int nIndexes = m_firstVisibleIndex + m_visibleItems.count();
174− const double bottomMostY = m_visibleItems.last()->y() + m_rowHeight;
175− const double averageHeight = bottomMostY / nIndexes;
176− setImplicitHeight(bottomMostY + averageHeight * (model()->rowCount() - nIndexes));
177− } else {
178− setImplicitHeight(0);
179− }
180−}
181−
182−void HorizontalJournal::processModelRemoves(const QVector<QQmlChangeSet::Change> &removes)
183−{
184− Q_FOREACH(const QQmlChangeSet::Change remove, removes) {
185− for (int i = remove.count - 1; i >= 0; --i) {
186− const int indexToRemove = remove.index + i;
187− // We only support removing from the end so
188− // any of the last items of a column has to be indexToRemove
189− const int lastIndex = m_firstVisibleIndex + m_visibleItems.count() - 1;
190− if (indexToRemove == lastIndex) {
191− releaseItem(m_visibleItems.takeLast());
192− m_lastInRowIndexPosition.remove(indexToRemove);
193− } else {
194− if (indexToRemove < lastIndex) {
195− qDebug() << "HorizontalJournal only supports removal from the end of the model, resetting instead";
196− cleanupExistingItems();
197− break;
198− } else {
199− setImplicitHeightDirty();
200− }
201− }
202− }
203− }
204− if (m_visibleItems.isEmpty()) {
205− m_firstVisibleIndex = -1;
206− }
207−}
208−
209−
210−void HorizontalJournal::doRelayout()
211−{
212− // If m_firstVisibleIndex is not 0 we need to drop all the delegates
213− // since we can't consistently relayout without the first item being there
214−
215− if (m_firstVisibleIndex == 0) {
216− int i = 0;
217− const QList<QQuickItem*> allItems = m_visibleItems;
218− m_visibleItems.clear();
219− m_lastInRowIndexPosition.clear();
220− Q_FOREACH(QQuickItem *item, allItems) {
221− addItemToView(i, item);
222− ++i;
223− }
224− } else {
225− Q_FOREACH(QQuickItem *item, m_visibleItems) {
226− releaseItem(item);
227− }
228− m_visibleItems.clear();
229− m_lastInRowIndexPosition.clear();
230− m_firstVisibleIndex = -1;
231− }
232−}
233−
234−void HorizontalJournal::updateItemCulling(qreal visibleFromY, qreal visibleToY)
235−{
236− Q_FOREACH(QQuickItem *item, m_visibleItems) {
237− QQuickItemPrivate::get(item)->setCulled(item->y() + m_rowHeight <= visibleFromY || item->y() >= visibleToY);
238− }
239−}
plugins/Dash/horizontaljournal.hdeleted−63
@@ -1,63 +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−#ifndef HORIZONTALJOURNAL_H
18−#define HORIZONTALJOURNAL_H
19−
20−#include "abstractdashview.h"
21−
22− /** A horizontal journal is a view that creates delegates
23− * based on a model and layouts them one after the other
24− * in the same row until there is no more free space for the next item
25− * and so that item is layouted in the next row
26− *
27− * All delegates are forced to rowHeight if they don't have it.
28− */
29− class HorizontalJournal : public AbstractDashView
30−{
31− Q_OBJECT
32−
33− Q_PROPERTY(qreal rowHeight READ rowHeight WRITE setRowHeight NOTIFY rowHeightChanged)
34−
35−friend class HorizontalJournalTest;
36−
37−public:
38− HorizontalJournal();
39−
40− qreal rowHeight() const;
41− void setRowHeight(qreal rowHeight);
42−
43−Q_SIGNALS:
44− void rowHeightChanged();
45−
46−private:
47− void findBottomModelIndexToAdd(int *modelIndex, qreal *yPos) override;
48− void findTopModelIndexToAdd(int *modelIndex, qreal *yPos) override;
49− bool removeNonVisibleItems(qreal bufferFromY, qreal bufferToY) override;
50− void addItemToView(int modelIndex, QQuickItem *item) override;
51− void cleanupExistingItems() override;
52− void calculateImplicitHeight() override;
53− void doRelayout() override;
54− void updateItemCulling(qreal visibleFromY, qreal visibleToY) override;
55− void processModelRemoves(const QVector<QQmlChangeSet::Change> &removes) override;
56−
57− int m_firstVisibleIndex;
58− QList<QQuickItem*> m_visibleItems;
59− QMap<int, double> m_lastInRowIndexPosition;
60− int m_rowHeight;
61−};
62−
63−#endif
plugins/Dash/listviewwithpageheader.cppdeleted−1394
@@ -1,1394 +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−/*
18− * Some documentation on how this thing works:
19− *
20− * A flickable has two very important concepts that define the top and
21− * height of the flickable area.
22− * The top is returned in minYExtent()
23− * The height is set using setContentHeight()
24− * By changing those two values we can make the list grow up or down
25− * as needed. e.g. if we are in the middle of the list
26− * and something that is above the viewport grows, since we do not
27− * want to change the viewport because of that we just adjust the
28− * minYExtent so that the list grows up.
29− *
30− * The implementation on the list relies on the delegateModel doing
31− * most of the instantiation work. You call createItem() when you
32− * need to create an item asking for it async or not. If returns null
33− * it means the item will be created async and the model will call the
34− * itemCreated slot with the item.
35− *
36− * updatePolish is the central point of dispatch for the work of the
37− * class. It is called by the scene graph just before drawing the class.
38− * In it we:
39− * * Make sure all items are positioned correctly
40− * * Add/Remove items if needed
41− * * Update the content height if it was dirty
42− *
43− * m_visibleItems contains all the items we have created at the moment.
44− * Actually not all of them are visible since it includes the ones
45− * in the cache area we create asynchronously to help performance.
46− * The first item in m_visibleItems has the m_firstVisibleIndex in
47− * the model. If you actually want to know what is the first
48− * item in the viewport you have to find the first non culled element
49− * in m_visibleItems
50− *
51− * All the items (except the header) are childs of m_clipItem which
52− * is a child of the contentItem() of the flickable (The contentItem()
53− * is what actually 'moves' in a a flickable). This way
54− * we can implement the clipping needed so we can have the header
55− * shown in the middle of the list over the items without the items
56− * leaking under the header in case it is transparent.
57− *
58− * The first item of m_visibleItems is the one that defines the
59− * positions of all the rest of items (see updatePolish()) and
60− * this is why sometimes we move it even if it's not the item
61− * that has triggered the function (i.e. in itemGeometryChanged())
62− *
63− * m_visibleItems is a list of ListItem. Each ListItem
64− * will contain a item and potentially a sectionItem. The sectionItem
65− * is only there when the list is using sectionDelegate+sectionProperty
66− * and this is the first item of the section. Each ListItem is vertically
67− * layouted with the sectionItem first and then the item.
68− *
69− * For sectioning we also have a section item alone (m_topSectionItem)
70− * that is used for the cases we need to show the sticky section item at
71− * the top of the view.
72− *
73− * Each delegate item has a context property called heightToClip that is
74− * used to communicate to the delegate implementation in case it has to
75− * clip itself because of overlapping with the top sticky section item.
76− * This is an implementation decision since it has been agreed it
77− * is easier to implement the clipping in QML with this info than to
78− * do it at the C++ level.
79− *
80− * Note that minYExtent and height are not always totally accurate, since
81− * we don't have the items created we can't guess their heights
82− * so we can only guarantee the values are correct when the first/last
83− * items of the list are visible, otherwise we just live with good enough
84− * values that make the list scrollable
85− *
86− * There are a few things that are not really implemented or tested properly
87− * which we don't use at the moment like changing the model, changing
88− * the section delegate, having a section delegate that changes its size, etc.
89− * The known missing features are marked with TODOs along the code.
90− */
91−
92−#include "listviewwithpageheader.h"
93−
94−#include <QCoreApplication>
95−#include <QDebug>
96−#include <qqmlinfo.h>
97−#include <qqmlengine.h>
98−#include <private/qqmlcontext_p.h>
99−#include <private/qqmldelegatemodel_p.h>
100−#include <private/qqmlglobal_p.h>
101−#include <private/qquickitem_p.h>
102−#include <private/qquickanimation_p.h>
103−// #include <private/qquickrectangle_p.h>
104−
105−qreal ListViewWithPageHeader::ListItem::height() const
106−{
107− return m_item->height() + (m_sectionItem ? m_sectionItem->height() : 0);
108−}
109−
110−qreal ListViewWithPageHeader::ListItem::y() const
111−{
112− return m_item->y() - (m_sectionItem ? m_sectionItem->height() : 0);
113−}
114−
115−void ListViewWithPageHeader::ListItem::setY(qreal newY)
116−{
117− if (m_sectionItem) {
118− m_sectionItem->setY(newY);
119− m_item->setY(newY + m_sectionItem->height());
120− } else {
121− m_item->setY(newY);
122− }
123−}
124−
125−bool ListViewWithPageHeader::ListItem::culled() const
126−{
127− return QQuickItemPrivate::get(m_item)->culled;
128−}
129−
130−void ListViewWithPageHeader::ListItem::setCulled(bool culled)
131−{
132− QQuickItemPrivate::get(m_item)->setCulled(culled);
133− if (m_sectionItem)
134− QQuickItemPrivate::get(m_sectionItem)->setCulled(culled);
135−}
136−
137−void ListViewWithPageHeader::ListItem::setSectionItem(QQuickItem *sectionItem)
138−{
139− m_sectionItem = sectionItem;
140−}
141−
142−ListViewWithPageHeader::ListViewWithPageHeader()
143− : m_delegateModel(nullptr)
144− , m_asyncRequestedIndex(-1)
145− , m_delegateValidated(false)
146− , m_firstVisibleIndex(-1)
147− , m_minYExtent(0)
148− , m_contentHeightDirty(false)
149− , m_headerItem(nullptr)
150− , m_previousContentY(0)
151− , m_headerItemShownHeight(0)
152− , m_sectionDelegate(nullptr)
153− , m_topSectionItem(nullptr)
154− , m_forceNoClip(false)
155− , m_inLayout(false)
156− , m_inContentHeightKeepHeaderShown(false)
157− , m_cacheBuffer(0)
158−{
159− m_clipItem = new QQuickItem(contentItem());
160−// m_clipItem = new QQuickRectangle(contentItem());
161−// ((QQuickRectangle*)m_clipItem)->setColor(Qt::gray);
162−
163− m_contentYAnimation = new QQuickNumberAnimation(this);
164− m_contentYAnimation->setEasing(QEasingCurve::OutQuad);
165− m_contentYAnimation->setProperty(QStringLiteral("contentY"));
166− m_contentYAnimation->setDuration(200);
167− m_contentYAnimation->setTargetObject(this);
168−
169− connect(contentItem(), &QQuickItem::widthChanged, this, &ListViewWithPageHeader::onContentWidthChanged);
170− connect(this, &ListViewWithPageHeader::contentHeightChanged, this, &ListViewWithPageHeader::onContentHeightChanged);
171− connect(this, &ListViewWithPageHeader::heightChanged, this, &ListViewWithPageHeader::onHeightChanged);
172− connect(m_contentYAnimation, &QQuickNumberAnimation::runningChanged, this, &ListViewWithPageHeader::contentYAnimationRunningChanged);
173−
174− setFlickableDirection(VerticalFlick);
175−}
176−
177−ListViewWithPageHeader::~ListViewWithPageHeader()
178−{
179−}
180−
181−QAbstractItemModel *ListViewWithPageHeader::model() const
182−{
183− return m_delegateModel ? m_delegateModel->model().value<QAbstractItemModel *>() : nullptr;
184−}
185−
186−void ListViewWithPageHeader::setModel(QAbstractItemModel *model)
187−{
188− if (model != this->model()) {
189− if (!m_delegateModel) {
190− createDelegateModel();
191− } else {
192− disconnect(m_delegateModel, &QQmlDelegateModel::modelUpdated, this, &ListViewWithPageHeader::onModelUpdated);
193− }
194− m_delegateModel->setModel(QVariant::fromValue<QAbstractItemModel *>(model));
195− connect(m_delegateModel, &QQmlDelegateModel::modelUpdated, this, &ListViewWithPageHeader::onModelUpdated);
196− Q_EMIT modelChanged();
197− polish();
198− // TODO?
199−// Q_EMIT contentHeightChanged();
200−// Q_EMIT contentYChanged();
201− }
202−}
203−
204−QQmlComponent *ListViewWithPageHeader::delegate() const
205−{
206− return m_delegateModel ? m_delegateModel->delegate() : nullptr;
207−}
208−
209−void ListViewWithPageHeader::setDelegate(QQmlComponent *delegate)
210−{
211− if (delegate != this->delegate()) {
212− if (!m_delegateModel) {
213− createDelegateModel();
214− }
215−
216− // Cleanup the existing items
217− Q_FOREACH(ListItem *item, m_visibleItems)
218− releaseItem(item);
219− m_visibleItems.clear();
220− initializeValuesForEmptyList();
221−
222− m_delegateModel->setDelegate(delegate);
223−
224− Q_EMIT delegateChanged();
225− m_delegateValidated = false;
226− m_contentHeightDirty = true;
227− polish();
228− }
229−}
230−
231−void ListViewWithPageHeader::initializeValuesForEmptyList()
232−{
233− m_firstVisibleIndex = -1;
234− adjustMinYExtent();
235− setContentY(0);
236− m_clipItem->setY(0);
237− if (m_topSectionItem) {
238− QQuickItemPrivate::get(m_topSectionItem)->setCulled(true);
239− }
240−}
241−
242−QQuickItem *ListViewWithPageHeader::header() const
243−{
244− return m_headerItem;
245−}
246−
247−void ListViewWithPageHeader::setHeader(QQuickItem *headerItem)
248−{
249− if (m_headerItem != headerItem) {
250− qreal oldHeaderHeight = 0;
251− qreal oldHeaderY = 0;
252− if (m_headerItem) {
253− oldHeaderHeight = m_headerItem->height();
254− oldHeaderY = m_headerItem->y();
255− m_headerItem->setParentItem(nullptr);
256− QQuickItemPrivate::get(m_headerItem)->removeItemChangeListener(this, QQuickItemPrivate::ImplicitHeight);
257− }
258− m_headerItem = headerItem;
259− if (m_headerItem) {
260− m_headerItem->setParentItem(contentItem());
261− m_headerItem->setZ(1);
262− m_previousHeaderImplicitHeight = m_headerItem->implicitHeight();
263− QQuickItemPrivate::get(m_headerItem)->addItemChangeListener(this, QQuickItemPrivate::ImplicitHeight);
264− }
265− qreal newHeaderHeight = m_headerItem ? m_headerItem->height() : 0;
266− if (!m_visibleItems.isEmpty() && newHeaderHeight != oldHeaderHeight) {
267− headerHeightChanged(newHeaderHeight, oldHeaderHeight, oldHeaderY);
268− polish();
269− m_contentHeightDirty = true;
270− }
271− Q_EMIT headerChanged();
272− }
273−}
274−
275−QQmlComponent *ListViewWithPageHeader::sectionDelegate() const
276−{
277− return m_sectionDelegate;
278−}
279−
280−void ListViewWithPageHeader::setSectionDelegate(QQmlComponent *delegate)
281−{
282− if (delegate != m_sectionDelegate) {
283− // TODO clean existing sections
284−
285− m_sectionDelegate = delegate;
286−
287− m_topSectionItem = getSectionItem(QString(), false /*watchGeometry*/);
288− if (m_topSectionItem) {
289− m_topSectionItem->setZ(3);
290− QQuickItemPrivate::get(m_topSectionItem)->setCulled(true);
291− connect(m_topSectionItem, &QQuickItem::heightChanged, this, &ListViewWithPageHeader::stickyHeaderHeightChanged);
292− }
293−
294− // TODO create sections for existing items
295−
296− Q_EMIT sectionDelegateChanged();
297− Q_EMIT stickyHeaderHeightChanged();
298− }
299−}
300−
301−QString ListViewWithPageHeader::sectionProperty() const
302−{
303− return m_sectionProperty;
304−}
305−
306−void ListViewWithPageHeader::setSectionProperty(const QString &property)
307−{
308− if (property != m_sectionProperty) {
309− m_sectionProperty = property;
310−
311− updateWatchedRoles();
312−
313− // TODO recreate sections
314−
315− Q_EMIT sectionPropertyChanged();
316− }
317−}
318−
319−bool ListViewWithPageHeader::forceNoClip() const
320−{
321− return m_forceNoClip;
322−}
323−
324−void ListViewWithPageHeader::setForceNoClip(bool noClip)
325−{
326− if (noClip != m_forceNoClip) {
327− m_forceNoClip = noClip;
328− updateClipItem();
329− Q_EMIT forceNoClipChanged();
330− }
331−}
332−
333−int ListViewWithPageHeader::stickyHeaderHeight() const
334−{
335− return m_topSectionItem ? m_topSectionItem->height() : 0;
336−}
337−
338−qreal ListViewWithPageHeader::headerItemShownHeight() const
339−{
340− return m_headerItemShownHeight;
341−}
342−
343−int ListViewWithPageHeader::cacheBuffer() const
344−{
345− return m_cacheBuffer;
346−}
347−
348−void ListViewWithPageHeader::setCacheBuffer(int cacheBuffer)
349−{
350− if (cacheBuffer < 0) {
351− qmlInfo(this) << "Cannot set a negative cache buffer";
352− return;
353− }
354−
355− if (cacheBuffer != m_cacheBuffer) {
356− m_cacheBuffer = cacheBuffer;
357− Q_EMIT cacheBufferChanged();
358− polish();
359− }
360−}
361−
362−void ListViewWithPageHeader::positionAtBeginning()
363−{
364− if (m_delegateModel->count() <= 0)
365− return;
366−
367− qreal headerHeight = (m_headerItem ? m_headerItem->height() : 0);
368− if (m_firstVisibleIndex != 0) {
369− // TODO This could be optimized by trying to reuse the interesection
370− // of items that may end up intersecting between the existing
371− // m_visibleItems and the items we are creating in the next loop
372− Q_FOREACH(ListItem *item, m_visibleItems)
373− releaseItem(item);
374− m_visibleItems.clear();
375− m_firstVisibleIndex = -1;
376−
377− // Create the item 0, it will be already correctly positioned at createItem()
378− m_clipItem->setY(0);
379− ListItem *item = createItem(0, false);
380− // Create the subsequent items
381− int modelIndex = 1;
382− qreal pos = item->y() + item->height();
383− const qreal bufferTo = height() + m_cacheBuffer;
384− while (modelIndex < m_delegateModel->count() && pos <= bufferTo) {
385− if (!(item = createItem(modelIndex, false)))
386− break;
387− pos += item->height();
388− ++modelIndex;
389− }
390−
391− m_previousContentY = m_visibleItems.first()->y() - headerHeight;
392− }
393− setContentY(m_visibleItems.first()->y() + m_clipItem->y() - headerHeight);
394− if (m_headerItem) {
395− // TODO This should not be needed and the code that adjust the m_headerItem position
396− // in viewportMoved() should be enough but in some cases we have not found a way to reproduce
397− // yet the code of viewportMoved() fails so here we make sure that at least if we are calling
398− // positionAtBeginning the header item will be correctly positioned
399− m_headerItem->setY(-m_minYExtent);
400− }
401−}
402−
403−static inline bool uFuzzyCompare(qreal r1, qreal r2)
404−{
405− return qFuzzyCompare(r1, r2) || (qFuzzyIsNull(r1) && qFuzzyIsNull(r2));
406−}
407−
408−void ListViewWithPageHeader::showHeader()
409−{
410− if (!m_headerItem)
411− return;
412−
413− const auto to = qMax(-minYExtent(), contentY() - m_headerItem->height() + m_headerItemShownHeight);
414− if (!uFuzzyCompare(to, contentY())) {
415− const bool headerShownByItsOwn = contentY() < m_headerItem->y() + m_headerItem->height();
416− if (headerShownByItsOwn && m_headerItemShownHeight == 0) {
417− // We are not clipping since we are just at the top of the viewport
418− // but because of the showHeader animation we will need to, so
419− // enable the clipping without logically moving the items
420− m_headerItemShownHeight = m_headerItem->y() + m_headerItem->height() - contentY();
421− if (!m_visibleItems.isEmpty()) {
422− updateClipItem();
423− ListItem *firstItem = m_visibleItems.first();
424− firstItem->setY(firstItem->y() - m_headerItemShownHeight);
425− layout();
426− }
427− Q_EMIT headerItemShownHeightChanged();
428− }
429− m_contentYAnimation->setTo(to);
430− contentYAnimationType = ContentYAnimationShowHeader;
431− m_contentYAnimation->start();
432− }
433−}
434−
435−int ListViewWithPageHeader::firstCreatedIndex() const
436−{
437− return m_firstVisibleIndex;
438−}
439−
440−int ListViewWithPageHeader::createdItemCount() const
441−{
442− return m_visibleItems.count();
443−}
444−
445−QQuickItem *ListViewWithPageHeader::item(int modelIndex) const
446−{
447− ListItem *item = itemAtIndex(modelIndex);
448− if (item)
449− return item->m_item;
450− else
451− return nullptr;
452−}
453−
454−bool ListViewWithPageHeader::maximizeVisibleArea(int modelIndex)
455−{
456− ListItem *listItem = itemAtIndex(modelIndex);
457− if (listItem) {
458− return maximizeVisibleArea(listItem, listItem->height());
459− }
460−
461− return false;
462−}
463−
464−bool ListViewWithPageHeader::maximizeVisibleArea(int modelIndex, int itemHeight)
465−{
466− if (itemHeight < 0)
467− return false;
468−
469− ListItem *listItem = itemAtIndex(modelIndex);
470− if (listItem) {
471− return maximizeVisibleArea(listItem, itemHeight + (listItem->sectionItem() ? listItem->sectionItem()->height() : 0));
472− }
473−
474− return false;
475−}
476−
477−bool ListViewWithPageHeader::maximizeVisibleArea(ListItem *listItem, int listItemHeight)
478−{
479− if (listItem) {
480− layout();
481− const auto listItemY = m_clipItem->y() + listItem->y();
482− if (listItemY > contentY() && listItemY + listItemHeight > contentY() + height()) {
483− // we can scroll the list up to show more stuff
484− const auto to = qMin(listItemY, listItemY + listItemHeight - height());
485− m_contentYAnimation->setTo(to);
486− contentYAnimationType = ContentYAnimationMaximizeVisibleArea;
487− m_contentYAnimation->start();
488− } else if ((listItemY < contentY() && listItemY + listItemHeight < contentY() + height()) ||
489− (m_topSectionItem && !listItem->sectionItem() && listItemY - m_topSectionItem->height() < contentY() && listItemY + listItemHeight < contentY() + height()))
490− {
491− // we can scroll the list down to show more stuff
492− auto realVisibleListItemY = listItemY;
493− if (m_topSectionItem) {
494− // If we are showing the top section sticky item and this item doesn't have a section
495− // item we have to make sure to scroll it a bit more so that it is not underlapping
496− // the top section sticky item
497− bool topSectionShown = !QQuickItemPrivate::get(m_topSectionItem)->culled;
498− if (topSectionShown && !listItem->sectionItem()) {
499− realVisibleListItemY -= m_topSectionItem->height();
500− }
501− }
502− const auto to = qMax(realVisibleListItemY, listItemY + listItemHeight - height());
503− m_contentYAnimation->setTo(to);
504− contentYAnimationType = ContentYAnimationMaximizeVisibleArea;
505− m_contentYAnimation->start();
506− }
507− return true;
508− }
509− return false;
510−}
511−
512−qreal ListViewWithPageHeader::minYExtent() const
513−{
514−// qDebug() << "ListViewWithPageHeader::minYExtent" << m_minYExtent;
515− return m_minYExtent;
516−}
517−
518−qreal ListViewWithPageHeader::maxYExtent() const
519−{
520− return height() - contentHeight();
521−}
522−
523−void ListViewWithPageHeader::componentComplete()
524−{
525− if (m_delegateModel)
526− m_delegateModel->componentComplete();
527−
528− QQuickFlickable::componentComplete();
529−
530− polish();
531−}
532−
533−void ListViewWithPageHeader::viewportMoved(Qt::Orientations orient)
534−{
535− // Check we are not being taken down and don't paint anything
536− // TODO Check if we still need this in 5.2
537− // For reproduction just inifnite loop testDash or testDashContent
538− if (!QQmlEngine::contextForObject(this)->parentContext())
539− return;
540−
541− QQuickFlickable::viewportMoved(orient);
542−// qDebug() << "ListViewWithPageHeader::viewportMoved" << contentY();
543− const qreal diff = m_previousContentY - contentY();
544− adjustHeader(diff);
545− m_previousContentY = contentY();
546− layout();
547− polish();
548−}
549−
550−void ListViewWithPageHeader::adjustHeader(qreal diff)
551−{
552− const bool showHeaderAnimationRunning = m_contentYAnimation->isRunning() && contentYAnimationType == ContentYAnimationShowHeader;
553− if (m_headerItem) {
554− const auto oldHeaderItemShownHeight = m_headerItemShownHeight;
555− if (uFuzzyCompare(contentY(), -m_minYExtent) || contentY() > -m_minYExtent) {
556− m_headerItem->setHeight(m_headerItem->implicitHeight());
557− // We are going down (but it's not because of the rebound at the end)
558− // (but the header was not shown by it's own position)
559− // or the header is partially shown and we are not doing a maximizeVisibleArea either
560− const bool scrolledUp = m_previousContentY > contentY();
561− const bool notRebounding = qRound(contentY() + height()) < qRound(contentHeight());
562− const bool notShownByItsOwn = contentY() + diff >= m_headerItem->y() + m_headerItem->height();
563− const bool maximizeVisibleAreaRunning = m_contentYAnimation->isRunning() && contentYAnimationType == ContentYAnimationMaximizeVisibleArea;
564−
565− if (!scrolledUp && (contentY() == -m_minYExtent || (m_headerItemShownHeight == 0 && m_previousContentY == m_headerItem->y()))) {
566− m_headerItemShownHeight = 0;
567− m_headerItem->setY(-m_minYExtent);
568− } else if ((scrolledUp && notRebounding && notShownByItsOwn && !maximizeVisibleAreaRunning) || (m_headerItemShownHeight > 0) || m_inContentHeightKeepHeaderShown) {
569− if (maximizeVisibleAreaRunning && diff > 0) {
570− // If we are maximizing and the header was shown, make sure we hide it
571− m_headerItemShownHeight -= diff;
572− } else {
573− m_headerItemShownHeight += diff;
574− }
575− if (uFuzzyCompare(contentY(), -m_minYExtent)) {
576− m_headerItemShownHeight = 0;
577− } else {
578− m_headerItemShownHeight = qBound(static_cast<qreal>(0.), m_headerItemShownHeight, m_headerItem->height());
579− }
580− if (m_headerItemShownHeight > 0) {
581− if (uFuzzyCompare(m_headerItem->height(), m_headerItemShownHeight)) {
582− m_headerItem->setY(contentY());
583− m_headerItemShownHeight = m_headerItem->height();
584− } else {
585− m_headerItem->setY(contentY() - m_headerItem->height() + m_headerItemShownHeight);
586− }
587− } else {
588− m_headerItem->setY(-m_minYExtent);
589− }
590− } else if (m_headerItemShownHeight == 0 && m_previousContentY > m_headerItem->y() && contentY() < m_headerItem->y()) {
591− // The header was hidden but now that we've moved up (e.g. because of item removed) it's visible
592− // make sure it isn't
593− m_headerItem->setY(-m_minYExtent);
594− }
595− Q_EMIT headerItemShownHeightChanged();
596− } else {
597− // Stick the header item to the top when dragging down
598− m_headerItem->setY(contentY());
599− m_headerItem->setHeight(m_headerItem->implicitHeight() + (-m_minYExtent - contentY()));
600− }
601− // We will be changing the clip item, need to accomadate for it
602− // otherwise we move the firstItem down/up twice (unless the
603− // show header animation is running, where we want to keep the viewport stable)
604− if (!showHeaderAnimationRunning) {
605− diff += oldHeaderItemShownHeight - m_headerItemShownHeight;
606− } else {
607− diff = -diff;
608− }
609− }
610− if (!m_visibleItems.isEmpty()) {
611− updateClipItem();
612− ListItem *firstItem = m_visibleItems.first();
613− firstItem->setY(firstItem->y() + diff);
614− if (showHeaderAnimationRunning) {
615− adjustMinYExtent();
616− }
617− }
618−}
619−
620−void ListViewWithPageHeader::createDelegateModel()
621−{
622− m_delegateModel = new QQmlDelegateModel(qmlContext(this), this);
623− connect(m_delegateModel, &QQmlDelegateModel::createdItem, this, &ListViewWithPageHeader::itemCreated);
624− if (isComponentComplete())
625− m_delegateModel->componentComplete();
626− updateWatchedRoles();
627−}
628−
629−void ListViewWithPageHeader::refill()
630−{
631− if (m_inLayout) {
632− return;
633− }
634− if (!isComponentComplete()) {
635− return;
636− }
637−
638− const qreal from = contentY();
639− const qreal to = from + height();
640− const qreal bufferFrom = from - m_cacheBuffer;
641− const qreal bufferTo = to + m_cacheBuffer;
642−
643− bool added = addVisibleItems(from, to, false);
644− bool removed = removeNonVisibleItems(bufferFrom, bufferTo);
645− added |= addVisibleItems(bufferFrom, bufferTo, true);
646−
647− if (added || removed) {
648− m_contentHeightDirty = true;
649− }
650−}
651−
652−bool ListViewWithPageHeader::addVisibleItems(qreal fillFrom, qreal fillTo, bool asynchronous)
653−{
654− if (!delegate())
655− return false;
656−
657− if (m_delegateModel->count() == 0)
658− return false;
659−
660− ListItem *item;
661−// qDebug() << "ListViewWithPageHeader::addVisibleItems" << fillFrom << fillTo << asynchronous;
662−
663− int modelIndex = 0;
664− qreal pos = 0;
665− if (!m_visibleItems.isEmpty()) {
666− modelIndex = m_firstVisibleIndex + m_visibleItems.count();
667− item = m_visibleItems.last();
668− pos = item->y() + item->height() + m_clipItem->y();
669− }
670− bool changed = false;
671−// qDebug() << (modelIndex < m_delegateModel->count()) << pos << fillTo;
672− while (modelIndex < m_delegateModel->count() && pos <= fillTo) {
673−// qDebug() << "refill: append item" << modelIndex << "pos" << pos << "asynchronous" << asynchronous;
674− if (!(item = createItem(modelIndex, asynchronous)))
675− break;
676− pos += item->height();
677− ++modelIndex;
678− changed = true;
679− }
680−
681− modelIndex = 0;
682− pos = 0;
683− if (!m_visibleItems.isEmpty()) {
684− modelIndex = m_firstVisibleIndex - 1;
685− item = m_visibleItems.first();
686− pos = item->y() + m_clipItem->y();
687− }
688− while (modelIndex >= 0 && pos > fillFrom) {
689−// qDebug() << "refill: prepend item" << modelIndex << "pos" << pos << "fillFrom" << fillFrom << "asynchronous" << asynchronous;
690− if (!(item = createItem(modelIndex, asynchronous)))
691− break;
692− pos -= item->height();
693− --modelIndex;
694− changed = true;
695− }
696−
697− return changed;
698−}
699−
700−void ListViewWithPageHeader::reallyReleaseItem(ListItem *listItem)
701−{
702− QQuickItem *item = listItem->m_item;
703− QQmlDelegateModel::ReleaseFlags flags = m_delegateModel->release(item);
704− if (flags & QQmlDelegateModel::Destroyed) {
705− item->setParentItem(nullptr);
706− }
707− if (listItem->sectionItem()) {
708− listItem->sectionItem()->deleteLater();
709− }
710− delete listItem;
711−}
712−
713−void ListViewWithPageHeader::releaseItem(ListItem *listItem)
714−{
715− QQuickItemPrivate::get(listItem->m_item)->removeItemChangeListener(this, QQuickItemPrivate::Geometry);
716− if (listItem->sectionItem()) {
717− QQuickItemPrivate::get(listItem->sectionItem())->removeItemChangeListener(this, QQuickItemPrivate::Geometry);
718− }
719− m_itemsToRelease << listItem;
720−}
721−
722−void ListViewWithPageHeader::updateWatchedRoles()
723−{
724− if (m_delegateModel) {
725− QList<QByteArray> roles;
726− if (!m_sectionProperty.isEmpty())
727− roles << m_sectionProperty.toUtf8();
728− m_delegateModel->setWatchedRoles(roles);
729− }
730−}
731−
732−QQuickItem *ListViewWithPageHeader::getSectionItem(int modelIndex, bool alreadyInserted)
733−{
734− if (!m_sectionDelegate)
735− return nullptr;
736−
737− const QString section = m_delegateModel->stringValue(modelIndex, m_sectionProperty);
738−
739− if (modelIndex > 0) {
740− const QString prevSection = m_delegateModel->stringValue(modelIndex - 1, m_sectionProperty);
741− if (section == prevSection)
742− return nullptr;
743− }
744− if (modelIndex + 1 < model()->rowCount() && !alreadyInserted) {
745− // Already inserted items can't steal next section header
746− const QString nextSection = m_delegateModel->stringValue(modelIndex + 1, m_sectionProperty);
747− if (section == nextSection) {
748− // Steal the section header
749− ListItem *nextItem = itemAtIndex(modelIndex); // Not +1 since not yet inserted into m_visibleItems
750− if (nextItem) {
751− QQuickItem *sectionItem = nextItem->sectionItem();
752− nextItem->setSectionItem(nullptr);
753− return sectionItem;
754− }
755− }
756− }
757−
758− return getSectionItem(section);
759−}
760−
761−QQuickItem *ListViewWithPageHeader::getSectionItem(const QString &sectionText, bool watchGeometry)
762−{
763− QQuickItem *sectionItem = nullptr;
764−
765− QQmlContext *creationContext = m_sectionDelegate->creationContext();
766− QQmlContext *context = new QQmlContext(creationContext ? creationContext : qmlContext(this));
767− QObject *nobj = m_sectionDelegate->beginCreate(context);
768− if (nobj) {
769− QQml_setParent_noEvent(context, nobj);
770− sectionItem = qobject_cast<QQuickItem *>(nobj);
771− if (!sectionItem) {
772− delete nobj;
773− } else {
774− sectionItem->setProperty("text", sectionText);
775− sectionItem->setProperty("delegate", QVariant());
776− sectionItem->setZ(2);
777− QQml_setParent_noEvent(sectionItem, m_clipItem);
778− sectionItem->setParentItem(m_clipItem);
779− }
780− } else {
781− delete context;
782− }
783− m_sectionDelegate->completeCreate();
784−
785− if (watchGeometry && sectionItem) {
786− QQuickItemPrivate::get(sectionItem)->addItemChangeListener(this, QQuickItemPrivate::Geometry);
787− }
788−
789− return sectionItem;
790−}
791−
792−void ListViewWithPageHeader::updateSectionItem(int modelIndex)
793−{
794− ListItem *item = itemAtIndex(modelIndex);
795− if (item) {
796− const QString sectionText = m_delegateModel->stringValue(modelIndex, m_sectionProperty);
797−
798− bool needSectionHeader = true;
799− // if it is the same section as the previous item need to drop the section
800− if (modelIndex > 0) {
801− const QString prevSection = m_delegateModel->stringValue(modelIndex - 1, m_sectionProperty);
802− if (sectionText == prevSection) {
803− needSectionHeader = false;
804− }
805− }
806−
807− if (needSectionHeader) {
808− if (!item->sectionItem()) {
809− item->setSectionItem(getSectionItem(sectionText));
810− } else {
811− item->sectionItem()->setProperty("text", sectionText);
812− }
813− } else {
814− if (item->sectionItem()) {
815− item->sectionItem()->deleteLater();
816− item->setSectionItem(nullptr);
817− }
818− }
819− }
820−}
821−
822−bool ListViewWithPageHeader::removeNonVisibleItems(qreal bufferFrom, qreal bufferTo)
823−{
824−// qDebug() << "ListViewWithPageHeader::removeNonVisibleItems" << bufferFrom << bufferTo;
825− // Do not remove items if we are overshooting up or down, since we'll come back
826− // to the "stable" position and delete/create items without any reason
827− if (contentY() < -m_minYExtent) {
828− return false;
829− } else if (contentY() + height() > contentHeight()) {
830− return false;
831− }
832− bool changed = false;
833−
834− bool foundVisible = false;
835− int i = 0;
836− int removedItems = 0;
837− const auto oldFirstVisibleIndex = m_firstVisibleIndex;
838− while (i < m_visibleItems.count()) {
839− ListItem *item = m_visibleItems[i];
840− const qreal pos = item->y() + m_clipItem->y();
841−// qDebug() << i << pos << (pos + item->height()) << bufferFrom << bufferTo;
842− if (pos + item->height() < bufferFrom || pos > bufferTo) {
843−// qDebug() << "Releasing" << i << (pos + item->height() < bufferFrom) << pos + item->height() << bufferFrom << (pos > bufferTo) << pos << bufferTo;
844− releaseItem(item);
845− m_visibleItems.removeAt(i);
846− changed = true;
847− ++removedItems;
848− } else {
849− if (!foundVisible) {
850− foundVisible = true;
851− const int itemIndex = m_firstVisibleIndex + removedItems + i;
852− m_firstVisibleIndex = itemIndex;
853− }
854− ++i;
855− }
856− }
857− if (!foundVisible) {
858− initializeValuesForEmptyList();
859− }
860− if (m_firstVisibleIndex != oldFirstVisibleIndex) {
861− adjustMinYExtent();
862− }
863−
864− return changed;
865−}
866−
867−ListViewWithPageHeader::ListItem *ListViewWithPageHeader::createItem(int modelIndex, bool asynchronous)
868−{
869−// qDebug() << "CREATE ITEM" << modelIndex;
870− if (asynchronous && m_asyncRequestedIndex != -1)
871− return nullptr;
872−
873− m_asyncRequestedIndex = -1;
874− QObject* object = m_delegateModel->object(modelIndex, asynchronous ? QQmlIncubator::Asynchronous : QQmlIncubator::AsynchronousIfNested);
875− QQuickItem *item = qmlobject_cast<QQuickItem*>(object);
876− if (!item) {
877− if (object) {
878− m_delegateModel->release(object);
879− if (!m_delegateValidated) {
880− m_delegateValidated = true;
881− QObject* delegateObj = delegate();
882− qmlInfo(delegateObj ? delegateObj : this) << "Delegate must be of Item type";
883− }
884− } else {
885− m_asyncRequestedIndex = modelIndex;
886− }
887− return 0;
888− } else {
889−// qDebug() << "ListViewWithPageHeader::createItem::We have the item" << modelIndex << item;
890− ListItem *listItem = new ListItem;
891− listItem->m_item = item;
892− listItem->setSectionItem(getSectionItem(modelIndex, false /*Not yet inserted into m_visibleItems*/));
893− QQuickItemPrivate::get(item)->addItemChangeListener(this, QQuickItemPrivate::Geometry);
894− ListItem *prevItem = itemAtIndex(modelIndex - 1);
895− bool lostItem = false; // Is an item that we requested async but because of model changes
896− // it is no longer attached to any of the existing items (has no prev nor next item)
897− // nor is the first item
898− if (prevItem) {
899− listItem->setY(prevItem->y() + prevItem->height());
900− } else {
901− ListItem *currItem = itemAtIndex(modelIndex);
902− if (currItem) {
903− // There's something already in m_visibleItems at out index, meaning this is an insert, so attach to its top
904− listItem->setY(currItem->y() - listItem->height());
905− } else {
906− ListItem *nextItem = itemAtIndex(modelIndex + 1);
907− if (nextItem) {
908− listItem->setY(nextItem->y() - listItem->height());
909− } else if (modelIndex == 0) {
910− listItem->setY(-m_clipItem->y() + (m_headerItem ? m_headerItem->height() : 0));
911− } else if (!m_visibleItems.isEmpty()) {
912− lostItem = true;
913− }
914− }
915− }
916− if (lostItem) {
917− listItem->setCulled(true);
918− releaseItem(listItem);
919− listItem = nullptr;
920− } else {
921− listItem->setCulled(listItem->y() + listItem->height() + m_clipItem->y() <= contentY() || listItem->y() + m_clipItem->y() >= contentY() + height());
922− if (m_visibleItems.isEmpty()) {
923− m_visibleItems << listItem;
924− } else {
925− m_visibleItems.insert(modelIndex - m_firstVisibleIndex, listItem);
926− }
927− if (m_firstVisibleIndex < 0 || modelIndex < m_firstVisibleIndex) {
928− m_firstVisibleIndex = modelIndex;
929− polish();
930− }
931− if (listItem->sectionItem()) {
932− listItem->sectionItem()->setProperty("delegate", QVariant::fromValue(listItem->m_item));
933− }
934− adjustMinYExtent();
935− m_contentHeightDirty = true;
936− }
937− return listItem;
938− }
939−}
940−
941−void ListViewWithPageHeader::itemCreated(int modelIndex, QObject *object)
942−{
943− QQuickItem *item = qmlobject_cast<QQuickItem*>(object);
944− if (!item) {
945− qWarning() << "ListViewWithPageHeader::itemCreated got a non item for index" << modelIndex;
946− return;
947− }
948−// qDebug() << "ListViewWithPageHeader::itemCreated" << modelIndex << item;
949− // Check we are not being taken down and don't paint anything
950− // TODO Check if we still need this in 5.2
951− // For reproduction just inifnite loop testDash or testDashContent
952− if (!QQmlEngine::contextForObject(this)->parentContext())
953− return;
954−
955− item->setParentItem(m_clipItem);
956− // FIXME Why do we need the refreshExpressions call?
957− QQmlContext *context = QQmlEngine::contextForObject(item)->parentContext();
958− QQmlContextPrivate::get(context)->data->refreshExpressions();
959− item->setProperty("heightToClip", QVariant::fromValue<int>(0));
960− if (modelIndex == m_asyncRequestedIndex) {
961− createItem(modelIndex, false);
962− refill();
963− }
964−}
965−
966−void ListViewWithPageHeader::updateClipItem()
967−{
968− m_clipItem->setHeight(height() - m_headerItemShownHeight);
969− m_clipItem->setY(contentY() + m_headerItemShownHeight);
970− m_clipItem->setClip(!m_forceNoClip && m_headerItemShownHeight > 0);
971−}
972−
973−void ListViewWithPageHeader::onContentHeightChanged()
974−{
975− updateClipItem();
976−}
977−
978−void ListViewWithPageHeader::onContentWidthChanged()
979−{
980− m_clipItem->setWidth(contentItem()->width());
981−}
982−
983−void ListViewWithPageHeader::onHeightChanged()
984−{
985− m_clipItem->setHeight(height() - m_headerItemShownHeight);
986− polish();
987−}
988−
989−
990−void ListViewWithPageHeader::onModelUpdated(const QQmlChangeSet &changeSet, bool /*reset*/)
991−{
992− // TODO Do something with reset
993−// qDebug() << "ListViewWithPageHeader::onModelUpdated" << changeSet << reset;
994− const auto oldFirstVisibleIndex = m_firstVisibleIndex;
995−
996− Q_FOREACH(const QQmlChangeSet::Change remove, changeSet.removes()) {
997−// qDebug() << "ListViewWithPageHeader::onModelUpdated Remove" << remove.index << remove.count;
998− if (remove.index + remove.count > m_firstVisibleIndex && remove.index < m_firstVisibleIndex + m_visibleItems.count()) {
999− const qreal oldFirstValidIndexPos = m_visibleItems.first()->y();
1000− // If all the items we are removing are either not created or culled
1001− // we have to grow down to avoid viewport changing
1002− bool growDown = true;
1003− for (int i = 0; growDown && i < remove.count; ++i) {
1004− const int modelIndex = remove.index + i;
1005− ListItem *item = itemAtIndex(modelIndex);
1006− if (item && !item->culled()) {
1007− growDown = false;
1008− }
1009− }
1010− for (int i = remove.count - 1; i >= 0; --i) {
1011− const int visibleIndex = remove.index + i - m_firstVisibleIndex;
1012− if (visibleIndex >= 0 && visibleIndex < m_visibleItems.count()) {
1013− ListItem *item = m_visibleItems[visibleIndex];
1014− // Pass the section item down if needed
1015− if (item->sectionItem() && visibleIndex + 1 < m_visibleItems.count()) {
1016− ListItem *nextItem = m_visibleItems[visibleIndex + 1];
1017− if (!nextItem->sectionItem()) {
1018− nextItem->setSectionItem(item->sectionItem());
1019− item->setSectionItem(nullptr);
1020− }
1021− }
1022− releaseItem(item);
1023− m_visibleItems.removeAt(visibleIndex);
1024− }
1025− }
1026− if (growDown) {
1027− adjustMinYExtent();
1028− } else if (remove.index <= m_firstVisibleIndex && !m_visibleItems.isEmpty()) {
1029− m_visibleItems.first()->setY(oldFirstValidIndexPos);
1030− }
1031− if (m_visibleItems.isEmpty()) {
1032− m_firstVisibleIndex = -1;
1033− } else {
1034− m_firstVisibleIndex -= qMax(0, m_firstVisibleIndex - remove.index);
1035− }
1036− } else if (remove.index + remove.count <= m_firstVisibleIndex) {
1037− m_firstVisibleIndex -= remove.count;
1038− }
1039− for (int i = remove.count - 1; i >= 0; --i) {
1040− const int modelIndex = remove.index + i;
1041− if (modelIndex == m_asyncRequestedIndex) {
1042− m_asyncRequestedIndex = -1;
1043− } else if (modelIndex < m_asyncRequestedIndex) {
1044− m_asyncRequestedIndex--;
1045− }
1046− }
1047− }
1048−
1049− Q_FOREACH(const QQmlChangeSet::Change insert, changeSet.inserts()) {
1050−// qDebug() << "ListViewWithPageHeader::onModelUpdated Insert" << insert.index << insert.count;
1051− const bool insertingInValidIndexes = insert.index > m_firstVisibleIndex && insert.index < m_firstVisibleIndex + m_visibleItems.count();
1052− const bool firstItemWithViewOnTop = insert.index == 0 && m_firstVisibleIndex == 0 && m_visibleItems.first()->y() + m_clipItem->y() > contentY();
1053− if (insertingInValidIndexes || firstItemWithViewOnTop)
1054− {
1055− // If the items we are adding won't be really visible
1056− // we grow up instead of down to not change the viewport
1057− bool growUp = false;
1058− if (!firstItemWithViewOnTop) {
1059− for (int i = 0; i < m_visibleItems.count(); ++i) {
1060− if (!m_visibleItems[i]->culled()) {
1061− if (insert.index <= m_firstVisibleIndex + i) {
1062− growUp = true;
1063− }
1064− break;
1065− }
1066− }
1067− }
1068−
1069− const qreal oldFirstValidIndexPos = m_visibleItems.first()->y();
1070− for (int i = insert.count - 1; i >= 0; --i) {
1071− const int modelIndex = insert.index + i;
1072− ListItem *item = createItem(modelIndex, false);
1073− if (growUp) {
1074− ListItem *firstItem = m_visibleItems.first();
1075− firstItem->setY(firstItem->y() - item->height());
1076− }
1077− // Adding an item may break a "same section" chain, so check
1078− // if we need adding a new section item
1079− if (m_sectionDelegate) {
1080− ListItem *nextItem = itemAtIndex(modelIndex + 1);
1081− if (nextItem && !nextItem->sectionItem()) {
1082− nextItem->setSectionItem(getSectionItem(modelIndex + 1, true /* alredy inserted into m_visibleItems*/));
1083− if (growUp && nextItem->sectionItem()) {
1084− ListItem *firstItem = m_visibleItems.first();
1085− firstItem->setY(firstItem->y() - nextItem->sectionItem()->height());
1086− }
1087− }
1088− }
1089− }
1090− if (firstItemWithViewOnTop) {
1091− ListItem *firstItem = m_visibleItems.first();
1092− firstItem->setY(oldFirstValidIndexPos);
1093− }
1094− adjustMinYExtent();
1095− } else if (insert.index <= m_firstVisibleIndex) {
1096− m_firstVisibleIndex += insert.count;
1097− }
1098−
1099− for (int i = insert.count - 1; i >= 0; --i) {
1100− const int modelIndex = insert.index + i;
1101− if (modelIndex <= m_asyncRequestedIndex) {
1102− m_asyncRequestedIndex++;
1103− }
1104− }
1105− }
1106−
1107− Q_FOREACH(const QQmlChangeSet::Change change, changeSet.changes()) {
1108− for (int i = change.start(); i < change.end(); ++i) {
1109− updateSectionItem(i);
1110− }
1111− // Also update the section header for the next item after the change since it may be influenced
1112− updateSectionItem(change.end());
1113− }
1114−
1115− if (m_firstVisibleIndex != oldFirstVisibleIndex) {
1116− if (m_visibleItems.isEmpty()) {
1117− initializeValuesForEmptyList();
1118− } else {
1119− adjustMinYExtent();
1120− }
1121− }
1122−
1123− for (int i = 0; i < m_visibleItems.count(); ++i) {
1124− ListItem *item = m_visibleItems[i];
1125− if (item->sectionItem()) {
1126− item->sectionItem()->setProperty("delegate", QVariant::fromValue(item->m_item));
1127− }
1128− }
1129−
1130− layout();
1131− polish();
1132− m_contentHeightDirty = true;
1133−}
1134−
1135−void ListViewWithPageHeader::contentYAnimationRunningChanged(bool running)
1136−{
1137− setInteractive(!running);
1138− if (!running) {
1139− m_contentHeightDirty = true;
1140− polish();
1141− }
1142−}
1143−
1144−void ListViewWithPageHeader::itemGeometryChanged(QQuickItem *item, QQuickGeometryChange change, const QRectF &oldGeometry)
1145−{
1146− if (change.heightChange()) {
1147− const qreal heightDiff = height() - oldGeometry.height();
1148− if (!m_visibleItems.isEmpty()) {
1149− ListItem *firstItem = m_visibleItems.first();
1150− const auto prevFirstItemY = firstItem->y();
1151− if (!m_inContentHeightKeepHeaderShown && oldGeometry.y() + oldGeometry.height() + m_clipItem->y() <= contentY()) {
1152− firstItem->setY(firstItem->y() - heightDiff);
1153− } else if (item == firstItem->sectionItem()) {
1154− firstItem->setY(firstItem->y() + heightDiff);
1155− }
1156−
1157− if (firstItem->y() != prevFirstItemY) {
1158− adjustMinYExtent();
1159− layout();
1160− }
1161− }
1162− refill();
1163− adjustMinYExtent();
1164− polish();
1165− m_contentHeightDirty = true;
1166− }
1167−}
1168−
1169−void ListViewWithPageHeader::itemImplicitHeightChanged(QQuickItem *item)
1170−{
1171− if (item == m_headerItem) {
1172− const qreal diff = m_headerItem->implicitHeight() - m_previousHeaderImplicitHeight;
1173− if (diff != 0) {
1174− adjustHeader(diff);
1175− m_previousHeaderImplicitHeight = m_headerItem->implicitHeight();
1176− layout();
1177− polish();
1178− m_contentHeightDirty = true;
1179− }
1180− }
1181−}
1182−
1183−void ListViewWithPageHeader::headerHeightChanged(qreal newHeaderHeight, qreal oldHeaderHeight, qreal oldHeaderY)
1184−{
1185− const qreal heightDiff = newHeaderHeight - oldHeaderHeight;
1186− if (m_headerItemShownHeight > 0) {
1187− // If the header is shown because of the clip
1188− // Change its size
1189− m_headerItemShownHeight += heightDiff;
1190− m_headerItemShownHeight = qBound(static_cast<qreal>(0.), m_headerItemShownHeight, newHeaderHeight);
1191− updateClipItem();
1192− adjustMinYExtent();
1193− Q_EMIT headerItemShownHeightChanged();
1194− } else {
1195− if (oldHeaderY + oldHeaderHeight > contentY()) {
1196− // If the header is shown because its position
1197− // Change its size
1198− ListItem *firstItem = m_visibleItems.first();
1199− firstItem->setY(firstItem->y() + heightDiff);
1200− layout();
1201− } else {
1202− // If the header is not on screen, just change the start of the list
1203− // so the viewport is not changed
1204− adjustMinYExtent();
1205− }
1206− }
1207−}
1208−
1209−
1210−void ListViewWithPageHeader::adjustMinYExtent()
1211−{
1212− if (m_visibleItems.isEmpty() || (contentHeight() + m_minYExtent < height())) {
1213− m_minYExtent = 0;
1214− } else {
1215− qreal nonCreatedHeight = 0;
1216− if (m_firstVisibleIndex != 0) {
1217− // Calculate the average height of items to estimate the position of the list start
1218− const int visibleItems = m_visibleItems.count();
1219− qreal visibleItemsHeight = 0;
1220− Q_FOREACH(ListItem *item, m_visibleItems) {
1221− visibleItemsHeight += item->height();
1222− }
1223− nonCreatedHeight = m_firstVisibleIndex * visibleItemsHeight / visibleItems;
1224−// qDebug() << m_firstVisibleIndex << visibleItemsHeight << visibleItems << nonCreatedHeight;
1225− }
1226− const qreal headerHeight = (m_headerItem ? m_headerItem->implicitHeight() : 0);
1227− m_minYExtent = nonCreatedHeight - m_visibleItems.first()->y() - m_clipItem->y() + headerHeight;
1228− if (m_minYExtent != 0 && qFuzzyIsNull(m_minYExtent)) {
1229− m_minYExtent = 0;
1230− m_visibleItems.first()->setY(nonCreatedHeight - m_clipItem->y() + headerHeight);
1231− }
1232− }
1233−}
1234−
1235−ListViewWithPageHeader::ListItem *ListViewWithPageHeader::itemAtIndex(int modelIndex) const
1236−{
1237− const int visibleIndexedModelIndex = modelIndex - m_firstVisibleIndex;
1238− if (visibleIndexedModelIndex >= 0 && visibleIndexedModelIndex < m_visibleItems.count())
1239− return m_visibleItems[visibleIndexedModelIndex];
1240−
1241− return nullptr;
1242−}
1243−
1244−void ListViewWithPageHeader::layout()
1245−{
1246− if (m_inLayout)
1247− return;
1248−
1249− m_inLayout = true;
1250− if (!m_visibleItems.isEmpty()) {
1251− const qreal visibleFrom = contentY() - m_clipItem->y() + m_headerItemShownHeight;
1252− const qreal visibleTo = contentY() + height() - m_clipItem->y();
1253−
1254− qreal pos = m_visibleItems.first()->y();
1255−
1256−// qDebug() << "ListViewWithPageHeader::layout Updating positions and heights. contentY" << contentY() << "minYExtent" << minYExtent();
1257− int firstReallyVisibleItem = -1;
1258− int modelIndex = m_firstVisibleIndex;
1259− Q_FOREACH(ListItem *item, m_visibleItems) {
1260− const bool cull = pos + item->height() <= visibleFrom || pos >= visibleTo;
1261− item->setCulled(cull);
1262− item->setY(pos);
1263− if (!cull && firstReallyVisibleItem == -1) {
1264− firstReallyVisibleItem = modelIndex;
1265− if (m_topSectionItem) {
1266− // Positing the top section sticky item is a two step process
1267− // First we set it either we cull it (because it doesn't need to be sticked to the top)
1268− // or stick it to the top
1269− // Then after the loop we'll make sure that if there's another section just below it
1270− // pushed the sticky section up to make it disappear
1271− const qreal topSectionStickPos = m_headerItemShownHeight + contentY() - m_clipItem->y();
1272− bool showStickySectionItem;
1273− // We need to show the "top section sticky item" when the position at the "top" of the
1274− // viewport is bigger than the start of the position of the first visible item
1275− // i.e. the first visible item starts before the viewport, or when the first
1276− // visible item starts just at the viewport start and it does not have its own section item
1277− if (topSectionStickPos > pos) {
1278− showStickySectionItem = true;
1279− } else if (topSectionStickPos == pos) {
1280− showStickySectionItem = !item->sectionItem();
1281− } else {
1282− showStickySectionItem = false;
1283− }
1284− if (!showStickySectionItem) {
1285− QQuickItemPrivate::get(m_topSectionItem)->setCulled(true);
1286− if (item->sectionItem()) {
1287− // This seems it should happen since why would we cull the top section
1288− // if the first visible item has no section header? This only happens briefly
1289− // when increasing the height of a list that is at the bottom, the m_topSectionItem
1290− // gets shown shortly in the next polish call
1291− QQuickItemPrivate::get(item->sectionItem())->setCulled(false);
1292− }
1293− } else {
1294− // Update the top sticky section header
1295− const QString section = m_delegateModel->stringValue(modelIndex, m_sectionProperty);
1296− m_topSectionItem->setProperty("text", section);
1297−
1298− QQuickItemPrivate::get(m_topSectionItem)->setCulled(false);
1299− m_topSectionItem->setY(topSectionStickPos);
1300− m_topSectionItem->setProperty("delegate", QVariant::fromValue(item->m_item));
1301− if (item->sectionItem()) {
1302− QQuickItemPrivate::get(item->sectionItem())->setCulled(true);
1303− }
1304− }
1305− }
1306− }
1307− const qreal clipFrom = visibleFrom + (!item->sectionItem() && m_topSectionItem && !QQuickItemPrivate::get(m_topSectionItem)->culled ? m_topSectionItem->height() : 0);
1308− if (!cull && pos < clipFrom) {
1309− item->m_item->setProperty("heightToClip", clipFrom - pos);
1310− } else {
1311− item->m_item->setProperty("heightToClip", QVariant::fromValue<int>(0));
1312− }
1313−// qDebug() << "ListViewWithPageHeader::layout" << item->m_item;
1314− pos += item->height();
1315− ++modelIndex;
1316− }
1317−
1318− // Second step of section sticky item positioning
1319− // Look at the next section header, check if it's pushing up the sticky one
1320− if (m_topSectionItem) {
1321− if (firstReallyVisibleItem >= 0) {
1322− for (int i = firstReallyVisibleItem - m_firstVisibleIndex + 1; i < m_visibleItems.count(); ++i) {
1323− ListItem *item = m_visibleItems[i];
1324− if (item->sectionItem()) {
1325− if (m_topSectionItem->y() + m_topSectionItem->height() > item->y()) {
1326− m_topSectionItem->setY(item->y() - m_topSectionItem->height());
1327− }
1328− break;
1329− }
1330− }
1331− }
1332− }
1333− }
1334− if (m_headerItem) {
1335− const bool cullHeader = m_headerItem->y() + m_headerItem->height() < contentY();
1336− QQuickItemPrivate::get(m_headerItem)->setCulled(cullHeader);
1337− }
1338− m_inLayout = false;
1339−}
1340−
1341−void ListViewWithPageHeader::updatePolish()
1342−{
1343− // Check we are not being taken down and don't paint anything
1344− // TODO Check if we still need this in 5.2
1345− // For reproduction just inifnite loop testDash or testDashContent
1346− if (!QQmlEngine::contextForObject(this)->parentContext())
1347− return;
1348−
1349− Q_FOREACH(ListItem *item, m_itemsToRelease)
1350− reallyReleaseItem(item);
1351− m_itemsToRelease.clear();
1352−
1353− if (!model())
1354− return;
1355−
1356− layout();
1357−
1358− refill();
1359−
1360− if (m_contentHeightDirty) {
1361− qreal contentHeight;
1362− if (m_visibleItems.isEmpty()) {
1363− contentHeight = m_headerItem ? m_headerItem->height() : 0;
1364− } else {
1365− const int modelCount = model()->rowCount();
1366− const int visibleItems = m_visibleItems.count();
1367− const int lastValidIndex = m_firstVisibleIndex + visibleItems - 1;
1368− qreal nonCreatedHeight = 0;
1369− if (lastValidIndex != modelCount - 1) {
1370− const int visibleItems = m_visibleItems.count();
1371− qreal visibleItemsHeight = 0;
1372− Q_FOREACH(ListItem *item, m_visibleItems) {
1373− visibleItemsHeight += item->height();
1374− }
1375− const int unknownSizes = modelCount - (m_firstVisibleIndex + visibleItems);
1376− nonCreatedHeight = unknownSizes * visibleItemsHeight / visibleItems;
1377− }
1378− ListItem *item = m_visibleItems.last();
1379− contentHeight = nonCreatedHeight + item->y() + item->height() + m_clipItem->y();
1380− if (m_firstVisibleIndex != 0) {
1381− // Make sure that if we are shrinking we tell the view we still fit
1382− m_minYExtent = qMax(m_minYExtent, -(contentHeight - height()));
1383− }
1384− }
1385−
1386− m_contentHeightDirty = false;
1387− adjustMinYExtent();
1388− m_inContentHeightKeepHeaderShown = m_headerItem && m_headerItem->y() == contentY();
1389− setContentHeight(contentHeight);
1390− m_inContentHeightKeepHeaderShown = false;
1391− }
1392−}
1393−
1394−#include "moc_listviewwithpageheader.cpp"
plugins/Dash/listviewwithpageheader.hdeleted−218
@@ -1,218 +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−#ifndef LISTVIEWWITHPAGEHEADER_H
18−#define LISTVIEWWITHPAGEHEADER_H
19−
20−#include <private/qquickitemchangelistener_p.h>
21−#include <private/qquickflickable_p.h>
22−
23−class QAbstractItemModel;
24−class QQuickNumberAnimation;
25−class QQmlChangeSet;
26−class QQmlDelegateModel;
27−
28−
29−/**
30− Note for users of this class
31−
32− ListViewWithPageHeader already loads delegates async when appropiate so if
33− your delegate uses a Loader you should not enable the asynchronous feature since
34− that will need to introduce sizing problems
35−
36− With the double async it may happen what while we are scrolling down
37− we reach to a point where given the size of the just created delegate with loader not yet loaded (which will be very close to 0)
38− we are already "at the end" of the list, but then a few milliseconds later the loader finishes loading and we could
39− have kept scrolling. This is specially visible at the end of the list where you realize
40− that scrolling ended a bit before the end of the list but the speed of the flicking was good
41− to reach the end
42−
43− By not having the second async we get a better sizing when the delegate is created and things work better
44−*/
45−
46−class ListViewWithPageHeader : public QQuickFlickable, public QQuickItemChangeListener
47−{
48− Q_OBJECT
49− Q_PROPERTY(QAbstractItemModel *model READ model WRITE setModel NOTIFY modelChanged)
50− Q_PROPERTY(QQmlComponent *delegate READ delegate WRITE setDelegate NOTIFY delegateChanged)
51− Q_PROPERTY(QQuickItem *pageHeader READ header WRITE setHeader NOTIFY headerChanged)
52− Q_PROPERTY(QQmlComponent *sectionDelegate READ sectionDelegate WRITE setSectionDelegate NOTIFY sectionDelegateChanged)
53− Q_PROPERTY(QString sectionProperty READ sectionProperty WRITE setSectionProperty NOTIFY sectionPropertyChanged)
54− Q_PROPERTY(bool forceNoClip READ forceNoClip WRITE setForceNoClip NOTIFY forceNoClipChanged)
55− Q_PROPERTY(int stickyHeaderHeight READ stickyHeaderHeight NOTIFY stickyHeaderHeightChanged)
56− Q_PROPERTY(qreal headerItemShownHeight READ headerItemShownHeight NOTIFY headerItemShownHeightChanged)
57− Q_PROPERTY(int cacheBuffer READ cacheBuffer WRITE setCacheBuffer NOTIFY cacheBufferChanged)
58−
59− friend class ListViewWithPageHeaderTest;
60− friend class ListViewWithPageHeaderTestSection;
61− friend class ListViewWithPageHeaderTestExternalModel;
62−
63−public:
64− ListViewWithPageHeader();
65− ~ListViewWithPageHeader();
66−
67− QAbstractItemModel *model() const;
68− void setModel(QAbstractItemModel *model);
69−
70− QQmlComponent *delegate() const;
71− void setDelegate(QQmlComponent *delegate);
72−
73− QQuickItem *header() const;
74− void setHeader(QQuickItem *header);
75−
76− QQmlComponent *sectionDelegate() const;
77− void setSectionDelegate(QQmlComponent *delegate);
78−
79− QString sectionProperty() const;
80− void setSectionProperty(const QString &property);
81−
82− bool forceNoClip() const;
83− void setForceNoClip(bool noClip);
84−
85− int stickyHeaderHeight() const;
86− qreal headerItemShownHeight() const;
87−
88− int cacheBuffer() const;
89− void setCacheBuffer(int cacheBuffer);
90−
91− Q_INVOKABLE void positionAtBeginning();
92− Q_INVOKABLE void showHeader();
93− Q_INVOKABLE int firstCreatedIndex() const;
94− Q_INVOKABLE int createdItemCount() const;
95− Q_INVOKABLE QQuickItem *item(int modelIndex) const;
96−
97− // The index has to be created for this to try to do something
98− // Created items are those visible and the precached ones
99− // Returns if the item existed or not
100− Q_INVOKABLE bool maximizeVisibleArea(int modelIndex);
101− Q_INVOKABLE bool maximizeVisibleArea(int modelIndex, int itemHeight);
102−
103−Q_SIGNALS:
104− void modelChanged();
105− void delegateChanged();
106− void headerChanged();
107− void sectionDelegateChanged();
108− void sectionPropertyChanged();
109− void forceNoClipChanged();
110− void stickyHeaderHeightChanged();
111− void headerItemShownHeightChanged();
112− void cacheBufferChanged();
113−
114−protected:
115− void componentComplete() override;
116− void viewportMoved(Qt::Orientations orient) override;
117− qreal minYExtent() const override;
118− qreal maxYExtent() const override;
119− void itemGeometryChanged(QQuickItem *item, QQuickGeometryChange change, const QRectF &oldGeometry) override;
120− void itemImplicitHeightChanged(QQuickItem *item) override;
121− void updatePolish() override;
122−
123−private Q_SLOTS:
124− void itemCreated(int modelIndex, QObject *object);
125− void onContentHeightChanged();
126− void onContentWidthChanged();
127− void onHeightChanged();
128− void onModelUpdated(const QQmlChangeSet &changeSet, bool reset);
129− void contentYAnimationRunningChanged(bool running);
130−
131−private:
132− class ListItem
133− {
134− public:
135− qreal height() const;
136−
137− qreal y() const;
138− void setY(qreal newY);
139−
140− bool culled() const;
141− void setCulled(bool culled);
142−
143− QQuickItem *sectionItem() const { return m_sectionItem; }
144− void setSectionItem(QQuickItem *sectionItem);
145−
146− QQuickItem *m_item;
147− private:
148− QQuickItem *m_sectionItem;
149− };
150−
151− bool maximizeVisibleArea(ListItem *listItem, int listItemHeight);
152−
153− void createDelegateModel();
154−
155− void layout();
156− void refill();
157− bool addVisibleItems(qreal fillFrom, qreal fillTo, bool asynchronous);
158− bool removeNonVisibleItems(qreal bufferFrom, qreal bufferTo);
159− ListItem *createItem(int modelIndex, bool asynchronous);
160−
161− void adjustHeader(qreal diff);
162− void adjustMinYExtent();
163− void updateClipItem();
164− void headerHeightChanged(qreal newHeaderHeight, qreal oldHeaderHeight, qreal oldHeaderY);
165− ListItem *itemAtIndex(int modelIndex) const; // Returns the item at modelIndex if has been created
166− void releaseItem(ListItem *item);
167− void reallyReleaseItem(ListItem *item);
168− void updateWatchedRoles();
169− QQuickItem *getSectionItem(int modelIndex, bool alreadyInserted);
170− QQuickItem *getSectionItem(const QString &sectionText, bool watchGeometry = true);
171− void updateSectionItem(int modelIndex);
172− void initializeValuesForEmptyList();
173−
174− QQmlDelegateModel *m_delegateModel;
175−
176− // Index we are waiting because we requested it asynchronously
177− int m_asyncRequestedIndex;
178−
179− // Used to only give a warning once if the delegate does not return objects
180− bool m_delegateValidated;
181−
182− // Visible indexes, [0] is m_firstValidIndex, [0+1] is m_firstValidIndex +1, ...
183− QList<ListItem *> m_visibleItems;
184− int m_firstVisibleIndex;
185−
186− qreal m_minYExtent;
187−
188− QQuickItem *m_clipItem;
189−
190− // If any of the heights has changed
191− // or new items have been added/removed
192− bool m_contentHeightDirty;
193−
194− QQuickItem *m_headerItem;
195− qreal m_previousContentY;
196− qreal m_previousHeaderImplicitHeight;
197− qreal m_headerItemShownHeight; // The height of header shown when the header is shown outside its topmost position
198− // i.e. it's being shown after dragging down in the middle of the list
199− enum ContentYAnimationType { ContentYAnimationShowHeader, ContentYAnimationMaximizeVisibleArea };
200− ContentYAnimationType contentYAnimationType;
201− QQuickNumberAnimation *m_contentYAnimation;
202−
203− QQmlComponent *m_sectionDelegate;
204− QString m_sectionProperty;
205− QQuickItem *m_topSectionItem;
206−
207− bool m_forceNoClip;
208− bool m_inLayout;
209− bool m_inContentHeightKeepHeaderShown;
210− int m_cacheBuffer;
211−
212− // Qt 5.0 doesn't like releasing the items just after itemCreated
213− // so we delay the releasing until the next updatePolish
214− QList<ListItem *> m_itemsToRelease;
215−};
216−
217−
218−#endif
plugins/Dash/organicgrid.cppdeleted−259
@@ -1,259 +0,0 @@
1−/*
2− * Copyright (C) 2014, 2016 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 "organicgrid.h"
18−
19−#include <math.h>
20−
21−#include <private/qquickitem_p.h>
22−
23−OrganicGrid::OrganicGrid()
24− : m_firstVisibleIndex(-1)
25− , m_numberOfModulesPerRow(-1)
26−{
27−}
28−
29−QSizeF OrganicGrid::smallDelegateSize() const
30−{
31− return m_smallDelegateSize;
32−}
33−
34−void OrganicGrid::setSmallDelegateSize(const QSizeF size)
35−{
36− if (m_smallDelegateSize != size) {
37− m_smallDelegateSize = size;
38− Q_EMIT smallDelegateSizeChanged();
39−
40− if (isComponentComplete()) {
41− relayout();
42− }
43− }
44−}
45−
46−QSizeF OrganicGrid::bigDelegateSize() const
47−{
48− return m_bigDelegateSize;
49−}
50−
51−void OrganicGrid::setBigDelegateSize(const QSizeF size)
52−{
53− if (m_bigDelegateSize != size) {
54− m_bigDelegateSize = size;
55− Q_EMIT bigDelegateSizeChanged();
56−
57− if (isComponentComplete()) {
58− relayout();
59− }
60− }
61−}
62−
63−QPointF OrganicGrid::positionForIndex(int modelIndex) const
64−{
65− const qreal moduleHeight = m_smallDelegateSize.height() + rowSpacing() + m_bigDelegateSize.height();
66− const qreal moduleWidth = m_smallDelegateSize.width() * 2 + columnSpacing() * 2 + m_bigDelegateSize.width();
67− const int itemsPerRow = m_numberOfModulesPerRow * 6;
68− const int rowIndex = floor(modelIndex / itemsPerRow);
69− const int columnIndex = floor((modelIndex - rowIndex * itemsPerRow) / 6);
70−
71− qreal yPos = (moduleHeight + rowSpacing()) * rowIndex;
72− const int moduleIndex = modelIndex % 6;
73− if (moduleIndex == 2) {
74− yPos += m_smallDelegateSize.height() + rowSpacing();
75− } else if (moduleIndex == 3 || moduleIndex == 5) {
76− yPos += m_bigDelegateSize.height() + rowSpacing();
77− }
78−
79− qreal xPos = (moduleWidth + columnSpacing()) * columnIndex;
80− if (moduleIndex == 1) {
81− xPos += m_smallDelegateSize.width() + columnSpacing();
82− } else if (moduleIndex == 3) {
83− xPos += m_bigDelegateSize.width() + columnSpacing();
84− } else if (moduleIndex == 4) {
85− xPos += (m_smallDelegateSize.width() + columnSpacing()) * 2;
86− } else if (moduleIndex == 5) {
87− xPos += m_bigDelegateSize.width() + m_smallDelegateSize.width() + columnSpacing() * 2;
88− }
89−
90− return QPointF(xPos, yPos);
91−}
92−
93−QSizeF OrganicGrid::sizeForIndex(int modelIndex) const
94−{
95− const int moduleIndex = modelIndex % 6;
96− if (moduleIndex == 0 || moduleIndex == 1 || moduleIndex == 3 || moduleIndex == 5) {
97− return m_smallDelegateSize;
98− } else {
99− return m_bigDelegateSize;
100− }
101−}
102−
103−void OrganicGrid::findBottomModelIndexToAdd(int *modelIndex, qreal *yPos)
104−{
105− if (m_visibleItems.isEmpty()) {
106− *modelIndex = 0;
107− *yPos = 0;
108− } else {
109− *modelIndex = m_firstVisibleIndex + m_visibleItems.count();
110− // We create stuff in a 6-module basis, so always return back
111− // the y position of the first item
112− const int firstModuleIndex = ((*modelIndex) / 6) * 6;
113− *yPos = positionForIndex(firstModuleIndex).y();
114− }
115−}
116−
117−void OrganicGrid::findTopModelIndexToAdd(int *modelIndex, qreal *yPos)
118−{
119− if (m_visibleItems.isEmpty()) {
120− *modelIndex = 0;
121− *yPos = 0;
122− } else {
123− *modelIndex = m_firstVisibleIndex - 1;
124− // We create stuff in a 6-module basis, so always return back
125− // the y position of the last item bottom
126− const int lastModuleIndex = ((*modelIndex) / 6) * 6 + 5;
127− *yPos = positionForIndex(lastModuleIndex).y();
128− *yPos += sizeForIndex(lastModuleIndex).height();
129− }
130−}
131−
132−void OrganicGrid::addItemToView(int modelIndex, QQuickItem *item)
133−{
134− // modelIndex has to be either m_firstVisibleIndex - 1 or m_firstVisibleIndex + m_visibleItems.count() or the first
135− if (modelIndex == m_firstVisibleIndex + m_visibleItems.count()) {
136− m_visibleItems << item;
137− } else if (modelIndex == m_firstVisibleIndex - 1) {
138− m_firstVisibleIndex = modelIndex;
139− m_visibleItems.prepend(item);
140− } else if (modelIndex == 0) {
141− m_firstVisibleIndex = 0;
142− m_visibleItems << item;
143− } else {
144− qWarning() << "OrganicGrid::addItemToView - Got unexpected modelIndex"
145− << modelIndex << m_firstVisibleIndex << m_visibleItems.count();
146− return;
147− }
148−
149− const QPointF pos = positionForIndex(modelIndex);
150− item->setPosition(pos);
151−
152− item->setSize(sizeForIndex(modelIndex));
153−}
154−
155−bool OrganicGrid::removeNonVisibleItems(qreal bufferFromY, qreal bufferToY)
156−{
157− bool changed = false;
158−
159− // As adding, we also remove in a 6-module basis
160− int lastModuleIndex = (m_firstVisibleIndex / 6) * 6 + 5;
161− bool removeIndex = positionForIndex(lastModuleIndex).y() + sizeForIndex(lastModuleIndex).height() < bufferFromY;
162− while (removeIndex && !m_visibleItems.isEmpty()) {
163− releaseItem(m_visibleItems.takeFirst());
164− changed = true;
165− m_firstVisibleIndex++;
166−
167− lastModuleIndex = (m_firstVisibleIndex / 6) * 6 + 5;
168− removeIndex = positionForIndex(lastModuleIndex).y() + sizeForIndex(lastModuleIndex).height() < bufferFromY;
169− }
170−
171− int firstModuleIndex = ((m_firstVisibleIndex + m_visibleItems.count() - 1) / 6) * 6;
172− removeIndex = positionForIndex(firstModuleIndex).y() > bufferToY;
173− while (removeIndex && !m_visibleItems.isEmpty()) {
174− releaseItem(m_visibleItems.takeLast());
175− changed = true;
176−
177− firstModuleIndex = ((m_firstVisibleIndex + m_visibleItems.count() - 1) / 6) * 6;
178− removeIndex = positionForIndex(firstModuleIndex).y() > bufferToY;
179− }
180−
181− if (m_visibleItems.isEmpty()) {
182− m_firstVisibleIndex = -1;
183− }
184−
185− return changed;
186−}
187−
188−void OrganicGrid::cleanupExistingItems()
189−{
190− Q_FOREACH(QQuickItem *item, m_visibleItems)
191− releaseItem(item);
192− m_visibleItems.clear();
193− m_firstVisibleIndex = -1;
194− setImplicitHeightDirty();
195−}
196−
197−void OrganicGrid::doRelayout()
198−{
199− const qreal moduleWidth = m_smallDelegateSize.width() * 2 + columnSpacing() * 2 + m_bigDelegateSize.width();
200− m_numberOfModulesPerRow = floor((width() + columnSpacing()) / (moduleWidth + columnSpacing()));
201− m_numberOfModulesPerRow = qMax(1, m_numberOfModulesPerRow);
202−
203− int i = m_firstVisibleIndex;
204− const QList<QQuickItem*> allItems = m_visibleItems;
205− m_visibleItems.clear();
206− Q_FOREACH(QQuickItem *item, allItems) {
207− addItemToView(i, item);
208− ++i;
209− }
210−}
211−
212−void OrganicGrid::updateItemCulling(qreal visibleFromY, qreal visibleToY)
213−{
214− Q_FOREACH(QQuickItem *item, m_visibleItems) {
215− QQuickItemPrivate::get(item)->setCulled(item->y() + item->height() <= visibleFromY || item->y() >= visibleToY);
216− }
217−}
218−
219−void OrganicGrid::calculateImplicitHeight()
220−{
221− const qreal moduleHeight = m_smallDelegateSize.height() + rowSpacing() + m_bigDelegateSize.height();
222− const int itemCount = !model() ? 0 : model()->rowCount();
223− const int itemsPerRow = m_numberOfModulesPerRow * 6;
224− const int fullRows = floor(itemCount / itemsPerRow);
225− const qreal fullRowsHeight = fullRows == 0 ? 0 : fullRows * moduleHeight + rowSpacing() * (fullRows - 1);
226−
227− const int remainingItems = itemCount - fullRows * itemsPerRow;
228− if (remainingItems == 0) {
229− setImplicitHeight(fullRowsHeight);
230− } else if (remainingItems <= 2) {
231− setImplicitHeight(fullRowsHeight + m_smallDelegateSize.height() + rowSpacing());
232− } else {
233− setImplicitHeight(fullRowsHeight + rowSpacing() + moduleHeight);
234− }
235−}
236−
237−void OrganicGrid::processModelRemoves(const QVector<QQmlChangeSet::Change> &removes)
238−{
239− Q_FOREACH(const QQmlChangeSet::Change remove, removes) {
240− for (int i = remove.count - 1; i >= 0; --i) {
241− const int indexToRemove = remove.index + i;
242− // We only support removing from the end
243− const int lastIndex = m_firstVisibleIndex + m_visibleItems.count() - 1;
244− if (indexToRemove == lastIndex) {
245− releaseItem(m_visibleItems.takeLast());
246− } else {
247− if (indexToRemove < lastIndex) {
248− qDebug() << "OrganicGrid only supports removal from the end of the model, resetting instead";
249− cleanupExistingItems();
250− break;
251− }
252− }
253− }
254− }
255− if (m_visibleItems.isEmpty()) {
256− m_firstVisibleIndex = -1;
257− }
258− setImplicitHeightDirty();
259−}
plugins/Dash/organicgrid.hdeleted−91
@@ -1,91 +0,0 @@
1−/*
2− * Copyright (C) 2014 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 ORGANICGRID_H
18−#define ORGANICGRID_H
19−
20−#include "abstractdashview.h"
21−
22− /** An Organic Grid is is a view that creates delegates
23− * based on a model and layouts them in groups of six items (called module).
24− *
25− * In each module there are 4 items that are forced to the small delegate size
26− * and two that are forced to the big delegate size.
27− *
28− * Example:
29− *
30− * +---+ +---+ +-----+
31− * | 1 | | 2 | | |
32− * +---+ +---+ | 5 |
33− * +-----+ | |
34− * | | +-----+
35− * | 3 | +---+ +---+
36− * | | | 4 | | 6 |
37− * +-----+ +---+ +---+
38− *
39− * Modules are positioned one after the other in a grid like fashion, i.e.
40− *
41− * +---+ +---+
42− * | 1 | | 2 |
43− * +---+ +---+
44− * +---+ +---+
45− * | 3 | | 4 |
46− * +---+ +---+
47− */
48−
49−class OrganicGrid : public AbstractDashView
50−{
51− Q_OBJECT
52−
53− Q_PROPERTY(QSizeF smallDelegateSize READ smallDelegateSize WRITE setSmallDelegateSize NOTIFY smallDelegateSizeChanged)
54− Q_PROPERTY(QSizeF bigDelegateSize READ bigDelegateSize WRITE setBigDelegateSize NOTIFY bigDelegateSizeChanged)
55−
56−friend class OrganicGridTest;
57−
58−public:
59− OrganicGrid();
60−
61− QSizeF smallDelegateSize() const;
62− void setSmallDelegateSize(const QSizeF size);
63−
64− QSizeF bigDelegateSize() const;
65− void setBigDelegateSize(const QSizeF size);
66−
67−Q_SIGNALS:
68− void smallDelegateSizeChanged();
69− void bigDelegateSizeChanged();
70−private:
71− QPointF positionForIndex(int modelIndex) const;
72− QSizeF sizeForIndex(int modelIndex) const;
73−
74− void findBottomModelIndexToAdd(int *modelIndex, qreal *yPos) override;
75− void findTopModelIndexToAdd(int *modelIndex, qreal *yPos) override;
76− void addItemToView(int modelIndex, QQuickItem *item) override;
77− bool removeNonVisibleItems(qreal bufferFromY, qreal bufferToY) override;
78− void cleanupExistingItems() override;
79− void doRelayout() override;
80− void updateItemCulling(qreal visibleFromY, qreal visibleToY) override;
81− void calculateImplicitHeight() override;
82− void processModelRemoves(const QVector<QQmlChangeSet::Change> &removes) override;
83−
84− QSizeF m_smallDelegateSize;
85− QSizeF m_bigDelegateSize;
86− int m_firstVisibleIndex;
87− int m_numberOfModulesPerRow;
88− QList<QQuickItem*> m_visibleItems;
89−};
90−
91−#endif
plugins/Dash/plugin.cppdeleted−70
@@ -1,70 +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−
18−#include "plugin.h"
19−
20−#include "horizontaljournal.h"
21−#include "listviewwithpageheader.h"
22−#include "organicgrid.h"
23−#include "verticaljournal.h"
24−
25−#include <QAbstractItemModel>
26−#include <QUrlQuery>
27−
28−static QUrl oauthCleanedUrl(QUrl u)
29−{
30− QUrlQuery q(u);
31− q.removeQueryItem(QStringLiteral("oauth_nonce"));
32− q.removeQueryItem(QStringLiteral("oauth_timestamp"));
33− q.removeQueryItem(QStringLiteral("oauth_consumer_key"));
34− q.removeQueryItem(QStringLiteral("oauth_signature_method"));
35− q.removeQueryItem(QStringLiteral("oauth_version"));
36− q.removeQueryItem(QStringLiteral("oauth_signature"));
37− u.setQuery(q);
38− return u;
39−}
40−
41−class AudioComparer : public QObject
42−{
43− Q_OBJECT
44−public:
45− Q_INVOKABLE bool compare(const QUrl &url1, const QUrl &url2)
46− {
47− return oauthCleanedUrl(url1) == oauthCleanedUrl(url2);
48− }
49−};
50−
51−static QObject *audio_comparer_singleton_provider(QQmlEngine *engine, QJSEngine *scriptEngine)
52−{
53− Q_UNUSED(engine)
54− Q_UNUSED(scriptEngine)
55−
56− return new AudioComparer();
57−}
58−
59−void DashPlugin::registerTypes(const char *uri)
60−{
61− Q_ASSERT(uri == QLatin1String("Dash"));
62− qmlRegisterType<QAbstractItemModel>();
63− qmlRegisterType<HorizontalJournal>(uri, 0, 1, "HorizontalJournal");
64− qmlRegisterType<ListViewWithPageHeader>(uri, 0, 1, "ListViewWithPageHeader");
65− qmlRegisterType<OrganicGrid>(uri, 0, 1, "OrganicGrid");
66− qmlRegisterType<VerticalJournal>(uri, 0, 1, "VerticalJournal");
67− qmlRegisterSingletonType<AudioComparer>(uri, 0, 1, "AudioUrlComparer", audio_comparer_singleton_provider);
68−}
69−
70−#include "plugin.moc"
plugins/Dash/plugin.hdeleted−33
@@ -1,33 +0,0 @@
1−/*
2− * Copyright (C) 2012 Canonical, Ltd.
3− *
4− * This program is free software; you can redistribute it and/or modify
5− * it under the terms of the GNU General Public License 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−#ifndef DASH_PLUGIN_H
19−#define DASH_PLUGIN_H
20−
21−#include <QtQml/QQmlEngine>
22−#include <QtQml/QQmlExtensionPlugin>
23−
24−class DashPlugin : public QQmlExtensionPlugin
25−{
26− Q_OBJECT
27− Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
28−
29−public:
30− void registerTypes(const char *uri) override;
31−};
32−
33−#endif
plugins/Dash/qmldirdeleted−11
@@ -1,11 +0,0 @@
1−module Dash
2−plugin Dash-qml
3−typeinfo Dash.qmltypes
4−singleton CardCreatorCache 0.1 CardCreatorCache.qml
5−singleton DashAudioPlayer 0.1 DashAudioPlayer.qml
6−ScopeStyle 0.1 ScopeStyle.qml
7−CardAttributes 0.1 CardAttributes.qml
8−CardSocialActions 0.1 CardSocialActions.qml
9−CroppedImageMinimumSourceSize 0.1 CroppedImageMinimumSourceSize.qml
10−AudioProgressBar 0.1 AudioProgressBar.qml
11−CardAudioProgress 0.1 CardAudioProgress.qml
plugins/Dash/verticaljournal.cppdeleted−279
@@ -1,279 +0,0 @@
1−/*
2− * Copyright (C) 2013, 2016 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 <math.h>
31−
32−#include <private/qquickitem_p.h>
33−
34−VerticalJournal::VerticalJournal()
35− : m_columnWidth(0)
36−{
37−}
38−
39−qreal VerticalJournal::columnWidth() const
40−{
41− return m_columnWidth;
42−}
43−
44−void VerticalJournal::setColumnWidth(qreal columnWidth)
45−{
46− if (columnWidth != m_columnWidth) {
47− m_columnWidth = columnWidth;
48− Q_EMIT columnWidthChanged();
49−
50− if (isComponentComplete()) {
51− Q_FOREACH(const auto &column, m_columnVisibleItems) {
52− Q_FOREACH(const ViewItem item, column) {
53− item.m_item->setWidth(columnWidth);
54− }
55− }
56− relayout();
57− }
58− }
59−}
60−
61−void VerticalJournal::findBottomModelIndexToAdd(int *modelIndex, qreal *yPos)
62−{
63− *modelIndex = 0;
64− *yPos = std::numeric_limits<qreal>::max();
65−
66− Q_FOREACH(const auto &column, m_columnVisibleItems) {
67− if (!column.isEmpty()) {
68− const ViewItem &item = column.last();
69− *yPos = qMin(*yPos, item.y() + item.height() + rowSpacing());
70− *modelIndex = qMax(*modelIndex, item.m_modelIndex + 1);
71− } else {
72− *yPos = 0;
73− }
74− }
75−}
76−
77−void VerticalJournal::findTopModelIndexToAdd(int *modelIndex, qreal *yPos)
78−{
79− *modelIndex = 0;
80− *yPos = std::numeric_limits<qreal>::lowest();
81− int columnToAddTo = -1;
82−
83− // Find the topmost free column
84− for (int i = 0; i < m_columnVisibleItems.count(); ++i) {
85− const auto &column = m_columnVisibleItems[i];
86− if (!column.isEmpty()) {
87− const ViewItem &item = column.first();
88− const auto itemTopPos = item.y() - rowSpacing();
89− if (itemTopPos > *yPos) {
90− *yPos = itemTopPos;
91− *modelIndex = item.m_modelIndex - 1;
92− columnToAddTo = i;
93− }
94− }
95− }
96−
97− if (*modelIndex > 0) {
98− Q_ASSERT(m_indexColumnMap.contains(*modelIndex));
99− while (*modelIndex > 0 && m_indexColumnMap[*modelIndex] != columnToAddTo) {
100− // We found out that we have to add to columnToAddTo
101− // and thought that we had to add *modelIndex, but history tells
102− // it is not correct, so find up from *modelIndex until we found the index
103− // that has to end up in columnToAddTo
104− *modelIndex = *modelIndex - 1;
105− Q_ASSERT(m_indexColumnMap.contains(*modelIndex));
106− }
107− }
108−}
109−
110−bool VerticalJournal::removeNonVisibleItems(qreal bufferFromY, qreal bufferToY)
111−{
112− bool changed = false;
113−
114− for (int i = 0; i < m_columnVisibleItems.count(); ++i) {
115− QList<ViewItem> &column = m_columnVisibleItems[i];
116− while (!column.isEmpty() && column.first().y() + column.first().height() < bufferFromY) {
117− releaseItem(column.takeFirst().m_item);
118− changed = true;
119− }
120−
121− while (!column.isEmpty() && column.last().y() > bufferToY) {
122− releaseItem(column.takeLast().m_item);
123− changed = true;
124− }
125− }
126−
127− return changed;
128−}
129−
130−void VerticalJournal::addItemToView(int modelIndex, QQuickItem *item)
131−{
132− if (item->width() != m_columnWidth) {
133− qWarning() << "Item" << modelIndex << "width is not the one that the columnWidth mandates, resetting it";
134− item->setWidth(m_columnWidth);
135− }
136−
137− // Check if we add it to the bottom of existing column items
138− const QList<ViewItem> &firstColumn = m_columnVisibleItems[0];
139− qreal columnToAddY = !firstColumn.isEmpty() ? firstColumn.last().y() + firstColumn.last().height() : -rowSpacing();
140− int columnToAddTo = 0;
141− for (int i = 1; i < m_columnVisibleItems.count(); ++i) {
142− const QList<ViewItem> &column = m_columnVisibleItems[i];
143− const qreal iY = !column.isEmpty() ? column.last().y() + column.last().height() : -rowSpacing();
144− if (iY < columnToAddY) {
145− columnToAddTo = i;
146− columnToAddY = iY;
147− }
148− }
149−
150− const QList<ViewItem> &columnToAdd = m_columnVisibleItems[columnToAddTo];
151− if (columnToAdd.isEmpty() || columnToAdd.last().m_modelIndex < modelIndex) {
152− item->setX(columnToAddTo * (m_columnWidth + columnSpacing()));
153− item->setY(columnToAddY + rowSpacing());
154−
155− m_columnVisibleItems[columnToAddTo] << ViewItem(item, modelIndex);
156− m_indexColumnMap[modelIndex] = columnToAddTo;
157− } else {
158− Q_ASSERT(m_indexColumnMap.contains(modelIndex));
159− columnToAddTo = m_indexColumnMap[modelIndex];
160− columnToAddY = m_columnVisibleItems[columnToAddTo].first().y();
161−
162− item->setX(columnToAddTo * (m_columnWidth + columnSpacing()));
163− item->setY(columnToAddY - rowSpacing() - item->height());
164−
165− m_columnVisibleItems[columnToAddTo].prepend(ViewItem(item, modelIndex));
166− }
167−}
168−
169−void VerticalJournal::cleanupExistingItems()
170−{
171− // Cleanup the existing items
172− for (int i = 0; i < m_columnVisibleItems.count(); ++i) {
173− QList<ViewItem> &column = m_columnVisibleItems[i];
174− Q_FOREACH(const ViewItem item, column)
175− releaseItem(item.m_item);
176− column.clear();
177− }
178− m_indexColumnMap.clear();
179− setImplicitHeightDirty();
180−}
181−
182−void VerticalJournal::calculateImplicitHeight()
183−{
184− int lastModelIndex = -1;
185− qreal bottomMostY = 0;
186− Q_FOREACH(const auto &column, m_columnVisibleItems) {
187− if (!column.isEmpty()) {
188− const ViewItem &item = column.last();
189− lastModelIndex = qMax(lastModelIndex, item.m_modelIndex);
190− bottomMostY = qMax(bottomMostY, item.y() + item.height());
191− }
192− }
193− if (lastModelIndex >= 0) {
194− const double averageHeight = bottomMostY / (lastModelIndex + 1);
195− setImplicitHeight(bottomMostY + averageHeight * (model()->rowCount() - lastModelIndex - 1));
196− } else {
197− setImplicitHeight(0);
198− }
199−}
200−
201−void VerticalJournal::doRelayout()
202−{
203− QList<ViewItem> allItems;
204− Q_FOREACH(const auto &column, m_columnVisibleItems)
205− allItems << column;
206−
207− qSort(allItems);
208−
209− const int nColumns = qMax(1., floor((double)(width() + columnSpacing()) / (m_columnWidth + columnSpacing())));
210− m_columnVisibleItems.resize(nColumns);
211− m_indexColumnMap.clear();
212− for (int i = 0; i < nColumns; ++i)
213− m_columnVisibleItems[i].clear();
214−
215− // If the first of allItems doesn't contain index 0 we need to drop them
216− // all since we can't consistently relayout without the first item being there
217−
218− if (!allItems.isEmpty()) {
219− if (allItems.first().m_modelIndex == 0) {
220− Q_FOREACH(const ViewItem item, allItems)
221− addItemToView(item.m_modelIndex, item.m_item);
222− } else {
223− Q_FOREACH(const ViewItem item, allItems)
224− releaseItem(item.m_item);
225− }
226− }
227−}
228−
229−void VerticalJournal::updateItemCulling(qreal visibleFromY, qreal visibleToY)
230−{
231− Q_FOREACH(const auto &column, m_columnVisibleItems) {
232− Q_FOREACH(const ViewItem item, column) {
233− const bool cull = item.y() + item.height() <= visibleFromY || item.y() >= visibleToY;
234− QQuickItemPrivate::get(item.m_item)->setCulled(cull);
235− }
236− }
237−}
238−
239−void VerticalJournal::processModelRemoves(const QVector<QQmlChangeSet::Change> &removes)
240−{
241− Q_FOREACH(const QQmlChangeSet::Change remove, removes) {
242− for (int i = remove.count - 1; i >= 0; --i) {
243− const int indexToRemove = remove.index + i;
244− // Since we only support removing from the end, indexToRemove
245− // must refer to the last item of one of the columns or
246− // be bigger than them (because it's not in the viewport and
247− // thus we have not created a delegate for it)
248− bool found = false;
249− int lastCreatedIndex = INT_MIN;
250− for (int i = 0; !found && i < m_columnVisibleItems.count(); ++i) {
251− QList<ViewItem> &column = m_columnVisibleItems[i];
252− if (!column.isEmpty()) {
253− const int lastColumnIndex = column.last().m_modelIndex;
254− if (lastColumnIndex == indexToRemove) {
255− releaseItem(column.takeLast().m_item);
256− found = true;
257− }
258− lastCreatedIndex = qMax(lastCreatedIndex, lastColumnIndex);
259− }
260− }
261− if (!found) {
262− if (indexToRemove < lastCreatedIndex) {
263− qDebug() << "VerticalJournal only supports removal from the end of the model, resetting instead";
264− cleanupExistingItems();
265− break;
266− } else {
267− setImplicitHeightDirty();
268− }
269− }
270− }
271− }
272−}
273−
274−void VerticalJournal::itemGeometryChanged(QQuickItem * /*item*/, QQuickGeometryChange change, const QRectF &)
275−{
276− if (change.verticalChange()) {
277− relayout();
278− }
279−}
plugins/Dash/verticaljournal.hdeleted−103
@@ -1,103 +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−#ifndef VERTICALJOURNAL_H
18−#define VERTICALJOURNAL_H
19−
20−#include "abstractdashview.h"
21−
22− /** A vertical journal is a view that creates delegates
23− * based on a model and layouts them in columns following
24− * a top-left most position rule.
25− *
26− * The number of columns is calculated using the width of
27− * the view itself, the columnWidth (i.e. the width of each individual delegate)
28− * and the columnSpacing between columns.
29− *
30− * All delegates are forced to columnWidth if they don't have it.
31− *
32− * The first nColumns items are layouted at row 0 from column 0
33− * to column nColumns-1 in order. After that every new item
34− * is positioned in the column which provides the free topmost
35− * position as possible. If more than one column tie in providing
36− * the topmost free position the leftmost column will be used.
37− *
38− * Example:
39− *
40− * +-----+ +-----+ +-----+
41− * | | | 2 | | |
42− * | | | | | |
43− * | 1 | +-----+ | 3 |
44− * | | +-----+ | |
45− * | | | | +-----+
46− * +-----+ | 4 | +-----+
47− * +-----+ | | | 5 |
48− * | 6 | +-----+ | |
49− * | | +-----+
50− * +-----+
51− *
52− */
53−
54−class VerticalJournal : public AbstractDashView
55−{
56− Q_OBJECT
57−
58− Q_PROPERTY(qreal columnWidth READ columnWidth WRITE setColumnWidth NOTIFY columnWidthChanged)
59−
60−friend class VerticalJournalTest;
61−
62−public:
63− VerticalJournal();
64−
65− qreal columnWidth() const;
66− void setColumnWidth(qreal columnWidth);
67−
68−protected:
69− void itemGeometryChanged(QQuickItem * /*item*/, QQuickGeometryChange change, const QRectF &oldGeometry) override;
70−
71−Q_SIGNALS:
72− void columnWidthChanged();
73−
74−private:
75− class ViewItem
76− {
77− public:
78− ViewItem(QQuickItem *item, int modelIndex) : m_item(item), m_modelIndex(modelIndex) {}
79− qreal x() const { return m_item->x(); }
80− qreal y() const { return m_item->y(); }
81− qreal height() const { return m_item->height(); }
82− bool operator<(const ViewItem v) const { return m_modelIndex < v.m_modelIndex; }
83−
84− QQuickItem *m_item;
85− int m_modelIndex;
86− };
87−
88− void findBottomModelIndexToAdd(int *modelIndex, qreal *yPos) override;
89− void findTopModelIndexToAdd(int *modelIndex, qreal *yPos) override;
90− bool removeNonVisibleItems(qreal bufferFromY, qreal bufferToY) override;
91− void addItemToView(int modelIndex, QQuickItem *item) override;
92− void cleanupExistingItems() override;
93− void calculateImplicitHeight() override;
94− void doRelayout() override;
95− void updateItemCulling(qreal visibleFromY, qreal visibleToY) override;
96− void processModelRemoves(const QVector<QQmlChangeSet::Change> &removes) override;
97−
98− QVector<QList<ViewItem>> m_columnVisibleItems;
99− QHash<int, int> m_indexColumnMap;
100− int m_columnWidth;
101−};
102−
103−#endif
plugins/GlobalShortcut/CMakeLists.txt+1−1
@@ -5,6 +5,6 @@ set(globalshortcutplugin_SRCS
55
66add_library(GlobalShortcut-qml SHARED ${globalshortcutplugin_SRCS})
77
8−qt5_use_modules(GlobalShortcut-qml Quick Gui)
8+target_link_libraries(GlobalShortcut-qml Qt5::Quick Qt5::Gui)
99
1010add_unity8_plugin(GlobalShortcut 1.0 GlobalShortcut TARGETS GlobalShortcut-qml)
plugins/GlobalShortcut/globalshortcut.cpp+15−4
@@ -58,15 +58,26 @@ void GlobalShortcut::setActive(bool active)
5858
5959void GlobalShortcut::componentComplete()
6060{
61+ if (this->window()) {
62+ QMetaObject::invokeMethod(this, "setupFilterOnWindow", Q_ARG(QQuickWindow*, this->window()));
63+ }
6164 connect(this, &QQuickItem::windowChanged, this, &GlobalShortcut::setupFilterOnWindow);
6265}
6366
6467void GlobalShortcut::keyPressEvent(QKeyEvent * event)
6568{
66− Q_UNUSED(event)
67− if (m_active) {
68− Q_EMIT triggered(m_shortcut.toString());
69− }
69+ if (!m_active) return;
70+
71+ event->accept();
72+ Q_EMIT triggered(m_shortcut.toString());
73+}
74+
75+void GlobalShortcut::keyReleaseEvent(QKeyEvent * event)
76+{
77+ if (!m_active) return;
78+
79+ event->accept();
80+ Q_EMIT released(m_shortcut.toString());
7081}
7182
7283void GlobalShortcut::setupFilterOnWindow(QQuickWindow *window)
plugins/GlobalShortcut/globalshortcut.h+5
@@ -55,6 +55,7 @@ public:
5555protected:
5656 void componentComplete() override;
5757 void keyPressEvent(QKeyEvent * event) override;
58+ void keyReleaseEvent(QKeyEvent * event) override;
5859
5960Q_SIGNALS:
6061 void shortcutChanged(const QVariant &shortcut);
@@ -62,6 +63,10 @@ Q_SIGNALS:
6263 * Emitted when a global keypress of @p shortcut is detected
6364 */
6465 void triggered(const QString &shortcut);
66+ /**
67+ * Emitted when a global keypress of @p shortcut is released
68+ */
69+ void released(const QString &shortcut);
6570 void activeChanged(bool active);
6671
6772private Q_SLOTS:
plugins/GlobalShortcut/globalshortcutregistry.cpp+14−4
@@ -73,20 +73,30 @@ bool GlobalShortcutRegistry::eventFilter(QObject *obj, QEvent *event)
7373 Q_ASSERT(m_filteredWindow);
7474 Q_ASSERT(obj == static_cast<QObject*>(m_filteredWindow.data()));
7575
76− if (event->type() == QEvent::KeyPress) {
76+ if (event->type() == QEvent::KeyPress || event->type() == QEvent::KeyRelease) {
77+
7778 QKeyEvent *keyEvent = static_cast<QKeyEvent*>(event);
79+
80+ // Make a copy of the event so we don't alter it for passing on.
81+ QKeyEvent eCopy(keyEvent->type(),
82+ keyEvent->key(),
83+ keyEvent->modifiers(),
84+ keyEvent->text(),
85+ keyEvent->isAutoRepeat(),
86+ keyEvent->count());
87+ eCopy.ignore();
88+
7889 int seq = keyEvent->key() + keyEvent->modifiers();
7990 if (m_shortcuts.contains(seq)) {
8091 const auto shortcuts = m_shortcuts.value(seq);
8192 Q_FOREACH(const auto &shortcut, shortcuts) {
8293 if (shortcut) {
83− qApp->sendEvent(shortcut, keyEvent);
84− event->accept();
94+ qApp->sendEvent(shortcut, &eCopy);
8595 }
8696 }
8797 }
8898
89− return event->isAccepted();
99+ return eCopy.isAccepted();
90100 }
91101
92102 return QObject::eventFilter(obj, event);
plugins/Greeter/Unity/Launcher/CMakeLists.txt+1−3
@@ -1,4 +1,3 @@
1−pkg_check_modules(LAUNCHER_API REQUIRED unity-shell-launcher=10)
21pkg_check_modules(GSETTINGS_QT REQUIRED gsettings-qt)
32
43add_definitions(-DSM_BUSNAME=systemBus)
@@ -30,8 +29,7 @@ add_library(UnityLauncherAS-qml MODULE
3029target_link_libraries(UnityLauncherAS-qml
3130 unity8-private
3231 ${GSETTINGS_QT_LDFLAGS}
32+ Qt5::DBus Qt5::Qml Qt5::Gui
3333 )
3434
35−qt5_use_modules(UnityLauncherAS-qml DBus Qml Gui)
36−
3735add_unity8_greeter_plugin(Unity.Launcher 0.1 Unity/Launcher TARGETS UnityLauncherAS-qml)
plugins/Greeter/Unity/Launcher/launcheritem.cpp+19
@@ -76,6 +76,25 @@ void LauncherItem::setIcon(const QString &icon)
7676 }
7777}
7878
79+QStringList LauncherItem::keywords() const
80+{
81+ return m_keywords;
82+}
83+
84+void LauncherItem::setKeywords(const QStringList &keywords)
85+{
86+ if (m_keywords != keywords) {
87+ m_keywords = keywords;
88+ Q_EMIT keywordsChanged(keywords);
89+ }
90+}
91+
92+uint LauncherItem::popularity() const
93+{
94+ // Not exposing usage order in greeter session at this point.
95+ return 0;
96+}
97+
7998bool LauncherItem::pinned() const
8099{
81100 return m_pinned;
plugins/Greeter/Unity/Launcher/launcheritem.h+4
@@ -34,6 +34,8 @@ public:
3434 QString appId() const override;
3535 QString name() const override;
3636 QString icon() const override;
37+ QStringList keywords() const override;
38+ uint popularity() const override;
3739 bool pinned() const override;
3840 bool running() const override;
3941 bool recent() const override;
@@ -49,6 +51,7 @@ public:
4951private:
5052 void setName(const QString &name);
5153 void setIcon(const QString &icon);
54+ void setKeywords(const QStringList &keywords);
5255 void setPinned(bool pinned);
5356 void setRunning(bool running);
5457 void setRecent(bool recent);
@@ -63,6 +66,7 @@ private:
6366 QString m_appId;
6467 QString m_name;
6568 QString m_icon;
69+ QStringList m_keywords;
6670 bool m_pinned;
6771 bool m_running;
6872 bool m_recent;
plugins/Greeter/Unity/Launcher/quicklistmodel.cpp+2
@@ -65,6 +65,8 @@ QVariant QuickListModel::data(const QModelIndex &index, int role) const
6565 return m_list.at(index.row()).icon();
6666 case RoleClickable:
6767 return m_list.at(index.row()).clickable();
68+ case RoleIsPrivate:
69+ return false; // The greeter plugin would just not add any private entries
6870 }
6971 return QVariant();
7072}
plugins/ImageCache/CMakeLists.txtdeleted−8
@@ -1,8 +0,0 @@
1−add_library(ImageCache-qml MODULE
2− ImageCache.cpp
3− plugin.cpp
4− )
5−
6−qt5_use_modules(ImageCache-qml Gui Qml Quick)
7−
8−add_unity8_plugin(ImageCache 0.1 ImageCache TARGETS ImageCache-qml)
plugins/ImageCache/ImageCache.cppdeleted−135
@@ -1,135 +0,0 @@
1−/*
2− * Copyright (C) 2016 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 <QDateTime>
18−#include <QDebug>
19−#include <QDir>
20−#include <QUrl>
21−#include <QUrlQuery>
22−
23−#include "ImageCache.h"
24−
25−ImageCache::ImageCache()
26− : QQuickImageProvider(QQmlImageProviderBase::Image,
27− QQmlImageProviderBase::ForceAsynchronousImageLoading)
28−{
29−}
30−
31−QString ImageCache::imageCacheRoot()
32−{
33− QString xdgCache(qgetenv("XDG_CACHE_HOME"));
34− if (xdgCache.isEmpty()) {
35− xdgCache = QDir::homePath() + QStringLiteral("/.cache");
36− }
37−
38− return QDir::cleanPath(xdgCache) + QStringLiteral("/unity8/imagecache");
39−}
40−
41−QFileInfo ImageCache::imagePath(const QUrl &image)
42−{
43− QUrlQuery query(image);
44−
45− auto name = query.queryItemValue(QStringLiteral("name"));
46− if (name.isEmpty()) {
47− name = QStringLiteral("/paths") + image.toLocalFile();
48− } else {
49− name = QStringLiteral("/names/") + name;
50− }
51−
52− return QFileInfo(imageCacheRoot() + name);
53−}
54−
55−bool ImageCache::needsUpdate(const QUrl &image, const QFileInfo &cachePath, const QSize &imageSize, const QSize &requestedSize, QSize &finalSize)
56−{
57− if (!cachePath.exists())
58− return true;
59−
60− QFileInfo imageInfo(image.toLocalFile());
61− if (imageInfo.lastModified() > cachePath.lastModified())
62− return true;
63−
64− QSize cacheSize(QImageReader(cachePath.filePath()).size());
65− finalSize = calculateSize(imageSize, requestedSize);
66− if (finalSize.isValid() && cacheSize != finalSize)
67− return true;
68−
69− return false;
70−}
71−
72−QSize ImageCache::calculateSize(const QSize &imageSize, const QSize &requestedSize)
73−{
74− QSize finalSize(requestedSize);
75−
76− if (finalSize.width() == 0) {
77− finalSize.setWidth(imageSize.width() * (((double)finalSize.height()) / imageSize.height()));
78− } else if (finalSize.height() == 0) {
79− finalSize.setHeight(imageSize.height() * (((double)finalSize.width()) / imageSize.width()));
80− }
81−
82− return finalSize;
83−}
84−
85−QImage ImageCache::loadAndCacheImage(QImageReader &reader, const QFileInfo &cachePath, const QSize &finalSize)
86−{
87− reader.setQuality(100);
88− reader.setScaledSize(finalSize);
89− auto format = reader.format(); // can't get this after reading
90−
91− QImage loadedImage(reader.read());
92− if (loadedImage.isNull()) {
93− qWarning() << "ImageCache could not read image" << reader.fileName() << ":" << reader.errorString();
94− return QImage();
95− }
96−
97− cachePath.dir().mkpath(QStringLiteral("."));
98− loadedImage.save(cachePath.filePath(), format, 100);
99−
100− return loadedImage;
101−}
102−
103−QImage ImageCache::requestImage(const QString &id, QSize *size, const QSize &requestedSize)
104−{
105− QUrl image(id);
106− QImageReader imageReader(image.toLocalFile());
107− QSize imageSize(imageReader.size());
108− QImage result;
109−
110− // Early exit here, with no sourceSize, scaled-up sourceSize, or bad source image
111− if ((requestedSize.width() <= 0 && requestedSize.height() <= 0) ||
112− imageSize.isEmpty() ||
113− requestedSize.height() >= imageSize.height() ||
114− requestedSize.width() >= imageSize.width()) {
115− // We're only interested in scaling down, not up.
116− result = imageReader.read();
117− *size = result.size();
118− return result;
119− }
120−
121− auto cachePath = imagePath(image);
122− QSize finalSize;
123−
124− if (needsUpdate(image, cachePath, imageSize, requestedSize, finalSize)) {
125− if (finalSize.isEmpty()) {
126− finalSize = calculateSize(imageSize, requestedSize);
127− }
128− result = loadAndCacheImage(imageReader, cachePath, finalSize);
129− } else {
130− result = QImage(cachePath.filePath());
131− }
132−
133− *size = result.size();
134− return result;
135−}
plugins/ImageCache/ImageCache.hdeleted−53
@@ -1,53 +0,0 @@
1−/*
2− * Copyright (C) 2016 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−#pragma once
18−
19−#include <QFileInfo>
20−#include <QImageReader>
21−#include <QQuickImageProvider>
22−#include <QSize>
23−
24−/**
25− * This class accepts an id formulated like a URL. So you'd use something like:
26− *
27− * Image {
28− * source: "image://unity8imagecache/file:///usr/share/..."
29− * }
30− *
31− * Right now, we only support file:/// URLs. We do accept some flags though:
32− *
33− * ?name=NAME
34− * - This will use NAME as the cache lookup key instead of the provided URL.
35− *
36− * We don't do any cleaning of old cached files yet. So you may want to always
37− * provide a name to avoid leaving lots of files around.
38− */
39−
40−class ImageCache: public QQuickImageProvider
41−{
42−public:
43− ImageCache();
44−
45− QImage requestImage(const QString &id, QSize *size, const QSize &requestedSize) override;
46−
47−private:
48− static QString imageCacheRoot();
49− static QFileInfo imagePath(const QUrl &image);
50− static bool needsUpdate(const QUrl &image, const QFileInfo &cachePath, const QSize &imageSize, const QSize &requestedSize, QSize &finalSize);
51− static QSize calculateSize(const QSize &imageSize, const QSize &requestedSize);
52− static QImage loadAndCacheImage(QImageReader &reader, const QFileInfo &cachePath, const QSize &finalSize);
53−};
plugins/ImageCache/qmldirdeleted−2
@@ -1,2 +0,0 @@
1−module ImageCache
2−plugin ImageCache-qml
plugins/LightDM/CMakeLists.txt+1−1
@@ -7,7 +7,6 @@ include_directories(
77 ${CMAKE_CURRENT_SOURCE_DIR}
88 ${CMAKE_CURRENT_BINARY_DIR}
99 ${CMAKE_SOURCE_DIR}/plugins/Utils
10− ${CMAKE_BINARY_DIR}/tests/mocks/LightDM/IntegratedLightDM
1110 ${libunity8-private_SOURCE_DIR}
1211 ${LIBUSERMETRICSOUTPUT_INCLUDE_DIRS}
1312)
@@ -18,6 +17,7 @@ set(QMLPLUGIN_SRC
1817 DBusGreeterList.cpp
1918 Greeter.cpp
2019 plugin.cpp
20+ PromptsModel.cpp
2121 SessionsModel.cpp
2222 UsersModel.cpp
2323 )
plugins/LightDM/DBusGreeterList.cpp+3−3
@@ -43,10 +43,10 @@ bool DBusGreeterList::entryIsLocked() const
4343 return !m_greeter->promptless();
4444}
4545
46−void DBusGreeterList::authenticationUserChangedHandler(const QString &user)
46+void DBusGreeterList::authenticationUserChangedHandler()
4747{
48− notifyPropertyChanged(QStringLiteral("ActiveEntry"), user);
49− Q_EMIT EntrySelected(user);
48+ notifyPropertyChanged(QStringLiteral("ActiveEntry"), m_greeter->authenticationUser());
49+ Q_EMIT EntrySelected(m_greeter->authenticationUser());
5050}
5151
5252void DBusGreeterList::promptlessChangedHandler()
plugins/LightDM/DBusGreeterList.h+1−1
@@ -47,7 +47,7 @@ Q_SIGNALS:
4747 void entryIsLockedChanged();
4848
4949private Q_SLOTS:
50− void authenticationUserChangedHandler(const QString &user);
50+ void authenticationUserChangedHandler();
5151 void promptlessChangedHandler();
5252
5353private:
plugins/LightDM/FullLightDM/CMakeLists.txt+6−2
@@ -6,10 +6,14 @@ add_definitions(-DFULL_LIGHTDM)
66
77include_directories(
88 ../
9− ${LIBLIGHTDM_INCLUDE_DIRS}
109 ${CMAKE_CURRENT_BINARY_DIR}
1110 )
1211
12+include_directories(
13+ SYSTEM
14+ ${LIBLIGHTDM_INCLUDE_DIRS}
15+ )
16+
1317foreach(source_file ${QMLPLUGIN_SRC})
1418 list(APPEND RELATIVE_QMLPLUGIN_SRC ../${source_file})
1519endforeach()
@@ -22,7 +26,7 @@ target_link_libraries(FullLightDM-qml
2226 unity8-private
2327 ${LIBLIGHTDM_LDFLAGS}
2428 ${LIBUSERMETRICSOUTPUT_LDFLAGS}
29+ Qt5::DBus Qt5::Gui Qt5::Qml
2530 )
2631
27−qt5_use_modules(FullLightDM-qml DBus Gui Qml)
2832add_unity8_plugin(FullLightDM 0.1 LightDM/FullLightDM TARGETS FullLightDM-qml)
plugins/LightDM/Greeter.cpp+144−14
@@ -1,5 +1,5 @@
11/*
2− * Copyright (C) 2013, 2015 Canonical, Ltd.
2+ * Copyright (C) 2013-2017 Canonical, Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -17,12 +17,16 @@
1717
1818#include "Greeter.h"
1919#include "GreeterPrivate.h"
20+#include <QCoreApplication>
2021#include <libintl.h>
2122
23+static Greeter *singleton = nullptr;
24+
2225GreeterPrivate::GreeterPrivate(Greeter* parent)
2326 : m_greeter(new QLightDM::Greeter(parent)),
2427 m_active(false),
25− wasPrompted(false),
28+ responded(false),
29+ everResponded(false),
2630 promptless(false),
2731 q_ptr(parent)
2832{
@@ -41,9 +45,32 @@ Greeter::Greeter(QObject* parent)
4145 connect(d->m_greeter, &QLightDM::Greeter::authenticationComplete,
4246 this, &Greeter::authenticationCompleteFilter);
4347
48+ // Don't get stuck waiting for PAM as we shut down.
49+ connect(QCoreApplication::instance(), &QCoreApplication::aboutToQuit,
50+ d->m_greeter, &QLightDM::Greeter::cancelAuthentication);
51+
4452 d->m_greeter->connectSync();
4553}
4654
55+Greeter::~Greeter()
56+{
57+ singleton = nullptr;
58+}
59+
60+Greeter *Greeter::instance()
61+{
62+ if (!singleton) {
63+ singleton = new Greeter;
64+ }
65+ return singleton;
66+}
67+
68+PromptsModel *Greeter::promptsModel()
69+{
70+ Q_D(Greeter);
71+ return &d->prompts;
72+}
73+
4774bool Greeter::isActive() const
4875{
4976 Q_D(const Greeter);
@@ -68,7 +95,16 @@ bool Greeter::isAuthenticated() const
6895QString Greeter::authenticationUser() const
6996{
7097 Q_D(const Greeter);
71− return d->m_greeter->authenticationUser();
98+ return d->cachedAuthUser;
99+}
100+
101+void Greeter::checkAuthenticationUser()
102+{
103+ Q_D(Greeter);
104+ if (d->cachedAuthUser != d->m_greeter->authenticationUser()) {
105+ d->cachedAuthUser = d->m_greeter->authenticationUser();
106+ Q_EMIT authenticationUserChanged();
107+ }
72108}
73109
74110QString Greeter::defaultSessionHint() const
@@ -86,26 +122,65 @@ bool Greeter::promptless() const
86122QString Greeter::selectUser() const
87123{
88124 Q_D(const Greeter);
89− return d->m_greeter->selectUserHint();
125+ if (hasGuestAccount() && d->m_greeter->selectGuestHint()) {
126+ return QStringLiteral("*guest");
127+ } else {
128+ return d->m_greeter->selectUserHint();
129+ }
130+}
131+
132+bool Greeter::hasGuestAccount() const
133+{
134+ Q_D(const Greeter);
135+ return d->m_greeter->hasGuestAccountHint();
136+}
137+
138+bool Greeter::showManualLoginHint() const
139+{
140+ Q_D(const Greeter);
141+ return d->m_greeter->showManualLoginHint();
142+}
143+
144+bool Greeter::hideUsersHint() const
145+{
146+ Q_D(const Greeter);
147+ return d->m_greeter->hideUsersHint();
90148}
91149
92150void Greeter::authenticate(const QString &username)
93151{
94152 Q_D(Greeter);
95− d->wasPrompted = false;
153+ d->prompts.clear();
154+ d->responded = false;
155+ d->everResponded = false;
96156 if (d->promptless) {
97157 d->promptless = false;
98158 Q_EMIT promptlessChanged();
99159 }
100160
101− d->m_greeter->authenticate(username);
161+ if (authenticationUser() == username) {
162+ d->prompts = d->leftovers;
163+ }
164+ d->leftovers.clear();
165+
166+ if (username == QStringLiteral("*guest")) {
167+ d->m_greeter->authenticateAsGuest();
168+ } else if (username == QStringLiteral("*other")) {
169+ d->m_greeter->authenticate(nullptr);
170+ } else {
171+ d->m_greeter->authenticate(username);
172+ }
173+
174+ Q_EMIT authenticationStarted();
102175 Q_EMIT isAuthenticatedChanged();
103− Q_EMIT authenticationUserChanged(username);
176+ checkAuthenticationUser();
104177}
105178
106179void Greeter::respond(const QString &response)
107180{
108181 Q_D(Greeter);
182+ d->responded = true;
183+ d->everResponded = true;
109184 d->m_greeter->respond(response);
110185}
111186
@@ -118,32 +193,87 @@ bool Greeter::startSessionSync(const QString &session)
118193void Greeter::showPromptFilter(const QString &text, QLightDM::Greeter::PromptType type)
119194{
120195 Q_D(Greeter);
121− d->wasPrompted = true;
196+
197+ checkAuthenticationUser(); // may have changed in liblightdm
122198
123199 bool isDefaultPrompt = (text == dgettext("Linux-PAM", "Password: "));
200+ bool isSecret = type == QLightDM::Greeter::PromptTypeSecret;
201+
202+ QString trimmedText;
203+ if (!isDefaultPrompt)
204+ trimmedText = text.trimmed();
124205
125206 // Strip prompt of any colons at the end
126− QString trimmedText = text.trimmed();
127207 if (trimmedText.endsWith(':') || trimmedText.endsWith(QStringLiteral(":"))) {
128208 trimmedText.chop(1);
129209 }
130210
131− Q_EMIT showPrompt(trimmedText, type == QLightDM::Greeter::PromptTypeSecret, isDefaultPrompt);
211+ if (trimmedText == "login") {
212+ // 'login' is provided untranslated by LightDM when asking for a manual
213+ // login username.
214+ trimmedText = gettext("Username");
215+ }
216+
217+ if (d->responded) {
218+ d->prompts.clear();
219+ d->responded = false;
220+ }
221+
222+ d->prompts.append(trimmedText, isSecret ? PromptsModel::Secret : PromptsModel::Question);
132223}
133224
134225void Greeter::showMessageFilter(const QString &text, QLightDM::Greeter::MessageType type)
135226{
136− Q_EMIT showMessage(text, type == QLightDM::Greeter::MessageTypeError);
227+ Q_D(Greeter);
228+
229+ checkAuthenticationUser(); // may have changed in liblightdm
230+
231+ bool isError = type == QLightDM::Greeter::MessageTypeError;
232+
233+ if (d->responded) {
234+ d->prompts.clear();
235+ d->responded = false;
236+ }
237+ d->prompts.append(text, isError? PromptsModel::Error : PromptsModel::Message);
137238}
138239
139240void Greeter::authenticationCompleteFilter()
140241{
141242 Q_D(Greeter);
142− if (!d->wasPrompted) {
243+
244+ Q_EMIT isAuthenticatedChanged();
245+
246+ bool automatic = !d->everResponded;
247+ bool pamHasLeftoverMessages = !d->prompts.hasPrompt() && d->prompts.rowCount() > 0;
248+
249+ if (isAuthenticated() && automatic) {
143250 d->promptless = true;
144251 Q_EMIT promptlessChanged();
145252 }
146253
147− Q_EMIT isAuthenticatedChanged();
148− Q_EMIT authenticationComplete();
254+ if (!isAuthenticated()) {
255+ if (pamHasLeftoverMessages) {
256+ d->leftovers = d->prompts; // Prefer PAM's messages
257+ } else if (automatic) {
258+ d->leftovers.append(gettext("Failed to authenticate"), PromptsModel::Error);
259+ } else {
260+ d->leftovers.append(gettext("Invalid password, please try again"), PromptsModel::Error);
261+ }
262+ } else if (pamHasLeftoverMessages) {
263+ automatic = true; // treat this successful login as automatic, so user sees message
264+ d->leftovers = d->prompts;
265+ }
266+
267+ if (automatic) {
268+ d->prompts = d->leftovers; // OK, we'll just use these now
269+ d->leftovers.clear();
270+ d->prompts.append(isAuthenticated() ? gettext("Log In") : gettext("Retry"),
271+ PromptsModel::Button);
272+ }
273+
274+ if (isAuthenticated()) {
275+ Q_EMIT loginSuccess(automatic);
276+ } else {
277+ Q_EMIT loginError(automatic);
278+ }
149279}
plugins/LightDM/Greeter.h+17−10
@@ -1,5 +1,5 @@
11/*
2− * Copyright (C) 2012,2013,2015 Canonical, Ltd.
2+ * Copyright (C) 2012-2016 Canonical, Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -21,13 +21,13 @@
2121 such edits in the future, and by inserting ourselves here, we have more
2222 control. */
2323
24−#ifndef UNITY_GREETER_H
25−#define UNITY_GREETER_H
24+#pragma once
2625
2726#include <QLightDM/Greeter>
2827#include <QtCore/QObject>
2928
3029class GreeterPrivate;
30+class PromptsModel;
3131
3232class Greeter : public QObject
3333{
@@ -41,7 +41,8 @@ class Greeter : public QObject
4141 Q_PROPERTY(QString selectUser READ selectUser CONSTANT)
4242
4343public:
44− explicit Greeter(QObject* parent=0);
44+ static Greeter *instance();
45+ virtual ~Greeter();
4546
4647 bool isActive() const;
4748 bool isAuthenticated() const;
@@ -49,6 +50,11 @@ public:
4950 QString defaultSessionHint() const;
5051 bool promptless() const;
5152 QString selectUser() const;
53+ bool hasGuestAccount() const;
54+ bool showManualLoginHint() const;
55+ bool hideUsersHint() const;
56+
57+ PromptsModel *promptsModel();
5258
5359public Q_SLOTS:
5460 void authenticate(const QString &username=QString());
@@ -57,21 +63,23 @@ public Q_SLOTS:
5763 void setIsActive(bool isActive);
5864
5965Q_SIGNALS:
60− void showMessage(const QString &text, bool isError);
61− void showPrompt(const QString &text, bool isSecret, bool isDefaultPrompt);
62− void authenticationComplete();
63− void authenticationUserChanged(const QString &user);
66+ void authenticationUserChanged();
6467 void isActiveChanged();
6568 void isAuthenticatedChanged();
6669 void promptlessChanged();
6770 void showGreeter();
6871 void hideGreeter();
72+ void loginError(bool automatic);
73+ void loginSuccess(bool automatic);
74+ void authenticationStarted(); // useful for testing
6975
7076 // This signal is emitted by external agents like indicators, and the UI
7177 // should switch to this user if possible.
7278 void requestAuthenticationUser(const QString &user);
7379
7480protected:
81+ explicit Greeter(QObject* parent=0);
82+
7583 GreeterPrivate * const d_ptr;
7684
7785 Q_DECLARE_PRIVATE(Greeter)
@@ -80,6 +88,5 @@ private Q_SLOTS:
8088 void showMessageFilter(const QString &text, QLightDM::Greeter::MessageType type);
8189 void showPromptFilter(const QString &text, QLightDM::Greeter::PromptType type);
8290 void authenticationCompleteFilter();
91+ void checkAuthenticationUser();
8392};
84−
85−#endif
plugins/LightDM/GreeterPrivate.h+13−7
@@ -1,5 +1,5 @@
11/*
2− * Copyright (C) 2014 Canonical, Ltd.
2+ * Copyright (C) 2015-2017 Canonical, Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -14,10 +14,14 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−#ifndef UNITY_GREETER_PRIVATE_H
18−#define UNITY_GREETER_PRIVATE_H
17+#pragma once
1918
20−#include <QLightDM/Greeter>
19+#include "PromptsModel.h"
20+#include <QObject>
21+
22+namespace QLightDM {
23+ class Greeter;
24+}
2125
2226class GreeterPrivate
2327{
@@ -26,8 +30,12 @@ public:
2630
2731 QLightDM::Greeter *m_greeter;
2832 bool m_active;
29− bool wasPrompted;
33+ PromptsModel prompts;
34+ PromptsModel leftovers; // prompts to show during next auth for same user
35+ bool responded;
36+ bool everResponded;
3037 bool promptless;
38+ QString cachedAuthUser;
3139
3240protected:
3341 Greeter * const q_ptr;
@@ -35,5 +43,3 @@ protected:
3543private:
3644 Q_DECLARE_PUBLIC(Greeter)
3745};
38−
39−#endif // UNITY_GREETER_PRIVATE_H
plugins/LightDM/IntegratedLightDM/CMakeLists.txt+1−1
@@ -25,9 +25,9 @@ target_link_libraries(IntegratedLightDM-qml
2525 integratedLightDM
2626 unity8-private
2727 ${LIBUSERMETRICSOUTPUT_LDFLAGS}
28+ Qt5::DBus Qt5::Gui Qt5::Qml
2829 )
2930
30−qt5_use_modules(IntegratedLightDM-qml DBus Gui Qml)
3131add_unity8_plugin(IntegratedLightDM 0.1 LightDM/IntegratedLightDM TARGETS IntegratedLightDM-qml)
3232
3333add_subdirectory(liblightdm)
plugins/LightDM/IntegratedLightDM/liblightdm/CMakeLists.txt+3−4
@@ -26,22 +26,21 @@ target_link_libraries(integratedLightDM
2626 ${GLIB_LIBRARIES}
2727 ${LIBUSERMETRICSOUTPUT_LDFLAGS}
2828 -lpam
29+ Qt5::Concurrent Qt5::DBus Qt5::Gui
2930)
3031target_link_libraries(integratedLightDMSession
3132 ${GLIB_LIBRARIES}
3233 ${LIBUSERMETRICSOUTPUT_LDFLAGS}
3334 -lpam
35+ Qt5::Concurrent Qt5::DBus Qt5::Gui
3436)
3537target_link_libraries(MockLightDM-demo-shared
3638 ${GLIB_LIBRARIES}
3739 ${LIBUSERMETRICSOUTPUT_LDFLAGS}
3840 -lpam
41+ Qt5::Concurrent Qt5::DBus Qt5::Gui
3942)
4043
41−qt5_use_modules(integratedLightDM Concurrent DBus Gui)
42−qt5_use_modules(integratedLightDMSession Concurrent DBus Gui)
43−qt5_use_modules(MockLightDM-demo-shared Concurrent DBus Gui)
44−
4544set_target_properties(integratedLightDM PROPERTIES
4645 COMPILE_FLAGS "-DSM_BUSNAME=systemBus -fPIC")
4746set_target_properties(integratedLightDMSession PROPERTIES
plugins/LightDM/IntegratedLightDM/liblightdm/Greeter.cpp+7−4
@@ -49,7 +49,7 @@ QString Greeter::authenticationUser() const
4949
5050bool Greeter::hasGuestAccountHint() const
5151{
52− return true;
52+ return false;
5353}
5454
5555QString Greeter::getHint(const QString &name) const
@@ -70,12 +70,12 @@ bool Greeter::hideUsersHint() const
7070
7171bool Greeter::showManualLoginHint() const
7272{
73− return true;
73+ return false;
7474}
7575
7676bool Greeter::showRemoteLoginHint() const
7777{
78− return true;
78+ return false;
7979}
8080
8181QString Greeter::selectUserHint() const
@@ -146,7 +146,10 @@ void Greeter::authenticateRemote(const QString &session, const QString &username
146146}
147147
148148void Greeter::cancelAuthentication()
149−{}
149+{
150+ Q_D(Greeter);
151+ d->cancelAuthentication();
152+}
150153
151154void Greeter::setLanguage (const QString &language)
152155{
plugins/LightDM/IntegratedLightDM/liblightdm/Greeter.h+2−2
@@ -46,18 +46,18 @@ class Q_DECL_EXPORT Greeter : public QObject
4646 Q_PROPERTY(QString hostname READ hostname CONSTANT)
4747 Q_PROPERTY(bool hasGuestAccount READ hasGuestAccountHint CONSTANT)
4848
49− Q_ENUMS(PromptType MessageType)
50−
5149public:
5250 enum PromptType {
5351 PromptTypeQuestion,
5452 PromptTypeSecret
5553 };
54+ Q_ENUM(PromptType)
5655
5756 enum MessageType {
5857 MessageTypeInfo,
5958 MessageTypeError
6059 };
60+ Q_ENUM(MessageType)
6161
6262 explicit Greeter(QObject* parent=0);
6363 virtual ~Greeter();
plugins/LightDM/IntegratedLightDM/liblightdm/GreeterPrivate.cpp+27−22
@@ -206,6 +206,28 @@ public Q_SLOTS:
206206 }
207207 }
208208
209+ void cancelPam()
210+ {
211+ if (pamHandle != nullptr) {
212+ QFuture<int> pamFuture = futureWatcher.future();
213+ pam_handle *handle = pamHandle;
214+ pamHandle = nullptr; // to disable normal finishPam() handling
215+ pamFuture.cancel();
216+
217+ // Note the empty loop, we just want to clear the futures queue.
218+ // Any further prompts from the pam thread will be immediately
219+ // responded to/dismissed in handlePrompt().
220+ while (respond(QString()));
221+
222+ // Now let signal/slot handling happen so the thread can finish
223+ while (!pamFuture.isFinished()) {
224+ QCoreApplication::processEvents();
225+ }
226+
227+ pam_end(handle, PAM_CONV_ERR);
228+ }
229+ }
230+
209231Q_SIGNALS:
210232 void showMessage(pam_handle *handle, QString text, QLightDM::Greeter::MessageType type);
211233 void showPrompt(pam_handle *handle, QString text, QLightDM::Greeter::PromptType type, QLightDM::GreeterImpl::ResponseFuture response);
@@ -247,28 +269,6 @@ private Q_SLOTS:
247269 }
248270
249271private:
250− void cancelPam()
251− {
252− if (pamHandle != nullptr) {
253− QFuture<int> pamFuture = futureWatcher.future();
254− pam_handle *handle = pamHandle;
255− pamHandle = nullptr; // to disable normal finishPam() handling
256− pamFuture.cancel();
257−
258− // Note the empty loop, we just want to clear the futures queue.
259− // Any further prompts from the pam thread will be immediately
260− // responded to/dismissed in handlePrompt().
261− while (respond(QString()));
262−
263− // Now let signal/slot handling happen so the thread can finish
264− while (!pamFuture.isFinished()) {
265− QCoreApplication::processEvents();
266− }
267−
268− pam_end(handle, PAM_CONV_ERR);
269− }
270− }
271−
272272 Greeter *greeter;
273273 GreeterPrivate *greeterPrivate;
274274 pam_handle* pamHandle;
@@ -299,6 +299,11 @@ void GreeterPrivate::handleRespond(const QString &response)
299299 m_impl->respond(response);
300300}
301301
302+void GreeterPrivate::cancelAuthentication()
303+{
304+ m_impl->cancelPam();
305+}
306+
302307}
303308
304309#include "GreeterPrivate.moc"
plugins/LightDM/IntegratedLightDM/liblightdm/GreeterPrivate.h+1
@@ -38,6 +38,7 @@ public:
3838
3939 void handleAuthenticate();
4040 void handleRespond(const QString &response);
41+ void cancelAuthentication();
4142
4243protected:
4344 GreeterImpl *m_impl; // if the backend needs more private data
plugins/LightDM/IntegratedLightDM/liblightdm/SessionsModel.cpp−1
@@ -38,7 +38,6 @@ SessionsModel::SessionsModel(QObject* parent) :
3838 QAbstractListModel(parent),
3939 d_ptr(new SessionsModelPrivate(this))
4040{
41− Q_D(SessionsModel);
4241 m_roleNames = QAbstractListModel::roleNames();
4342 m_roleNames[KeyRole] = "key";
4443 m_roleNames[TypeRole] = "type";
plugins/LightDM/IntegratedLightDM/liblightdm/SessionsModel.h+2−2
@@ -35,8 +35,6 @@ class Q_DECL_EXPORT SessionsModel : public QAbstractListModel
3535 {
3636 Q_OBJECT
3737
38− Q_ENUMS(SessionModelRoles SessionType)
39−
4038 public:
4139
4240 enum SessionModelRoles {
@@ -46,11 +44,13 @@ class Q_DECL_EXPORT SessionsModel : public QAbstractListModel
4644 IdRole = KeyRole, /** Deprecated */
4745 TypeRole
4846 };
47+ Q_ENUM(SessionModelRoles)
4948
5049 enum SessionType {
5150 LocalSessions,
5251 RemoteSessions
5352 };
53+ Q_ENUM(SessionType)
5454
5555 explicit SessionsModel(QObject* parent=0); /** Deprecated. Loads local sessions*/
5656 explicit SessionsModel(SessionsModel::SessionType, QObject* parent=0);
plugins/LightDM/IntegratedLightDM/liblightdm/UsersModel.h+1−2
@@ -37,8 +37,6 @@ class Q_DECL_EXPORT UsersModel : public QAbstractListModel
3737{
3838 Q_OBJECT
3939
40− Q_ENUMS(UserModelRoles)
41−
4240public:
4341 explicit UsersModel(QObject *parent = 0);
4442 virtual ~UsersModel() = default;
@@ -53,6 +51,7 @@ public:
5351 BackgroundPathRole,
5452 UidRole
5553 };
54+ Q_ENUM(UserModelRoles)
5655
5756 int rowCount(const QModelIndex &parent) const override;
5857 QVariant data(const QModelIndex &index, int role) const override;
plugins/LightDM/PromptsModel.cppnew file+97
@@ -0,0 +1,97 @@
1+/*
2+ * Copyright (C) 2017 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+#include "PromptsModel.h"
19+
20+PromptsModel::PromptsModel(QObject* parent)
21+ : QAbstractListModel(parent)
22+{
23+ m_roleNames[TypeRole] = "type";
24+ m_roleNames[TextRole] = "text";
25+}
26+
27+PromptsModel& PromptsModel::operator=(const PromptsModel &other)
28+{
29+ beginResetModel();
30+ m_prompts = other.m_prompts;
31+ endResetModel();
32+ Q_EMIT countChanged();
33+ return *this;
34+}
35+
36+int PromptsModel::rowCount(const QModelIndex &parent) const
37+{
38+ if (parent.isValid())
39+ return 0;
40+
41+ return m_prompts.size();
42+}
43+
44+QVariant PromptsModel::data(const QModelIndex &index, int role) const
45+{
46+ if (!index.isValid() || index.column() > 0 || index.row() >= m_prompts.size())
47+ return QVariant();
48+
49+ switch (role) {
50+ case Qt::DisplayRole: // fallthrough
51+ case TextRole: return m_prompts[index.row()].prompt;
52+ case TypeRole: return m_prompts[index.row()].type;
53+ default: return QVariant();
54+ }
55+}
56+
57+QHash<int, QByteArray> PromptsModel::roleNames() const
58+{
59+ return m_roleNames;
60+}
61+
62+void PromptsModel::prepend(const QString &text, PromptType type)
63+{
64+ beginInsertRows(QModelIndex(), 0, 0);
65+ m_prompts.prepend(PromptInfo{text, type});
66+ endInsertRows();
67+
68+ Q_EMIT countChanged();
69+}
70+
71+void PromptsModel::append(const QString &text, PromptType type)
72+{
73+ beginInsertRows(QModelIndex(), m_prompts.size(), m_prompts.size());
74+ m_prompts.append(PromptInfo{text, type});
75+ endInsertRows();
76+
77+ Q_EMIT countChanged();
78+}
79+
80+void PromptsModel::clear()
81+{
82+ beginResetModel();
83+ m_prompts.clear();
84+ endResetModel();
85+
86+ Q_EMIT countChanged();
87+}
88+
89+bool PromptsModel::hasPrompt() const
90+{
91+ Q_FOREACH(const PromptInfo &info, m_prompts) {
92+ if (info.type == PromptType::Secret || info.type == PromptType::Question) {
93+ return true;
94+ }
95+ }
96+ return false;
97+}
plugins/LightDM/PromptsModel.hnew file+70
@@ -0,0 +1,70 @@
1+/*
2+ * Copyright (C) 2017 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+#pragma once
19+
20+#include <QAbstractListModel>
21+
22+class PromptsModel : public QAbstractListModel
23+{
24+ Q_OBJECT
25+
26+ Q_PROPERTY(int count READ rowCount NOTIFY countChanged)
27+
28+public:
29+ enum PromptsModelRoles {
30+ TypeRole = Qt::UserRole,
31+ TextRole,
32+ };
33+ Q_ENUM(PromptsModelRoles)
34+
35+ enum PromptType {
36+ Message,
37+ Error,
38+ Secret,
39+ Question,
40+ Button,
41+ };
42+ Q_ENUM(PromptType)
43+
44+ explicit PromptsModel(QObject* parent=0);
45+
46+ PromptsModel& operator=(const PromptsModel &other);
47+
48+ int rowCount(const QModelIndex &parent = QModelIndex()) const override;
49+ QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
50+ QHash<int, QByteArray> roleNames() const override;
51+
52+ Q_INVOKABLE void prepend(const QString &text, PromptType type);
53+ Q_INVOKABLE void append(const QString &text, PromptType type);
54+
55+ void clear();
56+
57+ bool hasPrompt() const;
58+
59+Q_SIGNALS:
60+ void countChanged();
61+
62+private:
63+ struct PromptInfo {
64+ QString prompt;
65+ PromptType type;
66+ };
67+
68+ QList<PromptInfo> m_prompts;
69+ QHash<int, QByteArray> m_roleNames;
70+};
plugins/LightDM/SessionsModel.cpp+1−2
@@ -1,5 +1,5 @@
11/*
2− * Copyright (C) 2015 Canonical, Ltd.
2+ * Copyright (C) 2015-2016 Canonical, Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -128,7 +128,6 @@ SessionsModel::SessionsModel(QObject* parent)
128128 }
129129
130130 setModel(m_model);
131− setSourceModel(m_model);
132131 setSortCaseSensitivity(Qt::CaseInsensitive);
133132 setSortLocaleAware(true);
134133 setSortRole(Qt::DisplayRole);
plugins/LightDM/SessionsModel.h+5−7
@@ -1,5 +1,5 @@
11/*
2− * Copyright (C) 2015 Canonical, Ltd.
2+ * Copyright (C) 2015-2016 Canonical, Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -15,8 +15,7 @@
1515 *
1616 */
1717
18−#ifndef UNITY_SESSIONSMODEL_H
19−#define UNITY_SESSIONSMODEL_H
18+#pragma once
2019
2120#include <unitysortfilterproxymodelqml.h>
2221#include <QLightDM/SessionsModel>
@@ -28,10 +27,9 @@ class SessionsModel : public UnitySortFilterProxyModelQML
2827{
2928 Q_OBJECT
3029
31− Q_ENUMS(SessionModelRoles)
32−
3330 Q_PROPERTY(QList<QUrl> iconSearchDirectories READ iconSearchDirectories
3431 WRITE setIconSearchDirectories NOTIFY iconSearchDirectoriesChanged)
32+
3533Q_SIGNALS:
3634 void iconSearchDirectoriesChanged();
3735
@@ -45,6 +43,7 @@ public:
4543 TypeRole = QLightDM::SessionsModel::SessionModelRoles::TypeRole,
4644 IconRole
4745 };
46+ Q_ENUM(SessionModelRoles)
4847
4948 explicit SessionsModel(QObject* parent=nullptr);
5049
@@ -55,6 +54,7 @@ public:
5554 Q_INVOKABLE QUrl iconUrl(const QString sessionName) const;
5655
5756 void setIconSearchDirectories(const QList<QUrl> searchDirectories);
57+
5858private:
5959 QLightDM::SessionsModel* m_model;
6060 QHash<int, QByteArray> m_roleNames;
@@ -64,5 +64,3 @@ private:
6464 QUrl("/usr/share/unity-greeter/")};
6565
6666};
67−
68−#endif // UNITY_SESSIONSMODEL_H
plugins/LightDM/UsersModel.cpp+176−9
@@ -1,5 +1,5 @@
11/*
2− * Copyright (C) 2013 Canonical, Ltd.
2+ * Copyright (C) 2013,2015-2016 Canonical, Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -12,20 +12,22 @@
1212 *
1313 * You should have received a copy of the GNU General Public License
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15− *
16− * Author: Michael Terry <michael.terry@canonical.com>
1715 */
1816
17+#include "Greeter.h"
1918#include "UsersModel.h"
19+#include <QIdentityProxyModel>
2020#include <QLightDM/UsersModel>
21−#include <QtCore/QSortFilterProxyModel>
21+
22+#include <libintl.h>
2223
2324// First, we define an internal class that wraps LightDM's UsersModel. This
2425// class will modify some of the data coming from LightDM. For example, we
25−// modify any empty Real Names into just normal Names.
26+// modify any empty Real Names into just normal Names. We also add optional
27+// rows, depending on configuration.
2628// (We can't modify the data directly in UsersModel below because it won't sort
2729// using the modified data.)
28−class MangleModel : public QSortFilterProxyModel
30+class MangleModel : public QIdentityProxyModel
2931{
3032 Q_OBJECT
3133
@@ -33,29 +35,177 @@ public:
3335 explicit MangleModel(QObject* parent=0);
3436
3537 QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
38+ int rowCount(const QModelIndex &parent = QModelIndex()) const override;
39+ QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override;
40+
41+private:
42+ struct CustomRow {
43+ QString name;
44+ QString realName;
45+ };
46+
47+ int sourceRowCount() const;
48+
49+ void updateGuestRow();
50+ void updateManualRow();
51+ void updateCustomRows();
52+
53+ void addCustomRow(const CustomRow &newRow);
54+ void removeCustomRow(const QString &rowName);
55+
56+ QList<CustomRow> m_customRows;
57+ bool m_updatingCustomRows;
3658};
3759
3860MangleModel::MangleModel(QObject* parent)
39− : QSortFilterProxyModel(parent)
61+ : QIdentityProxyModel(parent)
62+ , m_updatingCustomRows(false)
4063{
4164 setSourceModel(new QLightDM::UsersModel(this));
65+
66+ updateCustomRows();
67+
68+ // Would be nice if there were a rowCountChanged signal in the base class.
69+ // We redo all custom rows on any row count change, because (A) some of
70+ // custom rows (manual login) use row count information and (B) when
71+ // testing, we use a modelReset signal as a way to indicate that a custom
72+ // row has been toggled off or on.
73+ connect(this, &QIdentityProxyModel::modelReset,
74+ this, &MangleModel::updateCustomRows);
75+ connect(this, &QIdentityProxyModel::rowsInserted,
76+ this, &MangleModel::updateCustomRows);
77+ connect(this, &QIdentityProxyModel::rowsRemoved,
78+ this, &MangleModel::updateCustomRows);
4279}
4380
4481QVariant MangleModel::data(const QModelIndex &index, int role) const
4582{
46− QVariant variantData = QSortFilterProxyModel::data(index, role);
83+ QVariant variantData;
84+
85+ if (index.row() >= rowCount())
86+ return QVariant();
87+
88+ bool isCustomRow = index.row() >= sourceRowCount();
89+ if (isCustomRow && index.column() == 0) {
90+ int customIndex = index.row() - sourceRowCount();
91+ if (role == QLightDM::UsersModel::NameRole) {
92+ variantData = m_customRows[customIndex].name;
93+ } else if (role == QLightDM::UsersModel::RealNameRole) {
94+ variantData = m_customRows[customIndex].realName;
95+ } else if (role == QLightDM::UsersModel::LoggedInRole) {
96+ variantData = false;
97+ } else if (role == QLightDM::UsersModel::SessionRole) {
98+ variantData = Greeter::instance()->defaultSessionHint();
99+ }
100+ } else {
101+ variantData = QIdentityProxyModel::data(index, role);
102+ }
47103
48104 // If user's real name is empty, switch to unix name
49105 if (role == QLightDM::UsersModel::RealNameRole && variantData.toString().isEmpty()) {
50− variantData = QSortFilterProxyModel::data(index, QLightDM::UsersModel::NameRole);
106+ variantData = data(index, QLightDM::UsersModel::NameRole);
51107 } else if (role == QLightDM::UsersModel::BackgroundPathRole && variantData.toString().startsWith('#')) {
52108 const QString stringData = "data:image/svg+xml,<svg><rect width='100%' height='100%' fill='" + variantData.toString() + "'/></svg>";
53109 variantData = stringData;
54110 }
55111
112+ // Workaround for liblightdm returning "" when a user has no default session
113+ if (Q_UNLIKELY(role == QLightDM::UsersModel::SessionRole && variantData.toString().isEmpty())) {
114+ variantData = Greeter::instance()->defaultSessionHint();
115+ }
116+
56117 return variantData;
57118}
58119
120+void MangleModel::addCustomRow(const CustomRow &newRow)
121+{
122+ for (int i = 0; i < m_customRows.size(); i++) {
123+ if (m_customRows[i].name == newRow.name) {
124+ return; // we don't have custom rows that change content yet
125+ }
126+ }
127+
128+ beginInsertRows(QModelIndex(), rowCount(), rowCount());
129+ m_customRows << newRow;
130+ endInsertRows();
131+}
132+
133+void MangleModel::removeCustomRow(const QString &rowName)
134+{
135+ for (int i = 0; i < m_customRows.size(); i++) {
136+ if (m_customRows[i].name == rowName) {
137+ int rowNum = sourceRowCount() + i;
138+ beginRemoveRows(QModelIndex(), rowNum, rowNum);
139+ m_customRows.removeAt(i);
140+ endRemoveRows();
141+ break;
142+ }
143+ }
144+}
145+
146+void MangleModel::updateManualRow()
147+{
148+ bool hasAnotherEntry = sourceRowCount() > 0;
149+ for (int i = 0; !hasAnotherEntry && i < m_customRows.size(); i++) {
150+ if (m_customRows[i].name != QStringLiteral("*other")) {
151+ hasAnotherEntry = true;
152+ }
153+ }
154+
155+ // Show manual login if we are asked to OR if no other entry exists
156+ if (Greeter::instance()->showManualLoginHint() || !hasAnotherEntry)
157+ addCustomRow({QStringLiteral("*other"), gettext("Login")});
158+ else
159+ removeCustomRow(QStringLiteral("*other"));
160+}
161+
162+void MangleModel::updateGuestRow()
163+{
164+ if (Greeter::instance()->hasGuestAccount())
165+ addCustomRow({QStringLiteral("*guest"), gettext("Guest Session")});
166+ else
167+ removeCustomRow(QStringLiteral("*guest"));
168+}
169+
170+void MangleModel::updateCustomRows()
171+{
172+ // We update when rowCount changes, but we also insert/remove rows here.
173+ // So guard this function to avoid recursion.
174+ if (m_updatingCustomRows)
175+ return;
176+
177+ m_updatingCustomRows = true;
178+ updateGuestRow();
179+ updateManualRow();
180+ m_updatingCustomRows = false;
181+}
182+
183+int MangleModel::rowCount(const QModelIndex &parent) const
184+{
185+ if (parent.isValid())
186+ return 0;
187+ else
188+ return sourceRowCount() + m_customRows.size();
189+}
190+
191+int MangleModel::sourceRowCount() const
192+{
193+ return Greeter::instance()->hideUsersHint() ? 0 : sourceModel()->rowCount();
194+}
195+
196+QModelIndex MangleModel::index(int row, int column, const QModelIndex &parent) const
197+{
198+ if (row >= rowCount())
199+ return QModelIndex();
200+
201+ bool isCustomRow = row >= sourceRowCount();
202+ if (isCustomRow && !parent.isValid()) {
203+ return createIndex(row, column);
204+ } else {
205+ return QIdentityProxyModel::index(row, column, parent);
206+ }
207+}
208+
59209// **** Now we continue with actual UsersModel class ****
60210
61211UsersModel::UsersModel(QObject* parent)
@@ -68,4 +218,21 @@ UsersModel::UsersModel(QObject* parent)
68218 sort(0);
69219}
70220
221+bool UsersModel::lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const
222+{
223+ auto leftName = source_left.data(QLightDM::UsersModel::NameRole);
224+ auto rightName = source_right.data(QLightDM::UsersModel::NameRole);
225+
226+ if (leftName == QStringLiteral("*guest"))
227+ return false;
228+ if (rightName == QStringLiteral("*guest"))
229+ return true;
230+ if (leftName == QStringLiteral("*other"))
231+ return false;
232+ if (rightName == QStringLiteral("*other"))
233+ return true;
234+
235+ return UnitySortFilterProxyModelQML::lessThan(source_left, source_right);
236+}
237+
71238#include "UsersModel.moc"
plugins/LightDM/UsersModel.h+6−8
@@ -1,5 +1,5 @@
11/*
2− * Copyright (C) 2012,2013 Canonical, Ltd.
2+ * Copyright (C) 2012-2013,2015-2016 Canonical, Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -12,19 +12,16 @@
1212 *
1313 * You should have received a copy of the GNU General Public License
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15− *
16− * Authors: Michael Terry <michael.terry@canonical.com>
1715 */
1816
1917/* This class is a really tiny filter around QLightDM::UsersModel. There are
2018 some operations that we want to edit a bit for the benefit of Qml.
2119 Specifically, we want to sort users according to realName. */
2220
23−#ifndef UNITY_USERSMODEL_H
24−#define UNITY_USERSMODEL_H
21+#pragma once
2522
2623#include <unitysortfilterproxymodelqml.h>
27−#include <QtCore/QObject>
24+#include <QObject>
2825
2926class UsersModel : public UnitySortFilterProxyModelQML
3027{
@@ -32,6 +29,7 @@ class UsersModel : public UnitySortFilterProxyModelQML
3229
3330public:
3431 explicit UsersModel(QObject* parent=0);
35−};
3632
37−#endif
33+protected:
34+ bool lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const override;
35+};
plugins/LightDM/plugin.cpp+12−4
@@ -19,6 +19,7 @@
1919#include "DBusGreeter.h"
2020#include "DBusGreeterList.h"
2121#include "Greeter.h"
22+#include "PromptsModel.h"
2223#include "SessionsModel.h"
2324#include "UsersModel.h"
2425#include <libusermetricsoutput/ColorTheme.h>
@@ -32,16 +33,24 @@
3233
3334static QObject *greeter_provider(QQmlEngine *engine, QJSEngine *scriptEngine)
3435{
35− Q_UNUSED(engine)
3636 Q_UNUSED(scriptEngine)
3737
38− Greeter *greeter = new Greeter();
38+ Greeter *greeter = Greeter::instance();
3939 new DBusGreeter(greeter, QStringLiteral("/"));
4040 new DBusGreeterList(greeter, QStringLiteral("/list"));
4141
42+ engine->setObjectOwnership(greeter, QQmlEngine::CppOwnership);
43+
4244 return greeter;
4345}
4446
47+static QObject *prompts_provider(QQmlEngine *engine, QJSEngine *)
48+{
49+ auto model = Greeter::instance()->promptsModel();
50+ engine->setObjectOwnership(model, QQmlEngine::CppOwnership);
51+ return model;
52+}
53+
4554static QObject *sessions_provider(QQmlEngine *engine, QJSEngine *scriptEngine)
4655{
4756 Q_UNUSED(engine)
@@ -78,8 +87,7 @@ void PLUGIN_CLASSNAME::registerTypes(const char *uri)
7887 #error No library defined in LightDM plugin
7988#endif
8089
81− qRegisterMetaType<QLightDM::Greeter::MessageType>("QLightDM::Greeter::MessageType");
82− qRegisterMetaType<QLightDM::Greeter::PromptType>("QLightDM::Greeter::PromptType");
90+ qmlRegisterSingletonType<PromptsModel>(uri, 0, 1, "Prompts", prompts_provider);
8391
8492 qmlRegisterSingletonType<SessionsModel>(uri, 0, 1, "Sessions", sessions_provider);
8593 qmlRegisterUncreatableType<QLightDM::SessionsModel>(uri, 0, 1, "SessionRoles", QStringLiteral("Type is not instantiable"));
plugins/Lights/CMakeLists.txt+8−2
@@ -1,5 +1,6 @@
11pkg_check_modules(ANDROID_HEADERS REQUIRED android-headers)
22pkg_check_modules(ANDROID_HARDWARE REQUIRED libhardware)
3+pkg_check_modules(ANDROID_PROPERTIES REQUIRED libandroid-properties)
34
45include_directories(
56 SYSTEM
@@ -9,9 +10,14 @@ include_directories(
910add_library(Lights-qml MODULE
1011 plugin.cpp
1112 Lights.cpp
13+ LegacyLights.cpp
14+ HfdLights.cpp
1215 )
1316
14−qt5_use_modules(Lights-qml Qml Gui)
15−target_link_libraries(Lights-qml ${ANDROID_HARDWARE_LIBRARIES})
17+target_link_libraries(Lights-qml
18+ Qt5::Qml Qt5::Gui Qt5::DBus
19+ ${ANDROID_HARDWARE_LIBRARIES}
20+ ${ANDROID_PROPERTIES_LIBRARIES}
21+ )
1622
1723add_unity8_plugin(Lights 0.1 Lights TARGETS Lights-qml)
plugins/Lights/HfdLights.cppnew file+62
@@ -0,0 +1,62 @@
1+/*
2+ * Copyright (C) 2021 UBports Foundation.
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+ * Author: Florian Leeber <florian@ubports.com>
17+ */
18+
19+#include "HfdLights.h"
20+#include <QtCore/QDebug>
21+#include <QDBusArgument>
22+#include <QDBusConnection>
23+#include <iostream>
24+
25+#define HFD_SERVICE_NAME "com.lomiri.hfd"
26+#define HFD_SERVICE_PATH "/com/lomiri/hfd"
27+#define HFD_SERVICE_INTERFACE "com.lomiri.hfd.Leds"
28+
29+HfdLights::HfdLights(QObject* parent)
30+ : Lights(parent)
31+{
32+ m_hfdInterface = new QDBusInterface(
33+ QStringLiteral(HFD_SERVICE_NAME),
34+ QStringLiteral(HFD_SERVICE_PATH),
35+ QStringLiteral(HFD_SERVICE_INTERFACE),
36+ QDBusConnection::systemBus(),
37+ this
38+ );
39+}
40+
41+bool HfdLights::init()
42+{
43+ // hfd does not need any initalization to be used
44+ return true;
45+}
46+
47+void HfdLights::turnOn()
48+{
49+ m_hfdInterface->call(QStringLiteral("setState"), 0);
50+ m_hfdInterface->call(QStringLiteral("setColor"), (quint32)m_color.rgba());
51+ m_hfdInterface->call(QStringLiteral("setOnMs"), m_onMs);
52+ m_hfdInterface->call(QStringLiteral("setOffMs"), m_offMs);
53+ m_hfdInterface->call(QStringLiteral("setState"), 1);
54+}
55+
56+void HfdLights::turnOff()
57+{
58+ m_hfdInterface->call(QStringLiteral("setState"), 0);
59+ m_hfdInterface->call(QStringLiteral("setColor"), (quint32)0);
60+ m_hfdInterface->call(QStringLiteral("setOnMs"), 0);
61+ m_hfdInterface->call(QStringLiteral("setOffMs"), 0);
62+}
plugins/Unity/DashCommunicator/plugin.h → plugins/Lights/HfdLights.hrenamed+17−9
@@ -1,5 +1,5 @@
11/*
2− * Copyright (C) 2014 Canonical, Ltd.
2+ * Copyright (C) 2021 UBports Foundation.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -13,22 +13,30 @@
1313 * You should have received a copy of the GNU General Public License
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 *
16− * Authors: Michael Zanetti <michael.zanetti@canonical.com>
16+ * Author: Florian Leeber <florian@ubports.com>
1717 */
1818
19−#ifndef DASHCOMMUNICATOR_PLUGIN_H
20−#define DASHCOMMUNICATOR_PLUGIN_H
19+#ifndef UNITY_HFDLIGHTS_H
20+#define UNITY_HFDLIGHTS_H
2121
22−#include <QtQml/QQmlEngine>
23−#include <QtQml/QQmlExtensionPlugin>
22+#include <QtCore/QObject>
23+#include <QDBusInterface>
24+#include "Lights.h"
2425
25−class DashCommunicatorPlugin : public QQmlExtensionPlugin
26+class HfdLights: public Lights
2627{
2728 Q_OBJECT
28− Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
2929
3030public:
31− void registerTypes(const char *uri) override;
31+ explicit HfdLights(QObject *parent = 0);
32+
33+protected:
34+ bool init() override;
35+ void turnOff() override;
36+ void turnOn() override;
37+
38+private:
39+ QDBusInterface* m_hfdInterface;
3240};
3341
3442#endif
plugins/Lights/LegacyLights.cppnew file+91
@@ -0,0 +1,91 @@
1+/*
2+ * Copyright (C) 2014 Canonical, Ltd.
3+ * Copyright (C) 2021 UBports Foundation.
4+ *
5+ * This program is free software; you can redistribute it and/or modify
6+ * it under the terms of the GNU General Public License as published by
7+ * the Free Software Foundation; version 3.
8+ *
9+ * This program is distributed in the hope that it will be useful,
10+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
11+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+ * GNU General Public License for more details.
13+ *
14+ * You should have received a copy of the GNU General Public License
15+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
16+ *
17+ * Author: Renato Araujo Oliveira Filho <renato.filho@canonical.com>
18+ */
19+
20+#include "LegacyLights.h"
21+#include <QtCore/QDebug>
22+
23+extern "C" {
24+#include "android-hardware.h"
25+#include <string.h>
26+}
27+
28+LegacyLights::~LegacyLights()
29+{
30+ if (m_lightDevice) {
31+ hw_device_t* device = (hw_device_t*) m_lightDevice;
32+ device->close(device);
33+ }
34+}
35+
36+bool LegacyLights::init()
37+{
38+ if (m_lightDevice) {
39+ return true;
40+ }
41+
42+ int err;
43+ hw_module_t* module;
44+
45+ err = hw_get_module(LIGHTS_HARDWARE_MODULE_ID, (hw_module_t const**)&module);
46+ if (err == 0) {
47+ hw_device_t* device;
48+ err = module->methods->open(module, LIGHT_ID_NOTIFICATIONS, &device);
49+ if (err == 0) {
50+ m_lightDevice = (light_device_t*)device;
51+ turnOff();
52+ return true;
53+ } else {
54+ qWarning() << "Failed to access notification lights";
55+ }
56+ } else {
57+ qWarning() << "Failed to initialize lights hardware.";
58+ }
59+ return false;
60+}
61+
62+void LegacyLights::turnOn()
63+{
64+ // pulse
65+ light_state_t state;
66+ memset(&state, 0, sizeof(light_state_t));
67+ state.color = m_color.rgba();
68+ state.flashMode = LIGHT_FLASH_TIMED;
69+ state.flashOnMS = m_onMs;
70+ state.flashOffMS = m_offMs;
71+ state.brightnessMode = BRIGHTNESS_MODE_USER;
72+
73+ if (m_lightDevice->set_light(m_lightDevice, &state) != 0) {
74+ qWarning() << "Failed to turn the light off";
75+ }
76+}
77+
78+void LegacyLights::turnOff()
79+{
80+ light_state_t state;
81+ memset(&state, 0, sizeof(light_state_t));
82+ state.color = 0x00000000;
83+ state.flashMode = LIGHT_FLASH_NONE;
84+ state.flashOnMS = 0;
85+ state.flashOffMS = 0;
86+ state.brightnessMode = 0;
87+
88+ if (m_lightDevice->set_light(m_lightDevice, &state) != 0) {
89+ qWarning() << "Failed to turn the light off";
90+ }
91+}
tests/mocks/Unity/DashCommunicator/plugin.h → plugins/Lights/LegacyLights.hrenamed+19−8
@@ -1,5 +1,6 @@
11/*
22 * Copyright (C) 2014 Canonical, Ltd.
3+ * Copyright (C) 2021 UBports Foundation.
34 *
45 * This program is free software; you can redistribute it and/or modify
56 * it under the terms of the GNU General Public License as published by
@@ -13,22 +14,32 @@
1314 * You should have received a copy of the GNU General Public License
1415 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1516 *
16− * Authors: Michael Zanetti <michael.zanetti@canonical.com>
17+ * Author: Renato Araujo Oliveira Filho <renato.filho@canonical.com>
1718 */
1819
19−#ifndef DASHCOMMUNICATOR_PLUGIN_H
20−#define DASHCOMMUNICATOR_PLUGIN_H
20+#ifndef UNITY_LEGACYLIGHTS_H
21+#define UNITY_LEGACYLIGHTS_H
2122
22−#include <QtQml/QQmlEngine>
23−#include <QtQml/QQmlExtensionPlugin>
23+#include <QtCore/QObject>
24+#include "Lights.h"
2425
25−class DashCommunicatorPlugin : public QQmlExtensionPlugin
26+struct light_device_t;
27+
28+class LegacyLights: public Lights
2629{
2730 Q_OBJECT
28− Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
2931
3032public:
31− void registerTypes(const char *uri) override;
33+ ~LegacyLights();
34+
35+protected:
36+ bool init() override;
37+ void turnOff() override;
38+ void turnOn() override;
39+
40+private:
41+ light_device_t* m_lightDevice;
42+
3243};
3344
3445#endif
plugins/Lights/Lights.cpp−65
@@ -26,20 +26,12 @@ extern "C" {
2626
2727Lights::Lights(QObject* parent)
2828 : QObject(parent),
29− m_lightDevice(0),
3029 m_color("blue"),
3130 m_state(Lights::Off),
3231 m_onMs(1000),
3332 m_offMs(3000)
3433{
35−}
3634
37−Lights::~Lights()
38−{
39− if (m_lightDevice) {
40− hw_device_t* device = (hw_device_t*) m_lightDevice;
41− device->close(device);
42− }
4335}
4436
4537void Lights::setState(Lights::State newState)
@@ -107,60 +99,3 @@ void Lights::setOffMillisec(int offMs)
10799 // FIXME: update the property if the light is already on
108100 }
109101}
110−
111−bool Lights::init()
112−{
113− if (m_lightDevice) {
114− return true;
115− }
116−
117− int err;
118− hw_module_t* module;
119−
120− err = hw_get_module(LIGHTS_HARDWARE_MODULE_ID, (hw_module_t const**)&module);
121− if (err == 0) {
122− hw_device_t* device;
123− err = module->methods->open(module, LIGHT_ID_NOTIFICATIONS, &device);
124− if (err == 0) {
125− m_lightDevice = (light_device_t*)device;
126− turnOff();
127− return true;
128− } else {
129− qWarning() << "Failed to access notification lights";
130− }
131− } else {
132− qWarning() << "Failed to initialize lights hardware.";
133− }
134− return false;
135−}
136−
137−void Lights::turnOn()
138−{
139− // pulse
140− light_state_t state;
141− memset(&state, 0, sizeof(light_state_t));
142− state.color = m_color.rgba();
143− state.flashMode = LIGHT_FLASH_TIMED;
144− state.flashOnMS = m_onMs;
145− state.flashOffMS = m_offMs;
146− state.brightnessMode = BRIGHTNESS_MODE_USER;
147−
148− if (m_lightDevice->set_light(m_lightDevice, &state) != 0) {
149− qWarning() << "Failed to turn the light off";
150− }
151−}
152−
153−void Lights::turnOff()
154−{
155− light_state_t state;
156− memset(&state, 0, sizeof(light_state_t));
157− state.color = 0x00000000;
158− state.flashMode = LIGHT_FLASH_NONE;
159− state.flashOnMS = 0;
160− state.flashOffMS = 0;
161− state.brightnessMode = 0;
162−
163− if (m_lightDevice->set_light(m_lightDevice, &state) != 0) {
164− qWarning() << "Failed to turn the light off";
165− }
166−}
plugins/Lights/Lights.h+5−9
@@ -22,12 +22,9 @@
2222#include <QtCore/QObject>
2323#include <QtGui/QColor>
2424
25−struct light_device_t;
26−
2725class Lights: public QObject
2826{
2927 Q_OBJECT
30− Q_ENUMS(State)
3128 Q_PROPERTY(State state READ state WRITE setState NOTIFY stateChanged)
3229 Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
3330 Q_PROPERTY(int onMillisec READ onMillisec WRITE setOnMillisec NOTIFY onMillisecChanged)
@@ -38,9 +35,9 @@ public:
3835 Off,
3936 On,
4037 };
38+ Q_ENUM(State)
4139
4240 explicit Lights(QObject *parent = 0);
43− ~Lights();
4441
4542 void setState(State newState);
4643 State state() const;
@@ -60,16 +57,15 @@ Q_SIGNALS:
6057 void onMillisecChanged(int onMs);
6158 void offMillisecChanged(int offMs);
6259
63−private:
64− light_device_t* m_lightDevice;
60+protected:
6561 QColor m_color;
6662 State m_state;
6763 int m_onMs;
6864 int m_offMs;
6965
70− bool init();
71− void turnOff();
72− void turnOn();
66+ virtual bool init() = 0;
67+ virtual void turnOff() = 0;
68+ virtual void turnOn() = 0;
7369};
7470
7571#endif
plugins/Lights/plugin.cpp+20−1
@@ -18,6 +18,11 @@
1818
1919#include "plugin.h"
2020#include "Lights.h"
21+#include "HfdLights.h"
22+#include "LegacyLights.h"
23+
24+// libandroid-properties
25+#include <hybris/properties/properties.h>
2126
2227#include <QtQml/qqml.h>
2328
@@ -25,7 +30,21 @@ static QObject *lights_provider(QQmlEngine *engine, QJSEngine *scriptEngine)
2530{
2631 Q_UNUSED(engine)
2732 Q_UNUSED(scriptEngine)
28− return new Lights();
33+
34+ bool use_hfd = false;
35+ char buffer[PROP_VALUE_MAX];
36+ auto result = property_get("ro.build.version.sdk", buffer, "0");
37+ if (result) {
38+ auto sdkVersion = QString(buffer).toInt();
39+ if (sdkVersion >= 27 || sdkVersion == 0) {
40+ use_hfd = true;
41+ }
42+ }
43+ if (use_hfd) {
44+ return new HfdLights();
45+ } else {
46+ return new LegacyLights();
47+ }
2948}
3049
3150void LightsPlugin::registerTypes(const char *uri)
plugins/Powerd/CMakeLists.txt+4−2
@@ -9,7 +9,9 @@ add_library(Powerd-qml MODULE
99 Powerd.cpp
1010 )
1111
12−qt5_use_modules(Powerd-qml DBus Qml)
13−target_link_libraries(Powerd-qml ${GIO_LDFLAGS})
12+target_link_libraries(Powerd-qml
13+ Qt5::DBus Qt5::Qml
14+ ${GIO_LDFLAGS}
15+ )
1416
1517add_unity8_plugin(Powerd 0.1 Powerd TARGETS Powerd-qml)
plugins/Powerd/Powerd.h+2−2
@@ -27,8 +27,6 @@
2727class Powerd: public QObject
2828{
2929 Q_OBJECT
30− Q_ENUMS(Status)
31− Q_ENUMS(DisplayStateChangeReason)
3230 Q_PROPERTY(Status status READ status NOTIFY statusChanged)
3331
3432public:
@@ -41,11 +39,13 @@ public:
4139 SnapDecision = 5, // Display changed state due to snap decision prompt
4240 CallDone = 6, // Display changed state due to voice call end
4341 };
42+ Q_ENUM(DisplayStateChangeReason)
4443
4544 enum Status {
4645 Off,
4746 On,
4847 };
48+ Q_ENUM(Status)
4949
5050 explicit Powerd(QObject *parent = 0);
5151 ~Powerd();
plugins/ScreenshotDirectory/CMakeLists.txt+1−1
@@ -4,6 +4,6 @@ set(PLUGIN_SOURCES
44)
55
66add_library(ScreenshotDirectory-qml MODULE ${PLUGIN_SOURCES})
7−qt5_use_modules(ScreenshotDirectory-qml Qml Gui Quick)
7+target_link_libraries(ScreenshotDirectory-qml Qt5::Qml Qt5::Gui Qt5::Quick)
88
99add_unity8_plugin(ScreenshotDirectory 0.1 ScreenshotDirectory TARGETS ScreenshotDirectory-qml)
plugins/SessionBroadcast/CMakeLists.txt+1−2
@@ -6,9 +6,8 @@ add_library(SessionBroadcast-qml MODULE
66 plugin.cpp
77 )
88
9−qt5_use_modules(SessionBroadcast-qml DBus Qml)
10−
119target_link_libraries(SessionBroadcast-qml
10+ Qt5::DBus Qt5::Qml
1211 ${GLIB_LIBRARIES}
1312 )
1413
plugins/UInput/CMakeLists.txt+1−1
@@ -3,5 +3,5 @@ add_library(UInput-qml MODULE
33 uinput.cpp
44)
55
6−qt5_use_modules(UInput-qml Qml)
6+target_link_libraries(UInput-qml Qt5::Qml)
77add_unity8_plugin(UInput 0.1 UInput TARGETS UInput-qml)
plugins/UInput/uinput.h+1−1
@@ -27,7 +27,6 @@
2727class UInput : public QObject
2828{
2929 Q_OBJECT
30− Q_ENUMS(Button)
3130
3231public:
3332 enum Button {
@@ -35,6 +34,7 @@ public:
3534 ButtonRight,
3635 ButtonMiddle
3736 };
37+ Q_ENUM(Button)
3838
3939 explicit UInput(QObject *parent = nullptr);
4040 ~UInput();
plugins/Ubuntu/CMakeLists.txt−2
@@ -1,4 +1,2 @@
11add_subdirectory(Gestures)
22add_subdirectory(DownloadDaemonListener)
3−#add_subdirectory(Payments)
4−add_subdirectory(SystemImage)
plugins/Ubuntu/DownloadDaemonListener/CMakeLists.txt+4−2
@@ -11,8 +11,10 @@ set(DOWNLOADDAEMONLISTENER_SOURCES
1111
1212add_library(DownloadDaemonListener MODULE ${DOWNLOADDAEMONLISTENER_SOURCES})
1313
14−qt5_use_modules(DownloadDaemonListener Qml Quick DBus Core)
1514pkg_check_modules(DDLADAPTER REQUIRED udm-common)
1615add_definitions(${DDLADAPTER_CFLAGS} ${DDLADAPTER_CFLAGS_OTHER})
17−target_link_libraries(DownloadDaemonListener ${DDLADAPTER_LIBRARIES})
16+target_link_libraries(DownloadDaemonListener
17+ Qt5::Qml Qt5::Quick Qt5::DBus Qt5::Core
18+ ${DDLADAPTER_LIBRARIES}
19+ )
1820add_unity8_plugin(Ubuntu.DownloadDaemonListener 0.1 Ubuntu/DownloadDaemonListener TARGETS DownloadDaemonListener)
plugins/Ubuntu/Gestures/CMakeLists.txt+2−4
@@ -16,10 +16,8 @@ pkg_check_modules(UBUNTUGESTURES REQUIRED UbuntuGestures)
1616
1717add_definitions(-DUBUNTUGESTURESQML_LIBRARY)
1818
19−add_library(UbuntuGesturesQml MODULE ${UbuntuGesturesQml_SOURCES})
20−target_link_libraries(UbuntuGesturesQml ${UBUNTUGESTURES_LIBRARIES})
21−
22−qt5_use_modules(UbuntuGesturesQml Core Quick)
19+add_library(UbuntuGesturesQml SHARED ${UbuntuGesturesQml_SOURCES})
20+target_link_libraries(UbuntuGesturesQml ${UBUNTUGESTURES_LIBRARIES} Qt5::Core Qt5::Quick)
2321
2422# So that Foo.cpp can #include "Foo.moc"
2523include_directories(${CMAKE_CURRENT_BINARY_DIR})
plugins/Ubuntu/Gestures/Direction.h+1−1
@@ -26,7 +26,6 @@
2626 */
2727class UBUNTUGESTURESQML_EXPORT Direction : public QObject {
2828 Q_OBJECT
29− Q_ENUMS(Type)
3029
3130public:
3231 // Make sure it is kept synchronized with SDK UCSwipeArea::Direction
@@ -38,6 +37,7 @@ public:
3837 Horizontal, // Along the X axis, in any direction
3938 Vertical // Along the Y axis, in any direction
4039 };
40+ Q_ENUM(Type)
4141
4242 Q_INVOKABLE static bool isHorizontal(Direction::Type type);
4343 Q_INVOKABLE static bool isVertical(Direction::Type type);
plugins/Ubuntu/Gestures/TouchGestureArea.cpp+6−5
@@ -328,6 +328,12 @@ void TouchGestureArea::touchEvent_rejected(QTouchEvent *event)
328328 }
329329 }
330330 }
331+
332+ // If this event is a new touch, ignore it and let the item below have it.
333+ // We won't recognize any new touch until the whole current gesture is done
334+ // i.e. we're in WaitingForTouch state.
335+ // And even if it isn't, just ignore it anyway; we don't care about it.
336+ event->ignore();
331337}
332338
333339void TouchGestureArea::unownedTouchEvent(QTouchEvent *unownedTouchEvent)
@@ -735,7 +741,6 @@ void TouchGestureArea::resyncCachedTouchPoints()
735741 bool added = false;
736742 bool ended = false;
737743 bool moved = false;
738− bool wantsDrag = false;
739744
740745 // list of deletes
741746 QMutableHashIterator<int, GestureTouchPoint*> removeIter(m_cachedTouchPoints);
@@ -765,10 +770,6 @@ void TouchGestureArea::resyncCachedTouchPoints()
765770 }
766771 }
767772
768− if (wantsDrag && !dragging()) {
769− setDragging(true);
770− }
771−
772773 if (ended) {
773774 if (m_cachedTouchPoints.isEmpty()) {
774775 if (!dragging()) Q_EMIT clicked();
plugins/Ubuntu/Gestures/TouchGestureArea.h+1−1
@@ -114,7 +114,6 @@ private:
114114class UBUNTUGESTURESQML_EXPORT TouchGestureArea : public QQuickItem
115115{
116116 Q_OBJECT
117− Q_ENUMS(Status)
118117
119118 Q_PROPERTY(int status READ status NOTIFY statusChanged)
120119 Q_PROPERTY(bool dragging READ dragging NOTIFY draggingChanged)
@@ -137,6 +136,7 @@ public:
137136 Recognized,
138137 Rejected
139138 };
139+ Q_ENUM(Status)
140140 TouchGestureArea(QQuickItem* parent = nullptr);
141141 ~TouchGestureArea();
142142
plugins/Ubuntu/Payments/CMakeLists.txtdeleted−20
@@ -1,20 +0,0 @@
1−include_directories(
2− ${CMAKE_CURRENT_SOURCE_DIR}
3− ${CMAKE_CURRENT_BINARY_DIR}
4−)
5−
6−set(PAYMENTS_SOURCES
7− plugin.cpp
8− Payments.cpp
9−)
10−
11−add_library(Payments MODULE ${PAYMENTS_SOURCES})
12−
13−qt5_use_modules(Payments Qml Quick DBus Core)
14−
15−add_unity8_plugin(Ubuntu.Payments 0.1 Ubuntu/Payments TARGETS Payments)
16−
17−pkg_check_modules(LIBPAY REQUIRED pay-2)
18−add_definitions(${LIBPAY_CFLAGS} ${LIBPAY_CFLAGS_OTHER})
19−
20−target_link_libraries(Payments ${LIBPAY_LDFLAGS})
plugins/Ubuntu/Payments/Payments.cppdeleted−136
@@ -1,136 +0,0 @@
1−/*
2− * Copyright (C) 2014 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 "Payments.h"
18−
19−#include <QLocale>
20−
21−#include <libpay/pay-package.h>
22−
23−
24−// The observer callback for the package we are watching.
25−static void observer(PayPackage* /* package */, const char* itemid, PayPackageItemStatus status, void* user_data) {
26− // This function is called in libpay's thread, so be careful what you call
27− // Emitting signals should be fine as long as they use Queued or Auto
28− // connections (the default)
29− // http://qt-project.org/doc/qt-5/threads-qobject.html#signals-and-slots-across-threads
30−
31− Payments *self = static_cast<Payments*>(user_data);
32−
33− // If the item ID is different, ignore it.
34− if (itemid != self->storeItemId()) {
35− return;
36− }
37−
38− // FIXME: No error reporting from libpay, but we need to show some
39− // types of errors to the user. https://launchpad.net/bugs/1333403
40− switch (status) {
41− case PAY_PACKAGE_ITEM_STATUS_PURCHASED:
42− Q_EMIT self->purchaseCompleted();
43− break;
44− case PAY_PACKAGE_ITEM_STATUS_PURCHASING:
45− self->setPurchasing(true);
46− break;
47− case PAY_PACKAGE_ITEM_STATUS_NOT_PURCHASED:
48− if (self->purchasing()) {
49− self->setPurchasing(false);
50− Q_EMIT self->purchaseCancelled();
51− }
52− break;
53− default:
54− break;
55− }
56−}
57−
58−Payments::Payments(QObject *parent)
59− : QObject(parent),
60− m_purchasing(false)
61−{
62− m_package = pay_package_new("click-scope");
63− pay_package_item_observer_install(m_package, observer, this);
64−}
65−
66−Payments::~Payments()
67−{
68− pay_package_item_observer_uninstall(m_package, observer, this);
69− pay_package_delete(m_package);
70−}
71−
72−QString Payments::currency() const
73−{
74− return m_currency;
75−}
76−
77−double Payments::price() const
78−{
79− return m_price;
80−}
81−
82−QString Payments::storeItemId() const
83−{
84− return m_store_item_id;
85−}
86−
87−QString Payments::formattedPrice() const
88−{
89− QLocale locale;
90− return locale.toCurrencyString(m_price, m_currency);
91−}
92−
93−bool Payments::purchasing() const
94−{
95− return m_purchasing;
96−}
97−
98−void Payments::setCurrency(const QString &currency)
99−{
100− if(m_currency != currency) {
101− m_currency = currency;
102− Q_EMIT currencyChanged(currency);
103− Q_EMIT formattedPriceChanged(formattedPrice());
104− }
105−}
106−
107−void Payments::setPrice(const double price)
108−{
109− if(m_price != price) {
110− m_price = price;
111− Q_EMIT priceChanged(price);
112− Q_EMIT formattedPriceChanged(formattedPrice());
113− }
114−}
115−
116−void Payments::setStoreItemId(const QString &store_item_id)
117−{
118− if (m_store_item_id != store_item_id) {
119− m_store_item_id = store_item_id;
120− Q_EMIT storeItemIdChanged(m_store_item_id);
121− }
122−
123− if (m_store_item_id.isEmpty()) {
124− return;
125− }
126−}
127−
128−void Payments::setPurchasing(bool is_purchasing)
129−{
130− m_purchasing = is_purchasing;
131−}
132−
133−void Payments::start()
134−{
135− pay_package_item_start_purchase(m_package, m_store_item_id.toLocal8Bit().data());
136−}
plugins/Ubuntu/Payments/Payments.hdeleted−69
@@ -1,69 +0,0 @@
1−/*
2− * Copyright (C) 2014 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 PAYMENTS_H
18−#define PAYMENTS_H
19−
20−#include <QObject>
21−
22−#include <libpay/pay-package.h>
23−
24−
25−class Payments : public QObject
26−{
27− Q_OBJECT
28− Q_DISABLE_COPY(Payments)
29− Q_PROPERTY(QString currency READ currency WRITE setCurrency NOTIFY currencyChanged)
30− Q_PROPERTY(double price READ price WRITE setPrice NOTIFY priceChanged)
31− Q_PROPERTY(QString storeItemId READ storeItemId WRITE setStoreItemId NOTIFY storeItemIdChanged)
32− Q_PROPERTY(QString formattedPrice READ formattedPrice NOTIFY formattedPriceChanged)
33−
34−public:
35− explicit Payments(QObject *parent = 0);
36− virtual ~Payments();
37−
38− QString currency() const;
39− double price() const;
40− QString storeItemId() const;
41− QString formattedPrice() const;
42− bool purchasing() const;
43−
44− void setCurrency(const QString& currency);
45− void setPrice(const double price);
46− void setStoreItemId(const QString& store_item_id);
47− void setPurchasing(bool is_purchasing);
48− Q_INVOKABLE void start();
49−
50−Q_SIGNALS:
51− void currencyChanged(const QString& currency);
52− void priceChanged(const double price);
53− void storeItemIdChanged(const QString &store_item_id);
54− void formattedPriceChanged(const QString &formatted_price);
55−
56− void purchaseError(const QString &error);
57− void purchaseCompleted();
58− void purchaseCancelled();
59−
60−private:
61− QString m_currency;
62− double m_price;
63− QString m_store_item_id;
64− bool m_purchasing;
65−
66− PayPackage *m_package;
67−};
68−
69−#endif // PAYMENTS_H
plugins/Ubuntu/Payments/qmldirdeleted−3
@@ -1,3 +0,0 @@
1−module Ubuntu.Payments
2−plugin Payments
3−typeinfo Payments.qmltypes
plugins/Ubuntu/SystemImage/CMakeLists.txtdeleted−15
@@ -1,15 +0,0 @@
1−include_directories(
2− ${GLIB_INCLUDE_DIRS}
3−)
4−
5−set(SYSTEMIMAGE_SOURCES
6− plugin.cpp
7− SystemImage.cpp
8−)
9−
10−add_library(SystemImage MODULE ${SYSTEMIMAGE_SOURCES})
11−
12−qt5_use_modules(SystemImage Qml DBus Core)
13−target_link_libraries(SystemImage ${GLIB_LIBRARIES})
14−
15−add_unity8_plugin(Ubuntu.SystemImage 0.1 Ubuntu/SystemImage TARGETS SystemImage)
plugins/Ubuntu/SystemImage/SystemImage.cppdeleted−155
@@ -1,155 +0,0 @@
1−/*
2− * Copyright (C) 2014-2016 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 <QDBusConnection>
18−#include <QDBusPendingCall>
19−#include <QDBusReply>
20−#include <QDebug>
21−
22−#include <glib.h>
23−
24−#include "SystemImage.h"
25−
26−#define SYSTEMIMAGE_SERVICE QStringLiteral("com.canonical.SystemImage")
27−#define SYSTEMIMAGE_PATH QStringLiteral("/Service")
28−#define SYSTEMIMAGE_IFACE QStringLiteral("com.canonical.SystemImage")
29−
30−Q_LOGGING_CATEGORY(SYSTEMIMAGEPLUGIN, "unity8.systemimage", QtWarningMsg)
31−
32−#define DEBUG_MSG qCDebug(SYSTEMIMAGEPLUGIN).nospace().noquote() << Q_FUNC_INFO
33−#define WARNING_MSG qCWarning(SYSTEMIMAGEPLUGIN).nospace().noquote() << Q_FUNC_INFO
34−
35−SystemImage::SystemImage(QObject *parent)
36− : QObject(parent)
37−{
38− QDBusConnection::systemBus().connect(SYSTEMIMAGE_SERVICE, SYSTEMIMAGE_PATH, SYSTEMIMAGE_IFACE, QStringLiteral("UpdateAvailableStatus"),
39− this, SLOT(onUpdateAvailableStatus(bool,bool,QString,int,QString,QString)));
40− QDBusConnection::systemBus().connect(SYSTEMIMAGE_SERVICE, SYSTEMIMAGE_PATH, SYSTEMIMAGE_IFACE, QStringLiteral("UpdateDownloaded"),
41− this, SLOT(onUpdateDownloaded()));
42− QDBusConnection::systemBus().connect(SYSTEMIMAGE_SERVICE, SYSTEMIMAGE_PATH, SYSTEMIMAGE_IFACE, QStringLiteral("UpdateFailed"),
43− this, SLOT(onUpdateFailed(int,QString)));
44− QDBusConnection::systemBus().connect(SYSTEMIMAGE_SERVICE, SYSTEMIMAGE_PATH, SYSTEMIMAGE_IFACE, QStringLiteral("Applied"),
45− this, SLOT(onUpdateApplied(bool)));
46− QDBusConnection::systemBus().connect(SYSTEMIMAGE_SERVICE, SYSTEMIMAGE_PATH, SYSTEMIMAGE_IFACE, QStringLiteral("Rebooting"),
47− this, SLOT(onRebooting(bool)));
48−}
49−
50−void SystemImage::checkForUpdate()
51−{
52− DEBUG_MSG << "Checking for update";
53− const QDBusMessage msg = QDBusMessage::createMethodCall(SYSTEMIMAGE_SERVICE, SYSTEMIMAGE_PATH, SYSTEMIMAGE_IFACE,
54− QStringLiteral("CheckForUpdate"));
55− QDBusConnection::systemBus().asyncCall(msg);
56−}
57−
58−void SystemImage::applyUpdate()
59−{
60− DEBUG_MSG << "Applying update";
61− setUpdateApplying(true);
62−
63− const QDBusMessage msg = QDBusMessage::createMethodCall(SYSTEMIMAGE_SERVICE, SYSTEMIMAGE_PATH, SYSTEMIMAGE_IFACE,
64− QStringLiteral("ApplyUpdate"));
65− QDBusConnection::systemBus().asyncCall(msg);
66−}
67−
68−void SystemImage::factoryReset()
69−{
70− const QDBusMessage msg = QDBusMessage::createMethodCall(SYSTEMIMAGE_SERVICE, SYSTEMIMAGE_PATH, SYSTEMIMAGE_IFACE,
71− QStringLiteral("FactoryReset"));
72− QDBusConnection::systemBus().asyncCall(msg);
73−}
74−
75−void SystemImage::onUpdateAvailableStatus(bool is_available, bool downloading, const QString &available_version, int update_size,
76− const QString &last_update_date, const QString &error_reason)
77−{
78− DEBUG_MSG << "A new update is " << (is_available ? "" : "NOT") << "available";
79−
80− if (is_available == m_updateAvailable) {
81− return;
82− }
83−
84− m_updateAvailable = is_available;
85− m_downloading = downloading;
86− m_availableVersion = available_version;
87− m_updateSize = formatSize(update_size);
88− m_lastUpdateDate = last_update_date;
89− m_errorReason = error_reason;
90− Q_EMIT updateAvailableStatus();
91−
92− DEBUG_MSG << "Downloading: " << downloading << ", version: " << available_version << ", last update: " << last_update_date <<
93− ", size: " << m_updateSize;
94−}
95−
96−void SystemImage::onUpdateDownloaded()
97−{
98− DEBUG_MSG << "Update downloaded";
99−
100− m_downloaded = true;
101− Q_EMIT updateDownloadedChanged();
102−}
103−
104−void SystemImage::onUpdateFailed(int /*consecutive_failure_count*/, const QString &last_reason)
105−{
106− WARNING_MSG << "System Update failed: " << last_reason;
107− setUpdateApplying(false);
108−}
109−
110−void SystemImage::onUpdateApplied(bool applied)
111−{
112− DEBUG_MSG << "System Update applied with status: " << applied;
113− setUpdateApplying(false);
114− if (applied) {
115− resetUpdateStatus();
116− Q_EMIT updateAvailableStatus();
117− }
118−}
119−
120−void SystemImage::onRebooting(bool status)
121−{
122− setUpdateApplying(false);
123− DEBUG_MSG << "Rebooting: " << status;
124−}
125−
126−void SystemImage::setUpdateApplying(bool status)
127−{
128− if (status != m_updateApplying) {
129− m_updateApplying = status;
130− Q_EMIT updateApplyingChanged();
131− }
132−}
133−
134−void SystemImage::resetUpdateStatus()
135−{
136− m_updateAvailable = false;
137− m_updateApplying = false;
138− m_downloading = false;
139− m_downloaded = false;
140− m_availableVersion.clear();
141− m_updateSize.clear();
142− m_lastUpdateDate.clear();
143− m_errorReason.clear();
144−}
145−
146−QString SystemImage::formatSize(quint64 size) const
147−{
148− guint64 g_size = size;
149−
150− gchar * formatted_size = g_format_size(g_size);
151− QString q_formatted_size = QString::fromLocal8Bit(formatted_size);
152− g_free(formatted_size);
153−
154− return q_formatted_size;
155−}
plugins/Ubuntu/SystemImage/SystemImage.hdeleted−84
@@ -1,84 +0,0 @@
1−/*
2− * Copyright (C) 2014-2016 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 SYSTEMIMAGE_H
18−#define SYSTEMIMAGE_H
19−
20−#include <QObject>
21−#include <QLoggingCategory>
22−
23−Q_DECLARE_LOGGING_CATEGORY(SYSTEMIMAGEPLUGIN)
24−
25−class SystemImage : public QObject
26−{
27− Q_OBJECT
28− Q_DISABLE_COPY(SystemImage)
29−
30− Q_PROPERTY(bool updateAvailable READ updateAvailable NOTIFY updateAvailableStatus)
31− Q_PROPERTY(bool updateDownloading READ updateDownloading NOTIFY updateAvailableStatus)
32− Q_PROPERTY(QString availableVersion READ availableVersion NOTIFY updateAvailableStatus)
33− Q_PROPERTY(QString updateSize READ updateSize NOTIFY updateAvailableStatus)
34− Q_PROPERTY(bool updateApplying READ updateApplying NOTIFY updateApplyingChanged)
35− Q_PROPERTY(bool updateDownloaded READ updateDownloaded NOTIFY updateDownloadedChanged)
36−
37−public:
38− explicit SystemImage(QObject *parent = nullptr);
39− ~SystemImage() = default;
40−
41− bool updateAvailable() const { return m_updateAvailable; }
42− bool updateDownloading() const { return m_downloading; }
43− QString availableVersion() const { return m_availableVersion; }
44− QString updateSize() const { return m_updateSize; }
45− bool updateApplying() const { return m_updateApplying; }
46− bool updateDownloaded() const { return m_downloaded; }
47−
48−public Q_SLOTS:
49− Q_INVOKABLE void checkForUpdate();
50− Q_INVOKABLE void applyUpdate();
51− Q_INVOKABLE void factoryReset();
52−
53−private Q_SLOTS:
54− void onUpdateAvailableStatus(bool is_available, bool updateDownloading, const QString &available_version,
55− int update_size, const QString &last_update_date, const QString &error_reason);
56− void onUpdateDownloaded();
57− void onUpdateFailed(int consecutive_failure_count, const QString & last_reason);
58− void onUpdateApplied(bool applied);
59− void onRebooting(bool status);
60−
61−Q_SIGNALS:
62− void updateAvailableStatus();
63− void updateDownloadedChanged();
64− void updateApplyingChanged();
65−
66−private Q_SLOTS:
67− void setUpdateApplying(bool status);
68−
69−private:
70− void resetUpdateStatus();
71− QString formatSize(quint64 size) const;
72−
73−private:
74− bool m_updateAvailable = false;
75− bool m_updateApplying = false;
76− bool m_downloading = false;
77− bool m_downloaded = false;
78− QString m_availableVersion;
79− QString m_updateSize;
80− QString m_lastUpdateDate;
81− QString m_errorReason;
82−};
83−
84−#endif // SYSTEMIMAGE_H
plugins/Ubuntu/SystemImage/plugin.cppdeleted−28
@@ -1,28 +0,0 @@
1−/*
2− * Copyright (C) 2014-2016 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 "plugin.h"
18−#include "SystemImage.h"
19−
20−#include <QtQml>
21−
22−void BackendPlugin::registerTypes(const char *uri)
23−{
24− Q_ASSERT(uri == QLatin1String("Ubuntu.SystemImage"));
25−
26− qmlRegisterSingletonType<SystemImage>(uri, 0, 1, "SystemImage",
27− [](QQmlEngine*, QJSEngine*) -> QObject* { return new SystemImage; });
28−}
plugins/Ubuntu/SystemImage/qmldirdeleted−3
@@ -1,3 +0,0 @@
1−module Ubuntu.SystemImage
2−plugin SystemImage
3−typeinfo SystemImage.qmltypes
plugins/Unity/ApplicationMenu/CMakeLists.txtnew file+19
@@ -0,0 +1,19 @@
1+find_package(Qt5DBus REQUIRED)
2+
3+include_directories(
4+ ${CMAKE_CURRENT_SOURCE_DIR}
5+ ${CMAKE_CURRENT_BINARY_DIR}
6+)
7+
8+set(applicationMenu_SRCS
9+ applicationmenuregistry.cpp
10+ dbusapplicationmenuregistry.cpp
11+ plugin.cpp)
12+
13+qt5_add_dbus_adaptor(applicationMenu_SRCS com.ubuntu.MenuRegistrar.xml dbusapplicationmenuregistry.h DBusApplicationMenuRegistry)
14+
15+add_library(ApplicationMenu-qml MODULE ${applicationMenu_SRCS})
16+
17+target_link_libraries(ApplicationMenu-qml Qt5::DBus Qt5::Qml)
18+
19+add_unity8_plugin(Unity.ApplicationMenu 0.1 Unity/ApplicationMenu TARGETS ApplicationMenu-qml)
plugins/Unity/ApplicationMenu/applicationmenuregistry.cppnew file+141
@@ -0,0 +1,141 @@
1+/*
2+ * Copyright (C) 2016 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 "applicationmenuregistry.h"
18+
19+#include <QQmlEngine>
20+#include <QDebug>
21+
22+Q_LOGGING_CATEGORY(UNITY_APPMENU, "unity.appmenu", QtDebugMsg)
23+
24+#define DEBUG_MSG qCDebug(UNITY_APPMENU).nospace().noquote() << "ApplicationMenuRegistry::" << __func__
25+#define WARNING_MSG qCWarning(UNITY_APPMENU).nospace().noquote() << "ApplicationMenuRegistry::" << __func__
26+
27+ApplicationMenuRegistry::ApplicationMenuRegistry(QObject *parent)
28+ : QObject(parent)
29+{
30+}
31+
32+ApplicationMenuRegistry::~ApplicationMenuRegistry()
33+{
34+ qDeleteAll(m_appMenus);
35+ m_appMenus.clear();
36+
37+ qDeleteAll(m_surfaceMenus);
38+ m_surfaceMenus.clear();
39+}
40+
41+void ApplicationMenuRegistry::RegisterAppMenu(pid_t processId,
42+ const QDBusObjectPath &menuObjectPath,
43+ const QDBusObjectPath &actionObjectPath,
44+ const QString &service)
45+{
46+ DEBUG_MSG << "(pid=" << processId
47+ << ", menuPath=" << menuObjectPath.path()
48+ << ", actionPath=" << actionObjectPath.path()
49+ << ", service=" << service;
50+
51+ auto i = m_appMenus.find(processId);
52+ while (i != m_appMenus.end() && i.key() == processId) {
53+ if (i.value()->m_menuPath == menuObjectPath.path().toUtf8()) {
54+ WARNING_MSG << "Already have a menu for application (pid= " << processId
55+ << ", service=" << service
56+ << ", menuPath=" << menuObjectPath.path() << ")";
57+ return;
58+ }
59+ ++i;
60+ }
61+
62+ auto menu = new MenuServicePath(service, menuObjectPath, actionObjectPath);
63+ QQmlEngine::setObjectOwnership(menu, QQmlEngine::CppOwnership);
64+
65+ m_appMenus.insert(processId, menu);
66+ Q_EMIT appMenuRegistered(processId);
67+}
68+
69+void ApplicationMenuRegistry::UnregisterAppMenu(pid_t processId, const QDBusObjectPath &menuObjectPath)
70+{
71+ DEBUG_MSG << "(pid=" << processId
72+ << ", menuPath=" << menuObjectPath.path();
73+
74+ auto i = m_appMenus.find(processId);
75+ while (i != m_appMenus.end() && i.key() == processId) {
76+ if (i.value()->m_menuPath == menuObjectPath.path().toUtf8()) {
77+ i.value()->deleteLater();
78+ m_appMenus.erase(i);
79+ Q_EMIT appMenuUnregistered(processId);
80+ break;
81+ }
82+ ++i;
83+ }
84+}
85+
86+void ApplicationMenuRegistry::RegisterSurfaceMenu(const QString &surfaceId,
87+ const QDBusObjectPath &menuObjectPath,
88+ const QDBusObjectPath &actionObjectPath,
89+ const QString &service)
90+{
91+ DEBUG_MSG << "(surfaceId=" << surfaceId
92+ << ", menuPath=" << menuObjectPath.path()
93+ << ", actionPath=" << actionObjectPath.path()
94+ << ", service=" << service;
95+
96+ auto i = m_surfaceMenus.find(surfaceId);
97+ while (i != m_surfaceMenus.end() && i.key() == surfaceId) {
98+ if (i.value()->m_menuPath == menuObjectPath.path().toUtf8()) {
99+ WARNING_MSG << "Already have a menu for surface (surfaceId= " << surfaceId
100+ << ", service=" << service
101+ << ", menuPath=" << menuObjectPath.path() << ")";
102+ return;
103+ }
104+ ++i;
105+ }
106+
107+ auto menu = new MenuServicePath(service, menuObjectPath, actionObjectPath);
108+ QQmlEngine::setObjectOwnership(menu, QQmlEngine::CppOwnership);
109+
110+ m_surfaceMenus.insert(surfaceId, menu);
111+ Q_EMIT surfaceMenuRegistered(surfaceId);
112+}
113+
114+void ApplicationMenuRegistry::UnregisterSurfaceMenu(const QString &surfaceId, const QDBusObjectPath &menuObjectPath)
115+{
116+ DEBUG_MSG << "(surfaceId=" << surfaceId
117+ << ", menuPath=" << menuObjectPath.path();
118+
119+ auto i = m_surfaceMenus.find(surfaceId);
120+ while (i != m_surfaceMenus.end() && i.key() == surfaceId) {
121+ if (i.value()->m_menuPath == menuObjectPath.path().toUtf8()) {
122+ i.value()->deleteLater();
123+ m_surfaceMenus.erase(i);
124+ Q_EMIT surfaceMenuUnregistered(surfaceId);
125+ break;
126+ }
127+ ++i;
128+ }
129+}
130+
131+QList<QObject*> ApplicationMenuRegistry::getMenusForSurface(const QString &surfaceId) const
132+{
133+ QList<QObject*> list;
134+
135+ auto i = m_surfaceMenus.find(surfaceId);
136+ while (i != m_surfaceMenus.constEnd() && i.key() == surfaceId) {
137+ list << i.value();
138+ ++i;
139+ }
140+ return list;
141+}
plugins/Unity/ApplicationMenu/applicationmenuregistry.hnew file+83
@@ -0,0 +1,83 @@
1+/*
2+ * Copyright (C) 2016 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 APPLICATIONMENUREGISTRY_H
18+#define APPLICATIONMENUREGISTRY_H
19+
20+#include <QObject>
21+#include <QDBusContext>
22+#include <QDBusObjectPath>
23+#include <QtQml>
24+
25+Q_DECLARE_LOGGING_CATEGORY(UNITY_APPMENU)
26+
27+class MenuServicePath : public QObject
28+{
29+ Q_OBJECT
30+ Q_PROPERTY(QByteArray service MEMBER m_service CONSTANT)
31+ Q_PROPERTY(QByteArray menuPath MEMBER m_menuPath CONSTANT)
32+ Q_PROPERTY(QByteArray actionPath MEMBER m_actionPath CONSTANT)
33+public:
34+ explicit MenuServicePath(const QString &service,
35+ const QDBusObjectPath &menuPath,
36+ const QDBusObjectPath &actionPath)
37+ : m_service(service.toUtf8())
38+ , m_menuPath(menuPath.path().toUtf8())
39+ , m_actionPath(actionPath.path().toUtf8())
40+ {}
41+
42+ const QByteArray m_service;
43+ const QByteArray m_menuPath;
44+ const QByteArray m_actionPath;
45+};
46+
47+class ApplicationMenuRegistry : public QObject
48+{
49+ Q_OBJECT
50+public:
51+ virtual ~ApplicationMenuRegistry();
52+
53+ // for qml
54+ Q_INVOKABLE QList<QObject*> getMenusForSurface(const QString &surfaceId) const;
55+
56+ // for dbus
57+ void RegisterAppMenu(pid_t processId,
58+ const QDBusObjectPath &menuObjectPath,
59+ const QDBusObjectPath &actionObjectPath,
60+ const QString &service);
61+ void UnregisterAppMenu(pid_t processId, const QDBusObjectPath &menuObjectPath);
62+
63+ void RegisterSurfaceMenu(const QString &surfaceId,
64+ const QDBusObjectPath &menuObjectPath,
65+ const QDBusObjectPath &actionObjectPath,
66+ const QString &service);
67+ void UnregisterSurfaceMenu(const QString &surfaceId, const QDBusObjectPath &menuObjectPath);
68+
69+Q_SIGNALS:
70+ void appMenuRegistered(uint processId);
71+ void appMenuUnregistered(uint processId);
72+
73+ void surfaceMenuRegistered(const QString& surfaceId);
74+ void surfaceMenuUnregistered(const QString& surfaceId);
75+
76+protected:
77+ explicit ApplicationMenuRegistry(QObject *parent = 0);
78+
79+ QMultiMap<pid_t, MenuServicePath*> m_appMenus;
80+ QMultiMap<QString, MenuServicePath*> m_surfaceMenus;
81+};
82+
83+#endif // APPLICATIONMENUREGISTRY_H
plugins/Unity/ApplicationMenu/com.ubuntu.MenuRegistrar.xmlnew file+83
@@ -0,0 +1,83 @@
1+<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
2+<node xmlns:dox="http://www.ayatana.org/dbus/dox.dtd">
3+ <dox:d><![CDATA[
4+ @mainpage
5+
6+ An interface to register menus that are associated with a window in an application. The
7+ main interface is documented here: @ref com::ubuntu::MenuRegistrar.
8+
9+ The actual menus are transported using the gmenumodel protocol
10+ ]]></dox:d>
11+ <interface name="com.ubuntu.MenuRegistrar" xmlns:dox="http://www.ayatana.org/dbus/dox.dtd">
12+ <dox:d>
13+ An interface to register a menu from an application to be displayed in another
14+ window. This manages that association between processes and/or Mir surface IDs and the dbus
15+ address and object that provides the menus using the org.gtk.Menus interface.
16+ </dox:d>
17+ <method name="RegisterAppMenu">
18+ <dox:d><![CDATA[
19+ Associates a gmenumodel with an application
20+
21+ /note this method assumes that the connection from the caller is the DBus connection
22+ to use for the object. Applications that use multiple DBus connections will need to
23+ ensure this method is called with the same connection that implements the object.
24+ ]]></dox:d>
25+ <arg name="pid" type="u" direction="in">
26+ <dox:d>The process ID of the application for which the menu is associated</dox:d>
27+ </arg>
28+ <arg name="menuObjectPath" type="o" direction="in">
29+ <dox:d>The dbus path where the gmenumodel interface for the application menu has been exported</dox:d>
30+ </arg>
31+ <arg name="actionObjectPath" type="o" direction="in">
32+ <dox:d>The dbus path where the gactionmenu interface for the application menu actions has been exported</dox:d>
33+ </arg>
34+ <arg name="service" type="s" direction="in">
35+ <dox:d>The dbus conection name of the client application to be registered (e.g. :1.23 or org.example.service)</dox:d>
36+ </arg>
37+ </method>
38+ <method name="UnregisterAppMenu">
39+ <dox:d>
40+ A method to allow removing an application menu from the database.
41+ </dox:d>
42+ <arg name="pid" type="u" direction="in">
43+ <dox:d>The process id of the application</dox:d>
44+ </arg>
45+ <arg name="menuObjectPath" type="o" direction="in">
46+ <dox:d>The dbus path for the registered application menu to be unregistered</dox:d>
47+ </arg>
48+ </method>
49+
50+ <method name="RegisterSurfaceMenu">
51+ <dox:d><![CDATA[
52+ Associates a gmenumodel with a surface
53+
54+ /note this method assumes that the connection from the caller is the DBus connection
55+ to use for the object. Applications that use multiple DBus connections will need to
56+ ensure this method is called with the same connection that implements the object.
57+ ]]></dox:d>
58+ <arg name="surface" type="s" direction="in">
59+ <dox:d>The surface ID of the surface</dox:d>
60+ </arg>
61+ <arg name="menuObjectPath" type="o" direction="in">
62+ <dox:d>The dbus path where the gmenumodel interface for the surface menu has been exported</dox:d>
63+ </arg>
64+ <arg name="actionObjectPath" type="o" direction="in">
65+ <dox:d>The dbus path where the gactionmenu interface for the surface menu actions has been exported</dox:d>
66+ </arg>
67+ <arg name="service" type="s" direction="in">
68+ <dox:d>The dbus conection name of the client application to be registered (e.g. :1.23 or org.example.service)</dox:d>
69+ </arg>
70+ </method>
71+ <method name="UnregisterSurfaceMenu">
72+ <dox:d>
73+ A method to allow removing a surface menu from the database.
74+ </dox:d>
75+ <arg name="surfaceId" type="s" direction="in">
76+ <dox:d>The surface id of the surface</dox:d>
77+ </arg>
78+ <arg name="menuObjectPath" type="o" direction="in">
79+ <dox:d>The dbus path for the registered surface menu to be unregistered</dox:d>
80+ </arg>
81+ </method>
82+ </interface>
83+</node>
plugins/Unity/ApplicationMenu/dbusapplicationmenuregistry.cppnew file+44
@@ -0,0 +1,44 @@
1+/*
2+ * Copyright (C) 2016 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 "dbusapplicationmenuregistry.h"
18+#include "menuregistraradaptor.h"
19+
20+DBusApplicationMenuRegistry::DBusApplicationMenuRegistry(QObject *parent)
21+ : ApplicationMenuRegistry(parent)
22+{
23+ new MenuRegistrarAdaptor(this);
24+
25+ QDBusConnection connection = QDBusConnection::sessionBus();
26+ if (!connection.registerObject("/com/ubuntu/MenuRegistrar", this)) {
27+ qCWarning(UNITY_APPMENU) << "Unable to register DBus object /com/ubuntu/MenuRegistrar";
28+ }
29+ if (!connection.registerService("com.ubuntu.MenuRegistrar")) {
30+ qCWarning(UNITY_APPMENU) << "Unable to register DBus service com.ubuntu.MenuRegistrar";
31+ }
32+}
33+
34+DBusApplicationMenuRegistry::~DBusApplicationMenuRegistry()
35+{
36+ QDBusConnection connection = QDBusConnection::sessionBus();
37+ connection.unregisterObject("/com/ubuntu/MenuRegistrar");
38+}
39+
40+ApplicationMenuRegistry *DBusApplicationMenuRegistry::instance()
41+{
42+ static ApplicationMenuRegistry* reg(new DBusApplicationMenuRegistry());
43+ return reg;
44+}
plugins/Ubuntu/SystemImage/plugin.h → plugins/Unity/ApplicationMenu/dbusapplicationmenuregistry.hrenamed+12−9
@@ -1,5 +1,5 @@
11/*
2− * Copyright (C) 2014 Canonical, Ltd.
2+ * Copyright (C) 2016 Canonical, Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -14,18 +14,21 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−#ifndef SYSTEMIMAGE_PLUGIN_H
18−#define SYSTEMIMAGE_PLUGIN_H
17+#ifndef DBUSAPPLICATIONMENUREGISTRY_H
18+#define DBUSAPPLICATIONMENUREGISTRY_H
1919
20−#include <QQmlExtensionPlugin>
20+#include "applicationmenuregistry.h"
2121
22−class BackendPlugin : public QQmlExtensionPlugin
22+class DBusApplicationMenuRegistry : public ApplicationMenuRegistry,
23+ protected QDBusContext
2324{
2425 Q_OBJECT
25− Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid)
26−
2726public:
28− void registerTypes(const char *uri) override;
27+ ~DBusApplicationMenuRegistry();
28+ static ApplicationMenuRegistry* instance();
29+
30+protected:
31+ explicit DBusApplicationMenuRegistry(QObject *parent = 0);
2932};
3033
31−#endif // SYSTEMIMAGE_PLUGIN_H
34+#endif // DBUSAPPLICATIONMENUREGISTRY_H
plugins/Unity/ApplicationMenu/plugin.cppnew file+42
@@ -0,0 +1,42 @@
1+/*
2+ * Copyright (C) 2016 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 "plugin.h"
18+#include "dbusapplicationmenuregistry.h"
19+
20+#include <QtQml>
21+
22+static QObject *menuRegistry(QQmlEngine *engine, QJSEngine *scriptEngine)
23+{
24+ Q_UNUSED(engine)
25+ Q_UNUSED(scriptEngine)
26+ return DBusApplicationMenuRegistry::instance();
27+}
28+
29+void ApplicationMenuPlugin::registerTypes(const char *uri)
30+{
31+ Q_ASSERT(uri == QLatin1String("Unity.ApplicationMenu"));
32+
33+ qmlRegisterUncreatableType<MenuServicePath>(uri, 0, 1, "MenuServicePath", "You cannot create a MenuServicePath");
34+ qmlRegisterSingletonType<DBusApplicationMenuRegistry>(uri, 0, 1, "ApplicationMenuRegistry", menuRegistry);
35+}
36+
37+void ApplicationMenuPlugin::initializeEngine(QQmlEngine *engine, const char *uri)
38+{
39+ QQmlExtensionPlugin::initializeEngine(engine, uri);
40+
41+ menuRegistry(nullptr, nullptr);
42+}
plugins/Ubuntu/Payments/plugin.h → plugins/Unity/ApplicationMenu/plugin.hrenamed+6−5
@@ -1,5 +1,5 @@
11/*
2− * Copyright (C) 2014 Canonical, Ltd.
2+ * Copyright (C) 2016 Canonical, Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -14,18 +14,19 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−#ifndef PAYMENTS_PLUGIN_H
18−#define PAYMENTS_PLUGIN_H
17+#ifndef APPLICATIONMENU_PLUGIN_H
18+#define APPLICATIONMENU_PLUGIN_H
1919
2020#include <QQmlExtensionPlugin>
2121
22−class BackendPlugin : public QQmlExtensionPlugin
22+class ApplicationMenuPlugin : public QQmlExtensionPlugin
2323{
2424 Q_OBJECT
2525 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
2626
2727public:
2828 void registerTypes(const char *uri) override;
29+ void initializeEngine(QQmlEngine *engine, const char *uri) override;
2930};
3031
31−#endif // PAYMENTS_PLUGIN_H
32+#endif // APPLICATIONMENU_PLUGIN_H
plugins/Unity/ApplicationMenu/qmldirnew file+3
@@ -0,0 +1,3 @@
1+module Unity.ApplicationMenu
2+plugin ApplicationMenu-qml
3+typeinfo ApplicationMenu.qmltypes
plugins/Unity/CMakeLists.txt+1−1
@@ -1,7 +1,7 @@
1+add_subdirectory(ApplicationMenu)
12add_subdirectory(Connectivity)
23add_subdirectory(Indicators)
34add_subdirectory(Launcher)
45add_subdirectory(Session)
5−add_subdirectory(DashCommunicator)
66add_subdirectory(InputInfo)
77add_subdirectory(Platform)
plugins/Unity/Connectivity/CMakeLists.txt+1−1
@@ -5,6 +5,6 @@ set(CONNECTIVITY_SOURCES
55
66add_library(Connectivity MODULE ${CONNECTIVITY_SOURCES})
77
8−qt5_use_modules(Connectivity Qml DBus Core)
8+target_link_libraries(Connectivity Qt5::Qml Qt5::DBus Qt5::Core)
99
1010add_unity8_plugin(Unity.Connectivity 0.1 Unity/Connectivity TARGETS Connectivity)
plugins/Unity/DashCommunicator/CMakeLists.txtdeleted−25
@@ -1,25 +0,0 @@
1−include_directories(
2− ${CMAKE_CURRENT_SOURCE_DIR}
3− ${libunity8-private_SOURCE_DIR}
4−)
5−
6−set(QMLDASHCOMMUNICATORPLUGIN_SRC
7− plugin.cpp
8− dbusdashcommunicatorservice.cpp
9− dashcommunicatorservice.cpp
10− dashcommunicator.cpp
11− dashconnection.cpp
12−)
13−
14−add_library(DashCommunicator-qml MODULE
15− ${QMLDASHCOMMUNICATORPLUGIN_SRC}
16−)
17−
18−qt5_use_modules(DashCommunicator-qml DBus Qml)
19−
20−target_link_libraries(DashCommunicator-qml
21− unity8-private
22−)
23−
24−# export the qmldir and qmltypes files
25−add_unity8_plugin(Unity.DashCommunicator 0.1 Unity/DashCommunicator TARGETS DashCommunicator-qml)
plugins/Unity/DashCommunicator/dashcommunicator.cppdeleted−58
@@ -1,58 +0,0 @@
1−/*
2− * Copyright (C) 2014 Canonical, Ltd.
3− *
4− * This program is free software: you can redistribute it and/or modify it under
5− * the terms of the GNU Lesser General Public License version 3, as published by
6− * the Free Software Foundation.
7− *
8− * This program is distributed in the hope that it will be useful, but WITHOUT
9− * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
10− * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11− * Lesser General Public License for more details.
12− *
13− * You should have received a copy of the GNU Lesser General Public License
14− * along with this program. If not, see <http://www.gnu.org/licenses/>.
15− */
16−
17−#include "dashcommunicator.h"
18−#include "dashconnection.h"
19−
20−#include <QObject>
21−
22−DashCommunicator::DashCommunicator(QObject *parent):
23− QThread(parent),
24− m_dashConnection(nullptr),
25− m_created(false)
26−{
27− start();
28−}
29−
30−DashCommunicator::~DashCommunicator()
31−{
32− quit();
33− wait();
34−}
35−
36−void DashCommunicator::setCurrentScope(int index, bool animate, bool isSwipe)
37−{
38− m_mutex.lock();
39− if (m_created) {
40− QMetaObject::invokeMethod(m_dashConnection, "setCurrentScope",
41− Q_ARG(int, index),
42− Q_ARG(bool, animate),
43− Q_ARG(bool, isSwipe));
44− }
45− m_mutex.unlock();
46−}
47−
48−void DashCommunicator::run()
49−{
50− m_dashConnection = new DashConnection(QStringLiteral("com.canonical.UnityDash"),
51− QStringLiteral("/com/canonical/UnityDash"),
52− QLatin1String(""), this);
53− m_mutex.lock();
54− m_created = true;
55− m_mutex.unlock();
56−
57− exec();
58−}
plugins/Unity/DashCommunicator/dashcommunicatorservice.cppdeleted−30
@@ -1,30 +0,0 @@
1−/*
2− * Copyright (C) 2014 Canonical, Ltd.
3− *
4− * This program is free software: you can redistribute it and/or modify it under
5− * the terms of the GNU Lesser General Public License version 3, as published by
6− * the Free Software Foundation.
7− *
8− * This program is distributed in the hope that it will be useful, but WITHOUT
9− * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
10− * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11− * Lesser General Public License for more details.
12− *
13− * You should have received a copy of the GNU Lesser General Public License
14− * along with this program. If not, see <http://www.gnu.org/licenses/>.
15− */
16−
17−#include "dashcommunicatorservice.h"
18−
19−DashCommunicatorService::DashCommunicatorService(QObject *parent):
20− QObject(parent),
21− m_dbusService(new DBusDashCommunicatorService(this))
22−{
23− connect(m_dbusService, &DBusDashCommunicatorService::setCurrentScopeRequested, this, &DashCommunicatorService::setCurrentScopeRequested);
24−}
25−
26−
27−DashCommunicatorService::~DashCommunicatorService()
28−{
29−
30−}
plugins/Unity/DashCommunicator/dashcommunicatorservice.hdeleted−38
@@ -1,38 +0,0 @@
1−/*
2− * Copyright (C) 2014 Canonical, Ltd.
3− *
4− * This program is free software: you can redistribute it and/or modify it under
5− * the terms of the GNU Lesser General Public License version 3, as published by
6− * the Free Software Foundation.
7− *
8− * This program is distributed in the hope that it will be useful, but WITHOUT
9− * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
10− * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11− * Lesser General Public License for more details.
12− *
13− * You should have received a copy of the GNU Lesser General Public License
14− * along with this program. If not, see <http://www.gnu.org/licenses/>.
15− */
16−
17−#ifndef DASHCOMMUNICATORSERVICE_H
18−#define DASHCOMMUNICATORSERVICE_H
19−
20−#include "dbusdashcommunicatorservice.h"
21−
22−#include <QObject>
23−
24−class DashCommunicatorService: public QObject
25−{
26− Q_OBJECT
27−public:
28− DashCommunicatorService(QObject *parent = 0);
29− ~DashCommunicatorService();
30−
31−Q_SIGNALS:
32− void setCurrentScopeRequested(int index, bool animate, bool isSwipe);
33−
34−private:
35− DBusDashCommunicatorService *m_dbusService;
36−};
37−
38−#endif // DBUSUNITYSESSIONSERVICE_H
plugins/Unity/DashCommunicator/dashconnection.cppdeleted−63
@@ -1,63 +0,0 @@
1−/*
2− * Copyright (C) 2014 Canonical, Ltd.
3− *
4− * This program is free software: you can redistribute it and/or modify it under
5− * the terms of the GNU Lesser General Public License version 3, as published by
6− * the Free Software Foundation.
7− *
8− * This program is distributed in the hope that it will be useful, but WITHOUT
9− * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
10− * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11− * Lesser General Public License for more details.
12− *
13− * You should have received a copy of the GNU Lesser General Public License
14− * along with this program. If not, see <http://www.gnu.org/licenses/>.
15− */
16−
17−#include "dashconnection.h"
18−
19−#include <QDBusInterface>
20−#include <QDBusPendingCall>
21−
22−/* The default implementation of AbstractDBusServiceMonitor creates a QDBusInterface when the service
23− * appears on the bus.
24− *
25− * On construction QDBusInterface synchronously introspects the service, which will block the GUI
26− * thread of this process if the service is busy. QDBusAbstractInterface does not perform this
27− * introspection, so let's subclass that and avoid the blocking scenario.
28− *
29− * However we lose Qt's wrapping of the DBus service with a MetaObject, with the result that we
30− * cannot easily connect to DBus signals with the usual connect() calls. So this approach only
31− * suited to push communication with the DBus service.
32− */
33−class AsyncDBusInterface : public QDBusAbstractInterface
34−{
35−public:
36− AsyncDBusInterface(const QString &service, const QString &path,
37− const QString &interface, const QDBusConnection &connection,
38− QObject *parent = 0)
39− : QDBusAbstractInterface(service, path, interface.toLatin1().data(), connection, parent)
40− {}
41− ~AsyncDBusInterface() = default;
42−};
43−
44−
45−DashConnection::DashConnection(const QString &service, const QString &path, const QString &interface, QObject *parent):
46− AbstractDBusServiceMonitor(service, path, interface, SessionBus, parent)
47−{
48−
49−}
50−
51−/* Override the default implementation to create a non-blocking DBus interface (see note above). */
52−QDBusAbstractInterface* DashConnection::createInterface(const QString &service, const QString &path,
53− const QString &interface, const QDBusConnection &connection)
54−{
55− return new AsyncDBusInterface(service, path, interface, connection);
56−}
57−
58−void DashConnection::setCurrentScope(int index, bool animate, bool isSwipe)
59−{
60− if (dbusInterface()) {
61− dbusInterface()->asyncCall(QStringLiteral("SetCurrentScope"), index, animate, isSwipe);
62− }
63−}
plugins/Unity/DashCommunicator/dashconnection.hdeleted−37
@@ -1,37 +0,0 @@
1−/*
2− * Copyright (C) 2014 Canonical, Ltd.
3− *
4− * This program is free software: you can redistribute it and/or modify it under
5− * the terms of the GNU Lesser General Public License version 3, as published by
6− * the Free Software Foundation.
7− *
8− * This program is distributed in the hope that it will be useful, but WITHOUT
9− * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
10− * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11− * Lesser General Public License for more details.
12− *
13− * You should have received a copy of the GNU Lesser General Public License
14− * along with this program. If not, see <http://www.gnu.org/licenses/>.
15− */
16−
17−#ifndef THREADEDDASHCONNECTION_H
18−#define THREADEDDASHCONNECTION_H
19−
20−// local
21−#include "abstractdbusservicemonitor.h"
22−
23−class DashConnection: public AbstractDBusServiceMonitor
24−{
25− Q_OBJECT
26−public:
27− DashConnection(const QString &service, const QString &path, const QString &interface, QObject *parent = 0);
28−
29−public Q_SLOTS:
30− void setCurrentScope(int index, bool animate, bool isSwipe);
31−
32−private:
33− QDBusAbstractInterface* createInterface(const QString &service, const QString &path,
34− const QString &interface, const QDBusConnection &connection) override;
35−};
36−
37−#endif
plugins/Unity/DashCommunicator/dbusdashcommunicatorservice.cppdeleted−35
@@ -1,35 +0,0 @@
1−/*
2− * Copyright (C) 2014 Canonical, Ltd.
3− *
4− * This program is free software: you can redistribute it and/or modify it under
5− * the terms of the GNU Lesser General Public License version 3, as published by
6− * the Free Software Foundation.
7− *
8− * This program is distributed in the hope that it will be useful, but WITHOUT
9− * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
10− * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11− * Lesser General Public License for more details.
12− *
13− * You should have received a copy of the GNU Lesser General Public License
14− * along with this program. If not, see <http://www.gnu.org/licenses/>.
15− */
16−
17−#include "dbusdashcommunicatorservice.h"
18−
19−#include <QDBusConnection>
20−#include <QDBusInterface>
21−#include <QDebug>
22−
23−DBusDashCommunicatorService::DBusDashCommunicatorService(QObject *parent):
24− UnityDBusObject(QStringLiteral("/com/canonical/UnityDash"), QStringLiteral("com.canonical.UnityDash"), false, parent)
25−{
26−}
27−
28−DBusDashCommunicatorService::~DBusDashCommunicatorService()
29−{
30−}
31−
32−void DBusDashCommunicatorService::SetCurrentScope(int index, bool animate, bool isSwipe)
33−{
34− Q_EMIT setCurrentScopeRequested(index, animate, isSwipe);
35−}
plugins/Unity/DashCommunicator/dbusdashcommunicatorservice.hdeleted−39
@@ -1,39 +0,0 @@
1−/*
2− * Copyright (C) 2014 Canonical, Ltd.
3− *
4− * This program is free software: you can redistribute it and/or modify it under
5− * the terms of the GNU Lesser General Public License version 3, as published by
6− * the Free Software Foundation.
7− *
8− * This program is distributed in the hope that it will be useful, but WITHOUT
9− * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
10− * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11− * Lesser General Public License for more details.
12− *
13− * You should have received a copy of the GNU Lesser General Public License
14− * along with this program. If not, see <http://www.gnu.org/licenses/>.
15− */
16−
17−#ifndef DBUSDASHCOMMUNICATORSERVICE_H
18−#define DBUSDASHCOMMUNICATORSERVICE_H
19−
20−#include "unitydbusobject.h"
21−
22−class DBusDashCommunicatorService: public UnityDBusObject
23−{
24− Q_OBJECT
25− Q_CLASSINFO("D-Bus Interface", "com.canonical.Unity.DashCommunicator")
26−
27−public:
28− DBusDashCommunicatorService(QObject *parent = 0);
29− ~DBusDashCommunicatorService();
30−
31−Q_SIGNALS:
32− void setCurrentScopeRequested(int index, bool animate, bool isSwipe);
33−
34−public Q_SLOTS:
35− Q_SCRIPTABLE void SetCurrentScope(int index, bool animate, bool isSwipe);
36−
37−};
38−
39−#endif // DBUSDASHCOMMUNICATORSERVICE_H
plugins/Unity/DashCommunicator/plugin.cppdeleted−32
@@ -1,32 +0,0 @@
1−/*
2− * Copyright (C) 2014 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− * Authors: Michael Zanetti <michael.zanetti@canonical.com>
17− */
18−
19−#include "plugin.h"
20−#include "dashcommunicator.h"
21−#include "dashcommunicatorservice.h"
22−
23−#include <QDBusConnection>
24−#include <QtQml/qqml.h>
25−
26−void DashCommunicatorPlugin::registerTypes(const char *uri)
27−{
28− // @uri Unity.DashCommunicator
29− Q_ASSERT(uri == QStringLiteral("Unity.DashCommunicator"));
30− qmlRegisterType<DashCommunicatorService>(uri, 0, 1, "DashCommunicatorService");
31− qmlRegisterType<DashCommunicator>(uri, 0, 1, "DashCommunicator");
32−}
plugins/Unity/DashCommunicator/qmldirdeleted−3
@@ -1,3 +0,0 @@
1−module Unity.DashCommunicator
2−plugin DashCommunicator-qml
3−typeinfo DashCommunicator.qmltypes
plugins/Unity/Indicators/CMakeLists.txt+4−2
@@ -11,6 +11,9 @@ include_directories(
1111include_directories(
1212 SYSTEM
1313 ${GLIB_INCLUDE_DIRS}
14+)
15+include_directories(
16+ SYSTEM
1417 ${GIO_INCLUDE_DIRS}
1518 ${QMENUMODEL_INCLUDE_DIRS}
1619)
@@ -41,8 +44,7 @@ target_link_libraries(IndicatorsQml
4144 ${GLIB_LIBRARIES}
4245 ${GIO_LIBRARIES}
4346 ${QMENUMODEL_LDFLAGS}
47+ Qt5::Core Qt5::Qml Qt5::Quick Qt5::DBus
4448)
4549
46−qt5_use_modules(IndicatorsQml Core Qml Quick DBus)
47−
4850add_unity8_plugin(Unity.Indicators 0.1 Unity/Indicators TARGETS IndicatorsQml)
plugins/Unity/Indicators/indicators.h+5−5
@@ -27,13 +27,13 @@ class UNITYINDICATORS_EXPORT ActionState : public QObject
2727{
2828 Q_OBJECT
2929public:
30− Q_ENUMS(ActionStates)
3130 enum ActionStates {
3231 Label = 0x00,
3332 IconSource = 0x01,
3433 AccessableName = 0x02,
3534 Visible = 0x03,
3635 };
36+ Q_ENUM(ActionStates)
3737
3838 ActionState(QObject*parent=0):QObject(parent) {}
3939};
@@ -42,11 +42,11 @@ class UNITYINDICATORS_EXPORT NetworkActionState : public QObject
4242{
4343 Q_OBJECT
4444public:
45− Q_ENUMS(NetworkActionStates)
4645 enum NetworkActionStates {
4746 Connection = 0x01,
4847 SignalStrength = 0x02,
4948 };
49+ Q_ENUM(NetworkActionStates)
5050
5151 NetworkActionState(QObject*parent=0):QObject(parent) {}
5252};
@@ -55,13 +55,13 @@ class UNITYINDICATORS_EXPORT NetworkConnection : public QObject
5555{
5656 Q_OBJECT
5757public:
58− Q_ENUMS(NetworkConnectionStates)
5958 enum NetworkConnectionStates {
6059 Initial = 0x00,
6160 Activating = 0x01,
6261 Activated = 0x02,
6362 Deactivating = 0x03,
6463 };
64+ Q_ENUM(NetworkConnectionStates)
6565
6666 NetworkConnection(QObject*parent=0):QObject(parent) {}
6767};
@@ -70,12 +70,12 @@ class UNITYINDICATORS_EXPORT IndicatorsModelRole : public QObject
7070{
7171 Q_OBJECT
7272public:
73− Q_ENUMS(Roles)
7473 enum Roles {
7574 Identifier = 0,
7675 Position,
7776 IndicatorProperties
7877 };
78+ Q_ENUM(Roles)
7979
8080 IndicatorsModelRole(QObject*parent=0):QObject(parent) {}
8181};
@@ -84,7 +84,6 @@ class UNITYINDICATORS_EXPORT FlatMenuProxyModelRole : public QObject
8484{
8585 Q_OBJECT
8686public:
87− Q_ENUMS(Roles)
8887 enum Roles {
8988 Action = Qt::DisplayRole + 1,
9089 Label,
@@ -93,6 +92,7 @@ public:
9392 hasSection,
9493 hasSubMenu
9594 };
95+ Q_ENUM(Roles)
9696
9797 FlatMenuProxyModelRole(QObject*parent=0):QObject(parent) {}
9898};
plugins/Unity/Indicators/indicatorsmanager.h−2
@@ -76,8 +76,6 @@ private:
7676 QSharedPointer<QFileSystemWatcher> m_fsWatcher;
7777 bool m_loaded;
7878 QString m_profile;
79−
80− Platform m_platform;
8179};
8280
8381#endif // INDICATORS_MANAGER_H
plugins/Unity/Indicators/indicatorsmodel.cpp+13
@@ -103,6 +103,19 @@ void IndicatorsModel::setProfile(const QString &profile)
103103 m_manager->setProfile(profile);
104104}
105105
106+bool IndicatorsModel::light() const
107+{
108+ return m_light;
109+}
110+
111+void IndicatorsModel::setLight(const bool &light)
112+{
113+ if (m_light != light) {
114+ m_light = light;
115+ Q_EMIT lightChanged();
116+ }
117+}
118+
106119/*!
107120 \qmlmethod IndicatorsModel::unload()
108121
plugins/Unity/Indicators/indicatorsmodel.h+9−1
@@ -32,10 +32,12 @@ class IndicatorsManager;
3232class UNITYINDICATORS_EXPORT IndicatorsModel : public QAbstractListModel
3333{
3434 Q_OBJECT
35− Q_ENUMS(Roles)
3635 Q_PROPERTY(int count READ count NOTIFY countChanged)
3736 Q_PROPERTY(QString profile READ profile WRITE setProfile NOTIFY profileChanged)
3837
38+ // Used for tests
39+ Q_PROPERTY(bool light READ light WRITE setLight NOTIFY lightChanged)
40+
3941public:
4042
4143 IndicatorsModel(QObject *parent=nullptr);
@@ -49,6 +51,9 @@ public:
4951 QString profile() const;
5052 void setProfile(const QString& profile);
5153
54+ bool light() const;
55+ void setLight(const bool &light);
56+
5257 /* QAbstractItemModel */
5358 QHash<int, QByteArray> roleNames() const override;
5459 int columnCount(const QModelIndex &parent = QModelIndex()) const override;
@@ -61,6 +66,7 @@ Q_SIGNALS:
6166 void countChanged();
6267 void profileChanged();
6368 void indicatorDataChanged(const QVariant& data);
69+ void lightChanged();
6470
6571private Q_SLOTS:
6672 void onIdentifierChanged();
@@ -75,6 +81,8 @@ private:
7581
7682 void notifyDataChanged(QObject *sender, int role);
7783 int count() const;
84+
85+ bool m_light;
7886};
7987
8088#endif // INDICATORSMODEL_H
plugins/Unity/Indicators/sharedunitymenumodel.cpp+4
@@ -81,12 +81,16 @@ void SharedUnityMenuModel::initialize()
8181 }
8282 } else {
8383 QSharedPointer<UnityMenuModel> model = UnityMenuModelCache::singleton()->model(m_menuObjectPath);
84+
8485 if (model != m_model) {
8586 if (model->busName() != m_busName) model->setBusName(m_busName);
8687 if (model->actions() != m_actions) model->setActions(m_actions);
8788
8889 m_model = model;
8990 Q_EMIT modelChanged();
91+ } else if (m_model) {
92+ if (m_model->busName() != m_busName) m_model->setBusName(m_busName);
93+ if (m_model->actions() != m_actions) m_model->setActions(m_actions);
9094 }
9195 }
9296}
plugins/Unity/InputInfo/CMakeLists.txt+1−2
@@ -32,8 +32,7 @@ add_library(InputInfo SHARED
3232target_link_libraries(InputInfo
3333 ${LIBUDEV_LDFLAGS}
3434 ${LIBEVDEV_LDFLAGS}
35+ Qt5::Core Qt5::Qml Qt5::Quick
3536)
3637
37−qt5_use_modules(InputInfo Core Qml Quick)
38−
3938add_unity8_plugin(Unity.InputInfo 0.1 Unity/InputInfo TARGETS InputInfo)
plugins/Unity/InputInfo/qinputinfo.h+2−3
@@ -57,8 +57,6 @@ class QInputDeviceManager;
5757class QInputDevice : public QObject
5858{
5959 Q_OBJECT
60− Q_ENUMS(InputType)
61− Q_FLAGS(InputType InputTypeFlags)
6260 friend class QInputDeviceManagerPrivate;
6361
6462public:
@@ -72,8 +70,9 @@ public:
7270 Keyboard = 16,
7371 Switch = 32
7472 };
75− Q_ENUMS(InputType)
73+ Q_FLAG(InputType)
7674 Q_DECLARE_FLAGS(InputTypeFlags, InputType)
75+ Q_FLAG(InputTypeFlags)
7776
7877 explicit QInputDevice(QObject *parent = 0);
7978 QString name() const;
plugins/Unity/Launcher/CMakeLists.txt+7−3
@@ -1,4 +1,3 @@
1−pkg_check_modules(LAUNCHER_API REQUIRED unity-shell-launcher=10)
21pkg_check_modules(GSETTINGS_QT REQUIRED gsettings-qt)
32
43add_definitions(-DSM_BUSNAME=systemBus)
@@ -25,13 +24,19 @@ set(QMLLAUNCHERPLUGIN_SRC
2524 dbusinterface.cpp
2625 gsettings.cpp
2726 asadapter.cpp
27+ appdrawermodel.cpp
28+ ualwrapper.cpp
29+ xdgwatcher.cpp
2830 ${CMAKE_SOURCE_DIR}/plugins/AccountsService/AccountsServiceDBusAdaptor.cpp
2931 ${APPLICATION_API_INCLUDEDIR}/unity/shell/application/ApplicationManagerInterface.h
3032 ${APPLICATION_API_INCLUDEDIR}/unity/shell/application/ApplicationInfoInterface.h
3133 ${APPLICATION_API_INCLUDEDIR}/unity/shell/application/MirSurfaceListInterface.h
34+ ${APPLICATION_API_INCLUDEDIR}/unity/shell/application/MirSurfaceInterface.h
35+ ${APPLICATION_API_INCLUDEDIR}/unity/shell/application/Mir.h
3236 ${LAUNCHER_API_INCLUDEDIR}/unity/shell/launcher/LauncherItemInterface.h
3337 ${LAUNCHER_API_INCLUDEDIR}/unity/shell/launcher/LauncherModelInterface.h
3438 ${LAUNCHER_API_INCLUDEDIR}/unity/shell/launcher/QuickListModelInterface.h
39+ ${LAUNCHER_API_INCLUDEDIR}/unity/shell/launcher/AppDrawerModelInterface.h
3540 )
3641
3742add_library(UnityLauncher-qml MODULE
@@ -43,8 +48,7 @@ target_link_libraries(UnityLauncher-qml
4348 ${GSETTINGS_QT_LDFLAGS}
4449 ${GLIB_LIBRARIES}
4550 ${UAL_LIBRARIES}
51+ Qt5::DBus Qt5::Qml Qt5::Gui Qt5::Concurrent
4652 )
4753
48−qt5_use_modules(UnityLauncher-qml DBus Qml Gui)
49−
5054add_unity8_plugin(Unity.Launcher 0.1 Unity/Launcher TARGETS UnityLauncher-qml)
plugins/Unity/Launcher/appdrawermodel.cppnew file+192
@@ -0,0 +1,192 @@
1+/*
2+ * Copyright (C) 2016 Canonical, Ltd.
3+ * Copyright (C) 2020 UBports Foundation.
4+ *
5+ * This program is free software; you can redistribute it and/or modify
6+ * it under the terms of the GNU General Public License as published by
7+ * the Free Software Foundation; version 3.
8+ *
9+ * This program is distributed in the hope that it will be useful,
10+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
11+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+ * GNU General Public License for more details.
13+ *
14+ * You should have received a copy of the GNU General Public License
15+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
16+ */
17+
18+#include "appdrawermodel.h"
19+#include "ualwrapper.h"
20+#include "xdgwatcher.h"
21+
22+#include <QDebug>
23+#include <QDateTime>
24+#include <QtConcurrentRun>
25+
26+static std::shared_ptr<LauncherItem> makeSharedLauncherItem(
27+ const QString &appId, const QString &name, const QString &icon, QObject * parent)
28+{
29+ return std::shared_ptr<LauncherItem>(
30+ new LauncherItem(appId, name, icon, parent),
31+ [] (LauncherItem *item) { item->deleteLater(); });
32+}
33+
34+AppDrawerModel::AppDrawerModel(QObject *parent):
35+ AppDrawerModelInterface(parent),
36+ m_ual(new UalWrapper(this)),
37+ m_xdgWatcher(new XdgWatcher(this)),
38+ m_refreshing(false)
39+{
40+ connect(&m_refreshFutureWatcher, &QFutureWatcher<ItemList>::finished,
41+ this, &AppDrawerModel::onRefreshFinished);
42+
43+ // keep this a queued connection as it's coming from another thread.
44+ connect(m_xdgWatcher, &XdgWatcher::appAdded, this, &AppDrawerModel::appAdded, Qt::QueuedConnection);
45+ connect(m_xdgWatcher, &XdgWatcher::appRemoved, this, &AppDrawerModel::appRemoved, Qt::QueuedConnection);
46+ connect(m_xdgWatcher, &XdgWatcher::appInfoChanged, this, &AppDrawerModel::appInfoChanged, Qt::QueuedConnection);
47+
48+ refresh();
49+}
50+
51+int AppDrawerModel::rowCount(const QModelIndex &parent) const
52+{
53+ Q_UNUSED(parent)
54+ return m_list.count();
55+}
56+
57+QVariant AppDrawerModel::data(const QModelIndex &index, int role) const
58+{
59+ switch (role) {
60+ case RoleAppId:
61+ return m_list.at(index.row())->appId();
62+ case RoleName:
63+ return m_list.at(index.row())->name();
64+ case RoleIcon:
65+ return m_list.at(index.row())->icon();
66+ case RoleKeywords:
67+ return m_list.at(index.row())->keywords();
68+ case RoleUsage:
69+ return m_list.at(index.row())->popularity();
70+ }
71+
72+ return QVariant();
73+}
74+
75+void AppDrawerModel::appAdded(const QString &appId)
76+{
77+ if (m_refreshing)
78+ // Will be replaced by the refresh result anyway.
79+ return;
80+
81+ UalWrapper::AppInfo info = UalWrapper::getApplicationInfo(appId);
82+ if (!info.valid) {
83+ qWarning() << "App added signal received but failed to get app info for app" << appId;
84+ return;
85+ }
86+
87+ beginInsertRows(QModelIndex(), m_list.count(), m_list.count());
88+ auto item = makeSharedLauncherItem(appId, info.name, info.icon, /* parent */ nullptr);
89+ item->setKeywords(info.keywords);
90+ item->setPopularity(info.popularity);
91+ m_list.append(std::move(item));
92+ endInsertRows();
93+}
94+
95+void AppDrawerModel::appRemoved(const QString &appId)
96+{
97+ if (m_refreshing)
98+ // Will be replaced by the refresh result anyway.
99+ return;
100+
101+ int idx = -1;
102+ for (int i = 0; i < m_list.count(); i++) {
103+ if (m_list.at(i)->appId() == appId) {
104+ idx = i;
105+ break;
106+ }
107+ }
108+ if (idx < 0) {
109+ qWarning() << "App removed signal received but app doesn't seem to be in the drawer model";
110+ return;
111+ }
112+ beginRemoveRows(QModelIndex(), idx, idx);
113+ m_list.removeAt(idx);
114+ endRemoveRows();
115+}
116+
117+void AppDrawerModel::appInfoChanged(const QString &appId)
118+{
119+ if (m_refreshing)
120+ // Will be replaced by the refresh result anyway.
121+ return;
122+
123+ std::shared_ptr<LauncherItem> item;
124+ int idx = -1;
125+
126+ for(int i = 0; i < m_list.count(); i++) {
127+ if (m_list.at(i)->appId() == appId) {
128+ item = m_list.at(i);
129+ idx = i;
130+ break;
131+ }
132+ }
133+
134+ if (!item) {
135+ return;
136+ }
137+
138+ UalWrapper::AppInfo info = m_ual->getApplicationInfo(appId);
139+ item->setPopularity(info.popularity);
140+ Q_EMIT dataChanged(index(idx), index(idx), {AppDrawerModelInterface::RoleUsage});
141+}
142+
143+bool AppDrawerModel::refreshing() {
144+ return m_refreshing;
145+}
146+
147+void AppDrawerModel::refresh() {
148+ if (m_refreshing)
149+ return;
150+
151+ m_refreshFutureWatcher.setFuture(QtConcurrent::run([](QThread *thread) {
152+ ItemList list;
153+
154+ Q_FOREACH (const QString &appId, UalWrapper::installedApps()) {
155+ UalWrapper::AppInfo info = UalWrapper::getApplicationInfo(appId);
156+ if (!info.valid) {
157+ qWarning() << "Failed to get app info for app" << appId;
158+ continue;
159+ }
160+ // We don't pass parent in because this may run after the model is destroyed.
161+ // (And, in fact, we can't, because the model is in a diferent thread.)
162+ auto item = makeSharedLauncherItem(appId, info.name, info.icon, /* parent */ nullptr);
163+ item->setKeywords(info.keywords);
164+ item->setPopularity(info.popularity);
165+ item->moveToThread(thread);
166+ list.append(std::move(item));
167+ }
168+
169+ return list;
170+ }, this->thread()));
171+
172+ m_refreshing = true;
173+ Q_EMIT refreshingChanged();
174+}
175+
176+void AppDrawerModel::onRefreshFinished() {
177+ if (m_refreshFutureWatcher.isCanceled())
178+ // This is the result of setting canceled future below.
179+ return;
180+
181+ beginResetModel();
182+
183+ m_list = m_refreshFutureWatcher.result();
184+ // Remove the future & its result, so that future modifications won't
185+ // create a copy.
186+ m_refreshFutureWatcher.setFuture(QFuture<ItemList>());
187+
188+ endResetModel();
189+
190+ m_refreshing = false;
191+ Q_EMIT refreshingChanged();
192+}
plugins/Unity/Launcher/appdrawermodel.hnew file+64
@@ -0,0 +1,64 @@
1+/*
2+ * Copyright (C) 2016 Canonical, Ltd.
3+ * Copyright (C) 2020 UBports Foundation.
4+ *
5+ * This program is free software; you can redistribute it and/or modify
6+ * it under the terms of the GNU General Public License as published by
7+ * the Free Software Foundation; version 3.
8+ *
9+ * This program is distributed in the hope that it will be useful,
10+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
11+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+ * GNU General Public License for more details.
13+ *
14+ * You should have received a copy of the GNU General Public License
15+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
16+ */
17+
18+#include <memory>
19+#include <QFutureWatcher>
20+#include <unity/shell/launcher/AppDrawerModelInterface.h>
21+
22+#include "launcheritem.h"
23+
24+class UalWrapper;
25+class XdgWatcher;
26+
27+class AppDrawerModel: public AppDrawerModelInterface
28+{
29+ Q_OBJECT
30+ // TODO: Add this to AppDrawerModelInterface in unity-api.
31+ // Or, better yet, remove AppDrawerModelInterface from unity-api.
32+ Q_PROPERTY(bool refreshing READ refreshing NOTIFY refreshingChanged)
33+public:
34+ AppDrawerModel(QObject* parent = nullptr);
35+
36+ int rowCount(const QModelIndex &parent) const override;
37+ QVariant data(const QModelIndex &index, int role) const override;
38+
39+ // TODO: add these to AppDrawerModelInterface too.
40+ bool refreshing();
41+ Q_INVOKABLE void refresh();
42+
43+Q_SIGNALS:
44+ void refreshingChanged();
45+
46+private Q_SLOTS:
47+ void appAdded(const QString &appId);
48+ void appRemoved(const QString &appId);
49+ void appInfoChanged(const QString &appId);
50+
51+ void onRefreshFinished();
52+
53+private:
54+ // Using shared_ptr is unavoidable in order to share the refresh result
55+ // from the worker thread safely without a memory leak, in case the model
56+ // is destructed before the worker finishes.
57+ typedef QList<std::shared_ptr<LauncherItem>> ItemList;
58+
59+ ItemList m_list;
60+ UalWrapper *m_ual;
61+ XdgWatcher *m_xdgWatcher;
62+ QFutureWatcher<ItemList> m_refreshFutureWatcher;
63+ bool m_refreshing;
64+};
plugins/Unity/Launcher/launcheritem.cpp+56−7
@@ -35,10 +35,8 @@ LauncherItem::LauncherItem(const QString &appId, const QString &name, const QStr
3535 m_countVisible(false),
3636 m_focused(false),
3737 m_alerting(false),
38− m_surfaceCount(0),
3938 m_quickList(new QuickListModel(this))
4039{
41− Q_ASSERT(parent != nullptr);
4240 QuickListEntry nameAction;
4341 nameAction.setActionId(QStringLiteral("launch_item"));
4442 nameAction.setText(m_name);
@@ -48,11 +46,13 @@ LauncherItem::LauncherItem(const QString &appId, const QString &name, const QStr
4846 QuickListEntry pinningAction;
4947 pinningAction.setActionId(QStringLiteral("pin_item"));
5048 pinningAction.setText(gettext("Pin shortcut"));
49+ pinningAction.setIsPrivate(true);
5150 m_quickList->appendAction(pinningAction);
5251
5352 m_quitAction.setActionId(QStringLiteral("stop_item"));
5453 m_quitAction.setIcon(QStringLiteral("application-exit"));
5554 m_quitAction.setText(gettext("Quit"));
55+ m_quitAction.setIsPrivate(true);
5656}
5757
5858QString LauncherItem::appId() const
@@ -90,6 +90,19 @@ void LauncherItem::setIcon(const QString &icon)
9090 }
9191}
9292
93+QStringList LauncherItem::keywords() const
94+{
95+ return m_keywords;
96+}
97+
98+void LauncherItem::setKeywords(const QStringList &keywords)
99+{
100+ if (m_keywords != keywords) {
101+ m_keywords = keywords;
102+ Q_EMIT keywordsChanged(keywords);
103+ }
104+}
105+
93106bool LauncherItem::pinned() const
94107{
95108 return m_pinned;
@@ -107,6 +120,7 @@ void LauncherItem::setPinned(bool pinned)
107120 QuickListEntry entry;
108121 entry.setActionId(QStringLiteral("pin_item"));
109122 entry.setText(pinned ? gettext("Unpin shortcut") : gettext("Pin shortcut"));
123+ entry.setIsPrivate(true);
110124 m_quickList->updateAction(entry);
111125}
112126
@@ -208,14 +222,49 @@ void LauncherItem::setAlerting(bool alerting)
208222
209223int LauncherItem::surfaceCount() const
210224{
211− return m_surfaceCount;
225+ return m_surfaces.count();
226+}
227+
228+void LauncherItem::setSurfaces(const QList<QPair<QString, QString> > &surfaces)
229+{
230+ if (m_surfaces != surfaces) {
231+ m_surfaces = surfaces;
232+
233+ QList<QuickListEntry> removedEntries;
234+ for (int i = 0; i < m_quickList->rowCount(); ++i) {
235+ QuickListEntry entry = m_quickList->get(i);
236+ if (entry.actionId().startsWith(QStringLiteral("surface_"))) {
237+ removedEntries.append(entry);
238+ }
239+ }
240+ Q_FOREACH (const QuickListEntry &entry, removedEntries) {
241+ m_quickList->removeAction(entry);
242+ }
243+ for (int i = 0; i < surfaces.count(); ++i) {
244+ QuickListEntry entry;
245+ entry.setActionId(QStringLiteral("surface_") + surfaces.at(i).first);
246+ entry.setText(surfaces.at(i).second);
247+ entry.setIsPrivate(true);
248+ if (i == surfaces.count() - 1) {
249+ entry.setHasSeparator(true);
250+ }
251+ m_quickList->insertAction(entry, i + 1);
252+ }
253+
254+ Q_EMIT surfaceCountChanged(m_surfaces.count());
255+ }
256+}
257+
258+uint LauncherItem::popularity() const
259+{
260+ return m_popularity;
212261}
213262
214−void LauncherItem::setSurfaceCount(int surfaceCount)
263+void LauncherItem::setPopularity(uint popularity)
215264{
216− if (m_surfaceCount != surfaceCount) {
217− m_surfaceCount = surfaceCount;
218− Q_EMIT surfaceCountChanged(surfaceCount);
265+ if (m_popularity != popularity) {
266+ m_popularity = popularity;
267+ Q_EMIT popularityChanged(popularity);
219268 }
220269}
221270
plugins/Unity/Launcher/launcheritem.h+10−2
@@ -23,6 +23,7 @@
2323#include "quicklistmodel.h"
2424
2525#include <unity/shell/launcher/LauncherItemInterface.h>
26+#include <unity/shell/application/MirSurfaceInterface.h>
2627
2728class QuickListModel;
2829
@@ -37,6 +38,8 @@ public:
3738 QString appId() const override;
3839 QString name() const override;
3940 QString icon() const override;
41+ QStringList keywords() const override;
42+ uint popularity() const override;
4043 bool pinned() const override;
4144 bool running() const override;
4245 bool recent() const override;
@@ -52,6 +55,8 @@ public:
5255private:
5356 void setName(const QString &name);
5457 void setIcon(const QString &icon);
58+ void setKeywords(const QStringList &keywords);
59+ void setPopularity(uint popularity);
5560 void setPinned(bool pinned);
5661 void setRunning(bool running);
5762 void setRecent(bool recent);
@@ -60,12 +65,14 @@ private:
6065 void setCountVisible(bool countVisible);
6166 void setFocused(bool focused);
6267 void setAlerting(bool alerting);
63− void setSurfaceCount(int surfaceCount);
68+ void setSurfaces(const QList<QPair<QString, QString >> &surfaces);
6469
6570private:
6671 QString m_appId;
6772 QString m_name;
6873 QString m_icon;
74+ QStringList m_keywords;
75+ uint m_popularity;
6976 bool m_pinned;
7077 bool m_running;
7178 bool m_recent;
@@ -74,11 +81,12 @@ private:
7481 bool m_countVisible;
7582 bool m_focused;
7683 bool m_alerting;
77− int m_surfaceCount;
84+ QList<QPair<QString, QString> > m_surfaces;
7885 QuickListModel *m_quickList;
7986 QuickListEntry m_quitAction;
8087
8188 friend class LauncherModel;
89+ friend class AppDrawerModel;
8290};
8391
8492#endif // LAUNCHERITEM_H
plugins/Unity/Launcher/launchermodel.cpp+57−57
@@ -19,18 +19,15 @@
1919#include "gsettings.h"
2020#include "dbusinterface.h"
2121#include "asadapter.h"
22+#include "ualwrapper.h"
2223
23−#include <ubuntu-app-launch/appid.h>
24−#include <ubuntu-app-launch/application.h>
25−#include <ubuntu-app-launch/registry.h>
2624#include <unity/shell/application/ApplicationInfoInterface.h>
2725#include <unity/shell/application/MirSurfaceListInterface.h>
26+#include <unity/shell/application/MirSurfaceInterface.h>
2827
2928#include <QDesktopServices>
3029#include <QDebug>
3130
32−namespace ual = ubuntu::app_launch;
33−
3431using namespace unity::shell::application;
3532
3633LauncherModel::LauncherModel(QObject *parent):
@@ -38,8 +35,7 @@ LauncherModel::LauncherModel(QObject *parent):
3835 m_settings(new GSettings(this)),
3936 m_dbusIface(new DBusInterface(this)),
4037 m_asAdapter(new ASAdapter()),
41− m_appManager(nullptr),
42− m_ualRegistry(std::make_shared<ual::Registry>())
38+ m_appManager(nullptr)
4339{
4440 connect(m_dbusIface, &DBusInterface::countChanged, this, &LauncherModel::countChanged);
4541 connect(m_dbusIface, &DBusInterface::countVisibleChanged, this, &LauncherModel::countVisibleChanged);
@@ -159,7 +155,7 @@ void LauncherModel::pin(const QString &appId, int index)
159155 index = m_list.count();
160156 }
161157
162− auto appInfo = getApplicationInfo(appId);
158+ UalWrapper::AppInfo appInfo = UalWrapper::getApplicationInfo(appId);
163159 if (!appInfo.valid) {
164160 qWarning() << "Can't pin application, appId not found:" << appId;
165161 return;
@@ -171,6 +167,7 @@ void LauncherModel::pin(const QString &appId, int index)
171167 appInfo.icon,
172168 this);
173169 item->setPinned(true);
170+ item->setPopularity(appInfo.popularity);
174171 m_list.insert(index, item);
175172 endInsertRows();
176173 }
@@ -203,12 +200,26 @@ void LauncherModel::quickListActionInvoked(const QString &appId, int actionIndex
203200 } else {
204201 pin(appId);
205202 }
206− } else if (actionId == QLatin1String("launch_item")) {
203+ } else if (actionId == QStringLiteral("launch_item")) {
207204 QDesktopServices::openUrl(getUrlForAppId(appId));
208− } else if (actionId == QLatin1String("stop_item")) { // Quit
205+ } else if (actionId == QStringLiteral("stop_item")) { // Quit
209206 if (m_appManager) {
210207 m_appManager->stopApplication(appId);
211208 }
209+ } else if (actionId.startsWith(QStringLiteral("surface_"))){
210+ ApplicationInfoInterface *appInfo = m_appManager->findApplication(appId);
211+ if (appInfo) {
212+ for (int i = 0; i < appInfo->surfaceList()->count(); ++i) {
213+ MirSurfaceInterface *iface = appInfo->surfaceList()->get(i);
214+ QString id = actionId;
215+ id.remove(QRegExp("^surface_"));
216+ if (id == iface->persistentId()) {
217+ iface->activate();
218+ }
219+ }
220+ } else {
221+ qWarning() << "App for" << appId << "not found in launcher. Cannot invoke quicklist action";
222+ }
212223 // Nope, we don't know this action, let the backend forward it to the application
213224 } else {
214225 // TODO: forward quicklist action to app, possibly via m_dbusIface
@@ -219,7 +230,6 @@ void LauncherModel::quickListActionInvoked(const QString &appId, int actionIndex
219230void LauncherModel::setUser(const QString &username)
220231{
221232 Q_UNUSED(username)
222− qWarning() << "This backend doesn't support multiple users";
223233}
224234
225235QString LauncherModel::getUrlForAppId(const QString &appId) const
@@ -335,32 +345,6 @@ int LauncherModel::findApplication(const QString &appId)
335345 return -1;
336346}
337347
338−LauncherModel::AppInfo LauncherModel::getApplicationInfo(const QString &appId)
339−{
340− AppInfo info;
341−
342− ual::AppID ualAppId = ual::AppID::find(m_ualRegistry, appId.toStdString());
343− if (ualAppId.empty()) {
344− return info;
345− }
346−
347− std::shared_ptr<ual::Application> ualApp;
348− try
349− {
350− ualApp = ual::Application::create(ualAppId, m_ualRegistry);
351− }
352− catch (std::runtime_error &e)
353− {
354− qWarning() << "Couldn't find application info for" << appId << "-" << e.what();
355− return info;
356− }
357−
358− info.valid = true;
359− info.name = QString::fromStdString(ualApp->info()->name());
360− info.icon = QString::fromStdString(ualApp->info()->iconPath());
361− return info;
362−}
363−
364348void LauncherModel::progressChanged(const QString &appId, int progress)
365349{
366350 const int idx = findApplication(appId);
@@ -408,7 +392,7 @@ void LauncherModel::countVisibleChanged(const QString &appId, bool countVisible)
408392 }
409393 } else {
410394 // Need to create a new LauncherItem and show the highlight
411− auto appInfo = getApplicationInfo(appId);
395+ UalWrapper::AppInfo appInfo = UalWrapper::getApplicationInfo(appId);
412396 if (countVisible && appInfo.valid) {
413397 LauncherItem *item = new LauncherItem(appId,
414398 appInfo.name,
@@ -428,7 +412,7 @@ void LauncherModel::refresh()
428412 // First walk through all the existing items and see if we need to remove something
429413 QList<LauncherItem*> toBeRemoved;
430414 Q_FOREACH (LauncherItem* item, m_list) {
431− auto appInfo = getApplicationInfo(item->appId());
415+ UalWrapper::AppInfo appInfo = UalWrapper::getApplicationInfo(item->appId());
432416 if (!appInfo.valid) {
433417 // Application no longer available => drop it!
434418 toBeRemoved << item;
@@ -480,7 +464,7 @@ void LauncherModel::refresh()
480464 if (itemIndex == -1) {
481465 // Need to add it. Just add it into the addedIndex to keep same ordering as the list
482466 // in the settings.
483− auto appInfo = getApplicationInfo(entry);
467+ UalWrapper::AppInfo appInfo = UalWrapper::getApplicationInfo(entry);
484468 if (!appInfo.valid) {
485469 continue;
486470 }
@@ -537,11 +521,6 @@ void LauncherModel::applicationAdded(const QModelIndex &parent, int row)
537521 return;
538522 }
539523
540− if (app->appId() == QLatin1String("unity8-dash")) {
541− // Not adding the dash app
542− return;
543− }
544−
545524 const int itemIndex = findApplication(app->appId());
546525 if (itemIndex != -1) {
547526 LauncherItem *item = m_list.at(itemIndex);
@@ -549,40 +528,61 @@ void LauncherModel::applicationAdded(const QModelIndex &parent, int row)
549528 item->setRecent(true);
550529 Q_EMIT dataChanged(index(itemIndex), index(itemIndex), {RoleRecent});
551530 }
552− if (item->surfaceCount() != app->surfaceCount()) {
553− item->setSurfaceCount(app->surfaceCount());
554− Q_EMIT dataChanged(index(itemIndex), index(itemIndex), {RoleSurfaceCount});
555− }
556−
557531 item->setRunning(true);
558532 } else {
559533 LauncherItem *item = new LauncherItem(app->appId(), app->name(), app->icon().toString(), this);
560534 item->setRecent(true);
561535 item->setRunning(true);
562536 item->setFocused(app->focused());
563− item->setSurfaceCount(app->surfaceCount());
564537 beginInsertRows(QModelIndex(), m_list.count(), m_list.count());
565538 m_list.append(item);
566539 endInsertRows();
567540 }
568− connect(app, &ApplicationInfoInterface::surfaceCountChanged, this, &LauncherModel::applicationSurfaceCountChanged);
541+ connect(app, &ApplicationInfoInterface::surfaceCountChanged, this, &LauncherModel::updateSurfaceList);
569542 m_asAdapter->syncItems(m_list);
570543 Q_EMIT dataChanged(index(itemIndex), index(itemIndex), {RoleRunning});
571544}
572545
573−void LauncherModel::applicationSurfaceCountChanged(int count)
546+void LauncherModel::updateSurfaceList()
574547{
575548 ApplicationInfoInterface *app = static_cast<ApplicationInfoInterface*>(sender());
549+ updateSurfaceListForApp(app);
550+}
551+
552+void LauncherModel::updateSurfaceListForSurface()
553+{
554+ MirSurfaceInterface *iface = static_cast<MirSurfaceInterface*>(sender());
555+ ApplicationInfoInterface* app = m_appManager->findApplication(iface->appId());
556+ if (!app) {
557+ return;
558+ }
559+ updateSurfaceListForApp(app);
560+}
561+
562+void LauncherModel::updateSurfaceListForApp(ApplicationInfoInterface* app)
563+{
576564 int idx = findApplication(app->appId());
577565 if (idx < 0) {
578566 qWarning() << "Received a surface count changed event from an app that's not in the Launcher model";
579567 return;
580568 }
581569 LauncherItem *item = m_list.at(idx);
582− if (item->surfaceCount() != count) {
583− item->setSurfaceCount(count);
584− Q_EMIT dataChanged(index(idx), index(idx), {RoleSurfaceCount});
570+ QList<QPair<QString, QString> > surfaces;
571+ for (int i = 0; i < app->surfaceList()->count(); ++i) {
572+ MirSurfaceInterface* iface = app->surfaceList()->get(i);
573+ if (iface->type() == Mir::NormalType || iface->type() == Mir::DialogType) {
574+ // Avoid duplicate connections, so let's just disconnect first to be sure
575+ disconnect(iface, &MirSurfaceInterface::nameChanged, this, &LauncherModel::updateSurfaceListForSurface);
576+ connect(iface, &MirSurfaceInterface::nameChanged, this, &LauncherModel::updateSurfaceListForSurface);
577+ QString name = iface->name();
578+ if (name.isEmpty()) {
579+ name = app->name();
580+ }
581+ surfaces.append({iface->persistentId(), name});
582+ }
585583 }
584+ item->setSurfaces(surfaces);
585+ Q_EMIT dataChanged(index(idx), index(idx), {RoleSurfaceCount});
586586}
587587
588588void LauncherModel::applicationRemoved(const QModelIndex &parent, int row)
@@ -603,7 +603,7 @@ void LauncherModel::applicationRemoved(const QModelIndex &parent, int row)
603603 return;
604604 }
605605
606− disconnect(app, &ApplicationInfoInterface::surfaceCountChanged, this, &LauncherModel::applicationSurfaceCountChanged);
606+ disconnect(app, &ApplicationInfoInterface::surfaceCountChanged, this, &LauncherModel::updateSurfaceList);
607607
608608 LauncherItem * item = m_list.at(appIndex);
609609
plugins/Unity/Launcher/launchermodel.h+3−15
@@ -27,12 +27,6 @@ class GSettings;
2727class DBusInterface;
2828class ASAdapter;
2929
30−namespace ubuntu {
31− namespace app_launch {
32− class Registry;
33− }
34−}
35−
3630using namespace unity::shell::launcher;
3731using namespace unity::shell::application;
3832
@@ -73,13 +67,6 @@ private:
7367
7468 void unpin(const QString &appId);
7569
76− struct AppInfo {
77− bool valid = false;
78− QString name;
79− QString icon;
80− };
81− AppInfo getApplicationInfo(const QString &appId);
82−
8370private Q_SLOTS:
8471 void countChanged(const QString &appId, int count);
8572 void countVisibleChanged(const QString &appId, bool count);
@@ -88,7 +75,9 @@ private Q_SLOTS:
8875 void applicationAdded(const QModelIndex &parent, int row);
8976 void applicationRemoved(const QModelIndex &parent, int row);
9077 void focusedAppIdChanged();
91− void applicationSurfaceCountChanged(int);
78+ void updateSurfaceList();
79+ void updateSurfaceListForApp(ApplicationInfoInterface *app);
80+ void updateSurfaceListForSurface();
9281
9382private:
9483 QList<LauncherItem*> m_list;
@@ -98,7 +87,6 @@ private:
9887 ASAdapter *m_asAdapter;
9988
10089 ApplicationManagerInterface *m_appManager;
101− std::shared_ptr<ubuntu::app_launch::Registry> m_ualRegistry;
10290
10391 friend class LauncherModelTest;
10492};
plugins/Unity/Launcher/plugin.cpp+2−1
@@ -26,7 +26,7 @@
2626// local
2727#include "launchermodel.h"
2828#include "launcheritem.h"
29−
29+#include "appdrawermodel.h"
3030
3131using namespace unity::shell::launcher;
3232
@@ -46,4 +46,5 @@ void UnityLauncherPlugin::registerTypes(const char *uri)
4646 qmlRegisterSingletonType<LauncherModel>(uri, 0, 1, "LauncherModel", modelProvider);
4747 qmlRegisterUncreatableType<LauncherItem>(uri, 0, 1, "LauncherItem", QStringLiteral("Can't create new Launcher Items in QML. Get them from the LauncherModel."));
4848 qmlRegisterUncreatableType<QuickListModel>(uri, 0, 1, "QuickListModel", QStringLiteral("Can't create a QuickListModel in QML. Get them from the LauncherItems."));
49+ qmlRegisterType<AppDrawerModel>(uri, 0, 1, "AppDrawerModel");
4950}
plugins/Unity/Launcher/quicklistentry.cpp+11
@@ -20,6 +20,7 @@
2020
2121QuickListEntry::QuickListEntry()
2222 : m_hasSeparator(false)
23+ , m_isPrivate(false)
2324{
2425}
2526
@@ -72,3 +73,13 @@ bool QuickListEntry::operator==(const QuickListEntry &other)
7273{
7374 return !other.actionId().isEmpty() && other.actionId() == m_actionId;
7475}
76+
77+bool QuickListEntry::isPrivate() const
78+{
79+ return m_isPrivate;
80+}
81+
82+void QuickListEntry::setIsPrivate(bool isPrivate)
83+{
84+ m_isPrivate = isPrivate;
85+}
plugins/Unity/Launcher/quicklistentry.h+4
@@ -42,11 +42,15 @@ public:
4242
4343 bool operator==(const QuickListEntry & other);
4444
45+ bool isPrivate() const;
46+ void setIsPrivate(bool isPrivate);
47+
4548private:
4649 QString m_actionId;
4750 QString m_text;
4851 QString m_icon;
4952 bool m_hasSeparator;
53+ bool m_isPrivate;
5054};
5155
5256#endif // QUICKLISTENTRY
plugins/Unity/Launcher/quicklistmodel.cpp+9
@@ -37,6 +37,13 @@ void QuickListModel::appendAction(const QuickListEntry &entry)
3737 endInsertRows();
3838}
3939
40+void QuickListModel::insertAction(const QuickListEntry &entry, int index)
41+{
42+ beginInsertRows(QModelIndex(), index, index);
43+ m_list.insert(index, entry);
44+ endInsertRows();
45+}
46+
4047void QuickListModel::updateAction(const QuickListEntry &entry)
4148{
4249 for (int i = 0; i < m_list.count(); ++i) {
@@ -81,6 +88,8 @@ QVariant QuickListModel::data(const QModelIndex &index, int role) const
8188 return m_list.at(index.row()).clickable();
8289 case RoleHasSeparator:
8390 return m_list.at(index.row()).hasSeparator();
91+ case RoleIsPrivate:
92+ return m_list.at(index.row()).isPrivate();
8493 }
8594 return QVariant();
8695}
plugins/Unity/Launcher/quicklistmodel.h+1
@@ -36,6 +36,7 @@ public:
3636 ~QuickListModel();
3737
3838 void appendAction(const QuickListEntry &entry);
39+ void insertAction(const QuickListEntry &entry, int index);
3940
4041 /**
4142 * @brief Update an existing action
plugins/Unity/Launcher/ualwrapper.cppnew file+74
@@ -0,0 +1,74 @@
1+/*
2+ * Copyright (C) 2016 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 <QDebug>
18+
19+#include "ualwrapper.h"
20+
21+#include <ubuntu-app-launch/registry.h>
22+using namespace ubuntu::app_launch;
23+
24+UalWrapper::UalWrapper(QObject *parent):
25+ QObject(parent)
26+{
27+}
28+
29+QStringList UalWrapper::installedApps()
30+{
31+ QStringList appIds;
32+ try {
33+ for (const std::shared_ptr<Application> &app : Registry::installedApps()) {
34+ if (!app->appId().package.value().empty()) {
35+ appIds << QString::fromStdString(app->appId().package.value() + "_" + app->appId().appname.value());
36+ } else {
37+ appIds << QString::fromStdString(app->appId().appname);
38+ }
39+ }
40+ } catch (const std::runtime_error &e) {
41+ qWarning() << "ubuntu-app-launch threw an exception listing apps:" << e.what();
42+ }
43+
44+ return appIds;
45+}
46+
47+UalWrapper::AppInfo UalWrapper::getApplicationInfo(const QString &appId)
48+{
49+ AppInfo info;
50+
51+ try {
52+ AppID ualAppId = AppID::find(appId.toStdString());
53+ if (ualAppId.empty()) {
54+ qWarning() << "Empty ualAppId result for" << appId;
55+ return info;
56+ }
57+
58+ std::shared_ptr<Application> ualApp;
59+ ualApp = Application::create(ualAppId, Registry::getDefault());
60+
61+ info.appId = appId;
62+ info.name = QString::fromStdString(ualApp->info()->name());
63+ info.icon = QString::fromStdString(ualApp->info()->iconPath());
64+ for (const std::string &keyword : ualApp->info()->keywords().value()) {
65+ info.keywords << QString::fromStdString(keyword);
66+ }
67+ //info.popularity = ualApp->info()->popularity();
68+ info.valid = true;
69+ } catch (const std::runtime_error &e) {
70+ qWarning() << "ubuntu-app-launch threw an exception getting app info for appId:" << appId << ":" << e.what();
71+ }
72+
73+ return info;
74+}
plugins/ImageCache/plugin.h → plugins/Unity/Launcher/ualwrapper.hrenamed+15−10
@@ -14,18 +14,23 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−#pragma once
17+#include <QObject>
1818
19−#include <QQmlExtensionPlugin>
20−
21−class QQmlEngine;
22−
23−class ImageCachePlugin : public QQmlExtensionPlugin
19+class UalWrapper: public QObject
2420{
2521 Q_OBJECT
26− Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
27−
2822public:
29− void registerTypes(const char* uri) override;
30− void initializeEngine(QQmlEngine* engine, const char* uri) override;
23+ struct AppInfo {
24+ QString appId;
25+ bool valid = false;
26+ QString name;
27+ QString icon;
28+ QStringList keywords;
29+ uint popularity = 0;
30+ };
31+
32+ UalWrapper(QObject* parent = nullptr);
33+
34+ static QStringList installedApps();
35+ static AppInfo getApplicationInfo(const QString &appId);
3136};
plugins/Unity/Launcher/xdgwatcher.cppnew file+129
@@ -0,0 +1,129 @@
1+/*
2+ * Copyright (C) 2019 UBports Foundation
3+ * Author(s): Marius Gripsgard <marius@ubports.com>
4+ *
5+ * This program is free software; you can redistribute it and/or modify
6+ * it under the terms of the GNU General Public License as published by
7+ * the Free Software Foundation; version 3.
8+ *
9+ * This program is distributed in the hope that it will be useful,
10+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
11+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+ * GNU General Public License for more details.
13+ *
14+ * You should have received a copy of the GNU General Public License
15+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
16+ */
17+
18+#include "xdgwatcher.h"
19+
20+#include <QDebug>
21+#include <QDir>
22+#include <QFile>
23+#include <QStandardPaths>
24+#include <QTextStream>
25+
26+XdgWatcher::XdgWatcher(QObject* parent)
27+ : QObject(parent),
28+ m_watcher(new QFileSystemWatcher(this))
29+{
30+ connect(m_watcher, &QFileSystemWatcher::directoryChanged, this, &XdgWatcher::onDirectoryChanged);
31+ connect(m_watcher, &QFileSystemWatcher::fileChanged, this, &XdgWatcher::onFileChanged);
32+
33+ const auto paths = QStandardPaths::standardLocations(QStandardPaths::ApplicationsLocation);
34+ for (const auto &path: paths) {
35+ const auto qdir = QDir(path);
36+ if (!qdir.exists()) {
37+ continue;
38+ }
39+
40+ // Add the path itself to watch for newly added apps
41+ m_watcher->addPath(path);
42+
43+ // Add watcher for eatch app to watch for changes
44+ const auto files = qdir.entryInfoList(QDir::Files);
45+ for (const auto &file: files) {
46+ if (file.suffix() == "desktop") {
47+ const auto path = file.absoluteFilePath();
48+ m_watcher->addPath(path);
49+ m_registry.insert(path, getAppId(file));
50+ }
51+ }
52+ }
53+}
54+
55+// "Ubuntu style" appID is filename without versionNumber after last "_"
56+const QString XdgWatcher::stripAppIdVersion(const QString rawAppID) const {
57+ auto appIdComponents = rawAppID.split("_");
58+ appIdComponents.removeLast();
59+ return appIdComponents.join("_");
60+}
61+
62+// Standard appID see:
63+// https://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html#desktop-file-id
64+const QString XdgWatcher::toStandardAppId(const QFileInfo fileInfo) const {
65+ const auto paths = QStandardPaths::standardLocations(QStandardPaths::ApplicationsLocation);
66+ for (const auto &path: paths) {
67+ if (fileInfo.absolutePath() == path) {
68+ break;
69+ }
70+ if (fileInfo.absolutePath().contains(path)) {
71+ auto fileStr = fileInfo.absoluteFilePath();
72+ fileStr.replace(path, "");
73+ fileStr.replace("/", "-");
74+ fileStr.replace(".desktop", "");
75+ return fileStr;
76+ }
77+ }
78+ return fileInfo.completeBaseName();
79+}
80+
81+const QString XdgWatcher::getAppId(const QFileInfo fileInfo) const {
82+ // We need to open the file to check if its and Ual application
83+ // as we cant just rely on the app name as "normal" apps can also
84+ // contain 3 _ causing us to belive its an ubuntu app
85+ // Example kde_org_kate would become kde_org
86+ QFile qFile(fileInfo.absoluteFilePath());
87+ qFile.open(QIODevice::ReadOnly);
88+ QTextStream fileStream(&qFile);
89+ QString line;
90+ while (fileStream.readLineInto(&line)) {
91+ if (line.startsWith("X-Ubuntu-Application-ID=")) {
92+ auto rawAppID = line.replace("X-Ubuntu-Application-ID=", "");
93+ qFile.close();
94+ return stripAppIdVersion(rawAppID);
95+ }
96+ }
97+ qFile.close();
98+
99+ // If it's not an "Ubuntu" appID, we follow freedesktop standard
100+ return toStandardAppId(fileInfo);
101+}
102+
103+// Watch for newly added apps
104+void XdgWatcher::onDirectoryChanged(const QString &path) {
105+ const auto files = QDir(path).entryInfoList(QDir::Files);
106+ const auto watchedFiles = m_watcher->files();
107+ for (const auto &file: files) {
108+ const auto appPath = file.absoluteFilePath();
109+ if (file.suffix() == "desktop" && !watchedFiles.contains(appPath)) {
110+ m_watcher->addPath(appPath);
111+
112+ const auto appId = getAppId(file);
113+ m_registry.insert(appPath, appId);
114+ Q_EMIT appAdded(appId);
115+ }
116+ }
117+}
118+
119+void XdgWatcher::onFileChanged(const QString &path) {
120+ QFileInfo file(path);
121+ if (file.exists()) {
122+ // The file exists, this must be an modify event
123+ Q_EMIT appInfoChanged(m_registry.value(path));
124+ } else {
125+ // File does not exist, assume this is an remove event.
126+ // onDirectoryChanged will handle rename event
127+ Q_EMIT appRemoved(m_registry.take(path));
128+ }
129+}
plugins/Unity/Launcher/xdgwatcher.hnew file+46
@@ -0,0 +1,46 @@
1+/*
2+ * Copyright (C) 2019 UBports Foundation
3+ * Author(s): Marius Gripsgard <marius@ubports.com>
4+ *
5+ * This program is free software; you can redistribute it and/or modify
6+ * it under the terms of the GNU General Public License as published by
7+ * the Free Software Foundation; version 3.
8+ *
9+ * This program is distributed in the hope that it will be useful,
10+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
11+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+ * GNU General Public License for more details.
13+ *
14+ * You should have received a copy of the GNU General Public License
15+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
16+ */
17+
18+#include <QFileSystemWatcher>
19+#include <QHash>
20+#include <QFileInfo>
21+
22+class QFileInfo;
23+
24+class XdgWatcher: public QObject
25+{
26+ Q_OBJECT
27+public:
28+ XdgWatcher(QObject* parent = nullptr);
29+
30+Q_SIGNALS:
31+ void appAdded(const QString &appId);
32+ void appRemoved(const QString &appId);
33+ void appInfoChanged(const QString &appId);
34+
35+private Q_SLOTS:
36+ void onDirectoryChanged(const QString &path);
37+ void onFileChanged(const QString &path);
38+
39+private:
40+ const QString toStandardAppId(const QFileInfo fileInfo) const;
41+ const QString getAppId(const QFileInfo file) const;
42+ const QString stripAppIdVersion(const QString rawAppID) const;
43+
44+ QFileSystemWatcher* m_watcher;
45+ QHash<const QString, QString> m_registry;
46+};
plugins/Unity/Platform/CMakeLists.txt+1−1
@@ -6,6 +6,6 @@ set(platformplugin_SRCS
66
77add_library(Platform-qml SHARED ${platformplugin_SRCS})
88
9−qt5_use_modules(Platform-qml DBus Qml)
9+target_link_libraries(Platform-qml Qt5::DBus Qt5::Qml)
1010
1111add_unity8_plugin(Unity.Platform 1.0 Unity/Platform TARGETS Platform-qml)
plugins/Unity/Platform/platform.cpp+16−2
@@ -17,9 +17,11 @@
1717#include "platform.h"
1818
1919#include <QDBusConnection>
20+#include <QSet>
21+#include <QString>
2022
2123Platform::Platform(QObject *parent)
22− : QObject(parent)
24+ : QObject(parent), m_isPC(true), m_isMultiSession(true)
2325{
2426 QMetaObject::invokeMethod(this, "init");
2527}
@@ -31,8 +33,20 @@ void Platform::init()
3133 QDBusInterface seatIface("org.freedesktop.login1", "/org/freedesktop/login1/seat/self", "org.freedesktop.login1.Seat",
3234 QDBusConnection::systemBus(), this);
3335
36+ // From the source at https://cgit.freedesktop.org/systemd/systemd/tree/src/hostname/hostnamed.c#n130
37+ // "vm\0"
38+ // "container\0"
39+ // "desktop\0"
40+ // "laptop\0"
41+ // "server\0"
42+ // "tablet\0"
43+ // "handset\0"
44+ // "watch\0"
45+ // "embedded\0",
3446 m_chassis = iface.property("Chassis").toString();
35− m_isPC = (m_chassis == "desktop" || m_chassis == "laptop" || m_chassis == "server");
47+
48+ // A PC is not a handset, tablet or watch.
49+ m_isPC = !QSet<QString>{"handset", "tablet", "watch"}.contains(m_chassis);
3650 m_isMultiSession = seatIface.property("CanMultiSession").toBool() && seatIface.property("CanGraphical").toBool();
3751}
3852
plugins/Unity/Session/CMakeLists.txt+1−1
@@ -18,8 +18,8 @@ add_library(UnitySession-qml MODULE
1818 ${QMLSESSIONPLUGIN_SRC}
1919 )
2020
21−qt5_use_modules(UnitySession-qml DBus Qml)
2221target_link_libraries(UnitySession-qml
22+ Qt5::DBus Qt5::Qml
2323 unity8-private
2424 ${GIO_LDFLAGS}
2525 ${GLIB_LIBRARIES}
plugins/Unity/Session/dbusunitysessionservice.cpp+75−4
@@ -18,6 +18,7 @@
1818#include "dbusunitysessionservice.h"
1919
2020// system
21+#include <grp.h>
2122#include <sys/types.h>
2223#include <unistd.h>
2324#include <pwd.h>
@@ -211,6 +212,23 @@ public:
211212 QDBusConnection::SM_BUSNAME().asyncCall(msg);
212213 }
213214
215+ bool isUserInGroup(const QString &user, const QString &groupName) const
216+ {
217+ auto group = getgrnam(groupName.toUtf8().data());
218+
219+ if (group && group->gr_mem)
220+ {
221+ for (int i = 0; group->gr_mem[i]; ++i)
222+ {
223+ if (g_strcmp0(group->gr_mem[i], user.toUtf8().data()) == 0) {
224+ return true;
225+ }
226+ }
227+ }
228+
229+ return false;
230+ }
231+
214232private Q_SLOTS:
215233 void onPropertiesChanged(const QString &iface, const QVariantMap &changedProps, const QStringList &invalidatedProps)
216234 {
@@ -297,7 +315,13 @@ bool DBusUnitySessionService::CanShutdown() const
297315
298316bool DBusUnitySessionService::CanLock() const
299317{
300− return true; // FIXME
318+ auto user = UserName();
319+ if (user.startsWith(QStringLiteral("guest-")) ||
320+ d->isUserInGroup(user, QStringLiteral("nopasswdlogin"))) {
321+ return false;
322+ } else {
323+ return true;
324+ }
301325}
302326
303327QString DBusUnitySessionService::UserName() const
@@ -335,8 +359,10 @@ void DBusUnitySessionService::PromptLock()
335359 // Prompt as in quick. No locking animation needed. Usually used by
336360 // indicator-session in combination with a switch to greeter or other
337361 // user session.
338− Q_EMIT LockRequested();
339− Q_EMIT lockRequested();
362+ if (CanLock()) {
363+ Q_EMIT LockRequested();
364+ Q_EMIT lockRequested();
365+ }
340366}
341367
342368void DBusUnitySessionService::Lock()
@@ -468,11 +494,56 @@ void performAsyncUnityCall(const QString &method)
468494
469495
470496DBusGnomeSessionManagerWrapper::DBusGnomeSessionManagerWrapper()
497+ : UnityDBusObject(QStringLiteral("/org/gnome/SessionManager"), QStringLiteral("org.gnome.SessionManager"))
498+{
499+}
500+
501+void DBusGnomeSessionManagerWrapper::Logout(quint32 mode)
502+{
503+ auto call = QStringLiteral("RequestLogout");
504+
505+ // These modes are documented as bitwise flags, not an enum, even though
506+ // they only ever seem to be used as enums.
507+
508+ if (mode & 1) // without dialog
509+ call = QStringLiteral("Logout");
510+ if (mode & 2) // without dialog, ignoring inhibitors (which we don't have)
511+ call = QStringLiteral("Logout");
512+
513+ performAsyncUnityCall(call);
514+}
515+
516+void DBusGnomeSessionManagerWrapper::Reboot()
517+{
518+ // GNOME's Reboot means with dialog (they use Request differently than us).
519+ performAsyncUnityCall(QStringLiteral("RequestReboot"));
520+}
521+
522+void DBusGnomeSessionManagerWrapper::RequestReboot()
523+{
524+ // GNOME's RequestReboot means no dialog (they use Request differently than us).
525+ performAsyncUnityCall(QStringLiteral("Reboot"));
526+}
527+
528+void DBusGnomeSessionManagerWrapper::RequestShutdown()
529+{
530+ // GNOME's RequestShutdown means no dialog (they use Request differently than us).
531+ performAsyncUnityCall(QStringLiteral("Shutdown"));
532+}
533+
534+void DBusGnomeSessionManagerWrapper::Shutdown()
535+{
536+ // GNOME's Shutdown means with dialog (they use Request differently than us).
537+ performAsyncUnityCall(QStringLiteral("RequestShutdown"));
538+}
539+
540+
541+DBusGnomeSessionManagerDialogWrapper::DBusGnomeSessionManagerDialogWrapper()
471542 : UnityDBusObject(QStringLiteral("/org/gnome/SessionManager/EndSessionDialog"), QStringLiteral("com.canonical.Unity"))
472543{
473544}
474545
475−void DBusGnomeSessionManagerWrapper::Open(const unsigned type, const unsigned arg_1, const unsigned max_wait, const QList<QDBusObjectPath> &inhibitors)
546+void DBusGnomeSessionManagerDialogWrapper::Open(const unsigned type, const unsigned arg_1, const unsigned max_wait, const QList<QDBusObjectPath> &inhibitors)
476547{
477548 Q_UNUSED(arg_1);
478549 Q_UNUSED(max_wait);
plugins/Unity/Session/dbusunitysessionservice.h+18−4
@@ -270,17 +270,31 @@ private:
270270class DBusGnomeSessionManagerWrapper : public UnityDBusObject
271271{
272272 Q_OBJECT
273− Q_CLASSINFO("D-Bus Interface", "org.gnome.SessionManager.EndSessionDialog")
273+ Q_CLASSINFO("D-Bus Interface", "org.gnome.SessionManager")
274274
275275public:
276276 DBusGnomeSessionManagerWrapper();
277277 ~DBusGnomeSessionManagerWrapper() = default;
278278
279279public Q_SLOTS:
280− Q_SCRIPTABLE void Open(const unsigned int type, const unsigned int arg_1, const unsigned int max_wait, const QList<QDBusObjectPath> &inhibitors);
280+ Q_SCRIPTABLE void Logout(quint32 mode);
281+ Q_SCRIPTABLE void Reboot();
282+ Q_SCRIPTABLE void RequestReboot();
283+ Q_SCRIPTABLE void RequestShutdown();
284+ Q_SCRIPTABLE void Shutdown();
285+};
281286
282−private:
283− void performAsyncCall(const QString &method);
287+class DBusGnomeSessionManagerDialogWrapper : public UnityDBusObject
288+{
289+ Q_OBJECT
290+ Q_CLASSINFO("D-Bus Interface", "org.gnome.SessionManager.EndSessionDialog")
291+
292+public:
293+ DBusGnomeSessionManagerDialogWrapper();
294+ ~DBusGnomeSessionManagerDialogWrapper() = default;
295+
296+public Q_SLOTS:
297+ Q_SCRIPTABLE void Open(const unsigned int type, const unsigned int arg_1, const unsigned int max_wait, const QList<QDBusObjectPath> &inhibitors);
284298};
285299
286300class DBusGnomeScreensaverWrapper: public UnityDBusObject
plugins/Unity/Session/plugin.cpp+1
@@ -26,6 +26,7 @@
2626
2727static QObject *dbusunitysessionservice_provider(QQmlEngine */*engine*/, QJSEngine */*jsEngine*/)
2828{
29+ new DBusGnomeSessionManagerDialogWrapper();
2930 new DBusGnomeSessionManagerWrapper();
3031 new DBusGnomeScreensaverWrapper();
3132 new DBusScreensaverWrapper();
plugins/Utils/CMakeLists.txt+10−4
@@ -7,7 +7,6 @@ include_directories(
77 SYSTEM
88 ${Qt5Gui_PRIVATE_INCLUDE_DIRS}
99 ${Qt5Quick_PRIVATE_INCLUDE_DIRS}
10− ${GIO_INCLUDE_DIRS}
1110)
1211
1312set(QMLPLUGIN_SRC
@@ -15,6 +14,10 @@ set(QMLPLUGIN_SRC
1514 ${APPLICATION_API_INCLUDEDIR}/unity/shell/application/ApplicationManagerInterface.h
1615 ${APPLICATION_API_INCLUDEDIR}/unity/shell/application/ApplicationInfoInterface.h
1716 applicationsfiltermodel.cpp
17+ ${LAUNCHER_API_INCLUDEDIR}/unity/shell/launcher/AppDrawerModelInterface.h
18+ ${LAUNCHER_API_INCLUDEDIR}/unity/shell/launcher/LauncherItemInterface.h
19+ ${LAUNCHER_API_INCLUDEDIR}/unity/shell/launcher/LauncherModelInterface.h
20+ appdrawerproxymodel.cpp
1821 constants.cpp
1922 WindowInputMonitor.cpp
2023 inputwatcher.cpp
@@ -30,6 +33,9 @@ set(QMLPLUGIN_SRC
3033 deviceconfigparser.cpp
3134 globalfunctions.cpp
3235 URLDispatcher.cpp
36+ tabfocusfence.cpp
37+ expressionfiltermodel.cpp
38+ quicklistproxymodel.cpp
3339 plugin.cpp
3440 )
3541
@@ -37,7 +43,9 @@ add_library(Utils-qml SHARED
3743 ${QMLPLUGIN_SRC}
3844 )
3945
40−target_link_libraries(Utils-qml ${GIO_LDFLAGS})
46+target_link_libraries(Utils-qml
47+ Qt5::Qml Qt5::Quick Qt5::DBus Qt5::Network Qt5::Gui Qt5::Sql Qt5::Concurrent
48+ )
4149
4250# Because this is an internal support library, we want
4351# to expose all symbols in it. Consider changing this
@@ -45,6 +53,4 @@ target_link_libraries(Utils-qml ${GIO_LDFLAGS})
4553# files directly in targets.
4654set_target_properties(Utils-qml PROPERTIES COMPILE_FLAGS -fvisibility=default)
4755
48−qt5_use_modules(Utils-qml Qml Quick DBus Network Gui Sql Concurrent)
49−
5056add_unity8_plugin(Utils 0.1 Utils TARGETS Utils-qml)
plugins/Utils/ElapsedTimer.h+1−1
@@ -41,7 +41,7 @@ class ElapsedTimer : public AbstractElapsedTimer {
4141public:
4242 void start() override { m_timer.start(); }
4343 qint64 msecsSinceReference() const override { return m_timer.msecsSinceReference(); }
44− qint64 elapsed() const override { return m_timer.elapsed(); }
44+ qint64 elapsed() const override { return m_timer.isValid() ? m_timer.elapsed() : 0; }
4545private:
4646 QElapsedTimer m_timer;
4747};
plugins/Utils/Timer.cpp+5−2
@@ -37,13 +37,16 @@ void Timer::setInterval(int msecs)
3737void Timer::start()
3838{
3939 m_timer.start();
40− AbstractTimer::start();
4140}
4241
4342void Timer::stop()
4443{
4544 m_timer.stop();
46− AbstractTimer::stop();
45+}
46+
47+bool Timer::isRunning() const
48+{
49+ return m_timer.isActive();
4750}
4851
4952bool Timer::isSingleShot() const
plugins/Utils/Timer.h+5−6
@@ -30,18 +30,16 @@ class AbstractTimer : public QObject
3030{
3131 Q_OBJECT
3232public:
33− AbstractTimer(QObject *parent) : QObject(parent), m_isRunning(false) {}
33+ AbstractTimer(QObject *parent) : QObject(parent) {}
3434 virtual int interval() const = 0;
3535 virtual void setInterval(int msecs) = 0;
36− virtual void start() { m_isRunning = true; }
37− virtual void stop() { m_isRunning = false; }
38− bool isRunning() const { return m_isRunning; }
36+ virtual void start() = 0;
37+ virtual void stop() = 0;
38+ virtual bool isRunning() const = 0;
3939 virtual bool isSingleShot() const = 0;
4040 virtual void setSingleShot(bool value) = 0;
4141Q_SIGNALS:
4242 void timeout();
43−private:
44− bool m_isRunning;
4543};
4644
4745/** A QTimer wrapper */
@@ -55,6 +53,7 @@ public:
5553 void setInterval(int msecs) override;
5654 void start() override;
5755 void stop() override;
56+ bool isRunning() const override;
5857 bool isSingleShot() const override;
5958 void setSingleShot(bool value) override;
6059private:
plugins/Utils/URLDispatcher.cpp+5−2
@@ -1,5 +1,5 @@
11/*
2− * Copyright (C) 2016 Canonical, Ltd.
2+ * Copyright (C) 2016-2017 Canonical, Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -17,6 +17,7 @@
1717#include "URLDispatcher.h"
1818
1919#include <QDBusConnection>
20+#include <QDebug>
2021
2122class URLDispatcherInterface : public QObject
2223{
@@ -63,7 +64,9 @@ void URLDispatcher::setActive(bool value)
6364 connection.registerObject(QStringLiteral("/com/canonical/URLDispatcher"),
6465 dispatcher,
6566 QDBusConnection::ExportScriptableContents);
66− connection.registerService(QStringLiteral("com.canonical.URLDispatcher"));
67+ if (!connection.registerService(QStringLiteral("com.canonical.URLDispatcher"))) {
68+ qWarning() << "Unable to register DBus service com.canonical.URLDispatcher";
69+ }
6770 m_dispatcher = dispatcher;
6871 } else {
6972 connection.unregisterService(QStringLiteral("com.canonical.URLDispatcher"));
plugins/Utils/WindowInputMonitor.cpp+3
@@ -73,6 +73,9 @@ void WindowInputMonitor::update(QEvent *event)
7373 && m_windowLastTouchedTimer->elapsed() >= msecsWithoutTouches) {
7474 m_pressedHomeKey = keyEvent->key();
7575 m_activationTimer->start();
76+ } else if (m_pressedHomeKey != 0 && !m_homeKeys.contains(keyEvent->key())) {
77+ // something else came in... cancel activation
78+ m_activationTimer->stop();
7679 }
7780
7881 } else if (event->type() == QEvent::KeyRelease) {
plugins/Utils/appdrawerproxymodel.cppnew file+189
@@ -0,0 +1,189 @@
1+/*
2+ * Copyright (C) 2016 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 "appdrawerproxymodel.h"
18+
19+#include <unity/shell/launcher/LauncherItemInterface.h>
20+
21+#include <QDebug>
22+
23+AppDrawerProxyModel::AppDrawerProxyModel(QObject *parent):
24+ QSortFilterProxyModel(parent)
25+{
26+ setSortRole(AppDrawerModelInterface::RoleName);
27+ setSortLocaleAware(true);
28+ sort(0);
29+
30+ connect(this, &QAbstractListModel::rowsInserted, this, &AppDrawerProxyModel::countChanged);
31+ connect(this, &QAbstractListModel::rowsRemoved, this, &AppDrawerProxyModel::countChanged);
32+ connect(this, &QAbstractListModel::layoutChanged, this, &AppDrawerProxyModel::countChanged);
33+}
34+
35+QAbstractItemModel *AppDrawerProxyModel::source() const
36+{
37+ return m_source;
38+}
39+
40+void AppDrawerProxyModel::setSource(QAbstractItemModel *source)
41+{
42+ if (m_source != source) {
43+ m_source = source;
44+ setSourceModel(m_source);
45+ setSortRole(m_sortBy == SortByAToZ ? AppDrawerModelInterface::RoleName : AppDrawerModelInterface::RoleUsage);
46+ connect(m_source, &QAbstractItemModel::rowsRemoved, this, &AppDrawerProxyModel::invalidate);
47+ connect(m_source, &QAbstractItemModel::rowsInserted, this, &AppDrawerProxyModel::invalidate);
48+ Q_EMIT sourceChanged();
49+ }
50+}
51+
52+AppDrawerProxyModel::GroupBy AppDrawerProxyModel::group() const
53+{
54+ return m_group;
55+}
56+
57+void AppDrawerProxyModel::setGroup(AppDrawerProxyModel::GroupBy group)
58+{
59+ if (m_group != group) {
60+ m_group = group;
61+ Q_EMIT groupChanged();
62+ invalidateFilter();
63+ }
64+}
65+
66+QString AppDrawerProxyModel::filterLetter() const
67+{
68+ return m_filterLetter;
69+}
70+
71+void AppDrawerProxyModel::setFilterLetter(const QString &filterLetter)
72+{
73+ if (m_filterLetter != filterLetter) {
74+ m_filterLetter = filterLetter;
75+ Q_EMIT filterLetterChanged();
76+ invalidateFilter();
77+ }
78+}
79+
80+QString AppDrawerProxyModel::filterString() const
81+{
82+ return m_filterString;
83+}
84+
85+void AppDrawerProxyModel::setFilterString(const QString &filterString)
86+{
87+ if (m_filterString != filterString) {
88+ m_filterString = filterString;
89+ Q_EMIT filterStringChanged();
90+ invalidateFilter();
91+ }
92+}
93+
94+AppDrawerProxyModel::SortBy AppDrawerProxyModel::sortBy() const
95+{
96+ return m_sortBy;
97+}
98+
99+void AppDrawerProxyModel::setSortBy(AppDrawerProxyModel::SortBy sortBy)
100+{
101+ if (m_sortBy != sortBy) {
102+ m_sortBy = sortBy;
103+ Q_EMIT sortByChanged();
104+ setSortRole(m_sortBy == SortByAToZ ? AppDrawerModelInterface::RoleName : AppDrawerModelInterface::RoleUsage);
105+ sort(0);
106+ }
107+}
108+
109+int AppDrawerProxyModel::count() const
110+{
111+ return rowCount();
112+}
113+
114+QVariant AppDrawerProxyModel::data(const QModelIndex &index, int role) const
115+{
116+ QModelIndex idx = mapToSource(index);
117+ if (role == Qt::UserRole) {
118+ QString name = m_source->data(idx, AppDrawerModelInterface::RoleName).toString();
119+ return name.length() > 0 ? QString(name.at(0)).toUpper() : QChar();
120+ }
121+ return m_source->data(idx, role);
122+}
123+
124+QHash<int, QByteArray> AppDrawerProxyModel::roleNames() const
125+{
126+ if (m_source) {
127+ QHash<int, QByteArray> roles = m_source->roleNames();
128+ roles.insert(Qt::UserRole, "letter");
129+ return roles;
130+ }
131+ return QHash<int, QByteArray>();
132+}
133+
134+bool AppDrawerProxyModel::filterAcceptsRow(int source_row, const QModelIndex &source_parent) const
135+{
136+ Q_UNUSED(source_parent)
137+
138+ if (m_group == GroupByAToZ && source_row > 0) {
139+ QString currentName = m_source->data(m_source->index(source_row, 0), AppDrawerModelInterface::RoleName).toString();
140+ QChar currentLetter = currentName.length() > 0 ? currentName.at(0) : QChar();
141+ QString previousName = m_source->data(m_source->index(source_row - 1,0 ), AppDrawerModelInterface::RoleName).toString();
142+ QChar previousLetter = previousName.length() > 0 ? previousName.at(0) : QChar();
143+ if (currentLetter.toLower() == previousLetter.toLower()) {
144+ return false;
145+ }
146+ } else if(m_group == GroupByAll && source_row > 0) {
147+ return false;
148+ }
149+ if (!m_filterLetter.isEmpty()) {
150+ QString currentName = m_source->data(m_source->index(source_row, 0), AppDrawerModelInterface::RoleName).toString();
151+ QString currentLetter = currentName.length() > 0 ? QString(currentName.at(0)) : QString();
152+ if (currentLetter.toLower() != m_filterLetter.toLower()) {
153+ return false;
154+ }
155+ }
156+ if (!m_filterString.isEmpty()) {
157+ QStringList allWords = m_source->data(m_source->index(source_row, 0), AppDrawerModelInterface::RoleKeywords).toStringList();
158+ allWords.prepend(m_source->data(m_source->index(source_row, 0), AppDrawerModelInterface::RoleName).toString());
159+ bool found = false;
160+ Q_FOREACH (const QString &currentWord, allWords) {
161+ if (currentWord.contains(m_filterString, Qt::CaseInsensitive)) {
162+ found = true;
163+ break;
164+ }
165+ }
166+ if (!found) {
167+ return false;
168+ }
169+ }
170+ return true;
171+}
172+
173+QString AppDrawerProxyModel::appId(int index) const
174+{
175+ if (index >= 0 && index < rowCount()) {
176+ QModelIndex sourceIndex = mapToSource(this->index(index, 0));
177+
178+ AppDrawerModelInterface* adm = dynamic_cast<AppDrawerModelInterface*>(m_source);
179+ if (adm) {
180+ return adm->data(sourceIndex, AppDrawerModelInterface::RoleAppId).toString();
181+ }
182+
183+ AppDrawerProxyModel* adpm = qobject_cast<AppDrawerProxyModel*>(m_source);
184+ if (adpm) {
185+ return adpm->appId(sourceIndex.row());
186+ }
187+ }
188+ return QString();
189+}
plugins/Utils/appdrawerproxymodel.hnew file+87
@@ -0,0 +1,87 @@
1+/*
2+ * Copyright (C) 2016 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 <QSortFilterProxyModel>
18+
19+#include <unity/shell/launcher/AppDrawerModelInterface.h>
20+
21+using namespace unity::shell::launcher;
22+
23+class AppDrawerProxyModel: public QSortFilterProxyModel
24+{
25+ Q_OBJECT
26+ Q_PROPERTY(QAbstractItemModel* source READ source WRITE setSource NOTIFY sourceChanged)
27+ Q_PROPERTY(GroupBy group READ group WRITE setGroup NOTIFY groupChanged)
28+ Q_PROPERTY(QString filterLetter READ filterLetter WRITE setFilterLetter NOTIFY filterLetterChanged)
29+ Q_PROPERTY(QString filterString READ filterString WRITE setFilterString NOTIFY filterStringChanged)
30+ Q_PROPERTY(SortBy sortBy READ sortBy WRITE setSortBy NOTIFY sortByChanged)
31+ Q_PROPERTY(int count READ count NOTIFY countChanged)
32+
33+public:
34+ enum GroupBy {
35+ GroupByNone,
36+ GroupByAll,
37+ GroupByAToZ
38+ };
39+ Q_ENUM(GroupBy)
40+ enum SortBy {
41+ SortByAToZ,
42+ SortByUsage
43+ };
44+ Q_ENUM(SortBy)
45+
46+ AppDrawerProxyModel(QObject* parent = nullptr);
47+
48+ QAbstractItemModel* source() const;
49+ void setSource(QAbstractItemModel* source);
50+
51+ GroupBy group() const;
52+ void setGroup(GroupBy group);
53+
54+ QString filterLetter() const;
55+ void setFilterLetter(const QString &filterLetter);
56+
57+ QString filterString() const;
58+ void setFilterString(const QString &filterString);
59+
60+ SortBy sortBy() const;
61+ void setSortBy(SortBy sortBy);
62+
63+ int count() const;
64+
65+ QVariant data(const QModelIndex &index, int role) const override;
66+ QHash<int, QByteArray> roleNames() const override;
67+
68+ Q_INVOKABLE QString appId(int index) const;
69+
70+protected:
71+ bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const override;
72+
73+Q_SIGNALS:
74+ void sourceChanged();
75+ void groupChanged();
76+ void filterLetterChanged();
77+ void filterStringChanged();
78+ void sortByChanged();
79+ void countChanged();
80+
81+private:
82+ QAbstractItemModel* m_source = nullptr;
83+ GroupBy m_group = GroupByNone;
84+ QString m_filterLetter;
85+ QString m_filterString;
86+ SortBy m_sortBy = SortByAToZ;
87+};
plugins/Utils/deviceconfigparser.cpp+18
@@ -116,6 +116,24 @@ QString DeviceConfigParser::category() const
116116 return value;
117117}
118118
119+bool DeviceConfigParser::supportsMultiColorLed() const
120+{
121+ return readBoolFromConfig("SupportsMultiColorLed", true);
122+}
123+
124+bool DeviceConfigParser::readBoolFromConfig(const QString &key, bool defaultValue) const
125+{
126+ m_config->beginGroup(m_name);
127+
128+ bool ret = defaultValue;
129+ if (m_config->contains(key)) {
130+ ret = m_config->value(key).toBool();
131+ }
132+
133+ m_config->endGroup();
134+ return ret;
135+}
136+
119137QStringList DeviceConfigParser::readOrientationsFromConfig(const QString &key) const
120138{
121139 m_config->beginGroup(m_name);
plugins/Utils/deviceconfigparser.h+3
@@ -33,6 +33,7 @@ class DeviceConfigParser: public QObject
3333 Q_PROPERTY(Qt::ScreenOrientation portraitOrientation READ portraitOrientation NOTIFY changed)
3434 Q_PROPERTY(Qt::ScreenOrientation invertedPortraitOrientation READ invertedPortraitOrientation NOTIFY changed)
3535 Q_PROPERTY(QString category READ category NOTIFY changed)
36+ Q_PROPERTY(bool supportsMultiColorLed READ supportsMultiColorLed NOTIFY changed)
3637
3738public:
3839 DeviceConfigParser(QObject *parent = nullptr);
@@ -47,6 +48,7 @@ public:
4748 Qt::ScreenOrientation portraitOrientation() const;
4849 Qt::ScreenOrientation invertedPortraitOrientation() const;
4950 QString category() const;
51+ bool supportsMultiColorLed() const;
5052
5153Q_SIGNALS:
5254 void changed();
@@ -58,6 +60,7 @@ private:
5860 QStringList readOrientationsFromConfig(const QString &key) const;
5961 QString readOrientationFromConfig(const QString &key) const;
6062 Qt::ScreenOrientation stringToOrientation(const QString &orientationString, Qt::ScreenOrientation defaultValue) const;
63+ bool readBoolFromConfig(const QString &key, bool defaultValue) const;
6164};
6265
6366#endif
plugins/Utils/easingcurve.h−1
@@ -36,7 +36,6 @@
3636class EasingCurve: public QObject
3737{
3838 Q_OBJECT
39− Q_ENUMS(QEasingCurve::Type)
4039 Q_PROPERTY(QEasingCurve::Type type READ type WRITE setType NOTIFY typeChanged)
4140 Q_PROPERTY(qreal period READ period WRITE setPeriod NOTIFY periodChanged)
4241 Q_PROPERTY(qreal progress READ progress WRITE setProgress NOTIFY progressChanged)
plugins/Utils/expressionfiltermodel.cppnew file+49
@@ -0,0 +1,49 @@
1+/*
2+ * Copyright (C) 2017 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 "expressionfiltermodel.h"
18+
19+ExpressionFilterModel::ExpressionFilterModel(QObject *parent)
20+ : UnitySortFilterProxyModelQML(parent)
21+{
22+}
23+
24+QJSValue ExpressionFilterModel::matchExpression() const
25+{
26+ return m_matchExpression;
27+}
28+
29+void ExpressionFilterModel::setMatchExpression(const QJSValue &value)
30+{
31+ m_matchExpression = value;
32+ invalidateFilter();
33+}
34+
35+bool
36+ExpressionFilterModel::filterAcceptsRow(int sourceRow,
37+ const QModelIndex &sourceParent) const
38+{
39+ if (m_matchExpression.isCallable()) {
40+ QJSValueList args;
41+ args << sourceRow;
42+ QJSValue ret = m_matchExpression.call(args);
43+ if (ret.isBool()) {
44+ return ret.toBool();
45+ }
46+ }
47+
48+ return UnitySortFilterProxyModelQML::filterAcceptsRow(sourceRow, sourceParent);
49+}
plugins/Utils/expressionfiltermodel.hnew file+42
@@ -0,0 +1,42 @@
1+/*
2+ * Copyright (C) 2017 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 EXPRESSIONFILTERMODEL_H
18+#define EXPRESSIONFILTERMODEL_H
19+
20+#include "unitysortfilterproxymodelqml.h"
21+#include <QJSValue>
22+
23+class ExpressionFilterModel : public UnitySortFilterProxyModelQML
24+{
25+ Q_OBJECT
26+ Q_PROPERTY(QJSValue matchExpression READ matchExpression WRITE setMatchExpression NOTIFY matchExpressionChanged)
27+public:
28+ explicit ExpressionFilterModel(QObject *parent = 0);
29+
30+ bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override;
31+
32+ QJSValue matchExpression() const;
33+ void setMatchExpression(const QJSValue& value);
34+
35+Q_SIGNALS:
36+ void matchExpressionChanged();
37+
38+private:
39+ mutable QJSValue m_matchExpression;
40+};
41+
42+#endif // EXPRESSIONFILTERMODEL_H
plugins/Utils/globalfunctions.cpp+5
@@ -51,3 +51,8 @@ QQuickItem *GlobalFunctions::itemAt(QQuickItem* parent, int x, int y, QJSValue m
5151 }
5252 return nullptr;
5353}
54+
55+bool GlobalFunctions::itemUnderMouse(QQuickItem* item)
56+{
57+ return item && item->isUnderMouse();
58+}
plugins/Utils/globalfunctions.h+2
@@ -37,6 +37,8 @@ public:
3737 int x,
3838 int y,
3939 QJSValue matcher);
40+
41+ static Q_INVOKABLE bool itemUnderMouse(QQuickItem* item);
4042};
4143
4244#endif // GLOBALFUNCTIONS_H
plugins/Utils/plugin.cpp+9−1
@@ -1,5 +1,5 @@
11/*
2− * Copyright (C) 2012-2015 Canonical, Ltd.
2+ * Copyright (C) 2012-2017 Canonical, Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -39,6 +39,10 @@
3939#include "deviceconfigparser.h"
4040#include "globalfunctions.h"
4141#include "URLDispatcher.h"
42+#include "appdrawerproxymodel.h"
43+#include "tabfocusfence.h"
44+#include "expressionfiltermodel.h"
45+#include "quicklistproxymodel.h"
4246
4347static QObject *createWindowStateStorage(QQmlEngine *engine, QJSEngine *scriptEngine)
4448{
@@ -82,4 +86,8 @@ void UtilsPlugin::registerTypes(const char *uri)
8286 qmlRegisterType<DeviceConfigParser>(uri, 0, 1, "DeviceConfigParser");
8387 qmlRegisterSingletonType<GlobalFunctions>(uri, 0, 1, "Functions", createGlobalFunctions);
8488 qmlRegisterType<URLDispatcher>(uri, 0, 1, "URLDispatcher");
89+ qmlRegisterType<AppDrawerProxyModel>(uri, 0, 1, "AppDrawerProxyModel");
90+ qmlRegisterType<TabFocusFenceItem>(uri, 0, 1, "TabFocusFence");
91+ qmlRegisterType<ExpressionFilterModel>(uri, 0, 1, "ExpressionFilterModel");
92+ qmlRegisterType<QuickListProxyModel>(uri, 0, 1, "QuickListProxyModel");
8593}
plugins/Utils/quicklistproxymodel.cppnew file+72
@@ -0,0 +1,72 @@
1+/*
2+ * Copyright (C) 2017 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 "quicklistproxymodel.h"
18+
19+#include <QDebug>
20+
21+QuickListProxyModel::QuickListProxyModel(QObject *parent):
22+ QSortFilterProxyModel(parent)
23+{
24+ connect(this, &QAbstractListModel::rowsInserted, this, &QuickListProxyModel::countChanged);
25+ connect(this, &QAbstractListModel::rowsRemoved, this, &QuickListProxyModel::countChanged);
26+ connect(this, &QAbstractListModel::layoutChanged, this, &QuickListProxyModel::countChanged);
27+}
28+
29+QAbstractItemModel *QuickListProxyModel::source() const
30+{
31+ return m_source;
32+}
33+
34+bool QuickListProxyModel::privateMode() const
35+{
36+ return m_privateMode;
37+}
38+
39+void QuickListProxyModel::setPrivateMode(bool privateMode)
40+{
41+ if (m_privateMode != privateMode) {
42+ m_privateMode = privateMode;
43+ invalidateFilter();
44+ Q_EMIT privateModeChanged();
45+ }
46+}
47+
48+void QuickListProxyModel::setSource(QAbstractItemModel *source)
49+{
50+ if (m_source != source) {
51+ m_source = source;
52+ setSourceModel(m_source);
53+ connect(m_source, &QAbstractItemModel::rowsRemoved, this, &QuickListProxyModel::invalidate);
54+ connect(m_source, &QAbstractItemModel::rowsInserted, this, &QuickListProxyModel::invalidate);
55+ Q_EMIT sourceChanged();
56+ }
57+}
58+
59+int QuickListProxyModel::count() const
60+{
61+ return rowCount();
62+}
63+
64+bool QuickListProxyModel::filterAcceptsRow(int source_row, const QModelIndex &source_parent) const
65+{
66+ Q_UNUSED(source_parent)
67+
68+ if (m_privateMode) {
69+ return !m_source->data(m_source->index(source_row, 0), QuickListModelInterface::RoleIsPrivate).toBool();
70+ }
71+ return true;
72+}
plugins/Utils/quicklistproxymodel.hnew file+52
@@ -0,0 +1,52 @@
1+/*
2+ * Copyright (C) 2017 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 <QSortFilterProxyModel>
18+
19+#include <unity/shell/launcher/QuickListModelInterface.h>
20+
21+using namespace unity::shell::launcher;
22+
23+class QuickListProxyModel: public QSortFilterProxyModel
24+{
25+ Q_OBJECT
26+ Q_PROPERTY(QAbstractItemModel* source READ source WRITE setSource NOTIFY sourceChanged)
27+ Q_PROPERTY(bool privateMode READ privateMode WRITE setPrivateMode NOTIFY privateModeChanged)
28+ Q_PROPERTY(int count READ count NOTIFY countChanged)
29+
30+public:
31+ QuickListProxyModel(QObject* parent = nullptr);
32+
33+ QAbstractItemModel* source() const;
34+ void setSource(QAbstractItemModel* source);
35+
36+ bool privateMode() const;
37+ void setPrivateMode(bool privateMode);
38+
39+ int count() const;
40+
41+protected:
42+ bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const override;
43+
44+Q_SIGNALS:
45+ void sourceChanged();
46+ void privateModeChanged();
47+ void countChanged();
48+
49+private:
50+ QAbstractItemModel* m_source = nullptr;
51+ bool m_privateMode = false;
52+};
plugins/Utils/tabfocusfence.cppnew file+72
@@ -0,0 +1,72 @@
1+/*
2+ * Copyright 2017 Canonical Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU Lesser General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+*/
16+
17+#include "tabfocusfence.h"
18+
19+#include <private/qquickitem_p.h>
20+
21+TabFocusFenceItem::TabFocusFenceItem(QQuickItem *parent) : QQuickItem(parent)
22+{
23+ QQuickItemPrivate *d = QQuickItemPrivate::get(this);
24+ d->isTabFence = true;
25+ setFlag(ItemIsFocusScope);
26+}
27+
28+bool TabFocusFenceItem::focusNext()
29+{
30+ QQuickItem * current = scopedFocusItem();
31+ if (current) {
32+ QQuickItem * next = current->nextItemInFocusChain(true);
33+ if (next) {
34+ next->setFocus(true, Qt::TabFocusReason);
35+ return true;
36+ }
37+ }
38+ return false;
39+}
40+
41+bool TabFocusFenceItem::focusPrev()
42+{
43+ QQuickItem * current = scopedFocusItem();
44+ if (current) {
45+ QQuickItem * prev = current->nextItemInFocusChain(false);
46+ if (prev) {
47+ prev->setFocus(true, Qt::BacktabFocusReason);
48+ return true;
49+ }
50+ }
51+ return false;
52+}
53+
54+void TabFocusFenceItem::keyPressEvent(QKeyEvent *event)
55+{
56+ // Needed so we eat Tab keys when there's only one item inside the fence
57+ if (event->key() == Qt::Key_Tab) {
58+ event->accept();
59+ } else {
60+ QQuickItem::keyPressEvent(event);
61+ }
62+}
63+
64+void TabFocusFenceItem::keyReleaseEvent(QKeyEvent *event)
65+{
66+ // Needed so we eat Tab keys when there's only one item inside the fence
67+ if (event->key() == Qt::Key_Tab) {
68+ event->accept();
69+ } else {
70+ QQuickItem::keyReleaseEvent(event);
71+ }
72+}
plugins/Utils/tabfocusfence.hnew file+38
@@ -0,0 +1,38 @@
1+/*
2+ * Copyright 2017 Canonical Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU Lesser General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+*/
16+
17+#ifndef TABFOCUSFENCE_H
18+#define TABFOCUSFENCE_H
19+
20+#include <QQuickItem>
21+
22+// An item that restricts focus Tab travelling
23+// to its children
24+class TabFocusFenceItem : public QQuickItem
25+{
26+Q_OBJECT
27+
28+public:
29+ TabFocusFenceItem(QQuickItem *parent = nullptr);
30+
31+ Q_INVOKABLE bool focusNext();
32+ Q_INVOKABLE bool focusPrev();
33+
34+ void keyPressEvent(QKeyEvent *event) override;
35+ void keyReleaseEvent(QKeyEvent *event) override;
36+};
37+
38+#endif
plugins/Utils/unitysortfilterproxymodelqml.h+5
@@ -38,6 +38,11 @@ public:
3838 Q_INVOKABLE int mapRowToSource(int row);
3939 bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override;
4040
41+ // Make the QSortFilterProxyModel variants also accessible
42+ using QSortFilterProxyModel::data;
43+ using QSortFilterProxyModel::mapFromSource;
44+ using QSortFilterProxyModel::mapToSource;
45+
4146 /* getters */
4247 int totalCount() const;
4348 bool invertMatch() const;
plugins/Utils/windowstatestorage.cpp+316−124
@@ -1,5 +1,6 @@
11/*
2− * Copyright 2015 Canonical Ltd.
2+ * Copyright 2015-2016 Canonical Ltd.
3+ * Copyright 2021 UBports Foundation
34 *
45 * This program is free software; you can redistribute it and/or modify
56 * it under the terms of the GNU Lesser General Public License as published by
@@ -16,176 +17,367 @@
1617
1718#include "windowstatestorage.h"
1819
19−#include <QtConcurrent>
2020#include <QDebug>
21−#include <QFutureSynchronizer>
21+#include <QDir>
22+#include <QMetaObject>
23+#include <QObject>
2224#include <QSqlQuery>
2325#include <QSqlError>
2426#include <QSqlResult>
27+#include <QStandardPaths>
2528#include <QRect>
2629#include <unity/shell/application/ApplicationInfoInterface.h>
2730
28−QMutex WindowStateStorage::s_mutex;
2931
30−inline QString sanitiseString(QString string) {
31− return string.remove(QLatin1Char('\"'))
32− .remove(QLatin1Char('\''))
33− .remove(QLatin1Char('\\'));
34−}
35−
36−WindowStateStorage::WindowStateStorage(QObject *parent):
37− QObject(parent)
32+class AsyncQuery: public QObject
3833{
39− QString dbPath = QDir::homePath() + "/.cache/unity8/";
40− m_db = QSqlDatabase::addDatabase(QStringLiteral("QSQLITE"));
41− QDir dir;
42− dir.mkpath(dbPath);
43− m_db.setDatabaseName(dbPath + "windowstatestorage.sqlite");
44− initdb();
45−}
34+ Q_OBJECT
4635
47−WindowStateStorage::~WindowStateStorage()
48−{
49− QFutureSynchronizer<void> futureSync;
50− for (int i = 0; i < m_asyncQueries.count(); ++i) {
51− futureSync.addFuture(m_asyncQueries[i]);
36+public:
37+ AsyncQuery(const QString &dbName):
38+ m_dbName(dbName)
39+ {
5240 }
53− futureSync.waitForFinished();
54− m_db.close();
55−}
5641
57−void WindowStateStorage::saveState(const QString &windowId, WindowStateStorage::WindowState state)
58−{
59− const QString queryString = QStringLiteral("INSERT OR REPLACE INTO state (windowId, state) values ('%1', '%2');")
60− .arg(sanitiseString(windowId))
61− .arg((int)state);
42+ ~AsyncQuery()
43+ {
44+ QSqlDatabase::removeDatabase(m_connectionName);
45+ }
6246
63− saveValue(queryString);
64−}
47+ Q_INVOKABLE const QString getDbName()
48+ {
49+ if (!m_ok) {
50+ return "ERROR";
51+ }
52+ QSqlDatabase connection = QSqlDatabase::database(m_connectionName);
53+ return connection.databaseName();
54+ }
6555
66−WindowStateStorage::WindowState WindowStateStorage::getState(const QString &windowId, WindowStateStorage::WindowState defaultValue) const
67−{
68− const QString queryString = QStringLiteral("SELECT * FROM state WHERE windowId = '%1';")
69− .arg(sanitiseString(windowId));
56+ Q_INVOKABLE bool initdb()
57+ {
58+ if (m_ok) {
59+ return true;
60+ }
61+ QSqlDatabase connection = QSqlDatabase::addDatabase(QStringLiteral("QSQLITE"), m_connectionName);
62+ connection.setDatabaseName(m_dbName);
63+ connection.setConnectOptions(QStringLiteral("QSQLITE_BUSY_TIMEOUT=1000"));
64+ if (!connection.open()) {
65+ qWarning() << "AsyncQuery::initdb: Error opening state database. Window positions will not be saved or restored." << m_dbName << connection.lastError().driverText() << connection.lastError().databaseText();
66+ return false;
67+ }
68+ QSqlQuery query(connection);
69+
70+ if (!connection.tables().contains(QStringLiteral("geometry"))) {
71+ QString geometryQuery = QStringLiteral("CREATE TABLE geometry(windowId TEXT UNIQUE, x INTEGER, y INTEGER, width INTEGER, height INTEGER);");
72+ if (!query.exec(geometryQuery)) {
73+ logSqlError(query);
74+ return false;
75+ }
76+ }
77+
78+ if (!connection.tables().contains(QStringLiteral("state"))) {
79+ QString stateQuery = QStringLiteral("CREATE TABLE state(windowId TEXT UNIQUE, state INTEGER);");
80+ if (!query.exec(stateQuery)) {
81+ logSqlError(query);
82+ return false;
83+ }
84+ }
85+
86+ if (!connection.tables().contains(QStringLiteral("stage"))) {
87+ QString stageQuery = QStringLiteral("CREATE TABLE stage(appId TEXT UNIQUE, stage INTEGER);");
88+ if (!query.exec(stageQuery)) {
89+ logSqlError(query);
90+ return false;
91+ }
92+ }
93+ m_ok = true;
94+ return true;
95+ }
7096
71− QSqlQuery query = getValue(queryString);
97+ Q_INVOKABLE int getState(const QString &windowId) const
98+ {
99+ if (!m_ok) {
100+ return -1;
101+ }
102+ QSqlDatabase connection = QSqlDatabase::database(m_connectionName);
103+ QSqlQuery query(connection);
104+ query.prepare(m_getStateQuery);
105+ query.bindValue(":windowId", windowId);
106+ query.exec();
107+ if (!query.isActive() || !query.isSelect()) {
108+ logSqlError(query);
109+ return -1;
110+ }
111+ if (!query.first()) {
112+ return -1;
113+ }
114+ bool converted = false;
115+ QVariant resultStr = query.value(0);
116+ int result = resultStr.toInt(&converted);
117+ if (converted) {
118+ return result;
119+ } else {
120+ qWarning() << "getState result expected integer, got " << resultStr;
121+ return -1;
122+ }
123+ }
124+
125+ Q_INVOKABLE QRect getGeometry(const QString &windowId) const
126+ {
127+ if (!m_ok) {
128+ return QRect();
129+ }
130+ QSqlDatabase connection = QSqlDatabase::database(m_connectionName);
131+ QSqlQuery query(connection);
132+ query.prepare(m_getGeometryQuery);
133+ query.bindValue(":windowId", windowId);
134+ query.exec();
135+ if (!query.isActive() || !query.isSelect()) {
136+ logSqlError(query);
137+ return QRect();
138+ }
139+
140+ if (!query.first()) {
141+ return QRect();
142+ }
143+
144+ bool xConverted, yConverted, widthConverted, heightConverted = false;
145+ int x, y, width, height;
146+ QVariant xResultStr = query.value(QStringLiteral("x"));
147+ QVariant yResultStr = query.value(QStringLiteral("y"));
148+ QVariant widthResultStr = query.value(QStringLiteral("width"));
149+ QVariant heightResultStr = query.value(QStringLiteral("height"));
150+ x = xResultStr.toInt(&xConverted);
151+ y = yResultStr.toInt(&yConverted);
152+ width = widthResultStr.toInt(&widthConverted);
153+ height = heightResultStr.toInt(&heightConverted);
154+
155+ if (xConverted && yConverted && widthConverted && heightConverted) {
156+ return QRect(x, y, width, height);
157+ } else {
158+ qWarning() << "getGeometry result expected integers, got x:"
159+ << xResultStr << "y:" << yResultStr << "width" << widthResultStr
160+ << "height:" << heightResultStr;
161+ return QRect();
162+ }
72163
73− if (!query.first()) {
74− return defaultValue;
75164 }
76− return (WindowState)query.value(QStringLiteral("state")).toInt();
77−}
78165
79−void WindowStateStorage::saveGeometry(const QString &windowId, const QRect &rect)
80−{
81− const QString queryString = QStringLiteral("INSERT OR REPLACE INTO geometry (windowId, x, y, width, height) values ('%1', '%2', '%3', '%4', '%5');")
82− .arg(sanitiseString(windowId))
83− .arg(rect.x())
84− .arg(rect.y())
85− .arg(rect.width())
86− .arg(rect.height());
87−
88− saveValue(queryString);
89−}
166+ Q_INVOKABLE int getStage(const QString &appId) const
167+ {
168+ if (!m_ok) {
169+ return -1;
170+ }
171+ QSqlDatabase connection = QSqlDatabase::database(m_connectionName);
172+ QSqlQuery query(connection);
173+ query.prepare(m_getStageQuery);
174+ query.bindValue(":appId", appId);
175+ query.exec();
176+ if (!query.isActive() || !query.isSelect()) {
177+ logSqlError(query);
178+ return -1;
179+ }
180+ if (!query.first()) {
181+ return -1;
182+ }
183+ bool converted = false;
184+ QVariant resultStr = query.value(0);
185+ int result = resultStr.toInt(&converted);
186+ if (converted) {
187+ return result;
188+ } else {
189+ qWarning() << "getStage result expected integer, got " << resultStr;
190+ return -1;
191+ }
192+ }
90193
91−void WindowStateStorage::saveStage(const QString &appId, int stage)
92−{
93− const QString queryString = QStringLiteral("INSERT OR REPLACE INTO stage (appId, stage) values ('%1', '%2');")
94− .arg(sanitiseString(appId))
95− .arg(stage);
194+public Q_SLOTS:
195+
196+ void saveState(const QString &windowId, WindowStateStorage::WindowState state)
197+ {
198+ if (!m_ok) {
199+ return;
200+ }
201+ QSqlDatabase connection = QSqlDatabase::database(m_connectionName);
202+ QSqlQuery query(connection);
203+ query.prepare(m_saveStateQuery);
204+ query.bindValue(":windowId", windowId);
205+ query.bindValue(":state", (int)state);
206+ if (!query.exec()) {
207+ logSqlError(query);
208+ }
209+ }
96210
97− saveValue(queryString);
98−}
211+ void saveGeometry(const QString &windowId, const QRect &rect)
212+ {
213+ if (!m_ok) {
214+ return;
215+ }
216+ QSqlDatabase connection = QSqlDatabase::database(m_connectionName);
217+ QSqlQuery query(connection);
218+ query.prepare(m_saveGeometryQuery);
219+ query.bindValue(":windowId", windowId);
220+ query.bindValue(":x", rect.x());
221+ query.bindValue(":y", rect.y());
222+ query.bindValue(":width", rect.width());
223+ query.bindValue(":height", rect.height());
224+ if (!query.exec()) {
225+ logSqlError(query);
226+ }
227+ }
99228
100−int WindowStateStorage::getStage(const QString &appId, int defaultValue) const
101−{
102− const QString queryString = QStringLiteral("SELECT * FROM stage WHERE appId = '%1';")
103− .arg(sanitiseString(appId));
229+ void saveStage(const QString &appId, int stage)
230+ {
231+ if (!m_ok) {
232+ return;
233+ }
234+ QSqlDatabase connection = QSqlDatabase::database(m_connectionName);
235+ QSqlQuery query(connection);
236+ query.prepare(m_saveStageQuery);
237+ query.bindValue(":appId", appId);
238+ query.bindValue(":stage", stage);
239+ if (!query.exec()) {
240+ logSqlError(query);
241+ }
242+ }
104243
105− QSqlQuery query = getValue(queryString);
244+private:
245+ static const QString m_connectionName;
246+ static const QString m_getStateQuery;
247+ static const QString m_saveStateQuery;
248+ static const QString m_getGeometryQuery;
249+ static const QString m_saveGeometryQuery;
250+ static const QString m_getStageQuery;
251+ static const QString m_saveStageQuery;
252+
253+ static void logSqlError(const QSqlQuery query)
254+ {
255+ qWarning() << "Error executing query" << query.lastQuery()
256+ << "Driver error:" << query.lastError().driverText()
257+ << "Database error:" << query.lastError().databaseText();
258+ }
106259
107− if (!query.first()) {
108− return defaultValue;
260+ QString m_dbName;
261+ bool m_ok = false;
262+};
263+
264+const QString AsyncQuery::m_connectionName = QStringLiteral("WindowStateStorage");
265+const QString AsyncQuery::m_getStateQuery = QStringLiteral("SELECT state FROM state WHERE windowId = :windowId");
266+const QString AsyncQuery::m_saveStateQuery = QStringLiteral("INSERT OR REPLACE INTO state (windowId, state) values (:windowId, :state)");
267+const QString AsyncQuery::m_getGeometryQuery = QStringLiteral("SELECT * FROM geometry WHERE windowId = :windowId");
268+const QString AsyncQuery::m_saveGeometryQuery = QStringLiteral("INSERT OR REPLACE INTO geometry (windowId, x, y, width, height) values (:windowId, :x, :y, :width, :height)");
269+const QString AsyncQuery::m_getStageQuery = QStringLiteral("SELECT stage FROM stage WHERE appId = :appId");
270+const QString AsyncQuery::m_saveStageQuery = QStringLiteral("INSERT OR REPLACE INTO stage (appId, stage) values (:appId, :stage)");
271+
272+WindowStateStorage::WindowStateStorage(const QString &dbName, QObject *parent):
273+ QObject(parent),
274+ m_thread()
275+{
276+ qRegisterMetaType<WindowStateStorage::WindowState>("WindowStateStorage::WindowState");
277+ QString dbFile;
278+ if (dbName.isEmpty()) {
279+ const QString dbPath = QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation) + QStringLiteral("/unity8/");
280+ QDir dir;
281+ dir.mkpath(dbPath);
282+ dbFile = QString(dbPath) + QStringLiteral("windowstatestorage.sqlite");
283+ } else {
284+ dbFile = dbName;
109285 }
110− return query.value("stage").toInt();
286+ m_asyncQuery = new AsyncQuery(dbFile);
287+ m_asyncQuery->moveToThread(&m_thread);
288+ connect(&m_thread, &QThread::finished, m_asyncQuery, &QObject::deleteLater);
289+ m_thread.start();
290+ // Note that we're relying on initdb being called before any other methods
291+ // on AsyncQuery. Given the current behavior of QueuedConnection (slots
292+ // invoked in the order they are received), this is fine.
293+ QMetaObject::invokeMethod(m_asyncQuery, "initdb",
294+ Qt::QueuedConnection);
295+ connect(this, &WindowStateStorage::saveState, m_asyncQuery, &AsyncQuery::saveState);
296+ connect(this, &WindowStateStorage::saveGeometry, m_asyncQuery, &AsyncQuery::saveGeometry);
297+ connect(this, &WindowStateStorage::saveStage, m_asyncQuery, &AsyncQuery::saveStage);
111298}
112299
113−void WindowStateStorage::executeAsyncQuery(const QString &queryString)
300+WindowStateStorage::~WindowStateStorage()
114301{
115− QMutexLocker l(&s_mutex);
116− QSqlQuery query;
117−
118− bool ok = query.exec(queryString);
119− if (!ok) {
120− qWarning() << "Error executing query" << queryString
121− << "Driver error:" << query.lastError().driverText()
122− << "Database error:" << query.lastError().databaseText();
123− }
302+ m_thread.quit();
303+ m_thread.wait();
124304}
125305
126−QRect WindowStateStorage::getGeometry(const QString &windowId, const QRect &defaultValue) const
306+WindowStateStorage::WindowState WindowStateStorage::getState(const QString &windowId, WindowStateStorage::WindowState defaultValue) const
127307{
128− QString queryString = QStringLiteral("SELECT * FROM geometry WHERE windowId = '%1';")
129− .arg(sanitiseString(windowId));
308+ int state;
130309
131− QSqlQuery query = getValue(queryString);
310+ QMetaObject::invokeMethod(m_asyncQuery, "getState", Qt::BlockingQueuedConnection,
311+ Q_RETURN_ARG(int, state),
312+ Q_ARG(const QString&, windowId)
313+ );
132314
133− if (!query.first()) {
315+ if (state == -1) {
134316 return defaultValue;
135317 }
136− return QRect(query.value(QStringLiteral("x")).toInt(), query.value(QStringLiteral("y")).toInt(),
137− query.value(QStringLiteral("width")).toInt(), query.value(QStringLiteral("height")).toInt());
318+
319+ return (WindowState)state;
138320}
139321
140−void WindowStateStorage::initdb()
322+int WindowStateStorage::getStage(const QString &appId, int defaultValue) const
141323{
142− m_db.open();
143− if (!m_db.open()) {
144− qWarning() << "Error opening state database:" << m_db.lastError().driverText() << m_db.lastError().databaseText();
145− return;
146− }
324+ int stage;
147325
148− if (!m_db.tables().contains(QStringLiteral("geometry"))) {
149− QSqlQuery query;
150− query.exec(QStringLiteral("CREATE TABLE geometry(windowId TEXT UNIQUE, x INTEGER, y INTEGER, width INTEGER, height INTEGER);"));
151− }
326+ QMetaObject::invokeMethod(m_asyncQuery, "getStage", Qt::BlockingQueuedConnection,
327+ Q_RETURN_ARG(int, stage),
328+ Q_ARG(const QString&, appId)
329+ );
152330
153− if (!m_db.tables().contains(QStringLiteral("state"))) {
154− QSqlQuery query;
155− query.exec(QStringLiteral("CREATE TABLE state(windowId TEXT UNIQUE, state INTEGER);"));
331+ if (stage == -1) {
332+ return defaultValue;
156333 }
157334
158− if (!m_db.tables().contains(QStringLiteral("stage"))) {
159− QSqlQuery query;
160− query.exec(QStringLiteral("CREATE TABLE stage(appId TEXT UNIQUE, stage INTEGER);"));
161− }
335+ return stage;
162336}
163337
164−void WindowStateStorage::saveValue(const QString &queryString)
338+QRect WindowStateStorage::getGeometry(const QString &windowId, const QRect &defaultValue) const
165339{
166− QMutexLocker mutexLocker(&s_mutex);
167−
168− QFuture<void> future = QtConcurrent::run(executeAsyncQuery, queryString);
169− m_asyncQueries.append(future);
170−
171− QFutureWatcher<void> *futureWatcher = new QFutureWatcher<void>();
172− futureWatcher->setFuture(future);
173− connect(futureWatcher, &QFutureWatcher<void>::finished,
174− this,
175− [=](){ m_asyncQueries.removeAll(futureWatcher->future());
176− futureWatcher->deleteLater(); });
340+ QRect geometry;
341+ QMetaObject::invokeMethod(m_asyncQuery, "getGeometry", Qt::BlockingQueuedConnection,
342+ Q_RETURN_ARG(QRect, geometry),
343+ Q_ARG(const QString&, windowId)
344+ );
345+ if (geometry.isNull() || !geometry.isValid()) {
346+ return defaultValue;
347+ }
348+ return geometry;
177349}
178350
179−QSqlQuery WindowStateStorage::getValue(const QString &queryString) const
351+const QString WindowStateStorage::getDbName()
180352{
181− QMutexLocker l(&s_mutex);
182− QSqlQuery query;
353+ QString dbName;
354+ QMetaObject::invokeMethod(m_asyncQuery, "getDbName", Qt::BlockingQueuedConnection,
355+ Q_RETURN_ARG(QString, dbName)
356+ );
357+ return QString(dbName);
358+}
183359
184− bool ok = query.exec(queryString);
185− if (!ok) {
186− qWarning() << "Error retrieving database query:" << queryString
187− << "Driver error:" << query.lastError().driverText()
188− << "Database error:" << query.lastError().databaseText();
360+Mir::State WindowStateStorage::toMirState(WindowState state) const
361+{
362+ // assumes a single state (not an OR of several)
363+ switch (state) {
364+ case WindowStateMaximized: return Mir::MaximizedState;
365+ case WindowStateMinimized: return Mir::MinimizedState;
366+ case WindowStateFullscreen: return Mir::FullscreenState;
367+ case WindowStateMaximizedLeft: return Mir::MaximizedLeftState;
368+ case WindowStateMaximizedRight: return Mir::MaximizedRightState;
369+ case WindowStateMaximizedHorizontally: return Mir::HorizMaximizedState;
370+ case WindowStateMaximizedVertically: return Mir::VertMaximizedState;
371+ case WindowStateMaximizedTopLeft: return Mir::MaximizedTopLeftState;
372+ case WindowStateMaximizedTopRight: return Mir::MaximizedTopRightState;
373+ case WindowStateMaximizedBottomLeft: return Mir::MaximizedBottomLeftState;
374+ case WindowStateMaximizedBottomRight: return Mir::MaximizedBottomRightState;
375+
376+ case WindowStateNormal:
377+ case WindowStateRestored:
378+ default:
379+ return Mir::RestoredState;
189380 }
190− return query;
191381}
382+
383+#include "windowstatestorage.moc"
plugins/Utils/windowstatestorage.h+19−17
@@ -1,5 +1,6 @@
11/*
22 * Copyright 2015-2016 Canonical Ltd.
3+ * Copyright 2021 UBports Foundation
34 *
45 * This program is free software; you can redistribute it and/or modify
56 * it under the terms of the GNU Lesser General Public License as published by
@@ -16,13 +17,19 @@
1617
1718#include <QObject>
1819#include <QSqlDatabase>
20+#include <QSqlQuery>
1921#include <QMutex>
2022#include <QFuture>
23+#include <QThread>
24+
25+// unity-api
26+#include <unity/shell/application/Mir.h>
27+
28+class AsyncQuery;
2129
2230class WindowStateStorage: public QObject
2331{
2432 Q_OBJECT
25− Q_ENUMS(WindowState)
2633public:
2734 enum WindowState {
2835 WindowStateNormal = 1 << 0,
@@ -39,34 +46,29 @@ public:
3946 WindowStateMaximizedBottomRight = 1 << 11,
4047 WindowStateRestored = 1 << 12
4148 };
49+ Q_ENUM(WindowState)
4250 Q_DECLARE_FLAGS(WindowStates, WindowState)
43−#if (QT_VERSION >= QT_VERSION_CHECK(5, 5, 0))
4451 Q_FLAG(WindowStates)
45−#endif
4652
47− WindowStateStorage(QObject *parent = 0);
53+ WindowStateStorage(const QString &dbName = QString(), QObject *parent = nullptr);
4854 virtual ~WindowStateStorage();
4955
50− Q_INVOKABLE void saveState(const QString &windowId, WindowState state);
5156 Q_INVOKABLE WindowState getState(const QString &windowId, WindowState defaultValue) const;
5257
53− Q_INVOKABLE void saveGeometry(const QString &windowId, const QRect &rect);
5458 Q_INVOKABLE QRect getGeometry(const QString &windowId, const QRect &defaultValue) const;
5559
56− Q_INVOKABLE void saveStage(const QString &appId, int stage);
5760 Q_INVOKABLE int getStage(const QString &appId, int defaultValue) const;
5861
59−private:
60− void initdb();
62+ Q_INVOKABLE Mir::State toMirState(WindowState state) const;
6163
62− void saveValue(const QString &queryString);
63− QSqlQuery getValue(const QString &queryString) const;
64+ const QString getDbName();
6465
65− static void executeAsyncQuery(const QString &queryString);
66− static QMutex s_mutex;
66+Q_SIGNALS:
67+ void saveStage(const QString &appId, int stage);
68+ void saveGeometry(const QString &windowId, const QRect &rect);
69+ void saveState(const QString &windowId, WindowStateStorage::WindowState state);
6770
68− // NB: This is accessed from threads. Make sure to mutex it.
69− QSqlDatabase m_db;
70−
71− QList< QFuture<void> > m_asyncQueries;
71+private:
72+ QThread m_thread;
73+ AsyncQuery *m_asyncQuery;
7274};
plugins/WindowManager/AvailableDesktopArea.cppnew file+50
@@ -0,0 +1,50 @@
1+/*
2+ * Copyright (C) 2017 Canonical, Ltd.
3+ *
4+ * This program is free software: you can redistribute it and/or modify it under
5+ * the terms of the GNU Lesser General Public License version 3, as published by
6+ * the Free Software Foundation.
7+ *
8+ * This program is distributed in the hope that it will be useful, but WITHOUT
9+ * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
10+ * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11+ * Lesser General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU Lesser General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+#include "AvailableDesktopArea.h"
18+
19+#include <QGuiApplication>
20+#include <QQuickWindow>
21+#include <qpa/qplatformnativeinterface.h>
22+
23+AvailableDesktopArea::AvailableDesktopArea(QQuickItem *parent)
24+ : QQuickItem(parent)
25+{
26+ connect(this, &QQuickItem::xChanged, this, &AvailableDesktopArea::updatePlatformWindowProperty);
27+ connect(this, &QQuickItem::yChanged, this, &AvailableDesktopArea::updatePlatformWindowProperty);
28+ connect(this, &QQuickItem::widthChanged, this, &AvailableDesktopArea::updatePlatformWindowProperty);
29+ connect(this, &QQuickItem::heightChanged, this, &AvailableDesktopArea::updatePlatformWindowProperty);
30+}
31+
32+void AvailableDesktopArea::updatePlatformWindowProperty()
33+{
34+ if (!window()) {
35+ return;
36+ }
37+
38+ QPlatformNativeInterface *nativeInterface = QGuiApplication::platformNativeInterface();
39+
40+ QRect rect(x(), y(), width(), height());
41+
42+ nativeInterface->setWindowProperty(window()->handle(), "availableDesktopArea", QVariant(rect));
43+}
44+
45+void AvailableDesktopArea::itemChange(ItemChange change, const ItemChangeData &)
46+{
47+ if (change == ItemSceneChange) {
48+ updatePlatformWindowProperty();
49+ }
50+}
plugins/Unity/DashCommunicator/dashcommunicator.h → plugins/WindowManager/AvailableDesktopArea.hrenamed+14−21
@@ -1,5 +1,5 @@
11/*
2− * Copyright (C) 2014 Canonical, Ltd.
2+ * Copyright (C) 2017 Canonical, Ltd.
33 *
44 * This program is free software: you can redistribute it and/or modify it under
55 * the terms of the GNU Lesser General Public License version 3, as published by
@@ -14,32 +14,25 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−#ifndef DASHCOMMUNICATOR_H
18−#define DASHCOMMUNICATOR_H
17+#ifndef AVAILABLEDESKTOPAREA_H
18+#define AVAILABLEDESKTOPAREA_H
1919
20−// Qt
21−#include <QThread>
22−#include <QMutex>
20+#include <QQuickItem>
2321
24−class DashConnection;
22+/**
23+ @brief Used to inform qtmir/miral about the available desktop area of shell
2524
26−class DashCommunicator: public QThread
25+ So that qtmir/miral can take correct window management decisions.
26+ */
27+class AvailableDesktopArea : public QQuickItem
2728{
2829 Q_OBJECT
2930public:
30− explicit DashCommunicator(QObject *parent = 0);
31− ~DashCommunicator();
32−
33−public Q_SLOTS:
34− void setCurrentScope(int index, bool animate, bool isSwipe);
35−
31+ AvailableDesktopArea(QQuickItem *parent = nullptr);
3632protected:
37− void run() override;
38−
39−private:
40− DashConnection *m_dashConnection;
41− bool m_created;
42− QMutex m_mutex;
33+ void itemChange(ItemChange change, const ItemChangeData &value) override;
34+private Q_SLOTS:
35+ void updatePlatformWindowProperty();
4336};
4437
45−#endif
38+#endif // AVAILABLEDESKTOPAREA_H
plugins/WindowManager/CMakeLists.txt+14−2
@@ -1,14 +1,26 @@
11set(WINDOWMANAGER_SRC
2− TopLevelSurfaceList.cpp
2+ AvailableDesktopArea.cpp
3+ TopLevelWindowModel.cpp
4+ Window.cpp
35 WindowManagerPlugin.cpp
6+ WindowMargins.cpp
7+ InputMethodManager.cpp
48 ${APPLICATION_API_INCLUDEDIR}/unity/shell/application/ApplicationInfoInterface.h
59 ${APPLICATION_API_INCLUDEDIR}/unity/shell/application/Mir.h
610 ${APPLICATION_API_INCLUDEDIR}/unity/shell/application/MirSurfaceInterface.h
711 ${APPLICATION_API_INCLUDEDIR}/unity/shell/application/MirSurfaceListInterface.h
12+ ${APPLICATION_API_INCLUDEDIR}/unity/shell/application/SurfaceManagerInterface.h
813 )
914
15+add_definitions(-DWINDOWMANAGERQML_LIBRARY)
16+
17+include_directories(
18+ SYSTEM
19+ ${Qt5Gui_PRIVATE_INCLUDE_DIRS}
20+)
21+
1022add_library(windowmanager-qml SHARED ${WINDOWMANAGER_SRC})
1123
12−qt5_use_modules(windowmanager-qml Qml Quick Gui)
24+target_link_libraries(windowmanager-qml Qt5::Qml Qt5::Quick Qt5::Gui)
1325
1426add_unity8_plugin(WindowManager 0.1 WindowManager TARGETS windowmanager-qml)
plugins/WindowManager/InputMethodManager.cppnew file+56
@@ -0,0 +1,56 @@
1+/*
2+ * Copyright (C) 2019 UBports Foundation.
3+ * Author(s) Marius Gripsgard <marius@ubports.com>
4+ *
5+ * This program is free software: you can redistribute it and/or modify it under
6+ * the terms of the GNU Lesser General Public License version 3, as published by
7+ * the Free Software Foundation.
8+ *
9+ * This program is distributed in the hope that it will be useful, but WITHOUT
10+ * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
11+ * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12+ * Lesser General Public License for more details.
13+ *
14+ * You should have received a copy of the GNU Lesser General Public License
15+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
16+ */
17+
18+#include "InputMethodManager.h"
19+#include <QDebug>
20+
21+#include <unity/shell/application/MirSurfaceInterface.h>
22+
23+// local
24+#include "Window.h"
25+
26+Q_LOGGING_CATEGORY(INPUTMETHODMANAGER, "InputMethodManager", QtInfoMsg)
27+#define DEBUG_MSG qCDebug(INPUTMETHODMANAGER).nospace().noquote() << __func__
28+
29+namespace unityapi = unity::shell::application;
30+
31+InputMethodManager *InputMethodManager::instance()
32+{
33+ static InputMethodManager* inputMethod(new InputMethodManager());
34+ return inputMethod;
35+}
36+
37+InputMethodManager::InputMethodManager()
38+{
39+}
40+
41+void InputMethodManager::setWindow(Window* window)
42+{
43+ if (window == m_inputMethodWindow) {
44+ return;
45+ }
46+
47+ DEBUG_MSG << "(" << window << ")";
48+
49+ m_inputMethodWindow = window;
50+ Q_EMIT surfaceChanged(surface());
51+}
52+
53+unityapi::MirSurfaceInterface* InputMethodManager::surface() const
54+{
55+ return m_inputMethodWindow ? m_inputMethodWindow->surface() : nullptr;
56+}
plugins/WindowManager/InputMethodManager.hnew file+55
@@ -0,0 +1,55 @@
1+/*
2+ * Copyright (C) 2019 UBports Foundation.
3+ * Author(s) Marius Gripsgard <marius@ubports.com>
4+ *
5+ * This program is free software: you can redistribute it and/or modify it under
6+ * the terms of the GNU Lesser General Public License version 3, as published by
7+ * the Free Software Foundation.
8+ *
9+ * This program is distributed in the hope that it will be useful, but WITHOUT
10+ * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
11+ * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12+ * Lesser General Public License for more details.
13+ *
14+ * You should have received a copy of the GNU Lesser General Public License
15+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
16+ */
17+
18+#pragma once
19+
20+#include <QLoggingCategory>
21+#include <QObject>
22+
23+#include "WindowManagerGlobal.h"
24+
25+Q_DECLARE_LOGGING_CATEGORY(INPUTMETHODMANAGER)
26+
27+class Window;
28+
29+namespace unity {
30+ namespace shell {
31+ namespace application {
32+ class MirSurfaceInterface;
33+ }
34+ }
35+}
36+
37+class WINDOWMANAGERQML_EXPORT InputMethodManager : public QObject
38+{
39+ Q_OBJECT
40+ Q_PROPERTY(unity::shell::application::MirSurfaceInterface* surface READ surface NOTIFY surfaceChanged)
41+
42+public:
43+ InputMethodManager();
44+ static InputMethodManager* instance();
45+
46+ void setWindow(Window* window);
47+
48+Q_SIGNALS:
49+ void surfaceChanged(unity::shell::application::MirSurfaceInterface* inputMethodSurface);
50+
51+private:
52+ unity::shell::application::MirSurfaceInterface* surface() const;
53+
54+ Window* m_inputMethodWindow{nullptr};
55+};
plugins/WindowManager/TopLevelSurfaceList.cppdeleted−481
@@ -1,481 +0,0 @@
1−/*
2− * Copyright (C) 2016 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 "TopLevelSurfaceList.h"
18−
19−// unity-api
20−#include <unity/shell/application/ApplicationInfoInterface.h>
21−#include <unity/shell/application/MirSurfaceInterface.h>
22−#include <unity/shell/application/MirSurfaceListInterface.h>
23−
24−#include <QMetaObject>
25−
26−Q_LOGGING_CATEGORY(UNITY_TOPSURFACELIST, "unity.topsurfacelist", QtDebugMsg)
27−
28−#define DEBUG_MSG qCDebug(UNITY_TOPSURFACELIST).nospace().noquote() << __func__
29−
30−using namespace unity::shell::application;
31−
32−TopLevelSurfaceList::TopLevelSurfaceList(QObject *parent) :
33− QAbstractListModel(parent)
34−{
35− DEBUG_MSG << "()";
36−}
37−
38−TopLevelSurfaceList::~TopLevelSurfaceList()
39−{
40− DEBUG_MSG << "()";
41−}
42−
43−int TopLevelSurfaceList::rowCount(const QModelIndex &parent) const
44−{
45− return !parent.isValid() ? m_surfaceList.size() : 0;
46−}
47−
48−QVariant TopLevelSurfaceList::data(const QModelIndex& index, int role) const
49−{
50− if (index.row() < 0 || index.row() >= m_surfaceList.size())
51− return QVariant();
52−
53− if (role == SurfaceRole) {
54− MirSurfaceInterface *surface = m_surfaceList.at(index.row()).surface;
55− return QVariant::fromValue(surface);
56− } else if (role == ApplicationRole) {
57− return QVariant::fromValue(m_surfaceList.at(index.row()).application);
58− } else if (role == IdRole) {
59− return QVariant::fromValue(m_surfaceList.at(index.row()).id);
60− } else {
61− return QVariant();
62− }
63−}
64−
65−void TopLevelSurfaceList::raise(MirSurfaceInterface *surface)
66−{
67− if (!surface)
68− return;
69−
70− DEBUG_MSG << "(MirSurface[" << (void*)surface << "])";
71−
72− int i = indexOf(surface);
73− if (i != -1) {
74− raiseId(m_surfaceList.at(i).id);
75− }
76−}
77−
78−void TopLevelSurfaceList::appendPlaceholder(ApplicationInfoInterface *application)
79−{
80− DEBUG_MSG << "(" << application->appId() << ")";
81−
82− appendSurfaceHelper(nullptr, application);
83−}
84−
85−void TopLevelSurfaceList::appendSurface(MirSurfaceInterface *surface, ApplicationInfoInterface *application)
86−{
87− Q_ASSERT(surface != nullptr);
88−
89− bool filledPlaceholder = false;
90− for (int i = 0; i < m_surfaceList.count() && !filledPlaceholder; ++i) {
91− ModelEntry &entry = m_surfaceList[i];
92− if (entry.application == application && entry.surface == nullptr) {
93− entry.surface = surface;
94− connectSurface(surface);
95− DEBUG_MSG << " appId=" << application->appId() << " surface=" << surface
96− << ", filling out placeholder. after: " << toString();
97− Q_EMIT dataChanged(index(i) /* topLeft */, index(i) /* bottomRight */, QVector<int>() << SurfaceRole);
98− filledPlaceholder = true;
99− }
100− }
101−
102− if (!filledPlaceholder) {
103− DEBUG_MSG << " appId=" << application->appId() << " surface=" << surface << ", adding new row";
104− appendSurfaceHelper(surface, application);
105− }
106−}
107−
108−void TopLevelSurfaceList::appendSurfaceHelper(MirSurfaceInterface *surface, ApplicationInfoInterface *application)
109−{
110− if (m_modelState == IdleState) {
111− m_modelState = InsertingState;
112− beginInsertRows(QModelIndex(), m_surfaceList.size() /*first*/, m_surfaceList.size() /*last*/);
113− } else {
114− Q_ASSERT(m_modelState == ResettingState);
115− // No point in signaling anything if we're resetting the whole model
116− }
117−
118− int id = generateId();
119− m_surfaceList.append(ModelEntry(surface, application, id));
120− if (surface) {
121− connectSurface(surface);
122− }
123−
124− if (m_modelState == InsertingState) {
125− endInsertRows();
126− Q_EMIT countChanged();
127− Q_EMIT listChanged();
128− m_modelState = IdleState;
129− }
130−
131− DEBUG_MSG << " after " << toString();
132−}
133−
134−void TopLevelSurfaceList::connectSurface(MirSurfaceInterface *surface)
135−{
136− connect(surface, &MirSurfaceInterface::liveChanged, this, [this, surface](bool live){
137− if (!live) {
138− onSurfaceDied(surface);
139− }
140− });
141− connect(surface, &QObject::destroyed, this, [this, surface](){ this->onSurfaceDestroyed(surface); });
142−}
143−
144−void TopLevelSurfaceList::onSurfaceDied(MirSurfaceInterface *surface)
145−{
146− int i = indexOf(surface);
147− if (i == -1) {
148− return;
149− }
150−
151− auto application = m_surfaceList[i].application;
152−
153− // can't be starting if it already has a surface
154− Q_ASSERT(application->state() != ApplicationInfoInterface::Starting);
155−
156− if (application->state() == ApplicationInfoInterface::Running) {
157− m_surfaceList[i].removeOnceSurfaceDestroyed = true;
158− } else {
159− // assume it got killed by the out-of-memory daemon.
160− //
161− // So leave entry in the model and only remove its surface, so shell can display a screenshot
162− // in its place.
163− m_surfaceList[i].removeOnceSurfaceDestroyed = false;
164− }
165−}
166−
167−void TopLevelSurfaceList::onSurfaceDestroyed(MirSurfaceInterface *surface)
168−{
169− int i = indexOf(surface);
170− if (i == -1) {
171− return;
172− }
173−
174− if (m_surfaceList[i].removeOnceSurfaceDestroyed) {
175− removeAt(i);
176− } else {
177− m_surfaceList[i].surface = nullptr;
178− Q_EMIT dataChanged(index(i) /* topLeft */, index(i) /* bottomRight */, QVector<int>() << SurfaceRole);
179− DEBUG_MSG << " Removed surface from entry. After: " << toString();
180− }
181−}
182−
183−void TopLevelSurfaceList::removeAt(int index)
184−{
185− if (m_modelState == IdleState) {
186− beginRemoveRows(QModelIndex(), index, index);
187− m_modelState = RemovingState;
188− } else {
189− Q_ASSERT(m_modelState == ResettingState);
190− // No point in signaling anything if we're resetting the whole model
191− }
192−
193− m_surfaceList.removeAt(index);
194−
195− if (m_modelState == RemovingState) {
196− endRemoveRows();
197− Q_EMIT countChanged();
198− Q_EMIT listChanged();
199− m_modelState = IdleState;
200− }
201−
202− DEBUG_MSG << " after " << toString();
203−}
204−
205−int TopLevelSurfaceList::indexOf(MirSurfaceInterface *surface)
206−{
207− for (int i = 0; i < m_surfaceList.count(); ++i) {
208− if (m_surfaceList.at(i).surface == surface) {
209− return i;
210− }
211− }
212− return -1;
213−}
214−
215−void TopLevelSurfaceList::move(int from, int to)
216−{
217− if (from == to) return;
218− DEBUG_MSG << " from=" << from << " to=" << to;
219−
220− if (from >= 0 && from < m_surfaceList.size() && to >= 0 && to < m_surfaceList.size()) {
221− QModelIndex parent;
222− /* When moving an item down, the destination index needs to be incremented
223− by one, as explained in the documentation:
224− http://qt-project.org/doc/qt-5.0/qtcore/qabstractitemmodel.html#beginMoveRows */
225−
226− Q_ASSERT(m_modelState == IdleState);
227− m_modelState = MovingState;
228−
229− beginMoveRows(parent, from, from, parent, to + (to > from ? 1 : 0));
230− m_surfaceList.move(from, to);
231− endMoveRows();
232− Q_EMIT listChanged();
233−
234− m_modelState = IdleState;
235−
236− DEBUG_MSG << " after " << toString();
237− }
238−}
239−
240−MirSurfaceInterface *TopLevelSurfaceList::surfaceAt(int index) const
241−{
242− if (index >=0 && index < m_surfaceList.count()) {
243− return m_surfaceList[index].surface;
244− } else {
245− return nullptr;
246− }
247−}
248−
249−ApplicationInfoInterface *TopLevelSurfaceList::applicationAt(int index) const
250−{
251− if (index >=0 && index < m_surfaceList.count()) {
252− return m_surfaceList[index].application;
253− } else {
254− return nullptr;
255− }
256−}
257−
258−int TopLevelSurfaceList::idAt(int index) const
259−{
260− if (index >=0 && index < m_surfaceList.count()) {
261− return m_surfaceList[index].id;
262− } else {
263− return 0;
264− }
265−}
266−
267−int TopLevelSurfaceList::indexForId(int id) const
268−{
269− for (int i = 0; i < m_surfaceList.count(); ++i) {
270− if (m_surfaceList[i].id == id) {
271− return i;
272− }
273− }
274− return -1;
275−}
276−
277−void TopLevelSurfaceList::doRaiseId(int id)
278−{
279− int fromIndex = indexForId(id);
280− if (fromIndex != -1) {
281− move(fromIndex, 0 /* toIndex */);
282− }
283−}
284−
285−void TopLevelSurfaceList::raiseId(int id)
286−{
287− if (m_modelState == IdleState) {
288− DEBUG_MSG << "(id=" << id << ") - do it now.";
289− doRaiseId(id);
290− } else {
291− DEBUG_MSG << "(id=" << id << ") - Model busy (modelState=" << m_modelState << "). Try again in the next event loop.";
292− // The model has just signalled some change. If we have a Repeater responding to this update, it will get nuts
293− // if we perform yet another model change straight away.
294− //
295− // A bad sympton of this problem is a Repeater.itemAt(index) call returning null event though Repeater.count says
296− // the index is definitely within bounds.
297− QMetaObject::invokeMethod(this, "raiseId", Qt::QueuedConnection, Q_ARG(int, id));
298− }
299−}
300−
301−int TopLevelSurfaceList::generateId()
302−{
303− int id = m_nextId;
304− m_nextId = nextFreeId(m_nextId + 1);
305− Q_EMIT nextIdChanged();
306− return id;
307−}
308−
309−int TopLevelSurfaceList::nextFreeId(int candidateId)
310−{
311− if (candidateId > m_maxId) {
312− return nextFreeId(1);
313− } else {
314− if (indexForId(candidateId) == -1) {
315− // it's indeed free
316− return candidateId;
317− } else {
318− return nextFreeId(candidateId + 1);
319− }
320− }
321−}
322−
323−QString TopLevelSurfaceList::toString()
324−{
325− QString str;
326− for (int i = 0; i < m_surfaceList.count(); ++i) {
327− auto item = m_surfaceList.at(i);
328−
329− QString itemStr = QString("(index=%1,appId=%2,surface=0x%3,id=%4)")
330− .arg(i)
331− .arg(item.application->appId())
332− .arg((qintptr)item.surface, 0, 16)
333− .arg(item.id);
334−
335− if (i > 0) {
336− str.append(",");
337− }
338− str.append(itemStr);
339− }
340− return str;
341−}
342−
343−void TopLevelSurfaceList::addApplication(ApplicationInfoInterface *application)
344−{
345− DEBUG_MSG << "(" << application->appId() << ")";
346− Q_ASSERT(!m_applications.contains(application));
347− m_applications.append(application);
348−
349− MirSurfaceListInterface *surfaceList = application->surfaceList();
350−
351− if (application->state() != ApplicationInfoInterface::Stopped) {
352− if (surfaceList->count() == 0) {
353− appendPlaceholder(application);
354− } else {
355− for (int i = 0; i < surfaceList->count(); ++i) {
356− appendSurface(surfaceList->get(i), application);
357− }
358− }
359− }
360−
361− connect(surfaceList, &QAbstractItemModel::rowsInserted, this,
362− [this, application, surfaceList](const QModelIndex & /*parent*/, int first, int last)
363− {
364− for (int i = last; i >= first; --i) {
365− this->appendSurface(surfaceList->get(i), application);
366− }
367− });
368−}
369−
370−void TopLevelSurfaceList::removeApplication(ApplicationInfoInterface *application)
371−{
372− DEBUG_MSG << "(" << application->appId() << ")";
373− Q_ASSERT(m_applications.contains(application));
374−
375− MirSurfaceListInterface *surfaceList = application->surfaceList();
376−
377− disconnect(surfaceList, 0, this, 0);
378−
379− Q_ASSERT(m_modelState == IdleState);
380− m_modelState = RemovingState;
381−
382− int i = 0;
383− while (i < m_surfaceList.count()) {
384− if (m_surfaceList.at(i).application == application) {
385− beginRemoveRows(QModelIndex(), i, i);
386− m_surfaceList.removeAt(i);
387− endRemoveRows();
388− Q_EMIT countChanged();
389− Q_EMIT listChanged();
390− } else {
391− ++i;
392− }
393− }
394−
395− m_modelState = IdleState;
396−
397− DEBUG_MSG << " after " << toString();
398−
399− m_applications.removeAll(application);
400−}
401−
402−QAbstractListModel *TopLevelSurfaceList::applicationsModel() const
403−{
404− return m_applicationsModel;
405−}
406−
407−void TopLevelSurfaceList::setApplicationsModel(QAbstractListModel* value)
408−{
409− if (m_applicationsModel == value) {
410− return;
411− }
412−
413− DEBUG_MSG << "(" << value << ")";
414−
415− Q_ASSERT(m_modelState == IdleState);
416− m_modelState = ResettingState;
417−
418− beginResetModel();
419−
420− if (m_applicationsModel) {
421− m_surfaceList.clear();
422− m_applications.clear();
423− disconnect(m_applicationsModel, 0, this, 0);
424− }
425−
426− m_applicationsModel = value;
427−
428− if (m_applicationsModel) {
429− findApplicationRole();
430−
431− connect(m_applicationsModel, &QAbstractItemModel::rowsInserted,
432− this, [this](const QModelIndex &/*parent*/, int first, int last) {
433− for (int i = first; i <= last; ++i) {
434− auto application = getApplicationFromModelAt(i);
435− addApplication(application);
436− }
437− });
438−
439− connect(m_applicationsModel, &QAbstractItemModel::rowsAboutToBeRemoved,
440− this, [this](const QModelIndex &/*parent*/, int first, int last) {
441− for (int i = first; i <= last; ++i) {
442− auto application = getApplicationFromModelAt(i);
443− removeApplication(application);
444− }
445− });
446−
447− for (int i = 0; i < m_applicationsModel->rowCount(); ++i) {
448− auto application = getApplicationFromModelAt(i);
449− addApplication(application);
450− }
451− }
452−
453− endResetModel();
454− m_modelState = IdleState;
455−}
456−
457−ApplicationInfoInterface *TopLevelSurfaceList::getApplicationFromModelAt(int index)
458−{
459− QModelIndex modelIndex = m_applicationsModel->index(index);
460−
461− QVariant variant = m_applicationsModel->data(modelIndex, m_applicationRole);
462−
463− // variant.value<ApplicationInfoInterface*>() returns null for some reason.
464− return static_cast<ApplicationInfoInterface*>(variant.value<QObject*>());
465−}
466−
467−void TopLevelSurfaceList::findApplicationRole()
468−{
469− QHash<int, QByteArray> namesHash = m_applicationsModel->roleNames();
470−
471− m_applicationRole = -1;
472− for (auto i = namesHash.begin(); i != namesHash.end() && m_applicationRole == -1; ++i) {
473− if (i.value() == "application") {
474− m_applicationRole = i.key();
475− }
476− }
477−
478− if (m_applicationRole == -1) {
479− qFatal("TopLevelSurfaceList: applicationsModel must have a \"application\" role.");
480− }
481−}
plugins/WindowManager/TopLevelSurfaceList.hdeleted−223
@@ -1,223 +0,0 @@
1−/*
2− * Copyright (C) 2016 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 TOPLEVELSURFACELIST_H
18−#define TOPLEVELSURFACELIST_H
19−
20−#include <QAbstractListModel>
21−#include <QList>
22−#include <QLoggingCategory>
23−
24−Q_DECLARE_LOGGING_CATEGORY(UNITY_TOPSURFACELIST)
25−
26−namespace unity {
27− namespace shell {
28− namespace application {
29− class ApplicationInfoInterface;
30− class MirSurfaceInterface;
31− }
32− }
33−}
34−
35−/**
36− * @brief A model of top-level surfaces
37− *
38− * It's an abstraction of top-level application windows.
39− *
40− * When an entry first appears, it normaly doesn't have a surface yet, meaning that the application is
41− * still starting up. A shell should then display a splash screen or saved screenshot of the application
42− * until its surface comes up.
43− *
44− * As applications can have multiple surfaces and you can also have entries without surfaces at all,
45− * the only way to unambiguously refer to an entry in this model is through its id.
46− */
47−class TopLevelSurfaceList : public QAbstractListModel
48−{
49−
50− Q_OBJECT
51−
52− /**
53− * @brief A list model of applications.
54− *
55− * It's expected to have a role called "application" which returns a ApplicationInfoInterface
56− */
57− Q_PROPERTY(QAbstractListModel* applicationsModel READ applicationsModel
58− WRITE setApplicationsModel
59− NOTIFY applicationsModelChanged)
60−
61− /**
62− * @brief Number of top-level surfaces in this model
63− *
64− * This is the same as rowCount, added in order to keep compatibility with QML ListModels.
65− */
66− Q_PROPERTY(int count READ rowCount NOTIFY countChanged)
67−
68− /**
69− The id to be used on the next entry created
70− Useful for tests
71− */
72− Q_PROPERTY(int nextId READ nextId NOTIFY nextIdChanged)
73−public:
74−
75− /**
76− * @brief The Roles supported by the model
77− *
78− * SurfaceRole - A MirSurfaceInterface. It will be null if the application is still starting up
79− * ApplicationRole - An ApplicationInfoInterface
80− * IdRole - A unique identifier for this entry. Useful to unambiguosly track elements as they move around in the list
81− */
82− enum Roles {
83− SurfaceRole = Qt::UserRole,
84− ApplicationRole = Qt::UserRole + 1,
85− IdRole = Qt::UserRole + 2,
86− };
87−
88− explicit TopLevelSurfaceList(QObject *parent = nullptr);
89− virtual ~TopLevelSurfaceList();
90−
91− // QAbstractItemModel methods
92− int rowCount(const QModelIndex &parent = QModelIndex()) const override;
93− QVariant data(const QModelIndex& index, int role) const override;
94− QHash<int, QByteArray> roleNames() const override {
95− QHash<int, QByteArray> roleNames { {SurfaceRole, "surface"},
96− {ApplicationRole, "application"},
97− {IdRole, "id"} };
98− return roleNames;
99− }
100−
101− int nextId() const { return m_nextId; }
102−
103− QAbstractListModel *applicationsModel() const;
104− void setApplicationsModel(QAbstractListModel*);
105−
106−public Q_SLOTS:
107− /**
108− * @brief Returns the surface at the given index
109− *
110− * It will be a nullptr if the application is still starting up and thus hasn't yet created
111− * and drawn into a surface.
112− */
113− unity::shell::application::MirSurfaceInterface *surfaceAt(int index) const;
114−
115− /**
116− * @brief Returns the application at the given index
117− */
118− unity::shell::application::ApplicationInfoInterface *applicationAt(int index) const;
119−
120− /**
121− * @brief Returns the unique id of the element at the given index
122− */
123− int idAt(int index) const;
124−
125− /**
126− * @brief Returns the index where the row with the given id is located
127− *
128− * Returns -1 if there's no row with the given id.
129− */
130− int indexForId(int id) const;
131−
132− /**
133− * @brief Raises the row with the given id to index 0
134− */
135− void raiseId(int id);
136−
137− void doRaiseId(int id);
138−
139−Q_SIGNALS:
140− void countChanged();
141−
142− /**
143− * @brief Emitted when the list changes
144− *
145− * Emitted when model gains an element, loses an element or when elements exchange positions.
146− */
147− void listChanged();
148−
149− void nextIdChanged();
150−
151− void applicationsModelChanged();
152−
153−private:
154− void addApplication(unity::shell::application::ApplicationInfoInterface *application);
155− void removeApplication(unity::shell::application::ApplicationInfoInterface *application);
156−
157− int indexOf(unity::shell::application::MirSurfaceInterface *surface);
158− void raise(unity::shell::application::MirSurfaceInterface *surface);
159− void move(int from, int to);
160− void appendSurfaceHelper(unity::shell::application::MirSurfaceInterface *surface,
161− unity::shell::application::ApplicationInfoInterface *application);
162− void connectSurface(unity::shell::application::MirSurfaceInterface *surface);
163− int generateId();
164− int nextFreeId(int candidateId);
165− QString toString();
166− void onSurfaceDestroyed(unity::shell::application::MirSurfaceInterface *surface);
167− void onSurfaceDied(unity::shell::application::MirSurfaceInterface *surface);
168− void removeAt(int index);
169− void findApplicationRole();
170−
171− unity::shell::application::ApplicationInfoInterface *getApplicationFromModelAt(int index);
172−
173− /*
174− Placeholder for a future surface from a starting or running application.
175− Enables shell to give immediate feedback to the user by showing, eg,
176− a splash screen.
177−
178− It's a model row containing a null surface and the given application.
179− */
180− void appendPlaceholder(unity::shell::application::ApplicationInfoInterface *application);
181−
182− /*
183− Adds a model row with the given surface and application
184−
185− Alternatively, if a placeholder exists for the given application it's
186− filled with the given surface instead.
187− */
188− void appendSurface(unity::shell::application::MirSurfaceInterface *surface,
189− unity::shell::application::ApplicationInfoInterface *application);
190−
191− struct ModelEntry {
192− ModelEntry(unity::shell::application::MirSurfaceInterface *surface, unity::shell::application::ApplicationInfoInterface *application, int id)
193− : surface(surface), application(application), id(id) {}
194− unity::shell::application::MirSurfaceInterface *surface;
195− unity::shell::application::ApplicationInfoInterface *application;
196− int id;
197− bool removeOnceSurfaceDestroyed{false};
198− };
199−
200− QList<ModelEntry> m_surfaceList;
201− int m_nextId{1};
202− static const int m_maxId{1000000};
203−
204− // applications that are being monitored
205− QList<unity::shell::application::ApplicationInfoInterface *> m_applications;
206−
207− QAbstractListModel* m_applicationsModel{nullptr};
208− int m_applicationRole{-1};
209−
210− enum ModelState {
211− IdleState,
212− InsertingState,
213− RemovingState,
214− MovingState,
215− ResettingState
216− };
217− ModelState m_modelState{IdleState};
218−};
219−
220−Q_DECLARE_METATYPE(TopLevelSurfaceList*)
221−Q_DECLARE_METATYPE(QAbstractListModel*)
222−
223−#endif // TOPLEVELSURFACELIST_H
plugins/WindowManager/TopLevelWindowModel.cppnew file+782
@@ -0,0 +1,782 @@
1+/*
2+ * Copyright (C) 2016-2017 Canonical, Ltd.
3+ * Copyright 2019 UBports Foundation
4+ *
5+ * This program is free software: you can redistribute it and/or modify it under
6+ * the terms of the GNU Lesser General Public License version 3, as published by
7+ * the Free Software Foundation.
8+ *
9+ * This program is distributed in the hope that it will be useful, but WITHOUT
10+ * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
11+ * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12+ * Lesser General Public License for more details.
13+ *
14+ * You should have received a copy of the GNU Lesser General Public License
15+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
16+ */
17+
18+#include "TopLevelWindowModel.h"
19+
20+// unity-api
21+#include <unity/shell/application/ApplicationInfoInterface.h>
22+#include <unity/shell/application/ApplicationManagerInterface.h>
23+#include <unity/shell/application/MirSurfaceInterface.h>
24+#include <unity/shell/application/MirSurfaceListInterface.h>
25+#include <unity/shell/application/SurfaceManagerInterface.h>
26+
27+// Qt
28+#include <QGuiApplication>
29+#include <QDebug>
30+
31+// local
32+#include "Window.h"
33+#include "InputMethodManager.h"
34+
35+Q_LOGGING_CATEGORY(TOPLEVELWINDOWMODEL, "toplevelwindowmodel", QtInfoMsg)
36+
37+#define DEBUG_MSG qCDebug(TOPLEVELWINDOWMODEL).nospace().noquote() << __func__
38+#define INFO_MSG qCInfo(TOPLEVELWINDOWMODEL).nospace().noquote() << __func__
39+
40+namespace unityapi = unity::shell::application;
41+
42+TopLevelWindowModel::TopLevelWindowModel()
43+ : m_nullWindow(createNullWindow()),
44+ m_surfaceManagerBusy(false)
45+{
46+ connect(m_nullWindow, &Window::focusedChanged, this, [this] {
47+ Q_EMIT rootFocusChanged();
48+ });
49+}
50+
51+void TopLevelWindowModel::setApplicationManager(unityapi::ApplicationManagerInterface* value)
52+{
53+ if (m_applicationManager == value) {
54+ return;
55+ }
56+
57+ DEBUG_MSG << "(" << value << ")";
58+
59+ Q_ASSERT(m_modelState == IdleState);
60+ m_modelState = ResettingState;
61+
62+ beginResetModel();
63+
64+ if (m_applicationManager) {
65+ m_windowModel.clear();
66+ disconnect(m_applicationManager, 0, this, 0);
67+ }
68+
69+ m_applicationManager = value;
70+
71+ if (m_applicationManager) {
72+ connect(m_applicationManager, &QAbstractItemModel::rowsInserted,
73+ this, [this](const QModelIndex &/*parent*/, int first, int last) {
74+ for (int i = first; i <= last; ++i) {
75+ auto application = m_applicationManager->get(i);
76+ addApplication(application);
77+ }
78+ });
79+
80+ connect(m_applicationManager, &QAbstractItemModel::rowsAboutToBeRemoved,
81+ this, [this](const QModelIndex &/*parent*/, int first, int last) {
82+ for (int i = first; i <= last; ++i) {
83+ auto application = m_applicationManager->get(i);
84+ removeApplication(application);
85+ }
86+ });
87+
88+ for (int i = 0; i < m_applicationManager->rowCount(); ++i) {
89+ auto application = m_applicationManager->get(i);
90+ addApplication(application);
91+ }
92+ }
93+
94+ endResetModel();
95+ m_modelState = IdleState;
96+}
97+
98+void TopLevelWindowModel::setSurfaceManager(unityapi::SurfaceManagerInterface *surfaceManager)
99+{
100+ if (surfaceManager == m_surfaceManager) {
101+ return;
102+ }
103+
104+ DEBUG_MSG << "(" << surfaceManager << ")";
105+
106+ if (m_surfaceManager) {
107+ disconnect(m_surfaceManager, 0, this, 0);
108+ }
109+
110+ m_surfaceManager = surfaceManager;
111+
112+ if (m_surfaceManager) {
113+ connect(m_surfaceManager, &unityapi::SurfaceManagerInterface::surfaceCreated, this, &TopLevelWindowModel::onSurfaceCreated);
114+ connect(m_surfaceManager, &unityapi::SurfaceManagerInterface::surfacesRaised, this, &TopLevelWindowModel::onSurfacesRaised);
115+ connect(m_surfaceManager, &unityapi::SurfaceManagerInterface::modificationsStarted, this, &TopLevelWindowModel::onModificationsStarted);
116+ connect(m_surfaceManager, &unityapi::SurfaceManagerInterface::modificationsEnded, this, &TopLevelWindowModel::onModificationsEnded);
117+ }
118+
119+ Q_EMIT surfaceManagerChanged(m_surfaceManager);
120+}
121+
122+void TopLevelWindowModel::addApplication(unityapi::ApplicationInfoInterface *application)
123+{
124+ DEBUG_MSG << "(" << application->appId() << ")";
125+
126+ if (application->state() != unityapi::ApplicationInfoInterface::Stopped && application->surfaceList()->count() == 0) {
127+ prependPlaceholder(application);
128+ }
129+}
130+
131+void TopLevelWindowModel::removeApplication(unityapi::ApplicationInfoInterface *application)
132+{
133+ DEBUG_MSG << "(" << application->appId() << ")";
134+
135+ Q_ASSERT(m_modelState == IdleState);
136+
137+ int i = 0;
138+ while (i < m_windowModel.count()) {
139+ if (m_windowModel.at(i).application == application) {
140+ deleteAt(i);
141+ } else {
142+ ++i;
143+ }
144+ }
145+}
146+
147+void TopLevelWindowModel::prependPlaceholder(unityapi::ApplicationInfoInterface *application)
148+{
149+ INFO_MSG << "(" << application->appId() << ")";
150+
151+ prependSurfaceHelper(nullptr, application);
152+}
153+
154+void TopLevelWindowModel::prependSurface(unityapi::MirSurfaceInterface *surface, unityapi::ApplicationInfoInterface *application)
155+{
156+ Q_ASSERT(surface != nullptr);
157+
158+ connectSurface(surface);
159+
160+ bool filledPlaceholder = false;
161+ for (int i = 0; i < m_windowModel.count() && !filledPlaceholder; ++i) {
162+ ModelEntry &entry = m_windowModel[i];
163+ if (entry.application == application && entry.window->surface() == nullptr) {
164+ entry.window->setSurface(surface);
165+ INFO_MSG << " appId=" << application->appId() << " surface=" << surface
166+ << ", filling out placeholder. after: " << toString();
167+ filledPlaceholder = true;
168+ }
169+ }
170+
171+ if (!filledPlaceholder) {
172+ INFO_MSG << " appId=" << application->appId() << " surface=" << surface << ", adding new row";
173+ prependSurfaceHelper(surface, application);
174+ }
175+}
176+
177+void TopLevelWindowModel::prependSurfaceHelper(unityapi::MirSurfaceInterface *surface, unityapi::ApplicationInfoInterface *application)
178+{
179+
180+ Window *window = createWindow(surface);
181+
182+ connect(window, &Window::stateChanged, this, [=](Mir::State newState) {
183+ if (newState == Mir::HiddenState) {
184+ // Comply, removing it from our model. Just as if it didn't exist anymore.
185+ removeAt(indexForId(window->id()));
186+ } else {
187+ if (indexForId(window->id()) == -1) {
188+ // was probably hidden before. put it back on the list
189+ auto *application = m_applicationManager->findApplicationWithSurface(window->surface());
190+ Q_ASSERT(application);
191+ prependWindow(window, application);
192+ }
193+ }
194+ });
195+
196+ prependWindow(window, application);
197+
198+ // Activate the newly-prepended window.
199+ window->activate();
200+
201+ INFO_MSG << " after " << toString();
202+}
203+
204+void TopLevelWindowModel::prependWindow(Window *window, unityapi::ApplicationInfoInterface *application)
205+{
206+ if (m_modelState == IdleState) {
207+ m_modelState = InsertingState;
208+ beginInsertRows(QModelIndex(), 0 /*first*/, 0 /*last*/);
209+ } else {
210+ Q_ASSERT(m_modelState == ResettingState);
211+ // No point in signaling anything if we're resetting the whole model
212+ }
213+
214+ m_windowModel.prepend(ModelEntry(window, application));
215+
216+ if (m_modelState == InsertingState) {
217+ endInsertRows();
218+ Q_EMIT countChanged();
219+ Q_EMIT listChanged();
220+ m_modelState = IdleState;
221+ }
222+}
223+
224+void TopLevelWindowModel::connectWindow(Window *window)
225+{
226+ connect(window, &Window::focusRequested, this, [this, window]() {
227+ if (!window->surface()) {
228+ activateEmptyWindow(window);
229+ }
230+ });
231+
232+ connect(window, &Window::focusedChanged, this, [this, window](bool focused) {
233+ if (window->surface()) {
234+ // Condense changes to the focused window
235+ // eg: Do focusedWindow=A to focusedWindow=B instead of
236+ // focusedWindow=A to focusedWindow=null to focusedWindow=B
237+ if (focused) {
238+ Q_ASSERT(m_newlyFocusedWindow == nullptr);
239+ m_focusedWindowChanged = true;
240+ m_newlyFocusedWindow = window;
241+ } else if (m_focusedWindow == window) {
242+ m_focusedWindowChanged = true;
243+ } else {
244+ // don't clear the focused window if you were not there in the first place
245+ // happens when a filled window gets replaced with an empty one (no surface) as the focused window.
246+ }
247+ }
248+ });
249+
250+ connect(window, &Window::closeRequested, this, [this, window]() {
251+ if (!window->surface()) {
252+ // do things ourselves as miral doesn't know about this window
253+ int id = window->id();
254+ int index = indexForId(id);
255+ bool focusOther = false;
256+ Q_ASSERT(index >= 0);
257+ if (window->focused()) {
258+ focusOther = true;
259+ }
260+ m_windowModel[index].application->close();
261+ if (focusOther) {
262+ activateTopMostWindowWithoutId(id);
263+ }
264+ }
265+ });
266+
267+ connect(window, &Window::emptyWindowActivated, this, [this, window]() {
268+ activateEmptyWindow(window);
269+ });
270+
271+ connect(window, &Window::liveChanged, this, [this, window](bool isAlive) {
272+ if (!isAlive && window->state() == Mir::HiddenState) {
273+ // Hidden windows are not in the model. So just delete it right away.
274+ delete window;
275+ }
276+ });
277+}
278+
279+void TopLevelWindowModel::activateEmptyWindow(Window *window)
280+{
281+ Q_ASSERT(!window->surface());
282+ DEBUG_MSG << "(" << window << ")";
283+
284+ // miral doesn't know about empty windows (ie, windows that are not backed up by MirSurfaces)
285+ // So we have to activate them ourselves (instead of asking SurfaceManager to do it for us).
286+
287+ window->setFocused(true);
288+ raiseId(window->id());
289+ Window *previousWindow = m_focusedWindow;
290+ setFocusedWindow(window);
291+ if (previousWindow && previousWindow->surface() && previousWindow->surface()->focused()) {
292+ m_surfaceManager->activate(nullptr);
293+ }
294+}
295+
296+void TopLevelWindowModel::connectSurface(unityapi::MirSurfaceInterface *surface)
297+{
298+ connect(surface, &unityapi::MirSurfaceInterface::liveChanged, this, [this, surface](bool live){
299+ if (!live) {
300+ onSurfaceDied(surface);
301+ }
302+ });
303+ connect(surface, &QObject::destroyed, this, [this, surface](){ this->onSurfaceDestroyed(surface); });
304+}
305+
306+void TopLevelWindowModel::onSurfaceDied(unityapi::MirSurfaceInterface *surface)
307+{
308+ if (surface->type() == Mir::InputMethodType) {
309+ removeInputMethodWindow();
310+ return;
311+ }
312+
313+ int i = indexOf(surface);
314+ if (i == -1) {
315+ return;
316+ }
317+
318+ auto application = m_windowModel[i].application;
319+
320+ DEBUG_MSG << " application->name()=" << application->name()
321+ << " application->state()=" << application->state();
322+
323+ if (application->state() == unityapi::ApplicationInfoInterface::Running
324+ || application->state() == unityapi::ApplicationInfoInterface::Starting) {
325+ m_windowModel[i].removeOnceSurfaceDestroyed = true;
326+ } else {
327+ // assume it got killed by the out-of-memory daemon.
328+ //
329+ // So leave entry in the model and only remove its surface, so shell can display a screenshot
330+ // in its place.
331+ m_windowModel[i].removeOnceSurfaceDestroyed = false;
332+ }
333+}
334+
335+void TopLevelWindowModel::onSurfaceDestroyed(unityapi::MirSurfaceInterface *surface)
336+{
337+ int i = indexOf(surface);
338+ if (i == -1) {
339+ return;
340+ }
341+
342+ if (m_windowModel[i].removeOnceSurfaceDestroyed) {
343+ deleteAt(i);
344+ } else {
345+ auto window = m_windowModel[i].window;
346+ window->setSurface(nullptr);
347+ window->setFocused(false);
348+ INFO_MSG << " Removed surface from entry. After: " << toString();
349+ }
350+}
351+
352+Window *TopLevelWindowModel::createWindow(unityapi::MirSurfaceInterface *surface)
353+{
354+ int id = m_nextId.fetchAndAddAcquire(1);
355+ return createWindowWithId(surface, id);
356+}
357+
358+Window *TopLevelWindowModel::createNullWindow()
359+{
360+ return createWindowWithId(nullptr, 0);
361+}
362+
363+Window *TopLevelWindowModel::createWindowWithId(unityapi::MirSurfaceInterface *surface, int id)
364+{
365+ Window *qmlWindow = new Window(id, this);
366+ connectWindow(qmlWindow);
367+ if (surface) {
368+ qmlWindow->setSurface(surface);
369+ }
370+ return qmlWindow;
371+}
372+
373+void TopLevelWindowModel::onSurfaceCreated(unityapi::MirSurfaceInterface *surface)
374+{
375+ DEBUG_MSG << "(" << surface << ")";
376+
377+ if (surface->parentSurface()) {
378+ // Wrap it in a Window so that we keep focusedWindow() up to date.
379+ Window *window = createWindow(surface);
380+ connect(surface, &QObject::destroyed, window, [=](){
381+ window->setSurface(nullptr);
382+ window->deleteLater();
383+ });
384+ } else {
385+ if (surface->type() == Mir::InputMethodType) {
386+ connectSurface(surface);
387+ setInputMethodWindow(createWindow(surface));
388+ } else {
389+ auto *application = m_applicationManager->findApplicationWithSurface(surface);
390+ if (application) {
391+ if (surface->state() == Mir::HiddenState) {
392+ // Ignore it until it's finally shown
393+ connect(surface, &unityapi::MirSurfaceInterface::stateChanged, this, [=](Mir::State newState) {
394+ Q_ASSERT(newState != Mir::HiddenState);
395+ disconnect(surface, &unityapi::MirSurfaceInterface::stateChanged, this, 0);
396+ prependSurface(surface, application);
397+ });
398+ } else {
399+ prependSurface(surface, application);
400+ }
401+ } else {
402+ // Must be a prompt session. No need to do add it as a prompt surface is not top-level.
403+ // It will show up in the ApplicationInfoInterface::promptSurfaceList of some application.
404+ // Still wrap it in a Window though, so that we keep focusedWindow() up to date.
405+ Window *promptWindow = createWindow(surface);
406+ connect(surface, &QObject::destroyed, promptWindow, [=](){
407+ promptWindow->setSurface(nullptr);
408+ promptWindow->deleteLater();
409+ });
410+ }
411+ }
412+ }
413+}
414+
415+void TopLevelWindowModel::deleteAt(int index)
416+{
417+ auto window = m_windowModel[index].window;
418+
419+ removeAt(index);
420+
421+ window->setSurface(nullptr);
422+
423+ delete window;
424+}
425+
426+void TopLevelWindowModel::removeAt(int index)
427+{
428+ if (m_modelState == IdleState) {
429+ beginRemoveRows(QModelIndex(), index, index);
430+ m_modelState = RemovingState;
431+ } else {
432+ Q_ASSERT(m_modelState == ResettingState);
433+ // No point in signaling anything if we're resetting the whole model
434+ }
435+
436+ auto window = m_windowModel[index].window;
437+
438+ if (!window->surface()) {
439+ window->setFocused(false);
440+ }
441+
442+ m_windowModel.removeAt(index);
443+
444+ if (m_modelState == RemovingState) {
445+ endRemoveRows();
446+ Q_EMIT countChanged();
447+ Q_EMIT listChanged();
448+ m_modelState = IdleState;
449+ }
450+
451+ if (m_focusedWindow == window) {
452+ setFocusedWindow(nullptr);
453+ }
454+
455+ if (m_previousWindow == window) {
456+ m_previousWindow = nullptr;
457+ }
458+
459+ if (m_closingAllApps) {
460+ if (m_windowModel.isEmpty()) {
461+ Q_EMIT closedAllWindows();
462+ }
463+ }
464+
465+ INFO_MSG << " after " << toString() << " apps left " << m_windowModel.count();
466+}
467+
468+void TopLevelWindowModel::setInputMethodWindow(Window *window)
469+{
470+ if (m_inputMethodWindow) {
471+ qWarning("Multiple Input Method Surfaces created, removing the old one!");
472+ delete m_inputMethodWindow;
473+ }
474+ m_inputMethodWindow = window;
475+ Q_EMIT inputMethodSurfaceChanged(m_inputMethodWindow->surface());
476+ InputMethodManager::instance()->setWindow(window);
477+}
478+
479+void TopLevelWindowModel::removeInputMethodWindow()
480+{
481+ if (m_inputMethodWindow) {
482+ delete m_inputMethodWindow;
483+ m_inputMethodWindow = nullptr;
484+ Q_EMIT inputMethodSurfaceChanged(nullptr);
485+ InputMethodManager::instance()->setWindow(nullptr);
486+ }
487+}
488+
489+void TopLevelWindowModel::onSurfacesRaised(const QVector<unityapi::MirSurfaceInterface*> &surfaces)
490+{
491+ DEBUG_MSG << "(" << surfaces << ")";
492+ const int raiseCount = surfaces.size();
493+ for (int i = 0; i < raiseCount; i++) {
494+ int fromIndex = findIndexOf(surfaces[i]);
495+ if (fromIndex != -1) {
496+ move(fromIndex, 0);
497+ }
498+ }
499+}
500+
501+int TopLevelWindowModel::rowCount(const QModelIndex &/*parent*/) const
502+{
503+ return m_windowModel.count();
504+}
505+
506+QVariant TopLevelWindowModel::data(const QModelIndex& index, int role) const
507+{
508+ if (index.row() < 0 || index.row() >= m_windowModel.size())
509+ return QVariant();
510+
511+ if (role == WindowRole) {
512+ Window *window = m_windowModel.at(index.row()).window;
513+ return QVariant::fromValue(window);
514+ } else if (role == ApplicationRole) {
515+ return QVariant::fromValue(m_windowModel.at(index.row()).application);
516+ } else {
517+ return QVariant();
518+ }
519+}
520+
521+int TopLevelWindowModel::findIndexOf(const unityapi::MirSurfaceInterface *surface) const
522+{
523+ for (int i=0; i<m_windowModel.count(); i++) {
524+ if (m_windowModel[i].window->surface() == surface) {
525+ return i;
526+ }
527+ }
528+ return -1;
529+}
530+
531+QString TopLevelWindowModel::toString()
532+{
533+ QString str;
534+ for (int i = 0; i < m_windowModel.count(); ++i) {
535+ auto item = m_windowModel.at(i);
536+
537+ QString itemStr = QString("(index=%1,appId=%2,surface=0x%3,id=%4)")
538+ .arg(QString::number(i),
539+ item.application->appId(),
540+ QString::number((qintptr)item.window->surface(), 16),
541+ QString::number(item.window->id()));
542+
543+ if (i > 0) {
544+ str.append(",");
545+ }
546+ str.append(itemStr);
547+ }
548+ return str;
549+}
550+
551+int TopLevelWindowModel::indexOf(unityapi::MirSurfaceInterface *surface)
552+{
553+ for (int i = 0; i < m_windowModel.count(); ++i) {
554+ if (m_windowModel.at(i).window->surface() == surface) {
555+ return i;
556+ }
557+ }
558+ return -1;
559+}
560+
561+int TopLevelWindowModel::indexForId(int id) const
562+{
563+ for (int i = 0; i < m_windowModel.count(); ++i) {
564+ if (m_windowModel[i].window->id() == id) {
565+ return i;
566+ }
567+ }
568+ return -1;
569+}
570+
571+Window *TopLevelWindowModel::windowAt(int index) const
572+{
573+ if (index >=0 && index < m_windowModel.count()) {
574+ return m_windowModel[index].window;
575+ } else {
576+ return nullptr;
577+ }
578+}
579+
580+unityapi::MirSurfaceInterface *TopLevelWindowModel::surfaceAt(int index) const
581+{
582+ if (index >=0 && index < m_windowModel.count()) {
583+ return m_windowModel[index].window->surface();
584+ } else {
585+ return nullptr;
586+ }
587+}
588+
589+unityapi::ApplicationInfoInterface *TopLevelWindowModel::applicationAt(int index) const
590+{
591+ if (index >=0 && index < m_windowModel.count()) {
592+ return m_windowModel[index].application;
593+ } else {
594+ return nullptr;
595+ }
596+}
597+
598+int TopLevelWindowModel::idAt(int index) const
599+{
600+ if (index >=0 && index < m_windowModel.count()) {
601+ return m_windowModel[index].window->id();
602+ } else {
603+ return 0;
604+ }
605+}
606+
607+void TopLevelWindowModel::raiseId(int id)
608+{
609+ if (m_modelState == IdleState) {
610+ DEBUG_MSG << "(id=" << id << ") - do it now.";
611+ doRaiseId(id);
612+ } else {
613+ DEBUG_MSG << "(id=" << id << ") - Model busy (modelState=" << m_modelState << "). Try again in the next event loop.";
614+ // The model has just signalled some change. If we have a Repeater responding to this update, it will get nuts
615+ // if we perform yet another model change straight away.
616+ //
617+ // A bad sympton of this problem is a Repeater.itemAt(index) call returning null event though Repeater.count says
618+ // the index is definitely within bounds.
619+ QMetaObject::invokeMethod(this, "raiseId", Qt::QueuedConnection, Q_ARG(int, id));
620+ }
621+}
622+
623+void TopLevelWindowModel::doRaiseId(int id)
624+{
625+ int fromIndex = indexForId(id);
626+ // can't raise something that doesn't exist or that it's already on top
627+ if (fromIndex != -1 && fromIndex != 0) {
628+ auto surface = m_windowModel[fromIndex].window->surface();
629+ if (surface) {
630+ m_surfaceManager->raise(surface);
631+ } else {
632+ // move it ourselves. Since there's no mir::scene::Surface/miral::Window, there's nothing
633+ // miral can do about it.
634+ move(fromIndex, 0);
635+ }
636+ }
637+}
638+
639+void TopLevelWindowModel::setFocusedWindow(Window *window)
640+{
641+ if (window != m_focusedWindow) {
642+ INFO_MSG << "(" << window << ")";
643+
644+ m_previousWindow = m_focusedWindow;
645+
646+ m_focusedWindow = window;
647+ Q_EMIT focusedWindowChanged(m_focusedWindow);
648+
649+ if (m_previousWindow && m_previousWindow->focused() && !m_previousWindow->surface()) {
650+ // do it ourselves. miral doesn't know about this window
651+ m_previousWindow->setFocused(false);
652+ }
653+ }
654+
655+ // Reset
656+ m_pendingActivation = false;
657+}
658+
659+unityapi::MirSurfaceInterface* TopLevelWindowModel::inputMethodSurface() const
660+{
661+ return m_inputMethodWindow ? m_inputMethodWindow->surface() : nullptr;
662+}
663+
664+Window* TopLevelWindowModel::focusedWindow() const
665+{
666+ return m_focusedWindow;
667+}
668+
669+void TopLevelWindowModel::move(int from, int to)
670+{
671+ if (from == to) return;
672+ DEBUG_MSG << " from=" << from << " to=" << to;
673+
674+ if (from >= 0 && from < m_windowModel.size() && to >= 0 && to < m_windowModel.size()) {
675+ QModelIndex parent;
676+ /* When moving an item down, the destination index needs to be incremented
677+ by one, as explained in the documentation:
678+ http://qt-project.org/doc/qt-5.0/qtcore/qabstractitemmodel.html#beginMoveRows */
679+
680+ Q_ASSERT(m_modelState == IdleState);
681+ m_modelState = MovingState;
682+
683+ beginMoveRows(parent, from, from, parent, to + (to > from ? 1 : 0));
684+#if QT_VERSION < QT_VERSION_CHECK(5, 6, 0)
685+ const auto &window = m_windowModel.takeAt(from);
686+ m_windowModel.insert(to, window);
687+#else
688+ m_windowModel.move(from, to);
689+#endif
690+ endMoveRows();
691+
692+ Q_EMIT listChanged();
693+ m_modelState = IdleState;
694+
695+ INFO_MSG << " after " << toString();
696+ }
697+}
698+void TopLevelWindowModel::onModificationsStarted()
699+{
700+ m_surfaceManagerBusy = true;
701+}
702+
703+void TopLevelWindowModel::onModificationsEnded()
704+{
705+ if (m_focusedWindowChanged) {
706+ setFocusedWindow(m_newlyFocusedWindow);
707+ }
708+ // reset
709+ m_focusedWindowChanged = false;
710+ m_newlyFocusedWindow = nullptr;
711+ m_surfaceManagerBusy = false;
712+}
713+
714+void TopLevelWindowModel::activateTopMostWindowWithoutId(int forbiddenId)
715+{
716+ DEBUG_MSG << "(" << forbiddenId << ")";
717+
718+ for (int i = 0; i < m_windowModel.count(); ++i) {
719+ Window *window = m_windowModel[i].window;
720+ if (window->id() != forbiddenId) {
721+ window->activate();
722+ break;
723+ }
724+ }
725+}
726+
727+void TopLevelWindowModel::closeAllWindows()
728+{
729+ m_closingAllApps = true;
730+ for (auto win : m_windowModel) {
731+ win.window->close();
732+ }
733+
734+ // This is done after the for loop in the unlikely event that
735+ // an app starts in between this
736+ if (m_windowModel.isEmpty()) {
737+ Q_EMIT closedAllWindows();
738+ }
739+}
740+
741+bool TopLevelWindowModel::rootFocus()
742+{
743+ return !m_nullWindow->focused();
744+}
745+
746+void TopLevelWindowModel::setRootFocus(bool focus)
747+{
748+ INFO_MSG << "(" << focus << "), surfaceManagerBusy is " << m_surfaceManagerBusy;
749+
750+ if (m_surfaceManagerBusy) {
751+ // Something else is probably being focused already, let's not add to
752+ // the noise.
753+ return;
754+ }
755+
756+ if (focus) {
757+ // Give focus back to previous focused window, only if null window is focused.
758+ // If null window is not focused, a different app had taken the focus and we
759+ // should repect that, or if a pendingActivation is going on.
760+ if (m_previousWindow && !m_previousWindow->focused() && !m_pendingActivation &&
761+ m_nullWindow == m_focusedWindow && m_previousWindow != m_nullWindow) {
762+ m_previousWindow->activate();
763+ } else if (!m_pendingActivation) {
764+ // The previous window does not exist any more, focus top window.
765+ activateTopMostWindowWithoutId(-1);
766+ }
767+ } else {
768+ if (!m_nullWindow->focused()) {
769+ m_nullWindow->activate();
770+ }
771+ }
772+}
773+
774+// Pending Activation will block refocus of previous focused window
775+// this is needed since surface activation with miral is async,
776+// and activation of placeholder is sync. This causes a race condition
777+// between placeholder and prev window. This results in prev window
778+// gets focused, as it will always be later than the placeholder.
779+void TopLevelWindowModel::pendingActivation()
780+{
781+ m_pendingActivation = true;
782+}
plugins/WindowManager/TopLevelWindowModel.hnew file+308
@@ -0,0 +1,308 @@
1+/*
2+ * Copyright (C) 2016-2017 Canonical, Ltd.
3+ * Copyright 2019 UBports Foundation
4+ *
5+ * This program is free software: you can redistribute it and/or modify it under
6+ * the terms of the GNU Lesser General Public License version 3, as published by
7+ * the Free Software Foundation.
8+ *
9+ * This program is distributed in the hope that it will be useful, but WITHOUT
10+ * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
11+ * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12+ * Lesser General Public License for more details.
13+ *
14+ * You should have received a copy of the GNU Lesser General Public License
15+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
16+ */
17+
18+#ifndef TOPLEVELWINDOWMODEL_H
19+#define TOPLEVELWINDOWMODEL_H
20+
21+#include <QAbstractListModel>
22+#include <QAtomicInteger>
23+#include <QLoggingCategory>
24+
25+#include "WindowManagerGlobal.h"
26+
27+Q_DECLARE_LOGGING_CATEGORY(TOPLEVELWINDOWMODEL)
28+
29+class Window;
30+
31+namespace unity {
32+ namespace shell {
33+ namespace application {
34+ class ApplicationInfoInterface;
35+ class ApplicationManagerInterface;
36+ class MirSurfaceInterface;
37+ class SurfaceManagerInterface;
38+ }
39+ }
40+}
41+
42+/**
43+ * @brief A model of top-level surfaces
44+ *
45+ * It's an abstraction of top-level application windows.
46+ *
47+ * When an entry first appears, it normaly doesn't have a surface yet, meaning that the application is
48+ * still starting up. A shell should then display a splash screen or saved screenshot of the application
49+ * until its surface comes up.
50+ *
51+ * As applications can have multiple surfaces and you can also have entries without surfaces at all,
52+ * the only way to unambiguously refer to an entry in this model is through its id.
53+ */
54+class WINDOWMANAGERQML_EXPORT TopLevelWindowModel : public QAbstractListModel
55+{
56+ Q_OBJECT
57+
58+ /**
59+ * @brief Number of top-level surfaces in this model
60+ *
61+ * This is the same as rowCount, added in order to keep compatibility with QML ListModels.
62+ */
63+ Q_PROPERTY(int count READ rowCount NOTIFY countChanged)
64+
65+ /**
66+ * @brief The input method surface, if any
67+ *
68+ * The surface of a onscreen keyboard (akak "virtual keyboard") would be kept here and not in the model itself.
69+ */
70+ Q_PROPERTY(unity::shell::application::MirSurfaceInterface* inputMethodSurface READ inputMethodSurface NOTIFY inputMethodSurfaceChanged)
71+
72+ /**
73+ * @brief The currently focused window, if any
74+ */
75+ Q_PROPERTY(Window* focusedWindow READ focusedWindow NOTIFY focusedWindowChanged)
76+
77+ Q_PROPERTY(unity::shell::application::SurfaceManagerInterface* surfaceManager
78+ READ surfaceManager
79+ WRITE setSurfaceManager
80+ NOTIFY surfaceManagerChanged)
81+
82+ Q_PROPERTY(unity::shell::application::ApplicationManagerInterface* applicationManager
83+ READ applicationManager
84+ WRITE setApplicationManager
85+ NOTIFY applicationManagerChanged)
86+
87+ /**
88+ The id to be used on the next entry created
89+ Useful for tests
90+ */
91+ Q_PROPERTY(int nextId READ nextId)
92+
93+
94+ /**
95+ * @brief Sets whether a user Window or "nothing" should be focused
96+ *
97+ * This implementation of TLWM must have something focused. However, the
98+ * user may wish to have nothing in some cases - for example, when they
99+ * minimize all their windows on the desktop or unfocus the app they're
100+ * using by clicking the background or indicators.
101+ *
102+ * Unsetting rootFocus effectively focuses "nothing" by setting up a Window
103+ * that has no displayable Surfaces and bringing it into focus.
104+ *
105+ * Setting rootFocus attempts to focus the Window which was focused last -
106+ * unless another app is attempting to gain focus (as determined by
107+ * pendingActivation) and that's why we got rootFocus.
108+ *
109+ * If the previously-focused Window was closed before rootFocus was set,
110+ * the next available window will be focused.
111+ */
112+ Q_PROPERTY(bool rootFocus READ rootFocus WRITE setRootFocus NOTIFY rootFocusChanged)
113+
114+public:
115+ /**
116+ * @brief The Roles supported by the model
117+ *
118+ * WindowRole - A Window.
119+ * ApplicationRole - An ApplicationInfoInterface
120+ */
121+ enum Roles {
122+ WindowRole = Qt::UserRole,
123+ ApplicationRole = Qt::UserRole + 1,
124+ };
125+
126+ TopLevelWindowModel();
127+
128+ // From QAbstractItemModel
129+ int rowCount(const QModelIndex &parent = QModelIndex()) const override;
130+ QVariant data(const QModelIndex& index, int role) const override;
131+ QHash<int, QByteArray> roleNames() const override {
132+ QHash<int, QByteArray> roleNames { {WindowRole, "window"},
133+ {ApplicationRole, "application"} };
134+ return roleNames;
135+ }
136+
137+ // Own API
138+
139+ unity::shell::application::MirSurfaceInterface* inputMethodSurface() const;
140+ Window* focusedWindow() const;
141+
142+ unity::shell::application::ApplicationManagerInterface *applicationManager() const { return m_applicationManager; }
143+ void setApplicationManager(unity::shell::application::ApplicationManagerInterface*);
144+
145+ unity::shell::application::SurfaceManagerInterface *surfaceManager() const { return m_surfaceManager; }
146+ void setSurfaceManager(unity::shell::application::SurfaceManagerInterface*);
147+
148+ int nextId() const { return m_nextId.load(); }
149+
150+public:
151+ /**
152+ * @brief Returns the surface at the given index
153+ *
154+ * It will be a nullptr if the application is still starting up and thus hasn't yet created
155+ * and drawn into a surface.
156+ *
157+ * Same as windowAt(index).surface()
158+ */
159+ Q_INVOKABLE unity::shell::application::MirSurfaceInterface *surfaceAt(int index) const;
160+
161+ /**
162+ * @brief Returns the window at the given index
163+ *
164+ * Will always be valid
165+ */
166+ Q_INVOKABLE Window *windowAt(int index) const;
167+
168+ /**
169+ * @brief Returns the application at the given index
170+ */
171+ Q_INVOKABLE unity::shell::application::ApplicationInfoInterface *applicationAt(int index) const;
172+
173+ /**
174+ * @brief Returns the unique id of the element at the given index
175+ */
176+ Q_INVOKABLE int idAt(int index) const;
177+
178+ /**
179+ * @brief Returns the index where the row with the given id is located
180+ *
181+ * Returns -1 if there's no row with the given id.
182+ */
183+ Q_INVOKABLE int indexForId(int id) const;
184+
185+ /**
186+ * @brief Raises the row with the given id to the top of the window stack (index == count-1)
187+ */
188+ Q_INVOKABLE void raiseId(int id);
189+
190+ /**
191+ * @brief Closes all windows, emits closedAllWindows when done
192+ */
193+ Q_INVOKABLE void closeAllWindows();
194+
195+ /**
196+ * @brief Sets pending activation flag
197+ */
198+ Q_INVOKABLE void pendingActivation();
199+
200+ void setRootFocus(bool focus);
201+ bool rootFocus();
202+
203+Q_SIGNALS:
204+ void countChanged();
205+ void inputMethodSurfaceChanged(unity::shell::application::MirSurfaceInterface* inputMethodSurface);
206+ void focusedWindowChanged(Window *focusedWindow);
207+ void applicationManagerChanged(unity::shell::application::ApplicationManagerInterface*);
208+ void surfaceManagerChanged(unity::shell::application::SurfaceManagerInterface*);
209+
210+ /**
211+ * @brief Emitted when the list changes
212+ *
213+ * Emitted when model gains an element, loses an element or when elements exchange positions.
214+ */
215+ void listChanged();
216+
217+ void closedAllWindows();
218+
219+ void rootFocusChanged();
220+
221+private Q_SLOTS:
222+ void onSurfaceCreated(unity::shell::application::MirSurfaceInterface *surface);
223+ void onSurfacesRaised(const QVector<unity::shell::application::MirSurfaceInterface*> &surfaces);
224+
225+ void onModificationsStarted();
226+ void onModificationsEnded();
227+
228+private:
229+ void doRaiseId(int id);
230+ int generateId();
231+ int nextFreeId(int candidateId, const int latestId);
232+ int nextId(int id) const;
233+ QString toString();
234+ int indexOf(unity::shell::application::MirSurfaceInterface *surface);
235+
236+ void setInputMethodWindow(Window *window);
237+ void setFocusedWindow(Window *window);
238+ void removeInputMethodWindow();
239+ int findIndexOf(const unity::shell::application::MirSurfaceInterface *surface) const;
240+ void deleteAt(int index);
241+ void removeAt(int index);
242+
243+ void addApplication(unity::shell::application::ApplicationInfoInterface *application);
244+ void removeApplication(unity::shell::application::ApplicationInfoInterface *application);
245+
246+ void prependPlaceholder(unity::shell::application::ApplicationInfoInterface *application);
247+ void prependSurface(unity::shell::application::MirSurfaceInterface *surface,
248+ unity::shell::application::ApplicationInfoInterface *application);
249+ void prependSurfaceHelper(unity::shell::application::MirSurfaceInterface *surface,
250+ unity::shell::application::ApplicationInfoInterface *application);
251+ void prependWindow(Window *window, unity::shell::application::ApplicationInfoInterface *application);
252+
253+ void connectWindow(Window *window);
254+ void connectSurface(unity::shell::application::MirSurfaceInterface *surface);
255+
256+ void onSurfaceDied(unity::shell::application::MirSurfaceInterface *surface);
257+ void onSurfaceDestroyed(unity::shell::application::MirSurfaceInterface *surface);
258+
259+ void move(int from, int to);
260+
261+ void activateEmptyWindow(Window *window);
262+
263+ void activateTopMostWindowWithoutId(int forbiddenId);
264+
265+ Window *createWindow(unity::shell::application::MirSurfaceInterface *surface);
266+ Window *createWindowWithId(unity::shell::application::MirSurfaceInterface *surface, int id);
267+ Window *createNullWindow();
268+
269+ struct ModelEntry {
270+ ModelEntry() {}
271+ ModelEntry(Window *window,
272+ unity::shell::application::ApplicationInfoInterface *application)
273+ : window(window), application(application) {}
274+ Window *window{nullptr};
275+ unity::shell::application::ApplicationInfoInterface *application{nullptr};
276+ bool removeOnceSurfaceDestroyed{false};
277+ };
278+
279+ QVector<ModelEntry> m_windowModel;
280+ Window* m_inputMethodWindow{nullptr};
281+ Window* m_focusedWindow{nullptr};
282+ Window* m_nullWindow;
283+ Window* m_previousWindow{nullptr};
284+ bool m_pendingActivation;
285+
286+ QAtomicInteger<int> m_nextId{1};
287+
288+ unity::shell::application::ApplicationManagerInterface* m_applicationManager{nullptr};
289+ unity::shell::application::SurfaceManagerInterface *m_surfaceManager{nullptr};
290+ bool m_surfaceManagerBusy;
291+
292+ enum ModelState {
293+ IdleState,
294+ InsertingState,
295+ RemovingState,
296+ MovingState,
297+ ResettingState
298+ };
299+ ModelState m_modelState{IdleState};
300+
301+ // Valid between modificationsStarted and modificationsEnded
302+ bool m_focusedWindowChanged{false};
303+ Window *m_newlyFocusedWindow{nullptr};
304+
305+ bool m_closingAllApps{false};
306+};
307+
308+#endif // TOPLEVELWINDOWMODEL_H
plugins/WindowManager/Window.cppnew file+277
@@ -0,0 +1,277 @@
1+/*
2+ * Copyright (C) 2016-2017 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 "Window.h"
18+
19+// unity-api
20+#include <unity/shell/application/MirSurfaceInterface.h>
21+
22+#include <QQmlEngine>
23+#include <QTextStream>
24+
25+namespace unityapi = unity::shell::application;
26+
27+Q_LOGGING_CATEGORY(UNITY_WINDOW, "unity.window", QtWarningMsg)
28+
29+#define DEBUG_MSG qCDebug(UNITY_WINDOW).nospace() << qPrintable(toString()) << "::" << __func__
30+#define WARNING_MSG qCWarning(UNITY_WINDOW).nospace() << qPrintable(toString()) << "::" << __func__
31+
32+Window::Window(int id, QObject *parent)
33+ : QObject(parent)
34+ , m_id(id)
35+{
36+ DEBUG_MSG << "()";
37+ QQmlEngine::setObjectOwnership(this, QQmlEngine::CppOwnership);
38+}
39+
40+Window::~Window()
41+{
42+ DEBUG_MSG << "()";
43+}
44+
45+QPoint Window::position() const
46+{
47+ return m_position;
48+}
49+
50+QPoint Window::requestedPosition() const
51+{
52+ return m_requestedPosition;
53+}
54+
55+void Window::setRequestedPosition(const QPoint &value)
56+{
57+ m_positionRequested = true;
58+ if (value != m_requestedPosition) {
59+ m_requestedPosition = value;
60+ Q_EMIT requestedPositionChanged(m_requestedPosition);
61+ if (m_surface) {
62+ m_surface->setRequestedPosition(value);
63+ } else {
64+ // fake-miral: always comply
65+ m_position = m_requestedPosition;
66+ Q_EMIT positionChanged(m_position);
67+ }
68+ }
69+}
70+
71+bool Window::allowClientResize() const
72+{
73+ return m_allowClientResize;
74+}
75+
76+void Window::setAllowClientResize(bool value)
77+{
78+ if (value != m_allowClientResize) {
79+ DEBUG_MSG << "("<<value<<")";
80+ m_allowClientResize = value;
81+ if (m_surface) {
82+ m_surface->setAllowClientResize(value);
83+ }
84+ Q_EMIT allowClientResizeChanged(m_allowClientResize);
85+ }
86+}
87+
88+Mir::State Window::state() const
89+{
90+ return m_state;
91+}
92+
93+bool Window::focused() const
94+{
95+ return m_focused;
96+}
97+
98+bool Window::confinesMousePointer() const
99+{
100+ if (m_surface) {
101+ return m_surface->confinesMousePointer();
102+ } else {
103+ return false;
104+ }
105+}
106+
107+int Window::id() const
108+{
109+ return m_id;
110+}
111+
112+unityapi::MirSurfaceInterface* Window::surface() const
113+{
114+ return m_surface;
115+}
116+
117+void Window::requestState(Mir::State state)
118+{
119+ m_stateRequested = true;
120+ if (m_surface) {
121+ m_surface->requestState(state);
122+ } else if (m_state != state) {
123+ m_state = state;
124+ Q_EMIT stateChanged(m_state);
125+ }
126+}
127+
128+void Window::close()
129+{
130+ if (m_surface) {
131+ m_surface->close();
132+ } else {
133+ Q_EMIT closeRequested();
134+ }
135+}
136+
137+void Window::activate()
138+{
139+ DEBUG_MSG << "()";
140+ if (m_surface) {
141+ m_surface->activate();
142+ } else {
143+ Q_EMIT emptyWindowActivated();
144+ }
145+}
146+
147+void Window::setSurface(unityapi::MirSurfaceInterface *surface)
148+{
149+ DEBUG_MSG << "(" << surface << ")";
150+ if (m_surface) {
151+ disconnect(m_surface, 0, this, 0);
152+ }
153+
154+ m_surface = surface;
155+
156+ if (m_surface) {
157+ connect(surface, &unityapi::MirSurfaceInterface::focusRequested, this, [this]() {
158+ Q_EMIT focusRequested();
159+ });
160+
161+ connect(surface, &unityapi::MirSurfaceInterface::closeRequested, this, &Window::closeRequested);
162+
163+ connect(surface, &unityapi::MirSurfaceInterface::positionChanged, this, [this]() {
164+ updatePosition();
165+ });
166+
167+ connect(surface, &unityapi::MirSurfaceInterface::stateChanged, this, [this]() {
168+ updateState();
169+ });
170+
171+ connect(surface, &unityapi::MirSurfaceInterface::focusedChanged, this, [this]() {
172+ updateFocused();
173+ });
174+
175+ connect(surface, &unityapi::MirSurfaceInterface::allowClientResizeChanged, this, [this]() {
176+ if (m_surface->allowClientResize() != m_allowClientResize) {
177+ m_allowClientResize = m_surface->allowClientResize();
178+ Q_EMIT allowClientResizeChanged(m_allowClientResize);
179+ }
180+ });
181+
182+ connect(surface, &unityapi::MirSurfaceInterface::liveChanged, this, &Window::liveChanged);
183+
184+ connect(surface, &QObject::destroyed, this, [this]() {
185+ setSurface(nullptr);
186+ });
187+
188+ // Surface should never be focused at this point!
189+ if (m_surface->focused()) {
190+ WARNING_MSG << "Inital surface is focused!";
191+ }
192+
193+ // bring it up to speed
194+ if (m_focused) {
195+ m_surface->activate();
196+ }
197+ if (m_positionRequested) {
198+ m_surface->setRequestedPosition(m_requestedPosition);
199+ }
200+ if (m_stateRequested && m_surface->state() == Mir::RestoredState) {
201+ m_surface->requestState(m_state);
202+ }
203+ m_surface->setAllowClientResize(m_allowClientResize);
204+
205+ // and sync with surface
206+ updatePosition();
207+ updateState();
208+ updateFocused();
209+ }
210+
211+ Q_EMIT surfaceChanged(surface);
212+}
213+
214+void Window::updatePosition()
215+{
216+ if (m_surface->position() != m_position) {
217+ m_position = m_surface->position();
218+ Q_EMIT positionChanged(m_position);
219+ }
220+}
221+
222+void Window::updateState()
223+{
224+ if (m_surface->state() != m_state) {
225+ m_state = m_surface->state();
226+ Q_EMIT stateChanged(m_state);
227+ }
228+}
229+
230+void Window::updateFocused()
231+{
232+ if (m_surface->focused() != m_focused) {
233+ m_focused = m_surface->focused();
234+ Q_EMIT focusedChanged(m_focused);
235+ }
236+}
237+
238+void Window::setFocused(bool value)
239+{
240+ if (value != m_focused) {
241+ DEBUG_MSG << "(" << value << ")";
242+ m_focused = value;
243+ Q_EMIT focusedChanged(m_focused);
244+ // when we have a surface we get focus changes from updateFocused() instead
245+ Q_ASSERT(!m_surface);
246+ }
247+}
248+
249+QString Window::toString() const
250+{
251+ QString result;
252+ {
253+ QTextStream stream(&result);
254+ stream << "Window["<<(void*)this<<", id="<<id()<<", ";
255+ if (surface()) {
256+ stream << "MirSurface["<<(void*)surface()<<",\""<<surface()->name()<<"\"]";
257+ } else {
258+ stream << "null";
259+ }
260+ stream << "]";
261+ }
262+ return result;
263+}
264+
265+QDebug operator<<(QDebug dbg, const Window *window)
266+{
267+ QDebugStateSaver saver(dbg);
268+ dbg.nospace();
269+
270+ if (window) {
271+ dbg << qPrintable(window->toString());
272+ } else {
273+ dbg << (void*)(window);
274+ }
275+
276+ return dbg;
277+}
plugins/WindowManager/Window.hnew file+176
@@ -0,0 +1,176 @@
1+/*
2+ * Copyright (C) 2016-2017 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 UNITY_WINDOW_H
18+#define UNITY_WINDOW_H
19+
20+#include <QLoggingCategory>
21+#include <QObject>
22+#include <QPoint>
23+
24+// Unity API
25+#include <unity/shell/application/Mir.h>
26+
27+#include "WindowManagerGlobal.h"
28+
29+namespace unity {
30+ namespace shell {
31+ namespace application {
32+ class MirSurfaceInterface;
33+ }
34+ }
35+}
36+
37+Q_DECLARE_LOGGING_CATEGORY(UNITY_WINDOW)
38+
39+/**
40+ @brief A slightly higher concept than MirSurface
41+
42+ A Window exists before its MirSurface gets created (for splashscreen purposes)
43+ and might also hang around after the backing surface is gone (In case the application
44+ was killed to free up memory, as it should still remain in the window list since the user
45+ did not explicitly close it).
46+ */
47+class WINDOWMANAGERQML_EXPORT Window : public QObject
48+{
49+ Q_OBJECT
50+
51+ /**
52+ * @brief Position of the current surface buffer, in pixels.
53+ */
54+ Q_PROPERTY(QPoint position READ position NOTIFY positionChanged)
55+
56+ /**
57+ * @brief Requested position of the current surface buffer, in pixels.
58+ */
59+ Q_PROPERTY(QPoint requestedPosition READ requestedPosition WRITE setRequestedPosition NOTIFY requestedPositionChanged)
60+
61+ /**
62+ * @brief State of the surface
63+ */
64+ Q_PROPERTY(Mir::State state READ state NOTIFY stateChanged)
65+
66+ /**
67+ * @brief Whether the surface is focused
68+ *
69+ * It will be true if this surface is MirFocusControllerInterface::focusedSurface
70+ */
71+ Q_PROPERTY(bool focused READ focused NOTIFY focusedChanged)
72+
73+ /**
74+ * @brief Whether the surface wants to confine the mouse pointer within its boundaries
75+ *
76+ * If true, the surface doesn't want the mouse pointer to leave its boundaries while it's focused.
77+ */
78+ Q_PROPERTY(bool confinesMousePointer READ confinesMousePointer NOTIFY confinesMousePointerChanged)
79+
80+ /**
81+ * @brief A unique identifier for this window.
82+ * Useful for telling windows apart in a list model as they get moved around
83+ */
84+ Q_PROPERTY(int id READ id CONSTANT)
85+
86+ /**
87+ * @brief Surface backing up this window
88+ * It might be null if a surface hasn't been created yet (application is starting up) or if
89+ * the corresponding application has been killed (but can still get restarted to continue from
90+ * where it left)
91+ */
92+ Q_PROPERTY(unity::shell::application::MirSurfaceInterface* surface READ surface NOTIFY surfaceChanged)
93+
94+ /**
95+ * @brief Whether to comply to resize requests coming from the client side
96+ *
97+ * It's true by default
98+ */
99+ Q_PROPERTY(bool allowClientResize READ allowClientResize WRITE setAllowClientResize NOTIFY allowClientResizeChanged)
100+
101+public:
102+ Window(int id, QObject *parent = nullptr);
103+ virtual ~Window();
104+ QPoint position() const;
105+ QPoint requestedPosition() const;
106+ void setRequestedPosition(const QPoint &);
107+ Mir::State state() const;
108+ bool focused() const;
109+ bool confinesMousePointer() const;
110+ int id() const;
111+ unity::shell::application::MirSurfaceInterface* surface() const;
112+
113+ void setSurface(unity::shell::application::MirSurfaceInterface *surface);
114+ void setFocused(bool value);
115+
116+ bool allowClientResize() const;
117+ void setAllowClientResize(bool);
118+
119+ QString toString() const;
120+
121+public Q_SLOTS:
122+ /**
123+ * @brief Requests a change to the specified state
124+ */
125+ void requestState(Mir::State state);
126+
127+ /**
128+ * @brief Sends a close request
129+ *
130+ */
131+ void close();
132+
133+ /**
134+ * @brief Focuses and raises the window
135+ */
136+ void activate();
137+
138+Q_SIGNALS:
139+ void closeRequested();
140+ void emptyWindowActivated();
141+
142+ void positionChanged(QPoint position);
143+ void requestedPositionChanged(QPoint position);
144+ void stateChanged(Mir::State value);
145+ void focusedChanged(bool value);
146+ void confinesMousePointerChanged(bool value);
147+ void surfaceChanged(unity::shell::application::MirSurfaceInterface *surface);
148+ void allowClientResizeChanged(bool value);
149+ void liveChanged(bool value);
150+
151+ /**
152+ * @brief Emitted when focus for this window is requested by an external party
153+ */
154+ void focusRequested();
155+
156+private:
157+ void updatePosition();
158+ void updateState();
159+ void updateFocused();
160+
161+ QPoint m_position;
162+ QPoint m_requestedPosition;
163+ bool m_positionRequested{false};
164+ bool m_focused{false};
165+ int m_id;
166+ Mir::State m_state{Mir::RestoredState};
167+ bool m_stateRequested{false};
168+ unity::shell::application::MirSurfaceInterface *m_surface{nullptr};
169+
170+ bool m_allowClientResize{true};
171+};
172+
173+QDebug operator<<(QDebug dbg, const Window *window);
174+
175+Q_DECLARE_METATYPE(Window*)
176+#endif // UNITY_WINDOW_H
tests/mocks/LightDM/IntegratedLightDM/QLightDM/Greeter → plugins/WindowManager/WindowManagerGlobal.hrenamed+8−2
@@ -1,5 +1,5 @@
11/*
2− * Copyright (C) 2014 Canonical, Ltd.
2+ * Copyright (C) 2017 Canonical, Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -14,4 +14,10 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−#include "../liblightdm/Greeter.h"
17+#include <QtCore/QtGlobal>
18+
19+#if defined(WINDOWMANAGERQML_LIBRARY)
20+# define WINDOWMANAGERQML_EXPORT Q_DECL_EXPORT
21+#else
22+# define WINDOWMANAGERQML_EXPORT Q_DECL_IMPORT
23+#endif
plugins/WindowManager/WindowManagerPlugin.cpp+19−3
@@ -1,5 +1,5 @@
11/*
2− * Copyright (C) 2016 Canonical, Ltd.
2+ * Copyright (C) 2016-2017 Canonical, Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -16,13 +16,29 @@
1616
1717#include "WindowManagerPlugin.h"
1818
19−#include "TopLevelSurfaceList.h"
19+#include "AvailableDesktopArea.h"
20+#include "TopLevelWindowModel.h"
21+#include "Window.h"
22+#include "WindowMargins.h"
23+#include "InputMethodManager.h"
2024
2125#include <QtQml>
2226
27+QObject *inputMethodManager(QQmlEngine *engine, QJSEngine *scriptEngine)
28+{
29+ Q_UNUSED(engine)
30+ Q_UNUSED(scriptEngine)
31+ return InputMethodManager::instance();
32+}
33+
2334void WindowManagerPlugin::registerTypes(const char *uri)
2435{
25− qmlRegisterType<TopLevelSurfaceList>(uri, 0, 1, "TopLevelSurfaceList");
36+ qmlRegisterType<AvailableDesktopArea>(uri, 1, 0, "AvailableDesktopArea");
37+ qmlRegisterType<TopLevelWindowModel>(uri, 1, 0, "TopLevelWindowModel");
38+ qmlRegisterType<WindowMargins>(uri, 1, 0, "WindowMargins");
39+ qmlRegisterSingletonType<InputMethodManager>(uri, 1, 0, "InputMethodManager", inputMethodManager);
40+
41+ qRegisterMetaType<Window*>("Window*");
2642
2743 qRegisterMetaType<QAbstractListModel*>("QAbstractListModel*");
2844}
plugins/WindowManager/WindowMargins.cppnew file+74
@@ -0,0 +1,74 @@
1+/*
2+ * Copyright (C) 2017 Canonical, Ltd.
3+ *
4+ * This program is free software: you can redistribute it and/or modify it under
5+ * the terms of the GNU Lesser General Public License version 3, as published by
6+ * the Free Software Foundation.
7+ *
8+ * This program is distributed in the hope that it will be useful, but WITHOUT
9+ * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
10+ * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11+ * Lesser General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU Lesser General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+#include "WindowMargins.h"
18+
19+#include <QGuiApplication>
20+#include <QQuickWindow>
21+#include <qpa/qplatformnativeinterface.h>
22+
23+void WindowMargins::setNormal(QRectF value)
24+{
25+ if (m_normal == value) {
26+ return;
27+ }
28+
29+ m_normal = value;
30+
31+ if (window()) {
32+ QPlatformNativeInterface *nativeInterface = QGuiApplication::platformNativeInterface();
33+ nativeInterface->setWindowProperty(window()->handle(), "normalWindowMargins", QVariant(m_normal.toRect()));
34+ }
35+
36+ Q_EMIT normalChanged();
37+}
38+
39+QRectF WindowMargins::normal() const
40+{
41+ return m_normal;
42+}
43+
44+void WindowMargins::setDialog(QRectF value)
45+{
46+ if (m_dialog == value) {
47+ return;
48+ }
49+
50+ m_dialog = value;
51+
52+ if (window()) {
53+ QPlatformNativeInterface *nativeInterface = QGuiApplication::platformNativeInterface();
54+ nativeInterface->setWindowProperty(window()->handle(), "dialogWindowMargins", QVariant(m_dialog.toRect()));
55+ }
56+
57+ Q_EMIT dialogChanged();
58+}
59+
60+QRectF WindowMargins::dialog() const
61+{
62+ return m_dialog;
63+}
64+
65+void WindowMargins::itemChange(ItemChange change, const ItemChangeData &data)
66+{
67+ if (change == ItemSceneChange && data.window != nullptr) {
68+ QPlatformNativeInterface *nativeInterface = QGuiApplication::platformNativeInterface();
69+ if (!m_normal.isNull()) {
70+ nativeInterface->setWindowProperty(data.window->handle(), "normalWindowMargins", QVariant(m_normal.toRect()));
71+ nativeInterface->setWindowProperty(data.window->handle(), "dialogWindowMargins", QVariant(m_dialog.toRect()));
72+ }
73+ }
74+}
plugins/WindowManager/WindowMargins.hnew file+59
@@ -0,0 +1,59 @@
1+/*
2+ * Copyright (C) 2017 Canonical, Ltd.
3+ *
4+ * This program is free software: you can redistribute it and/or modify it under
5+ * the terms of the GNU Lesser General Public License version 3, as published by
6+ * the Free Software Foundation.
7+ *
8+ * This program is distributed in the hope that it will be useful, but WITHOUT
9+ * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
10+ * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11+ * Lesser General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU Lesser General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+#ifndef WINDOWMARGINS_H
18+#define WINDOWMARGINS_H
19+
20+#include <QQuickItem>
21+#include <QRectF>
22+
23+/*
24+ * Specifies window margins for different Mir window types
25+ *
26+ * Used to inform MirAL so that it can take window management decisions that match
27+ * the visuals drawn by Unity.
28+ */
29+class WindowMargins : public QQuickItem
30+{
31+ Q_OBJECT
32+
33+ // Margins for windows of normal type
34+ Q_PROPERTY(QRectF normal READ normal WRITE setNormal NOTIFY normalChanged)
35+
36+ // Margins for windows of dialog type
37+ Q_PROPERTY(QRectF dialog READ dialog WRITE setDialog NOTIFY dialogChanged)
38+
39+ // TODO: Add margins for other window types as needed
40+
41+public:
42+ QRectF normal() const;
43+ void setNormal(QRectF value);
44+
45+ QRectF dialog() const;
46+ void setDialog(QRectF value);
47+
48+protected:
49+ void itemChange(ItemChange change, const ItemChangeData &value) override;
50+
51+Q_SIGNALS:
52+ void normalChanged();
53+ void dialogChanged();
54+private:
55+ QRectF m_normal;
56+ QRectF m_dialog;
57+};
58+
59+#endif // WINDOWMARGINS_H
plugins/Wizard/CMakeLists.txt+4−2
@@ -13,8 +13,10 @@ add_library(Wizard-qml MODULE
1313 Changelog.cpp
1414)
1515
16−qt5_use_modules(Wizard-qml DBus Qml)
17−target_link_libraries(Wizard-qml ${GD3_LDFLAGS} ${GLIB_LDFLAGS} ${GEONAMES_LDFLAGS})
16+target_link_libraries(Wizard-qml
17+ Qt5::DBus Qt5::Qml
18+ ${GD3_LDFLAGS} ${GLIB_LDFLAGS} ${GEONAMES_LDFLAGS}
19+)
1820add_unity8_plugin(Wizard 0.1 Wizard TARGETS Wizard-qml)
1921
2022set(POLKIT_LIB_DIR "${CMAKE_INSTALL_LOCALSTATEDIR}/lib/polkit-1")
plugins/Wizard/System.cpp+1−4
@@ -168,13 +168,10 @@ void System::updateSessionLocale(const QString &locale)
168168
169169 // Restart bits of the session to pick up new language.
170170 QProcess::startDetached(QStringLiteral("sh -c \"initctl emit indicator-services-end; \
171− initctl stop scope-registry; \
172− initctl stop smart-scopes-proxy; \
173171 initctl emit --no-wait indicator-services-start; \
174172 initctl restart --no-wait ubuntu-location-service-trust-stored; \
175173 initctl restart --no-wait maliit-server; \
176− initctl restart --no-wait indicator-messages; \
177− initctl restart --no-wait unity8-dash\""));
174+ initctl restart --no-wait indicator-messages"));
178175}
179176
180177void System::skipUntilFinishedPage()
plugins/Wizard/Utils/CMakeLists.txt+1−1
@@ -20,7 +20,7 @@ add_library(WizardUtils-qml SHARED
2020# files directly in targets.
2121set_target_properties(WizardUtils-qml PROPERTIES COMPILE_FLAGS -fvisibility=default)
2222
23−qt5_use_modules(WizardUtils-qml DBus Qml Quick)
23+target_link_libraries(WizardUtils-qml Qt5::DBus Qt5::Qml Qt5::Quick)
2424
2525set(PLUG_DIR ${PLUGIN_PRIVATE_MODULE_DIR}/Ubuntu/SystemSettings/Wizard/Utils)
2626install(FILES qmldir DESTINATION ${PLUG_DIR})
plugins/Wizard/test.shdeleted−18
@@ -1,18 +0,0 @@
1−#!/bin/sh
2−
3−TOPDIR=$(readlink -e "$(dirname ${0})/..")
4−
5−LOCAL_PRIVATE_DIR=$(ls -d ${TOPDIR}/debian/tmp/usr/lib/*/ubuntu-system-settings/private)
6−if [ -n ${LOCAL_PRIVATE_DIR} ]; then
7− echo "Testing against locally built version"
8− export UBUNTU_SYSTEM_SETTINGS_WIZARD_ROOT="${TOPDIR}/debian/tmp/usr/share"
9− export UBUNTU_SYSTEM_SETTINGS_WIZARD_MODULES="${LOCAL_PRIVATE_DIR}"
10− export QML2_IMPORT_PATH=${LOCAL_PRIVATE_DIR}:${QML2_IMPORT_PATH}
11− export PATH=${TOPDIR}/debian/tmp/usr/bin:${PATH}
12−else
13− echo "Testing against system version"
14−fi
15−
16−export QML2_IMPORT_PATH=${TOPDIR}/tests/mocks:${QML2_IMPORT_PATH}
17−
18−exec system-settings-wizard
po/aa.po+224−354
@@ -7,105 +7,137 @@ msgid ""
77msgstr ""
88"Project-Id-Version: unity8\n"
99"Report-Msgid-Bugs-To: \n"
10−"POT-Creation-Date: 2018-10-08 13:29-0500\n"
11−"PO-Revision-Date: 2016-02-12 10:18+0000\n"
12−"Last-Translator: Charif AYFARAH <ayfarah@ymail.com>\n"
13−"Language-Team: Afar <aa@li.org>\n"
10+"POT-Creation-Date: 2021-01-29 11:42-0600\n"
11+"PO-Revision-Date: 2021-03-08 10:42+0000\n"
12+"Last-Translator: TigranKhachatryan0 <tigrank2008@gmail.com>\n"
13+"Language-Team: Afar <https://translate.ubports.com/projects/ubports/lomiri/"
14+"aa/>\n"
1415"Language: aa\n"
1516"MIME-Version: 1.0\n"
1617"Content-Type: text/plain; charset=UTF-8\n"
1718"Content-Transfer-Encoding: 8bit\n"
1819"Plural-Forms: nplurals=2; plural=n != 1;\n"
20+"X-Generator: Weblate 3.11.3\n"
1921"X-Launchpad-Export-Date: 2016-11-23 06:34+0000\n"
20−"X-Generator: Launchpad (build 18269)\n"
2122
22−#: plugins/LightDM/Greeter.cpp:123
23+#: plugins/LightDM/Greeter.cpp:199
2324msgid "Password: "
24−msgstr "Cuumita "
25+msgstr ""
26+
27+#: plugins/LightDM/Greeter.cpp:214
28+msgid "Username"
29+msgstr ""
30+
31+#: plugins/LightDM/Greeter.cpp:258
32+msgid "Failed to authenticate"
33+msgstr ""
34+
35+#: plugins/LightDM/Greeter.cpp:260
36+msgid "Invalid password, please try again"
37+msgstr ""
38+
39+#: plugins/LightDM/Greeter.cpp:270
40+msgid "Log In"
41+msgstr ""
42+
43+#: plugins/LightDM/Greeter.cpp:270
44+msgid "Retry"
45+msgstr "Qagis"
2546
26−#: plugins/Unity/Launcher/launcheritem.cpp:50
27−#: plugins/Unity/Launcher/launcheritem.cpp:109
47+#: plugins/LightDM/UsersModel.cpp:157
48+msgid "Login"
49+msgstr ""
50+
51+#: plugins/LightDM/UsersModel.cpp:165
52+msgid "Guest Session"
53+msgstr ""
54+
55+#: plugins/Unity/Launcher/launcheritem.cpp:48
56+#: plugins/Unity/Launcher/launcheritem.cpp:122
2857msgid "Pin shortcut"
2958msgstr ""
3059
31−#: plugins/Unity/Launcher/launcheritem.cpp:55
60+#: plugins/Unity/Launcher/launcheritem.cpp:54
3261msgid "Quit"
3362msgstr "Kat"
3463
35−#: plugins/Unity/Launcher/launcheritem.cpp:109
64+#: plugins/Unity/Launcher/launcheritem.cpp:122
3665msgid "Unpin shortcut"
3766msgstr ""
3867
39−#: qml/Components/Dialogs.qml:149
68+#: qml/Components/Dialogs.qml:176
4069msgctxt "Title: Lock/Log out dialog"
4170msgid "Log out"
4271msgstr "Eweq"
4372
44−#: qml/Components/Dialogs.qml:150
73+#: qml/Components/Dialogs.qml:177
4574msgid "Are you sure you want to log out?"
4675msgstr ""
4776
48−#: qml/Components/Dialogs.qml:152
77+#: qml/Components/Dialogs.qml:180
4978msgctxt "Button: Lock the system"
5079msgid "Lock"
5180msgstr "Koflis"
5281
53−#: qml/Components/Dialogs.qml:159
82+#: qml/Components/Dialogs.qml:191
5483msgctxt "Button: Log out from the system"
5584msgid "Log Out"
5685msgstr "Eweq"
5786
58−#: qml/Components/Dialogs.qml:166 qml/Components/Dialogs.qml:222
59−#: qml/Dash/DashPageHeader.qml:324 qml/Greeter/NarrowView.qml:232
60−#: qml/Wizard/Pages/passcode-confirm.qml:32
87+#: qml/Components/Dialogs.qml:199 qml/Components/Dialogs.qml:284
88+#: qml/Greeter/NarrowView.qml:215 qml/Wizard/Pages/passcode-confirm.qml:32
6189#: qml/Wizard/Pages/passcode-set.qml:32
6290msgid "Cancel"
6391msgstr "Bayis"
6492
65−#: qml/Components/Dialogs.qml:178
93+#: qml/Components/Dialogs.qml:211
6694msgctxt "Title: Reboot dialog"
6795msgid "Reboot"
6896msgstr "Wadir-ugus"
6997
70−#: qml/Components/Dialogs.qml:179
98+#: qml/Components/Dialogs.qml:212
7199msgid "Are you sure you want to reboot?"
72100msgstr "Wadir-ugussuh digga maay litoo?"
73101
74−#: qml/Components/Dialogs.qml:181
102+#: qml/Components/Dialogs.qml:215
75103msgid "No"
76104msgstr "Maleey"
77105
78−#: qml/Components/Dialogs.qml:187
106+#: qml/Components/Dialogs.qml:223
79107msgid "Yes"
80108msgstr "Yeey"
81109
82−#: qml/Components/Dialogs.qml:202
110+#: qml/Components/Dialogs.qml:243
83111msgctxt "Title: Power off/Restart dialog"
84112msgid "Power"
85113msgstr "Cayla"
86114
87−#: qml/Components/Dialogs.qml:203
115+#: qml/Components/Dialogs.qml:244
88116msgid ""
89117"Are you sure you would like\n"
90118"to power off?"
91119msgstr "Timmi haytuh digga maay litoo?"
92120
93−#: qml/Components/Dialogs.qml:205
121+#: qml/Components/Dialogs.qml:248
94122msgctxt "Button: Power off the system"
95123msgid "Power off"
96124msgstr "Timmi hayis"
97125
98−#: qml/Components/Dialogs.qml:214
126+#: qml/Components/Dialogs.qml:263
99127msgctxt "Button: Restart the system"
100128msgid "Restart"
101129msgstr "Wadir-qimbis"
102130
131+#: qml/Components/Dialogs.qml:276
132+msgid "Screenshot"
133+msgstr ""
134+
103135#: qml/Components/KeyboardShortcutsOverlay.qml:41
104136msgid "Keyboard Shortcuts"
105137msgstr ""
106138
107139#: qml/Components/KeyboardShortcutsOverlay.qml:55
108−msgid "Unity 8"
140+msgid "Lomiri"
109141msgstr ""
110142
111143#: qml/Components/KeyboardShortcutsOverlay.qml:62
@@ -121,7 +153,7 @@ msgid "Alt + PrtScr"
121153msgstr ""
122154
123155#: qml/Components/KeyboardShortcutsOverlay.qml:80
124−msgid "Takes a screenshot of a window."
156+msgid "Takes a screenshot of the current window."
125157msgstr ""
126158
127159#: qml/Components/KeyboardShortcutsOverlay.qml:88
@@ -140,127 +172,131 @@ msgstr ""
140172msgid "Switches to previous keyboard layout."
141173msgstr ""
142174
143−#: qml/Components/KeyboardShortcutsOverlay.qml:118
144−msgid "Launcher"
175+#: qml/Components/KeyboardShortcutsOverlay.qml:114
176+msgid "Ctrl + Alt + T"
145177msgstr ""
146178
147−#: qml/Components/KeyboardShortcutsOverlay.qml:125
148−msgid "Super (Hold)"
179+#: qml/Components/KeyboardShortcutsOverlay.qml:119
180+msgid "Starts the Terminal application."
149181msgstr ""
150182
151−#: qml/Components/KeyboardShortcutsOverlay.qml:130
152−msgid "Opens the launcher, displays shortcuts."
183+#: qml/Components/KeyboardShortcutsOverlay.qml:131
184+msgid "Launcher"
153185msgstr ""
154186
155187#: qml/Components/KeyboardShortcutsOverlay.qml:138
156−msgid "Alt + F1"
188+msgid "Super (Hold)"
157189msgstr ""
158190
159191#: qml/Components/KeyboardShortcutsOverlay.qml:143
160−msgid "Opens launcher keyboard navigation mode."
192+msgid "Opens the launcher, displays shortcuts."
161193msgstr ""
162194
163195#: qml/Components/KeyboardShortcutsOverlay.qml:151
164−msgid "Super + Tab"
196+msgid "Alt + F1"
165197msgstr ""
166198
167199#: qml/Components/KeyboardShortcutsOverlay.qml:156
168−msgid "Switches applications via the launcher."
200+msgid "Opens launcher keyboard navigation mode."
169201msgstr ""
170202
171203#: qml/Components/KeyboardShortcutsOverlay.qml:164
172−msgid "Super + 0 to 9"
204+msgid "Super + Tab"
173205msgstr ""
174206
175207#: qml/Components/KeyboardShortcutsOverlay.qml:169
176−msgid "Same as clicking on a launcher icon."
208+msgid "Switches applications via the launcher."
209+msgstr ""
210+
211+#: qml/Components/KeyboardShortcutsOverlay.qml:177
212+msgid "Super + 1 to 0"
177213msgstr ""
178214
179−#: qml/Components/KeyboardShortcutsOverlay.qml:181
180−msgid "Scopes"
215+#: qml/Components/KeyboardShortcutsOverlay.qml:182
216+msgid "Same as clicking on a launcher icon."
181217msgstr ""
182218
183−#: qml/Components/KeyboardShortcutsOverlay.qml:188
184−msgid "Super (Tap)"
219+#: qml/Components/KeyboardShortcutsOverlay.qml:190
220+msgid "Super + A"
185221msgstr ""
186222
187−#: qml/Components/KeyboardShortcutsOverlay.qml:193
188−msgid "Opens the Scopes home."
223+#: qml/Components/KeyboardShortcutsOverlay.qml:195
224+msgid "Opens the Application Drawer."
189225msgstr ""
190226
191−#: qml/Components/KeyboardShortcutsOverlay.qml:209
227+#: qml/Components/KeyboardShortcutsOverlay.qml:235
192228msgid "Switching"
193229msgstr ""
194230
195−#: qml/Components/KeyboardShortcutsOverlay.qml:216
231+#: qml/Components/KeyboardShortcutsOverlay.qml:242
196232msgid "Alt + Tab"
197233msgstr ""
198234
199−#: qml/Components/KeyboardShortcutsOverlay.qml:221
235+#: qml/Components/KeyboardShortcutsOverlay.qml:247
200236msgid "Switches between applications."
201237msgstr ""
202238
203−#: qml/Components/KeyboardShortcutsOverlay.qml:229
239+#: qml/Components/KeyboardShortcutsOverlay.qml:255
204240msgid "Super + W"
205241msgstr ""
206242
207−#: qml/Components/KeyboardShortcutsOverlay.qml:234
243+#: qml/Components/KeyboardShortcutsOverlay.qml:260
208244msgid "Opens the desktop spread."
209245msgstr ""
210246
211−#: qml/Components/KeyboardShortcutsOverlay.qml:242
247+#: qml/Components/KeyboardShortcutsOverlay.qml:268
212248msgid "Cursor Left or Right"
213249msgstr ""
214250
215−#: qml/Components/KeyboardShortcutsOverlay.qml:247
251+#: qml/Components/KeyboardShortcutsOverlay.qml:273
216252msgid "Moves the focus."
217253msgstr ""
218254
219−#: qml/Components/KeyboardShortcutsOverlay.qml:259
255+#: qml/Components/KeyboardShortcutsOverlay.qml:285
220256msgid "Windows"
221257msgstr ""
222258
223−#: qml/Components/KeyboardShortcutsOverlay.qml:266
259+#: qml/Components/KeyboardShortcutsOverlay.qml:292
224260msgid "Ctrl + Super + D"
225261msgstr ""
226262
227−#: qml/Components/KeyboardShortcutsOverlay.qml:271
263+#: qml/Components/KeyboardShortcutsOverlay.qml:297
228264msgid "Minimizes all windows."
229265msgstr ""
230266
231−#: qml/Components/KeyboardShortcutsOverlay.qml:279
267+#: qml/Components/KeyboardShortcutsOverlay.qml:305
232268msgid "Ctrl + Super + Up"
233269msgstr ""
234270
235−#: qml/Components/KeyboardShortcutsOverlay.qml:284
271+#: qml/Components/KeyboardShortcutsOverlay.qml:310
236272msgid "Maximizes the current window."
237273msgstr ""
238274
239−#: qml/Components/KeyboardShortcutsOverlay.qml:292
275+#: qml/Components/KeyboardShortcutsOverlay.qml:318
240276msgid "Ctrl + Super + Down"
241277msgstr ""
242278
243−#: qml/Components/KeyboardShortcutsOverlay.qml:297
279+#: qml/Components/KeyboardShortcutsOverlay.qml:323
244280msgid "Minimizes or restores the current window."
245281msgstr ""
246282
247−#: qml/Components/KeyboardShortcutsOverlay.qml:305
283+#: qml/Components/KeyboardShortcutsOverlay.qml:331
248284msgid "Ctrl + Super + Left or Right"
249285msgstr ""
250286
251−#: qml/Components/KeyboardShortcutsOverlay.qml:310
287+#: qml/Components/KeyboardShortcutsOverlay.qml:336
252288msgid "Semi-maximizes the current window."
253289msgstr ""
254290
255−#: qml/Components/KeyboardShortcutsOverlay.qml:318
291+#: qml/Components/KeyboardShortcutsOverlay.qml:344
256292msgid "Alt + F4"
257293msgstr ""
258294
259−#: qml/Components/KeyboardShortcutsOverlay.qml:323
295+#: qml/Components/KeyboardShortcutsOverlay.qml:349
260296msgid "Closes the current window."
261297msgstr ""
262298
263−#: qml/Components/Lockscreen.qml:212 qml/Greeter/NarrowView.qml:252
299+#: qml/Components/Lockscreen.qml:212 qml/Greeter/NarrowView.qml:235
264300msgid "Return to Call"
265301msgstr "Seecol gacis"
266302
@@ -268,7 +304,7 @@ msgstr "Seecol gacis"
268304msgid "Emergency Call"
269305msgstr ""
270306
271−#: qml/Components/Lockscreen.qml:244
307+#: qml/Components/Lockscreen.qml:245
272308msgid "OK"
273309msgstr "Hayya"
274310
@@ -282,29 +318,29 @@ msgstr ""
282318msgid "%1:%2"
283319msgstr ""
284320
285−#: qml/Components/ModeSwitchWarningDialog.qml:32
321+#: qml/Components/ModeSwitchWarningDialog.qml:33
286322msgid "Apps may have unsaved data:"
287323msgstr ""
288324
289−#: qml/Components/ModeSwitchWarningDialog.qml:57
325+#: qml/Components/ModeSwitchWarningDialog.qml:60
290326msgctxt ""
291327"Re-dock means connect the device again to an external screen/mouse/keyboard"
292328msgid "Re-dock, save your work and close these apps to continue."
293329msgstr ""
294330
295−#: qml/Components/ModeSwitchWarningDialog.qml:63
331+#: qml/Components/ModeSwitchWarningDialog.qml:67
296332msgid "Or force close now (unsaved data will be lost)."
297333msgstr ""
298334
299−#: qml/Components/ModeSwitchWarningDialog.qml:75
335+#: qml/Components/ModeSwitchWarningDialog.qml:80
300336msgid "OK, I will reconnect"
301337msgstr ""
302338
303−#: qml/Components/ModeSwitchWarningDialog.qml:76
339+#: qml/Components/ModeSwitchWarningDialog.qml:81
304340msgid "Reconnect now!"
305341msgstr ""
306342
307−#: qml/Components/ModeSwitchWarningDialog.qml:88
343+#: qml/Components/ModeSwitchWarningDialog.qml:94
308344msgid "Close all"
309345msgstr "Inkih alif"
310346
@@ -312,107 +348,26 @@ msgstr "Inkih alif"
312348msgid "Preview Share Item"
313349msgstr ""
314350
315−#: qml/Dash/DashPageHeader.qml:361
316−msgctxt "Button: Open the Ubuntu Store"
317−msgid "Store"
318−msgstr ""
319−
320−#: qml/Dash/DashPageHeader.qml:368
321−msgctxt "Button: Start a search in the current dash scope"
322−msgid "Search"
323−msgstr "Goranto"
324−
325−#: qml/Dash/DashPageHeader.qml:378
326−msgctxt "Button: Show the current dash scope settings"
327−msgid "Settings"
328−msgstr "Massosu"
329−
330−#: qml/Dash/DashPageHeader.qml:385
331−msgid "Remove from Favorites"
332−msgstr ""
333−
334−#: qml/Dash/DashPageHeader.qml:385
335−msgid "Add to Favorites"
336−msgstr ""
337−
338−#: qml/Dash/FiltersPopover.qml:61
339−msgid "Refine your results"
340−msgstr ""
341−
342−#: qml/Dash/FiltersPopover.qml:70
343−msgid "Reset"
344−msgstr ""
345−
346−#: qml/Dash/GenericScopeView.qml:547 qml/Dash/GenericScopeView.qml:718
347−msgid "Show less"
348−msgstr ""
349−
350−#: qml/Dash/GenericScopeView.qml:547
351−msgid "Show all"
352−msgstr ""
353−
354−#: qml/Dash/GenericScopeView.qml:578
355−msgctxt "Label: Hint for dash search line edit"
356−msgid "Search"
357−msgstr "Goranto"
358−
359−#: qml/Dash/PageHeaderExtraPanel.qml:67
360−msgid "Recent Searches"
361−msgstr ""
362−
363−#: qml/Dash/PageHeaderExtraPanel.qml:78
364−msgid "Clear All"
365−msgstr ""
366−
367−#: qml/Dash/Previews/PreviewActionCombo.qml:36
368−msgid "More..."
369−msgstr ""
370−
371−#: qml/Dash/Previews/PreviewActionCombo.qml:36
372−msgid "Less..."
373−msgstr ""
374−
375−#: qml/Dash/Previews/PreviewCommentInput.qml:83
376−#: qml/Dash/Previews/PreviewRatingInput.qml:202
377−msgid "Send"
378−msgstr "Rub"
379−
380−#: qml/Dash/Previews/PreviewRatingInput.qml:109
381−msgid "Rate this"
382−msgstr ""
383−
384−#: qml/Dash/Previews/PreviewRatingInput.qml:184
385−msgid "Add a review"
386−msgstr ""
387−
388−#: qml/Dash/PullToRefreshScopeStyle.qml:56
389−msgid "Pull to refresh…"
390−msgstr ""
391−
392−#: qml/Dash/PullToRefreshScopeStyle.qml:61
393−msgid "Release to refresh…"
351+#: qml/Components/VirtualTouchPad.qml:317
352+msgid ""
353+"Your device is now connected to an external display. Use this screen as a "
354+"touch pad to interact with the pointer."
394355msgstr ""
395356
396−#: qml/Dash/ScopeSettings/ScopeSettingBoolean.qml:43
397−msgid "Enable location data"
357+#: qml/Components/VirtualTouchPad.qml:327
358+msgid "Tap left button to click."
398359msgstr ""
399360
400−#: qml/Dash/ScopesList.qml:57
401−msgid "Manage"
361+#: qml/Components/VirtualTouchPad.qml:339
362+msgid "Tap right button to right click."
402363msgstr ""
403364
404−#: qml/Dash/ScopesList.qml:104
405−msgid "Home"
406−msgstr "Dabqi"
407−
408−#: qml/Dash/ScopesList.qml:105
409−msgid "Also installed"
365+#: qml/Components/VirtualTouchPad.qml:351
366+msgid "Swipe with two fingers to scroll."
410367msgstr ""
411368
412−#: qml/DisabledScreenNotice.qml:109
413−msgid ""
414−"Your device is now connected to an external display. Use this screen as a "
415−"touch pad to interact with the pointer."
369+#: qml/Components/VirtualTouchPad.qml:396
370+msgid "Find more settings in the system settings."
416371msgstr ""
417372
418373#: qml/Greeter/CoverPage.qml:127
@@ -438,32 +393,51 @@ msgid_plural "Please wait %1 minutes and then try again…"
438393msgstr[0] "Maganak %1 minit qambaalaay, kaadu gabbat"
439394msgstr[1] "Maganak %1 minit qambaalaay, kaadu gabbat"
440395
441−#: qml/Greeter/Greeter.qml:596
396+#: qml/Greeter/Greeter.qml:550
442397msgid "Try again"
443398msgstr ""
444399
445−#: qml/Greeter/LoginList.qml:70
400+#: qml/Greeter/Greeter.qml:551
401+#, fuzzy
402+#| msgid "Enter passphrase"
403+msgid "Enter passphrase to unlock"
404+msgstr "Tatur-maxco culus"
405+
406+#: qml/Greeter/Greeter.qml:552
407+#, fuzzy
408+#| msgid "Enter passcode"
409+msgid "Enter passcode to unlock"
410+msgstr "Tatur-mudenta culus"
411+
412+#: qml/Greeter/NarrowView.qml:235
413+msgid "Emergency"
414+msgstr ""
415+
416+#: qml/Greeter/PromptList.qml:126
446417msgid "Passphrase"
447418msgstr ""
448419
449−#: qml/Greeter/LoginList.qml:71
420+#: qml/Greeter/PromptList.qml:126
450421msgid "Passcode"
451422msgstr ""
452423
453−#: qml/Greeter/LoginList.qml:98 qml/Wizard/Pages/UpdateDelegate.qml:118
454−msgid "Retry"
455−msgstr "Qagis"
456−
457−#: qml/Greeter/LoginList.qml:99
458−msgid "Log In"
424+#: qml/Greeter/SessionsList.qml:124
425+msgid "Select desktop environment"
459426msgstr ""
460427
461−#: qml/Greeter/NarrowView.qml:252
462−msgid "Emergency"
428+#: qml/Launcher/Drawer.qml:250
429+#, fuzzy
430+#| msgctxt "Button: Start a search in the current dash scope"
431+#| msgid "Search"
432+msgid "Search…"
433+msgstr "Goranto"
434+
435+#: qml/Launcher/PullToRefreshScopeStyle.qml:56
436+msgid "Pull to refresh…"
463437msgstr ""
464438
465−#: qml/Greeter/SessionsList.qml:122
466−msgid "Select desktop environment"
439+#: qml/Launcher/PullToRefreshScopeStyle.qml:61
440+msgid "Release to refresh…"
467441msgstr ""
468442
469443#: qml/Notifications/NotificationMenuItemFactory.qml:124
@@ -478,63 +452,62 @@ msgstr ""
478452msgid "Conference"
479453msgstr "Koboxu"
480454
481−#: qml/Panel/Indicators/MenuItemFactory.qml:847
455+#: qml/Panel/Indicators/IndicatorMenuItemFactory.qml:869
482456msgid "Nothing is playing"
483457msgstr ""
484458
485−#: qml/Panel/Indicators/MenuItemFactory.qml:975
459+#: qml/Panel/Indicators/IndicatorMenuItemFactory.qml:997
486460#, qt-format
487461msgid "%1 hour"
488462msgid_plural "%1 hours"
489463msgstr[0] "%1 saaqata"
490464msgstr[1] "%1 saaqata"
491465
492−#: qml/Panel/Indicators/MenuItemFactory.qml:979
466+#: qml/Panel/Indicators/IndicatorMenuItemFactory.qml:1001
493467#, qt-format
494468msgid "%1 minute"
495469msgid_plural "%1 minutes"
496470msgstr[0] "%1 miniti"
497471msgstr[1] "%1 miniti"
498472
499−#: qml/Panel/Indicators/MenuItemFactory.qml:984
473+#: qml/Panel/Indicators/IndicatorMenuItemFactory.qml:1006
500474#, qt-format
501475msgid "%1 second"
502476msgid_plural "%1 seconds"
503477msgstr[0] "%1 nammayye"
504478msgstr[1] "%1 nammayye"
505479
506−#: qml/Panel/Indicators/MenuItemFactory.qml:987
480+#: qml/Panel/Indicators/IndicatorMenuItemFactory.qml:1009
507481msgid "0 seconds"
508482msgstr "0 nammayye"
509483
510484#. Translators: String like "1 hour, 2 minutes, 3 seconds remaining"
511−#: qml/Panel/Indicators/MenuItemFactory.qml:989
485+#: qml/Panel/Indicators/IndicatorMenuItemFactory.qml:1011
512486#, qt-format
513487msgid "%1 remaining"
514488msgstr "%1 raaqe"
515489
516−#: qml/Panel/Indicators/MenuItemFactory.qml:995
490+#: qml/Panel/Indicators/IndicatorMenuItemFactory.qml:1017
517491msgid "In queue…"
518492msgstr ""
519493
520−#: qml/Panel/Indicators/MenuItemFactory.qml:999
521−#: qml/Wizard/Pages/UpdateDelegate.qml:226
494+#: qml/Panel/Indicators/IndicatorMenuItemFactory.qml:1021
522495msgid "Downloading"
523496msgstr "Qulluumah"
524497
525−#: qml/Panel/Indicators/MenuItemFactory.qml:1001
498+#: qml/Panel/Indicators/IndicatorMenuItemFactory.qml:1023
526499msgid "Paused, tap to resume"
527500msgstr ""
528501
529−#: qml/Panel/Indicators/MenuItemFactory.qml:1003
502+#: qml/Panel/Indicators/IndicatorMenuItemFactory.qml:1025
530503msgid "Canceled"
531504msgstr "Bayteh"
532505
533−#: qml/Panel/Indicators/MenuItemFactory.qml:1005
506+#: qml/Panel/Indicators/IndicatorMenuItemFactory.qml:1027
534507msgid "Finished"
535508msgstr "Duudumteh"
536509
537−#: qml/Panel/Indicators/MenuItemFactory.qml:1007
510+#: qml/Panel/Indicators/IndicatorMenuItemFactory.qml:1029
538511msgid "Failed, tap to retry"
539512msgstr ""
540513
@@ -554,23 +527,34 @@ msgctxt "Button: Call back on phone"
554527msgid "Call back"
555528msgstr ""
556529
530+#: qml/Panel/PanelMenuPage.qml:92
531+#, fuzzy
532+#| msgctxt "Button: Go back one page in the Wizard"
533+#| msgid "Back"
534+msgid "Back"
535+msgstr "Derre"
536+
557537#: qml/Stage/SideStage.qml:76
558538msgid "Drag using 3 fingers any application from one window to the other"
559539msgstr ""
560540
541+#: qml/Stage/Stage.qml:671
542+msgid "No running apps"
543+msgstr ""
544+
561545#: qml/Tutorial/TutorialLeftLong.qml:49
562−msgid "Long swipe from the left edge to open the Today scope"
546+msgid "Long swipe from the left edge to open the Application Drawer"
563547msgstr ""
564548
565549#: qml/Tutorial/TutorialLeft.qml:47
566550msgid "Short swipe from the left edge to open the launcher"
567551msgstr ""
568552
569−#: qml/Tutorial/TutorialRight.qml:55
553+#: qml/Tutorial/TutorialRight.qml:54
570554msgid "Push your mouse against the right edge to view your open apps"
571555msgstr ""
572556
573−#: qml/Tutorial/TutorialRight.qml:56
557+#: qml/Tutorial/TutorialRight.qml:55
574558msgid "Swipe from the right edge to view your open apps"
575559msgstr ""
576560
@@ -587,15 +571,13 @@ msgstr "Derre"
587571msgid "Language"
588572msgstr ""
589573
590−#: qml/Wizard/Pages/10-welcome.qml:175
574+#: qml/Wizard/Pages/10-welcome.qml:176
591575#: qml/Wizard/Pages/10-welcome-update.qml:126
592576#: qml/Wizard/Pages/11-changelog.qml:74 qml/Wizard/Pages/20-keyboard.qml:152
593−#: qml/Wizard/Pages/30-wifi.qml:208 qml/Wizard/Pages/50-timezone.qml:272
594−#: qml/Wizard/Pages/60-account.qml:66 qml/Wizard/Pages/70-passwd-type.qml:146
595−#: qml/Wizard/Pages/75-report-check.qml:85
596−#: qml/Wizard/Pages/76-app-update.qml:236
597−#: qml/Wizard/Pages/passcode-desktop.qml:142
598−#: qml/Wizard/Pages/password-set.qml:142
577+#: qml/Wizard/Pages/30-wifi.qml:214 qml/Wizard/Pages/50-timezone.qml:272
578+#: qml/Wizard/Pages/60-account.qml:72 qml/Wizard/Pages/70-passwd-type.qml:146
579+#: qml/Wizard/Pages/passcode-desktop.qml:154
580+#: qml/Wizard/Pages/password-set.qml:153
599581msgid "Next"
600582msgstr ""
601583
@@ -627,9 +609,9 @@ msgstr ""
627609msgid "Keyboard layout"
628610msgstr ""
629611
630−#: qml/Wizard/Pages/20-keyboard.qml:152 qml/Wizard/Pages/30-wifi.qml:208
631−#: qml/Wizard/Pages/60-account.qml:66 qml/Wizard/Pages/76-app-update.qml:240
632−#: qml/Wizard/Pages/79-system-update.qml:152 qml/Wizard/Pages/sim.qml:101
612+#: qml/Wizard/Pages/20-keyboard.qml:152 qml/Wizard/Pages/30-wifi.qml:214
613+#: qml/Wizard/Pages/60-account.qml:72 qml/Wizard/Pages/79-system-update.qml:144
614+#: qml/Wizard/Pages/sim.qml:101
633615msgid "Skip"
634616msgstr "Kaqit"
635617
@@ -637,15 +619,15 @@ msgstr "Kaqit"
637619msgid "Connect to Wi‑Fi"
638620msgstr ""
639621
640−#: qml/Wizard/Pages/30-wifi.qml:133
622+#: qml/Wizard/Pages/30-wifi.qml:139
641623msgid "Connected"
642624msgstr ""
643625
644−#: qml/Wizard/Pages/30-wifi.qml:166
626+#: qml/Wizard/Pages/30-wifi.qml:172
645627msgid "Available Wi-Fi networks"
646628msgstr ""
647629
648−#: qml/Wizard/Pages/30-wifi.qml:167
630+#: qml/Wizard/Pages/30-wifi.qml:173
649631msgid "No available Wi-Fi networks"
650632msgstr ""
651633
@@ -661,7 +643,7 @@ msgstr ""
661643msgid "Personalize Your Device"
662644msgstr ""
663645
664−#: qml/Wizard/Pages/60-account.qml:49
646+#: qml/Wizard/Pages/60-account.qml:54
665647msgid "Preferred Name"
666648msgstr ""
667649
@@ -684,47 +666,6 @@ msgctxt "Label: Type of security method"
684666msgid "No lock code"
685667msgstr ""
686668
687−#: qml/Wizard/Pages/75-report-check.qml:26
688−msgid "Privacy Policy"
689−msgstr ""
690−
691−#: qml/Wizard/Pages/75-report-check.qml:26
692−msgid "Help Us Improve"
693−msgstr ""
694−
695−#: qml/Wizard/Pages/75-report-check.qml:60
696−msgid "Improve system performance by sending us crashes and error reports."
697−msgstr ""
698−
699−#: qml/Wizard/Pages/75-report-check.qml:61
700−msgid "Privacy policy"
701−msgstr ""
702−
703−#: qml/Wizard/Pages/76-app-update.qml:35
704−msgid "Update Apps"
705−msgstr ""
706−
707−#: qml/Wizard/Pages/76-app-update.qml:127
708−msgid "This device is not connected to the internet."
709−msgstr ""
710−
711−#: qml/Wizard/Pages/76-app-update.qml:128
712−#: qml/Wizard/Pages/76-app-update.qml:134
713−msgid "Use the OpenStore app to check for updates once connected."
714−msgstr ""
715−
716−#: qml/Wizard/Pages/76-app-update.qml:130
717−msgid "Software is up to date"
718−msgstr ""
719−
720−#: qml/Wizard/Pages/76-app-update.qml:133
721−msgid "The update server is not responding."
722−msgstr ""
723−
724−#: qml/Wizard/Pages/76-app-update.qml:238
725−msgid "Please wait..."
726−msgstr ""
727−
728669#: qml/Wizard/Pages/79-system-update.qml:28
729670msgid "Update Device"
730671msgstr ""
@@ -737,7 +678,7 @@ msgstr ""
737678
738679#: qml/Wizard/Pages/79-system-update.qml:76
739680msgctxt "string identifying name of the update"
740−msgid "Ubuntu system"
681+msgid "Ubuntu Touch system"
741682msgstr ""
742683
743684#: qml/Wizard/Pages/79-system-update.qml:83
@@ -746,11 +687,11 @@ msgctxt "version of the system update"
746687msgid "Version %1"
747688msgstr ""
748689
749−#: qml/Wizard/Pages/79-system-update.qml:102
690+#: qml/Wizard/Pages/79-system-update.qml:95
750691msgid "This could take a few minutes..."
751692msgstr ""
752693
753−#: qml/Wizard/Pages/79-system-update.qml:116
694+#: qml/Wizard/Pages/79-system-update.qml:109
754695msgid "Install and restart now"
755696msgstr ""
756697
@@ -774,31 +715,8 @@ msgstr "Tatur"
774715msgid "Get Started"
775716msgstr ""
776717
777−#: qml/Wizard/Pages/DownloadHandler.qml:174
778−msgid "Installation failed"
779−msgstr ""
780−
781−#: qml/Wizard/Pages/GlobalUpdateControls.qml:84
782−msgid "Checking for updates…"
783−msgstr ""
784−
785−#: qml/Wizard/Pages/GlobalUpdateControls.qml:109
786−#, qt-format
787−msgid "%1 update available"
788−msgid_plural "%1 updates available"
789−msgstr[0] ""
790−msgstr[1] ""
791−
792−#: qml/Wizard/Pages/GlobalUpdateControls.qml:119
793−msgid "Update all…"
794−msgstr ""
795−
796−#: qml/Wizard/Pages/GlobalUpdateControls.qml:121
797−msgid "Update all"
798−msgstr ""
799−
800718#: qml/Wizard/Pages/passcode-confirm.qml:43
801−#: qml/Wizard/Pages/passcode-desktop.qml:97
719+#: qml/Wizard/Pages/passcode-desktop.qml:104
802720msgid "Confirm passcode"
803721msgstr ""
804722
@@ -815,24 +733,24 @@ msgstr ""
815733msgid "Lock Screen Passcode"
816734msgstr ""
817735
818−#: qml/Wizard/Pages/passcode-desktop.qml:61
736+#: qml/Wizard/Pages/passcode-desktop.qml:68
819737msgid "Enter 4 numbers to setup your passcode"
820738msgstr ""
821739
822−#: qml/Wizard/Pages/passcode-desktop.qml:77
740+#: qml/Wizard/Pages/passcode-desktop.qml:84
823741#: qml/Wizard/Pages/passcode-set.qml:54
824742msgid "Choose passcode"
825743msgstr ""
826744
827−#: qml/Wizard/Pages/passcode-desktop.qml:127
745+#: qml/Wizard/Pages/passcode-desktop.qml:139
828746msgid "Passcode too short"
829747msgstr ""
830748
831−#: qml/Wizard/Pages/passcode-desktop.qml:129
749+#: qml/Wizard/Pages/passcode-desktop.qml:141
832750msgid "Passcodes match"
833751msgstr ""
834752
835−#: qml/Wizard/Pages/passcode-desktop.qml:131
753+#: qml/Wizard/Pages/passcode-desktop.qml:143
836754msgid "Passcodes do not match"
837755msgstr ""
838756
@@ -844,15 +762,15 @@ msgstr ""
844762msgid "Lock Screen Password"
845763msgstr ""
846764
847−#: qml/Wizard/Pages/password-set.qml:62
765+#: qml/Wizard/Pages/password-set.qml:68
848766msgid "Enter at least 8 characters"
849767msgstr ""
850768
851−#: qml/Wizard/Pages/password-set.qml:74
769+#: qml/Wizard/Pages/password-set.qml:80
852770msgid "Choose password"
853771msgstr ""
854772
855−#: qml/Wizard/Pages/password-set.qml:104
773+#: qml/Wizard/Pages/password-set.qml:110
856774msgid "Confirm password"
857775msgstr ""
858776
@@ -880,70 +798,6 @@ msgstr ""
880798msgid "To proceed with no SIM tap Skip."
881799msgstr ""
882800
883−#: qml/Wizard/Pages/UpdateDelegate.qml:123
884−msgid "Update"
885−msgstr ""
886−
887−#: qml/Wizard/Pages/UpdateDelegate.qml:125
888−#, fuzzy
889−msgid "Download"
890−msgstr "Qulluumah"
891−
892−#: qml/Wizard/Pages/UpdateDelegate.qml:131
893−msgid "Resume"
894−msgstr ""
895−
896−#: qml/Wizard/Pages/UpdateDelegate.qml:138
897−msgid "Pause"
898−msgstr ""
899−
900−#: qml/Wizard/Pages/UpdateDelegate.qml:142
901−msgid "Install…"
902−msgstr ""
903−
904−#: qml/Wizard/Pages/UpdateDelegate.qml:144
905−msgid "Install"
906−msgstr ""
907−
908−#: qml/Wizard/Pages/UpdateDelegate.qml:148
909−msgid "Open"
910−msgstr ""
911−
912−#: qml/Wizard/Pages/UpdateDelegate.qml:216
913−msgid "Installing"
914−msgstr ""
915−
916−#: qml/Wizard/Pages/UpdateDelegate.qml:220
917−msgid "Paused"
918−msgstr ""
919−
920−#: qml/Wizard/Pages/UpdateDelegate.qml:223
921−msgid "Waiting to download"
922−msgstr ""
923−
924−#: qml/Wizard/Pages/UpdateDelegate.qml:279
925−#, qt-format
926−msgid "%1 of %2"
927−msgstr ""
928−
929−#: qml/Wizard/Pages/UpdateDelegate.qml:283
930−#, fuzzy
931−msgid "Downloaded"
932−msgstr "Qulluumah"
933−
934−#: qml/Wizard/Pages/UpdateDelegate.qml:286
935−msgid "Installed"
936−msgstr ""
937−
938−#: qml/Wizard/Pages/UpdateDelegate.qml:291
939−#, qt-format
940−msgid "Updated %1"
941−msgstr ""
942−
943−#: qml/Wizard/Pages/UpdateDelegate.qml:315
944−msgid "Update failed"
945−msgstr ""
946−
947801#: qml/Wizard/PasswordMeter.qml:87
948802msgid "Password too short"
949803msgstr ""
@@ -972,6 +826,28 @@ msgstr ""
972826msgid "Very weak password"
973827msgstr ""
974828
829+#~ msgctxt "Button: Show the current dash scope settings"
830+#~ msgid "Settings"
831+#~ msgstr "Massosu"
832+
833+#~ msgctxt "Label: Hint for dash search line edit"
834+#~ msgid "Search"
835+#~ msgstr "Goranto"
836+
837+#~ msgid "Send"
838+#~ msgstr "Rub"
839+
840+#~ msgid "Home"
841+#~ msgstr "Dabqi"
842+
843+#, fuzzy
844+#~ msgid "Download"
845+#~ msgstr "Qulluumah"
846+
847+#, fuzzy
848+#~ msgid "Downloaded"
849+#~ msgstr "Qulluumah"
850+
975851#~ msgctxt "Title: Reboot/Shut down dialog"
976852#~ msgid "Shut down"
977853#~ msgstr "Bargus"
@@ -990,12 +866,6 @@ msgstr ""
990866#~ msgid "Enter %1"
991867#~ msgstr "%1 culus"
992868
993−#~ msgid "Enter passphrase"
994−#~ msgstr "Tatur-maxco culus"
995−
996−#~ msgid "Enter passcode"
997−#~ msgstr "Tatur-mudenta culus"
998−
999869#~ msgctxt "Label: Type of security method"
1000870#~ msgid "Swipe"
1001871#~ msgstr "Uysuttuc"
po/am.po+369−369
@@ -7,85 +7,112 @@ msgid ""
77msgstr ""
88"Project-Id-Version: unity8\n"
99"Report-Msgid-Bugs-To: \n"
10−"POT-Creation-Date: 2018-10-08 13:29-0500\n"
11−"PO-Revision-Date: 2019-06-23 19:04+0000\n"
10+"POT-Creation-Date: 2021-01-29 11:42-0600\n"
11+"PO-Revision-Date: 2021-08-29 20:18+0000\n"
1212"Last-Translator: Samson <sambelet@yahoo.com>\n"
13−"Language-Team: Amharic <https://translate.ubports.com/projects/unity8/unity8/"
14−"am/>\n"
13+"Language-Team: Amharic <https://translate.ubports.com/projects/ubports/"
14+"lomiri/am/>\n"
1515"Language: am\n"
1616"MIME-Version: 1.0\n"
1717"Content-Type: text/plain; charset=UTF-8\n"
1818"Content-Transfer-Encoding: 8bit\n"
1919"Plural-Forms: nplurals=2; plural=n > 1;\n"
20−"X-Generator: Weblate 3.6.1\n"
20+"X-Generator: Weblate 3.11.3\n"
2121"X-Launchpad-Export-Date: 2016-11-23 06:34+0000\n"
2222
23−#: plugins/LightDM/Greeter.cpp:123
23+#: plugins/LightDM/Greeter.cpp:199
2424msgid "Password: "
2525msgstr "የ መግቢያ ቃል: "
2626
27−#: plugins/Unity/Launcher/launcheritem.cpp:50
28−#: plugins/Unity/Launcher/launcheritem.cpp:109
27+#: plugins/LightDM/Greeter.cpp:214
28+msgid "Username"
29+msgstr "የ ተጠቃሚ ስም"
30+
31+#: plugins/LightDM/Greeter.cpp:258
32+msgid "Failed to authenticate"
33+msgstr "ማረጋገጥ አልተቻለም"
34+
35+#: plugins/LightDM/Greeter.cpp:260
36+msgid "Invalid password, please try again"
37+msgstr "ዋጋ የሌለው የ መግቢያ ቃል: እባክዎን እንደገና ይሞክሩ"
38+
39+#: plugins/LightDM/Greeter.cpp:270
40+msgid "Log In"
41+msgstr "መግቢያ"
42+
43+#: plugins/LightDM/Greeter.cpp:270
44+msgid "Retry"
45+msgstr "እንደገና ይሞክሩ"
46+
47+#: plugins/LightDM/UsersModel.cpp:157
48+msgid "Login"
49+msgstr "መግቢያ"
50+
51+#: plugins/LightDM/UsersModel.cpp:165
52+msgid "Guest Session"
53+msgstr "የ እንግዳ ክፍለ ጊዜ"
54+
55+#: plugins/Unity/Launcher/launcheritem.cpp:48
56+#: plugins/Unity/Launcher/launcheritem.cpp:122
2957msgid "Pin shortcut"
3058msgstr "አቋራጭ ማጣበቂያ"
3159
32−#: plugins/Unity/Launcher/launcheritem.cpp:55
60+#: plugins/Unity/Launcher/launcheritem.cpp:54
3361msgid "Quit"
3462msgstr "ማጥፊያ"
3563
36−#: plugins/Unity/Launcher/launcheritem.cpp:109
64+#: plugins/Unity/Launcher/launcheritem.cpp:122
3765msgid "Unpin shortcut"
3866msgstr "አቋራጭ መለያያ"
3967
40−#: qml/Components/Dialogs.qml:149
68+#: qml/Components/Dialogs.qml:176
4169msgctxt "Title: Lock/Log out dialog"
4270msgid "Log out"
4371msgstr "መውጫ"
4472
45−#: qml/Components/Dialogs.qml:150
73+#: qml/Components/Dialogs.qml:177
4674msgid "Are you sure you want to log out?"
4775msgstr "በእርግጥ መውጣት ይፈልጋሉ?"
4876
49−#: qml/Components/Dialogs.qml:152
77+#: qml/Components/Dialogs.qml:180
5078msgctxt "Button: Lock the system"
5179msgid "Lock"
5280msgstr "መቆለፊያ"
5381
54−#: qml/Components/Dialogs.qml:159
82+#: qml/Components/Dialogs.qml:191
5583msgctxt "Button: Log out from the system"
5684msgid "Log Out"
5785msgstr "መውጫ"
5886
59−#: qml/Components/Dialogs.qml:166 qml/Components/Dialogs.qml:222
60−#: qml/Dash/DashPageHeader.qml:324 qml/Greeter/NarrowView.qml:232
61−#: qml/Wizard/Pages/passcode-confirm.qml:32
87+#: qml/Components/Dialogs.qml:199 qml/Components/Dialogs.qml:284
88+#: qml/Greeter/NarrowView.qml:215 qml/Wizard/Pages/passcode-confirm.qml:32
6289#: qml/Wizard/Pages/passcode-set.qml:32
6390msgid "Cancel"
6491msgstr "መሰረዣ"
6592
66−#: qml/Components/Dialogs.qml:178
93+#: qml/Components/Dialogs.qml:211
6794msgctxt "Title: Reboot dialog"
6895msgid "Reboot"
6996msgstr "እንደገና ማስነሻ"
7097
71−#: qml/Components/Dialogs.qml:179
98+#: qml/Components/Dialogs.qml:212
7299msgid "Are you sure you want to reboot?"
73100msgstr "በእርግጥ እንደገና ማስነሳት ይፈልጋሉ?"
74101
75−#: qml/Components/Dialogs.qml:181
102+#: qml/Components/Dialogs.qml:215
76103msgid "No"
77104msgstr "አይ"
78105
79−#: qml/Components/Dialogs.qml:187
106+#: qml/Components/Dialogs.qml:223
80107msgid "Yes"
81108msgstr "አዎ"
82109
83−#: qml/Components/Dialogs.qml:202
110+#: qml/Components/Dialogs.qml:243
84111msgctxt "Title: Power off/Restart dialog"
85112msgid "Power"
86113msgstr "ሐይል"
87114
88−#: qml/Components/Dialogs.qml:203
115+#: qml/Components/Dialogs.qml:244
89116msgid ""
90117"Are you sure you would like\n"
91118"to power off?"
@@ -93,23 +120,27 @@ msgstr ""
93120"በእርግጥ ሐይሉን ማጥፋት\n"
94121"ይፈልጋሉ?"
95122
96−#: qml/Components/Dialogs.qml:205
123+#: qml/Components/Dialogs.qml:248
97124msgctxt "Button: Power off the system"
98125msgid "Power off"
99126msgstr "ሐይል ማጥፊያ"
100127
101−#: qml/Components/Dialogs.qml:214
128+#: qml/Components/Dialogs.qml:263
102129msgctxt "Button: Restart the system"
103130msgid "Restart"
104131msgstr "እንደገና ማስጀመሪያ"
105132
133+#: qml/Components/Dialogs.qml:276
134+msgid "Screenshot"
135+msgstr "መመልከቻ ፎቶ ማንሻ"
136+
106137#: qml/Components/KeyboardShortcutsOverlay.qml:41
107138msgid "Keyboard Shortcuts"
108139msgstr "የ ፊደል ገበታ አቋራጮች"
109140
110141#: qml/Components/KeyboardShortcutsOverlay.qml:55
111−msgid "Unity 8"
112−msgstr "Unity 8"
142+msgid "Lomiri"
143+msgstr "Lomiri"
113144
114145#: qml/Components/KeyboardShortcutsOverlay.qml:62
115146msgid "PrtScr"
@@ -124,8 +155,8 @@ msgid "Alt + PrtScr"
124155msgstr "Alt + PrtScr"
125156
126157#: qml/Components/KeyboardShortcutsOverlay.qml:80
127−msgid "Takes a screenshot of a window."
128−msgstr "የ መስኮት መመልከቻ ፎቶ ማንሻ"
158+msgid "Takes a screenshot of the current window."
159+msgstr "የ አሁኑን መስኮት መመልከቻ ፎቶ ማንሻ"
129160
130161#: qml/Components/KeyboardShortcutsOverlay.qml:88
131162msgid "Super + Space"
@@ -143,127 +174,131 @@ msgstr "Super + Shift + Space"
143174msgid "Switches to previous keyboard layout."
144175msgstr "ወዳለፈው የ ፊደል ገበታ እቅድ መቀየሪያ"
145176
146−#: qml/Components/KeyboardShortcutsOverlay.qml:118
177+#: qml/Components/KeyboardShortcutsOverlay.qml:114
178+msgid "Ctrl + Alt + T"
179+msgstr "Ctrl + Alt + T"
180+
181+#: qml/Components/KeyboardShortcutsOverlay.qml:119
182+msgid "Starts the Terminal application."
183+msgstr "የ ተርሚናል መተግበሪያ ማስጀመሪያ"
184+
185+#: qml/Components/KeyboardShortcutsOverlay.qml:131
147186msgid "Launcher"
148187msgstr "ማስነሻ"
149188
150−#: qml/Components/KeyboardShortcutsOverlay.qml:125
189+#: qml/Components/KeyboardShortcutsOverlay.qml:138
151190msgid "Super (Hold)"
152191msgstr "Super (ይጫኑ)"
153192
154−#: qml/Components/KeyboardShortcutsOverlay.qml:130
193+#: qml/Components/KeyboardShortcutsOverlay.qml:143
155194msgid "Opens the launcher, displays shortcuts."
156195msgstr "ማስነሻውን መክፈቻ እና አቋራጮች ማሳያ"
157196
158−#: qml/Components/KeyboardShortcutsOverlay.qml:138
197+#: qml/Components/KeyboardShortcutsOverlay.qml:151
159198msgid "Alt + F1"
160199msgstr "Alt + F1"
161200
162−#: qml/Components/KeyboardShortcutsOverlay.qml:143
201+#: qml/Components/KeyboardShortcutsOverlay.qml:156
163202msgid "Opens launcher keyboard navigation mode."
164203msgstr "መክፈቻ በ ፊደል ገበታ መቃኛ ዘዴ ማስነሻ"
165204
166−#: qml/Components/KeyboardShortcutsOverlay.qml:151
205+#: qml/Components/KeyboardShortcutsOverlay.qml:164
167206msgid "Super + Tab"
168207msgstr "Super + Tab"
169208
170−#: qml/Components/KeyboardShortcutsOverlay.qml:156
209+#: qml/Components/KeyboardShortcutsOverlay.qml:169
171210msgid "Switches applications via the launcher."
172211msgstr "መተግበሪያዎችን በ ማስጀመሪያ መቀየሪያ"
173212
174−#: qml/Components/KeyboardShortcutsOverlay.qml:164
175−msgid "Super + 0 to 9"
213+#: qml/Components/KeyboardShortcutsOverlay.qml:177
214+msgid "Super + 1 to 0"
176215msgstr "Super + 0 እስከ 9"
177216
178−#: qml/Components/KeyboardShortcutsOverlay.qml:169
217+#: qml/Components/KeyboardShortcutsOverlay.qml:182
179218msgid "Same as clicking on a launcher icon."
180219msgstr "ተመሳሳይ በ ማስጀመሪያ ምልክት ላይ እንደ መጫን"
181220
182−#: qml/Components/KeyboardShortcutsOverlay.qml:181
183−msgid "Scopes"
184−msgstr "ክልል"
221+#: qml/Components/KeyboardShortcutsOverlay.qml:190
222+msgid "Super + A"
223+msgstr "Super + A"
185224
186−#: qml/Components/KeyboardShortcutsOverlay.qml:188
187−msgid "Super (Tap)"
188−msgstr "Super (Tap)"
225+#: qml/Components/KeyboardShortcutsOverlay.qml:195
226+msgid "Opens the Application Drawer."
227+msgstr "የ መሳያ መተግበሪያ ማስጀመሪያ"
189228
190−#: qml/Components/KeyboardShortcutsOverlay.qml:193
191−msgid "Opens the Scopes home."
192−msgstr "የ ክልል ቤት መክፈቻ"
193−
194−#: qml/Components/KeyboardShortcutsOverlay.qml:209
229+#: qml/Components/KeyboardShortcutsOverlay.qml:235
195230msgid "Switching"
196231msgstr "በ መቀየር ላይ"
197232
198−#: qml/Components/KeyboardShortcutsOverlay.qml:216
233+#: qml/Components/KeyboardShortcutsOverlay.qml:242
199234msgid "Alt + Tab"
200235msgstr "Alt + Tab"
201236
202−#: qml/Components/KeyboardShortcutsOverlay.qml:221
237+#: qml/Components/KeyboardShortcutsOverlay.qml:247
203238msgid "Switches between applications."
204239msgstr "በ መተግበሪያዎች መካከል መቀያየሪያ"
205240
206−#: qml/Components/KeyboardShortcutsOverlay.qml:229
241+#: qml/Components/KeyboardShortcutsOverlay.qml:255
207242msgid "Super + W"
208243msgstr "Super + W"
209244
210−#: qml/Components/KeyboardShortcutsOverlay.qml:234
245+#: qml/Components/KeyboardShortcutsOverlay.qml:260
211246msgid "Opens the desktop spread."
212247msgstr "የ ዴስክቶፕ ማስፊያ መክፈቻ"
213248
214−#: qml/Components/KeyboardShortcutsOverlay.qml:242
249+#: qml/Components/KeyboardShortcutsOverlay.qml:268
215250msgid "Cursor Left or Right"
216251msgstr "መጠቆሚያ የ ግራ ወይንም የ ቀኝ"
217252
218−#: qml/Components/KeyboardShortcutsOverlay.qml:247
253+#: qml/Components/KeyboardShortcutsOverlay.qml:273
219254msgid "Moves the focus."
220255msgstr "ትኩረት ማንቀሳቀሻ"
221256
222−#: qml/Components/KeyboardShortcutsOverlay.qml:259
257+#: qml/Components/KeyboardShortcutsOverlay.qml:285
223258msgid "Windows"
224259msgstr "መስኮቶች"
225260
226−#: qml/Components/KeyboardShortcutsOverlay.qml:266
261+#: qml/Components/KeyboardShortcutsOverlay.qml:292
227262msgid "Ctrl + Super + D"
228263msgstr "Ctrl + Super + D"
229264
230−#: qml/Components/KeyboardShortcutsOverlay.qml:271
265+#: qml/Components/KeyboardShortcutsOverlay.qml:297
231266msgid "Minimizes all windows."
232267msgstr "ሁሉንም መስኮቶች ማሳነሻ"
233268
234−#: qml/Components/KeyboardShortcutsOverlay.qml:279
269+#: qml/Components/KeyboardShortcutsOverlay.qml:305
235270msgid "Ctrl + Super + Up"
236271msgstr "Ctrl + Super + Up"
237272
238−#: qml/Components/KeyboardShortcutsOverlay.qml:284
273+#: qml/Components/KeyboardShortcutsOverlay.qml:310
239274msgid "Maximizes the current window."
240275msgstr "የ አሁኑን መስኮት ማሳደጊያ"
241276
242−#: qml/Components/KeyboardShortcutsOverlay.qml:292
277+#: qml/Components/KeyboardShortcutsOverlay.qml:318
243278msgid "Ctrl + Super + Down"
244279msgstr "Ctrl + Super + Down"
245280
246−#: qml/Components/KeyboardShortcutsOverlay.qml:297
281+#: qml/Components/KeyboardShortcutsOverlay.qml:323
247282msgid "Minimizes or restores the current window."
248283msgstr "የ አሁኑን መስኮትማሳነሻ ወይንም እንደ ነበር መመለሻ"
249284
250−#: qml/Components/KeyboardShortcutsOverlay.qml:305
285+#: qml/Components/KeyboardShortcutsOverlay.qml:331
251286msgid "Ctrl + Super + Left or Right"
252287msgstr "Ctrl + Super + Left or Right"
253288
254−#: qml/Components/KeyboardShortcutsOverlay.qml:310
289+#: qml/Components/KeyboardShortcutsOverlay.qml:336
255290msgid "Semi-maximizes the current window."
256291msgstr "የ አሁኑን መስኮት በ ንዑስ-ማሳደጊያ"
257292
258−#: qml/Components/KeyboardShortcutsOverlay.qml:318
293+#: qml/Components/KeyboardShortcutsOverlay.qml:344
259294msgid "Alt + F4"
260295msgstr "Alt + F4"
261296
262−#: qml/Components/KeyboardShortcutsOverlay.qml:323
297+#: qml/Components/KeyboardShortcutsOverlay.qml:349
263298msgid "Closes the current window."
264299msgstr "የ አሁኑን መስኮት መዝጊያ"
265300
266−#: qml/Components/Lockscreen.qml:212 qml/Greeter/NarrowView.qml:252
301+#: qml/Components/Lockscreen.qml:212 qml/Greeter/NarrowView.qml:235
267302msgid "Return to Call"
268303msgstr "ወደ ጥሪ መመለሻ"
269304
@@ -271,7 +306,7 @@ msgstr "ወደ ጥሪ መመለሻ"
271306msgid "Emergency Call"
272307msgstr "የ ድንገተኛ ጥሪ"
273308
274−#: qml/Components/Lockscreen.qml:244
309+#: qml/Components/Lockscreen.qml:245
275310msgid "OK"
276311msgstr "እሺ"
277312
@@ -285,29 +320,29 @@ msgstr "%1:%2:%3"
285320msgid "%1:%2"
286321msgstr "%1:%2"
287322
288−#: qml/Components/ModeSwitchWarningDialog.qml:32
323+#: qml/Components/ModeSwitchWarningDialog.qml:33
289324msgid "Apps may have unsaved data:"
290325msgstr "መተግበሪያው ያልተቀመጠ ዳታ ይዟል:"
291326
292−#: qml/Components/ModeSwitchWarningDialog.qml:57
327+#: qml/Components/ModeSwitchWarningDialog.qml:60
293328msgctxt ""
294329"Re-dock means connect the device again to an external screen/mouse/keyboard"
295330msgid "Re-dock, save your work and close these apps to continue."
296331msgstr "እንደገና-ማሳረፊያ: ስራዎትን ያስቀምጡ እና ይዝጉ መተግበሪያው እንዲቀጥል"
297332
298−#: qml/Components/ModeSwitchWarningDialog.qml:63
333+#: qml/Components/ModeSwitchWarningDialog.qml:67
299334msgid "Or force close now (unsaved data will be lost)."
300335msgstr "ወይንም አሁን አስገድዶ ማጥፊያ (ያልተቀመጠ ዳታ ይጠፋል)"
301336
302−#: qml/Components/ModeSwitchWarningDialog.qml:75
337+#: qml/Components/ModeSwitchWarningDialog.qml:80
303338msgid "OK, I will reconnect"
304339msgstr "እሺ: እኔ አሁን እንደገና እገናኛለሁ"
305340
306−#: qml/Components/ModeSwitchWarningDialog.qml:76
341+#: qml/Components/ModeSwitchWarningDialog.qml:81
307342msgid "Reconnect now!"
308343msgstr "አሁን እንደገና መገናኛ!"
309344
310−#: qml/Components/ModeSwitchWarningDialog.qml:88
345+#: qml/Components/ModeSwitchWarningDialog.qml:94
311346msgid "Close all"
312347msgstr "ሁሉንም መዝጊያ"
313348
@@ -315,109 +350,28 @@ msgstr "ሁሉንም መዝጊያ"
315350msgid "Preview Share Item"
316351msgstr "የሚካፈሉትን እቃ ቅድመ እይታ"
317352
318−#: qml/Dash/DashPageHeader.qml:361
319−msgctxt "Button: Open the Ubuntu Store"
320−msgid "Store"
321−msgstr "ማስቀመጫ"
322−
323−#: qml/Dash/DashPageHeader.qml:368
324−msgctxt "Button: Start a search in the current dash scope"
325−msgid "Search"
326−msgstr "መፈለጊያ"
327−
328−#: qml/Dash/DashPageHeader.qml:378
329−msgctxt "Button: Show the current dash scope settings"
330−msgid "Settings"
331−msgstr "ማሰናጃዎች"
332−
333−#: qml/Dash/DashPageHeader.qml:385
334−msgid "Remove from Favorites"
335−msgstr "ከምወዳቸው ማስወገጃ"
336−
337−#: qml/Dash/DashPageHeader.qml:385
338−msgid "Add to Favorites"
339−msgstr "ወደምወዳቸው መጨመሪያ"
340−
341−#: qml/Dash/FiltersPopover.qml:61
342−msgid "Refine your results"
343−msgstr "የ እርስዎን ውጤቶች እንደገና ማጣሪያ"
344−
345−#: qml/Dash/FiltersPopover.qml:70
346−msgid "Reset"
347−msgstr "እንደ ነበረ መመለሻ"
348−
349−#: qml/Dash/GenericScopeView.qml:547 qml/Dash/GenericScopeView.qml:718
350−msgid "Show less"
351−msgstr "ትንሽ ማሳያ"
352−
353−#: qml/Dash/GenericScopeView.qml:547
354−msgid "Show all"
355−msgstr "ሁሉንም ማሳያ"
356−
357−#: qml/Dash/GenericScopeView.qml:578
358−msgctxt "Label: Hint for dash search line edit"
359−msgid "Search"
360−msgstr "መፈለጊያ"
361−
362−#: qml/Dash/PageHeaderExtraPanel.qml:67
363−msgid "Recent Searches"
364−msgstr "የ ቅርብ ጊዜ ፍለጋዎች"
365−
366−#: qml/Dash/PageHeaderExtraPanel.qml:78
367−msgid "Clear All"
368−msgstr "ሁሉንም ማጽጃ"
369−
370−#: qml/Dash/Previews/PreviewActionCombo.qml:36
371−msgid "More..."
372−msgstr "ተጨማሪ..."
373−
374−#: qml/Dash/Previews/PreviewActionCombo.qml:36
375−msgid "Less..."
376−msgstr "አነስተኛ..."
377−
378−#: qml/Dash/Previews/PreviewCommentInput.qml:83
379−#: qml/Dash/Previews/PreviewRatingInput.qml:202
380−msgid "Send"
381−msgstr "መላኪያ"
382−
383−#: qml/Dash/Previews/PreviewRatingInput.qml:109
384−msgid "Rate this"
385−msgstr "ለዚህ ደረጃ ይስጡ"
386−
387−#: qml/Dash/Previews/PreviewRatingInput.qml:184
388−msgid "Add a review"
389−msgstr "ግምገማ መጨመሪያ"
390−
391−#: qml/Dash/PullToRefreshScopeStyle.qml:56
392−msgid "Pull to refresh…"
393−msgstr "ይሳቡ ለማነቃቃት…"
394−
395−#: qml/Dash/PullToRefreshScopeStyle.qml:61
396−msgid "Release to refresh…"
397−msgstr "ይልቀቁ ለማነቃቃት…"
398−
399−#: qml/Dash/ScopeSettings/ScopeSettingBoolean.qml:43
400−msgid "Enable location data"
401−msgstr "የአካባቢ ዳታ ማስቻያ"
402−
403−#: qml/Dash/ScopesList.qml:57
404−msgid "Manage"
405−msgstr "አስተዳዳሪ"
406−
407−#: qml/Dash/ScopesList.qml:104
408−msgid "Home"
409−msgstr "ቤት"
410−
411−#: qml/Dash/ScopesList.qml:105
412−msgid "Also installed"
413−msgstr "እንዲሁም የተገጠሙ"
414−
415−#: qml/DisabledScreenNotice.qml:109
353+#: qml/Components/VirtualTouchPad.qml:317
416354msgid ""
417355"Your device is now connected to an external display. Use this screen as a "
418356"touch pad to interact with the pointer."
419357msgstr "የ እርስዎ አካል አሁን ከ ውጪ ማሳያ ጋር ተገናኝቷል: ይህን መመልከቻ እንደ ተችፓድ መጠቀሚያ"
420358
359+#: qml/Components/VirtualTouchPad.qml:327
360+msgid "Tap left button to click."
361+msgstr "የ ግራ ቁልፍ መታ ያድርጉ ለ መጫን"
362+
363+#: qml/Components/VirtualTouchPad.qml:339
364+msgid "Tap right button to right click."
365+msgstr "የ ቀኝ ቁልፍ መታ ያድርጉ በ ቀኝ ለ መጫን"
366+
367+#: qml/Components/VirtualTouchPad.qml:351
368+msgid "Swipe with two fingers to scroll."
369+msgstr "ለ መሸብለል በ ሁለት ጣቶች ይጥረጉ"
370+
371+#: qml/Components/VirtualTouchPad.qml:396
372+msgid "Find more settings in the system settings."
373+msgstr "ተጨማሪ ማሰናጃ በ ስርአት ማሰናጃ ውስጥ መፈለጊያ"
374+
421375#: qml/Greeter/CoverPage.qml:127
422376msgid "Unlock"
423377msgstr "መክፈቻ"
@@ -441,33 +395,45 @@ msgid_plural "Please wait %1 minutes and then try again…"
441395msgstr[0] "እባክዎን ይቆዩ %1 ደቂቃ እና ከዛ እንደ ገና ይምክሩ…"
442396msgstr[1] "እባክዎን ይቆዩ %1 ደቂቃዎች እና ከዛ እንደ ገና ይምክሩ…"
443397
444−#: qml/Greeter/Greeter.qml:596
398+#: qml/Greeter/Greeter.qml:550
445399msgid "Try again"
446400msgstr "እንደገና ይሞክሩ"
447401
448−#: qml/Greeter/LoginList.qml:70
402+#: qml/Greeter/Greeter.qml:551
403+msgid "Enter passphrase to unlock"
404+msgstr "የ ማለፊያ ሀረግ ያስገቡ"
405+
406+#: qml/Greeter/Greeter.qml:552
407+msgid "Enter passcode to unlock"
408+msgstr "የ ማለፊያ ኮድ ያስገቡ ለ መክፈት"
409+
410+#: qml/Greeter/NarrowView.qml:235
411+msgid "Emergency"
412+msgstr "ድንገተኛ"
413+
414+#: qml/Greeter/PromptList.qml:126
449415msgid "Passphrase"
450416msgstr "የማለፊያ ሐረግ"
451417
452−#: qml/Greeter/LoginList.qml:71
418+#: qml/Greeter/PromptList.qml:126
453419msgid "Passcode"
454420msgstr "ማለፊያ ኮድ"
455421
456−#: qml/Greeter/LoginList.qml:98 qml/Wizard/Pages/UpdateDelegate.qml:118
457−msgid "Retry"
458−msgstr "እንደገና ይሞክሩ"
422+#: qml/Greeter/SessionsList.qml:124
423+msgid "Select desktop environment"
424+msgstr "የ ዴስክቶፕ አይነት ይምረጡ"
459425
460−#: qml/Greeter/LoginList.qml:99
461−msgid "Log In"
462−msgstr "መግቢያ"
426+#: qml/Launcher/Drawer.qml:250
427+msgid "Search…"
428+msgstr "መፈለጊያ…"
463429
464−#: qml/Greeter/NarrowView.qml:252
465−msgid "Emergency"
466−msgstr "ድንገተኛ"
430+#: qml/Launcher/PullToRefreshScopeStyle.qml:56
431+msgid "Pull to refresh…"
432+msgstr "ይሳቡ ለማነቃቃት…"
467433
468−#: qml/Greeter/SessionsList.qml:122
469−msgid "Select desktop environment"
470−msgstr "የ ዴስክቶፕ አይነት ይምረጡ"
434+#: qml/Launcher/PullToRefreshScopeStyle.qml:61
435+msgid "Release to refresh…"
436+msgstr "ይልቀቁ ለማነቃቃት…"
471437
472438#: qml/Notifications/NotificationMenuItemFactory.qml:124
473439msgid "Show password"
@@ -481,63 +447,62 @@ msgstr "ወደ ጥሪው ለመመለስ መታ ያድርጉ..."
481447msgid "Conference"
482448msgstr "ስብሰባ"
483449
484−#: qml/Panel/Indicators/MenuItemFactory.qml:847
450+#: qml/Panel/Indicators/IndicatorMenuItemFactory.qml:869
485451msgid "Nothing is playing"
486452msgstr "ምንም አይጫወትም"
487453
488−#: qml/Panel/Indicators/MenuItemFactory.qml:975
454+#: qml/Panel/Indicators/IndicatorMenuItemFactory.qml:997
489455#, qt-format
490456msgid "%1 hour"
491457msgid_plural "%1 hours"
492458msgstr[0] "%1 ሰአት"
493459msgstr[1] "%1 ሰአቶች"
494460
495−#: qml/Panel/Indicators/MenuItemFactory.qml:979
461+#: qml/Panel/Indicators/IndicatorMenuItemFactory.qml:1001
496462#, qt-format
497463msgid "%1 minute"
498464msgid_plural "%1 minutes"
499465msgstr[0] "%1 ደቂቃ"
500466msgstr[1] "%1 ደቂቃዎች"
501467
502−#: qml/Panel/Indicators/MenuItemFactory.qml:984
468+#: qml/Panel/Indicators/IndicatorMenuItemFactory.qml:1006
503469#, qt-format
504470msgid "%1 second"
505471msgid_plural "%1 seconds"
506472msgstr[0] "%1 ሰከንድ"
507473msgstr[1] "%1 ሰከንዶች"
508474
509−#: qml/Panel/Indicators/MenuItemFactory.qml:987
475+#: qml/Panel/Indicators/IndicatorMenuItemFactory.qml:1009
510476msgid "0 seconds"
511477msgstr "0 ሰከንዶች"
512478
513479#. Translators: String like "1 hour, 2 minutes, 3 seconds remaining"
514−#: qml/Panel/Indicators/MenuItemFactory.qml:989
480+#: qml/Panel/Indicators/IndicatorMenuItemFactory.qml:1011
515481#, qt-format
516482msgid "%1 remaining"
517483msgstr "%1 የቀረው"
518484
519−#: qml/Panel/Indicators/MenuItemFactory.qml:995
485+#: qml/Panel/Indicators/IndicatorMenuItemFactory.qml:1017
520486msgid "In queue…"
521487msgstr "ወረፋ በመጠበቅ ላይ…"
522488
523−#: qml/Panel/Indicators/MenuItemFactory.qml:999
524−#: qml/Wizard/Pages/UpdateDelegate.qml:226
489+#: qml/Panel/Indicators/IndicatorMenuItemFactory.qml:1021
525490msgid "Downloading"
526491msgstr "በማውረድ ላይ"
527492
528−#: qml/Panel/Indicators/MenuItemFactory.qml:1001
493+#: qml/Panel/Indicators/IndicatorMenuItemFactory.qml:1023
529494msgid "Paused, tap to resume"
530495msgstr "ማስቆሚያ: ለመቀጠል መታ ያድርጉ"
531496
532−#: qml/Panel/Indicators/MenuItemFactory.qml:1003
497+#: qml/Panel/Indicators/IndicatorMenuItemFactory.qml:1025
533498msgid "Canceled"
534499msgstr "ተሰርዟል"
535500
536−#: qml/Panel/Indicators/MenuItemFactory.qml:1005
501+#: qml/Panel/Indicators/IndicatorMenuItemFactory.qml:1027
537502msgid "Finished"
538503msgstr "ጨርሷል"
539504
540−#: qml/Panel/Indicators/MenuItemFactory.qml:1007
505+#: qml/Panel/Indicators/IndicatorMenuItemFactory.qml:1029
541506msgid "Failed, tap to retry"
542507msgstr "አልተቻለም: እንደገና ለመሞከር መታ ያድርጉ"
543508
@@ -557,23 +522,33 @@ msgctxt "Button: Call back on phone"
557522msgid "Call back"
558523msgstr "መልሶ መደወያ"
559524
525+#: qml/Panel/PanelMenuPage.qml:92
526+msgid "Back"
527+msgstr "ወደ ኋላ"
528+
560529#: qml/Stage/SideStage.qml:76
561530msgid "Drag using 3 fingers any application from one window to the other"
562531msgstr "መጎተቻ 3 ጣቶች በ መጠቀም ማንኛውንም መተግበሪያ ከ አንድ መስኮት ወደ ሌላ"
563532
533+#: qml/Stage/Stage.qml:671
534+msgid "No running apps"
535+msgstr ""
536+
564537#: qml/Tutorial/TutorialLeftLong.qml:49
565−msgid "Long swipe from the left edge to open the Today scope"
538+#, fuzzy
539+#| msgid "Long swipe from the left edge to open the Today scope"
540+msgid "Long swipe from the left edge to open the Application Drawer"
566541msgstr "በ ረጅሙ ከ ግራ ጠርዝ በኩል ይጥረጉ የ ዛሬን ክልል ለ መክፈት"
567542
568543#: qml/Tutorial/TutorialLeft.qml:47
569544msgid "Short swipe from the left edge to open the launcher"
570545msgstr "በ አጭሩ ይጥረጉ ከ ግራ ጠርዝ በኩል ማስጀመሪያውን ለ መክፈት"
571546
572−#: qml/Tutorial/TutorialRight.qml:55
547+#: qml/Tutorial/TutorialRight.qml:54
573548msgid "Push your mouse against the right edge to view your open apps"
574549msgstr "የ እርስዎን አይጥ መጠቆሚያ ወደ ቀኝ ጠርዝ በኩል ያስጠጉ የ ተከፈቱ መተግበሪያዎችን ለ መመልከት"
575550
576−#: qml/Tutorial/TutorialRight.qml:56
551+#: qml/Tutorial/TutorialRight.qml:55
577552msgid "Swipe from the right edge to view your open apps"
578553msgstr "ከ ቀኝ በኩል ይጥረጉ የ ተከፈቱ መተግበሪያዎችን ለ መመልከት"
579554
@@ -590,15 +565,13 @@ msgstr "ወደ ኋላ"
590565msgid "Language"
591566msgstr "ቋንቋ"
592567
593−#: qml/Wizard/Pages/10-welcome.qml:175
568+#: qml/Wizard/Pages/10-welcome.qml:176
594569#: qml/Wizard/Pages/10-welcome-update.qml:126
595570#: qml/Wizard/Pages/11-changelog.qml:74 qml/Wizard/Pages/20-keyboard.qml:152
596−#: qml/Wizard/Pages/30-wifi.qml:208 qml/Wizard/Pages/50-timezone.qml:272
597−#: qml/Wizard/Pages/60-account.qml:66 qml/Wizard/Pages/70-passwd-type.qml:146
598−#: qml/Wizard/Pages/75-report-check.qml:85
599−#: qml/Wizard/Pages/76-app-update.qml:236
600−#: qml/Wizard/Pages/passcode-desktop.qml:142
601−#: qml/Wizard/Pages/password-set.qml:142
571+#: qml/Wizard/Pages/30-wifi.qml:214 qml/Wizard/Pages/50-timezone.qml:272
572+#: qml/Wizard/Pages/60-account.qml:72 qml/Wizard/Pages/70-passwd-type.qml:146
573+#: qml/Wizard/Pages/passcode-desktop.qml:154
574+#: qml/Wizard/Pages/password-set.qml:153
602575msgid "Next"
603576msgstr "ይቀጥሉ"
604577
@@ -630,9 +603,9 @@ msgstr "የ ፊደል ገበታ ቋንቋ"
630603msgid "Keyboard layout"
631604msgstr "የ ፊደል ገበታ አቀራረብ"
632605
633−#: qml/Wizard/Pages/20-keyboard.qml:152 qml/Wizard/Pages/30-wifi.qml:208
634−#: qml/Wizard/Pages/60-account.qml:66 qml/Wizard/Pages/76-app-update.qml:240
635−#: qml/Wizard/Pages/79-system-update.qml:152 qml/Wizard/Pages/sim.qml:101
606+#: qml/Wizard/Pages/20-keyboard.qml:152 qml/Wizard/Pages/30-wifi.qml:214
607+#: qml/Wizard/Pages/60-account.qml:72 qml/Wizard/Pages/79-system-update.qml:144
608+#: qml/Wizard/Pages/sim.qml:101
636609msgid "Skip"
637610msgstr "መዝለያ"
638611
@@ -640,15 +613,15 @@ msgstr "መዝለያ"
640613msgid "Connect to Wi‑Fi"
641614msgstr "ወደ ዋይ‑ፋይ መገናኛ"
642615
643−#: qml/Wizard/Pages/30-wifi.qml:133
616+#: qml/Wizard/Pages/30-wifi.qml:139
644617msgid "Connected"
645618msgstr "ተገናኝቷል"
646619
647−#: qml/Wizard/Pages/30-wifi.qml:166
620+#: qml/Wizard/Pages/30-wifi.qml:172
648621msgid "Available Wi-Fi networks"
649622msgstr "ዝግጁ የ ዋይ-ፋይ ኔትዎርኮች"
650623
651−#: qml/Wizard/Pages/30-wifi.qml:167
624+#: qml/Wizard/Pages/30-wifi.qml:173
652625msgid "No available Wi-Fi networks"
653626msgstr "ምንም ዝግጁ ዋይ-ፋይ ኔትዎርኮች አልተገኙም"
654627
@@ -664,7 +637,7 @@ msgstr "የ እርስዎን ከተማ ያስገቡ"
664637msgid "Personalize Your Device"
665638msgstr "የ እርስዎን አካል የ ግልዎ ያድርጉ"
666639
667−#: qml/Wizard/Pages/60-account.qml:49
640+#: qml/Wizard/Pages/60-account.qml:54
668641msgid "Preferred Name"
669642msgstr "የመረጡት ስም"
670643
@@ -687,47 +660,6 @@ msgctxt "Label: Type of security method"
687660msgid "No lock code"
688661msgstr "ምንም መቆለፊያ ኮድ አልተገኘም"
689662
690−#: qml/Wizard/Pages/75-report-check.qml:26
691−msgid "Privacy Policy"
692−msgstr "የ ግላዊነት መመሪያ"
693−
694−#: qml/Wizard/Pages/75-report-check.qml:26
695−msgid "Help Us Improve"
696−msgstr "እንድንሻሻል ይርዱን"
697−
698−#: qml/Wizard/Pages/75-report-check.qml:60
699−msgid "Improve system performance by sending us crashes and error reports."
700−msgstr "የ ስርአቱን አፈጻጸም ለማሻሻል የ ግጭት እና የ ስህተት መልእክቶች ይላኩልን"
701−
702−#: qml/Wizard/Pages/75-report-check.qml:61
703−msgid "Privacy policy"
704−msgstr "የ ግላዊነት መመሪያ"
705−
706−#: qml/Wizard/Pages/76-app-update.qml:35
707−msgid "Update Apps"
708−msgstr "መተግበሪያ ማሻሻያ"
709−
710−#: qml/Wizard/Pages/76-app-update.qml:127
711−msgid "This device is not connected to the internet."
712−msgstr "ይህ አካል ከ ኢንተርኔት ጋር አልተገናኘም:"
713−
714−#: qml/Wizard/Pages/76-app-update.qml:128
715−#: qml/Wizard/Pages/76-app-update.qml:134
716−msgid "Use the OpenStore app to check for updates once connected."
717−msgstr ""
718−
719−#: qml/Wizard/Pages/76-app-update.qml:130
720−msgid "Software is up to date"
721−msgstr "ሶፍትዌሩ ዘመናዊ ነው:"
722−
723−#: qml/Wizard/Pages/76-app-update.qml:133
724−msgid "The update server is not responding."
725−msgstr "የ ማሻሻያ ሰርቨር አይመልስም:"
726−
727−#: qml/Wizard/Pages/76-app-update.qml:238
728−msgid "Please wait..."
729−msgstr "እባክዎን ይቆዩ..."
730−
731663#: qml/Wizard/Pages/79-system-update.qml:28
732664msgid "Update Device"
733665msgstr "አካሉን ማሻሻያ"
@@ -739,8 +671,11 @@ msgid ""
739671msgstr "የ ስርአት ማሻሻያ ዝግጁ ነው ለ መግጠም: ከዚያ በኋላ አካሉ ራሱ በራሱ እንደገና ይጀምራል"
740672
741673#: qml/Wizard/Pages/79-system-update.qml:76
674+#, fuzzy
675+#| msgctxt "string identifying name of the update"
676+#| msgid "Ubuntu system"
742677msgctxt "string identifying name of the update"
743−msgid "Ubuntu system"
678+msgid "Ubuntu Touch system"
744679msgstr "የ ኡቡቱ ስርአት"
745680
746681#: qml/Wizard/Pages/79-system-update.qml:83
@@ -749,11 +684,11 @@ msgctxt "version of the system update"
749684msgid "Version %1"
750685msgstr "እትም %1"
751686
752−#: qml/Wizard/Pages/79-system-update.qml:102
687+#: qml/Wizard/Pages/79-system-update.qml:95
753688msgid "This could take a few minutes..."
754−msgstr "ይህ ትንሽ ደቂቆች ይወስዳል"
689+msgstr "ይህ ትንሽ ደቂቃዎች ይወስዳል..."
755690
756−#: qml/Wizard/Pages/79-system-update.qml:116
691+#: qml/Wizard/Pages/79-system-update.qml:109
757692msgid "Install and restart now"
758693msgstr "መግጠሚያ እና እንደገና ማስጀመሪያ"
759694
@@ -777,31 +712,8 @@ msgstr "ይቀጥሉ"
777712msgid "Get Started"
778713msgstr "እንጀምር"
779714
780−#: qml/Wizard/Pages/DownloadHandler.qml:174
781−msgid "Installation failed"
782−msgstr "መግጠሙ አልተሳካም:"
783−
784−#: qml/Wizard/Pages/GlobalUpdateControls.qml:84
785−msgid "Checking for updates…"
786−msgstr "ማሻሻያ በ መፈለግ ላይ…"
787−
788−#: qml/Wizard/Pages/GlobalUpdateControls.qml:109
789−#, qt-format
790−msgid "%1 update available"
791−msgid_plural "%1 updates available"
792−msgstr[0] "%1 ማሻሻያ ዝግጁ ነው:"
793−msgstr[1] "%1 ማሻሻያዎች ዝግጁ ናቸው:"
794−
795−#: qml/Wizard/Pages/GlobalUpdateControls.qml:119
796−msgid "Update all…"
797−msgstr "ሁሉንም ማሻሻያ…"
798−
799−#: qml/Wizard/Pages/GlobalUpdateControls.qml:121
800−msgid "Update all"
801−msgstr "ሁሉንም ማሻሻያ"
802−
803715#: qml/Wizard/Pages/passcode-confirm.qml:43
804−#: qml/Wizard/Pages/passcode-desktop.qml:97
716+#: qml/Wizard/Pages/passcode-desktop.qml:104
805717msgid "Confirm passcode"
806718msgstr "የማለፊያ ኮድ ማረጋገጫ"
807719
@@ -818,24 +730,24 @@ msgstr "እባክዎን እንደገና-ያስገቡ"
818730msgid "Lock Screen Passcode"
819731msgstr "የ መመልከቻው መቆለፊያ የ ማለፊያ ኮድ"
820732
821−#: qml/Wizard/Pages/passcode-desktop.qml:61
733+#: qml/Wizard/Pages/passcode-desktop.qml:68
822734msgid "Enter 4 numbers to setup your passcode"
823735msgstr "ያስገቡ 4 ቁጥሮች የ እርስዎን የ ማለፊያ ኮድ ለማሰናዳት"
824736
825−#: qml/Wizard/Pages/passcode-desktop.qml:77
737+#: qml/Wizard/Pages/passcode-desktop.qml:84
826738#: qml/Wizard/Pages/passcode-set.qml:54
827739msgid "Choose passcode"
828740msgstr "የ ማለፊያ ኮድ ይምረጡ"
829741
830−#: qml/Wizard/Pages/passcode-desktop.qml:127
742+#: qml/Wizard/Pages/passcode-desktop.qml:139
831743msgid "Passcode too short"
832744msgstr "የ ማለፊያ ኮዱ በጣም አጭር ነው"
833745
834−#: qml/Wizard/Pages/passcode-desktop.qml:129
746+#: qml/Wizard/Pages/passcode-desktop.qml:141
835747msgid "Passcodes match"
836748msgstr "የ ማለፊያ ኮዶቹ ተመሳሳይ ናቸው"
837749
838−#: qml/Wizard/Pages/passcode-desktop.qml:131
750+#: qml/Wizard/Pages/passcode-desktop.qml:143
839751msgid "Passcodes do not match"
840752msgstr "የ ማለፊያ ኮዶቹ አይመሳሰሉም"
841753
@@ -847,15 +759,15 @@ msgstr "የ ማለፊያ ኮድ 4 ባህሪዎች መሆን አለበት"
847759msgid "Lock Screen Password"
848760msgstr "የ መመልከቻ መቆለፊያ የ መግቢያ ቃል"
849761
850−#: qml/Wizard/Pages/password-set.qml:62
762+#: qml/Wizard/Pages/password-set.qml:68
851763msgid "Enter at least 8 characters"
852764msgstr "ያስገቡ ቢያንስ 8 ባህሪዎች"
853765
854−#: qml/Wizard/Pages/password-set.qml:74
766+#: qml/Wizard/Pages/password-set.qml:80
855767msgid "Choose password"
856768msgstr "የ መግቢያ ቃል ይምረጡ"
857769
858−#: qml/Wizard/Pages/password-set.qml:104
770+#: qml/Wizard/Pages/password-set.qml:110
859771msgid "Confirm password"
860772msgstr "የ መግቢያ ቃሉን ያረጋግጡ"
861773
@@ -883,68 +795,6 @@ msgstr "ያለ ሲም ካርድ እርስዎ ጥሪ መፈጸም ወይንም
883795msgid "To proceed with no SIM tap Skip."
884796msgstr "ያለ ሲም ለ መቀጠል መዝለያውን መታ ያድርጉ"
885797
886−#: qml/Wizard/Pages/UpdateDelegate.qml:123
887−msgid "Update"
888−msgstr "ማሻሻያ"
889−
890−#: qml/Wizard/Pages/UpdateDelegate.qml:125
891−msgid "Download"
892−msgstr "የ ወረደ"
893−
894−#: qml/Wizard/Pages/UpdateDelegate.qml:131
895−msgid "Resume"
896−msgstr "ይቀጥሉ"
897−
898−#: qml/Wizard/Pages/UpdateDelegate.qml:138
899−msgid "Pause"
900−msgstr ""
901−
902−#: qml/Wizard/Pages/UpdateDelegate.qml:142
903−msgid "Install…"
904−msgstr "መግጠሚያ…"
905−
906−#: qml/Wizard/Pages/UpdateDelegate.qml:144
907−msgid "Install"
908−msgstr "መግጠሚያ"
909−
910−#: qml/Wizard/Pages/UpdateDelegate.qml:148
911−msgid "Open"
912−msgstr "መክፈቻ"
913−
914−#: qml/Wizard/Pages/UpdateDelegate.qml:216
915−msgid "Installing"
916−msgstr "በ መግጠም ላይ"
917−
918−#: qml/Wizard/Pages/UpdateDelegate.qml:220
919−msgid "Paused"
920−msgstr ""
921−
922−#: qml/Wizard/Pages/UpdateDelegate.qml:223
923−msgid "Waiting to download"
924−msgstr "ለ ማውረድ በ መጠበቅ ላይ"
925−
926−#: qml/Wizard/Pages/UpdateDelegate.qml:279
927−#, qt-format
928−msgid "%1 of %2"
929−msgstr "%1 ከ %2"
930−
931−#: qml/Wizard/Pages/UpdateDelegate.qml:283
932−msgid "Downloaded"
933−msgstr "የ ወረደ"
934−
935−#: qml/Wizard/Pages/UpdateDelegate.qml:286
936−msgid "Installed"
937−msgstr "ተገጥሟል:"
938−
939−#: qml/Wizard/Pages/UpdateDelegate.qml:291
940−#, qt-format
941−msgid "Updated %1"
942−msgstr "ተሻሽሏል %1"
943−
944−#: qml/Wizard/Pages/UpdateDelegate.qml:315
945−msgid "Update failed"
946−msgstr "ማሻሻል አልተቻለም:"
947−
948798#: qml/Wizard/PasswordMeter.qml:87
949799msgid "Password too short"
950800msgstr "የ መግቢያ ቃል በጣም አጭር ነው"
@@ -973,6 +823,168 @@ msgstr "ደካማ የ መግቢያ ቃል"
973823msgid "Very weak password"
974824msgstr "በጣም ደካማ የ መግቢያ ቃል"
975825
826+#~ msgid "Unity 8"
827+#~ msgstr "Unity 8"
828+
829+#~ msgid "Scopes"
830+#~ msgstr "ክልል"
831+
832+#~ msgid "Super (Tap)"
833+#~ msgstr "Super (Tap)"
834+
835+#~ msgid "Opens the Scopes home."
836+#~ msgstr "የ ክልል ቤት መክፈቻ"
837+
838+#~ msgctxt "Button: Open the Ubuntu Store"
839+#~ msgid "Store"
840+#~ msgstr "ማስቀመጫ"
841+
842+#~ msgctxt "Button: Start a search in the current dash scope"
843+#~ msgid "Search"
844+#~ msgstr "መፈለጊያ"
845+
846+#~ msgctxt "Button: Show the current dash scope settings"
847+#~ msgid "Settings"
848+#~ msgstr "ማሰናጃዎች"
849+
850+#~ msgid "Remove from Favorites"
851+#~ msgstr "ከምወዳቸው ማስወገጃ"
852+
853+#~ msgid "Add to Favorites"
854+#~ msgstr "ወደምወዳቸው መጨመሪያ"
855+
856+#~ msgid "Refine your results"
857+#~ msgstr "የ እርስዎን ውጤቶች እንደገና ማጣሪያ"
858+
859+#~ msgid "Reset"
860+#~ msgstr "እንደ ነበረ መመለሻ"
861+
862+#~ msgid "Show less"
863+#~ msgstr "ትንሽ ማሳያ"
864+
865+#~ msgid "Show all"
866+#~ msgstr "ሁሉንም ማሳያ"
867+
868+#~ msgctxt "Label: Hint for dash search line edit"
869+#~ msgid "Search"
870+#~ msgstr "መፈለጊያ"
871+
872+#~ msgid "Recent Searches"
873+#~ msgstr "የ ቅርብ ጊዜ ፍለጋዎች"
874+
875+#~ msgid "Clear All"
876+#~ msgstr "ሁሉንም ማጽጃ"
877+
878+#~ msgid "More..."
879+#~ msgstr "ተጨማሪ..."
880+
881+#~ msgid "Less..."
882+#~ msgstr "አነስተኛ..."
883+
884+#~ msgid "Send"
885+#~ msgstr "መላኪያ"
886+
887+#~ msgid "Rate this"
888+#~ msgstr "ለዚህ ደረጃ ይስጡ"
889+
890+#~ msgid "Add a review"
891+#~ msgstr "ግምገማ መጨመሪያ"
892+
893+#~ msgid "Enable location data"
894+#~ msgstr "የአካባቢ ዳታ ማስቻያ"
895+
896+#~ msgid "Manage"
897+#~ msgstr "አስተዳዳሪ"
898+
899+#~ msgid "Home"
900+#~ msgstr "ቤት"
901+
902+#~ msgid "Also installed"
903+#~ msgstr "እንዲሁም የተገጠሙ"
904+
905+#~ msgid "Privacy Policy"
906+#~ msgstr "የ ግላዊነት መመሪያ"
907+
908+#~ msgid "Help Us Improve"
909+#~ msgstr "እንድንሻሻል ይርዱን"
910+
911+#~ msgid "Improve system performance by sending us crashes and error reports."
912+#~ msgstr "የ ስርአቱን አፈጻጸም ለማሻሻል የ ግጭት እና የ ስህተት መልእክቶች ይላኩልን"
913+
914+#~ msgid "Privacy policy"
915+#~ msgstr "የ ግላዊነት መመሪያ"
916+
917+#~ msgid "Update Apps"
918+#~ msgstr "መተግበሪያ ማሻሻያ"
919+
920+#~ msgid "This device is not connected to the internet."
921+#~ msgstr "ይህ አካል ከ ኢንተርኔት ጋር አልተገናኘም:"
922+
923+#~ msgid "Software is up to date"
924+#~ msgstr "ሶፍትዌሩ ዘመናዊ ነው:"
925+
926+#~ msgid "The update server is not responding."
927+#~ msgstr "የ ማሻሻያ ሰርቨር አይመልስም:"
928+
929+#~ msgid "Please wait..."
930+#~ msgstr "እባክዎን ይቆዩ..."
931+
932+#~ msgid "Installation failed"
933+#~ msgstr "መግጠሙ አልተሳካም:"
934+
935+#~ msgid "Checking for updates…"
936+#~ msgstr "ማሻሻያ በ መፈለግ ላይ…"
937+
938+#~ msgid "%1 update available"
939+#~ msgid_plural "%1 updates available"
940+#~ msgstr[0] "%1 ማሻሻያ ዝግጁ ነው:"
941+#~ msgstr[1] "%1 ማሻሻያዎች ዝግጁ ናቸው:"
942+
943+#~ msgid "Update all…"
944+#~ msgstr "ሁሉንም ማሻሻያ…"
945+
946+#~ msgid "Update all"
947+#~ msgstr "ሁሉንም ማሻሻያ"
948+
949+#~ msgid "Update"
950+#~ msgstr "ማሻሻያ"
951+
952+#~ msgid "Download"
953+#~ msgstr "የ ወረደ"
954+
955+#~ msgid "Resume"
956+#~ msgstr "ይቀጥሉ"
957+
958+#~ msgid "Install…"
959+#~ msgstr "መግጠሚያ…"
960+
961+#~ msgid "Install"
962+#~ msgstr "መግጠሚያ"
963+
964+#~ msgid "Open"
965+#~ msgstr "መክፈቻ"
966+
967+#~ msgid "Installing"
968+#~ msgstr "በ መግጠም ላይ"
969+
970+#~ msgid "Waiting to download"
971+#~ msgstr "ለ ማውረድ በ መጠበቅ ላይ"
972+
973+#~ msgid "%1 of %2"
974+#~ msgstr "%1 ከ %2"
975+
976+#~ msgid "Downloaded"
977+#~ msgstr "የ ወረደ"
978+
979+#~ msgid "Installed"
980+#~ msgstr "ተገጥሟል:"
981+
982+#~ msgid "Updated %1"
983+#~ msgstr "ተሻሽሏል %1"
984+
985+#~ msgid "Update failed"
986+#~ msgstr "ማሻሻል አልተቻለም:"
987+
976988#~ msgid "Location Services"
977989#~ msgstr "የ አካባቢ ግልጋሎት"
978990
@@ -1043,9 +1055,6 @@ msgstr "በጣም ደካማ የ መግቢያ ቃል"
10431055#~ msgid "Confirm"
10441056#~ msgstr "ማረጋገጫ"
10451057
1046−#~ msgid "Search"
1047−#~ msgstr "መፈለጊያ"
1048−
10491058#~ msgid "See less"
10501059#~ msgstr "አነስተኛ መመልከቻ"
10511060
@@ -1157,12 +1166,6 @@ msgstr "በጣም ደካማ የ መግቢያ ቃል"
11571166#~ msgid "Please re-enter"
11581167#~ msgstr "እባክዎን እንደገና-ያስገቡ"
11591168
1160−#~ msgid "Enter passphrase"
1161−#~ msgstr "የ ማለፊያ ሀረግ ያስገቡ"
1162−
1163−#~ msgid "Enter passcode"
1164−#~ msgstr "የ ማለፊያ ኮድ ያስገቡ"
1165−
11661169#~ msgid "Lock security"
11671170#~ msgstr "ደህንነት መቆለፊያ"
11681171
@@ -1269,9 +1272,6 @@ msgstr "በጣም ደካማ የ መግቢያ ቃል"
12691272#~ msgid "Short swipe from the left edge."
12701273#~ msgstr "ከ ግራ ጠርዝ በኩል በትንሹ ይጥረጉ"
12711274
1272−#~ msgid "Open the launcher"
1273−#~ msgstr "ማስጀመሪያውን መክፈቻ"
1274−
12751275#~ msgid "Tap here to continue."
12761276#~ msgstr "እዚህ መታ ይድርጉ ለመቀጠል"
12771277
po/ar.po+469−519

This diff is too big to show here.

po/ast.po+470−494

This diff is too big to show here.

po/az.po+226−351

This diff is too big to show here.

po/be.po+422−504

This diff is too big to show here.

po/bg.po+207−349

This diff is too big to show here.

po/bn.po+410−503

This diff is too big to show here.

po/br.po+336−373

This diff is too big to show here.

po/bs.po+268−359

This diff is too big to show here.

po/ca.po+385−377

This diff is too big to show here.

po/ca@valencia.po+252−362

This diff is too big to show here.

po/ce.po+184−339

This diff is too big to show here.

po/ckb.po+203−348

This diff is too big to show here.

po/co.po+289−358

This diff is too big to show here.

po/cs.po+467−456

This diff is too big to show here.

po/cy.po+268−360

This diff is too big to show here.

po/da.po+344−431

This diff is too big to show here.

po/de.po+383−378

This diff is too big to show here.

po/el.po+391−453

This diff is too big to show here.

po/en_AU.po+394−363

This diff is too big to show here.

po/en_GB.po+349−370

This diff is too big to show here.

po/en_US.po+184−339

This diff is too big to show here.

po/eo.po+233−344

This diff is too big to show here.

po/es.po+400−395

This diff is too big to show here.

po/et.ponew file+816

This diff is too big to show here.

po/eu.po+274−365

This diff is too big to show here.

po/fa.po+426−398

This diff is too big to show here.

po/fi.po+379−373

This diff is too big to show here.

po/fo.po+253−353

This diff is too big to show here.

po/fr.po+385−381

This diff is too big to show here.

po/ga.po+261−358

This diff is too big to show here.

po/gd.po+351−374

This diff is too big to show here.

po/gl.po+399−400

This diff is too big to show here.

po/gu.po+184−339

This diff is too big to show here.

po/gv.po+217−348

This diff is too big to show here.

po/he.po+402−498

This diff is too big to show here.

po/hi.po+197−344

This diff is too big to show here.

po/hr.po+361−412

This diff is too big to show here.

po/hu.po+402−405

This diff is too big to show here.

po/hy.po+312−441

This diff is too big to show here.

po/ia.po+351−372

This diff is too big to show here.

po/id.po+259−370

This diff is too big to show here.

po/is.po+232−359

This diff is too big to show here.

po/it.po+384−378

This diff is too big to show here.

po/ja.po+298−415

This diff is too big to show here.

po/kk.ponew file+841

This diff is too big to show here.

po/km.po+270−360

This diff is too big to show here.

po/kn.po+191−344

This diff is too big to show here.

po/ko.po+397−481

This diff is too big to show here.

po/ku.po+226−351

This diff is too big to show here.

po/ky.po+191−343

This diff is too big to show here.

po/lo.po+190−342

This diff is too big to show here.

po/lt.po+453−442

This diff is too big to show here.

po/lv.po+274−366

This diff is too big to show here.

po/ml.po+203−348

This diff is too big to show here.

po/mr.po+207−344

This diff is too big to show here.

po/ms.po+308−366

This diff is too big to show here.

po/my.po+240−346

This diff is too big to show here.

po/nb.po+387−391

This diff is too big to show here.

po/ne.po+188−340

This diff is too big to show here.

po/nl.po+427−426

This diff is too big to show here.

po/nn.po+184−339

This diff is too big to show here.

po/oc.po+343−367

This diff is too big to show here.

po/or.po+184−339

This diff is too big to show here.

po/pa.po+271−361

This diff is too big to show here.

po/pl.po+386−382

This diff is too big to show here.

po/pt.po+383−377

This diff is too big to show here.

po/pt_BR.po+388−467

This diff is too big to show here.

po/ro.po+274−367

This diff is too big to show here.

po/ru.po+387−382

This diff is too big to show here.

po/sc.po+401−470

This diff is too big to show here.

po/shn.po+184−339

This diff is too big to show here.

po/si.po+211−355

This diff is too big to show here.

po/sk.po+399−401

This diff is too big to show here.

po/sl.po+336−371

This diff is too big to show here.

po/sq.po+261−352

This diff is too big to show here.

po/sr.po+350−371

This diff is too big to show here.

po/sv.po+384−386

This diff is too big to show here.

po/sw.po+251−356

This diff is too big to show here.

po/ta.po+203−348

This diff is too big to show here.

po/te.po+211−350

This diff is too big to show here.

po/th.po+204−357

This diff is too big to show here.

po/tr.po+411−381

This diff is too big to show here.

po/ug.po+316−369

This diff is too big to show here.

po/uk.po+349−377

This diff is too big to show here.

po/unity8.pot+184−339

This diff is too big to show here.

po/update-unity-pot+17

This diff is too big to show here.

po/ur.po+206−358

This diff is too big to show here.

po/uz.po+184−338

This diff is too big to show here.

po/vi.po+184−338

This diff is too big to show here.

po/wo.po+274−365

This diff is too big to show here.

po/xh.po+184−339

This diff is too big to show here.

po/zh_CN.po+377−376

This diff is too big to show here.

po/zh_HK.po+220−350

This diff is too big to show here.

po/zh_TW.po+376−371

This diff is too big to show here.

qml/ApplicationMenus/ApplicationMenuItemFactory.qmlnew file+135

This diff is too big to show here.

tests/plugins/ImageCache/test.qml → qml/ApplicationMenus/ApplicationMenusLimits.qmlrenamed+6−5

This diff is too big to show here.

qml/ApplicationMenus/MenuBar.qmlnew file+513

This diff is too big to show here.

qml/ApplicationMenus/MenuItem.qmlnew file+146

This diff is too big to show here.

qml/ApplicationMenus/MenuNavigator.qmlnew file+101

This diff is too big to show here.

qml/ApplicationMenus/MenuPopup.qmlnew file+510

This diff is too big to show here.

qml/ApplicationMenus/RegisteredApplicationMenuModel.qmlnew file+56

This diff is too big to show here.

qml/ApplicationMenus/qmldirnew file+1

This diff is too big to show here.

qml/CMakeLists.txt+1−1

This diff is too big to show here.

qml/Components/Background.qml+1−1

This diff is too big to show here.

qml/Components/BaseCarouselDelegate.qmldeleted−42

This diff is too big to show here.

qml/Components/Carousel.qmldeleted−335

This diff is too big to show here.

qml/Components/Dialogs.qml+93−27

This diff is too big to show here.

qml/Components/DragHandle.qml+1

This diff is too big to show here.

qml/Components/EdgeBarrier.qml+1

This diff is too big to show here.

qml/Components/EdgeBarrierController.qml+1

This diff is too big to show here.

qml/Panel/Handle.qml → qml/Components/Handle.qmlrenamed+1

This diff is too big to show here.

qml/Components/InputMethod.qml+6−4

This diff is too big to show here.

qml/Components/ItemGrabber.qml+1−1

This diff is too big to show here.

qml/Components/KeyboardShortcutsOverlay.qml+19−17

This diff is too big to show here.

qml/Components/KeymapSwitcher.qml+19−8

This diff is too big to show here.

qml/Components/Lockscreen.qml+5−1

This diff is too big to show here.

qml/Components/ModeSwitchWarningDialog.qml+8−2

This diff is too big to show here.

qml/Components/PanelState/PanelState.qml+6−3

This diff is too big to show here.

qml/Components/PhysicalKeysMapper.qml+4−4

This diff is too big to show here.

qml/Components/ResponsiveGridView.qmldeleted−98

This diff is too big to show here.

qml/Components/ResponsiveVerticalJournal.qmldeleted−81

This diff is too big to show here.

qml/Components/ScrollCalculator.qml+21−2

This diff is too big to show here.

qml/Components/ShellDialog.qml+27−12

This diff is too big to show here.

qml/Components/Showable.qml+15−12

This diff is too big to show here.

qml/Components/VirtualTouchPad.qml+269−1

This diff is too big to show here.

qml/Components/Wallpaper.qml+68−16

This diff is too big to show here.

qml/Components/WallpaperResolver.qml+17−6

This diff is too big to show here.

qml/Components/WindowControlButtons.qml+2

This diff is too big to show here.

qml/Dash/CardCarousel.qmldeleted−74

This diff is too big to show here.

qml/Dash/CardGrid.qmldeleted−84

This diff is too big to show here.

qml/Dash/CardHorizontalList.qmldeleted−66

This diff is too big to show here.

qml/Dash/CardTool.qmldeleted−298

This diff is too big to show here.

qml/Dash/CardVerticalJournal.qmldeleted−85

This diff is too big to show here.

qml/Dash/Dash.qmldeleted−381

This diff is too big to show here.

qml/Dash/DashBackground.qmldeleted−36

This diff is too big to show here.

qml/Dash/DashCategoryBase.qmldeleted−54

This diff is too big to show here.

qml/Dash/DashContent.qmldeleted−211

This diff is too big to show here.

qml/Dash/DashContentTabBarStyle.qmldeleted−24

This diff is too big to show here.

qml/Dash/DashNavigation.qmldeleted−199

This diff is too big to show here.

qml/Dash/DashNavigationHeader.qmldeleted−73

This diff is too big to show here.

qml/Dash/DashNavigationList.qmldeleted−118

This diff is too big to show here.

qml/Dash/DashPageHeader.qmldeleted−448

This diff is too big to show here.

qml/Dash/DashRenderer.qmldeleted−66

This diff is too big to show here.

qml/Dash/DashSectionHeader.qmldeleted−64

This diff is too big to show here.

qml/Dash/Filters/FilterExpandableWidget.qmldeleted−97

This diff is too big to show here.

qml/Dash/Filters/FilterOptionSelector.qmldeleted−97

This diff is too big to show here.

qml/Dash/Filters/FilterRangeInput.qmldeleted−136

This diff is too big to show here.

qml/Dash/Filters/FilterValueSlider.qmldeleted−87

This diff is too big to show here.

qml/Dash/Filters/FilterWidget.qmldeleted−32

This diff is too big to show here.

qml/Dash/Filters/FilterWidgetFactory.qmldeleted−89

This diff is too big to show here.

qml/Dash/FiltersPopover.qmldeleted−106

This diff is too big to show here.

qml/Dash/GenericScopeView.qmldeleted−797

This diff is too big to show here.

qml/Dash/PageHeaderExtraPanel.qmldeleted−201

This diff is too big to show here.

qml/Dash/PreviewView.qmldeleted−76

This diff is too big to show here.

qml/Dash/Previews/Preview.qmldeleted−145

This diff is too big to show here.

qml/Dash/Previews/PreviewActionButton.qmldeleted−27

This diff is too big to show here.

qml/Dash/Previews/PreviewActionCombo.qmldeleted−79

This diff is too big to show here.

qml/Dash/Previews/PreviewActions.qmldeleted−73

This diff is too big to show here.

qml/Dash/Previews/PreviewAudioPlayback.qmldeleted−151

This diff is too big to show here.

qml/Dash/Previews/PreviewComment.qmldeleted−86

This diff is too big to show here.

qml/Dash/Previews/PreviewCommentInput.qmldeleted−88

This diff is too big to show here.

qml/Dash/Previews/PreviewExpandable.qmldeleted−104

This diff is too big to show here.

qml/Dash/Previews/PreviewHeader.qmldeleted−170

This diff is too big to show here.

qml/Dash/Previews/PreviewIconActions.qmldeleted−88

This diff is too big to show here.

qml/Dash/Previews/PreviewImageGallery.qmldeleted−150

This diff is too big to show here.

qml/Dash/Previews/PreviewInlineVideo.qmldeleted−112

This diff is too big to show here.

qml/Dash/Previews/PreviewMediaToolbar.qmldeleted−57

This diff is too big to show here.

qml/Dash/Previews/PreviewOverlay.qmldeleted−166

This diff is too big to show here.

qml/Dash/Previews/PreviewPayments.qmldeleted−81

This diff is too big to show here.

qml/Dash/Previews/PreviewProgress.qmldeleted−74

This diff is too big to show here.

qml/Dash/Previews/PreviewRatingDisplay.qmldeleted−117

This diff is too big to show here.

qml/Dash/Previews/PreviewRatingEdit.qmldeleted−83

This diff is too big to show here.

qml/Dash/Previews/PreviewRatingInput.qmldeleted−207

This diff is too big to show here.

qml/Dash/Previews/PreviewRatingSingleDisplay.qmldeleted−73

This diff is too big to show here.

qml/Dash/Previews/PreviewSingleton/qmldirdeleted−1

This diff is too big to show here.

qml/Dash/Previews/PreviewTable.qmldeleted−91

This diff is too big to show here.

qml/Dash/Previews/PreviewTextSummary.qmldeleted−78

This diff is too big to show here.

qml/Dash/Previews/PreviewVideoPlayback.qmldeleted−87

This diff is too big to show here.

qml/Dash/Previews/PreviewWidget.qmldeleted−60

This diff is too big to show here.

qml/Dash/Previews/PreviewWidgetFactory.qmldeleted−101

This diff is too big to show here.

qml/Dash/Previews/PreviewZoomableImage.qmldeleted−103

This diff is too big to show here.

qml/Dash/ScopeListView.qmldeleted−28

This diff is too big to show here.

qml/Dash/ScopeSettings/ScopeSetting.qmldeleted−46

This diff is too big to show here.

qml/Dash/ScopeSettings/ScopeSettingBoolean.qmldeleted−63

This diff is too big to show here.

qml/Dash/ScopeSettings/ScopeSettingList.qmldeleted−50

This diff is too big to show here.

qml/Dash/ScopeSettings/ScopeSettingString.qmldeleted−89

This diff is too big to show here.

qml/Dash/ScopeSettings/ScopeSettingsWidgetFactory.qmldeleted−61

This diff is too big to show here.

qml/Dash/ScopeSettingsPage.qmldeleted−72

This diff is too big to show here.

qml/Dash/ScopesList.qmldeleted−125

This diff is too big to show here.

qml/Dash/ScopesListCategory.qmldeleted−181

This diff is too big to show here.

qml/Dash/ScopesListCategoryItem.qmldeleted−115

This diff is too big to show here.

qml/Dash/graphics/dark_background.jpgdeleted

Binary file not shown.

qml/Dash/graphics/header_handlearrow2@27.pngdeleted

Binary file not shown.

qml/Dash/graphics/header_handlearrow@27.pngdeleted

Binary file not shown.

qml/Dash/graphics/icon_clear@20.pngdeleted

Binary file not shown.

qml/Dash/graphics/icon_search_active@20.pngdeleted

Binary file not shown.

qml/Dash/graphics/icon_search_inactive@20.pngdeleted

Binary file not shown.

qml/Dash/graphics/overview_hint@30.pngdeleted

Binary file not shown.

qml/Dash/graphics/pixel.pngdeleted

Binary file not shown.

qml/Dash/graphics/play_button@18.pngdeleted

Binary file not shown.

qml/Dash/graphics/play_button_active@18.pngdeleted

Binary file not shown.

qml/Dash/graphics/play_button_active_big@20.pngdeleted

Binary file not shown.

qml/Dash/graphics/play_button_big@20.pngdeleted

Binary file not shown.

qml/Dash/graphics/rectangular_dropshadow@30.pngdeleted

Binary file not shown.

qml/Dash/graphics/rectangular_dropshadow@30.scideleted−5

This diff is too big to show here.

qml/Dash/graphics/tabbarchevron@27.pngdeleted

Binary file not shown.

qml/Dash/graphics/tablet/icon_close_preview@20.pngdeleted

Binary file not shown.

qml/Dash/graphics/tooltip_arrow@27.pngdeleted

Binary file not shown.

qml/DeviceConfiguration.qml+12

This diff is too big to show here.

qml/DisabledScreenNotice.qml+3−55

This diff is too big to show here.

qml/Greeter/ButtonPrompt.qmlnew file+51

This diff is too big to show here.

qml/Greeter/Circle.qml+1−1

This diff is too big to show here.

qml/Greeter/CoverPage.qml+32−11

This diff is too big to show here.

qml/Greeter/FullLightDMImpl.qml+1

This diff is too big to show here.

qml/Greeter/Greeter.qml+79−78

This diff is too big to show here.

qml/Greeter/GreeterPrompt.qml+66−167

This diff is too big to show here.

qml/Greeter/GreeterView.qmlnew file+534

This diff is too big to show here.

qml/Greeter/IntegratedLightDMImpl.qml+1

This diff is too big to show here.

qml/Greeter/LightDMService.qml+4−4

This diff is too big to show here.

qml/Greeter/LoginAreaContainer.qml+3−3

This diff is too big to show here.

qml/Greeter/LoginList.qml+111−191

This diff is too big to show here.

qml/Greeter/NarrowView.qmldeleted−294

This diff is too big to show here.

qml/Greeter/PinPrompt.qmlnew file+184

This diff is too big to show here.

qml/Greeter/PromptList.qmlnew file+151

This diff is too big to show here.

qml/Greeter/SessionsList.qml+36−18

This diff is too big to show here.

qml/Greeter/ShimGreeter.qml+2

This diff is too big to show here.

qml/Greeter/TextPrompt.qmlnew file+198

This diff is too big to show here.

qml/Greeter/WideView.qmldeleted−213

This diff is too big to show here.

qml/Launcher/BackgroundBlur.qmlnew file+81

This diff is too big to show here.

qml/Launcher/Drawer.qmlnew file+413

This diff is too big to show here.

qml/Launcher/DrawerGridView.qmlnew file+85

This diff is too big to show here.

qml/Launcher/Launcher.qml+245−54

This diff is too big to show here.

qml/Launcher/LauncherDelegate.qml+9−12

This diff is too big to show here.

qml/Launcher/LauncherPanel.qml+89−36

This diff is too big to show here.

qml/Dash/PullToRefreshScopeStyle.qml → qml/Launcher/PullToRefreshScopeStyle.qmlrenamed

The content is the same.

qml/Launcher/graphics/home.svgnew file+243

This diff is too big to show here.

qml/Launcher/graphics/home@18.pngdeleted

Binary file not shown.

qml/Launcher/graphics/launcher-app-focus-ring.svgdeleted−12

This diff is too big to show here.

qml/Notifications/Notification.qml+8−3

This diff is too big to show here.

qml/Notifications/NotificationButton.qml+2−1

This diff is too big to show here.

qml/Notifications/SwipeToAct.qml+4

This diff is too big to show here.

qml/OrientedShell.qml+26−7

This diff is too big to show here.

qml/Panel/ActiveCallHint.qml+3

This diff is too big to show here.

qml/Dash/ScopeSettings/ScopeSettingNumber.qml → qml/Panel/FakePanelMenu.qmlrenamed+8−3

This diff is too big to show here.

qml/Panel/IndicatorPage.qmldeleted−188

This diff is too big to show here.

qml/Panel/IndicatorItem.qml → qml/Panel/Indicators/IndicatorItem.qmlrenamed+16−3

This diff is too big to show here.

qml/Panel/Indicators/MenuItemFactory.qml → qml/Panel/Indicators/IndicatorMenuItemFactory.qmlrenamed+30−12

This diff is too big to show here.

qml/Panel/Indicators/IndicatorsLight.qml+185−12

This diff is too big to show here.

qml/Panel/Indicators/client/IndicatorRepresentation.qml+18−5

This diff is too big to show here.

qml/Panel/MenuContent.qml+12−12

This diff is too big to show here.

qml/Panel/Panel.qml+372−95

This diff is too big to show here.

qml/Panel/IndicatorsBar.qml → qml/Panel/PanelBar.qmlrenamed+87−36

This diff is too big to show here.

qml/Panel/IndicatorItemRow.qml → qml/Panel/PanelItemRow.qmlrenamed+65−106

This diff is too big to show here.

qml/Panel/IndicatorsMenu.qml → qml/Panel/PanelMenu.qmlrenamed+80−36

This diff is too big to show here.

qml/Panel/PanelMenuPage.qmlnew file+226

This diff is too big to show here.

qml/Rotation/RotationStates.qml+2−5

This diff is too big to show here.

qml/ScopeTool.qmldeleted−165

This diff is too big to show here.

qml/Shell.qml+254−115

This diff is too big to show here.

qml/Stage/AbstractStage.qmldeleted−93

This diff is too big to show here.

qml/Stage/ApplicationWindow.qml+16−4

This diff is too big to show here.

qml/Stage/ChildWindow.qmlnew file+203

This diff is too big to show here.

qml/Stage/ChildWindowRepeater.qmlnew file+39

This diff is too big to show here.

qml/Stage/ChildWindowTree.qmlnew file+138

This diff is too big to show here.

qml/Stage/DecoratedWindow.qml+97−44

This diff is too big to show here.

qml/Stage/DesktopSpread.qmldeleted−576

This diff is too big to show here.

qml/Stage/DesktopSpreadDelegate.qmldeleted−126

This diff is too big to show here.

qml/Stage/FakeMaximizeDelegate.qml+7−7

This diff is too big to show here.

qml/Stage/MoveHandler.qml+46−33

This diff is too big to show here.

qml/Stage/PhoneStage.qmldeleted−806

This diff is too big to show here.

qml/Stage/SideStage.qml+10−6

This diff is too big to show here.

qml/Stage/Splash.qml+4−4

This diff is too big to show here.

qml/Stage/Spread/Spread.qml+11

This diff is too big to show here.

qml/Stage/Spread/WindowedRightEdgeMaths.qml+19−4

This diff is too big to show here.

qml/Stage/SpreadDelegate.qmldeleted−424

This diff is too big to show here.

qml/Stage/SpreadMaths.qmldeleted−164

This diff is too big to show here.

qml/Stage/Stage.qml+566−294

This diff is too big to show here.

qml/Stage/StageMaths.qml+23−9

This diff is too big to show here.

qml/Stage/StagedFullscreenPolicy.qml+7−13

This diff is too big to show here.

qml/Stage/TabletStage.qmldeleted−1201

This diff is too big to show here.

qml/Stage/TopLevelSurfaceRepeater.qmldeleted−67

This diff is too big to show here.

qml/Stage/TransformedSpreadDelegate.qmldeleted−391

This diff is too big to show here.

qml/Stage/TransformedTabletSpreadDelegate.qmldeleted−437

This diff is too big to show here.

qml/Stage/WindowControlsOverlay.qml+23−26

This diff is too big to show here.

qml/Stage/WindowDecoration.qml+83−19

This diff is too big to show here.

qml/Stage/WindowInfoItem.qml+16

This diff is too big to show here.

qml/Stage/WindowResizeArea.qml+15−73

This diff is too big to show here.

qml/Stage/WindowStateSaver.qmlnew file+64

This diff is too big to show here.

qml/Stage/WindowedFullscreenPolicy.qml+4−12

This diff is too big to show here.

qml/Tutorial/Tutorial.qml+1

This diff is too big to show here.

qml/Tutorial/TutorialContent.qml+61−43

This diff is too big to show here.

qml/Tutorial/TutorialLeft.qml+1−1

This diff is too big to show here.

qml/Tutorial/TutorialLeftLong.qml+3−3

This diff is too big to show here.

qml/Tutorial/TutorialRight.qml+2−3

This diff is too big to show here.

qml/Tutorial/TutorialTop.qml+2−2

This diff is too big to show here.

qml/Wizard/Pages.qml+45−6

This diff is too big to show here.

qml/Wizard/Pages/10-welcome.qml+1

This diff is too big to show here.

qml/Wizard/Pages/30-wifi.qml+6−10

This diff is too big to show here.

qml/Wizard/Pages/50-timezone.qml+9−11

This diff is too big to show here.

qml/Wizard/Pages/76-app-update.qmldeleted−246

This diff is too big to show here.

qml/Wizard/Pages/78-firmware-update.qml.disabled+1−1

This diff is too big to show here.

qml/Wizard/Pages/79-system-update.qml+4−12

This diff is too big to show here.

qml/Wizard/Pages/ClickUpdateDelegate.qmldeleted−26

This diff is too big to show here.

qml/Wizard/Pages/DownloadHandler.qmldeleted−204

This diff is too big to show here.

qml/Wizard/Pages/GlobalUpdateControls.qmldeleted−138

This diff is too big to show here.

qml/Wizard/Pages/UpdateDelegate.qmldeleted−389

This diff is too big to show here.

src/ApplicationArguments.h+5

This diff is too big to show here.

src/CMakeLists.txt+15−6

This diff is too big to show here.

src/Dash/CMakeLists.txtdeleted−29

This diff is too big to show here.

src/Dash/main.cppdeleted−146

This diff is too big to show here.

src/DebuggingController.cppnew file+92

This diff is too big to show here.

src/DebuggingController.hnew file+57

This diff is too big to show here.

src/MouseTouchAdaptor.cpp+28−1

This diff is too big to show here.

src/MouseTouchAdaptor.h+1

This diff is too big to show here.

src/Panel/CMakeLists.txtdeleted−3

This diff is too big to show here.

src/Panel/Indicators/CMakeLists.txtdeleted−1

This diff is too big to show here.

src/ShellApplication.cpp+22−5

This diff is too big to show here.

src/ShellApplication.h+1−3

This diff is too big to show here.

src/ShellView.cpp+22

This diff is too big to show here.

src/libunity8-private/CMakeLists.txt+1−1

This diff is too big to show here.

src/libunity8-private/abstractdbusservicemonitor.h+1−1

This diff is too big to show here.

src/main.cpp+10−2

This diff is too big to show here.

tests/CMakeLists.txt+30−11

This diff is too big to show here.

tests/autopilot/unity8/dash.pydeleted−263

This diff is too big to show here.

tests/autopilot/unity8/fixture_setup.py+1−1

This diff is too big to show here.

tests/autopilot/unity8/shell/fixture_setup.py+1−27

This diff is too big to show here.

tests/autopilot/unity8/shell/tests/__init__.py+1−1

This diff is too big to show here.

tests/autopilot/unity8/shell/tests/test_helpers.py−123

This diff is too big to show here.

tests/autopilot/unity8/shell/tests/test_rotation.py+3−3

This diff is too big to show here.

tests/copyright/check_copyright.sh+35−4

This diff is too big to show here.

tests/data/unity/backgrounds/20x30.pngnew file

Binary file not shown.

tests/data/unity/backgrounds/black.pngnew file

Binary file not shown.

tests/graphics/screenshots/gallery@12.pngnew file

Binary file not shown.

tests/mocks/AccountsService/AccountsService.cpp+2−39

This diff is too big to show here.

tests/mocks/AccountsService/AccountsService.h+4−27

This diff is too big to show here.

tests/mocks/AccountsService/CMakeLists.txt+4−5

This diff is too big to show here.

tests/mocks/Biometryd/CMakeLists.txt+1−1

This diff is too big to show here.

tests/mocks/Biometryd/MockOperation.h−1

This diff is too big to show here.

tests/mocks/CMakeLists.txt+16−16

This diff is too big to show here.

tests/mocks/Cursor/CMakeLists.txt+1−1

This diff is too big to show here.

tests/mocks/GSettings.1.0/CMakeLists.txt+1−2

This diff is too big to show here.

tests/mocks/GSettings.1.0/fake_gsettings.cpp+25−27

This diff is too big to show here.

tests/mocks/GSettings.1.0/fake_gsettings.h+9−9

This diff is too big to show here.

tests/mocks/LightDM/CMakeLists.txtdeleted−1

This diff is too big to show here.

tests/mocks/LightDM/IntegratedLightDM/CMakeLists.txtdeleted−51

This diff is too big to show here.

tests/mocks/LightDM/IntegratedLightDM/MockGreeter.cppdeleted−51

This diff is too big to show here.

tests/mocks/LightDM/IntegratedLightDM/MockGreeter.hdeleted−42

This diff is too big to show here.

tests/mocks/LightDM/IntegratedLightDM/MockSessionsModel.cppdeleted−66

This diff is too big to show here.

tests/mocks/LightDM/IntegratedLightDM/MockSessionsModel.hdeleted−44

This diff is too big to show here.

tests/mocks/LightDM/IntegratedLightDM/MockUsersModel.cppdeleted−44

This diff is too big to show here.

tests/mocks/LightDM/IntegratedLightDM/QLightDM/SessionsModeldeleted−17

This diff is too big to show here.

tests/mocks/LightDM/IntegratedLightDM/QLightDM/UsersModeldeleted−17

This diff is too big to show here.

tests/mocks/LightDM/IntegratedLightDM/liblightdm/CMakeLists.txtdeleted−20

This diff is too big to show here.

tests/mocks/LightDM/IntegratedLightDM/liblightdm/Greeter.cppdeleted−201

This diff is too big to show here.

tests/mocks/LightDM/IntegratedLightDM/liblightdm/UsersModel.cppdeleted−123

This diff is too big to show here.

tests/mocks/LightDM/IntegratedLightDM/plugin.cppdeleted−79

This diff is too big to show here.

tests/mocks/LightDM/IntegratedLightDM/plugin.hdeleted−32

This diff is too big to show here.

tests/mocks/LightDM/IntegratedLightDM/qmldirdeleted−2

This diff is too big to show here.

tests/mocks/LightDMController/CMakeLists.txtnew file+14

This diff is too big to show here.

tests/mocks/Ubuntu/SystemImage/plugin.cpp → tests/mocks/LightDMController/plugin.cpprenamed+11−10

This diff is too big to show here.

tests/mocks/Ubuntu/Payments/plugin.h → tests/mocks/LightDMController/plugin.hrenamed+4−6

This diff is too big to show here.

tests/mocks/LightDMController/qmldirnew file+2

This diff is too big to show here.

tests/mocks/Lights/CMakeLists.txt+1−1

This diff is too big to show here.

tests/mocks/Lights/Lights.h+1−1

This diff is too big to show here.

tests/mocks/MeeGo/QOfono/CMakeLists.txt+1−1

This diff is too big to show here.

tests/mocks/Powerd/CMakeLists.txt+1−1

This diff is too big to show here.

tests/mocks/Powerd/Powerd.h+2−2

This diff is too big to show here.

tests/mocks/QMenuModel/CMakeLists.txt+1−2

This diff is too big to show here.

tests/mocks/QMenuModel/dbus-enums.h+2−3

This diff is too big to show here.

tests/mocks/QMenuModel/unitymenumodel.cpp+78−13

This diff is too big to show here.

tests/mocks/QMenuModel/unitymenumodel.h+12−1

This diff is too big to show here.

tests/mocks/QtMultimedia/CMakeLists.txt+1−1

This diff is too big to show here.

tests/mocks/QtMultimedia/mediaplayer.cpp+2−2

This diff is too big to show here.

tests/mocks/QtMultimedia/mediaplayer.h+6−6

This diff is too big to show here.

tests/mocks/QtMultimedia/videooutput.h+1−1

This diff is too big to show here.

tests/mocks/SessionBroadcast/CMakeLists.txt+1−1

This diff is too big to show here.

tests/mocks/UInput/CMakeLists.txt+1−1

This diff is too big to show here.

tests/mocks/UInput/mockuinput.h+1−1

This diff is too big to show here.

tests/mocks/Ubuntu/CMakeLists.txt−2

This diff is too big to show here.

tests/mocks/Ubuntu/Connectivity/CMakeLists.txt+1−1

This diff is too big to show here.

tests/mocks/Ubuntu/Connectivity/networking-status.cpp+7−1

This diff is too big to show here.

tests/mocks/Ubuntu/Connectivity/networking-status.h+7−6

This diff is too big to show here.

tests/mocks/Ubuntu/DownloadDaemonListener/CMakeLists.txt+1−1

This diff is too big to show here.

tests/mocks/Ubuntu/Payments/CMakeLists.txtdeleted−10

This diff is too big to show here.

tests/mocks/Ubuntu/Payments/MockPayments.cppdeleted−95

This diff is too big to show here.

tests/mocks/Ubuntu/Payments/MockPayments.hdeleted−62

This diff is too big to show here.

tests/mocks/Ubuntu/Payments/qmldirdeleted−3

This diff is too big to show here.

tests/mocks/Ubuntu/SystemImage/CMakeLists.txtdeleted−10

This diff is too big to show here.

tests/mocks/Ubuntu/SystemImage/MockSystemImage.cppdeleted−50

This diff is too big to show here.

tests/mocks/Ubuntu/SystemImage/MockSystemImage.hdeleted−56

This diff is too big to show here.

tests/mocks/Ubuntu/SystemImage/qmldirdeleted−3

This diff is too big to show here.

tests/mocks/Ubuntu/SystemSettings/CMakeLists.txt+1

This diff is too big to show here.

tests/mocks/Ubuntu/SystemSettings/SecurityPrivacy/CMakeLists.txt+2−2

This diff is too big to show here.

tests/mocks/Ubuntu/SystemSettings/SecurityPrivacy/MockSecurityPrivacy.h+1−1

This diff is too big to show here.

tests/mocks/Ubuntu/SystemSettings/Update/CMakeLists.txtnew file+1

This diff is too big to show here.

plugins/Ubuntu/Payments/plugin.cpp → tests/mocks/Ubuntu/SystemSettings/Update/MockSystemImage.qmlrenamed+11−9

This diff is too big to show here.

tests/mocks/Ubuntu/SystemSettings/Update/qmldirnew file+2

This diff is too big to show here.

tests/mocks/Ubuntu/Telephony/CMakeLists.txt+1−1

This diff is too big to show here.

tests/mocks/Unity/Application/ApplicationInfo.cpp+61−27

This diff is too big to show here.

tests/mocks/Unity/Application/ApplicationInfo.h+8−9

This diff is too big to show here.

tests/mocks/Unity/Application/ApplicationManager.cpp+114−64

This diff is too big to show here.

tests/mocks/Unity/Application/ApplicationManager.h+32−10

This diff is too big to show here.

tests/mocks/Unity/Application/CMakeLists.txt+4−4

This diff is too big to show here.

tests/mocks/Unity/Application/MirMock.cpp+13

This diff is too big to show here.

tests/mocks/Unity/Application/MirMock.h+4

This diff is too big to show here.

tests/mocks/Unity/Application/MirSurface.cpp+121−82

This diff is too big to show here.

tests/mocks/Unity/Application/MirSurface.h+45−27

This diff is too big to show here.

tests/mocks/Unity/Application/MirSurfaceItem.cpp+24−9

This diff is too big to show here.

tests/mocks/Unity/Application/MirSurfaceItem.h+1−2

This diff is too big to show here.

tests/mocks/Unity/Application/MirSurfaceListModel.cpp+17−39

This diff is too big to show here.

tests/mocks/Unity/Application/MirSurfaceListModel.h+7−15

This diff is too big to show here.

tests/mocks/Unity/Application/SurfaceManager.cpp+186−31

This diff is too big to show here.

tests/mocks/Unity/Application/SurfaceManager.h+32−10

This diff is too big to show here.

tests/mocks/Unity/Application/VirtualKeyboard.cpp+5−4

This diff is too big to show here.

tests/mocks/Unity/Application/plugin.cpp+3−33

This diff is too big to show here.

tests/mocks/Unity/Application/resources/Kate.qmlnew file+49

This diff is too big to show here.

tests/mocks/Unity/Application/resources/KateDialog.qmlnew file+48

This diff is too big to show here.

qml/Dash/DashApplication.qml → tests/mocks/Unity/Application/resources/KateMenu.qmlrenamed+17−15

This diff is too big to show here.

tests/mocks/Unity/Application/resources/surfaces.qrc+3

This diff is too big to show here.

tests/mocks/Unity/ApplicationMenu/CMakeLists.txtnew file+18

This diff is too big to show here.

tests/mocks/Unity/ApplicationMenu/mockapplicationmenuregistry.cppnew file+47

This diff is too big to show here.

tests/mocks/Unity/ApplicationMenu/mockapplicationmenuregistry.hnew file+41

This diff is too big to show here.

plugins/ImageCache/plugin.cpp → tests/mocks/Unity/ApplicationMenu/plugin.cpprenamed+14−11

This diff is too big to show here.

tests/mocks/Ubuntu/SystemImage/plugin.h → tests/mocks/Unity/ApplicationMenu/plugin.hrenamed+6−5

This diff is too big to show here.

tests/mocks/Unity/ApplicationMenu/qmldirnew file+3

This diff is too big to show here.

tests/mocks/Unity/CMakeLists.txt+2−63

This diff is too big to show here.

tests/mocks/Unity/Connectivity/CMakeLists.txt+1−1

This diff is too big to show here.

tests/mocks/Unity/DashCommunicator/CMakeLists.txtdeleted−18

This diff is too big to show here.

tests/mocks/Unity/DashCommunicator/dashcommunicator.cppdeleted−42

This diff is too big to show here.

tests/mocks/Unity/DashCommunicator/dashcommunicator.hdeleted−39

This diff is too big to show here.

tests/mocks/Unity/DashCommunicator/dashcommunicatorservice.cppdeleted−46

This diff is too big to show here.

tests/mocks/Unity/DashCommunicator/dashcommunicatorservice.hdeleted−41

This diff is too big to show here.

tests/mocks/Unity/DashCommunicator/plugin.cppdeleted−31

This diff is too big to show here.

tests/mocks/Unity/DashCommunicator/qmldirdeleted−3

This diff is too big to show here.

tests/mocks/Unity/Indicators/CMakeLists.txt+4−1

This diff is too big to show here.

tests/mocks/Unity/Indicators/IndicatorsModel.qml+30−12

This diff is too big to show here.

tests/mocks/Unity/Indicators/fakeindicatorsmodel.h−1

This diff is too big to show here.

tests/mocks/Unity/Indicators/fakeindicatorsmodeldata.js+23−6

This diff is too big to show here.

tests/mocks/Unity/InputInfo/CMakeLists.txt+1−1

This diff is too big to show here.

tests/mocks/Unity/InputInfo/qinputdeviceinfo_mock.cpp+6−2

This diff is too big to show here.

tests/mocks/Unity/Launcher/CMakeLists.txt+5−3

This diff is too big to show here.

tests/mocks/Unity/Launcher/MockAppDrawerModel.cppnew file+98

This diff is too big to show here.

tests/mocks/Unity/fake_filters.h → tests/mocks/Unity/Launcher/MockAppDrawerModel.hrenamed+14−17

This diff is too big to show here.

tests/mocks/Unity/Launcher/MockLauncherItem.cpp+27−1

This diff is too big to show here.

tests/mocks/Unity/Launcher/MockLauncherItem.h+9

This diff is too big to show here.

tests/mocks/Unity/Launcher/MockLauncherModel.cpp+4−1

This diff is too big to show here.

tests/mocks/Unity/Launcher/MockLauncherModel.h+1−1

This diff is too big to show here.

tests/mocks/Unity/Launcher/MockQuickListModel.cpp+3−1

This diff is too big to show here.

tests/mocks/Unity/Launcher/MockQuickListModel.h+2

This diff is too big to show here.

tests/mocks/Unity/Launcher/plugin.cpp+4

This diff is too big to show here.

tests/mocks/Unity/Notifications/CMakeLists.txt+1−1

This diff is too big to show here.

tests/mocks/Unity/Notifications/MockActionModel.h+1−1

This diff is too big to show here.

tests/mocks/Unity/Notifications/MockNotification.h+2−1

This diff is too big to show here.

tests/mocks/Unity/Platform/CMakeLists.txtnew file+1

This diff is too big to show here.

qml/Dash/Previews/PreviewSingleton/PreviewSingleton.qml → tests/mocks/Unity/Platform/MockPlatform.qmlrenamed+6−3

This diff is too big to show here.

tests/mocks/Unity/Platform/qmldirnew file+2

This diff is too big to show here.

tests/mocks/Unity/Screens/CMakeLists.txt+1−1

This diff is too big to show here.

tests/mocks/Unity/Screens/screens.cpp+1−1

This diff is too big to show here.

tests/mocks/Unity/Screens/screens.h+1−1

This diff is too big to show here.

tests/mocks/Unity/fake_categories.cppdeleted−165

This diff is too big to show here.

tests/mocks/Unity/fake_categories.hdeleted−54

This diff is too big to show here.

tests/mocks/Unity/fake_expandablefilterwidget.cppdeleted−53

This diff is too big to show here.

tests/mocks/Unity/fake_expandablefilterwidget.hdeleted−48

This diff is too big to show here.

tests/mocks/Unity/fake_filters.cppdeleted−136

This diff is too big to show here.

tests/mocks/Unity/fake_navigation.cppdeleted−123

This diff is too big to show here.

tests/mocks/Unity/fake_navigation.hdeleted−61

This diff is too big to show here.

tests/mocks/Unity/fake_optionselectorfilter.cppdeleted−70

This diff is too big to show here.

tests/mocks/Unity/fake_optionselectorfilter.hdeleted−54

This diff is too big to show here.

tests/mocks/Unity/fake_optionselectoroptions.cppdeleted−90

This diff is too big to show here.

tests/mocks/Unity/fake_optionselectoroptions.hdeleted−49

This diff is too big to show here.

tests/mocks/Unity/fake_previewmodel.cppdeleted−103

This diff is too big to show here.

tests/mocks/Unity/fake_previewmodel.hdeleted−58

This diff is too big to show here.

tests/mocks/Unity/fake_previewwidgetmodel.cppdeleted−97

This diff is too big to show here.

tests/mocks/Unity/fake_previewwidgetmodel.hdeleted−47

This diff is too big to show here.

tests/mocks/Unity/fake_rangeinputfilter.cppdeleted−167

This diff is too big to show here.

tests/mocks/Unity/fake_rangeinputfilter.hdeleted−79

This diff is too big to show here.

tests/mocks/Unity/fake_resultsmodel.cppdeleted−92

This diff is too big to show here.

tests/mocks/Unity/fake_resultsmodel.hdeleted−52

This diff is too big to show here.

tests/mocks/Unity/fake_scope.cppdeleted−372

This diff is too big to show here.

tests/mocks/Unity/fake_scope.hdeleted−128

This diff is too big to show here.

tests/mocks/Unity/fake_scopes.cppdeleted−280

This diff is too big to show here.

tests/mocks/Unity/fake_scopes.hdeleted−83

This diff is too big to show here.

tests/mocks/Unity/fake_scopesoverview.cppdeleted−340

This diff is too big to show here.

tests/mocks/Unity/fake_scopesoverview.hdeleted−117

This diff is too big to show here.

tests/mocks/Unity/fake_settingsmodel.cppdeleted−95

This diff is too big to show here.

tests/mocks/Unity/fake_settingsmodel.hdeleted−54

This diff is too big to show here.

tests/mocks/Unity/fake_unity_plugin.cppdeleted−62

This diff is too big to show here.

tests/mocks/Unity/fake_unity_plugin.hdeleted−34

This diff is too big to show here.

tests/mocks/Unity/fake_valuesliderfilter.cppdeleted−84

This diff is too big to show here.

tests/mocks/Unity/fake_valuesliderfilter.hdeleted−55

This diff is too big to show here.

tests/mocks/Unity/fake_valueslidervalues.cppdeleted−51

This diff is too big to show here.

tests/mocks/Unity/fake_valueslidervalues.hdeleted−36

This diff is too big to show here.

tests/mocks/Unity/qmldirdeleted−3

This diff is too big to show here.

tests/mocks/Utils/CMakeLists.txt+12−3

This diff is too big to show here.

tests/mocks/Utils/plugin.cpp+9−1

This diff is too big to show here.

tests/mocks/Utils/windowstatestorage.cpp+23

This diff is too big to show here.

tests/mocks/Utils/windowstatestorage.h+6−3

This diff is too big to show here.

tests/mocks/Wizard/CMakeLists.txt+2−2

This diff is too big to show here.

tests/mocks/Wizard/MockSystem.cpp+19−4

This diff is too big to show here.

tests/mocks/Wizard/MockSystem.h+11−1

This diff is too big to show here.

tests/mocks/Wizard/mockplugin.cpp+2

This diff is too big to show here.

tests/mocks/liblightdm/CMakeLists.txtnew file+18

This diff is too big to show here.

tests/mocks/LightDM/IntegratedLightDM/liblightdm/GreeterPrivate.cpp → tests/mocks/liblightdm/GreeterPrivate.cpprenamed

The content is the same.

tests/mocks/LightDM/IntegratedLightDM/liblightdm/GreeterPrivate.h → tests/mocks/liblightdm/GreeterPrivate.hrenamed

The content is the same.

tests/mocks/liblightdm/MockController.cppnew file+192

This diff is too big to show here.

tests/mocks/liblightdm/MockController.hnew file+106

This diff is too big to show here.

tests/mocks/liblightdm/MockGreeter.cppnew file+316

This diff is too big to show here.

tests/mocks/LightDM/IntegratedLightDM/liblightdm/Greeter.h → tests/mocks/liblightdm/MockGreeter.hrenamed+10−23

This diff is too big to show here.

tests/mocks/LightDM/IntegratedLightDM/liblightdm/SessionsModel.cpp → tests/mocks/liblightdm/MockSessionsModel.cpprenamed+39−42

This diff is too big to show here.

tests/mocks/LightDM/IntegratedLightDM/liblightdm/SessionsModel.h → tests/mocks/liblightdm/MockSessionsModel.hrenamed+11−19

This diff is too big to show here.

tests/mocks/liblightdm/MockUsersModel.cppnew file+220

This diff is too big to show here.

tests/mocks/LightDM/IntegratedLightDM/liblightdm/UsersModel.h → tests/mocks/liblightdm/MockUsersModel.hrenamed+9−18

This diff is too big to show here.

tests/mocks/LightDM/IntegratedLightDM/liblightdm/SessionsModelPrivate.cpp → tests/mocks/liblightdm/SessionsModelPrivate.cpprenamed+1−1

This diff is too big to show here.

tests/mocks/LightDM/IntegratedLightDM/liblightdm/SessionsModelPrivate.h → tests/mocks/liblightdm/SessionsModelPrivate.hrenamed

The content is the same.

tests/mocks/LightDM/IntegratedLightDM/liblightdm/UsersModelPrivate.cpp → tests/mocks/liblightdm/UsersModelPrivate.cpprenamed+23−23

This diff is too big to show here.

tests/mocks/LightDM/IntegratedLightDM/liblightdm/UsersModelPrivate.h → tests/mocks/liblightdm/UsersModelPrivate.hrenamed

The content is the same.

tests/mocks/liblightdm/demo/CMakeLists.txt+1−1

This diff is too big to show here.

tests/mocks/libusermetrics/CMakeLists.txt+2−1

This diff is too big to show here.

tests/mocks/libusermetrics/ColorTheme.cpp+4

This diff is too big to show here.

tests/mocks/libusermetrics/UserMetrics.cpp+5

This diff is too big to show here.

tests/plugins/AccountsService/CMakeLists.txt+8−2

This diff is too big to show here.

tests/plugins/AccountsService/PropertiesServer.cpp+1−1

This diff is too big to show here.

tests/plugins/AccountsService/client.cpp+6−34

This diff is too big to show here.

tests/plugins/CMakeLists.txt+2−3

This diff is too big to show here.

tests/plugins/Dash/CMakeLists.txtdeleted−79

This diff is too big to show here.

tests/plugins/Dash/cardcreator/1.resdeleted−82

This diff is too big to show here.

tests/plugins/Dash/cardcreator/1.res.cardcreatordeleted−69

This diff is too big to show here.

tests/plugins/Dash/cardcreator/1.tstdeleted−4

This diff is too big to show here.

tests/plugins/Dash/cardcreator/10.resdeleted−129

This diff is too big to show here.

tests/plugins/Dash/cardcreator/10.res.cardcreatordeleted−127

This diff is too big to show here.

tests/plugins/Dash/cardcreator/10.tstdeleted−4

This diff is too big to show here.

tests/plugins/Dash/cardcreator/11.resdeleted−176

This diff is too big to show here.

tests/plugins/Dash/cardcreator/11.res.cardcreatordeleted−160

This diff is too big to show here.

tests/plugins/Dash/cardcreator/11.tstdeleted−4

This diff is too big to show here.

tests/plugins/Dash/cardcreator/12.resdeleted−108

This diff is too big to show here.

tests/plugins/Dash/cardcreator/12.res.cardcreatordeleted−95

This diff is too big to show here.

tests/plugins/Dash/cardcreator/12.tstdeleted−4

This diff is too big to show here.

tests/plugins/Dash/cardcreator/2.resdeleted−128

This diff is too big to show here.

tests/plugins/Dash/cardcreator/2.res.cardcreatordeleted−126

This diff is too big to show here.

tests/plugins/Dash/cardcreator/2.tstdeleted−4

This diff is too big to show here.

tests/plugins/Dash/cardcreator/3.resdeleted−90

This diff is too big to show here.

tests/plugins/Dash/cardcreator/3.res.cardcreatordeleted−86

This diff is too big to show here.

tests/plugins/Dash/cardcreator/3.tstdeleted−4

This diff is too big to show here.

tests/plugins/Dash/cardcreator/4.resdeleted−111

This diff is too big to show here.

tests/plugins/Dash/cardcreator/4.res.cardcreatordeleted−99

This diff is too big to show here.

tests/plugins/Dash/cardcreator/4.tstdeleted−4

This diff is too big to show here.

tests/plugins/Dash/cardcreator/5.resdeleted−102

This diff is too big to show here.

tests/plugins/Dash/cardcreator/5.res.cardcreatordeleted−99

This diff is too big to show here.

tests/plugins/Dash/cardcreator/5.tstdeleted−4

This diff is too big to show here.

tests/plugins/Dash/cardcreator/6.resdeleted−127

This diff is too big to show here.

tests/plugins/Dash/cardcreator/6.res.cardcreatordeleted−116

This diff is too big to show here.

tests/plugins/Dash/cardcreator/6.tstdeleted−4

This diff is too big to show here.

tests/plugins/Dash/cardcreator/7.resdeleted−141

This diff is too big to show here.

tests/plugins/Dash/cardcreator/7.res.cardcreatordeleted−139

This diff is too big to show here.

tests/plugins/Dash/cardcreator/7.tstdeleted−4

This diff is too big to show here.

tests/plugins/Dash/cardcreator/8.resdeleted−109

This diff is too big to show here.

tests/plugins/Dash/cardcreator/8.res.cardcreatordeleted−97

This diff is too big to show here.

tests/plugins/Dash/cardcreator/8.tstdeleted−4

This diff is too big to show here.

tests/plugins/Dash/cardcreator/9.resdeleted−120

This diff is too big to show here.

tests/plugins/Dash/cardcreator/9.res.cardcreatordeleted−109

This diff is too big to show here.

tests/plugins/Dash/cardcreator/9.tstdeleted−4

This diff is too big to show here.

tests/plugins/Dash/cardcreatortest.cppdeleted−121

This diff is too big to show here.

tests/plugins/Dash/cardcreatortest.qmldeleted−29

This diff is too big to show here.

tests/plugins/Dash/horizontaljournaltest.cppdeleted−487

This diff is too big to show here.

tests/plugins/Dash/horizontaljournaltest.qmldeleted−44

This diff is too big to show here.

tests/plugins/Dash/horizontaljournaltry.cppdeleted−89

This diff is too big to show here.

tests/plugins/Dash/horizontaljournaltry.qmldeleted−120

This diff is too big to show here.

tests/plugins/Dash/listviewwithpageheadersectionexternalmodeltest.cppdeleted−243

This diff is too big to show here.

tests/plugins/Dash/listviewwithpageheadersectiontest.cppdeleted−2210

This diff is too big to show here.

tests/plugins/Dash/listviewwithpageheadertest.cppdeleted−2036

This diff is too big to show here.

tests/plugins/Dash/listviewwithpageheadertest.qmldeleted−96

This diff is too big to show here.

tests/plugins/Dash/listviewwithpageheadertestsection.qmldeleted−119

This diff is too big to show here.

tests/plugins/Dash/listviewwithpageheadertestsectionexternalmodel.qmldeleted−76

This diff is too big to show here.

tests/plugins/Dash/organicgridtest.cppdeleted−530

This diff is too big to show here.

tests/plugins/Dash/organicgridtest.qmldeleted−44

This diff is too big to show here.

tests/plugins/Dash/organicgridtry.cppdeleted−97

This diff is too big to show here.

tests/plugins/Dash/organicgridtry.qmldeleted−114

This diff is too big to show here.

tests/plugins/Dash/tst_CardAttributes.qmldeleted−57

This diff is too big to show here.

tests/plugins/Dash/tst_CroppedImageMinimumSourceSize.qmldeleted−56

This diff is too big to show here.

tests/plugins/Dash/tst_ListViewWithPageHeaderQML.qmldeleted−140

This diff is too big to show here.

tests/plugins/Dash/tst_ScopeStyle.qmldeleted−188

This diff is too big to show here.

tests/plugins/Dash/verticaljournaltest.cppdeleted−561

This diff is too big to show here.

tests/plugins/Dash/verticaljournaltest.qmldeleted−45

This diff is too big to show here.

tests/plugins/Dash/verticaljournaltry.cppdeleted−89

This diff is too big to show here.

tests/plugins/Dash/verticaljournaltry.qmldeleted−121

This diff is too big to show here.

tests/plugins/GlobalShortcut/CMakeLists.txt+12−7

This diff is too big to show here.

tests/plugins/GlobalShortcut/GlobalShortcutTest.cpp+3−2

This diff is too big to show here.

tests/plugins/Greeter/Unity/Launcher/CMakeLists.txt+5−22

This diff is too big to show here.

tests/plugins/Greeter/Unity/Launcher/launchermodelastest.cpp+4−1

This diff is too big to show here.

tests/plugins/ImageCache/CMakeLists.txtdeleted−20

This diff is too big to show here.

tests/plugins/ImageCache/graphics/wide.jpgdeleted

Binary file not shown.

tests/plugins/ImageCache/test.cppdeleted−214

This diff is too big to show here.

tests/plugins/LightDM/IntegratedLightDM/CMakeLists.txt+58−14

This diff is too big to show here.

tests/plugins/LightDM/IntegratedLightDM/dbus.cpp+22−12

This diff is too big to show here.

tests/plugins/LightDM/IntegratedLightDM/greeter.qml+2−7

This diff is too big to show here.

tests/plugins/LightDM/IntegratedLightDM/promptsmodel.cppnew file+175

This diff is too big to show here.

tests/plugins/LightDM/IntegratedLightDM/sessionsmodel.cpp+19−13

This diff is too big to show here.

tests/plugins/LightDM/IntegratedLightDM/usersmodel.cpp+100−16

This diff is too big to show here.

tests/plugins/SessionBroadcast/CMakeLists.txt+8−2

This diff is too big to show here.

tests/plugins/Ubuntu/Gestures/CMakeLists.txt+12−6

This diff is too big to show here.

tests/plugins/Ubuntu/Gestures/GestureTest.cpp+12−2

This diff is too big to show here.

tests/plugins/Ubuntu/Gestures/tst_FloatingFlickable.qml+1−1

This diff is too big to show here.

tests/plugins/Ubuntu/Gestures/tst_TouchGate.cpp+14−3

This diff is too big to show here.

tests/plugins/Ubuntu/Gestures/tst_TouchGestureArea.cpp+30

This diff is too big to show here.

tests/plugins/Unity/CMakeLists.txt+1

This diff is too big to show here.

tests/plugins/Unity/Indicators/CMakeLists.txt+12−2

This diff is too big to show here.

tests/plugins/Unity/Indicators/IndicatorsManagerTest.cpp+1−1

This diff is too big to show here.

tests/plugins/Unity/Indicators/IndicatorsModelTest.cpp+1−1

This diff is too big to show here.

tests/plugins/Unity/Launcher/CMakeLists.txt+48−4

This diff is too big to show here.

tests/plugins/Unity/Launcher/appdrawermodeltest.cppnew file+68

This diff is too big to show here.

tests/plugins/Unity/Launcher/launchermodeltest.cpp+113−11

This diff is too big to show here.

tests/plugins/Unity/Launcher/ualwrapper.cppnew file+58

This diff is too big to show here.

tests/plugins/Unity/Launcher/ualwrapper.hnew file+55

This diff is too big to show here.

tests/mocks/Ubuntu/Payments/plugin.cpp → tests/plugins/Unity/Launcher/xdgwatcher.cpprenamed+24−7

This diff is too big to show here.

tests/mocks/LightDM/IntegratedLightDM/MockUsersModel.h → tests/plugins/Unity/Launcher/xdgwatcher.hrenamed+17−17

This diff is too big to show here.

tests/plugins/Unity/Platform/CMakeLists.txtnew file+30

This diff is too big to show here.

tests/plugins/Unity/Platform/platformtest.cppnew file+142

This diff is too big to show here.

tests/plugins/Unity/Session/CMakeLists.txt+21−3

This diff is too big to show here.

tests/plugins/Unity/Session/LogindServer.cpp+10

This diff is too big to show here.

tests/plugins/Unity/Session/LogindServer.h+5

This diff is too big to show here.

tests/plugins/Unity/Session/interfaces.xml+12

This diff is too big to show here.

tests/plugins/Unity/Session/preload.cnew file+43

This diff is too big to show here.

tests/plugins/Unity/Session/sessionbackendtest.cpp+130−11

This diff is too big to show here.

tests/plugins/Utils/CMakeLists.txt+13−5

This diff is too big to show here.

tests/plugins/Utils/DeviceConfigParserTest.cpp+7−1

This diff is too big to show here.

tests/plugins/Utils/ModelTest.cpp+2−1

This diff is too big to show here.

tests/plugins/Utils/WindowInputMonitorTest.cpp+107−10

This diff is too big to show here.

tests/plugins/Utils/WindowStateStorageTest.cppnew file+121

This diff is too big to show here.

tests/plugins/WindowManager/CMakeLists.txtnew file+36

This diff is too big to show here.

tests/plugins/WindowManager/UnityApplicationMocks.hnew file+211

This diff is too big to show here.

tests/plugins/WindowManager/tst_TopLevelWindowModel.cppnew file+193

This diff is too big to show here.

tests/plugins/Wizard/CMakeLists.txt+8−2

This diff is too big to show here.

tests/qmltests/ApplicationMenuDataLoader.qmlnew file+99

This diff is too big to show here.

tests/qmltests/ApplicationMenus/tst_MenuBar.qmlnew file+437

This diff is too big to show here.

tests/qmltests/ApplicationMenus/tst_MenuPopup.qmlnew file+361

This diff is too big to show here.

tests/qmltests/CMakeLists.txt+28−53

This diff is too big to show here.

tests/qmltests/Components/CMakeLists.txt+26−7

This diff is too big to show here.

tests/qmltests/Components/tst_Carousel.qmldeleted−292

This diff is too big to show here.

tests/qmltests/Components/tst_Dialogs.qml−1

This diff is too big to show here.

tests/qmltests/Components/tst_DragHandle.cpp+23−4

This diff is too big to show here.

tests/qmltests/Components/tst_DraggingArea.qml+6−6

This diff is too big to show here.

tests/qmltests/Components/tst_EdgeDragEvaluator.cpp+4−2

This diff is too big to show here.

tests/qmltests/Components/tst_Lockscreen.qml+11−9

This diff is too big to show here.

tests/qmltests/Components/tst_MediaServices.qml+5−4

This diff is too big to show here.

tests/qmltests/Components/tst_PhysicalKeysMapper.qml+7−6

This diff is too big to show here.

tests/qmltests/Components/tst_Rating.qml+1−1

This diff is too big to show here.

tests/qmltests/Components/tst_ResponsiveGridView.qmldeleted−157

This diff is too big to show here.

tests/qmltests/Components/tst_ResponsiveVerticalJournal.qmldeleted−183

This diff is too big to show here.

tests/qmltests/Components/tst_SharingPicker.qml+3−3

This diff is too big to show here.

tests/qmltests/Components/tst_Showable.qml+13

This diff is too big to show here.

tests/qmltests/Components/tst_VirtualTouchPad.qml+55−1

This diff is too big to show here.

tests/qmltests/Components/tst_Wallpaper.qmlnew file+118

This diff is too big to show here.

tests/qmltests/Components/tst_WallpaperResolver.qml+104−18

This diff is too big to show here.

tests/qmltests/Components/tst_ZoomableImage.qml+1−1

This diff is too big to show here.

tests/qmltests/Dash/CardHelpers.jsdeleted−115

This diff is too big to show here.

tests/qmltests/Dash/Filters/tst_FilterExpandableWidget.qmldeleted−99

This diff is too big to show here.

tests/qmltests/Dash/Filters/tst_FilterOptionSelector.qmldeleted−96

This diff is too big to show here.

tests/qmltests/Dash/Filters/tst_FilterRangeInput.qmldeleted−247

This diff is too big to show here.

tests/qmltests/Dash/Filters/tst_FilterValueSlider.qmldeleted−101

This diff is too big to show here.

tests/qmltests/Dash/Filters/tst_FilterWidgetFactory.qmldeleted−59

This diff is too big to show here.

tests/qmltests/Dash/Previews/MockPreviewWidget.qmldeleted−27

This diff is too big to show here.

tests/qmltests/Dash/Previews/tst_Preview.qmldeleted−151

This diff is too big to show here.

tests/qmltests/Dash/Previews/tst_PreviewActions.qmldeleted−262

This diff is too big to show here.

tests/qmltests/Dash/Previews/tst_PreviewAudioPlayback.qmldeleted−182

This diff is too big to show here.

tests/qmltests/Dash/Previews/tst_PreviewComment.qmldeleted−84

This diff is too big to show here.

tests/qmltests/Dash/Previews/tst_PreviewCommentInput.qmldeleted−113

This diff is too big to show here.

tests/qmltests/Dash/Previews/tst_PreviewExpandable.qmldeleted−358

This diff is too big to show here.

tests/qmltests/Dash/Previews/tst_PreviewHeader.qmldeleted−183

This diff is too big to show here.

tests/qmltests/Dash/Previews/tst_PreviewIconActions.qmldeleted−136

This diff is too big to show here.

tests/qmltests/Dash/Previews/tst_PreviewImageGallery.qmldeleted−147

This diff is too big to show here.

tests/qmltests/Dash/Previews/tst_PreviewInlineVideo.qmldeleted−155

This diff is too big to show here.

tests/qmltests/Dash/Previews/tst_PreviewMediaToolbar.qmldeleted−69

This diff is too big to show here.

tests/qmltests/Dash/Previews/tst_PreviewPayments.qmldeleted−203

This diff is too big to show here.

tests/qmltests/Dash/Previews/tst_PreviewProgress.qmldeleted−100

This diff is too big to show here.

tests/qmltests/Dash/Previews/tst_PreviewRatingDisplay.qmldeleted−123

This diff is too big to show here.

tests/qmltests/Dash/Previews/tst_PreviewRatingDisplayCreationRanges.qmldeleted−131

This diff is too big to show here.

tests/qmltests/Dash/Previews/tst_PreviewRatingEdit.qmldeleted−87

This diff is too big to show here.

tests/qmltests/Dash/Previews/tst_PreviewRatingInput.qmldeleted−246

This diff is too big to show here.

tests/qmltests/Dash/Previews/tst_PreviewTable.qmldeleted−147

This diff is too big to show here.

tests/qmltests/Dash/Previews/tst_PreviewTextSummary.qmldeleted−87

This diff is too big to show here.

tests/qmltests/Dash/Previews/tst_PreviewVideoPlayback.qmldeleted−61

This diff is too big to show here.

tests/qmltests/Dash/Previews/tst_PreviewWidgetFactory.qmldeleted−104

This diff is too big to show here.

tests/qmltests/Dash/Previews/tst_PreviewZoomableImage.qmldeleted−138

This diff is too big to show here.

tests/qmltests/Dash/ScopeSettings/tst_ScopeSettingBoolean.qmldeleted−62

This diff is too big to show here.

tests/qmltests/Dash/ScopeSettings/tst_ScopeSettingList.qmldeleted−84

This diff is too big to show here.

tests/qmltests/Dash/ScopeSettings/tst_ScopeSettingNumber.qmldeleted−98

This diff is too big to show here.

tests/qmltests/Dash/ScopeSettings/tst_ScopeSettingString.qmldeleted−88

This diff is too big to show here.

tests/qmltests/Dash/ScopeSettings/tst_ScopeSettingsWidgetFactory.qmldeleted−65

This diff is too big to show here.

tests/qmltests/Dash/artwork/avatar@12.pngdeleted

Binary file not shown.

tests/qmltests/Dash/artwork/background.pngdeleted

Binary file not shown.

tests/qmltests/Dash/artwork/checkers.pngdeleted

Binary file not shown.

tests/qmltests/Dash/artwork/emblem.pngdeleted

Binary file not shown.

tests/qmltests/Dash/artwork/music-player-design.pngdeleted

Binary file not shown.

tests/qmltests/Dash/tst_Card.qmldeleted−682

This diff is too big to show here.

tests/qmltests/Dash/tst_CardBenchmark.qmldeleted−95

This diff is too big to show here.

tests/qmltests/Dash/tst_CardCarousel.qmldeleted−111

This diff is too big to show here.

tests/qmltests/Dash/tst_CardTool.qmldeleted−379

This diff is too big to show here.

tests/qmltests/Dash/tst_Dash.qmldeleted−693

This diff is too big to show here.

tests/qmltests/Dash/tst_DashContent.qmldeleted−730

This diff is too big to show here.

tests/qmltests/Dash/tst_DashPageHeader.qmldeleted−357

This diff is too big to show here.

tests/qmltests/Dash/tst_DashShell.qmldeleted−145

This diff is too big to show here.

tests/qmltests/Dash/tst_GenericScopeView.qmldeleted−722

This diff is too big to show here.

tests/qmltests/Dash/tst_PageHeader/logo-ubuntu-orange.svgdeleted−60

This diff is too big to show here.

tests/qmltests/Dash/tst_PreviewView.qmldeleted−122

This diff is too big to show here.

tests/qmltests/Greeter/TestView.qml+16−22

This diff is too big to show here.

tests/qmltests/Greeter/tst_Greeter.qml+80−140

This diff is too big to show here.

tests/qmltests/Greeter/tst_GreeterView.qmlnew file+1366

This diff is too big to show here.

tests/qmltests/Greeter/tst_Infographics.qml+1−11

This diff is too big to show here.

tests/qmltests/Greeter/tst_NarrowView.qmldeleted−589

This diff is too big to show here.

tests/qmltests/Greeter/tst_WideView.qmldeleted−757

This diff is too big to show here.

tests/qmltests/Launcher/tst_Drawer.qmlnew file+520

This diff is too big to show here.

tests/qmltests/Launcher/tst_Launcher.qml+259−85

This diff is too big to show here.

tests/qmltests/Notifications/tst_Notifications.qml+27−21

This diff is too big to show here.

tests/qmltests/Notifications/tst_OptionToggle.qml+12−6

This diff is too big to show here.

tests/qmltests/Notifications/tst_SwipeToAct.qml+15−8

This diff is too big to show here.

tests/qmltests/Notifications/tst_VisualSnapDecisionsQueue.qml+3−3

This diff is too big to show here.

tests/qmltests/Panel/tst_IndicatorItem.qml → tests/qmltests/Panel/Indicators/tst_IndicatorItem.qmlrenamed+1−1

This diff is too big to show here.

tests/qmltests/Panel/Indicators/tst_MenuItemFactory.qml → tests/qmltests/Panel/Indicators/tst_IndicatorMenuItemFactory.qmlrenamed+41−82

This diff is too big to show here.

tests/qmltests/Panel/Indicators/tst_IndicatorsLight.qml+168−8

This diff is too big to show here.

tests/qmltests/Panel/IndicatorTest.qml → tests/qmltests/Panel/PanelTest.qmlrenamed−5

This diff is too big to show here.

tests/qmltests/Panel/PanelUI.qmlnew file+286

This diff is too big to show here.

tests/qmltests/Panel/tst_ActiveCallHint.qml+29−10

This diff is too big to show here.

tests/qmltests/Panel/tst_MenuContent.qml+16−4

This diff is too big to show here.

tests/qmltests/Panel/tst_Panel.qml+419−235

This diff is too big to show here.

tests/qmltests/Panel/tst_IndicatorsBar.qml → tests/qmltests/Panel/tst_PanelBar.qmlrenamed+24−33

This diff is too big to show here.

tests/qmltests/Panel/tst_IndicatorItemRow.qml → tests/qmltests/Panel/tst_PanelItemRow.qmlrenamed+38−34

This diff is too big to show here.

tests/qmltests/Panel/tst_IndicatorsMenu.qml → tests/qmltests/Panel/tst_PanelMenu.qmlrenamed+91−34

This diff is too big to show here.

tests/qmltests/Panel/tst_IndicatorPage.qml → tests/qmltests/Panel/tst_PanelMenuPage.qmlrenamed+53−47

This diff is too big to show here.

tests/qmltests/Panel/tst_PanelSmallScreen.qmlnew file+133

This diff is too big to show here.

tests/qmltests/Stage/ApplicationCheckBox.qml+8−8

This diff is too big to show here.

tests/qmltests/Stage/tst_ApplicationWindow.qml+15−32

This diff is too big to show here.

tests/qmltests/Stage/tst_DecoratedWindow.qml+40−5

This diff is too big to show here.

tests/qmltests/Stage/tst_DesktopStage.qml+417−141

This diff is too big to show here.

tests/qmltests/Stage/tst_PhoneStage.qml+118−102

This diff is too big to show here.

tests/qmltests/Stage/tst_QMLTopLevelWindowModel.qmlnew file+191

This diff is too big to show here.

tests/qmltests/Stage/tst_SpreadDelegate.qmldeleted−423

This diff is too big to show here.

tests/qmltests/Stage/tst_SurfaceContainer.qml+13−8

This diff is too big to show here.

tests/qmltests/Stage/tst_TabletStage.qml+151−141

This diff is too big to show here.

tests/qmltests/Stage/tst_WindowDecoration.qmlnew file+244

This diff is too big to show here.

tests/qmltests/Stage/tst_WindowResizeArea.qml+22−78

This diff is too big to show here.

tests/qmltests/Tutorial/tst_Tutorial.qml+205−184

This diff is too big to show here.

tests/qmltests/Wizard/tst_Wizard.qml+101−128

This diff is too big to show here.

tests/qmltests/tst_DisabledScreenNotice.qml+23−9

This diff is too big to show here.

tests/qmltests/tst_OrientedShell.qml+410−274

This diff is too big to show here.

tests/qmltests/tst_Shell.qml+1329−794

This diff is too big to show here.

tests/qmltests/tst_ShellWithPin.qml+122−190

This diff is too big to show here.

tests/scripts/alert-launcher-icon.sh+16

This diff is too big to show here.

tests/scripts/get-progress.sh+16

This diff is too big to show here.

tests/scripts/list-launcher-icons.sh+16

This diff is too big to show here.

tests/scripts/set-count-visible.sh+16

This diff is too big to show here.

tests/scripts/set-count.sh+16

This diff is too big to show here.

tests/scripts/set-progress.sh+16

This diff is too big to show here.

tests/uqmlscene/CMakeLists.txt+14−2

This diff is too big to show here.

tests/uqmlscene/main.cpp+7−3

This diff is too big to show here.

tests/utils/modules/Unity/Test/CMakeLists.txt+5−5

This diff is too big to show here.

tests/utils/modules/Unity/Test/MouseTouchEmulationCheckbox.qml+1−1

This diff is too big to show here.

tests/utils/modules/Unity/Test/StageTestCase.qmlnew file+64

This diff is too big to show here.

tests/utils/modules/Unity/Test/TouchEventSequenceWrapper.cpp+18

This diff is too big to show here.

tests/utils/modules/Unity/Test/UnityTestCase.qml+10−20

This diff is too big to show here.

tests/utils/modules/Unity/Test/qmldir+2−1

This diff is too big to show here.

tests/utils/modules/Unity/Test/testutil.cpp+1−1

This diff is too big to show here.

tools/CMakeLists.txt+2−12

This diff is too big to show here.

src/Panel/Indicators/client/CMakeLists.txt → tools/indicatorsclient/CMakeLists.txtrenamed+1−1

This diff is too big to show here.

src/Panel/Indicators/client/indicatorsclient.cpp → tools/indicatorsclient/indicatorsclient.cpprenamed

The content is the same.

src/Panel/Indicators/client/indicatorsclient.h → tools/indicatorsclient/indicatorsclient.hrenamed

The content is the same.

src/Panel/Indicators/client/main.cpp → tools/indicatorsclient/main.cpprenamed

The content is the same.

tools/menutool/CMakeLists.txtnew file+5

This diff is too big to show here.

tools/menutool/READMEnew file+11

This diff is too big to show here.

tools/menutool/menutool.cppnew file+62

This diff is too big to show here.

tools/menutool/menutool.qmlnew file+118

This diff is too big to show here.

tools/registry-tracker.cppdeleted−146

This diff is too big to show here.

tools/registry-tracker.hdeleted−49

This diff is too big to show here.

tools/scopetool.cppdeleted−116

This diff is too big to show here.

tools/unlock-device+16

This diff is too big to show here.