void Application::setHost(QString host)
{
    if (m_host == host)
        return;
    m_host = host;
    emit hostChanged(host);
}
Esempio n. 2
0
void IRCClient::ready(){
    emit hostChanged(socket.peerName(), true);
    if(!this->auth.isEmpty())
        socket.write(("PASS " + this->auth + "\r\n").toUtf8());
    socket.write(("NICK " + this->nickname + "\r\n").toUtf8());
    socket.write(("USER " + this->nickname + " 0 * :" + this->nickname + "\r\n").toUtf8());
}
Esempio n. 3
0
bool ProxyManager::load()
{
    if(!QFile::exists(this->_proxyfile))
        return false;

    QFile file(this->_proxyfile);

    if(!file.open(QFile::ReadOnly))
        return false;

    bool res = false;
    QStringList settings = QString::fromUtf8(file.readAll()).simplified().split(":");

    if(settings.length() == 2)
    {
        this->_host = settings.first();
        this->_port = settings.last().toInt();

        emit hostChanged();
        emit portChanged();

        res = true;
    }

    file.close();
    return res;
}
Esempio n. 4
0
void ProxyManager::setHost(const QString &host)
{
    if(this->_host == host)
        return;

    this->_host = host;
    emit hostChanged();
}
Esempio n. 5
0
void RegionModel::setHost(StreetList *host)
{
	if (mHost == host)
		return;

	mHost = host;
	init();
	emit hostChanged(host);
}
void ProxySettings::setHost(const QString& value)
{
	QSettings s;
	s.beginGroup(group);
	s.setValue("proxy_host", value);
	free(prefs.proxy_host);
	prefs.proxy_host = copy_string(qPrintable(value));;
	emit hostChanged(value);
}
Esempio n. 7
0
void AddressManager::setHost(const QString& host, LookupTrigger trigger) {
    if (host != _host) {

        // if the host is being changed we should store current address in the history
        addCurrentAddressToHistory(trigger);

        _host = host;
        emit hostChanged(_host);
    }
}
RemoteCaptureDialog::RemoteCaptureDialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::RemoteCaptureDialog)
{
    ui->setupUi(this);

    fillComboBox();
    connect(ui->buttonBox, SIGNAL(accepted()), this, SLOT(apply_remote()));
    connect(this, SIGNAL(remoteAdded(GList *, remote_options*)), parent, SIGNAL(remoteAdded(GList *, remote_options*)));
    connect(ui->hostCombo, SIGNAL(currentIndexChanged(QString)), this, SLOT(hostChanged(QString)));
}
Esempio n. 9
0
void IrcSession::setHost(const QString& host)
{
    Q_D(IrcSession);
    if (isActive())
        qWarning("IrcSession::setHost() has no effect until re-connect");
    if (d->host != host)
    {
        d->host = host;
        emit hostChanged(host);
    }
}
void QQmlWebSocketServer::setHost(const QString &host)
{
    if (host == m_host) {
        return;
    }

    m_host = host;
    emit hostChanged(host);
    emit urlChanged(url());

    updateListening();
}
Esempio n. 11
0
MQTT::MQTT(QObject *parent) :
    QObject(parent)
{
    // re-initialize connection whenever the
    // host or the port changes
    QObject::connect(this, SIGNAL(hostChanged(QString)),
            this, SLOT(initializeConnection()));
    QObject::connect(this, SIGNAL(portChanged(int)),
            this, SLOT(initializeConnection()));
    qDebug()<<"Rahr: testing";
    numberOfData =0;
    udpSocket = new QUdpSocket(this);
    udpSocket->bind(3000, QUdpSocket::ShareAddress);

    QObject::connect(udpSocket, SIGNAL(readyRead()),
            this, SLOT(processPendingDatagrams()));
}
Esempio n. 12
0
bool AddressManager::setHost(const QString& host, LookupTrigger trigger, quint16 port) {
    if (host != _host || port != _port) {
        
        addCurrentAddressToHistory(trigger);

        _port = port;

        if (host != _host) {
            _host = host;
            emit hostChanged(_host);
        }

        return true;
    }

    return false;
}
Esempio n. 13
0
bool KHost::ReadConfig()
{
	KConfig *config = ((KConnection*) topLevelWidget())->GetConfig();
	QStrList List;
	const char *Value;
	int i;

	if (config == NULL)
		return FALSE;

	config->setGroup(KI_SEC_HOSTS);

	config->readListEntry(KI_ENT_HOSTS,List);
	hostCombo->insertStrList(&List);

	List.clear();

	config->readListEntry(KI_ENT_PORTS,List);
	portCombo->insertStrList(&List);

	Value = config->readEntry(KI_ENT_LAST_HOST);

	if (Value != NULL && *Value != '\0')
		for (i = 0; i < hostCombo->count(); i++)
			if (!strcmp(Value,hostCombo->text(i)))
			{
				hostCombo->setCurrentItem(i);
				break;
			}

	Value = config->readEntry(KI_ENT_LAST_PORT);

	if (Value != NULL && *Value != '\0')
		for (i = 0; i < portCombo->count(); i++)
			if (!strcmp(Value,portCombo->text(i)))
			{
				portCombo->setCurrentItem(i);
				break;
			}

	hostChanged(0);
	portChanged(0);

	return TRUE;
}
Esempio n. 14
0
bool KHost::WriteConfig()
{
	KConfig *config = ((KConnection*) topLevelWidget())->GetConfig();
	QStrList List;
	const char *Value;
	int i;

	if (config == NULL)
		return FALSE;

	hostChanged(0);
	portChanged(0);

	config->setGroup(KI_SEC_HOSTS);

	if ((Value = hostCombo->currentText()) != NULL && *Value != '\0' && List.find(Value) == -1)
		List.append(Value);

	for (i = 0; i < hostCombo->count(); i++)
		if (List.find(hostCombo->text(i)) == -1)
			List.append(hostCombo->text(i));

	config->writeEntry(KI_ENT_HOSTS,List);
	List.clear();

	if ((Value = portCombo->currentText()) != NULL && *Value != '\0' && List.find(Value) == -1)
		List.append(Value);

	for (i = 0; i < portCombo->count(); i++)
		if (List.find(portCombo->text(i)) == -1)
			List.append(portCombo->text(i));

	config->writeEntry(KI_ENT_PORTS,List);

	config->writeEntry(KI_ENT_LAST_HOST,hostCombo->currentText());
	config->writeEntry(KI_ENT_LAST_PORT,portCombo->currentText());

	return TRUE;
}
Esempio n. 15
0
SessionItem::SessionItem(Session* session) : AbstractSessionItem(session), m_closing(false)
{
    setTitle(session->host());
    setSubtitle(session->nickName());

    connect(session, SIGNAL(hostChanged(QString)), this, SLOT(setTitle(QString)));
    connect(session, SIGNAL(nickNameChanged(QString)), this, SLOT(setSubtitle(QString)));

    connect(session, SIGNAL(socketError(QAbstractSocket::SocketError)), this, SLOT(updateState()));
    connect(session, SIGNAL(connectedChanged(bool)), this, SLOT(updateState()));
    connect(session, SIGNAL(activeChanged(bool)), this, SLOT(updateState()));

    setSession(session);
    m_handler.setSession(session);
    m_handler.setDefaultReceiver(this);
    m_handler.setCurrentReceiver(this);
    connect(&m_handler, SIGNAL(receiverToBeAdded(QString)), SLOT(addChild(QString)));
    connect(&m_handler, SIGNAL(receiverToBeRenamed(QString,QString)), SLOT(renameChild(QString,QString)));
    connect(&m_handler, SIGNAL(receiverToBeRemoved(QString)), SLOT(removeChild(QString)));

    updateCurrent(this);
    updateState();
}
Esempio n. 16
0
void Configure::slotHostChanged(int selection) {
    emit hostChanged(widget.hostComboBox->currentText());
}
Esempio n. 17
0
void BirthdayParty::setHost(Person *c)
{
    if (c == m_host) return;
    m_host = c;
    emit hostChanged();
}
Esempio n. 18
0
void WampRouter::setHost(QString value)
{
    Q_D(WampRouter);
    d->_host = value;
    Q_EMIT hostChanged();
}
Esempio n. 19
0
SettingsDialog::SettingsDialog(QWidget *parent) : QDialog(parent) {

  okButton = new QPushButton(tr("&OK"));
  connect(okButton, SIGNAL(clicked()), this, SLOT(okButtonClicked()));
  okButton->setEnabled(false);
  cancelButton = new QPushButton(tr("&Cancel"));
  connect(cancelButton, SIGNAL(clicked()), this, SLOT(cancelButtonClicked()));

  host = "";
  port = "";
  url  = "";
  autoRefresh = Qt::Unchecked;
  interval = 3;

  hostLineEdit = new QLineEdit();
  hostLineEdit->setText(host);
  connect(hostLineEdit, SIGNAL(textChanged(QString)), this, SLOT(hostChanged(QString)));
  portLineEdit = new QLineEdit();
  portLineEdit->setText(port);
  connect(portLineEdit, SIGNAL(textChanged(QString)), this, SLOT(portChanged(QString)));
  urlLineEdit  = new QLineEdit();
  urlLineEdit->setText(url);
  connect(urlLineEdit, SIGNAL(textChanged(QString)), this, SLOT(urlChanged(QString)));
  intervalSpinBox = new QSpinBox();
  intervalSpinBox->setMaximum(600);
  intervalSpinBox->setMinimum(3);
  intervalSpinBox->setValue(interval);
  intervalSpinBox->setEnabled(false);
  connect(intervalSpinBox, SIGNAL(valueChanged(int)), this, SLOT(intervalChanged(int)));
  autoRefreshCheckBox = new QCheckBox();
  autoRefreshCheckBox->setCheckState(autoRefresh); 
  connect(autoRefreshCheckBox, SIGNAL(stateChanged(int)), this, SLOT(autoRefreshChanged(int)));
  

  hostLabel = new QLabel(tr("Host name: "));
  hostLabel->setBuddy(hostLineEdit);
  portLabel = new QLabel(tr("Port: "));
  portLabel->setBuddy(portLineEdit);
  urlLabel  = new QLabel(tr("URL: "));
  urlLabel->setBuddy(urlLineEdit);
  intervalLabel = new QLabel(tr("Interval: "));
  intervalLabel->setBuddy(intervalSpinBox);
  autoRefreshLabel = new QLabel(tr("Auto Refresh: "));
  autoRefreshLabel->setBuddy(autoRefreshCheckBox);


  //Layouts
  QHBoxLayout *buttonsLayout = new QHBoxLayout();
  buttonsLayout->addWidget(okButton);
  buttonsLayout->addWidget(cancelButton);

  QHBoxLayout *hostLayout = new QHBoxLayout();
  hostLayout->addWidget(hostLabel);
  hostLayout->addWidget(hostLineEdit);

  QHBoxLayout *portLayout = new QHBoxLayout();
  portLayout->addWidget(portLabel);
  portLayout->addWidget(portLineEdit);

  QHBoxLayout *urlLayout = new QHBoxLayout();
  urlLayout->addWidget(urlLabel);
  urlLayout->addWidget(urlLineEdit);

  QHBoxLayout *autoRefreshLayout = new QHBoxLayout();
  autoRefreshLayout->addWidget(autoRefreshLabel);
  autoRefreshLayout->addWidget(autoRefreshCheckBox);

  QHBoxLayout *intervalLayout = new QHBoxLayout();
  intervalLayout->addWidget(intervalLabel);
  intervalLayout->addWidget(intervalSpinBox);

  QVBoxLayout *itemsLayout = new QVBoxLayout();
  itemsLayout->addLayout(hostLayout);
  itemsLayout->addLayout(portLayout);
  itemsLayout->addLayout(urlLayout);
  itemsLayout->addLayout(autoRefreshLayout);
  itemsLayout->addLayout(intervalLayout);
  
  QVBoxLayout *mainLayout = new QVBoxLayout();
  mainLayout->addLayout(itemsLayout);
  mainLayout->addLayout(buttonsLayout);

  setLayout(mainLayout);
};
Esempio n. 20
0
UI::UI() {
    widget.setupUi(this);

    widget.gridLayout->setContentsMargins(2,2,2,2);
    widget.gridLayout->setVerticalSpacing(0);

    // connect up all the menus
    connect(widget.actionAbout,SIGNAL(triggered()),this,SLOT(actionAbout()));
    connect(widget.actionConnectToServer,SIGNAL(triggered()),this,SLOT(actionConnect()));
    connect(widget.actionDisconnectFromServer,SIGNAL(triggered()),this,SLOT(actionDisconnect()));

    connect(widget.actionSubrx,SIGNAL(triggered()),this,SLOT(actionSubRx()));
    connect(widget.actionBandscope,SIGNAL(triggered()),this,SLOT(actionBandscope()));
    connect(widget.actionRecord,SIGNAL(triggered()),this,SLOT(actionRecord()));

    connect(&connection,SIGNAL(isConnected()),this,SLOT(connected()));
    connect(&connection,SIGNAL(disconnected(QString)),this,SLOT(disconnected(QString)));
    connect(&connection,SIGNAL(audioBuffer(char*,char*)),this,SLOT(audioBuffer(char*,char*)));
    connect(&connection,SIGNAL(spectrumBuffer(char*,char*)),this,SLOT(spectrumBuffer(char*,char*)));

    connect(widget.actionConfig,SIGNAL(triggered()),this,SLOT(actionConfigure()));

    connect(widget.actionMuteMainRx,SIGNAL(triggered()),this,SLOT(actionMuteMainRx()));
    connect(widget.actionMuteSubRx,SIGNAL(triggered()),this,SLOT(actionMuteSubRx()));

    connect(widget.actionGain_10,SIGNAL(triggered()),this,SLOT(actionGain_10()));
    connect(widget.actionGain_20,SIGNAL(triggered()),this,SLOT(actionGain_20()));
    connect(widget.actionGain_30,SIGNAL(triggered()),this,SLOT(actionGain_30()));
    connect(widget.actionGain_40,SIGNAL(triggered()),this,SLOT(actionGain_40()));
    connect(widget.actionGain_50,SIGNAL(triggered()),this,SLOT(actionGain_50()));
    connect(widget.actionGain_60,SIGNAL(triggered()),this,SLOT(actionGain_60()));
    connect(widget.actionGain_70,SIGNAL(triggered()),this,SLOT(actionGain_70()));
    connect(widget.actionGain_80,SIGNAL(triggered()),this,SLOT(actionGain_80()));
    connect(widget.actionGain_90,SIGNAL(triggered()),this,SLOT(actionGain_90()));
    connect(widget.actionGain_100,SIGNAL(triggered()),this,SLOT(actionGain_100()));

    connect(widget.actionKeypad, SIGNAL(triggered()),this,SLOT(actionKeypad()));
    connect(&keypad,SIGNAL(setKeypadFrequency(long long)),this,SLOT(setKeypadFrequency(long long)));

    connect(widget.action160, SIGNAL(triggered()),this,SLOT(action160()));
    connect(widget.action80, SIGNAL(triggered()),this,SLOT(action80()));
    connect(widget.action60, SIGNAL(triggered()),this,SLOT(action60()));
    connect(widget.action40, SIGNAL(triggered()),this,SLOT(action40()));
    connect(widget.action30, SIGNAL(triggered()),this,SLOT(action30()));
    connect(widget.action20, SIGNAL(triggered()),this,SLOT(action20()));
    connect(widget.action17, SIGNAL(triggered()),this,SLOT(action17()));
    connect(widget.action15, SIGNAL(triggered()),this,SLOT(action15()));
    connect(widget.action12, SIGNAL(triggered()),this,SLOT(action12()));
    connect(widget.action10, SIGNAL(triggered()),this,SLOT(action10()));
    connect(widget.action6, SIGNAL(triggered()),this,SLOT(action6()));
    connect(widget.actionGen, SIGNAL(triggered()),this,SLOT(actionGen()));
    connect(widget.actionWWV, SIGNAL(triggered()),this,SLOT(actionWWV()));

    connect(widget.actionCWL,SIGNAL(triggered()),this,SLOT(actionCWL()));
    connect(widget.actionCWU,SIGNAL(triggered()),this,SLOT(actionCWU()));
    connect(widget.actionLSB,SIGNAL(triggered()),this,SLOT(actionLSB()));
    connect(widget.actionUSB,SIGNAL(triggered()),this,SLOT(actionUSB()));
    connect(widget.actionDSB,SIGNAL(triggered()),this,SLOT(actionDSB()));
    connect(widget.actionAM,SIGNAL(triggered()),this,SLOT(actionAM()));
    connect(widget.actionSAM,SIGNAL(triggered()),this,SLOT(actionSAM()));
    connect(widget.actionFMN,SIGNAL(triggered()),this,SLOT(actionFMN()));
    connect(widget.actionDIGL,SIGNAL(triggered()),this,SLOT(actionDIGL()));
    connect(widget.actionDIGU,SIGNAL(triggered()),this,SLOT(actionDIGU()));

    connect(widget.actionFilter_0,SIGNAL(triggered()),this,SLOT(actionFilter0()));
    connect(widget.actionFilter_1,SIGNAL(triggered()),this,SLOT(actionFilter1()));
    connect(widget.actionFilter_2,SIGNAL(triggered()),this,SLOT(actionFilter2()));
    connect(widget.actionFilter_3,SIGNAL(triggered()),this,SLOT(actionFilter3()));
    connect(widget.actionFilter_4,SIGNAL(triggered()),this,SLOT(actionFilter4()));
    connect(widget.actionFilter_5,SIGNAL(triggered()),this,SLOT(actionFilter5()));
    connect(widget.actionFilter_6,SIGNAL(triggered()),this,SLOT(actionFilter6()));
    connect(widget.actionFilter_7,SIGNAL(triggered()),this,SLOT(actionFilter7()));
    connect(widget.actionFilter_8,SIGNAL(triggered()),this,SLOT(actionFilter8()));
    connect(widget.actionFilter_9,SIGNAL(triggered()),this,SLOT(actionFilter9()));

    connect(widget.actionANF,SIGNAL(triggered()),this,SLOT(actionANF()));
    connect(widget.actionNR,SIGNAL(triggered()),this,SLOT(actionNR()));
    connect(widget.actionNB,SIGNAL(triggered()),this,SLOT(actionNB()));
    connect(widget.actionSDROM,SIGNAL(triggered()),this,SLOT(actionSDROM()));

    connect(widget.actionPolyphase,SIGNAL(triggered()),this,SLOT(actionPolyphase()));

    connect(widget.actionLong,SIGNAL(triggered()),this,SLOT(actionLong()));
    connect(widget.actionSlow,SIGNAL(triggered()),this,SLOT(actionSlow()));
    connect(widget.actionMedium,SIGNAL(triggered()),this,SLOT(actionMedium()));
    connect(widget.actionFast,SIGNAL(triggered()),this,SLOT(actionFast()));


    connect(widget.actionPreamp,SIGNAL(triggered()),this,SLOT(actionPreamp()));

    connect(widget.actionBookmarkThisFrequency,SIGNAL(triggered()),this,SLOT(actionBookmark()));
    connect(widget.actionEditBookmarks,SIGNAL(triggered()),this,SLOT(editBookmarks()));



    // connect up band and frequency changes
    connect(&band,SIGNAL(bandChanged(int,int)),this,SLOT(bandChanged(int,int)));
//    connect(&band,SIGNAL(frequencyChanged(long long)),this,SLOT(frequencyChanged(long long)));

    // connect up mode changes
    connect(&mode,SIGNAL(modeChanged(int,int)),this,SLOT(modeChanged(int,int)));

    // connect up filter changes
    connect(&filters,SIGNAL(filtersChanged(FiltersBase*,FiltersBase*)),this,SLOT(filtersChanged(FiltersBase*,FiltersBase*)));
    connect(&filters,SIGNAL(filterChanged(int,int)),this,SLOT(filterChanged(int,int)));

    // connect up spectrum frame
    connect(widget.spectrumFrame, SIGNAL(frequencyMoved(int,int)),
            this, SLOT(frequencyMoved(int,int)));
    connect(widget.spectrumFrame, SIGNAL(frequencyChanged(long long)),
            this, SLOT(frequencyChanged(long long)));
    connect(widget.spectrumFrame, SIGNAL(spectrumHighChanged(int)),
            this,SLOT(spectrumHighChanged(int)));
    connect(widget.spectrumFrame, SIGNAL(spectrumLowChanged(int)),
            this,SLOT(spectrumLowChanged(int)));
    connect(widget.spectrumFrame, SIGNAL(waterfallHighChanged(int)),
            this,SLOT(waterfallHighChanged(int)));
    connect(widget.spectrumFrame, SIGNAL(waterfallLowChanged(int)),
            this,SLOT(waterfallLowChanged(int)));

    // connect up waterfall frame
    connect(widget.waterfallFrame, SIGNAL(frequencyMoved(int,int)),
            this, SLOT(frequencyMoved(int,int)));

    // connect up configuration changes
    connect(&configure,SIGNAL(spectrumHighChanged(int)),this,SLOT(spectrumHighChanged(int)));
    connect(&configure,SIGNAL(spectrumLowChanged(int)),this,SLOT(spectrumLowChanged(int)));
    connect(&configure,SIGNAL(fpsChanged(int)),this,SLOT(fpsChanged(int)));
    connect(&configure,SIGNAL(waterfallHighChanged(int)),this,SLOT(waterfallHighChanged(int)));
    connect(&configure,SIGNAL(waterfallLowChanged(int)),this,SLOT(waterfallLowChanged(int)));
    connect(&configure,SIGNAL(waterfallAutomaticChanged(bool)),this,SLOT(waterfallAutomaticChanged(bool)));

    configure.initAudioDevices(&audio);
    connect(&configure,SIGNAL(audioDeviceChanged(QAudioDeviceInfo,int,int,QAudioFormat::Endian)),this,SLOT(audioDeviceChanged(QAudioDeviceInfo,int,int,QAudioFormat::Endian)));

    connect(&configure,SIGNAL(hostChanged(QString)),this,SLOT(hostChanged(QString)));
    connect(&configure,SIGNAL(receiverChanged(int)),this,SLOT(receiverChanged(int)));

    connect(&configure,SIGNAL(nrValuesChanged(int,int,double,double)),this,SLOT(nrValuesChanged(int,int,double,double)));
    connect(&configure,SIGNAL(anfValuesChanged(int,int,double,double)),this,SLOT(anfValuesChanged(int,int,double,double)));
    connect(&configure,SIGNAL(nbThresholdChanged(double)),this,SLOT(nbThresholdChanged(double)));
    connect(&configure,SIGNAL(sdromThresholdChanged(double)),this,SLOT(sdromThresholdChanged(double)));

    connect(&bookmarks,SIGNAL(bookmarkSelected(QAction*)),this,SLOT(selectBookmark(QAction*)));
    connect(&bookmarkDialog,SIGNAL(accepted()),this,SLOT(addBookmark()));

    connect(&configure,SIGNAL(addXVTR(QString,long long,long long,long long,long long,int,int)),this,SLOT(addXVTR(QString,long long,long long,long long,long long,int,int)));
    connect(&configure,SIGNAL(deleteXVTR(int)),this,SLOT(deleteXVTR(int)));


    connect(&xvtr,SIGNAL(xvtrSelected(QAction*)),this,SLOT(selectXVTR(QAction*)));


    bandscope=NULL;

    fps=15;
    gain=100;
    subRx=FALSE;
    subRxGain=100;
    agc=AGC_SLOW;
    cwPitch=600;

    audio_device=0;
    audio_sample_rate=configure.getSampleRate();
    audio_channels=configure.getChannels();
    audio_byte_order=configure.getByteOrder();
    audio.initialize_audio(AUDIO_BUFFER_SIZE);

    // load any saved settings
    loadSettings();
    switch(agc) {
        case AGC_SLOW:
            widget.actionSlow->setChecked(TRUE);
            break;
        case AGC_MEDIUM:
            widget.actionMedium->setChecked(TRUE);
            break;
        case AGC_FAST:
            widget.actionFast->setChecked(TRUE);
            break;
        case AGC_LONG:
            widget.actionLong->setChecked(TRUE);
            break;
    }

    fps=configure.getFps();

    configure.updateXvtrList(&xvtr);
    xvtr.buildMenu(widget.menuXVTR);

    widget.spectrumFrame->setHost(configure.getHost());
    widget.spectrumFrame->setReceiver(configure.getReceiver());

    widget.actionSubrx->setDisabled(TRUE);
    widget.actionMuteSubRx->setDisabled(TRUE);

    band.initBand(band.getBand());
    
}