source: src-qt4/PCDM/src/pcdm-backend.h @ 90dc161

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

Completely revamp how PCDM uses the previous login information. Now you no longer need to specify which desktop to auto-login to if you have auto-login selected. It will first try to check for previous login information for that user, then fall back on the last login for the system in order to try and auto login. Also fix the PCDMd script a bit so that autologins work properly when triggered.

  • Property mode set to 100644
File size: 2.0 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#ifndef PCDM_BACKEND_H
8#define PCDM_BACKEND_H
9
10#include <QStringList>
11#include <QString>
12#include <QDebug>
13#include <QDir>
14#include <QProcess>
15#include <QFile>
16
17#include "pcdm-config.h"
18#include "pcbsd-utils.h"
19
20#define PCSYSINSTALL    QString("/usr/sbin/pc-sysinstall")
21
22class Process : public QProcess {
23public:
24    Process(const QStringList &args) {
25        setReadChannel(QProcess::StandardOutput);
26        start(PCSYSINSTALL, args);
27    }
28};
29
30class Backend {
31public:
32    static QStringList getAvailableDesktops();
33    static QString getDesktopComment(QString);
34    static QString getDesktopIcon(QString);
35    static QString getDesktopBinary(QString);
36    static QStringList getSystemUsers();
37    static QString getUsernameFromDisplayname(QString);
38    static QString getDisplayNameFromUsername(QString);
39    static QStringList keyModels();
40    static QStringList keyLayouts();
41    static QStringList keyVariants(const QString &layout, QStringList &savedKeyVariants);
42    static void changeKbMap(QString model, QString layout, QString variant);
43    static QStringList languages();
44    static void openLogFile(QString);
45    static void log(QString); 
46    static QString getUserHomeDir(QString);
47    static void checkLocalDirs();
48
49    static QString getALUsername();
50    static QString getALDesktopCmd();
51    static QString getALPassword();
52   
53    static QString getLastUser();
54    static QString getLastDE(QString);
55    static void saveLoginInfo(QString, QString);
56   
57private:       
58    static void loadXSessionsData();
59    static QStringList readXSessionsFile(QString, QString);
60    static void readSystemUsers();
61    static void readSystemLastLogin();
62    static void writeSystemLastLogin(QString, QString);
63    static QString readUserLastDesktop(QString);
64    static void writeUserLastDesktop(QString, QString);
65   
66};
67
68
69#endif // PCDM_BACKEND_H
Note: See TracBrowser for help on using the repository browser.