~blue-shell/blue-shell/kde-workspace-systemsettings-qml-4.9

« back to all changes in this revision

Viewing changes to krunner/lock/lockdlg.h

  • Committer: Luboš Luňák
  • Date: 2002-03-02 22:53:37 UTC
  • Revision ID: git-v1:0f8cc785dbf548afc08084d171ef76aae2eb906c
Fix #38142 by using a separate process for the actual locking.
In case I've broken something, yell.

svn path=/trunk/kdebase/kdesktop/lock/; revision=140360

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//===========================================================================
 
2
//
 
3
// This file is part of the KDE project
 
4
//
 
5
// Copyright (c) 1999 Martin R. Jones <mjones@kde.org>
 
6
//
 
7
 
 
8
#ifndef __LOCKDLG_H__
 
9
#define __LOCKDLG_H__
 
10
 
 
11
#include <qframe.h>
 
12
#include <qlabel.h>                                                             
 
13
#include <X11/Xlib.h>
 
14
 
 
15
//===========================================================================
 
16
//
 
17
// Simple dialog for entering a password.
 
18
// It does not handle password validation.
 
19
//
 
20
class PasswordDlg : public QFrame
 
21
{
 
22
    Q_OBJECT
 
23
public:
 
24
    PasswordDlg(QWidget *parent);
 
25
 
 
26
    //-----------------------------------------------------------------------
 
27
    //
 
28
    // Reset the password to ""
 
29
    //
 
30
    void resetPassword();
 
31
 
 
32
    //-----------------------------------------------------------------------
 
33
    //
 
34
    // Show "Failed" in the dialog for 1.5 seconds
 
35
    //
 
36
    void showFailed();
 
37
 
 
38
    //-----------------------------------------------------------------------
 
39
    //
 
40
    // Keyboard events should be passed to this function directly.
 
41
    // We accept key presses this way because the keyboard is grabbed, so we
 
42
    // don't get any events.  There's nicer ways of handling this, but this
 
43
    // is simplest.
 
44
    //
 
45
    void keyPressed(XKeyEvent *);
 
46
 
 
47
    //-----------------------------------------------------------------------
 
48
    //
 
49
    // return the password the user entered.
 
50
    //
 
51
    QString password() const { return mPassword; }
 
52
 
 
53
protected:
 
54
    void drawStars();
 
55
    QString currentUser();
 
56
    QString passwordQueryMsg(bool name);
 
57
    virtual void timerEvent(QTimerEvent *);
 
58
 
 
59
private:
 
60
    int         mFailedTimerId;
 
61
    int         mBlinkTimerId;
 
62
    QLabel      *mLabel;
 
63
    QLabel      *mEntry;
 
64
    QString     mPassword;
 
65
    int         mStars;
 
66
    bool        mBlink;
 
67
};
 
68
 
 
69
#endif
 
70