From 2004f6f3835bf7fd59d3bacd605d514ea3d3d7e3 Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Tue, 4 Dec 2012 18:52:54 -0500 Subject: [PATCH] Misc --- OpenSQLManager.c | 2 +- src/OpenSQLManager.php | 15 +++++---------- src/sys/widgets/connection_sidebar.php | 8 ++++++-- src/sys/windows/connection_manager.php | 3 --- src/sys/windows/main.php | 3 ++- 5 files changed, 14 insertions(+), 17 deletions(-) diff --git a/OpenSQLManager.c b/OpenSQLManager.c index b702a3f..8272c52 100644 --- a/OpenSQLManager.c +++ b/OpenSQLManager.c @@ -20,7 +20,7 @@ int main(int argc, char *argv[]) { PHP_EMBED_START_BLOCK(argc,argv) /* Change extension directory */ - zend_alter_ini_entry("extension_dir", sizeof("extension_dir"), ".", sizeof("."), PHP_INI_ALL, PHP_INI_STAGE_RUNTIME); + zend_alter_ini_entry("extension_dir", sizeof("extension_dir"), "./", sizeof("./"), PHP_INI_ALL, PHP_INI_STAGE_RUNTIME); zend_eval_string(" \ chdir(dirname($argv[0])); \ require ('OpenSQLManager.php'); \ diff --git a/src/OpenSQLManager.php b/src/OpenSQLManager.php index 19ecd31..37bb4d5 100644 --- a/src/OpenSQLManager.php +++ b/src/OpenSQLManager.php @@ -36,7 +36,6 @@ define('OSM_RESOURCE_DIR', realpath(__DIR__.'/../Resources')); define('OSM_SETTINGS_DIR', __DIR__); define('OSM_PROGRAM_NAME', 'OpenSQLManager'); define('OSM_VERSION', '0.2.0pre'); -echo OSM_RESOURCE_DIR . "\n"; // -------------------------------------------------------------------------- @@ -52,7 +51,7 @@ function log_fatal() $fatal = [E_ERROR, E_PARSE, E_RECOVERABLE_ERROR]; // Log error. - //if(in_array($error['type'], $fatal)) + if(in_array($error['type'], $fatal)) { file_put_contents('errors.txt', print_r($error, TRUE), FILE_APPEND); } @@ -63,7 +62,7 @@ register_shutdown_function('OpenSQLManager\log_fatal'); // -------------------------------------------------------------------------- // Make sure wxphp works -if ( ! class_exists('wxApp')) +if ( ! extension_loaded('wxwidgets')) { // Try to load wxphp if possible // Windows is special @@ -73,7 +72,7 @@ if ( ! class_exists('wxApp')) } else { - $name .= 'wxwidgets.'.PHP_SHLIB_SUFFIX; + $name = 'wxwidgets.'.PHP_SHLIB_SUFFIX; } $res = dl($name); @@ -183,8 +182,7 @@ class OpenSQLManager extends \wxApp { public function OnInit() { // The main Window object - $main = new Main(); - $main->show(); + (new Main())->show(); return 0; } @@ -204,11 +202,8 @@ class OpenSQLManager extends \wxApp { // Create the app instance $app = new OpenSQLManager(); -// Create platform information object -$platform = new \wxPlatformInfo(); - // Define the platform for later use -define('PLATFORM', $platform->GetOperatingSystemId()); +define('PLATFORM', (new \wxPlatformInfo())->GetOperatingSystemId()); // Start the wx event loop \wxApp::SetInstance($app); diff --git a/src/sys/widgets/connection_sidebar.php b/src/sys/widgets/connection_sidebar.php index d6325e4..4731789 100644 --- a/src/sys/widgets/connection_sidebar.php +++ b/src/sys/widgets/connection_sidebar.php @@ -62,7 +62,7 @@ class Connection_Sidebar extends \wxPanel { * * @var wxListCtrl */ - private $list; + public $list; /** * Reference to the image list control that holds connection images @@ -157,7 +157,11 @@ class Connection_Sidebar extends \wxPanel { break; case self::MENU_DELETE_CONNECT: - alert("Delete"); + $res = confirm("Do you want to delete this item?"); + if ($res) + { + print_r($event); + } break; default: diff --git a/src/sys/windows/connection_manager.php b/src/sys/windows/connection_manager.php index 18958e5..a9ce026 100644 --- a/src/sys/windows/connection_manager.php +++ b/src/sys/windows/connection_manager.php @@ -221,9 +221,6 @@ class Connection_Manager extends \wxFrame { } $this->settings->add_db($params->name, $params); - - $this->parent->Update(); - $this->Destroy(); } diff --git a/src/sys/windows/main.php b/src/sys/windows/main.php index 96b5167..590a025 100644 --- a/src/sys/windows/main.php +++ b/src/sys/windows/main.php @@ -156,7 +156,8 @@ class Main extends \wxFrame { // Add the connection sidebar $this->connection_sidebar =& Connection_Sidebar::get_instance($win); - $win2 = new Db_tabs($win); + $win2 = new Db_tabs($win); + $win2->add_tab(''); // Add the widgets to the split window $win->SplitVertically($this->connection_sidebar, $win2);