// Initialization of the dialog HWND InitVpnWebDlg(VPNWEBDLG_INIT *init) { HWND hWnd; // Validate arguments if (init == NULL) { return NULL; } _configthreadlocale(_DISABLE_PER_THREAD_LOCALE); setlocale(LC_ALL, ""); ZeroMemory(&data, sizeof(data)); CopyMemory(&data, init, sizeof(data)); LoadTables(data.LanguageId); hWnd = CreateDialog(hDllInstance, MAKEINTRESOURCE(IDD_VPNWEBDLG), data.hControlWnd, VpnWebDlgProc); data.hWnd = hWnd; ShowWindow(hWnd, SW_SHOW); return hWnd; }
void classTables::setOpen( bool bOpen ) { if ( bOpen ) LoadTables(); else listTables.clear(); #ifdef QT_V4LAYOUT Q3ListViewItem::setOpen( bOpen ); #else QListViewItem::setOpen( bOpen ); #endif }
bool TROPUSRLoader::Load(const std::string& filepath, const std::string& configpath) { if (m_file) Close(); // TODO: This seems to be always true... A bug in ExistsFile() ? if (!Emu.GetVFS().ExistsFile(filepath)) Generate(filepath, configpath); m_file = Emu.GetVFS().OpenFile(filepath, vfsRead); LoadHeader(); LoadTableHeaders(); LoadTables(); Close(); return true; }
bool TROPUSRLoader::Load(const std::string& filepath, const std::string& configpath) { const std::string& path = vfs::get(filepath); if (!fs::is_file(path)) { Generate(filepath, configpath); } if (!m_file.open(path, fs::read)) { return false; } if (!LoadHeader() || !LoadTableHeaders() || !LoadTables()) { return false; } m_file.release(); return true; }
bool ODBC_Connection::ConnectToDatabase(QString database, QString user, QString password) { if (m_db.isOpen()) { Logging::getInstance()->WriteLog(WARNING, "Warning in ConnectToDatabase(): Attempted to connect while connection is open"); #ifdef _DEBUG qDebug() << "Warning in ConnectToDatabase(): Attempted to connect while connection is open"; #endif return true; } m_db.setDatabaseName(database); if (user != "") m_db.setUserName(user); if (password != "") m_db.setPassword(password); m_db.setConnectOptions(QString("SQL_ATTR_LOGIN_TIMEOUT=%1").arg(ODBC_OptionsDialog::getInstance()->GetConnectionTimeout())); if (!m_db.open()) { m_sDatabaseError = m_db.lastError().text(); Logging::getInstance()->WriteLog(ERR, QString("Couldn't connect to \"%1\", error: %2").arg(m_sConnectionName, m_sDatabaseError)); #ifdef _DEBUG qDebug() << QString("Couldn't connect to \"%1\", error: %2").arg(m_sConnectionName, m_sDatabaseError); #endif return false; } else { // set the status label m_ui.StatusLabel->setText(QString("Connected to %1").arg(m_sConnectionName)); Logging::getInstance()->WriteLog(INFORMATION, QString("Connected to \"%1\"").arg(m_sConnectionName)); LoadTables(); mQuery = QSqlQuery(m_db); return true; } }
void ODBC_Connection::RestoreGui() { m_ui.SQLCommandTextEdit->setText(m_sCurrentStatement); m_ui.SQLLogTextBrowser->setText(m_sLogFile); m_ui.SQLLogTextBrowser->verticalScrollBar()->setSliderPosition(m_ui.SQLLogTextBrowser->verticalScrollBar()->maximum()); m_ui.SQLResultTableView->setModel(NULL); LoadTables(); for (int i = 0, count = m_db.tables().count(); i < count; i++) { QString sTableName = m_db.tables().value(i); QList<QTreeWidgetItem*> lItems = m_ui.TableTreeWidget->findItems(sTableName, Qt::MatchExactly); if (lItems.count() > 0) { QTreeWidgetItem *pItem = lItems.value(0); if (pItem == NULL) return; if (m_lExpandedTables.contains(sTableName)) m_ui.TableTreeWidget->expandItem(pItem); } } int iStatementCount = m_slStatementHistory.count(); if (m_iCurrentHistoryIndex < iStatementCount) m_ui.SQLCommandTextEdit->setText(m_slStatementHistory.value(m_iCurrentHistoryIndex)); else m_ui.SQLCommandTextEdit->setText(""); m_ui.CurrentStatementLabel->setText(QString().setNum(m_iCurrentHistoryIndex + 1)); if (m_ui.SQLCommandTextEdit->toPlainText().isEmpty()) m_ui.ExecuteToolButton->setDisabled(true); if (m_iCurrentHistoryIndex == 0) { m_ui.LeftToolButton->setDisabled(true); if (m_ui.SQLCommandTextEdit->toPlainText().isEmpty()) m_ui.RightToolButton->setDisabled(true); else { m_ui.RightToolButton->setEnabled(true); m_ui.CurrentStatementLabel->setEnabled(true); } } else if (m_iCurrentHistoryIndex == iStatementCount && iStatementCount != 0) { m_ui.RightToolButton->setDisabled(true); m_ui.LeftToolButton->setEnabled(true); m_ui.CurrentStatementLabel->setEnabled(true); } else { m_ui.RightToolButton->setEnabled(true); m_ui.LeftToolButton->setEnabled(true); m_ui.CurrentStatementLabel->setEnabled(true); } // set the status label m_ui.StatusLabel->setText(QString("Connected to %1").arg(m_sConnectionName)); }
//***************************************** void cOrderArray::Setup() { setupUi(this); LoadTables(); }
//******************************************* void cOrderArray::on_comboBoxFileType4_currentIndexChanged() { LoadTables(); }