Browse Source

draft shutdown event

CPP-GTK4
yggverse 4 months ago
parent
commit
b891678dbc
  1. 22
      src/app/browser.cpp
  2. 8
      src/app/browser.h

22
src/app/browser.cpp

@ -24,7 +24,7 @@ namespace app @@ -24,7 +24,7 @@ namespace app
Browser::HEIGHT
);
// Init requirements
// Init components
this->header = new browser::Header(
this
);
@ -42,5 +42,25 @@ namespace app @@ -42,5 +42,25 @@ namespace app
this->gtk
)
);
// Connect signals
g_signal_connect(
G_APPLICATION(
this->application
),
"shutdown",
G_CALLBACK(
_shutdown
),
NULL
);
}
// Events
void Browser::_shutdown(
GtkApplication *application
) {
// @TODO save session, clean cache, etc
g_print("Shutdown..\n");
}
}

8
src/app/browser.h

@ -31,9 +31,17 @@ namespace app @@ -31,9 +31,17 @@ namespace app
const guint WIDTH = 640;
const guint HEIGHT = 480;
// Constructor
Browser(
GtkApplication *application
);
private:
// Events
static void _shutdown(
GtkApplication *application
);
};
};

Loading…
Cancel
Save