Misc
This commit is contained in:
parent
887dc7ff8d
commit
2004f6f383
@ -20,7 +20,7 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
PHP_EMBED_START_BLOCK(argc,argv)
|
PHP_EMBED_START_BLOCK(argc,argv)
|
||||||
/* Change extension directory */
|
/* 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(" \
|
zend_eval_string(" \
|
||||||
chdir(dirname($argv[0])); \
|
chdir(dirname($argv[0])); \
|
||||||
require ('OpenSQLManager.php'); \
|
require ('OpenSQLManager.php'); \
|
||||||
|
@ -36,7 +36,6 @@ define('OSM_RESOURCE_DIR', realpath(__DIR__.'/../Resources'));
|
|||||||
define('OSM_SETTINGS_DIR', __DIR__);
|
define('OSM_SETTINGS_DIR', __DIR__);
|
||||||
define('OSM_PROGRAM_NAME', 'OpenSQLManager');
|
define('OSM_PROGRAM_NAME', 'OpenSQLManager');
|
||||||
define('OSM_VERSION', '0.2.0pre');
|
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];
|
$fatal = [E_ERROR, E_PARSE, E_RECOVERABLE_ERROR];
|
||||||
|
|
||||||
// Log 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);
|
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
|
// Make sure wxphp works
|
||||||
if ( ! class_exists('wxApp'))
|
if ( ! extension_loaded('wxwidgets'))
|
||||||
{
|
{
|
||||||
// Try to load wxphp if possible
|
// Try to load wxphp if possible
|
||||||
// Windows is special
|
// Windows is special
|
||||||
@ -73,7 +72,7 @@ if ( ! class_exists('wxApp'))
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$name .= 'wxwidgets.'.PHP_SHLIB_SUFFIX;
|
$name = 'wxwidgets.'.PHP_SHLIB_SUFFIX;
|
||||||
}
|
}
|
||||||
|
|
||||||
$res = dl($name);
|
$res = dl($name);
|
||||||
@ -183,8 +182,7 @@ class OpenSQLManager extends \wxApp {
|
|||||||
public function OnInit()
|
public function OnInit()
|
||||||
{
|
{
|
||||||
// The main Window object
|
// The main Window object
|
||||||
$main = new Main();
|
(new Main())->show();
|
||||||
$main->show();
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -204,11 +202,8 @@ class OpenSQLManager extends \wxApp {
|
|||||||
// Create the app instance
|
// Create the app instance
|
||||||
$app = new OpenSQLManager();
|
$app = new OpenSQLManager();
|
||||||
|
|
||||||
// Create platform information object
|
|
||||||
$platform = new \wxPlatformInfo();
|
|
||||||
|
|
||||||
// Define the platform for later use
|
// Define the platform for later use
|
||||||
define('PLATFORM', $platform->GetOperatingSystemId());
|
define('PLATFORM', (new \wxPlatformInfo())->GetOperatingSystemId());
|
||||||
|
|
||||||
// Start the wx event loop
|
// Start the wx event loop
|
||||||
\wxApp::SetInstance($app);
|
\wxApp::SetInstance($app);
|
||||||
|
@ -62,7 +62,7 @@ class Connection_Sidebar extends \wxPanel {
|
|||||||
*
|
*
|
||||||
* @var wxListCtrl
|
* @var wxListCtrl
|
||||||
*/
|
*/
|
||||||
private $list;
|
public $list;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reference to the image list control that holds connection images
|
* Reference to the image list control that holds connection images
|
||||||
@ -157,7 +157,11 @@ class Connection_Sidebar extends \wxPanel {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case self::MENU_DELETE_CONNECT:
|
case self::MENU_DELETE_CONNECT:
|
||||||
alert("Delete");
|
$res = confirm("Do you want to delete this item?");
|
||||||
|
if ($res)
|
||||||
|
{
|
||||||
|
print_r($event);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -221,9 +221,6 @@ class Connection_Manager extends \wxFrame {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$this->settings->add_db($params->name, $params);
|
$this->settings->add_db($params->name, $params);
|
||||||
|
|
||||||
$this->parent->Update();
|
|
||||||
|
|
||||||
$this->Destroy();
|
$this->Destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -156,7 +156,8 @@ class Main extends \wxFrame {
|
|||||||
|
|
||||||
// Add the connection sidebar
|
// Add the connection sidebar
|
||||||
$this->connection_sidebar =& Connection_Sidebar::get_instance($win);
|
$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
|
// Add the widgets to the split window
|
||||||
$win->SplitVertically($this->connection_sidebar, $win2);
|
$win->SplitVertically($this->connection_sidebar, $win2);
|
||||||
|
Reference in New Issue
Block a user