From c6da8310d97bec284c3585dd0e09443c8b0d45ae Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Mon, 30 Jan 2012 11:22:44 -0500 Subject: [PATCH] Various Improvements --- src/databases/db_pdo.php | 6 +++--- src/windows/main.php | 43 +++++++++++++++++++++++++++++++++++++++- 2 files changed, 45 insertions(+), 4 deletions(-) diff --git a/src/databases/db_pdo.php b/src/databases/db_pdo.php index 0b72e97..0c2f567 100644 --- a/src/databases/db_pdo.php +++ b/src/databases/db_pdo.php @@ -26,7 +26,7 @@ class DB_PDO extends PDO { parent::__construct($dsn, $username, $password, $driver_options); } - // -------------------------------------------------------------------------- + // ------------------------------------------------------------------------- /** * PHP magic method to facilitate dynamic methods @@ -46,7 +46,7 @@ class DB_PDO extends PDO { } } - // -------------------------------------------------------------------------- + // ------------------------------------------------------------------------- /** * PHP magic methods to call non-static methods statically @@ -62,7 +62,7 @@ class DB_PDO extends PDO { } } - // -------------------------------------------------------------------------- + // ------------------------------------------------------------------------- /** * Simplifies prepared statements for database queries diff --git a/src/windows/main.php b/src/windows/main.php index e203d96..794e1e8 100644 --- a/src/windows/main.php +++ b/src/windows/main.php @@ -53,6 +53,12 @@ class Main extends GtkWindow { // Add the menubar $main_vbox->pack_start($this->_create_menu(), FALSE, FALSE); + // Add the toolbar + //$main_vbox->pack_start($this->_create_toolbar(), FALSE, FALSE); + + // Add the info box + $main_vbox->pack_start($this->_create_infobox(), FALSE, FALSE); + // Add the main interface area hbox $main_vbox->pack_start($main_hbox, FALSE, FALSE); @@ -61,6 +67,23 @@ class Main extends GtkWindow { $this->show_all(); } + /** + * Create the main toolbar + * + * @return GtkToolBar + */ + private function _create_toolbar() + { + $tbar = new GtkToolBar(); + + $open = new GtkToolButton(); + $open->set_stock_id(Gtk::STOCK_OPEN); + + $tbar->insert($open); + + return $tbar; + } + /** * Create the menu for the program * @@ -84,6 +107,10 @@ class Main extends GtkWindow { //File Menu { + //Set up the open item + $open = new GtkImageMenuItem(GTK::STOCK_OPEN); + $file_menu->append($open); + //Set up the quit item $quit = new GtkImageMenuItem(GTK::STOCK_QUIT); $quit->connect_simple('activate', array($this, 'quit')); @@ -108,6 +135,21 @@ class Main extends GtkWindow { return $menu_bar; } + /** + * Display Info box for errors/message + */ + function _create_infobox() + { + $this->infobar = new GtkInfoBar(); + $this->messagelabel = new GtkLabel('Welcome to OpenSQLManager!'); + $contentarea = $this->infobar->get_content_area(); + $contentarea->add($this->messagelabel); + $this->infobar->add_button(GTK::STOCK_OK, GTK::RESPONSE_OK); + $this->infobar->connect_simple('response', array($this->infobar, 'hide')); + + return ($this->infobar); + } + /** * Display About menu with version information */ @@ -135,7 +177,6 @@ class Main extends GtkWindow { { Gtk::main_quit(); } - } // End of main.php \ No newline at end of file