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

releng/10.0releng/10.0.1releng/10.0.2releng/10.0.3releng/10.1
Last change on this file since a982a19 was a982a19, checked in by Ken Moore <ken@…>, 13 months ago

Add the ability for PCDM to save/load the previous/default locale and keyboard settings. Still needs testing, but if it works I just need to enable the keyboard settings for the user session as well in order to have all the localization stiff finished completely.

  • Property mode set to 100644
File size: 2.2 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 QString getUserShell(QString);
48    static void checkLocalDirs();
49
50    static QString getALUsername();
51    static QString getALDesktopCmd();
52    static QString getALPassword();
53   
54    static QString getLastUser();
55    static QString getLastDE(QString);
56    static void saveLoginInfo(QString, QString);
57    static void readDefaultSysEnvironment(QString &lang, QString &keymodel, QString &keylayout, QString &keyvariant);
58    static void saveDefaultSysEnvironment(QString lang, QString keymodel, QString keylayout, QString keyvariant);
59   
60private:       
61    static void loadXSessionsData();
62    static QStringList readXSessionsFile(QString, QString);
63    static void readSystemUsers();
64    static void readSystemLastLogin();
65    static void writeSystemLastLogin(QString, QString);
66    static QString readUserLastDesktop(QString);
67    static void writeUserLastDesktop(QString, QString);
68   
69};
70
71
72#endif // PCDM_BACKEND_H
Note: See TracBrowser for help on using the repository browser.