Advertisement
Guest User

Logout.qml

a guest
Feb 21st, 2016
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.48 KB | None | 0 0
  1. /***************************************************************************
  2. * Copyright (C) 2014 by Aleix Pol Gonzalez <aleixpol@blue-systems.com> *
  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; either version 2 of the License, or *
  7. * (at your option) any later version. *
  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, write to the *
  16. * Free Software Foundation, Inc., *
  17. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
  18. ***************************************************************************/
  19.  
  20. import QtQuick 2.1
  21. import "../components"
  22.  
  23. Item {
  24. id: root
  25. height: units.largeSpacing*14
  26. width: screenGeometry.width/4
  27.  
  28. signal logoutRequested()
  29. signal haltRequested()
  30. signal suspendRequested(int spdMethod)
  31. signal rebootRequested()
  32. signal rebootRequested2(int opt)
  33. signal cancelRequested()
  34. signal lockScreenRequested()
  35.  
  36. LogoutScreen {
  37. anchors.fill: parent
  38.  
  39. mode: switch (sdtype) {
  40. case ShutdownType.ShutdownTypeNone:
  41. return "logout";
  42. case ShutdownType.ShutdownTypeHalt:
  43. return maysd ? "shutdown" : "logout";
  44. case ShutdownType.ShutdownTypeReboot:
  45. return maysd ? "reboot" : "logout";
  46. default:
  47. return "logout";
  48. }
  49.  
  50. onShutdownRequested: {
  51. root.haltRequested()
  52. }
  53.  
  54. onRebootRequested: {
  55. root.rebootRequested()
  56. }
  57. canShutdown: maysd && choose
  58. canReboot: maysd && choose
  59. canLogout: true
  60.  
  61. onCancel: root.cancelRequested()
  62. }
  63. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement