Publish LumaOps source
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,171 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| OpenRGBDialog.h |
|
||||
| |
|
||||
| User interface for OpenRGB main window |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <QMainWindow>
|
||||
#include <QTimer>
|
||||
#include <QSystemTrayIcon>
|
||||
#include <QMenu>
|
||||
#include <QSlider>
|
||||
|
||||
#include "OpenRGBClientInfoPage.h"
|
||||
#include "OpenRGBPluginsPage/OpenRGBPluginsPage.h"
|
||||
#include "OpenRGBSoftwareInfoPage.h"
|
||||
#include "OpenRGBSystemInfoPage.h"
|
||||
#include "OpenRGBSupportedDevicesPage.h"
|
||||
#include "OpenRGBSettingsPage.h"
|
||||
#include "ManualDevicesSettingsPage/ManualDevicesSettingsPage.h"
|
||||
|
||||
#include "PluginManager.h"
|
||||
#include "SuspendResume.h"
|
||||
|
||||
#include "i2c_smbus.h"
|
||||
#include "LogManager.h"
|
||||
#include "RGBController.h"
|
||||
#include "ProfileManager.h"
|
||||
#include "NetworkClient.h"
|
||||
#include "NetworkServer.h"
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class OpenRGBDialog;
|
||||
}
|
||||
|
||||
class OpenRGBDialog : public QMainWindow, private SuspendResumeListener
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit OpenRGBDialog(QWidget *parent = 0);
|
||||
~OpenRGBDialog();
|
||||
|
||||
void AddClientTab();
|
||||
void AddI2CToolsPage();
|
||||
void AddServerTab();
|
||||
|
||||
void AddPlugin(OpenRGBPluginEntry* plugin);
|
||||
void RemovePlugin(OpenRGBPluginEntry* plugin);
|
||||
|
||||
void setMode(unsigned char mode_val);
|
||||
|
||||
static bool IsMinimizeOnClose();
|
||||
|
||||
void SetDialogMessage(PLogMessage msg);
|
||||
|
||||
bool DontShowAgain;
|
||||
|
||||
signals:
|
||||
void ProfileListChanged();
|
||||
|
||||
public slots:
|
||||
void changeEvent(QEvent *event) override;
|
||||
void SetTrayIcon(bool tray_icon);
|
||||
void handleAboutToQuit();
|
||||
|
||||
protected:
|
||||
void keyPressEvent(QKeyEvent *event) override;
|
||||
|
||||
private:
|
||||
/*-----------------------------------------------------*\
|
||||
| Context string |
|
||||
\*-----------------------------------------------------*/
|
||||
const char * context = "OpenRGBDialog";
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Page pointers |
|
||||
\*-----------------------------------------------------*/
|
||||
OpenRGBClientInfoPage * ClientInfoPage;
|
||||
OpenRGBPluginsPage * PluginsPage;
|
||||
OpenRGBSystemInfoPage * SMBusToolsPage;
|
||||
OpenRGBSoftwareInfoPage * SoftInfoPage;
|
||||
OpenRGBSupportedDevicesPage * SupportedPage;
|
||||
OpenRGBSettingsPage * SettingsPage;
|
||||
|
||||
ManualDevicesSettingsPage * manualDevicesPage;
|
||||
|
||||
PluginManager * plugin_manager = nullptr;
|
||||
|
||||
bool device_view_showing = false;
|
||||
bool ShowI2CTools = false;
|
||||
bool plugins_loaded = false;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| System tray icon and menu |
|
||||
\*-----------------------------------------------------*/
|
||||
QSystemTrayIcon * trayIcon;
|
||||
QMenu * trayIconMenu;
|
||||
QMenu * profileMenu;
|
||||
|
||||
QAction * actionExit;
|
||||
QString dialog_message;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| User interface |
|
||||
\*-----------------------------------------------------*/
|
||||
Ui::OpenRGBDialog *ui;
|
||||
|
||||
void AddSoftwareInfoPage();
|
||||
void AddSupportedDevicesPage();
|
||||
void AddSettingsPage();
|
||||
void AddPluginsPage();
|
||||
void AddConsolePage();
|
||||
void AddManualDevicesSettingsPage();
|
||||
|
||||
void ClearDevicesList();
|
||||
void UpdateDevicesList();
|
||||
void UpdateProfileList();
|
||||
void closeEvent(QCloseEvent *event) override;
|
||||
bool SelectConfigProfile(const std::string name);
|
||||
|
||||
void SetDetectionViewState(bool detection_showing);
|
||||
void SaveProfile();
|
||||
void SaveProfileAs();
|
||||
|
||||
void TogglePluginsVisibility(int, QTabWidget*);
|
||||
|
||||
void ShowLEDView();
|
||||
void HideLEDView();
|
||||
|
||||
void OnSuspend() override;
|
||||
void OnResume() override;
|
||||
|
||||
private slots:
|
||||
void on_Exit();
|
||||
void on_LightsOff();
|
||||
void on_QuickRed();
|
||||
void on_QuickYellow();
|
||||
void on_QuickGreen();
|
||||
void on_QuickCyan();
|
||||
void on_QuickBlue();
|
||||
void on_QuickMagenta();
|
||||
void on_QuickWhite();
|
||||
void onDeviceListUpdated();
|
||||
void onDetectionProgressUpdated();
|
||||
void onDetectionStarted();
|
||||
void onDetectionEnded();
|
||||
void on_SetAllDevices(unsigned char red, unsigned char green, unsigned char blue);
|
||||
void on_SaveSizeProfile();
|
||||
void on_ShowHide();
|
||||
void onShowDialogMessage();
|
||||
void on_ReShow(QSystemTrayIcon::ActivationReason reason);
|
||||
void on_ProfileSelected();
|
||||
void on_ButtonLoadProfile_clicked();
|
||||
void on_ButtonDeleteProfile_clicked();
|
||||
void on_ButtonToggleDeviceView_clicked();
|
||||
void on_ButtonStopDetection_clicked();
|
||||
void on_ButtonRescan_clicked();
|
||||
void on_ActionSaveProfile_triggered();
|
||||
void on_ActionSaveProfileAs_triggered();
|
||||
void on_MainTabBar_currentChanged(int);
|
||||
void on_InformationTabBar_currentChanged(int);
|
||||
void on_DevicesTabBar_currentChanged(int);
|
||||
void on_SettingsTabBar_currentChanged(int);
|
||||
};
|
||||
@@ -0,0 +1,206 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>OpenRGBDialog</class>
|
||||
<widget class="QMainWindow" name="OpenRGBDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>700</width>
|
||||
<height>350</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>OpenRGB</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralWidget">
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="2" column="0" colspan="5">
|
||||
<widget class="QTabWidget" name="MainTabBar">
|
||||
<property name="tabShape">
|
||||
<enum>QTabWidget::Rounded</enum>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
<widget class="QWidget" name="TabDevices">
|
||||
<attribute name="title">
|
||||
<string>Devices</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="1" column="0">
|
||||
<widget class="QTabWidget" name="DevicesTabBar">
|
||||
<property name="tabPosition">
|
||||
<enum>QTabWidget::West</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="TabInformation">
|
||||
<attribute name="title">
|
||||
<string>Information</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="0">
|
||||
<widget class="QTabWidget" name="InformationTabBar">
|
||||
<property name="tabPosition">
|
||||
<enum>QTabWidget::West</enum>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>-1</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="TabSettings">
|
||||
<attribute name="title">
|
||||
<string>Settings</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout_4">
|
||||
<item row="0" column="0">
|
||||
<widget class="QTabWidget" name="SettingsTabBar">
|
||||
<property name="tabPosition">
|
||||
<enum>QTabWidget::West</enum>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>-1</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0" colspan="5">
|
||||
<layout class="QHBoxLayout" name="MainButtonsLayout">
|
||||
<item>
|
||||
<widget class="QFrame" name="MainButtonsFrame">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_5">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QPushButton" name="ButtonToggleDeviceView">
|
||||
<property name="text">
|
||||
<string>Toggle LED View</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QPushButton" name="ButtonRescan">
|
||||
<property name="text">
|
||||
<string>Rescan Devices</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QToolButton" name="ButtonSaveProfile">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Save Profile</string>
|
||||
</property>
|
||||
<property name="popupMode">
|
||||
<enum>QToolButton::MenuButtonPopup</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<widget class="QPushButton" name="ButtonDeleteProfile">
|
||||
<property name="text">
|
||||
<string>Delete Profile</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="4">
|
||||
<widget class="QPushButton" name="ButtonLoadProfile">
|
||||
<property name="text">
|
||||
<string>Load Profile</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="5">
|
||||
<widget class="QComboBox" name="ProfileBox"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="4" column="0" colspan="5">
|
||||
<layout class="QHBoxLayout" name="DetectorLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="DetectionProgressLabel">
|
||||
<property name="text">
|
||||
<string>OpenRGB is detecting devices...</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QProgressBar" name="DetectionProgressBar">
|
||||
<property name="value">
|
||||
<number>24</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="ButtonStopDetection">
|
||||
<property name="text">
|
||||
<string>Cancel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<action name="ActionSaveProfile">
|
||||
<property name="text">
|
||||
<string>Save Profile</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Save Profile</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="ActionSaveProfileAs">
|
||||
<property name="text">
|
||||
<string>Save Profile As...</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Save Profile with custom name</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
Reference in New Issue
Block a user