feat(gui): manage desktop environments from a gtk window
Offer a single window to install and switch between XFCE, GNOME, Plasma, Hyprland and i3. Installation goes through pkexec and pacman, switching uses logind sessions, so neither action requires a reboot.
This commit is contained in:
4 files changed
+487
-12
No files matched your search
+16
-12
@@ -1,27 +1,31 @@
|
||||
cmake_minimum_required(VERSION 3.20)
|
||||
|
||||
project(FWS-DeskManager VERSION 0.1.0 LANGUAGES CXX)
|
||||
project(FWS-DeskManager VERSION 0.2.0 LANGUAGES CXX)
|
||||
|
||||
if(NOT CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
message(FATAL_ERROR "FWS-DeskManager targets Linux with systemd-logind.")
|
||||
endif()
|
||||
|
||||
add_executable(fws-deskmanager
|
||||
src/main.cpp
|
||||
find_package(PkgConfig REQUIRED)
|
||||
pkg_check_modules(GTK4 REQUIRED IMPORTED_TARGET gtk4)
|
||||
|
||||
add_library(fws-core STATIC
|
||||
src/process.cpp
|
||||
src/session-catalog.cpp
|
||||
src/session-switcher.cpp
|
||||
src/user-interface.cpp
|
||||
src/desktop-catalog.cpp
|
||||
)
|
||||
target_include_directories(fws-core PUBLIC src)
|
||||
target_compile_features(fws-core PUBLIC cxx_std_17)
|
||||
target_compile_options(fws-core PRIVATE -Wall -Wextra -Wpedantic)
|
||||
|
||||
set_target_properties(fws-deskmanager PROPERTIES
|
||||
OUTPUT_NAME "fws-deskmanager"
|
||||
CXX_STANDARD 17
|
||||
CXX_STANDARD_REQUIRED ON
|
||||
CXX_EXTENSIONS OFF
|
||||
)
|
||||
|
||||
target_include_directories(fws-deskmanager PRIVATE src)
|
||||
add_executable(fws-deskmanager src/main.cpp)
|
||||
target_link_libraries(fws-deskmanager PRIVATE fws-core)
|
||||
target_compile_options(fws-deskmanager PRIVATE -Wall -Wextra -Wpedantic)
|
||||
|
||||
install(TARGETS fws-deskmanager RUNTIME DESTINATION bin)
|
||||
add_executable(fws-deskmanager-gui src/gui.cpp)
|
||||
target_link_libraries(fws-deskmanager-gui PRIVATE fws-core PkgConfig::GTK4)
|
||||
target_compile_options(fws-deskmanager-gui PRIVATE -Wall -Wextra -Wpedantic)
|
||||
|
||||
install(TARGETS fws-deskmanager fws-deskmanager-gui RUNTIME DESTINATION bin)
|
||||
@@ -0,0 +1,67 @@
|
||||
#include "desktop-catalog.h"
|
||||
|
||||
#include "process.h"
|
||||
#include "session-catalog.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <cctype>
|
||||
|
||||
namespace fws {
|
||||
namespace {
|
||||
|
||||
std::string lower(std::string value) {
|
||||
std::transform(value.begin(), value.end(), value.begin(),
|
||||
[](unsigned char character) { return static_cast<char>(std::tolower(character)); });
|
||||
return value;
|
||||
}
|
||||
|
||||
bool pacmanKnows(const std::vector<std::string>& arguments) {
|
||||
const CommandResult result = runCommand(arguments);
|
||||
return result.started && result.exitCode == 0;
|
||||
}
|
||||
|
||||
bool targetInstalled(const std::string& target) {
|
||||
// A target is either a package (pacman -Q) or a group (pacman -Qg).
|
||||
if (pacmanKnows({"pacman", "-Q", target})) {
|
||||
return true;
|
||||
}
|
||||
return pacmanKnows({"pacman", "-Qg", target});
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
const std::vector<DesktopProfile>& supportedDesktops() {
|
||||
static const std::vector<DesktopProfile> desktops = {
|
||||
{"xfce", "XFCE", {"xfce4"}, {"xfce", "xfce4"}},
|
||||
{"gnome", "GNOME", {"gnome"}, {"gnome"}},
|
||||
{"plasma", "KDE Plasma", {"plasma-meta"}, {"kde", "plasma"}},
|
||||
{"hyprland", "Hyprland", {"hyprland"}, {"hyprland"}},
|
||||
{"i3", "i3", {"i3"}, {"i3"}},
|
||||
};
|
||||
return desktops;
|
||||
}
|
||||
|
||||
bool isDesktopInstalled(const DesktopProfile& profile) {
|
||||
return std::all_of(profile.packages.begin(), profile.packages.end(), targetInstalled);
|
||||
}
|
||||
|
||||
bool findActiveSession(const DesktopProfile& profile, std::string& sessionId) {
|
||||
for (const SessionInfo& session : listGraphicalSessions()) {
|
||||
const std::string desktop = lower(session.desktop);
|
||||
for (const std::string& name : profile.sessionNames) {
|
||||
if (desktop == lower(name)) {
|
||||
sessionId = session.id;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
std::vector<std::string> installArguments(const DesktopProfile& profile) {
|
||||
std::vector<std::string> arguments = {"pkexec", "pacman", "-S", "--needed", "--noconfirm"};
|
||||
arguments.insert(arguments.end(), profile.packages.begin(), profile.packages.end());
|
||||
return arguments;
|
||||
}
|
||||
|
||||
} // namespace fws
|
||||
@@ -0,0 +1,26 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace fws {
|
||||
|
||||
struct DesktopProfile {
|
||||
std::string id;
|
||||
std::string name;
|
||||
std::vector<std::string> packages; // pacman targets (packages or groups)
|
||||
std::vector<std::string> sessionNames; // logind Desktop values to match
|
||||
};
|
||||
|
||||
const std::vector<DesktopProfile>& supportedDesktops();
|
||||
|
||||
// True when every pacman target of the profile is installed.
|
||||
bool isDesktopInstalled(const DesktopProfile& profile);
|
||||
|
||||
// Finds an active logind session for the profile.
|
||||
bool findActiveSession(const DesktopProfile& profile, std::string& sessionId);
|
||||
|
||||
// pkexec + pacman command used to install the profile.
|
||||
std::vector<std::string> installArguments(const DesktopProfile& profile);
|
||||
|
||||
} // namespace fws
|
||||
+378
@@ -0,0 +1,378 @@
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "desktop-catalog.h"
|
||||
#include "session-switcher.h"
|
||||
|
||||
namespace {
|
||||
|
||||
enum class RowMode { Install, SwitchTo, Greeter };
|
||||
|
||||
struct RowWidgets {
|
||||
const fws::DesktopProfile* profile = nullptr;
|
||||
GtkWidget* status = nullptr;
|
||||
GtkWidget* action = nullptr;
|
||||
RowMode mode = RowMode::Install;
|
||||
};
|
||||
|
||||
class ManagerWindow {
|
||||
public:
|
||||
static int run(int argc, char** argv) {
|
||||
GtkApplication* application =
|
||||
gtk_application_new("tech.nocodevar.FwsDeskManager", G_APPLICATION_DEFAULT_FLAGS);
|
||||
auto* manager = new ManagerWindow();
|
||||
g_signal_connect(application, "activate", G_CALLBACK(&ManagerWindow::onActivate), manager);
|
||||
|
||||
const int status = g_application_run(G_APPLICATION(application), argc, argv);
|
||||
g_object_unref(application);
|
||||
delete manager;
|
||||
return status;
|
||||
}
|
||||
|
||||
private:
|
||||
ManagerWindow() = default;
|
||||
|
||||
static void onActivate(GtkApplication* application, gpointer data) {
|
||||
auto* self = static_cast<ManagerWindow*>(data);
|
||||
if (self->window_ == nullptr) {
|
||||
self->buildWindow(application);
|
||||
}
|
||||
gtk_window_present(GTK_WINDOW(self->window_));
|
||||
}
|
||||
|
||||
static void onRefreshClicked(GtkButton*, gpointer data) {
|
||||
auto* self = static_cast<ManagerWindow*>(data);
|
||||
if (!self->busy_) {
|
||||
self->refreshRows();
|
||||
}
|
||||
}
|
||||
|
||||
static void onActionClicked(GtkButton* button, gpointer data) {
|
||||
auto* self = static_cast<ManagerWindow*>(data);
|
||||
if (self->busy_) {
|
||||
return;
|
||||
}
|
||||
|
||||
const int index = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(button), "fws-row-index"));
|
||||
if (index < 0 || index >= static_cast<int>(self->rows_.size())) {
|
||||
return;
|
||||
}
|
||||
|
||||
RowWidgets& row = self->rows_[static_cast<std::size_t>(index)];
|
||||
switch (row.mode) {
|
||||
case RowMode::Install:
|
||||
self->startInstall(*row.profile);
|
||||
break;
|
||||
case RowMode::SwitchTo:
|
||||
self->switchTo(*row.profile);
|
||||
break;
|
||||
case RowMode::Greeter:
|
||||
self->askGreeter();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void onInstallDone(GObject* source, GAsyncResult* result, gpointer data) {
|
||||
auto* self = static_cast<ManagerWindow*>(data);
|
||||
GError* error = nullptr;
|
||||
char* output = nullptr;
|
||||
g_subprocess_communicate_utf8_finish(G_SUBPROCESS(source), result, &output, nullptr, &error);
|
||||
|
||||
const bool success = g_subprocess_get_successful(G_SUBPROCESS(source)) != FALSE;
|
||||
std::string text = output != nullptr ? output : "";
|
||||
if (error != nullptr) {
|
||||
text += error->message;
|
||||
g_error_free(error);
|
||||
}
|
||||
g_free(output);
|
||||
|
||||
self->finishInstall(success, text);
|
||||
g_clear_object(&self->pending_);
|
||||
}
|
||||
|
||||
static void onGreeterResponse(GtkAlertDialog*, int response, gpointer data) {
|
||||
if (response != 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto* self = static_cast<ManagerWindow*>(data);
|
||||
std::string error;
|
||||
if (!fws::switchToGreeter(error)) {
|
||||
self->showError("Impossible de revenir au greeter : " + error);
|
||||
} else {
|
||||
self->setStatus("Retour à l'écran de connexion…");
|
||||
}
|
||||
}
|
||||
|
||||
void buildWindow(GtkApplication* application) {
|
||||
window_ = gtk_application_window_new(application);
|
||||
gtk_window_set_title(GTK_WINDOW(window_), "FWS DeskManager");
|
||||
gtk_window_set_default_size(GTK_WINDOW(window_), 660, 620);
|
||||
|
||||
GtkWidget* header = gtk_header_bar_new();
|
||||
GtkWidget* title = gtk_label_new(nullptr);
|
||||
gtk_label_set_markup(GTK_LABEL(title), "<b>FWS DeskManager</b>");
|
||||
gtk_header_bar_set_title_widget(GTK_HEADER_BAR(header), title);
|
||||
|
||||
refreshButton_ = gtk_button_new_from_icon_name("view-refresh-symbolic");
|
||||
gtk_widget_set_tooltip_text(refreshButton_, "Rafraîchir l'état des environnements");
|
||||
g_signal_connect(refreshButton_, "clicked", G_CALLBACK(&ManagerWindow::onRefreshClicked), this);
|
||||
gtk_header_bar_pack_end(GTK_HEADER_BAR(header), refreshButton_);
|
||||
gtk_window_set_titlebar(GTK_WINDOW(window_), header);
|
||||
|
||||
GtkWidget* root = gtk_box_new(GTK_ORIENTATION_VERTICAL, 12);
|
||||
gtk_widget_set_margin_start(root, 18);
|
||||
gtk_widget_set_margin_end(root, 18);
|
||||
gtk_widget_set_margin_top(root, 14);
|
||||
gtk_widget_set_margin_bottom(root, 14);
|
||||
gtk_window_set_child(GTK_WINDOW(window_), root);
|
||||
|
||||
GtkWidget* intro = gtk_label_new(
|
||||
"Installez un environnement puis basculez dessus sans redémarrer. "
|
||||
"La bascule instantanée nécessite une session déjà ouverte pour cet environnement.");
|
||||
gtk_label_set_wrap(GTK_LABEL(intro), TRUE);
|
||||
gtk_label_set_xalign(GTK_LABEL(intro), 0.0F);
|
||||
gtk_widget_add_css_class(intro, "dim-label");
|
||||
gtk_box_append(GTK_BOX(root), intro);
|
||||
|
||||
GtkWidget* scroller = gtk_scrolled_window_new();
|
||||
gtk_widget_set_vexpand(scroller, TRUE);
|
||||
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scroller), GTK_POLICY_NEVER,
|
||||
GTK_POLICY_AUTOMATIC);
|
||||
|
||||
rowsBox_ = gtk_box_new(GTK_ORIENTATION_VERTICAL, 10);
|
||||
gtk_scrolled_window_set_child(GTK_SCROLLED_WINDOW(scroller), rowsBox_);
|
||||
gtk_box_append(GTK_BOX(root), scroller);
|
||||
|
||||
GtkWidget* footer = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 8);
|
||||
spinner_ = gtk_spinner_new();
|
||||
gtk_widget_set_visible(spinner_, FALSE);
|
||||
gtk_box_append(GTK_BOX(footer), spinner_);
|
||||
|
||||
statusLabel_ = gtk_label_new("Prêt.");
|
||||
gtk_label_set_xalign(GTK_LABEL(statusLabel_), 0.0F);
|
||||
gtk_widget_set_hexpand(statusLabel_, TRUE);
|
||||
gtk_widget_add_css_class(statusLabel_, "dim-label");
|
||||
gtk_box_append(GTK_BOX(footer), statusLabel_);
|
||||
gtk_box_append(GTK_BOX(root), footer);
|
||||
|
||||
logExpander_ = gtk_expander_new("Détails de l'installation");
|
||||
gtk_expander_set_expanded(GTK_EXPANDER(logExpander_), FALSE);
|
||||
GtkWidget* logScroller = gtk_scrolled_window_new();
|
||||
gtk_widget_set_size_request(logScroller, -1, 150);
|
||||
logView_ = gtk_text_view_new();
|
||||
gtk_text_view_set_editable(GTK_TEXT_VIEW(logView_), FALSE);
|
||||
gtk_text_view_set_monospace(GTK_TEXT_VIEW(logView_), TRUE);
|
||||
gtk_text_view_set_cursor_visible(GTK_TEXT_VIEW(logView_), FALSE);
|
||||
gtk_scrolled_window_set_child(GTK_SCROLLED_WINDOW(logScroller), logView_);
|
||||
gtk_expander_set_child(GTK_EXPANDER(logExpander_), logScroller);
|
||||
gtk_widget_set_visible(logExpander_, FALSE);
|
||||
gtk_box_append(GTK_BOX(root), logExpander_);
|
||||
|
||||
buildRows();
|
||||
refreshRows();
|
||||
}
|
||||
|
||||
void buildRows() {
|
||||
rows_.reserve(fws::supportedDesktops().size());
|
||||
for (const fws::DesktopProfile& profile : fws::supportedDesktops()) {
|
||||
GtkWidget* frame = gtk_frame_new(nullptr);
|
||||
gtk_widget_add_css_class(frame, "frame");
|
||||
|
||||
GtkWidget* box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 12);
|
||||
gtk_widget_set_margin_start(box, 14);
|
||||
gtk_widget_set_margin_end(box, 14);
|
||||
gtk_widget_set_margin_top(box, 12);
|
||||
gtk_widget_set_margin_bottom(box, 12);
|
||||
|
||||
GtkWidget* text = gtk_box_new(GTK_ORIENTATION_VERTICAL, 4);
|
||||
gtk_widget_set_hexpand(text, TRUE);
|
||||
|
||||
GtkWidget* name = gtk_label_new(nullptr);
|
||||
gchar* markup = g_markup_printf_escaped("<b>%s</b>", profile.name.c_str());
|
||||
gtk_label_set_markup(GTK_LABEL(name), markup);
|
||||
g_free(markup);
|
||||
gtk_label_set_xalign(GTK_LABEL(name), 0.0F);
|
||||
|
||||
GtkWidget* status = gtk_label_new("…");
|
||||
gtk_label_set_xalign(GTK_LABEL(status), 0.0F);
|
||||
|
||||
gtk_box_append(GTK_BOX(text), name);
|
||||
gtk_box_append(GTK_BOX(text), status);
|
||||
|
||||
GtkWidget* action = gtk_button_new_with_label("Installer");
|
||||
gtk_widget_set_valign(action, GTK_ALIGN_CENTER);
|
||||
gtk_widget_add_css_class(action, "suggested-action");
|
||||
g_signal_connect(action, "clicked", G_CALLBACK(&ManagerWindow::onActionClicked), this);
|
||||
|
||||
gtk_box_append(GTK_BOX(box), text);
|
||||
gtk_box_append(GTK_BOX(box), action);
|
||||
gtk_frame_set_child(GTK_FRAME(frame), box);
|
||||
gtk_box_append(GTK_BOX(rowsBox_), frame);
|
||||
|
||||
RowWidgets row;
|
||||
row.profile = &profile;
|
||||
row.status = status;
|
||||
row.action = action;
|
||||
row.mode = RowMode::Install;
|
||||
rows_.push_back(row);
|
||||
g_object_set_data(G_OBJECT(action), "fws-row-index",
|
||||
GINT_TO_POINTER(static_cast<int>(rows_.size()) - 1));
|
||||
}
|
||||
}
|
||||
|
||||
void refreshRows() {
|
||||
for (RowWidgets& row : rows_) {
|
||||
std::string sessionId;
|
||||
const bool installed = fws::isDesktopInstalled(*row.profile);
|
||||
const bool active = installed && fws::findActiveSession(*row.profile, sessionId);
|
||||
|
||||
gtk_widget_remove_css_class(row.action, "suggested-action");
|
||||
gtk_widget_remove_css_class(row.action, "destructive-action");
|
||||
|
||||
if (!installed) {
|
||||
gtk_label_set_markup(GTK_LABEL(row.status),
|
||||
"<span foreground='#e5a50a'>Non installé</span>");
|
||||
gtk_button_set_label(GTK_BUTTON(row.action), "Installer");
|
||||
gtk_widget_add_css_class(row.action, "suggested-action");
|
||||
row.mode = RowMode::Install;
|
||||
} else if (active) {
|
||||
gtk_label_set_markup(GTK_LABEL(row.status),
|
||||
"<span foreground='#26a269'>Installé</span> · session active");
|
||||
gtk_button_set_label(GTK_BUTTON(row.action), "Basculer");
|
||||
gtk_widget_add_css_class(row.action, "suggested-action");
|
||||
row.mode = RowMode::SwitchTo;
|
||||
} else {
|
||||
gtk_label_set_markup(GTK_LABEL(row.status),
|
||||
"<span foreground='#26a269'>Installé</span> · aucune session");
|
||||
gtk_button_set_label(GTK_BUTTON(row.action), "Écran de connexion");
|
||||
gtk_widget_add_css_class(row.action, "destructive-action");
|
||||
row.mode = RowMode::Greeter;
|
||||
}
|
||||
|
||||
gtk_widget_set_sensitive(row.action, selfBusy() ? FALSE : TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
void startInstall(const fws::DesktopProfile& profile) {
|
||||
const std::vector<std::string> arguments = fws::installArguments(profile);
|
||||
std::vector<const char*> argv;
|
||||
argv.reserve(arguments.size() + 1);
|
||||
for (const std::string& argument : arguments) {
|
||||
argv.push_back(argument.c_str());
|
||||
}
|
||||
argv.push_back(nullptr);
|
||||
|
||||
GError* error = nullptr;
|
||||
GSubprocess* process = g_subprocess_newv(
|
||||
argv.data(),
|
||||
static_cast<GSubprocessFlags>(G_SUBPROCESS_FLAGS_STDOUT_PIPE |
|
||||
G_SUBPROCESS_FLAGS_STDERR_MERGE),
|
||||
&error);
|
||||
if (process == nullptr) {
|
||||
showError(std::string("Impossible de lancer l'installation : ") +
|
||||
(error != nullptr ? error->message : "pkexec indisponible"));
|
||||
if (error != nullptr) {
|
||||
g_error_free(error);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
pending_ = process;
|
||||
setBusy(true, "Installation de " + profile.name + "…");
|
||||
gtk_text_buffer_set_text(
|
||||
gtk_text_view_get_buffer(GTK_TEXT_VIEW(logView_)), "", -1);
|
||||
|
||||
g_subprocess_communicate_utf8_async(process, nullptr, nullptr,
|
||||
&ManagerWindow::onInstallDone, this);
|
||||
}
|
||||
|
||||
void finishInstall(bool success, const std::string& output) {
|
||||
setBusy(false, success ? "Installation terminée. Utilisez l'écran de connexion pour "
|
||||
"ouvrir le nouvel environnement."
|
||||
: "Échec de l'installation.");
|
||||
if (!output.empty()) {
|
||||
GtkTextBuffer* buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(logView_));
|
||||
gtk_text_buffer_set_text(buffer, output.c_str(), -1);
|
||||
gtk_widget_set_visible(logExpander_, TRUE);
|
||||
gtk_expander_set_expanded(GTK_EXPANDER(logExpander_), !success);
|
||||
}
|
||||
refreshRows();
|
||||
if (!success) {
|
||||
showError("L'installation a échoué. Consultez les détails dans la fenêtre.");
|
||||
}
|
||||
}
|
||||
|
||||
void switchTo(const fws::DesktopProfile& profile) {
|
||||
std::string sessionId;
|
||||
if (!fws::findActiveSession(profile, sessionId)) {
|
||||
refreshRows();
|
||||
return;
|
||||
}
|
||||
|
||||
std::string error;
|
||||
if (!fws::activateSession(sessionId, error)) {
|
||||
showError("Échec de la bascule : " + error);
|
||||
return;
|
||||
}
|
||||
setStatus("Bascule vers " + profile.name + "…");
|
||||
}
|
||||
|
||||
void askGreeter() {
|
||||
GtkAlertDialog* dialog = gtk_alert_dialog_new(
|
||||
"%s",
|
||||
"La session graphique courante sera fermée. Les applications non enregistrées "
|
||||
"seront perdues. Continuer ?");
|
||||
const char* buttons[] = {"Annuler", "Continuer", nullptr};
|
||||
gtk_alert_dialog_set_buttons(dialog, buttons);
|
||||
gtk_alert_dialog_set_cancel_button(dialog, 0);
|
||||
gtk_alert_dialog_set_default_button(dialog, 1);
|
||||
g_signal_connect(dialog, "response", G_CALLBACK(&ManagerWindow::onGreeterResponse), this);
|
||||
gtk_alert_dialog_show(dialog, GTK_WINDOW(window_));
|
||||
g_object_unref(dialog);
|
||||
}
|
||||
|
||||
void showError(const std::string& message) {
|
||||
GtkAlertDialog* dialog = gtk_alert_dialog_new("%s", message.c_str());
|
||||
gtk_alert_dialog_show(dialog, GTK_WINDOW(window_));
|
||||
g_object_unref(dialog);
|
||||
}
|
||||
|
||||
void setStatus(const std::string& message) {
|
||||
gtk_label_set_text(GTK_LABEL(statusLabel_), message.c_str());
|
||||
}
|
||||
|
||||
void setBusy(bool busy, const std::string& message) {
|
||||
busy_ = busy;
|
||||
gtk_widget_set_visible(spinner_, busy ? TRUE : FALSE);
|
||||
if (busy) {
|
||||
gtk_spinner_start(GTK_SPINNER(spinner_));
|
||||
} else {
|
||||
gtk_spinner_stop(GTK_SPINNER(spinner_));
|
||||
}
|
||||
gtk_widget_set_sensitive(refreshButton_, busy ? FALSE : TRUE);
|
||||
setStatus(message);
|
||||
refreshRows();
|
||||
}
|
||||
|
||||
bool selfBusy() const { return busy_; }
|
||||
|
||||
GtkWidget* window_ = nullptr;
|
||||
GtkWidget* rowsBox_ = nullptr;
|
||||
GtkWidget* spinner_ = nullptr;
|
||||
GtkWidget* statusLabel_ = nullptr;
|
||||
GtkWidget* logView_ = nullptr;
|
||||
GtkWidget* logExpander_ = nullptr;
|
||||
GtkWidget* refreshButton_ = nullptr;
|
||||
std::vector<RowWidgets> rows_;
|
||||
GSubprocess* pending_ = nullptr;
|
||||
bool busy_ = false;
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
return ManagerWindow::run(argc, argv);
|
||||
}
|
||||
Reference in new issue
Block a user