summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--Makefile14
-rw-r--r--core/launcher/taskbar.cpp4
-rw-r--r--core/opie-login/README2
-rw-r--r--core/opie-login/qdmdialogimpl.cpp2
4 files changed, 11 insertions, 11 deletions
diff --git a/Makefile b/Makefile
index 24a9050..01aba30 100644
--- a/Makefile
+++ b/Makefile
@@ -1,71 +1,71 @@
default: dynamic
all: default docs
LIBS=library libopie
COMPONENTS=$(LOCALCOMPONENTS) inputmethods/keyboard \
inputmethods/pickboard \
inputmethods/handwriting \
inputmethods/unikeyboard \
inputmethods/jumpx \
inputmethods/dvorak \
- taskbar/batteryapplet \
- taskbar/volumeapplet \
- taskbar/clockapplet \
- taskbar/netmonapplet \
- taskbar/screenshotapplet \
- taskbar/vmemo \
+ launcher/batteryapplet \
+ launcher/volumeapplet \
+ launcher/clockapplet \
+ launcher/netmonapplet \
+ launcher/screenshotapplet \
+ launcher/vmemo \
netsetup/dialup \
netsetup/lan \
opiemail/ifaces/pop3 opiemail/ifaces/smtp \
mpegplayer/libmpeg3 \
mpegplayer/libmad \
mpegplayer/wavplugin \
cardmon \
sdmon
APPS=$(LOCALAPPS) core/addressbook calculator clock datebook \
filebrowser helpbrowser minesweep mpegplayer \
settings/light-and-power \
settings/language \
settings/rotation \
settings/appearance \
settings/security \
settings/sound \
settings/systemtime \
solitaire spreadsheet tetrix textedit \
- todo wordgame embeddedkonsole taskbar sysinfo \
+ todo wordgame embeddedkonsole launcher sysinfo \
parashoot snake citytime showimg netsetup tableviewer \
qipkg mindbreaker go qasteroids qcop fifteen keypebble today opiemail/converter opiemail \
noncore/tictac noncore/opieftp noncore/drawpad noncore/kcheckers
DOCS = docs/src/opie-policy
single: mpegplayer/libmpeg3
dynamic: $(APPS)
docs: $(DOCS)
$(COMPONENTS): $(LIBS)
$(APPS): $(LIBS) $(COMPONENTS)
$(LIBS) $(COMPONENTS) $(APPS) $(DOCS) single:
$(MAKE) -C $@ -f Makefile
showcomponents:
@echo $(LIBS) $(APPS) $(COMPONENTS) single
clean:
$(MAKE) -C single -f Makefile $@
for dir in $(APPS) $(LIBS) $(COMPONENTS) $(DOCS); do $(MAKE) -C $$dir -f Makefile $@ || exit 1; done
lupdate:
for dir in $(APPS) $(LIBS) $(COMPONENTS); do $(MAKE) -C $$dir -f Makefile $@ || exit 1; done
lrelease:
for dir in $(APPS) $(LIBS) $(COMPONENTS); do $(MAKE) -C $$dir -f Makefile $@ || exit 1; done
.PHONY: default dynamic $(LIBS) $(APPS) $(COMPONENTS) $(DOCS) single showcomponents clean
diff --git a/core/launcher/taskbar.cpp b/core/launcher/taskbar.cpp
index d7f36bd..18d28cb 100644
--- a/core/launcher/taskbar.cpp
+++ b/core/launcher/taskbar.cpp
@@ -1,268 +1,268 @@
/**********************************************************************
** Copyright (C) 2000 Trolltech AS. All rights reserved.
**
** This file is 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.
**
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
#include "startmenu.h"
#include "inputmethods.h"
#include "mrulist.h"
#include "systray.h"
#include "calibrate.h"
#include "wait.h"
#include "appicons.h"
#include "taskbar.h"
#include "desktop.h"
#include <qpe/qpeapplication.h>
#include <qpe/qcopenvelope_qws.h>
#include <qpe/global.h>
#ifdef QT_QWS_CUSTOM
#include <qpe/custom.h>
#endif
#include <qlabel.h>
#include <qlayout.h>
#include <qtimer.h>
#include <qwindowsystem_qws.h>
#include <qwidgetstack.h>
#if defined( Q_WS_QWS )
#include <qwsdisplay_qws.h>
#include <qgfx_qws.h>
#endif
#define FACTORY(T) \
static QWidget *new##T( bool maximized ) { \
QWidget *w = new T( 0, "test", QWidget::WDestructiveClose | QWidget::WGroupLeader ); \
if ( maximized ) { \
if ( qApp->desktop()->width() <= 350 ) { \
w->showMaximized(); \
} else { \
w->resize( QSize( 300, 300 ) ); \
} \
} \
w->show(); \
return w; \
}
#ifdef SINGLE_APP
#define APP(a,b,c,d) FACTORY(b)
-#include "../taskbar/apps.h"
+#include "../launcher/apps.h"
#undef APP
#endif // SINGLE_APP
static Global::Command builtins[] = {
#ifdef SINGLE_APP
#define APP(a,b,c,d) { a, new##b, c },
-#include "../taskbar/apps.h"
+#include "../launcher/apps.h"
#undef APP
#endif
#if defined(QT_QWS_IPAQ) || defined(QT_QWS_CASSIOPEIA) || defined(QT_QWS_EBX)
{ "calibrate", TaskBar::calibrate, 1, 0 },
#endif
#if !defined(QT_QWS_CASSIOPEIA)
{ "shutdown", Global::shutdown, 1, 0 },
// { "run", run, 1, 0 },
#endif
{ 0, TaskBar::calibrate, 0, 0 },
};
static bool initNumLock()
{
#ifdef QPE_INITIAL_NUMLOCK_STATE
QPE_INITIAL_NUMLOCK_STATE
#endif
return FALSE;
}
class LockKeyState : public QWidget
{
public:
LockKeyState( QWidget *parent ) :
QWidget(parent),
nl(initNumLock()), cl(FALSE)
{
nl_pm = Resource::loadPixmap("numlock");
cl_pm = Resource::loadPixmap("capslock");
}
QSize sizeHint() const
{
return QSize(nl_pm.width()+2,nl_pm.width()+nl_pm.height()+1);
}
void toggleNumLockState()
{
nl = !nl; repaint();
}
void toggleCapsLockState()
{
cl = !cl; repaint();
}
void paintEvent( QPaintEvent * )
{
int y = (height()-sizeHint().height())/2;
QPainter p(this);
if ( nl )
p.drawPixmap(1,y,nl_pm);
if ( cl )
p.drawPixmap(1,y+nl_pm.height()+1,cl_pm);
}
private:
QPixmap nl_pm, cl_pm;
bool nl, cl;
};
TaskBar::~TaskBar()
{
}
TaskBar::TaskBar() : QHBox(0, 0, WStyle_Customize | WStyle_Tool | WStyle_StaysOnTop | WGroupLeader)
{
Global::setBuiltinCommands(builtins);
sm = new StartMenu( this );
inputMethods = new InputMethods( this );
connect( inputMethods, SIGNAL(inputToggled(bool)),
this, SLOT(calcMaxWindowRect()) );
//new QuickLauncher( this );
stack = new QWidgetStack( this );
stack->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Minimum ) );
label = new QLabel(stack);
mru = new MRUList( stack );
stack->raiseWidget( mru );
waitIcon = new Wait( this );
(void) new AppIcons( this );
sysTray = new SysTray( this );
// ## make customizable in some way?
#ifdef QT_QWS_CUSTOM
lockState = new LockKeyState( this );
#else
lockState = 0;
#endif
#if defined(Q_WS_QWS)
#if !defined(QT_NO_COP)
QCopChannel *channel = new QCopChannel( "QPE/TaskBar", this );
connect( channel, SIGNAL(received(const QCString&, const QByteArray&)),
this, SLOT(receive(const QCString&, const QByteArray&)) );
#endif
#endif
waitTimer = new QTimer( this );
connect( waitTimer, SIGNAL( timeout() ), this, SLOT( stopWait() ) );
clearer = new QTimer( this );
QObject::connect(clearer, SIGNAL(timeout()), SLOT(clearStatusBar()));
QObject::connect(clearer, SIGNAL(timeout()), sysTray, SLOT(show()));
}
void TaskBar::setStatusMessage( const QString &text )
{
label->setText( text );
stack->raiseWidget( label );
if ( sysTray && ( label->fontMetrics().width( text ) > label->width() ) )
sysTray->hide();
clearer->start( 3000 );
}
void TaskBar::clearStatusBar()
{
label->clear();
stack->raiseWidget( mru );
}
void TaskBar::startWait()
{
waitIcon->setWaiting( true );
// a catchall stop after 10 seconds...
waitTimer->start( 10 * 1000, true );
}
void TaskBar::stopWait(const QString& app)
{
waitTimer->stop();
mru->addTask(sm->execToLink(app));
waitIcon->setWaiting( false );
}
void TaskBar::stopWait()
{
waitTimer->stop();
waitIcon->setWaiting( false );
}
void TaskBar::resizeEvent( QResizeEvent *e )
{
QHBox::resizeEvent( e );
calcMaxWindowRect();
}
void TaskBar::styleChange( QStyle &s )
{
QHBox::styleChange( s );
calcMaxWindowRect();
}
void TaskBar::calcMaxWindowRect()
{
#ifdef Q_WS_QWS
QRect wr;
int displayWidth = qApp->desktop()->width();
QRect ir = inputMethods->inputRect();
if ( ir.isValid() ) {
wr.setCoords( 0, 0, displayWidth-1, ir.top()-1 );
} else {
wr.setCoords( 0, 0, displayWidth-1, y()-1 );
}
#if QT_VERSION < 300
QWSServer::setMaxWindowRect( qt_screen->mapToDevice(wr,
QSize(qt_screen->width(),qt_screen->height()))
);
#else
QWSServer::setMaxWindowRect( wr );
#endif
#endif
}
void TaskBar::receive( const QCString &msg, const QByteArray &data )
{
QDataStream stream( data, IO_ReadOnly );
if ( msg == "message(QString)" ) {
QString text;
stream >> text;
setStatusMessage( text );
} else if ( msg == "hideInputMethod()" ) {
inputMethods->hideInputMethod();
} else if ( msg == "showInputMethod()" ) {
inputMethods->showInputMethod();
} else if ( msg == "reloadInputMethods()" ) {
inputMethods->loadInputMethods();
} else if ( msg == "reloadApplets()" ) {
sysTray->loadApplets();
} else if ( msg == "soundAlarm()" ) {
diff --git a/core/opie-login/README b/core/opie-login/README
index ad3b298..4a4234d 100644
--- a/core/opie-login/README
+++ b/core/opie-login/README
@@ -1,78 +1,78 @@
Welcome to LISA System's
QDM - the Login-Dialog for QPE
WHAT'S THIS:
This small add-on for the Qtopia Environment (QPE - see
http://qpe.sourceforge.net for further details) allows You to use your
handheld computer running QPE and Linux with the typical Un*x user
handling, i.e. just log in on a graphical environment, as e.g. KDM or
XDM. This way your personal data can be easily protected against
unwanted access from others in case you loose your machine.
STATUS:
Still in development, but should be useable.
REQUIREMENTS:
- QDM needs Linux-PAM (Pluggable Authentication Modules for Linux) for
proper user validation.
- the /dev/fb0 device has to writeable to everyone ;-(
INSTALLATION:
Per default this little add-on is not enabled. You have to do so
yourself for now, by setting a compile option variable called
QT_QWS_LOGIN . Furthermore there have to be made some changes in
-taskbar/taskbar.pro :
+launcher/taskbar.pro :
At the section HEADERS insert a line:
../login/qdmdialogimpl.h \
At the section SOURCES insert a line:
../login/qdmdialogimpl.cpp \
furthermore serte these lines:
INCLUDEPATH += ../login
DEPENDPATH += ../login
INTERFACES = ../login/qdmdialog.ui
For unix-login make folloing changes to a line:
LIBS = -lqpe -lcrypt
For PAM use the following:
LIBS = -lqpe -ldl -lpam
CONFIGURATION:
Configuration of the 'Look' of QDM is done via Qt Designer. Just open
the .ui file and edit the look of the dialog as you like. You can, for
instance, change the logo pixmap. QDM should also be ready for i18n so
far.
Other configuration stuff, eg welcome string in the upper right, and
user list can be changed in the qdm_config.h file.
USAGE:
The QDM comes up, when the QPE is started, and if the QPE is started
as 'root'. Being started as any other user, the uid couldn't be
changed and the login dialog wouldn't be ofg much use.
CONTACT:
http://www.lisa.de
diff --git a/core/opie-login/qdmdialogimpl.cpp b/core/opie-login/qdmdialogimpl.cpp
index bb1b453..56f0fc0 100644
--- a/core/opie-login/qdmdialogimpl.cpp
+++ b/core/opie-login/qdmdialogimpl.cpp
@@ -1,263 +1,263 @@
/**********************************************************************
** 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 <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>
#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 "../taskbar/inputmethods.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;
default:
break;
}
}
//----------------------------------------------------------------------------
void QDMDialogImpl::informBadPassword()
{
QMessageBox::warning( this, tr("Password wrong"),