43 lines
1.0 KiB
C++
43 lines
1.0 KiB
C++
#ifndef MAINWINDOW_H
|
|
#define MAINWINDOW_H
|
|
|
|
#include <gtk/gtk.h>
|
|
#include "nvme_monitor.h"
|
|
#include "temperature_chart.h"
|
|
#include "config_manager.h"
|
|
|
|
class MainWindow {
|
|
public:
|
|
MainWindow();
|
|
~MainWindow();
|
|
|
|
void show();
|
|
|
|
private:
|
|
void setupUI();
|
|
void updateTemperatures();
|
|
void updateLegend();
|
|
void saveWindowState();
|
|
|
|
static gboolean onDeleteWindow(GtkWidget *widget, gpointer userData);
|
|
static gboolean onUpdateTimer(gpointer userData);
|
|
static void onRefreshRateChanged(GtkSpinButton *spinButton, gpointer userData);
|
|
static void onClearButtonClicked(GtkButton *button, gpointer userData);
|
|
static void onQuitButtonClicked(GtkButton *button, gpointer userData);
|
|
|
|
GtkWidget *window;
|
|
GtkWidget *statusLabel;
|
|
GtkSpinButton *refreshRateSpinBox;
|
|
TemperatureChart *chart;
|
|
NvmeMonitor *monitor;
|
|
ConfigManager *config;
|
|
guint timerID;
|
|
int refreshRateSec;
|
|
GtkWidget *legendBox;
|
|
};
|
|
|
|
// Global main loop reference for proper shutdown
|
|
extern GMainLoop *gMainLoop;
|
|
|
|
#endif // MAINWINDOW_H
|