summaryrefslogtreecommitdiff
authorkergoth <kergoth>2002-04-24 22:29:40 (UTC)
committer kergoth <kergoth>2002-04-24 22:29:40 (UTC)
commita12408cb8191addfaf613ec7caeb270d74428bad (patch) (side-by-side diff)
tree41d88d6da4835cbe8751f12dc61d22fe5839d19d
parent203caeed5513f98d5f412acb5ca7bf51a4ab6df0 (diff)
downloadopie-a12408cb8191addfaf613ec7caeb270d74428bad.zip
opie-a12408cb8191addfaf613ec7caeb270d74428bad.tar.gz
opie-a12408cb8191addfaf613ec7caeb270d74428bad.tar.bz2
Set proper include paths for qpeapplication.h and global.h.
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--core/opie-login/qdmdialogimpl.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/opie-login/qdmdialogimpl.cpp b/core/opie-login/qdmdialogimpl.cpp
index 56f0fc0..5d4cd49 100644
--- a/core/opie-login/qdmdialogimpl.cpp
+++ b/core/opie-login/qdmdialogimpl.cpp
@@ -1,249 +1,249 @@
/**********************************************************************
** Copyright (C) 2001 LISA Systems
**
** This file is an additional part of Qtopia Environment.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** For further information contact info@lisa.de
**
**********************************************************************/
/*
* AUTHOR: Christian Rahn
* EMAIL: cdr@lisa.de
*
* $Id$
*/
#include "qdm_config.h"
#ifdef QT_QWS_LOGIN
#include <pwd.h>
#include <unistd.h>
#include <stdlib.h>
#include <iostream.h>
#include <assert.h>
#include <qlabel.h>
#include <qregexp.h>
#include <qdatetime.h>
#include <qmessagebox.h>
#include <qcombobox.h>
#include <qlineedit.h>
#include <qtranslator.h>
-#include <qpeapplication.h>
+#include <qpe/qpeapplication.h>
#include <qwsdisplay_qws.h>
#include <string.h>
#include <stdio.h>
#include <errno.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/sem.h>
#include <sys/shm.h>
#include <sys/ipc.h>
-#include <global.h>
+#include <qpe/global.h>
#if defined(QT_QWS_LOGIN_USEPAM)
extern "C" {
#include <security/pam_appl.h>
}
#else
#define _XOPEN_SOURCE
#include <unistd.h>
#include <crypt.h>
#endif
#include "qdmdialogimpl.h"
#include "../launcher/inputmethods.h"
//----------------------------------------------------------------------------
//-- taken from semctl man page
#if defined(__GNU_LIBRARY__) && !defined(_SEM_SEMUN_UNDEFINED)
//-- union semun is defined by including <sys/sem.h>
#else
//-- according to X/OPEN we have to define it ourselves
union semun {
int val; // value for SETVAL
struct semid_ds *buf; // buffer for IPC_STAT, IPC_SET
unsigned short int *array; // array for GETALL, SETALL
struct seminfo *__buf; // buffer for IPC_INFO
};
#endif
//----------------------------------------------------------------------------
static const int ShowClockFreq = 1;
QDM_SHOWNUSERS;
#ifdef QT_QWS_LOGIN_USEPAM
static const char *_PAM_SERVICE = "xdm";
static const char *PAM_password;
typedef const struct pam_message pam_message_type;
static int PAM_conv( int, pam_message_type **, struct pam_response **, void * );
static struct pam_conv PAM_conversation = {
&PAM_conv,
NULL
};
//----------------------------------------------------------------------------
static char *COPY_STRING( const char * s ) {
return (s) ? strdup(s) : (char *)NULL;
}
#define GET_MEM if (reply) realloc(reply, size);\
else reply = (struct pam_response *)malloc(size); \
if (!reply) return PAM_CONV_ERR; \
size += sizeof(struct pam_response)
static int PAM_conv( int num_msg, pam_message_type **msg,
struct pam_response **resp, void *)
{
int count = 0, replies = 0;
struct pam_response *reply = NULL;
int size = sizeof(struct pam_response);
for( count = 0; count < num_msg; count++ ) {
switch (msg[count]->msg_style) {
case PAM_PROMPT_ECHO_ON:
/* user name given to PAM already */
return PAM_CONV_ERR;
case PAM_PROMPT_ECHO_OFF:
/* wants password */
GET_MEM;
reply[replies].resp_retcode = PAM_SUCCESS;
reply[replies].resp = COPY_STRING(PAM_password);
replies++;
/* PAM frees resp */
break;
case PAM_TEXT_INFO:
break;
default:
/* unknown or PAM_ERROR_MSG */
if (reply) free (reply);
return PAM_CONV_ERR;
}
}
if (reply) *resp = reply;
return PAM_SUCCESS;
}
#endif
//----------------------------------------------------------------------------
QDMDialogImpl::QDMDialogImpl( QWidget* parent, const char* name, bool modal, WFlags f )
: QDMDialog( parent, name, modal, f )
{
showTime();
clockTimer = startTimer( ShowClockFreq * 1000 ); //-- call timer evry min.
setActiveWindow();
setFocus();
input = new InputMethods( this );
input->resize( input->sizeHint() );
input->move( 0, height() - input->height() );
for( int i=0; Shown_Users[i]; ++i ) {
input_user->insertItem( Shown_Users[i] );
}
input_user->clearEdit();
label_welcome->setText( QDM_WELCOME_STRING );
};
QDMDialogImpl::~QDMDialogImpl()
{
input->lower();
input->close( false );
input->hide();
delete input;
input = 0;
if( parent() ) {
((QWidget*)parent())->repaint(true);
}
};
void QDMDialogImpl::accept () { };
void QDMDialogImpl::reject () { };
void QDMDialogImpl::showTime( void )
{
label_date->setText( QDate::currentDate().toString() );
label_time->setText( QTime::currentTime().toString() );
}
void QDMDialogImpl::timerEvent( QTimerEvent * e )
{
if( e->timerId() == clockTimer )
showTime();
}
//----------------------------------------------------------------------------
void QDMDialogImpl::slot_sleepmode()
{
const int button = QMessageBox::warning( this, "Shutdown", tr( "Do you really want to go\nto sleep mode now?" ),
QString::null, tr( "Cancel" ), QString::null,0,1 );
switch( button ) {
case 0:
done( Rejected );
// Global::execute( cmd_shutdown );
if( vfork() == 0 ) {
execl( QDM_CMD_SLEEP, 0 );
cerr << "Sleepmode: " << strerror( errno ) << endl;
}
break;
default:
break;
}
}
//----------------------------------------------------------------------------
void QDMDialogImpl::slot_shutdown()
{
const int button = QMessageBox::warning( this, "Shutdown", tr("Do you really want to shut\nthe system down now?"),
QString::null, tr("Cancel"), QString::null,0,1 );
switch( button ) {
case 0:
done( Rejected );
// Global::execute( cmd_shutdown );
if( vfork() == 0 ) {
execl( QDM_CMD_SHUTDOWN, 0 );
cerr << "Shutdown: " << strerror( errno ) << endl;
}
break;