Exemplo n.º 1
0
TvChannelModel::TvChannelModel(TvChannelList *channelList, QObject *parent)
    : QAbstractItemModel(parent)
    , m_channelList(channelList)
{
    connect(channelList, SIGNAL(channelsChanged()),
            this, SLOT(channelsChanged()));
    connect(channelList, SIGNAL(hiddenChannelsChanged()),
            this, SLOT(channelsChanged()));
    connect(channelList, SIGNAL(channelIconsChanged()),
            this, SLOT(channelIconsChanged()));
    connect(channelList, SIGNAL(groupsChanged()),
            this, SLOT(channelsChanged()));
    loadVisibleChannels();
}
Exemplo n.º 2
0
void IrcClient::createBufferList()
{
    bufferModel = new IrcBufferModel(connection);
    connect(bufferModel, SIGNAL(added(IrcBuffer*)), this, SLOT(onBufferAdded(IrcBuffer*)));
    connect(bufferModel, SIGNAL(removed(IrcBuffer*)), this, SLOT(onBufferRemoved(IrcBuffer*)));

    bufferList = new QListView(this);
    bufferList->setFocusPolicy(Qt::NoFocus);
    bufferList->setModel(bufferModel);

    // keep the command parser aware of the context
    connect(bufferModel, SIGNAL(channelsChanged(QStringList)), parser, SLOT(setChannels(QStringList)));

    // keep track of the current buffer, see also onBufferActivated()
    connect(bufferList->selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)), this, SLOT(onBufferActivated(QModelIndex)));

    // create a server buffer for non-targeted messages...
    IrcBuffer* serverBuffer = bufferModel->add(connection->host());

    // ...and connect it to IrcBufferModel::messageIgnored()
    connect(bufferModel, SIGNAL(messageIgnored(IrcMessage*)), serverBuffer, SLOT(receiveMessage(IrcMessage*)));

    insertWidget(0, bufferList);

    setStretchFactor(0, 1);
    setStretchFactor(1, 3);
}
Exemplo n.º 3
0
	void after_connected()
	{
		// when retrying, pool will be non-null because we reuse it
		if(!udp && !pool)
		{
			pool = new StunTransactionPool(StunTransaction::Tcp, this);
			connect(pool, SIGNAL(outgoingMessage(const QByteArray &, const QHostAddress &, int)), SLOT(pool_outgoingMessage(const QByteArray &, const QHostAddress &, int)));
			connect(pool, SIGNAL(needAuthParams()), SLOT(pool_needAuthParams()));

			pool->setLongTermAuthEnabled(true);
			if(!user.isEmpty())
			{
				pool->setUsername(user);
				pool->setPassword(pass);
				if(!realm.isEmpty())
					pool->setRealm(realm);
			}
		}

		allocate = new StunAllocate(pool);
		connect(allocate, SIGNAL(started()), SLOT(allocate_started()));
		connect(allocate, SIGNAL(stopped()), SLOT(allocate_stopped()));
		connect(allocate, SIGNAL(error(XMPP::StunAllocate::Error)), SLOT(allocate_error(XMPP::StunAllocate::Error)));
		connect(allocate, SIGNAL(permissionsChanged()), SLOT(allocate_permissionsChanged()));
		connect(allocate, SIGNAL(channelsChanged()), SLOT(allocate_channelsChanged()));

		allocate->setClientSoftwareNameAndVersion(clientSoftware);

		allocateStarted = false;
		emit q->debugLine("Allocating...");
		allocate->start();
	}
Exemplo n.º 4
0
void GData::removeFileFromList(SoundFile *s)
{
  int j;
  int curPos;
  int prevPos;  
  //remove all the channels in s from the channels list
  for(j=0; j<s->numChannels(); j++) {
    Channel *c = s->channels(j);
    //if(c == getActiveChannel()) { setActiveChannel(NULL); }
    curPos = prevPos = 0;
    for(std::vector<Channel*>::iterator it1=channels.begin(); it1 != channels.end(); it1++, curPos++) {
      if((*it1) == c) {
        if(c == getActiveChannel()) prevPos = curPos;
        it1 = channels.erase(it1) - 1;
      }
    }
    if(channels.empty()) setActiveChannel(NULL);
    else setActiveChannel(channels.at(bound(prevPos, 0, int(channels.size()-1))));
  }
  //remove the soundFile from the soundFiles list
  for(std::vector<SoundFile*>::iterator it2=soundFiles.begin(); it2 != soundFiles.end(); it2++) {
    if((*it2) == s) {
      it2 = soundFiles.erase(it2) - 1;
    }
  }
  emit channelsChanged();
  //view->doSlowUpdate();
}
Exemplo n.º 5
0
qutim_sdk_0_3::ChatSession *Chat::getSession(qutim_sdk_0_3::ChatUnit *unit, bool create)
{
    // TODO: Think, is it good idea or we need smth more intellegent?
    if (ChatUnit *meta = unit->metaContact())
        unit = meta;

    unit = getUnitForSession(unit);

    if (!unit)
        return nullptr;

	// We don't wont to have separate channels for contact and his resource
	unit = const_cast<ChatUnit*>(unit->getHistoryUnit());
	foreach (ChatChannel *channel, m_channels) {
		if (channel->unit() == unit)
			return channel;
	}
	ChatChannel *channel = 0;
    if (create) {
        m_view.show();

        channel = new ChatChannel(unit);
        QQmlEngine::setObjectOwnership(channel, QQmlEngine::CppOwnership);
        QQmlEngine::setObjectOwnership(unit, QQmlEngine::CppOwnership);
		connect(channel, SIGNAL(activated(bool)), SLOT(onSessionActivated(bool)));
		connect(channel, SIGNAL(destroyed(QObject*)), SLOT(onSessionDestroyed(QObject*)));
		m_channels << channel;
		emit channelsChanged(channels());
		emit sessionCreated(channel);
	}
	return channel;
}
Exemplo n.º 6
0
// Executes the Channel Manager
void ktvschedule::channelList()
{
	channellist *channels = new channellist(this);
	connect (channels, SIGNAL ( channelsChanged() ), this, SLOT ( doNewSorting() ) );
	channels->setChannelMap(Channels);
	channels->show();
}
Exemplo n.º 7
0
static void unbind(IrcBuffer* buffer, IrcCommandParser* parser)
{
    if (buffer && parser) {
        IrcBufferModel* model = buffer->model();
        QObject::disconnect(model, SIGNAL(channelsChanged(QStringList)), parser, SLOT(setChannels(QStringList)));
        QObject::disconnect(buffer, SIGNAL(titleChanged(QString)), parser, SLOT(setTarget(QString)));
    }
}
void CMBaseAudioSource::setChannels(quint8 channels)
{
    if (m_channels == channels)
        return;

    m_channels = channels;
    emit channelsChanged(channels);
}
Exemplo n.º 9
0
void IrcCommandParser::setChannels(const QStringList& channels)
{
    Q_D(IrcCommandParser);
    if (d->channels != channels) {
        d->channels = channels;
        emit channelsChanged(channels);
    }
}
Exemplo n.º 10
0
void GData::addFileToList(SoundFile *s)
{
  int c;
  soundFiles.push_back(s);
  for(c=0; c<s->numChannels(); c++) {
    channels.push_back(s->channels(c));
  }
  emit channelsChanged();
}
Exemplo n.º 11
0
static void bind(IrcBuffer* buffer, IrcCommandParser* parser)
{
    if (buffer && parser) {
        IrcBufferModel* model = buffer->model();
        QObject::connect(model, SIGNAL(channelsChanged(QStringList)), parser, SLOT(setChannels(QStringList)));
        QObject::connect(buffer, SIGNAL(titleChanged(QString)), parser, SLOT(setTarget(QString)));

        parser->setTarget(buffer->title());
        parser->setChannels(buffer->model()->channels());
    } else if (parser) {
        parser->reset();
    }
}
Exemplo n.º 12
0
void GData::saveActiveFile() {
  SoundFile *s = getActiveSoundFile();
  if(!s) return;
  if(s->saved()) return;
  if(audioThread.playSoundFile() == s || audioThread.recSoundFile() == s) {
    stop();
  }
  int val = saveFile(s, saveFileAsk(s->filename));
  if(val == 0) { //success
    emit channelsChanged();
  } else if(val == -1) {
    QMessageBox::warning(mainWindow, "Error", QString("Error saving file '") + QString(s->filename) + QString("'"), QMessageBox::Ok, Qt::NoButton);
  }
}
int MoodBox::RevolverRecieverManager::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = SingleShotTimerObject::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: channelsChanged(); break;
        case 1: onTimerTimeout(); break;
        case 2: onContactListChanged(); break;
        default: ;
        }
        _id -= 3;
    }
    return _id;
}
Exemplo n.º 14
0
IrcBot::IrcBot(QObject* parent) : IrcConnection(parent)
{
//! [messages]
    connect(this, SIGNAL(privateMessageReceived(IrcPrivateMessage*)), this, SLOT(processMessage(IrcPrivateMessage*)));
//! [messages]

//! [commands]
    parser.addCommand(IrcCommand::CtcpAction, "ACT [target] <message...>");
    parser.addCommand(IrcCommand::Custom, "HELP (<command...>)");
    parser.addCommand(IrcCommand::Nick, "NICK <nick>");
    parser.addCommand(IrcCommand::Join, "JOIN <#channel> (<key>)");
    parser.addCommand(IrcCommand::Part, "PART (<#channel>) (<message...>)");
    parser.addCommand(IrcCommand::Quit, "QUIT (<message...>)");
    parser.addCommand(IrcCommand::Message, "SAY [target] <message...>");
//! [commands]

    bufferModel.setConnection(this);
//! [channels]
    connect(&bufferModel, SIGNAL(channelsChanged(QStringList)), &parser, SLOT(setChannels(QStringList)));
//! [channels]
}
Exemplo n.º 15
0
Options::Options(QWidget *parent) : QWidget(parent)
{
	ui.setupUi(this);

	SetupPluginList();
	channelsChanged(0);

	ui.sbPaTxDelayValue->setVisible(false);
	ui.sbVoiceRepeatTime->setVisible(false);

	ui.tbSDR->setCurrentIndex(0);
	ui.SwMain->setCurrentIndex(0);

#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
    QString DocumentsLocation = QStandardPaths::writableLocation(QStandardPaths::HomeLocation);
#else
    QString DocumentsLocation = QDesktopServices::storageLocation(QDesktopServices:: HomeLocation);
#endif

	QDir dir;

	if(dir.exists(DocumentsLocation))
	{
		if(!dir.exists(DocumentsLocation + "/ExpertSDR"))
			dir.mkdir(DocumentsLocation + "/ExpertSDR");
		pathDefaultWaveIQ = DocumentsLocation + "/ExpertSDR/";
	}
	else
	{
		if(dir.mkdir(QDir::homePath() + "/ExpertSDR"))
			pathDefaultWaveIQ = QDir::homePath() + "/ExpertSDR/";
		else
		{
			QMessageBox msgBox;
			msgBox.setText("Choose a directory where wave files will be located.");
			msgBox.exec();
			//
			QString path = QDir::homePath();
			if(path.isEmpty())
			{
				msgBox.setText("Wave file location:\n" + QDir::homePath());
				msgBox.exec();
				pathDefaultWaveIQ = QDir::homePath() + "/";
			}
			else
				pathDefaultWaveIQ = path + "/";
		}
	}
	pathDefaultWaveIQDefault = pathDefaultWaveIQ;
	ui.lbWavePathIQ->setText(pathDefaultWaveIQ);
	pProg0 = new QProcess(this);
	pProg1 = new QProcess(this);
	pProg2 = new QProcess(this);
	pProg3 = new QProcess(this);
	pProg4 = new QProcess(this);

   //prepare to pupulate list in combobox with serial ports
    ui.cbPttPortName->clear();
    ui.cbAddKeyPortName->clear();
    ui.cbKeyPortName->clear();

       QList<QextPortInfo> ports = QextSerialEnumerator::getPorts();
       if (ports.size()!=0)
       {
           for (int i = 0; i < ports.size(); i++)
           {
                  ui.cbPttPortName->addItem(ports.at(i).portName.toLocal8Bit().constData(),0);
                  ui.cbAddKeyPortName->addItem(ports.at(i).portName.toLocal8Bit().constData(),0);
                  ui.cbKeyPortName->addItem(ports.at(i).portName.toLocal8Bit().constData(),0);
           }
       }


    #ifdef Q_OS_LINUX
        pPttPort = new QextSerialPort("/dev/ttyS0", QextSerialPort::EventDriven);
        pKeyPort = new QextSerialPort("/dev/ttyS0", QextSerialPort::EventDriven);
        pAddKeyPort = new QextSerialPort("/dev/ttyS0", QextSerialPort::EventDriven);
    #else
       pPttPort = new QextSerialPort("COM1", QextSerialPort::EventDriven);
       pKeyPort = new QextSerialPort("COM1", QextSerialPort::EventDriven);
       pAddKeyPort = new QextSerialPort("COM1", QextSerialPort::EventDriven);
    #endif /*Q_OS_LINUX*/

    connect(pPttPort, SIGNAL(dsrChanged(bool)), this, SLOT(OnPttDsr(bool)));
    connect(pPttPort, SIGNAL(ctsChanged(bool)), this, SLOT(OnPttCts(bool)));
    connect(pKeyPort, SIGNAL(dsrChanged(bool)), this, SLOT(OnKeyDsr(bool)));
    connect(pKeyPort, SIGNAL(ctsChanged(bool)), this, SLOT(OnKeyCts(bool)));
    connect(pAddKeyPort, SIGNAL(dsrChanged(bool)), this, SLOT(OnAddKeyDsr(bool)));
    connect(pAddKeyPort, SIGNAL(ctsChanged(bool)), this, SLOT(OnAddKeyCts(bool)));
	connect(ui.LwOptions, SIGNAL(currentItemChanged(QListWidgetItem*, QListWidgetItem*)), this, SLOT(ChangePage(QListWidgetItem*, QListWidgetItem*)));
	connect(ui.pbOK, SIGNAL(clicked()), this, SLOT(OnOK()));
	connect(ui.pbCancel, SIGNAL(clicked()), this, SLOT(OnCancel()));
	connect(ui.slTxImRejMag, SIGNAL(valueChanged(int)), this, SLOT(OnTxGainChange(int)));
	connect(ui.slTxImRejPhase, SIGNAL(valueChanged(int)), this, SLOT(OnTxPhaseChange(int)));
	connect(ui.slTxImRejMagCw, SIGNAL(valueChanged(int)), this, SLOT(OnTxGainChangeCw(int)));
	connect(ui.sbTxImRejMagCw, SIGNAL(valueChanged(int)), this, SLOT(OnTxGainChangeCw(int)));
	connect(ui.slTxImRejPhaseCw, SIGNAL(valueChanged(int)), this, SLOT(OnTxPhaseChangeCw(int)));
	connect(ui.sbTxImRejPhaseCw, SIGNAL(valueChanged(int)), this, SLOT(OnTxPhaseChangeCw(int)));
	connect(ui.slTxImRejMagAmFm, SIGNAL(valueChanged(int)), this, SLOT(OnTxGainChangeAmFm(int)));
	connect(ui.sbTxImRejMagAmFm, SIGNAL(valueChanged(int)), this, SLOT(OnTxGainChangeAmFm(int)));
	connect(ui.slTxImRejPhaseAmFm, SIGNAL(valueChanged(int)), this, SLOT(OnTxPhaseChangeAmFm(int)));
	connect(ui.sbTxImRejPhaseAmFm, SIGNAL(valueChanged(int)), this, SLOT(OnTxPhaseChangeAmFm(int)));
	connect(ui.pbProg0, SIGNAL(clicked()), this, SLOT(OnProg0()));
	connect(ui.pbProg1, SIGNAL(clicked()), this, SLOT(OnProg1()));
	connect(ui.pbProg2, SIGNAL(clicked()), this, SLOT(OnProg2()));
	connect(ui.pbProg3, SIGNAL(clicked()), this, SLOT(OnProg3()));
	connect(ui.pbProg4, SIGNAL(clicked()), this, SLOT(OnProg4()));
	connect(ui.pbApply, SIGNAL(clicked()), this, SLOT(LaunchProgs()));
	connect(ui.pbOK, SIGNAL(clicked()), this, SLOT(LaunchProgs()));
	if(ui.chbExtCtrl->isChecked())
		OnEnableExControl(1);
	else
		OnEnableExControl(0);
	connect(ui.chbExtCtrl, SIGNAL(stateChanged(int)), this, SLOT(OnEnableExControl(int)));
	connect(ui.spinBox_0, SIGNAL(valueChanged(int)), this, SLOT(PowerCorrect160(int)));
	connect(ui.spinBox_1, SIGNAL(valueChanged(int)), this, SLOT(PowerCorrect80(int)));
	connect(ui.spinBox_2, SIGNAL(valueChanged(int)), this, SLOT(PowerCorrect60(int)));
	connect(ui.spinBox_3, SIGNAL(valueChanged(int)), this, SLOT(PowerCorrect40(int)));
	connect(ui.spinBox_4, SIGNAL(valueChanged(int)), this, SLOT(PowerCorrect30(int)));
	connect(ui.spinBox_5, SIGNAL(valueChanged(int)), this, SLOT(PowerCorrect20(int)));
	connect(ui.spinBox_6, SIGNAL(valueChanged(int)), this, SLOT(PowerCorrect17(int)));
	connect(ui.spinBox_7, SIGNAL(valueChanged(int)), this, SLOT(PowerCorrect15(int)));
	connect(ui.spinBox_8, SIGNAL(valueChanged(int)), this, SLOT(PowerCorrect12(int)));
	connect(ui.spinBox_9, SIGNAL(valueChanged(int)), this, SLOT(PowerCorrect10(int)));
	connect(ui.spinBox_10, SIGNAL(valueChanged(int)), this, SLOT(PowerCorrect6(int)));
	connect(ui.spinBox_11, SIGNAL(valueChanged(int)), this, SLOT(PowerCorrect2(int)));
	connect(ui.spinBox_12, SIGNAL(valueChanged(int)), this, SLOT(PowerCorrect07(int)));
	connect(ui.chbPttEnable, SIGNAL(clicked(bool)), this, SLOT(pttOpen(bool)));
	ui.chbPttDtr->setVisible(false);
	ui.chbPttRts->setVisible(false);
	connect(ui.chbKeyEnable, SIGNAL(clicked(bool)), this, SLOT(keyOpen(bool)));
	connect(ui.chbAddKeyEnable, SIGNAL(clicked(bool)), this, SLOT(addKeyOpen(bool)));
	connect(ui.cbPaDriver, SIGNAL(currentIndexChanged(int)), this, SLOT(soundDrvChanged(int)));
	connect(ui.cbPaIn, SIGNAL(currentIndexChanged(int)), this, SLOT(soundChanged(int)));
	connect(ui.cbPaOut, SIGNAL(currentIndexChanged(int)), this, SLOT(soundChanged(int)));
	connect(ui.cbPaBufferSize, SIGNAL(currentIndexChanged(int)), this, SLOT(soundChanged(int)));
	connect(ui.cbPaSampleRate, SIGNAL(currentIndexChanged(int)), this, SLOT(soundChanged(int)));
	connect(ui.cbPaChannels, SIGNAL(currentIndexChanged(int)), this, SLOT(soundChanged(int)));
	connect(ui.cbPaChannels, SIGNAL(currentIndexChanged(int)), this, SLOT(channelsChanged(int)));
	connect(ui.sbPaLattency, SIGNAL(valueChanged(int)), this, SLOT(soundChanged(int)));
	connect(ui.cbPaVacDriver, SIGNAL(currentIndexChanged(int)), this, SLOT(soundVacDrvChanged(int)));
	connect(ui.cbPaVacIn, SIGNAL(currentIndexChanged(int)), this, SLOT(soundVacChanged(int)));
	connect(ui.cbPaVacOut, SIGNAL(currentIndexChanged(int)), this, SLOT(soundVacChanged(int)));
	connect(ui.cbPaVacBufferSize, SIGNAL(currentIndexChanged(int)), this, SLOT(soundVacChanged(int)));
	connect(ui.cbPaVacSampleRate, SIGNAL(currentIndexChanged(int)), this, SLOT(soundVacChanged(int)));
	connect(ui.sbPaVacLattency, SIGNAL(valueChanged(int)), this, SLOT(soundVacChanged(int)));
	connect(ui.chbVacEnable, SIGNAL(stateChanged(int)), this, SLOT(soundChanged(int)));
	connect(ui.cbSdrType, SIGNAL(currentIndexChanged(int)), this, SLOT(OnSdrType(int)));
	connect(ui.cbSdrType, SIGNAL(currentIndexChanged(int)), this, SLOT(onSdrTypeChanged(int)));
	onEnableXvtrx(false);
	connect(ui.chbXvtrxEnable, SIGNAL(clicked(bool)), this, SLOT(onEnableXvtrx(bool)));
	connect(ui.pbWavePath, SIGNAL(clicked()), this, SLOT(openWaveDir()));
	connect(ui.pbLog, SIGNAL(clicked()), this, SLOT(viewLocationLogFile()));
}
Exemplo n.º 16
0
void NotifyQt::notifyListChange(int list, int type)
{
#ifdef NOTIFY_DEBUG
	std::cerr << "NotifyQt::notifyListChange()" << std::endl;
#endif
	switch(list)
	{
		case NOTIFY_LIST_NEIGHBOURS:
#ifdef NOTIFY_DEBUG
			std::cerr << "received neighbrs changed" << std::endl ;
#endif
			emit neighborsChanged();
			break;
		case NOTIFY_LIST_FRIENDS:
#ifdef NOTIFY_DEBUG
			std::cerr << "received friends changed" << std::endl ;
#endif
			emit friendsChanged() ;
			break;
		case NOTIFY_LIST_DIRLIST_LOCAL:
#ifdef NOTIFY_DEBUG
			std::cerr << "received files changed" << std::endl ;
#endif
			emit filesPostModChanged(true) ;  /* Local */
			break;
		case NOTIFY_LIST_DIRLIST_FRIENDS:
#ifdef NOTIFY_DEBUG
			std::cerr << "received files changed" << std::endl ;
#endif
			emit filesPostModChanged(false) ;  /* Local */
			break;
		case NOTIFY_LIST_SEARCHLIST:
			break;
		case NOTIFY_LIST_MESSAGELIST:
#ifdef NOTIFY_DEBUG
			std::cerr << "received msg changed" << std::endl ;
#endif
			emit messagesChanged() ;
			break;
		case NOTIFY_LIST_MESSAGE_TAGS:
#ifdef NOTIFY_DEBUG
			std::cerr << "received msg tags changed" << std::endl ;
#endif
			emit messagesTagsChanged();
			break;
		case NOTIFY_LIST_CHANNELLIST:
			break;
		case NOTIFY_LIST_TRANSFERLIST:
#ifdef NOTIFY_DEBUG
			std::cerr << "received transfer changed" << std::endl ;
#endif
			emit transfersChanged() ;
			break;
		case NOTIFY_LIST_CONFIG:
#ifdef NOTIFY_DEBUG
			std::cerr << "received config changed" << std::endl ;
#endif
			emit configChanged() ;
			break ;
		case NOTIFY_LIST_FORUMLIST_LOCKED:
#ifdef NOTIFY_DEBUG
			std::cerr << "received forum msg changed" << std::endl ;
#endif
			emit forumsChanged(); // use connect with Qt::QueuedConnection
			break;
		case NOTIFY_LIST_CHANNELLIST_LOCKED:
#ifdef NOTIFY_DEBUG
			std::cerr << "received channel msg changed" << std::endl ;
#endif
			emit channelsChanged(type); // use connect with Qt::QueuedConnection
			break;
		case NOTIFY_LIST_PUBLIC_CHAT:
#ifdef NOTIFY_DEBUG
			std::cerr << "received public chat changed" << std::endl ;
#endif
			emit publicChatChanged(type);
			break;
		case NOTIFY_LIST_PRIVATE_INCOMING_CHAT:
		case NOTIFY_LIST_PRIVATE_OUTGOING_CHAT:
#ifdef NOTIFY_DEBUG
			std::cerr << "received private chat changed" << std::endl ;
#endif
			emit privateChatChanged(list, type);
			break;
		case NOTIFY_LIST_GROUPLIST:
#ifdef NOTIFY_DEBUG
			std::cerr << "received groups changed" << std::endl ;
#endif
			emit groupsChanged(type);
			break;
		default:
			break;
	}
	return;
}