void X264Encoder::runEncodingPass_parseLine(const QString &line, QList<QRegExp*> &patterns, const int &pass, double &last_progress, double &size_estimate)
{
	int offset = -1;
	if((offset = patterns[0]->lastIndexIn(line)) >= 0)
	{
		X264_UPDATE_PROGRESS(patterns[0]);
	}
	else if((offset = patterns[1]->lastIndexIn(line)) >= 0)
	{
		bool ok = false;
		unsigned int progress = patterns[1]->cap(1).toUInt(&ok);
		setStatus(JobStatus_Indexing);
		if(ok)
		{
			setProgress(progress);
		}
		setDetails(line.mid(offset).trimmed());
	}
	else if((offset = patterns[2]->lastIndexIn(line)) >= 0)
	{
		setStatus((pass == 2) ? JobStatus_Running_Pass2 : ((pass == 1) ? JobStatus_Running_Pass1 : JobStatus_Running));
		setDetails(line.mid(offset).trimmed());
	}
	else if((offset = patterns[3]->lastIndexIn(line)) >= 0)
	{
		X264_UPDATE_PROGRESS(patterns[3]);
	}
	else if(!line.isEmpty())
	{
		log(line);
	}
}
Exemplo n.º 2
0
//---------------------------------------------------------------------------
void __fastcall TContestEntryDetails::BundleOverrideButtonClick( TObject * /*Sender*/ )
{
   getDetails( );   // override from the window

   contest->setINIDetails();
   setDetails( );
   if ( bool( CalendarDlg ) )
   {
      setDetails( CalendarDlg->ic );
   }
}
Exemplo n.º 3
0
void AudioCdDevice::connectService(bool useCddb)
{
    #if defined CDDB_FOUND && defined MUSICBRAINZ5_FOUND
    if (cddb && !useCddb) {
        cddb->deleteLater();
        cddb=0;
    }
    if (mb && useCddb) {
        mb->deleteLater();
        mb=0;
    }
    #else
    Q_UNUSED(useCddb)
    #endif

    #ifdef CDDB_FOUND
    if (!cddb
            #ifdef MUSICBRAINZ5_FOUND
            && useCddb
            #endif
            ) {
        cddb=new CddbInterface(device);
        connect(cddb, SIGNAL(error(QString)), this, SIGNAL(error(QString)));
        connect(cddb, SIGNAL(initialDetails(CdAlbum)), this, SLOT(setDetails(CdAlbum)));
        connect(cddb, SIGNAL(matches(const QList<CdAlbum> &)), SLOT(cdMatches(const QList<CdAlbum> &)));
        connect(this, SIGNAL(lookup(bool)), cddb, SLOT(lookup(bool)));
    }
Exemplo n.º 4
0
int EvaMemoPacket::putBody( unsigned char *buf )
{
	int pos = 0;
	int len = 0;
	setDetails(m_Memo);
	switch(m_Type){
	case 0x01:{
		buf[pos++] = TQQ_MEMO_UPLOAD; //0x01 is the upload memo option
		buf[pos++] = 0x00; //unknow byte
		pos += EvaUtil::write32( buf+pos, m_Id);//qq number
		buf[pos++] = 0x00; //unknow byte
		
		for(int i=0; i<TQQ_MEMO_FIELDS; i++){
			len = m_Infos.at(i).length();
			buf[pos++] = 0xff & len;
			memcpy(buf+pos, m_Infos.at(i).c_str(), len);
			pos += len;
			}
		}
		break;
	case 0x02:{
		buf[pos++] = TQQ_MEMO_REMOVE; //0x02 is the remove memo option
		pos += EvaUtil::write32( buf+pos,m_Id);//qq number
		}
		break;
	case 0x03:{
		buf[pos++] = TQQ_MEMO_DOWNLOAD; //0x03 is the download memo option
		pos += EvaUtil::write32( buf+pos,m_Id);//qq number
		}
		break;
	}
	return pos;
}
ConnectionErrorNotification::ConnectionErrorNotification(Account account, const QString &errorServer, const QString &errorMessage) :
		Notification(account, Chat::null, "ConnectionError", KaduIcon("dialog-error")),
		ErrorServer(errorServer), ErrorMessage(errorMessage)
{
	setTitle(tr("Connection error"));
	setText(Qt::escape(tr("Connection error on account: %1 (%2)").arg(account.id()).arg(account.accountIdentity().name())));

	if (!ErrorMessage.isEmpty())
	{
		if (ErrorServer.isEmpty())
			setDetails(Qt::escape(ErrorMessage));
		else
			setDetails(Qt::escape(QString("%1 (%2)").arg(ErrorMessage).arg(ErrorServer)));
	}

	addCallback("connection-ignore-errors");
}
Exemplo n.º 6
0
 Icmp(const u_char *data, const OSI &layers) {
   this->name = "Icmp";
   this->header = (struct header_s*)(data + layers.getSize());
   this->header->checksum = htons(this->header->checksum);
   this->header->id = htons(this->header->id);
   this->header->seq = htons(this->header->seq);
   this->size = ICMP_SIZE;
   setDetails();
 }
Exemplo n.º 7
0
/*
      onShow - needs to produce a copy of the contest structure containing relevant
               fields
      setDetails (both) to populate display from those details

      getDetails to get from screen into copy

      Then OK Button to actually copy the detail over - then cancel
      can just discard the details
*/
void TContestEntryDetails::setDetails( LoggerContestLog * pcont )
{
   if ( !pcont )
      return ;
   inputcontest = pcont;
   contest = new LoggerContestLog();
   *contest = *pcont;                // is this safe? not with the QSO vector... although it won't get changed!
   setDetails();
}
Exemplo n.º 8
0
void KOfxDirectConnectDlg::slotOfxData(KIO::Job*, const QByteArray& _ba)
{
  qDebug("Got %d bytes of data", _ba.size());
  if (d->m_firstData) {
    setStatus("Connection established, retrieving data...");
    setDetails(QString("Downloading data to %1...").arg(m_tmpfile->fileName()));
    kProgress1->setValue(kProgress1->value() + 1);
    d->m_firstData = false;
  }
  m_tmpfile->write(_ba);

  setDetails(QString("Got %1 bytes").arg(_ba.size()));

  if (d->m_fpTrace.isOpen()) {
    QByteArray trcData(_ba);
    trcData.replace('\r', "");
    d->m_fpTrace.write(trcData, trcData.size());
  }
}
Exemplo n.º 9
0
//---------------------------------------------------------------------------
void __fastcall TContestEntryDetails::EntDetailButtonClick( TObject * /*Sender*/ )
{
   getDetails( );   // override from the window
   std::auto_ptr <TEntryOptionsForm> EntryDlg( new TEntryOptionsForm( this, contest, false ) );
   EntryDlg->EntryGroup->Visible = false;
   EntryDlg->Caption = "Entry Details";
   if ( EntryDlg->ShowModal() == mrOk )
      setDetails( );

}
Exemplo n.º 10
0
/*
      onShow - needs to produce a copy of the contest structure containing relevant
               fields
      setDetails (both) to populate display from those details

      getDetails to get from screen into copy

      Then OK Button to actually copy the detail over - then cancel
      can just discard the details
*/
void TContestEntryDetails::setDetails( LoggerContestLog * pcont )
{
   if ( !pcont )
      return ;
   inputcontest = pcont;
   contest = new LoggerContestLog();
   *contest = *pcont;                // is this safe? not with the QSO vector... although it won't get changed!
   sectionList = contest->sectionList.getValue().c_str(); // the combo will then be properly set up in setDetails()
   setDetails();
}
Exemplo n.º 11
0
void AccountShared::useProtocolFactory(ProtocolFactory *factory)
{
	Protocol *oldProtocolHandler = ProtocolHandler;

	if (ProtocolHandler)
	{
		disconnect(ProtocolHandler, SIGNAL(statusChanged(Account, Status)), this, SIGNAL(statusChanged()));
		disconnect(ProtocolHandler, SIGNAL(contactStatusChanged(Contact, Status)),
				   this, SIGNAL(buddyStatusChanged(Contact, Status)));
		disconnect(ProtocolHandler, SIGNAL(connected(Account)), this, SIGNAL(connected()));
		disconnect(ProtocolHandler, SIGNAL(disconnected(Account)), this, SIGNAL(disconnected()));

		storeStatus(StatusChangerManager::instance()->manuallySetStatus(this));
		setDisconnectStatus();
	}

	if (!factory)
	{
		setDetails(0);
		ProtocolHandler = 0;
		emit protocolUnloaded();
	}
	else
	{
		ProtocolHandler = factory->createProtocolHandler(this);
		setDetails(factory->createAccountDetails(this));
		emit protocolLoaded();
	}

	if (oldProtocolHandler)
		delete oldProtocolHandler;

	if (ProtocolHandler)
	{
		connect(ProtocolHandler, SIGNAL(statusChanged(Account, Status)), this, SIGNAL(statusChanged()));
		connect(ProtocolHandler, SIGNAL(contactStatusChanged(Contact, Status)),
				this, SIGNAL(buddyStatusChanged(Contact, Status)));
		connect(ProtocolHandler, SIGNAL(connected(Account)), this, SIGNAL(connected()));
		connect(ProtocolHandler, SIGNAL(disconnected(Account)), this, SIGNAL(disconnected()));
	}
}
Exemplo n.º 12
0
void FollowUpRecord::setAttributesAndValues(const QMap<QString, QVariant> & attributesAndValues){
    Record::setAttributesAndValues(attributesAndValues);
    QString  s = attributesAndValues.value(QString("Status")).toString();
    QDateTime  ddat = attributesAndValues.value(QString("DueDateAndTime")).toDateTime();
    QString  d = attributesAndValues.value(QString("Details")).toString();
    int c = attributesAndValues.value(QString("ConsultationRecordID")).toInt();

    setStatusForString(s);
    setDueDateTime(ddat);
    setDetails(d);
    setConsultationRecordId(c);
}
Exemplo n.º 13
0
void __fastcall TContestEntryDetails::VHFCalendarButtonClick( TObject * /*Sender*/ )
{
   if ( !CalendarDlg )
   {
      CalendarDlg = new TCalendarForm( this ) ;
      CalendarDlg->Caption = "VHF Calendar";
   }
   if ( CalendarDlg->ShowModal() == mrOk )
   {
      // set up all the details that we can from the calendar
      ContestNameSelected->Text = CalendarDlg->ic.description.c_str();
      setDetails( CalendarDlg->ic );
   }
}
Exemplo n.º 14
0
void __fastcall TContestEntryDetails::StationBundleFrameBundleEditClick(
      TObject *Sender)
{
   TButton *cb = dynamic_cast<TButton *>(Sender );
   TSettingBundleFrame *bf = dynamic_cast<TSettingBundleFrame *>(cb->Parent);
   if (bf)
   {
      bf->BundleEditClick(Sender);
   }
   getDetails( );   // override from the window

   contest->setINIDetails();
   setDetails( );
}
Exemplo n.º 15
0
void __fastcall TContestEntryDetails::BundleFrameBundleSectionChange(
      TObject *Sender)
{
   TComboBox *cb = dynamic_cast<TComboBox *>(Sender);
   TSettingBundleFrame *bf = dynamic_cast<TSettingBundleFrame *>(cb->Parent);
   if (bf)
   {
      bf->BundleSectionChange(Sender);
   }
   getDetails( );   // override from the window

   contest->setINIDetails();
   setDetails( );
}
Exemplo n.º 16
0
Food::Food(istringstream & line)
{
	string id, name;
	double unitPrice;
	int inventory;
	line >> id >> name >> unitPrice >> inventory;

	string details, tmp;
	while (line >> tmp)
	{
		details += tmp;
		details += "\t";
	}
	setId(id);
	setName(name);
	setUnitPrice(unitPrice);
	setInventory(inventory);
	setDetails(details);
}
Exemplo n.º 17
0
MessageNotification::MessageNotification(MessageType messageType, const Message &message) :
		ChatNotification(message.chat(), messageType == NewChat ? "NewChat" : "NewMessage",
			IconsManager::instance()->loadIcon("Message"))
{
	QString syntax;

	if (messageType == NewChat)
	{
		setTitle("New chat");
		syntax = tr("Chat with <b>%1</b>");
	}
	else
	{
		setTitle("New message");
		syntax = tr("New message from <b>%1</b>");
	}

	setText(syntax.arg(Qt::escape(message.sender().display())));
	setDetails(message.content());
}
Exemplo n.º 18
0
void
FriendWidget::update( const lastfm::XmlQuery& user, unsigned int order )
{
    m_order = order;

    m_track.setTitle( user["recenttrack"]["name"].text() );
    m_track.setAlbum( user["recenttrack"]["album"]["name"].text() );
    m_track.setArtist( user["recenttrack"]["artist"]["name"].text() );
    m_track.setExtra( "playerName", user["scrobblesource"]["name"].text() );
    m_track.setExtra( "playerURL", user["scrobblesource"]["url"].text() );

    QString recentTrackDate = user["recenttrack"].attribute( "uts" );

    bool hasListened = m_track != lastfm::Track();
    ui->trackFrame->setVisible( hasListened );

    m_listeningNow = recentTrackDate.isEmpty() && hasListened;

    if ( !recentTrackDate.isEmpty() )
        m_track.setTimeStamp( QDateTime::fromTime_t( recentTrackDate.toUInt() ) );

    setDetails();
}
Exemplo n.º 19
0
void __fastcall TContestEntryDetails::VHFCalendarButtonClick( TObject * /*Sender*/ )
{
   std::auto_ptr <TCalendarForm> CalendarDlg(new TCalendarForm(this));

   CalendarDlg->Caption = "VHF Calendar";
   CalendarDlg->description = ContestNameSelected->Text;

   if ( CalendarDlg->ShowModal() == mrOk )
   {
      // set up all the details that we can from the calendar
      ContestNameSelected->Text = CalendarDlg->ic.description.c_str();
      setDetails( CalendarDlg->ic );
   }
   TWinControl *next = getNextFocus();
   if (next)
   {
      next->SetFocus();
   }
   else
   {
      OKButton->SetFocus();
   }
}
Exemplo n.º 20
0
void __fastcall TContestEntryDetails::BundleFrameBundleEditClick(
      TObject *Sender)
{
   TButton *cb = dynamic_cast<TButton *>(Sender );
   TSettingBundleFrame *bf = dynamic_cast<TSettingBundleFrame *>(cb->Parent);
   if (bf)
   {
      bf->BundleEditClick(Sender);
   }
   getDetails( );   // override from the window

   contest->setINIDetails();
   setDetails( );
   TWinControl *next = getNextFocus();
   if (next)
   {
      next->SetFocus();
   }
   else
   {
      OKButton->SetFocus();
   }
}
Exemplo n.º 21
0
MessageNotification::MessageNotification(ChatWidgetRepository *chatWidgetRepository, MessageType messageType, const Message &message) :
		Notification(Account::null, message.messageChat(), messageType == NewChat ? "NewChat" : "NewMessage",
		KaduIcon("protocols/common/message")), CurrentMessage(message)
{
	addChatCallbacks();

	connect(chatWidgetRepository, SIGNAL(chatWidgetAdded(ChatWidget*)), this, SLOT(chatWidgetAdded(ChatWidget*)));

	QString syntax;

	if (messageType == NewChat)
	{
		setTitle(tr("New chat"));
		syntax = tr("Chat with <b>%1</b>");
	}
	else
	{
		setTitle(tr("New message"));
		syntax = tr("New message from <b>%1</b>");
	}

	setText(syntax.arg(Qt::escape(message.messageSender().display(true))));
	setDetails(message.htmlContent());
}
Exemplo n.º 22
0
void AccountShared::aboutToBeRemoved()
{
	setDetails(0);
}
Exemplo n.º 23
0
Application::Application(int argc, char *argv[])
    : QCoreApplication(argc, argv)
{
    QCommandLineParser parser;
    parser.setApplicationDescription("HTTP Interface for MPD/CantataWeb");
    parser.addHelpOption();
    parser.addVersionOption();
    QCommandLineOption configOption(QStringList() << "c" << "c", "Config file (default " PACKAGE_NAME ".conf).", "configfile", PACKAGE_NAME".conf");
    parser.addOption(configOption);
    parser.process(*this);
    QString cfgFile=parser.value(configOption);

    if (!QFile::exists(cfgFile)) {
        qWarning() << cfgFile << "does not exist";
        ::exit(-1);
    }

    QSettings *cfg=new QSettings(cfgFile, QSettings::IniFormat, this);

    MPDConnection::self()->start(); // Place in separate thread...
    connect(this, SIGNAL(mpdDetails(MPDConnectionDetails)), MPDConnection::self(), SLOT(setDetails(MPDConnectionDetails)));
    MPDConnectionDetails mpd;
    mpd.hostname=cfg->value("mpd/host", "127.0.0.1").toString();
    mpd.port=cfg->value("mpd/port", "6600").toUInt();
    mpd.password=cfg->value("mpd/password", QString()).toString();
    mpd.dir=cfg->value("mpd/dir", "/var/lib/mpd/music").toString();
    MPDParseUtils::setSingleTracksFolder(cfg->value("mpd/singleTracksFolder", QString()).toString());
    QString dbFile(cfg->value("db", QCoreApplication::applicationDirPath()+QDir::separator()+PACKAGE_NAME".sqlite").toString());
    if (!MpdLibraryDb::self()->init(dbFile)) {
        qWarning() << dbFile << "failed to initialize";
        ::exit(-1);
    }
    emit mpdDetails(mpd);
    HttpServer *http=new HttpServer(this, cfg);
    if (!http->start()) {
        qWarning() << "Failed to start HTTP server";
        ::exit(-1);
    }
    StatusApi::self();
}
Exemplo n.º 24
0
FollowUpRecord::FollowUpRecord(QString & s, QDateTime &ddat,QString&d, int co){
    setStatusForString(s);
    setDueDateTime(ddat);
    setDetails(d);
    setConsultationRecordId(co);
}