Move resources into their own folder, mac menu improvements
@ -1,4 +1,3 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
/**
|
||||
* OpenSQLManager
|
||||
@ -33,6 +32,7 @@ ini_set('memory_limit', -1);
|
||||
|
||||
// Set the current directory as the base for included files
|
||||
define('BASE_DIR', __DIR__.'/sys');
|
||||
define('RESOURCE_DIR', __DIR__.'/resources');
|
||||
define('SETTINGS_DIR', __DIR__);
|
||||
define('PROGRAM_NAME', 'OpenSQLManager');
|
||||
define('VERSION', '0.2.0pre');
|
||||
@ -190,6 +190,9 @@ $app = new OpenSQLManager();
|
||||
// Create platform information object
|
||||
$platform = new \wxPlatformInfo();
|
||||
|
||||
// Define the platform for later use
|
||||
define('PLATFORM', $platform->GetOperatingSystemId());
|
||||
|
||||
// Start the wx event loop
|
||||
\wxApp::SetInstance($app);
|
||||
\wxEntry();
|
||||
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 946 B After Width: | Height: | Size: 946 B |
@ -124,7 +124,7 @@ class Connection_Sidebar extends \wxPanel {
|
||||
*/
|
||||
public function menu($event)
|
||||
{
|
||||
if ($this->list->GetSelectedItemCount() === 1)
|
||||
if ($this->list->GetSelectedItemCount() > 0)
|
||||
{
|
||||
// Create the menu items
|
||||
$menu = new \wxMenu();
|
||||
|
@ -56,7 +56,7 @@ class Connection_Manager extends \wxFrame {
|
||||
*/
|
||||
public function __construct($parent, $params = array())
|
||||
{
|
||||
parent::__construct($parent, 32, "Connection Manager", wxDefaultPosition);
|
||||
parent::__construct($parent, 32, "Connection Manager", wxDefaultPosition, wxDefaultSize, wxCAPTION | wxCLOSE_BOX | wxSTAY_ON_TOP | wxRESIZE_BORDER);
|
||||
|
||||
// Save a reference to the settings class
|
||||
$this->settings =& Settings::get_instance();
|
||||
@ -168,7 +168,7 @@ class Connection_Manager extends \wxFrame {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Use the ibase_functions over PDO::Firebird, at least for now
|
||||
// Use the ibase_functions over PDO::Firebird
|
||||
if ($d === 'firebird')
|
||||
{
|
||||
continue;
|
||||
@ -240,6 +240,8 @@ class Connection_Manager extends \wxFrame {
|
||||
));
|
||||
$this->_hide(array('Database File'));
|
||||
|
||||
$fields['User']->SetValue('');
|
||||
$fields['Port']->SetValue('');
|
||||
$fields['Password']->SetValue('');
|
||||
$fields['Database Name']->SetValue('');
|
||||
$fields['Host']->SetValue('127.0.0.1');
|
||||
@ -262,7 +264,10 @@ class Connection_Manager extends \wxFrame {
|
||||
$fields['Password']->SetValue('masterkey');
|
||||
$fields['Port']->SetValue('');
|
||||
$this->_show(array('Database File'));
|
||||
$this->_hide(array('Database Name'));
|
||||
$this->_hide(array(
|
||||
'Database Name',
|
||||
'Port'
|
||||
));
|
||||
break;
|
||||
|
||||
case "sqlite":
|
||||
@ -294,7 +299,7 @@ class Connection_Manager extends \wxFrame {
|
||||
// Get the connection parameters
|
||||
$params = $this->_get_vals();
|
||||
|
||||
// Smart alek error for smart alek behavior
|
||||
// Smart aleck error for smart aleck behavior
|
||||
if (empty($params->type))
|
||||
{
|
||||
error("You need to select the correct database type");
|
||||
|
@ -106,7 +106,7 @@ class Main extends \wxFrame {
|
||||
|
||||
$dlg->SetWebSite('https://github.com/aviat4ion/OpenSQLManager','Fork on Github');
|
||||
|
||||
$dlg->SetLicense(file_get_contents(BASE_DIR . "/LICENSE"));
|
||||
$dlg->SetLicense(file_get_contents(RESOURCE_DIR . "/LICENSE"));
|
||||
|
||||
$dlg->SetDevelopers(array(
|
||||
'Timothy J. Warren',
|
||||
@ -163,8 +163,8 @@ class Main extends \wxFrame {
|
||||
// File Menu
|
||||
{
|
||||
// Set up the quit item
|
||||
$top_file_menu->Append(2, "&Quit", "Exit the program");
|
||||
$this->Connect(2, wxEVT_COMMAND_MENU_SELECTED, array($this, "quit"));
|
||||
$top_file_menu->Append(wxID_EXIT, "&Quit\tCtrl+Q", "Exit the program");
|
||||
$this->Connect(wxID_EXIT, wxEVT_COMMAND_MENU_SELECTED, array($this, "quit"));
|
||||
|
||||
// Add the top level menu to the menubar
|
||||
$menu_bar->Append($top_file_menu, "&File");
|
||||
@ -173,11 +173,12 @@ class Main extends \wxFrame {
|
||||
// Help Menu
|
||||
{
|
||||
// Set up the about item
|
||||
$top_help_menu->Append(4, "&About", "About this program");
|
||||
$this->Connect(4, wxEVT_COMMAND_MENU_SELECTED, array($this, "about"));
|
||||
$top_help_menu->Append(wxID_ABOUT, "&About", "About this program");
|
||||
$this->Connect(wxID_ABOUT, wxEVT_COMMAND_MENU_SELECTED, array($this, "about"));
|
||||
|
||||
// Add the top level menu to the menubar
|
||||
$menu_bar->Append($top_help_menu, "&Help");
|
||||
|
||||
}
|
||||
|
||||
|
||||
|