source: src-qt4/pc-installgui/backend.h

Last change on this file was 8d3682c, checked in by Kris Moore <kris@…>, 6 months ago

Add the ability for the GUI installer to detect your country and try to
set the default language based upon it. This will work ONLY if the
installer was able to connect to the internet.

  • Property mode set to 100644
File size: 2.3 KB
Line 
1#ifndef BACKEND_H
2#define BACKEND_H
3
4#include <QStringListIterator>
5#include <QStringList>
6#include <QString>
7#include <QList>
8#include <QDebug>
9#include <QProcess>
10#include <QByteArray>
11#include <QFile>
12#include <QWidget>
13
14
15#define PCSYSINSTALLCFG QString("/tmp/sys-install.cfg")
16#define TMPLANGFILE QString("/tmp/.SysInstallLang")
17
18// Set the minimum sizes for FBSD
19#define FBSD_MINSIZE 2500
20#define FBSD_MINROOT 1000
21#define FBSD_MINVAR 500
22#define FBSD_MINUSR 1000
23
24// Set the minimum sizes for PCBSD
25#define PCBSD_MINSIZE 3000
26#define PCBSD_MINROOT 1000
27#define PCBSD_MINVAR 500
28#define PCBSD_MINUSR 1500
29
30
31namespace Scripts {
32
33class Process : public QProcess {
34public:
35    Process(const QStringList &args) {
36        QString PCSYSINSTALL;
37        setReadChannel(QProcess::StandardOutput);
38        // If we are using a debug copy of pc-sysinstall, we can execute that instead of default
39        if ( QFile::exists("/root/pc-sysinstall/pc-sysinstall") )
40          PCSYSINSTALL = "/root/pc-sysinstall/pc-sysinstall";
41        else
42          PCSYSINSTALL = "/usr/local/sbin/pc-sysinstall";
43        start(PCSYSINSTALL, args);
44    }
45};
46
47class Backend {
48public:
49    static void enableNic(QString Nic, QString IP, QString NetMask, QString DNS, QString Gate, bool fetchMirrors, QString IPv6="", QString IPv6Gate="", QString IPv6DNS="");
50    static void createErrorReport();
51    static void setupSSHKeys(QString Host, QString User, QString Port);
52    static QStringList languages();
53    static QStringList keyLayouts();
54    static QStringList keyModels();
55    static QStringList keyVariants(const QString &, QStringList &savedKeyVariants);
56    static QStringList bootableMedia();
57    static QStringList networkDevices();
58    static QStringList timezones();
59    static QString detectCountryCode();
60    static void changeKbMap(QString model, QString layout, QString variant);
61    static QList<QStringList> hardDrives();
62    static QList<QStringList> availComponents();
63    static int systemMemory();
64    static int deleteMBRPart(QString Slice, QString &output);
65    static int addMBRPart(QString Disk, int size, QString &output);
66    static QList<QStringList> getPackageData(bool &found, QString pkgset);
67    //static QList<QStringList> slices();
68
69private:
70  QString PCSYSINSTALL;
71  QString PCSYSINSTALLDIR;
72};
73
74
75} //namespace Scripts
76
77
78#endif // BACKEND_H
Note: See TracBrowser for help on using the repository browser.