Move resources into their own folder, mac menu improvements

This commit is contained in:
Timothy Warren 2012-06-06 16:26:06 -04:00
parent 19e02e1349
commit 152a10d6b3
13 changed files with 126 additions and 117 deletions

View File

@ -1,4 +1,3 @@
#!/usr/bin/env php
<?php <?php
/** /**
* OpenSQLManager * OpenSQLManager
@ -33,6 +32,7 @@ ini_set('memory_limit', -1);
// Set the current directory as the base for included files // Set the current directory as the base for included files
define('BASE_DIR', __DIR__.'/sys'); define('BASE_DIR', __DIR__.'/sys');
define('RESOURCE_DIR', __DIR__.'/resources');
define('SETTINGS_DIR', __DIR__); define('SETTINGS_DIR', __DIR__);
define('PROGRAM_NAME', 'OpenSQLManager'); define('PROGRAM_NAME', 'OpenSQLManager');
define('VERSION', '0.2.0pre'); define('VERSION', '0.2.0pre');
@ -190,6 +190,9 @@ $app = new OpenSQLManager();
// Create platform information object // Create platform information object
$platform = new \wxPlatformInfo(); $platform = new \wxPlatformInfo();
// Define the platform for later use
define('PLATFORM', $platform->GetOperatingSystemId());
// Start the wx event loop // Start the wx event loop
\wxApp::SetInstance($app); \wxApp::SetInstance($app);
\wxEntry(); \wxEntry();

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

Before

Width:  |  Height:  |  Size: 946 B

After

Width:  |  Height:  |  Size: 946 B

View File

@ -124,7 +124,7 @@ class Connection_Sidebar extends \wxPanel {
*/ */
public function menu($event) public function menu($event)
{ {
if ($this->list->GetSelectedItemCount() === 1) if ($this->list->GetSelectedItemCount() > 0)
{ {
// Create the menu items // Create the menu items
$menu = new \wxMenu(); $menu = new \wxMenu();

View File

@ -56,7 +56,7 @@ class Connection_Manager extends \wxFrame {
*/ */
public function __construct($parent, $params = array()) 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 // Save a reference to the settings class
$this->settings =& Settings::get_instance(); $this->settings =& Settings::get_instance();
@ -168,7 +168,7 @@ class Connection_Manager extends \wxFrame {
continue; continue;
} }
// Use the ibase_functions over PDO::Firebird, at least for now // Use the ibase_functions over PDO::Firebird
if ($d === 'firebird') if ($d === 'firebird')
{ {
continue; continue;
@ -240,6 +240,8 @@ class Connection_Manager extends \wxFrame {
)); ));
$this->_hide(array('Database File')); $this->_hide(array('Database File'));
$fields['User']->SetValue('');
$fields['Port']->SetValue('');
$fields['Password']->SetValue(''); $fields['Password']->SetValue('');
$fields['Database Name']->SetValue(''); $fields['Database Name']->SetValue('');
$fields['Host']->SetValue('127.0.0.1'); $fields['Host']->SetValue('127.0.0.1');
@ -262,7 +264,10 @@ class Connection_Manager extends \wxFrame {
$fields['Password']->SetValue('masterkey'); $fields['Password']->SetValue('masterkey');
$fields['Port']->SetValue(''); $fields['Port']->SetValue('');
$this->_show(array('Database File')); $this->_show(array('Database File'));
$this->_hide(array('Database Name')); $this->_hide(array(
'Database Name',
'Port'
));
break; break;
case "sqlite": case "sqlite":
@ -294,7 +299,7 @@ class Connection_Manager extends \wxFrame {
// Get the connection parameters // Get the connection parameters
$params = $this->_get_vals(); $params = $this->_get_vals();
// Smart alek error for smart alek behavior // Smart aleck error for smart aleck behavior
if (empty($params->type)) if (empty($params->type))
{ {
error("You need to select the correct database type"); error("You need to select the correct database type");

View File

@ -106,7 +106,7 @@ class Main extends \wxFrame {
$dlg->SetWebSite('https://github.com/aviat4ion/OpenSQLManager','Fork on Github'); $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( $dlg->SetDevelopers(array(
'Timothy J. Warren', 'Timothy J. Warren',
@ -163,8 +163,8 @@ class Main extends \wxFrame {
// File Menu // File Menu
{ {
// Set up the quit item // Set up the quit item
$top_file_menu->Append(2, "&Quit", "Exit the program"); $top_file_menu->Append(wxID_EXIT, "&Quit\tCtrl+Q", "Exit the program");
$this->Connect(2, wxEVT_COMMAND_MENU_SELECTED, array($this, "quit")); $this->Connect(wxID_EXIT, wxEVT_COMMAND_MENU_SELECTED, array($this, "quit"));
// Add the top level menu to the menubar // Add the top level menu to the menubar
$menu_bar->Append($top_file_menu, "&File"); $menu_bar->Append($top_file_menu, "&File");
@ -173,11 +173,12 @@ class Main extends \wxFrame {
// Help Menu // Help Menu
{ {
// Set up the about item // Set up the about item
$top_help_menu->Append(4, "&About", "About this program"); $top_help_menu->Append(wxID_ABOUT, "&About", "About this program");
$this->Connect(4, wxEVT_COMMAND_MENU_SELECTED, array($this, "about")); $this->Connect(wxID_ABOUT, wxEVT_COMMAND_MENU_SELECTED, array($this, "about"));
// Add the top level menu to the menubar // Add the top level menu to the menubar
$menu_bar->Append($top_help_menu, "&Help"); $menu_bar->Append($top_help_menu, "&Help");
} }