top->set_size_request(640, 480); /** * 2. Restore session info */ $this->model = new Pgma_Model(); // load configuration info /** * @todo Apply layout info restored at this point to the top-level window */ /** * 3. connect */ $this->serverController = new Server_Controller($this->model->properties['Auth']); try { $this->serverController->login(); } catch (PDOException $e) { die('Failed login to the DB server: ' . PHP_EOL . $e->getMessage() . PHP_EOL); } /** * Populate the DB view */ $dbStore = new GtkListStore(GObject::TYPE_STRING); $arDatabases = $this->serverController->getDatabases(); foreach ($arDatabases as $dbName) { $dbStore->append(array($dbName)); } $dbView = $this->glade->get_widget('tvNavigation'); $dbView->set_model($dbStore); $dbNameRenderer = new GtkCellRendererText(); $dbNameRenderer->set_property('width', -1); $dbNameRenderer->set_property('text', $dbName); $dbCol = new GtkTreeViewColumn('Database', $dbNameRenderer, 'text', 0); $dbCol->set_cell_data_func($dbNameRenderer, array($this, 'zebraTreeViewCallback')); $dbView->append_column($dbCol); } }