diff --git a/src/Entity/Browser/Menu/Help/About.php b/src/Entity/Browser/Menu/Help/About.php
index 94fc3d1a..ae9fa9a6 100644
--- a/src/Entity/Browser/Menu/Help/About.php
+++ b/src/Entity/Browser/Menu/Help/About.php
@@ -5,7 +5,13 @@ declare(strict_types=1);
namespace Yggverse\Yoda\Entity\Browser\Menu\Help;
use \Gtk;
+use \GtkButtonsType;
+use \GtkDialogFlags;
+use \GtkJustification;
use \GtkMenuItem;
+use \GtkMessageDialog;
+use \GtkMessageType;
+use \GtkResponseType;
use \Yggverse\Yoda\Entity\Browser\Menu\Help;
@@ -20,6 +26,14 @@ class About
// Defaults
public const LABEL = 'About';
+ public const DIALOG_MESSAGE_FORMAT = 'About';
+ public const DIALOG_FORMAT_SECONDARY_MARKUP_APP_SRC_VERSION = 'Yoda dev'; // @TODO
+ public const DIALOG_FORMAT_SECONDARY_MARKUP_PHP_SRC_VERSION = 'PHP %d.%d.%d';
+ public const DIALOG_FORMAT_SECONDARY_MARKUP_PHP_GTK_VERSION = 'PHP-GTK %s';
+ public const DIALOG_FORMAT_SECONDARY_MARKUP_LIB_GTK_VERSION = 'GTK %d.%d.%d';
+
+ public const PHP_VERSION_GTK_EXTENSION = 'php-gtk3';
+
public function __construct(
Help $help
) {
@@ -39,7 +53,72 @@ class About
'activate',
function()
{
- // @TODO
+ $dialog = new GtkMessageDialog(
+ $this->help->menu->browser->gtk,
+ GtkDialogFlags::MODAL,
+ GtkMessageType::INFO,
+ GtkButtonsType::OK,
+ _($this::DIALOG_MESSAGE_FORMAT)
+ );
+
+ $dialog->format_secondary_markup(
+ implode(
+ PHP_EOL,
+ [
+ _($this::DIALOG_FORMAT_SECONDARY_MARKUP_APP_SRC_VERSION),
+ sprintf(
+ _($this::DIALOG_FORMAT_SECONDARY_MARKUP_PHP_SRC_VERSION),
+ PHP_MAJOR_VERSION,
+ PHP_MINOR_VERSION,
+ PHP_RELEASE_VERSION
+ ),
+ implode(
+ ' / ',
+ [
+ sprintf(
+ _($this::DIALOG_FORMAT_SECONDARY_MARKUP_PHP_GTK_VERSION),
+ phpversion(
+ $this::PHP_VERSION_GTK_EXTENSION
+ )
+ ),
+ sprintf(
+ _($this::DIALOG_FORMAT_SECONDARY_MARKUP_LIB_GTK_VERSION),
+ 0, // @TODO pending for PR #153
+ 0,
+ 0
+ )
+ ]
+ )
+ ]
+ )
+ );
+
+ // Tune up the label
+ if ($label = $dialog->get_message_area()->get_children())
+ {
+ if (!isset($label[1]))
+ {
+ throw new Exception;
+ }
+
+ $label[1]->set_selectable(
+ true
+ );
+
+ $label[1]->set_track_visited_links(
+ false
+ );
+
+ $label[1]->set_justify(
+ GtkJustification::CENTER
+ );
+ }
+
+ // Await for action
+ if (GtkResponseType::OK == $dialog->run())
+ {
+ $dialog->destroy();
+ }
}
);
}