Added general "alert" dialog, and "error" dialog
This commit is contained in:
parent
427a1c0ccb
commit
a77591dfa7
40
index.php
40
index.php
@ -115,6 +115,46 @@ if(function_exists('fbird_connect'))
|
|||||||
|
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create info dialog to retun an informational message
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function alert($message)
|
||||||
|
{
|
||||||
|
$dialog = new GTKMessageDialog(
|
||||||
|
NULL,
|
||||||
|
Gtk::DIALOG_MODAL,
|
||||||
|
Gtk::MESSAGE_INFO,
|
||||||
|
Gtk::BUTTONS_OK,
|
||||||
|
$message
|
||||||
|
);
|
||||||
|
$dialog->run();
|
||||||
|
$dialog->destroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
// --------------------------------------------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create info dialog to retun an informational message
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function error($message)
|
||||||
|
{
|
||||||
|
$dialog = new GTKMessageDialog(
|
||||||
|
NULL,
|
||||||
|
Gtk::DIALOG_MODAL,
|
||||||
|
Gtk::MESSAGE_ERROR,
|
||||||
|
Gtk::BUTTONS_OK,
|
||||||
|
$message
|
||||||
|
);
|
||||||
|
$dialog->run();
|
||||||
|
$dialog->destroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
// --------------------------------------------------------------------------
|
||||||
|
|
||||||
// Create the main window
|
// Create the main window
|
||||||
new Main();
|
new Main();
|
||||||
|
|
||||||
|
@ -223,6 +223,7 @@ class Connection_Sidebar extends GtkVBox {
|
|||||||
{
|
{
|
||||||
$remove = new GtkImageMenuItem('Delete Connection');
|
$remove = new GtkImageMenuItem('Delete Connection');
|
||||||
$remove->set_image(GtkImage::new_from_stock(GTK::STOCK_CANCEL, Gtk::ICON_SIZE_MENU));
|
$remove->set_image(GtkImage::new_from_stock(GTK::STOCK_CANCEL, Gtk::ICON_SIZE_MENU));
|
||||||
|
$remove->connect_simple('activate', array($this, 'remove_connection'));
|
||||||
|
|
||||||
$this->menu->append($remove);
|
$this->menu->append($remove);
|
||||||
}
|
}
|
||||||
@ -237,10 +238,9 @@ class Connection_Sidebar extends GtkVBox {
|
|||||||
/**
|
/**
|
||||||
* Remove a connection from the connection manager
|
* Remove a connection from the connection manager
|
||||||
*
|
*
|
||||||
* @param string $key
|
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function remove_connection($key)
|
public function remove_connection()
|
||||||
{
|
{
|
||||||
//@todo implement
|
//@todo implement
|
||||||
$model = $this->treeview->get_model();
|
$model = $this->treeview->get_model();
|
||||||
|
@ -259,31 +259,13 @@ class DB_Info_Widget extends GtkTable {
|
|||||||
}
|
}
|
||||||
catch (PDOException $e)
|
catch (PDOException $e)
|
||||||
{
|
{
|
||||||
$dialog = new GTKMessageDialog(
|
error("Error connecting to database: \n\n" . $e->getMessage());
|
||||||
NULL,
|
|
||||||
Gtk::DIALOG_MODAL,
|
|
||||||
Gtk::MESSAGE_ERROR,
|
|
||||||
Gtk::BUTTONS_OK,
|
|
||||||
"Error connecting to database: \n\n" . $e->getMessage()
|
|
||||||
);
|
|
||||||
$dialog->run();
|
|
||||||
$dialog->destroy();
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Successful Connection?
|
// Successful Connection?
|
||||||
// Tell the user!
|
// Tell the user!
|
||||||
$dialog = new GTKMessageDialog(
|
alert("Successfully Connected.");
|
||||||
NULL,
|
|
||||||
Gtk::DIALOG_MODAL,
|
|
||||||
Gtk::MESSAGE_INFO,
|
|
||||||
Gtk::BUTTONS_OK,
|
|
||||||
"Successfully connected"
|
|
||||||
);
|
|
||||||
|
|
||||||
$dialog->run();
|
|
||||||
$dialog->destroy();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user