source: src-qt4/PCDM/src/loginWidget.h @ 1d2d46a

9.2-releasereleng/10.0releng/10.0.1releng/10.0.2
Last change on this file since 1d2d46a was 1d2d46a, checked in by Ken Moore <ken@…>, 12 months ago

Completely redo the simple desktop switcher option. It now puts it in the login widget underneath the password prompt. Also clean up the default theme a bit to accomodate these changes.

  • Property mode set to 100644
File size: 2.3 KB
Line 
1/* PCDM Login Manager:
2*  Written by Ken Moore (ken@pcbsd.org) 2012/2013
3*  Copyright(c) 2013 by the PC-BSD Project
4*  Available under the 3-clause BSD license
5*/
6
7/*
8 Sub-classed widget for a login entry box
9*/
10
11#ifndef LOGIN_WIDGET_H
12#define LOGIN_WIDGET_H
13
14#include <QWidget>
15#include <QFile>
16#include <QPushButton>
17#include <QToolButton>
18#include <QFormLayout>
19#include <QPixmap>
20#include <QDebug>
21#include <QLabel>
22#include <QComboBox>
23#include <QLineEdit>
24#include <QKeyEvent>
25#include <QAction>
26#include <QGroupBox>
27#include <QListWidget>
28#include <QAbstractItemView>
29
30class LoginWidget : public QGroupBox
31{
32        Q_OBJECT
33
34  public:
35        LoginWidget(QWidget* parent = 0);
36        ~LoginWidget();
37
38        //Get the currently selected items
39        QString currentUsername();
40        QString currentPassword();
41        QString currentDE();
42        void setCurrentUser(QString);
43        void setCurrentDE(QString);
44        void setUsernames(QStringList);
45        void setDesktops(QStringList, QStringList, QStringList);
46        void displayHostName(QString);
47        void changeButtonIcon(QString button, QString iconFile, QSize iconSize);
48        void setDesktopIconSize(QSize);
49        //Change the style sheet for all widget items (see QtStyle options for more)
50        void changeStyleSheet(QString item, QString style);
51       
52        void keyPressEvent(QKeyEvent *e);
53        void retranslateUi();
54        void resetFocus(QString item="");
55        void allowPasswordView(bool);
56 
57  private:
58        QComboBox* listUsers;
59        QComboBox* listDE;
60        QListWidget* listUserBig;
61        QLineEdit* linePassword;
62        QToolButton* pushLogin;
63        QToolButton* pushViewPassword;
64        QToolButton *pushUserIcon, *userIcon;
65        QLabel* deIcon;
66       
67
68        QStringList idL, desktopIcons, desktopInfo;
69        QSize desktopIconSize;
70        QString hostName;
71        bool userSelected, pwVisible, allowPWVisible;
72
73        void updateWidget();
74
75  private slots:
76        void slotUserActivated(QAction*);
77        //void slotUserClicked(QListWidgetItem*);
78        void slotUserHighlighted(int);
79        void slotUserSelected();
80        void slotUserUnselected();
81        void slotTryLogin();
82        void slotChooseUser(int);
83        void slotChangePWView();
84        void slotDesktopChanged(int);
85       
86  signals:
87        //Emits these signals whenever a login request is detected
88        void loginRequested(QString user, QString password);
89        void UserSelected(QString user);
90        void UserChanged(QString user);
91        void escapePressed();
92
93};
94#endif
Note: See TracBrowser for help on using the repository browser.