diff --git a/index.php b/index.php index 3bcc0c2..153d2af 100644 --- a/index.php +++ b/index.php @@ -118,6 +118,7 @@ if(function_exists('fbird_connect')) /** * Create info dialog to retun an informational message * + * @param string $message * @return void */ function alert($message) @@ -138,6 +139,7 @@ function alert($message) /** * Create info dialog to retun an informational message * + * @param string $message * @return void */ function error($message) @@ -155,6 +157,30 @@ function error($message) // -------------------------------------------------------------------------- +/** + * Creates a binary confirmation dialog + * + * @param string $message + * @return bool + */ +function confirm($message) +{ + $dialog = new GTKMessageDialog( + NULL, + Gtk::DIALOG_MODAL, + Gtk::MESSAGE_QUESTION, + Gtk::BUTTONS_YES_NO, + $message + ); + + $answer = $dialog->run(); + $dialog->destroy(); + + return ($answer === Gtk::RESPONSE_YES) ? TRUE : FALSE; +} + +// -------------------------------------------------------------------------- + // Create the main window new Main(); diff --git a/sys/common/settings.php b/sys/common/settings.php index 3593737..1b1d815 100644 --- a/sys/common/settings.php +++ b/sys/common/settings.php @@ -123,6 +123,9 @@ class Settings { { return FALSE; } + + // Save the json + $this->__destruct(); } // -------------------------------------------------------------------------- @@ -143,6 +146,9 @@ class Settings { { return FALSE; } + + // Save the json + $this->__destruct(); } // -------------------------------------------------------------------------- @@ -161,6 +167,9 @@ class Settings { // Remove the db name from the object unset($this->current->dbs->{$name}); + + // Save the json + $this->__destruct(); } // -------------------------------------------------------------------------- diff --git a/sys/windows/widgets/connection_sidebar.php b/sys/windows/widgets/connection_sidebar.php index c616701..7302dce 100644 --- a/sys/windows/widgets/connection_sidebar.php +++ b/sys/windows/widgets/connection_sidebar.php @@ -232,6 +232,16 @@ class Connection_Sidebar extends GtkVBox { // -------------------------------------------------------------------------- + /** + * Update the connection information for an existing connection + */ + public function edit_connection() + { + //@todo implement + } + + // -------------------------------------------------------------------------- + /** * Remove a connection from the connection manager * @@ -239,6 +249,11 @@ class Connection_Sidebar extends GtkVBox { */ public function remove_connection($col) { + if ( ! confirm("Are you sure you want to remove this database connection?")) + { + return; + } + //@todo implement $model = $this->treeview->get_model(); }