[Differential] [Commented On] D2790: Make application close upon Ctrl+Q

2016-09-16 Thread mart (Marco Martin)
mart added a comment.


  hmm, can it be intercepted since Applicationwindow can't be subclassed from 
c++? i can think about an ugly event filter, but ouch..

REPOSITORY
  rKIRIGAMI Kirigami

BRANCH
  master

REVISION DETAIL
  https://phabricator.kde.org/D2790

EMAIL PREFERENCES
  https://phabricator.kde.org/settings/panel/emailpreferences/

To: apol, #kirigami, mart, broulik
Cc: broulik, plasma-devel, apol


[Differential] [Commented On] D2790: Make application close upon Ctrl+Q

2016-09-15 Thread broulik (Kai Uwe Broulik)
broulik added a comment.


  You can: http://doc.qt.io/qt-5/qml-qtquick-window-window.html#closing-signal

REPOSITORY
  rKIRIGAMI Kirigami

BRANCH
  master

REVISION DETAIL
  https://phabricator.kde.org/D2790

EMAIL PREFERENCES
  https://phabricator.kde.org/settings/panel/emailpreferences/

To: apol, #kirigami, broulik, mart
Cc: broulik, plasma-devel, apol


[Differential] [Commented On] D2790: Make application close upon Ctrl+Q

2016-09-15 Thread apol (Aleix Pol Gonzalez)
apol added a comment.


  In https://phabricator.kde.org/D2790#51966, @broulik wrote:
  
  > So, Ctrl+Q always quits without confirmation? What about having a
  >
  >   singal aboutToQuit(var event)
  >
  > and then do:
  >
  >   onActivated: {
  >   var event = {accepted: false}
  >   aboutToQuit(event);
  >   if (!event.accepted) {
  >   Qt.quit();
  >   }
  >   }
  >
  > Then an app can
  >
  >   onAboutToQuit: {
  >   if (hasUnsavedChanges) {
  >   event.accepted = true;
  >   // ask for confirmation
  >   }
  >   }
  
  
  That could be interesting but could be out of scope for the patch? There's 
other ways the application can be closed.

REPOSITORY
  rKIRIGAMI Kirigami

REVISION DETAIL
  https://phabricator.kde.org/D2790

EMAIL PREFERENCES
  https://phabricator.kde.org/settings/panel/emailpreferences/

To: apol, #kirigami, mart
Cc: broulik, plasma-devel, apol


[Differential] [Commented On] D2790: Make application close upon Ctrl+Q

2016-09-15 Thread broulik (Kai Uwe Broulik)
broulik added a comment.


  So, Ctrl+Q always quits without confirmation? What about having a
  
singal aboutToQuit(var event)
  
  and then do:
  
onActivated: {
var event = {accepted: false}
aboutToQuit(event);
if (!event.accepted) {
Qt.quit();
}
}
  
  Then an app can
  
onAboutToQuit: {
if (hasUnsavedChanges) {
event.accepted = true;
// ask for confirmation
}
}

REPOSITORY
  rKIRIGAMI Kirigami

REVISION DETAIL
  https://phabricator.kde.org/D2790

EMAIL PREFERENCES
  https://phabricator.kde.org/settings/panel/emailpreferences/

To: apol, #kirigami, mart
Cc: broulik, plasma-devel, apol