void KexiDBConnectionDialog::init(const KGuiItem& acceptButtonGuiItem)
{
    setObjectName("KexiDBConnectionDialog");
    setButtons(KDialog::User1 | KDialog::Cancel | KDialog::Help);
    setButtonGuiItem(KDialog::User1,
                     acceptButtonGuiItem.text().isEmpty()
                     ? KGuiItem(i18n("&Open"), "document-open", i18n("Open Database Connection"))
                     : acceptButtonGuiItem
                    );
    setModal(true);

    setMainWidget(m_tabWidget);
    connect(this, SIGNAL(user1Clicked()), this, SLOT(accept()));
    connect(m_tabWidget->mainWidget, SIGNAL(saveChanges()), this, SIGNAL(saveChanges()));
    connect(m_tabWidget, SIGNAL(testConnection()), this, SIGNAL(testConnection()));

    adjustSize();
    resize(width(), m_tabWidget->height());
    if (m_tabWidget->mainWidget->connectionOnly())
        m_tabWidget->mainWidget->driversCombo()->setFocus();
    else if (m_tabWidget->mainWidget->nameCombo->currentText().isEmpty())
        m_tabWidget->mainWidget->nameCombo->setFocus();
    else if (m_tabWidget->mainWidget->userEdit->text().isEmpty())
        m_tabWidget->mainWidget->userEdit->setFocus();
    else if (m_tabWidget->mainWidget->passwordEdit->text().isEmpty())
        m_tabWidget->mainWidget->passwordEdit->setFocus();
    else //back
        m_tabWidget->mainWidget->nameCombo->setFocus();
}
Ejemplo n.º 2
0
void frmConnect::on_btnOk_clicked()
{
    QHostAddress adressValidator;

    if(adressValidator.setAddress(ui->txtServer->text()) && testConnection(ui->txtServer->text(),ui->txtPort->text().toUInt()))
    {
        p_server = ui->txtServer->text();
        p_port = ui->txtPort->text();

        if(ui->chbCreateServer->isChecked())
        {
            frmServer *server_frm = new frmServer;
            server_frm->show();
        }
        else
        {
            frmClient *client_frm = new frmClient;
            client_frm->show();
        }
        this->close();
    }
    else
    {
        QMessageBox msg;
        msg.warning(this,tr("Пiдключення"),tr("Сервер недоступний, або невiрнi параметри пiдключення."),QMessageBox::Ok);
        ui->txtServer->setFocus();
    }
}
Ejemplo n.º 3
0
static int handler(request_rec *r) {
    int stat = OK;
	if(strcmp(r->handler, MODULE_NAME)) return DECLINED;
    if(r->header_only) return stat;

	r->allowed |= (AP_METHOD_BIT << M_GET);
	r->allowed |= (AP_METHOD_BIT << M_POST);

	osrfLogSetAppname("osrf_http_translator");
	osrfAppSessionSetIngress(TRANSLATOR_INGRESS);
    testConnection(r);
    crossOriginHeaders(r, allowedOrigins);

	osrfLogMkXid();
    osrfHttpTranslator* trans = osrfNewHttpTranslator(r);
    if(trans->body) {
        stat = osrfHttpTranslatorProcess(trans);
        //osrfHttpTranslatorDebug(trans);
        osrfLogInfo(OSRF_LOG_MARK, "translator resulted in status %d", stat);
    } else {
        osrfLogWarning(OSRF_LOG_MARK, "no message body to process");
    }
    osrfHttpTranslatorFree(trans);
	return stat;
}
Ejemplo n.º 4
0
TTTPreferences::TTTPreferences(QWidget *parent) :
    QDialog(parent),
    m_pUI(new Ui::TTTPreferences)
{
	m_pUI->setupUi(this);
	connect(this->m_pUI->testButton,SIGNAL(clicked()),this,SLOT(testConnection()));
}
Ejemplo n.º 5
0
void QgsMssqlNewConnection::listDatabases()
{
  testConnection( "master" );
  listDatabase->clear();
  QString queryStr = "SELECT name FROM master..sysdatabases WHERE name NOT IN ('master', 'tempdb', 'model', 'msdb')";

  QSqlDatabase db = QgsMssqlProvider::GetDatabase( txtService->text().trimmed(),
                    txtHost->text().trimmed(),
                    "master",
                    txtUsername->text().trimmed(),
                    txtPassword->text().trimmed() );
  if ( db.open() )
  {
    QSqlQuery query = QSqlQuery( db );
    query.setForwardOnly( true );
    query.exec( queryStr );

    if ( !txtService->text().isEmpty() )
    {
      listDatabase->addItem( "(from service)" );
    }

    if ( query.isActive() )
    {
      while ( query.next() )
      {
        QString name = query.value( 0 ).toString();
        listDatabase->addItem( name );
      }
      listDatabase->setCurrentRow( 0 );
    }
    db.close();
  }
}
/**
 * Start the device through address with offset's informed
 * @param address
 * @param xGyroOffset
 * @param yGyroOffset
 * @param zGyroOffset
 * @return boolean
 */
bool MPU6050::dmpStartDevice(uint8_t address, int xGyroOffset, int yGyroOffset, int zGyroOffset) {

    setAddress(address);

    initialize();

    setXGyroOffset(xGyroOffset);
    setYGyroOffset(yGyroOffset);
    setZGyroOffset(zGyroOffset);

    if (testConnection())
    {
        // load and configure the DMP
        if (dmpInitialize() == 0)
        {
            // turn on the DMP, now that it's ready
            setDMPEnabled(true);

            dmpStatus = getIntStatus();

            // set our DMP Ready flag so the main loop() function knows it's okay to use it
            dmpReady = true;

            // get expected DMP packet size for later comparison
            dmpPacketSize = dmpGetFIFOPacketSize();

            timeReset();
            resetFIFO();

            return true;
        }
    }

    return false;
}
Ejemplo n.º 7
0
int64_t PDOPgSqlConnection::doer(const String& sql){
  testConnection();

  const char* query = sql.data();

  PQ::Result res = m_server->exec(query);

  if(!res){
    // I think this error should be handled in a different way perhaps?
    handleError(nullptr, "XX000", "Invalid result data");
    return -1;
  }

  ExecStatusType status = m_lastExec = res.status();

  int64_t ret;

  if(status == PGRES_COMMAND_OK){
    ret = (int64_t)res.cmdTuples();
  } else if(status == PGRES_TUPLES_OK) {
    ret = 0L;
  } else {
    HANDLE_ERROR(nullptr, res);
    return -1L;
  }

  this->pgoid = res.oidValue();

  return ret;
}
Ejemplo n.º 8
0
TrackerSettingsWidget::TrackerSettingsWidget(QWidget *parent) :
    AbstractSettingsWidget(parent)
{
    QGridLayout *mainLayout = new QGridLayout;
    mainLayout->addWidget(new QLabel(tr("YouTrack Login:"******"YouTrack password:"******"Url: "), this), 2, 0);
    mainLayout->addWidget(mUrlEdit, 2, 1, 1, 2);

    mSuccessLabel = new QLabel(tr("Success"), this);
    mSuccessLabel->hide();
    mFailLabel = new QLabel(tr("Fail"), this);
    mFailLabel->hide();
    mainLayout->addWidget(mSuccessLabel, 3, 1);
    mainLayout->addWidget(mFailLabel, 3, 1);

    mTestButton = new QPushButton(tr("Test connection"), this);
    connect(mTestButton, SIGNAL(clicked()), this, SLOT(testConnection()));
    mainLayout->addWidget(mTestButton, 3, 2);

    mainLayout->addWidget(new QLabel(tr("Projects: "), this), 4, 0);
    mProjectList = new QComboBox(this);
    connect(mProjectList, SIGNAL(currentIndexChanged(int)), this, SLOT(projectChanged(int)));
    mainLayout->addWidget(mProjectList, 4, 1, 1, 2);

    setLayout(mainLayout);
}
Ejemplo n.º 9
0
void MainWindow::new_list() {
    if ( !testConnection() ) return;
    try {
       setFilledList(md->new_list(md->fetch_topic(selectedTopicID())));
    } catch ( std::exception & e ) {
        QMessageBox::warning(this, "Failed!", e.what());
    }
}
Ejemplo n.º 10
0
void MainWindow::new_topic() {
    if ( !testConnection() ) return;
    try {
       setFilledTopic(md->new_topic(Im633::topictype::get_topictype(1))); // default to music
    } catch ( std::exception & e ) {
        QMessageBox::warning(this, "Failed!", e.what());
    }

}
Ejemplo n.º 11
0
SettingsDialog::SettingsDialog(const Settings& settings, qulonglong currModBase, QWidget* parent)
	: QDialog(parent)
	, m_UI(new Ui::SettingsDialog)
	, m_PaletteChanged(false)
{
	m_UI->setupUi(this);
	CHECKED_CONNECT(connect(m_UI->bTestConnection, SIGNAL(clicked()), this, SIGNAL(testConnection())));
	CHECKED_CONNECT(connect(m_UI->bDiscard, SIGNAL(clicked()), this, SLOT(reject())));

	const QVariantList prevHosts = GlobalSettingsManger::instance().
			value(GSK_PrevEnteredOllyHosts).toList();

	m_UI->cbOllyIP->clear();
	foreach(const QVariant& v, prevHosts)
	{
		const QString sv = v.toString().trimmed();
		if (sv.isEmpty())
			continue;
		m_UI->cbOllyIP->addItem(sv);
	}

	const QString currHostVal = QString::fromStdString(settings.host);
	int currHostIdx = m_UI->cbOllyIP->findText(currHostVal);
	if (currHostIdx == -1)
	{
		m_UI->cbOllyIP->insertItem(0, currHostVal);
	}
	m_UI->cbOllyIP->setCurrentIndex(m_UI->cbOllyIP->findText(currHostVal));

	m_UI->sbOllyPort->setValue(settings.port);
	m_UI->leRemoteModuleBase->setText(QString("0x%1").arg(settings.remoteModBase, sizeof(ea_t) * 2, 16, QChar('0')));
	m_UI->leRemoteModuleBase->setToolTip(QString("Current IDA DB's module base is 0x%1.").arg(currModBase, sizeof(ea_t) * 2, 16, QChar('0')));
	m_UI->gbEnabledSync->setChecked(settings.enabled);
	m_UI->chDemangleNames->setChecked(settings.demangle);
	m_UI->chLocalLabels->setChecked(settings.localLabels);
	m_UI->chPerformPEAnalysis->setChecked(settings.analysePEHeader);
	m_UI->chPostProcessFixCallJumps->setChecked(settings.postProcessFixCallJumps);
	m_UI->chNonCodeNames->setChecked(settings.nonCodeNames);
	m_UI->cbOverwriteWarning->setCurrentIndex(settings.overwriteWarning);
	m_UI->cbCommentsSync->setCurrentIndex(settings.commentsSync);

	QLabel* const lVer = new QLabel(m_UI->tabWidget);
	lVer->setText(QString("v %1").arg(LABELESS_VER_STR));
	lVer->setStyleSheet("color: rgb(0x8a, 0x8a, 0x8a);");
	QGraphicsDropShadowEffect* const effect = new QGraphicsDropShadowEffect(lVer);
	effect->setBlurRadius(5);
	effect->setOffset(0);
	effect->setColor(Qt::white);
	lVer->setGraphicsEffect(effect);
	m_UI->tabWidget->setCornerWidget(lVer);

	setUpPalette();
	setFixedSize(size());
	adjustSize();
	setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
}
Ejemplo n.º 12
0
unsigned long BT_HC06::findConnectedBaud()
{
	for (uint8_t i = 1; i < 12; i++)
	{
		HC06Serial.begin(ValidBauds[i]);
		if (testConnection()) return i;
	}

	return 0; //no HC-06 found
}
Ejemplo n.º 13
0
void MainWindow::delete_list() {
    if ( !testConnection() ) return;
    if ( QMessageBox::question(this, "Confirm", "Are you sure you want to delete this list?", QMessageBox::Ok, QMessageBox::Cancel) == QMessageBox::Cancel ) return;
    try {
        md->list_delete(md->fetch_list(selectedListID()));
        QMessageBox::information(this, "Deleted", "Record Deleted!");
        load_lists();
    } catch ( std::exception & e ) {
        QMessageBox::warning(this, "Failed!", e.what());
    }
}
Ejemplo n.º 14
0
void KexiDBConnectionDialog::init()
{
	connect( this, SIGNAL(user1Clicked()), this, SLOT(accept()));
	setMainWidget(tabWidget);
	connect(tabWidget->mainWidget, SIGNAL(saveChanges()), this, SIGNAL(saveChanges()));
	connect(tabWidget, SIGNAL(testConnection()), this, SIGNAL(testConnection()));

	adjustSize();
	resize(width(), tabWidget->height());
	if (tabWidget->mainWidget->connectionOnly())
		tabWidget->mainWidget->driversCombo()->setFocus();
	else if (tabWidget->mainWidget->nameCombo->currentText().isEmpty())
		tabWidget->mainWidget->nameCombo->setFocus();
	else if (tabWidget->mainWidget->userEdit->text().isEmpty())
		tabWidget->mainWidget->userEdit->setFocus();
	else if (tabWidget->mainWidget->passwordEdit->text().isEmpty())
		tabWidget->mainWidget->passwordEdit->setFocus();
	else //back
		tabWidget->mainWidget->nameCombo->setFocus();
}
void QstProtocol::setSocket( int socket )
{
    if (debug_on) {
        qDebug() << ( QString("%1 QstProtocol::setSocket(socket=%2)").
                            arg(uniqueId()).
                            arg(socket).toLatin1());
    }
    setSocketDescriptor( socket );

    rx_timer.start();
    testConnection();
}
Ejemplo n.º 16
0
void TrackerSettingsWidget::deserialize(const QDomNode *node)
{
    mProjectList->clear();
    QDomNode itemNode = node->namedItem("login");
    if (!itemNode.isNull())
    {
        QDomNode attr = itemNode.attributes().namedItem("value");
        if (!attr.isNull())
        {
            mLoginEdit->setText(attr.nodeValue());
        }
    }
    itemNode = node->namedItem("password");
    if (!itemNode.isNull())
    {
        QDomNode attr = itemNode.attributes().namedItem("value");
        if (!attr.isNull())
        {
            mPasswordEdit->setText(attr.nodeValue());
        }
    }
    itemNode = node->namedItem("endpoint");
    if (!itemNode.isNull())
    {
        QDomNode attr = itemNode.attributes().namedItem("value");
        if (!attr.isNull())
        {
            mUrlEdit->setText(attr.nodeValue());
        }
    }
    QDomNode projectsRootNode = node->namedItem("projects");
    if (!projectsRootNode.isNull())
    {
        QDomNodeList projects = projectsRootNode.childNodes();
        for (int i = 0; i < projects.size(); ++i)
        {
            QDomNode proj = projects.item(i);
            QDomNode nameAttr = proj.attributes().namedItem("name");
            QString name, shortName;
            if (!nameAttr.isNull())
            {
                name = nameAttr.nodeValue();
            }
            nameAttr = proj.attributes().namedItem("shortName");
            if (!nameAttr.isNull())
                shortName = nameAttr.nodeValue();
            if (!name.isEmpty() && !shortName.isEmpty())
                mProjectList->addItem(name, shortName);
        }
    }
    testConnection();
}
Ejemplo n.º 17
0
void MainWindow::save_list() {
    if ( !testConnection() ) return;
    Im633::list list = getFilledList();
    try {
        if ( md->list_update(list) == 0 ) {
            md->list_delete(list);
            md->list_insert(list);
        }
       QMessageBox::information(this, "Saved", "List Saved!");
       load_lists();
    } catch ( std::exception & e ) {
       QMessageBox::warning(this, "Failed!", e.what());
    }
}
Ejemplo n.º 18
0
void MainWindow::save_topic() {
    if ( !testConnection() ) return;
    Im633::topic topic = getFilledTopic();
    try {
        if ( md->topic_update(topic) == 0 ) {
            md->topic_delete(topic);
            md->topic_insert(topic);
        }
       QMessageBox::information(this, "Saved", "Topic Saved!");
       load_topics();
    } catch ( std::exception & e ) {
       QMessageBox::warning(this, "Failed!", e.what());
    }
}
Ejemplo n.º 19
0
void PlayerSetupDialog::setupUI()
{
    connect(ui->addPlayerBtn, SIGNAL(clicked()), this, SLOT(newPlayer()));
    connect(ui->removePlayerBtn, SIGNAL(clicked()), this, SLOT(removePlayer()));

    connect(ui->newSubviewBtn, SIGNAL(clicked()), this, SLOT(newSubview()));
    connect(ui->delSubviewBtn, SIGNAL(clicked()), this, SLOT(removeSubview()));

    connect(ui->testConnectionBtn, SIGNAL(clicked()), this, SLOT(testConnection()));
    connect(ui->connectBtn, SIGNAL(clicked()), this, SLOT(connectPlayer()));
    connect(ui->autoconnectBox, SIGNAL(toggled(bool)), this, SLOT(autoconBoxChanged(bool)));

    connect(ui->playerListview, SIGNAL(activated(const QModelIndex &)), this, SLOT(playerSelected(const QModelIndex &)));
    connect(ui->playerListview, SIGNAL(clicked(const QModelIndex &)),   this, SLOT(playerSelected(const QModelIndex &)));

    connect(ui->subviewListview, SIGNAL(activated(const QModelIndex &)), this, SLOT(subviewSelected(const QModelIndex &)));
    connect(ui->subviewListview, SIGNAL(clicked(const QModelIndex &)),   this, SLOT(subviewSelected(const QModelIndex &)));

    connect(ui->aphaMaskBrowseBtn, SIGNAL(clicked()), this, SLOT(alphamaskBrowse()));
    connect(ui->keyTLx, SIGNAL(valueChanged(int)), this, SLOT(subviewTopLeftXChanged(int)));
    connect(ui->keyTLy, SIGNAL(valueChanged(int)), this, SLOT(subviewTopLeftYChanged(int)));
    connect(ui->keyTRx, SIGNAL(valueChanged(int)), this, SLOT(subviewTopRightXChanged(int)));
    connect(ui->keyTRy, SIGNAL(valueChanged(int)), this, SLOT(subviewTopRightYChanged(int)));
    connect(ui->keyBLx, SIGNAL(valueChanged(int)), this, SLOT(subviewBottomLeftXChanged(int)));
    connect(ui->keyBLy, SIGNAL(valueChanged(int)), this, SLOT(subviewBottomLeftYChanged(int)));
    connect(ui->keyBRx, SIGNAL(valueChanged(int)), this, SLOT(subviewBottomRightXChanged(int)));
    connect(ui->keyBRy, SIGNAL(valueChanged(int)), this, SLOT(subviewBottomRightYChanged(int)));

    connect(ui->outputX, SIGNAL(valueChanged(int)), this, SLOT(screenXChanged(int)));
    connect(ui->outputY, SIGNAL(valueChanged(int)), this, SLOT(screenYChanged(int)));
    connect(ui->outputWidth, SIGNAL(valueChanged(int)), this, SLOT(screenWChanged(int)));
    connect(ui->outputHeight, SIGNAL(valueChanged(int)), this, SLOT(screenHChanged(int)));

    connect(ui->viewportX, SIGNAL(valueChanged(int)), this, SLOT(viewportXChanged(int)));
    connect(ui->viewportY, SIGNAL(valueChanged(int)), this, SLOT(viewportYChanged(int)));
    connect(ui->viewportWidth, SIGNAL(valueChanged(int)), this, SLOT(viewportWChanged(int)));
    connect(ui->viewportHeight, SIGNAL(valueChanged(int)), this, SLOT(viewportHChanged(int)));

    connect(ui->optIgnoreAR, SIGNAL(toggled(bool)), this, SLOT(ignoreArBoxChanged(bool)));

    connect(ui->aphaMaskBrowseBtn, SIGNAL(clicked()), this, SLOT(alphamaskBrowse()));
    connect(ui->alphaMaskFile, SIGNAL(textChanged(QString)), this, SLOT(showAlphaMaskPreview(QString)));

    connect(ui->brightnessResetBtn, SIGNAL(clicked()), this, SLOT(brightReset()));
    connect(ui->contrastResetBtn, SIGNAL(clicked()), this, SLOT(contReset()));
    connect(ui->hueResetBtn, SIGNAL(clicked()), this, SLOT(hueReset()));
    connect(ui->saturationResetBtn, SIGNAL(clicked()), this, SLOT(satReset()));
}
Ejemplo n.º 20
0
void MainWindow::load_lists() {
    if ( !testConnection() ) return;
    listModel->clear();
    listModel->setColumnCount(2);
    std::set<Im633::list> lists = md->fetch_list(md->fetch_topic(selectedTopicID()));

    listModel->setHeaderData(0, Qt::Horizontal, QObject::tr("List ID"));
    listModel->setHeaderData(1, Qt::Horizontal, QObject::tr("List Name"));
    for (auto it=lists.begin(); it != lists.end(); ++it) {
        listModel->insertRow(0);
        listModel->setData(listModel->index(0, 0), QString::number( (*it).get_id() ));
        listModel->setData(listModel->index(0, 1), QString::fromUtf8( (*it).get_list_name().c_str() ) );
    }
    ui->listTableView->setColumnWidth(0,80);
    ui->listTableView->setColumnWidth(1,250);
    ui->listTableView->setCurrentIndex(ui->listTableView->indexAt(QPoint(0,0)));
}
ConnectionSettingsDialog::ConnectionSettingsDialog(QWidget *parent_) :
  QDialog(parent_), m_ui(new Ui::ConnectionSettingsDialog)
{
  m_ui->setupUi(this);

  connect(m_ui->pushTestConnection, SIGNAL(clicked()), SLOT(testConnection()));
  connect(m_ui->buttonBox, SIGNAL(accepted()), SLOT(updateSettings()));

  QSettings settings;
  QString host = settings.value("clientServer/connectionSettings/hostName",
      defaultHost).toString();
  int port = settings.value("clientServer/connectionSettings/port", defaultPort)
      .toInt();

  m_ui->editHostName->setText(host);
  m_ui->spinPort->setValue(port);
}
Ejemplo n.º 22
0
void MainWindow::load_topics() {
    if ( !testConnection() ) return;
    topicModel->clear();
    topicModel->setColumnCount(2);
    std::set<Im633::topic> all_topics = md->fetch_topic();
    topicModel->setHeaderData(0, Qt::Horizontal, QObject::tr("Topic ID"));
    topicModel->setHeaderData(1, Qt::Horizontal, QObject::tr("Topic Name"));
    for (auto it=all_topics.begin(); it != all_topics.end(); ++it) {
        topicModel->insertRow(0);
        topicModel->setData(topicModel->index(0, 0), QString::number( (*it).get_id() ));
        topicModel->setData(topicModel->index(0, 1), QString::fromUtf8( (*it).get_topic_name().c_str() ) );
    }
    ui->topicTableView->setColumnWidth(0,80);
    ui->topicTableView->setColumnWidth(1,250);
    ui->topicTableView->setCurrentIndex(ui->topicTableView->indexAt(QPoint(0,0)));

    load_lists();//load the list as well
}
Ejemplo n.º 23
0
    /**
     * @brief Constructs dialog with specified connection
     */
    ConnectionDialog::ConnectionDialog(ConnectionSettings *connection) 
        : QDialog(),
        _connection(connection)
    {
        setWindowTitle("Connection Settings");
        setWindowIcon(GuiRegistry::instance().serverIcon());
        setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); // Remove help button (?)

        QPushButton *testButton = new QPushButton("&Test");
        testButton->setIcon(qApp->style()->standardIcon(QStyle::SP_MessageBoxInformation));
        VERIFY(connect(testButton, SIGNAL(clicked()), this, SLOT(testConnection())));

        QHBoxLayout *bottomLayout = new QHBoxLayout;
        bottomLayout->addWidget(testButton, 1, Qt::AlignLeft);
        QDialogButtonBox *buttonBox = new QDialogButtonBox(this);
        buttonBox->setOrientation(Qt::Horizontal);
        buttonBox->setStandardButtons(QDialogButtonBox::Cancel | QDialogButtonBox::Save);
        VERIFY(connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept())));
        VERIFY(connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject())));
        bottomLayout->addWidget(buttonBox);

        QTabWidget *tabWidget = new QTabWidget;
                
        _basicTab    = new ConnectionBasicTab(_connection);
        _authTab     = new ConnectionAuthTab(_connection);
        _advancedTab = new ConnectionAdvancedTab(_connection);
#ifdef SSH_SUPPORT_ENABLED
        _sshTab = new SshTunelTab(_connection);
#endif

        tabWidget->addTab(_basicTab,    "Connection");
        tabWidget->addTab(_authTab,     "Authentication");
        tabWidget->addTab(_advancedTab, "Advanced");
#ifdef SSH_SUPPORT_ENABLED
        tabWidget->addTab(_sshTab, "SSH Tunnel");
#endif

        QVBoxLayout *mainLayout = new QVBoxLayout;
        mainLayout->addWidget(tabWidget);
        mainLayout->addLayout(bottomLayout);
        setLayout(mainLayout);

        _basicTab->setFocus();
    }
int MainWindow::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QMainWindow::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: eventChanged((*reinterpret_cast< AGSEventType(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break;
        case 1: newFile(); break;
        case 2: openFile(); break;
        case 3: closeFile(); break;
        case 4: exportFile(); break;
        case 5: importToDatabase(); break;
        case 6: loadFile((*reinterpret_cast< QString(*)>(_a[1]))); break;
        case 7: openRecentFile(); break;
        case 8: showOptions(); break;
        case 9: updateTime(); break;
        case 10: lookupAGS_ID(); break;
        case 11: lookupPCC_ID(); break;
        case 12: lookupPCC_ID((*reinterpret_cast< QString(*)>(_a[1]))); break;
        case 13: setEventTypeID((*reinterpret_cast< QString(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break;
        case 14: setEvent((*reinterpret_cast< AGSEventType(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break;
        case 15: setLogoutTime(); break;
        case 16: setLogoutTime((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 17: setTShirtCalc((*reinterpret_cast< double(*)>(_a[1])),(*reinterpret_cast< bool(*)>(_a[2]))); break;
        case 18: setTimer((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2])),(*reinterpret_cast< int(*)>(_a[3]))); break;
        case 19: setTimer((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break;
        case 20: boo(); break;
        case 21: showError((*reinterpret_cast< QString(*)>(_a[1]))); break;
        case 22: login(); break;
        case 23: logout(); break;
        case 24: about(); break;
        case 25: tutorial(); break;
        case 26: reportABug(); break;
        case 27: testConnection(); break;
        case 28: { QString _r = generateHeader();
            if (_a[0]) *reinterpret_cast< QString*>(_a[0]) = _r; }  break;
        case 29: rewriteHeader(); break;
        default: ;
        }
        _id -= 30;
    }
    return _id;
}
Ejemplo n.º 25
0
bool PDOPgSqlConnection::transactionCommand(const char* command){
  testConnection();

  PQ::Result res = m_server->exec(command);

  if(!res){
    // I think this error should be handled in a different way perhaps?
    handleError(nullptr, "XX000", "Invalid result data");
    return -1;
  }

  ExecStatusType status = m_lastExec = res.status();

  if(status == PGRES_COMMAND_OK){
    return true;
  }

  HANDLE_ERROR(nullptr, res);
  return false;
}
Ejemplo n.º 26
0
void MT500::on_delButton_clicked()
{
    QFile file(ipConfig);
    if (file.open(QIODevice::WriteOnly | QIODevice::Text))
    {
        QTextStream out(&file);
        out << "File format:\n\n";
        out << "[IP ADDRESS]    [PORT]  [TYPE OF DATA]\n\n";
        out << "[IP ADDRESS] --- Destination IP in the form of xxx.xxx.xxx.xxx\n[PORT] --- Destination port\n[TYPE OF DATA] --- Options: RAW or PROC or BASE\n\n------DO NOT MODIFY ANYTHING ABOVE THIS LINE---------\n";
        for(int i = 0; i < 6; i++) {
            if(!ipArray[i].ip.isEmpty() && ipArray[i].ip != ui->delSelect->currentText().trimmed()) {
                out << ipArray[i].ip + "\t" + QString::number(ipArray[i].port) + "\t" + ipArray[i].dataType + "\n";
            }
        }
    }
    file.close();
    ui->delLabel->setText("<font color=red>Port Deleted</font>");
    getIPs();
    initial = true;
    testConnection();
}
Ejemplo n.º 27
0
/** Power on and prepare for general usage.
 * This will activate the device and take it out of sleep mode (which must be done
 * after start-up). This function also sets both the accelerometer and the gyroscope
 * to their most sensitive settings, namely +/- 2g and +/- 250 degrees/sec, and sets
 * the clock source to use the X Gyro for reference, which is slightly better than
 * the default internal clock source.
 */
PUBLIC void initializeLSM6DS0(bool useAccel, bool useGyro) {
	xAccelOffset = yAccelOffset = zAccelOffset = 0;
	xGyroOffset = yGyroOffset = zGyroOffset = 0;

	gyroEnabled = useGyro;
	accelEnabled = useAccel;

	if(gyroEnabled)
	{
		gScale = GYRO_FS_245DSP;
		calcGyroRes();
	}

	if(accelEnabled)
	{
		aScale = ACC_FS_2G;
		calcAccelRes();
	}

	if(testConnection())
	{
		resetLSM6DS0();

		if(accelEnabled)
		{
			initAccel();
			setFullScaleAccelRange(aScale);
			setAccelODR(ACC_ODR_119Hz);
		}

		if(gyroEnabled)
		{
			initGyro();
			setFullScaleGyroRange(gScale);
			setGyroODR(GYRO_ODR_119Hz_CO_14Hz);
		}

		calibrateLSM6DS0(gbias,abias);
	}
}
Ejemplo n.º 28
0
void MT500::on_addButton_clicked()
{
    QString ip = ui->ipLineEdit->text().trimmed();
    QString port = ui->portLineEdit->text().trimmed();
    QString dataType = ui->dataSelect->currentText().trimmed();
    if(dataType == "Processed") dataType = "PROC";
    else if(dataType == "Base Station") dataType = "BASE";
    else if(dataType == "Raw") dataType = "RAW";;
    QFile file(ipConfig);
    if (file.open(QIODevice::Append | QIODevice::Text))
    {
        QTextStream out(&file);
        out << ip << "\t" << port << "\t" << dataType << "\n";
    }
    ui->addLabel->setText("<font color=red>Port Added</font>");
    ui->ipLineEdit->clear();
    ui->portLineEdit->clear();
    ui->dataSelect->setItemText(0,"Raw");
    getIPs();
    initial = true;
    testConnection();
}
Ejemplo n.º 29
0
void QgsPgNewConnection::btnConnect_clicked()
{
  testConnection();
}
Ejemplo n.º 30
0
void QgsNewOgrConnection::on_btnConnect_clicked()
{
  testConnection();
}