aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/src-cpp/framework-OSInterface.h
diff options
context:
space:
mode:
authorKen Moore <ken@ixsystems.com>2018-02-01 17:10:42 -0500
committerKen Moore <ken@ixsystems.com>2018-02-01 17:10:42 -0500
commit6f251cac292ee2657ec60e0e33ba02e3d08fade8 (patch)
tree5f5d7eacbf12bff4d7dd6061a8b5b747f12a8fa8 /src-qt5/src-cpp/framework-OSInterface.h
parentFix up the single application numbering. (diff)
downloadlumina-6f251cac292ee2657ec60e0e33ba02e3d08fade8.tar.gz
lumina-6f251cac292ee2657ec60e0e33ba02e3d08fade8.tar.bz2
lumina-6f251cac292ee2657ec60e0e33ba02e3d08fade8.zip
Get the FreeBSD OSInterface class all setup.
Also test/fix some stuff in the build side of things. OSInterface no longer uses the LUtils and LXDG classes from libLumina.
Diffstat (limited to 'src-qt5/src-cpp/framework-OSInterface.h')
-rw-r--r--src-qt5/src-cpp/framework-OSInterface.h22
1 files changed, 13 insertions, 9 deletions
diff --git a/src-qt5/src-cpp/framework-OSInterface.h b/src-qt5/src-cpp/framework-OSInterface.h
index 2f1795a1..2c4a4e0c 100644
--- a/src-qt5/src-cpp/framework-OSInterface.h
+++ b/src-qt5/src-cpp/framework-OSInterface.h
@@ -33,7 +33,7 @@
#include <QNetworkInterface>
//Lumina Utils class
-#include <LUtils.h>
+//#include <LUtils.h>
class OSInterface : public QObject{
Q_OBJECT
@@ -165,7 +165,7 @@ public:
// = Volume =
bool OS_volumeSupported();
int OS_volume();
- void OS_setVolume(int);
+ bool OS_setVolume(int);
// = Network Information =
QString OS_networkTypeFromDeviceName(QString name);
float OS_networkStrengthFromDeviceName(QString name);
@@ -194,7 +194,7 @@ public:
// = Screen Brightness =
bool OS_brightnessSupported();
int OS_brightness();
- void OS_setBrightness(int);
+ bool OS_setBrightness(int);
// = System Status Monitoring
bool OS_cpuSupported();
QList<int> OS_cpuPercentage();
@@ -219,10 +219,10 @@ private slots:
void iodeviceReadyRead();
void iodeviceAboutToClose();
//NetworkAccessManager slots
- void netAccessChanged(QNetworkAccessManager::NetworkAccessibility);
void netRequestFinished(QNetworkReply*);
void netSslErrors(QNetworkReply*, const QList<QSslError>&);
//Timer slots
+ void NetworkTimerUpdate();
void BatteryTimerUpdate();
void UpdateTimerUpdate();
void BrightnessTimerUpdate();
@@ -259,7 +259,7 @@ private:
//Network Access Manager (check network connectivity, etc)
QNetworkAccessManager *netman;
//Timer for regular probes/updates
- QTimer *batteryTimer, *updateTimer, *brightnessTimer, *volumeTimer, *cpuTimer, *memTimer, *diskTimer;
+ QTimer *networkTimer, *batteryTimer, *updateTimer, *brightnessTimer, *volumeTimer, *cpuTimer, *memTimer, *diskTimer;
// Internal implifications for connecting the various watcher objects to their respective slots
// (OS-agnostic - defined in the "OSInterface_private.cpp" file)
@@ -269,16 +269,19 @@ private:
//Internal simplification routines
bool verifyAppOrBin(QString chk);
+ QString runProcess(int &retcode, QString command, QStringList arguments, QString workdir = "", QStringList env = QStringList());
+ int runCmd(QString command, QStringList args = QStringList());
+ QStringList getCmdOutput(QString command, QStringList args = QStringList());
+ bool findInDirectory(QString file, QString dirpath, bool recursive=true);
+ QString readFile(QString path);
// External Media Management (if system uses *.desktop shortcuts only)
void setupMediaWatcher();
bool handleMediaDirChange(QString dir); //returns true if directory was handled
QStringList autoHandledMediaFiles();
- // Qt-based NetworkAccessManager usage
- void setupNetworkManager();
-
- // Timer-based monitors
+ // Timer-based setups
+ void setupNetworkManager(int update_ms, int delay_ms);
void setupBatteryMonitor(int update_ms, int delay_ms);
void setupUpdateMonitor(int update_ms, int delay_ms);
void setupBrightnessMonitor(int update_ms, int delay_ms);
@@ -288,6 +291,7 @@ private:
void setupDiskMonitor(int update_ms, int delay_ms);
// Timer-based monitor update routines (NOTE: these are all run in a separate thread!!)
+ void syncNetworkInfo(OSInterface *os, QHash<QString, QVariant> *hash, QTimer *timer);
void syncBatteryInfo(OSInterface *os, QHash<QString, QVariant> *hash, QTimer *timer);
void syncUpdateInfo(OSInterface *os, QHash<QString, QVariant> *hash, QTimer *timer);
void syncBrightnessInfo(OSInterface *os, QHash<QString, QVariant> *hash, QTimer *timer);
bgstack15