summaryrefslogtreecommitdiff
path: root/liblightdm-qt
diff options
context:
space:
mode:
authorRobert Ancell <robert.ancell@canonical.com>2011-07-19 14:44:22 +1000
committerRobert Ancell <robert.ancell@canonical.com>2011-07-19 14:44:22 +1000
commit39f93a22f857505c0cb5f0fd53d72b2ef49b0ff5 (patch)
treede466655193dc8059061aed09cda4662af34e81f /liblightdm-qt
parentd7523f3cf087f104f49d5734edb275ca5c485d20 (diff)
downloadlightdm-39f93a22f857505c0cb5f0fd53d72b2ef49b0ff5.tar.gz
Update liblightdm-qt API to match liblightdm-gobject
Diffstat (limited to 'liblightdm-qt')
-rw-r--r--liblightdm-qt/QLightDM/greeter.h38
-rw-r--r--liblightdm-qt/QLightDM/language.h4
-rw-r--r--liblightdm-qt/QLightDM/sessionsmodel.h4
-rw-r--r--liblightdm-qt/QLightDM/user.h6
-rw-r--r--liblightdm-qt/QLightDM/usersmodel.h3
-rw-r--r--liblightdm-qt/greeter.cpp12
6 files changed, 38 insertions, 29 deletions
diff --git a/liblightdm-qt/QLightDM/greeter.h b/liblightdm-qt/QLightDM/greeter.h
index d99b371e..9f8d05e5 100644
--- a/liblightdm-qt/QLightDM/greeter.h
+++ b/liblightdm-qt/QLightDM/greeter.h
@@ -10,20 +10,30 @@
* license.
*/
-#ifndef QLIGTHDM_GREETER_H
-#define QLIGTHDM_GREETER_H
+#ifndef QLIGHTDM_GREETER_H
+#define QLIGHTDM_GREETER_H
#include <QtCore/QObject>
#include <QtCore/QVariant>
-
-#include "user.h"
-#include "language.h"
-//#include "layout.h"
+#include "QLightDM/User"
+#include "QLightDM/Language"
class GreeterPrivate;
namespace QLightDM
{
+ typedef enum
+ {
+ PROMPT_TYPE_QUESTION,
+ PROMPT_TYPE_SECRET
+ } PromptType;
+
+ typedef enum
+ {
+ MESSAGE_TYPE_INFO,
+ MESSAGE_TYPE_ERROR
+ } MessageType;
+
class Q_DECL_EXPORT Greeter : public QObject
{
Q_OBJECT
@@ -47,7 +57,6 @@ namespace QLightDM
QList<QLightDM::Language> languages() const;
QString defaultLanguage() const;
- //QList<LdmLayout> layouts() const;
QString layout() const;
QString getHint(QString name) const;
@@ -77,6 +86,7 @@ namespace QLightDM
void connectToServer();
void login(const QString &username);
+ void loginWithUserPrompt();
void loginAsGuest();
void respond(const QString &response);
void cancelAuthentication();
@@ -84,12 +94,11 @@ namespace QLightDM
signals:
void connected();
- void showPrompt(QString prompt);
- void showMessage(QString message);
- void showError(QString message);
- void authenticationComplete(bool isAuthenticated);
+ void showPrompt(QString prompt, PromptType type);
+ void showMessage(QString message, MessageType type);
+ void authenticationComplete();
void sessionFailed();
- void timedLogin(QString username);
+ void autologinTimerExpired();
void quit();
private slots:
@@ -105,7 +114,6 @@ namespace QLightDM
int readInt(int *offset);
QString readString(int *offset);
};
+};
-};//end namespace
-
-#endif // QLIGHDM_GREETER_H
+#endif // QLIGHTDM_GREETER_H
diff --git a/liblightdm-qt/QLightDM/language.h b/liblightdm-qt/QLightDM/language.h
index cdda5b6e..5ba16c8b 100644
--- a/liblightdm-qt/QLightDM/language.h
+++ b/liblightdm-qt/QLightDM/language.h
@@ -9,8 +9,8 @@
* license.
*/
-#ifndef QLIGTHDM_LANGUAGE_H
-#define QLIGTHDM_LANGUAGE_H
+#ifndef QLIGHTDM_LANGUAGE_H
+#define QLIGHTDM_LANGUAGE_H
#include <QString>
diff --git a/liblightdm-qt/QLightDM/sessionsmodel.h b/liblightdm-qt/QLightDM/sessionsmodel.h
index 82ff14e5..62191c7f 100644
--- a/liblightdm-qt/QLightDM/sessionsmodel.h
+++ b/liblightdm-qt/QLightDM/sessionsmodel.h
@@ -9,8 +9,8 @@
* license.
*/
-#ifndef QLIGTHDM_SESSIONSMODEL_H
-#define QLIGTHDM_SESSIONSMODEL_H
+#ifndef QLIGHTDM_SESSIONSMODEL_H
+#define QLIGHTDM_SESSIONSMODEL_H
#include <QtCore/QAbstractListModel>
diff --git a/liblightdm-qt/QLightDM/user.h b/liblightdm-qt/QLightDM/user.h
index 9b45f74d..e6d3a984 100644
--- a/liblightdm-qt/QLightDM/user.h
+++ b/liblightdm-qt/QLightDM/user.h
@@ -9,8 +9,8 @@
* license.
*/
-#ifndef QLIGTHDM_USER_H
-#define QLIGTHDM_USER_H
+#ifndef QLIGHTDM_USER_H
+#define QLIGHTDM_USER_H
#include <QtCore/QString>
#include <QtCore/QSharedDataPointer>
@@ -57,4 +57,4 @@ namespace QLightDM
};
}
-#endif // LDMUSER_H
+#endif // QLIGHTDM_USER_H
diff --git a/liblightdm-qt/QLightDM/usersmodel.h b/liblightdm-qt/QLightDM/usersmodel.h
index 449144ef..b1baf6fb 100644
--- a/liblightdm-qt/QLightDM/usersmodel.h
+++ b/liblightdm-qt/QLightDM/usersmodel.h
@@ -25,8 +25,7 @@ class Q_DECL_EXPORT UsersModel : public QAbstractListModel
public:
enum UserModelRoles {NameRole = Qt::UserRole,
RealNameRole,
- LoggedInRole
- };
+ LoggedInRole};
explicit UsersModel(QObject *parent = 0);
~UsersModel();
diff --git a/liblightdm-qt/greeter.cpp b/liblightdm-qt/greeter.cpp
index a9865138..249a910c 100644
--- a/liblightdm-qt/greeter.cpp
+++ b/liblightdm-qt/greeter.cpp
@@ -173,7 +173,7 @@ QString Greeter::readString(int *offset)
void Greeter::connectToServer()
{
QDBusConnection busType = QDBusConnection::systemBus();
- QString ldmBus(qgetenv("LDM_BUS"));
+ QString ldmBus(qgetenv("LIGHTDM_BUS"));
if(ldmBus == QLatin1String("SESSION")) {
busType = QDBusConnection::sessionBus();
}
@@ -360,14 +360,16 @@ void Greeter::onRead(int fd)
switch (msg_style)
{
case PAM_PROMPT_ECHO_OFF:
+ emit showPrompt(msg, PROMPT_TYPE_SECRET);
+ break;
case PAM_PROMPT_ECHO_ON:
- emit showPrompt(msg);
+ emit showPrompt(msg, PROMPT_TYPE_QUESTION);
break;
case PAM_ERROR_MSG:
- emit showError(msg);
+ emit showMessage(msg, MESSAGE_TYPE_ERROR);
break;
case PAM_TEXT_INFO:
- emit showMessage(msg);
+ emit showMessage(msg, MESSAGE_TYPE_INFO);
break;
}
}
@@ -385,7 +387,7 @@ void Greeter::onRead(int fd)
if(!d->isAuthenticated) {
d->authenticationUser = "";
}
- emit authenticationComplete(d->isAuthenticated);
+ emit authenticationComplete();
d->inAuthentication = false;
}
else