summaryrefslogtreecommitdiff
path: root/core/applets/logoutapplet/logout.cpp
Unidiff
Diffstat (limited to 'core/applets/logoutapplet/logout.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/applets/logoutapplet/logout.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/core/applets/logoutapplet/logout.cpp b/core/applets/logoutapplet/logout.cpp
index 1769ae6..8d3cdba 100644
--- a/core/applets/logoutapplet/logout.cpp
+++ b/core/applets/logoutapplet/logout.cpp
@@ -66,59 +66,61 @@ QPopupMenu *LogoutApplet::popup ( QWidget * ) const
66 66
67class HackApplication : public QApplication { 67class HackApplication : public QApplication {
68public: 68public:
69 HackApplication ( ) : QApplication ( dummy, 0 ) 69 HackApplication ( ) : QApplication ( dummy, 0 )
70 { 70 {
71 } 71 }
72 72
73 void emit_about_to_quit ( ) 73 void emit_about_to_quit ( )
74 { 74 {
75 emit aboutToQuit ( ); 75 emit aboutToQuit ( );
76 } 76 }
77 77
78 int dummy; 78 int dummy;
79}; 79};
80 80
81 81
82void LogoutApplet::activated ( ) 82void LogoutApplet::activated ( )
83{ 83{
84 QMessageBox mb ( tr( "Logout" ), 84 QMessageBox mb ( tr( "Logout" ),
85 tr( "Do you really want to\nend this session ?" ), 85 tr( "Do you really want to\nend this session ?" ),
86 QMessageBox::NoIcon, 86 QMessageBox::NoIcon,
87 QMessageBox::Yes | QMessageBox::Default, 87 QMessageBox::Yes | QMessageBox::Default,
88 QMessageBox::No | QMessageBox::Escape, 88 QMessageBox::No | QMessageBox::Escape,
89 QMessageBox::NoButton ); 89 QMessageBox::NoButton );
90 90
91 mb. setButtonText ( QMessageBox::Yes, "Yes" ); 91 mb. setButtonText ( QMessageBox::Yes, "Yes" );
92 mb. setButtonText ( QMessageBox::No, "No" ); 92 mb. setButtonText ( QMessageBox::No, "No" );
93 mb. setIconPixmap ( icon ( ). pixmap ( )); 93 mb. setIconPixmap ( icon ( ). pixmap ( ));
94 94
95 if ( mb. exec ( ) == QMessageBox::Yes ) { 95 if ( mb. exec ( ) == QMessageBox::Yes ) {
96 { QCopEnvelope envelope( "QPE/System", "forceQuit()" ); } 96 { QCopEnvelope envelope( "QPE/System", "forceQuit()" ); }
97 97
98 qApp-> processEvents ( ); // ensure the message goes out. 98 qApp-> processEvents ( ); // ensure the message goes out.
99 sleep ( 1 ); // You have 1 second to comply. 99 sleep ( 1 ); // You have 1 second to comply.
100 100
101 ((HackApplication *) qApp )-> emit_about_to_quit ( ); 101 ((HackApplication *) qApp )-> emit_about_to_quit ( );
102 qApp-> quit(); 102 qApp-> quit();
103 } 103 }
104} 104}
105 105
106 106
107QRESULT LogoutApplet::queryInterface ( const QUuid &uuid, QUnknownInterface **iface ) 107QRESULT LogoutApplet::queryInterface ( const QUuid &uuid, QUnknownInterface **iface )
108{ 108{
109 *iface = 0; 109 *iface = 0;
110 if ( uuid == IID_QUnknown ) 110 if ( uuid == IID_QUnknown )
111 *iface = this; 111 *iface = this;
112 else if ( uuid == IID_MenuApplet ) 112 else if ( uuid == IID_MenuApplet )
113 *iface = this; 113 *iface = this;
114 else
115 return QS_FALSE;
114 116
115 if ( *iface ) 117 if ( *iface )
116 (*iface)-> addRef ( ); 118 (*iface)-> addRef ( );
117 return QS_OK; 119 return QS_OK;
118} 120}
119 121
120Q_EXPORT_INTERFACE( ) 122Q_EXPORT_INTERFACE( )
121{ 123{
122 Q_CREATE_INSTANCE( LogoutApplet ) 124 Q_CREATE_INSTANCE( LogoutApplet )
123} 125}
124 126