source: src-qt4/PCDM/src/loginWidget.h @ 2d615ae

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

Fix the PCDM background to the main window only, and remove an extra function from the loginwidget class.

  • Property mode set to 100644
File size: 2.1 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        void setCurrentUser(QString);
42        void setUsernames(QStringList);
43        void displayHostName(QString);
44        //Manually set the "back" (up/left) and "forward" (down/right) button icons
45        void changeButtonIcon(QString button, QString iconFile, QSize iconSize);
46        //Change the style sheet for all widget items (see QtStyle options for more)
47        void changeStyleSheet(QString item, QString style);
48       
49        void keyPressEvent(QKeyEvent *e);
50        void retranslateUi();
51        void resetFocus(QString item="");
52        void allowPasswordView(bool);
53 
54  private:
55        QComboBox* listUsers;
56        QListWidget* listUserBig;
57        QLineEdit* linePassword;
58        QToolButton* pushLogin;
59        QToolButton* pushViewPassword;
60        QToolButton *pushUserIcon, *userIcon;
61       
62
63        QStringList idL;
64        QString hostName;
65        bool userSelected, pwVisible, allowPWVisible;
66
67        void updateWidget();
68
69  private slots:
70        void slotUserActivated(QAction*);
71        //void slotUserClicked(QListWidgetItem*);
72        void slotUserHighlighted(int);
73        void slotUserSelected();
74        void slotUserUnselected();
75        void slotTryLogin();
76        void slotChooseUser(int);
77        void slotChangePWView();
78       
79  signals:
80        //Emits these signals whenever a login request is detected
81        void loginRequested(QString user, QString password);
82        void UserSelected(QString user);
83        void UserChanged(QString user);
84        void escapePressed();
85
86};
87#endif
Note: See TracBrowser for help on using the repository browser.