Exemple #1
0
DateChangeWatcher::DateChangeWatcher( QObject* parent )
    : QObject( parent )
{
    connect( &m_timer, SIGNAL(timeout()), SLOT(slotTimeout()) );
    m_timer.start( 1000 * 60 );
    slotTimeout();
}
Timeout::Timeout( QObject *parent, DBusTimeout *t )
  : QObject( parent ),  m_timeout( t )
{
  m_timer = new QTimer( this );
  connect( m_timer,  SIGNAL(timeout()),
           SLOT(slotTimeout()) );
}
Exemple #3
0
Submit_manager::Submit_manager(struct reportArr report, struct classArr data, QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Submit_manager)
{
    ui->setupUi(this);

    QString parameter;

    test = data;
    listCnt = 0;

    parameter.append(report.pk_report+"/");
    parameter.append(test.token);

    api_http = new Api_http;

    connect(api_http,SIGNAL(getReply(QNetworkReply*)),this,SLOT(slotGetReply(QNetworkReply*)));
    api_http->get_url(DONCARE,GET_SUMMIT_LIST,parameter,2);

    ui->user_name->setText(test.userName);
    ui->class_name->setText(test.className);

    connect(&timer,SIGNAL(timeout()),this,SLOT(slotTimeout()));

}
SMActionVideoVLC::SMActionVideoVLC(QWidget *parent):
    SMAction(parent)
{
    poller = new QTimer(0);
    connect(poller, SIGNAL(timeout()), SLOT(slotTimeout()));

    //preparation of the vlc command
    const char * const vlc_args[] = {
              "--verbose=2", //be much more verbose then normal for debugging purpose
    };
    _vlcinstance=libvlc_new(sizeof(vlc_args) / sizeof(vlc_args[0]), vlc_args);

    // Create a media player playing environement
    _mp = libvlc_media_player_new (_vlcinstance);
    _m = NULL;

    setRepeat(0);
    setVolume(1.0);

    getContextMenu()->addSeparator();
    QAction* setRepeatAction = getContextMenu()->addAction("set repeat");
    connect(setRepeatAction, SIGNAL(triggered(bool)), SLOT(slotSetRepeat()));

    QAction* setVolumeAction = getContextMenu()->addAction("set volume");
    connect(setVolumeAction, SIGNAL(triggered(bool)), SLOT(slotSetVolume()));
}
Exemple #5
0
KScienceSaver::KScienceSaver( WId id, bool s, bool gP )
    : KScreenSaver( id )
{
    d = new KScienceData;
    d->gc = XCreateGC(qt_xdisplay(), id, 0, 0);
	d->xRootWin = 0;
    d->buffer = 0;

	moveOn = true;
	grabPixmap = gP;
	setup = s;

	vx = vy = 0.0;
	readSettings();

	if( !grabPixmap )
	{
		grabRootWindow();
		initialize();
		do_refresh( QRect ( 0, 0, width(), height() ) );
	}

	connect( &timer, SIGNAL( timeout() ), SLOT( slotTimeout() ) );
	timer.start( SCI_MAX_SPEED - speed[mode] );
}
Exemple #6
0
Waiter::Waiter(QObject* parent)
    : QObject(parent),
      timedOut_(false)
{
	timer_.setSingleShot(true);
	connect(&timer_, SIGNAL(timeout()), SLOT(slotTimeout()));
}
WeatherRequest::WeatherRequest(QObject *parent) :
    QObject(parent)
{
    m_maps["dt"] = new DtImp();
    m_maps["temp"] = new TemperatureImp();
    m_maps["weather"] = new WeatherImp();
    m_maps["pressure"] = new PressureImp();
    m_maps["humidity"] = new HumidityImp();
    m_maps["speed"] = new SpeedImp();
    m_maps["deg"] = new DegImp();
    m_maps["clouds"] = new CloudsImp();
    //m_maps["rain"] = new RainImp();

    NetworkUtil util;
    QStringList details = util.location(util.public_ip()).split(":");
    m_city = details.count()== 3 ? details.at(2) : QString("Wuhan");
    m_url = QUrl(QString("http://api.openweathermap.org/data/2.5/forecast/daily?"
                 "q=%1&mode=json&units=metric&cnt=7&APPID=a106333152baafe953f41c112767b167").arg(m_city));

    m_location = QUrl(QString("http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js"));

    m_manager = new QNetworkAccessManager(this);
    m_timer = new QTimer(this);
    m_timer->setInterval(5000);
    m_timer->setSingleShot(false);

    connect(m_manager, SIGNAL(finished(QNetworkReply*)), this,
            SLOT(replyFinished(QNetworkReply*)));
    connect(m_timer, SIGNAL(timeout()), this, SLOT(slotTimeout()));

//    m_url = QUrl(QString("http://www.ipip.net/ip.html"));
    m_manager->get(QNetworkRequest(m_url));
}
QString NetMeetingInvitation::invitationHead()
{
	QTimer::singleShot( 10*60000, this, SLOT( slotTimeout() ) ); //send TIMEOUT in 10 minute if the invitation has not been accepted/refused
	return QString( MSNInvitation::invitationHead()+
				"Session-Protocol: SM1\r\n"
  				"Session-ID: {6672F94C-45BF-11D7-B4AE-00010A1008DF}\r\n" //FIXME i don't know what is the session id
				"\r\n").utf8();
}
NaughtyProcessMonitor::NaughtyProcessMonitor(uint interval, uint triggerLevel, QObject *parent, const char *name) : QObject(parent, name)
{
    d = new NaughtyProcessMonitorPrivate;
    d->interval_ = interval * 1000;
    d->triggerLevel_ = triggerLevel;
    d->timer_ = new QTimer(this);
    connect(d->timer_, SIGNAL(timeout()), this, SLOT(slotTimeout()));
}
TransformationStateDefined::TransformationStateDefined(TransformationStateContext &context,
                                                       QGraphicsScene &scene) :
  TransformationStateAbstractBase (context),
  m_axesChecker (new Checker (scene)),
  m_timer (new QTimer)
{
  m_timer->setSingleShot (true);
  connect (m_timer, SIGNAL (timeout()), this, SLOT (slotTimeout()));
}
Exemple #11
0
bool EvaTipWindow::qt_invoke( int _id, QUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: slotTimeout(); break;
    default:
	return EvaTipUIBase::qt_invoke( _id, _o );
    }
    return TRUE;
}
void TutorialStateContext::createTimer ()
{
  LOG4CPP_INFO_S ((*mainCat)) << "TutorialStateContext::createTimer";

  m_timer = new QTimer ();
  m_timer->setInterval (TIMER_INTERVAL);
  m_timer->setSingleShot (true);
  connect (m_timer, SIGNAL (timeout ()), this, SLOT (slotTimeout ()));
}
Exemple #13
0
void EvaServers::fetchAddress( bool isUdp )
{
	int num = 0;
	if(m_bIsFirst){
		m_bIsFirst = false;
		TDEConfig* config = new TDEConfig( (TQDir::homeDirPath() + "/.eva/eva.cfg") );
		config->setGroup("General");
		TQString type = config->readEntry("Server Type");
		if(!type.isEmpty()){
			TQHostAddress addr(config->readEntry("Server IP"));
			if(!addr.isNull()) {
				if( (type == "UDP" && isUdp) ||
						(type == "TCP" && !isUdp)){
					emit isReady(addr);
					return;
				}
			}
		}
		delete config;
	}
				
	if(isUdp){
		num = UDPServers.count();
		fetchType = UDP;
	} else{
		num = TCPServers.count();
		fetchType = TCP;
	}
	if(num == 0 ){
		defaultAddress();
		return;
	}
	//int index = rand() % num;

	int maxItems = isUdp?UDPServers.count():TCPServers.count();
	if(m_CurrAddrIndex>maxItems) m_CurrAddrIndex = 0;
	serverItem addr;
	if(isUdp)
		addr = UDPServers[m_CurrAddrIndex++];
	else
		addr = TCPServers[m_CurrAddrIndex++];
	
	if(addr.type == Addr_IP){
		emit isReady(TQHostAddress(addr.addr.latin1())); // this way, Red hat 9 might work properly
		return;
	}
	
	// the address should be a URL now, so we try to get the IP
	TQDns * dns =  new TQDns(addr.addr, TQDns::A);
	TQObject::connect(dns, SIGNAL(resultsReady()), this, SLOT(getResultsSlot()));


	m_Timeout = new TQTimer(this, "dns timer");
	TQObject::connect(m_Timeout, SIGNAL(timeout()), SLOT(slotTimeout()));
	m_Timeout->start(30000, true);
}
Exemple #14
0
KSpriteSaver::KSpriteSaver()
{
    initialise();
    readSettings();
    blank();

    connect(&mTimer, SIGNAL(timeout()), SLOT(slotTimeout()));
    mTimer.setSingleShot(true);
    mTimer.start(120-mSpeed);
}
Exemple #15
0
CDeviceGarmin::CDeviceGarmin(const QString& devkey, const QString& port, QObject * parent)
: IDevice(devkey, parent)
, port(port)
{
    qDebug() << "CDeviceGarmin::CDeviceGarmin()";

    timer = new QTimer(this);
    connect(timer, SIGNAL(timeout()), this, SLOT(slotTimeout()));

}
Exemple #16
0
bool EvaServers::qt_invoke( int _id, QUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: getResultsSlot(); break;
    case 1: slotTimeout(); break;
    default:
	return QObject::qt_invoke( _id, _o );
    }
    return TRUE;
}
Exemple #17
0
/**
 * @class ChameleonMScreen lfjport_qte_mscreen.h
 *
 * @brief ChameleonMScreen class map to a Java widget based drawing widget
 *
 * @note Even thought we may support mscreen per Java graphics context
 * it is not the way we design. Only one ChameleonMScreen should exists.
 */
ChameleonMScreen::ChameleonMScreen(QWidget *parent, const char* name) : QWidget(parent, name)
{
    vm_stopped = false;

    /* Graphics context */
    gc = new QPainter();

    /* Slots */
    connect(&vm_slicer, SIGNAL(timeout()), this, SLOT(slotTimeout()));
}
Exemple #18
0
Flarm::Flarm(QObject* parent) : QObject(parent), FlarmBase()
{
  // Load Flarm alias data
  FlarmAliasList::loadAliasData();

  // Setup timer for data clearing
  m_timer = new QTimer( this );
  m_timer->setSingleShot( true );
  connect( m_timer, SIGNAL(timeout()), this, SLOT(slotTimeout()) );
}
Exemple #19
0
TDMDelayedPushButton::TDMDelayedPushButton( const KGuiItem &item,
                                            TQWidget *parent, 
                                            const char *name )
	: inherited( item, parent, name )
	, pop( 0 )
{
	connect( this, TQT_SIGNAL(pressed()), TQT_SLOT(slotPressed()) );
	connect( this, TQT_SIGNAL(released()), TQT_SLOT(slotReleased()) );
	connect( &popt, TQT_SIGNAL(timeout()), TQT_SLOT(slotTimeout()) );
}
Exemple #20
0
EvaSystemTray::EvaSystemTray(TQWidget* parent, const char* name) 
	: KSystemTray(parent, name), 
	images(NULL), sysMenu(NULL), statusMenu(NULL), isBlinkOn(false)
{
	blinkTimer = new TQTimer(this);
	TQObject::connect(blinkTimer, SIGNAL(timeout()), SLOT(slotTimeout()));

	clickTimer = new TQTimer(this);
	TQObject::connect(clickTimer, SIGNAL(timeout()), SLOT(slotClickTimeout()));
}
Exemple #21
0
MyApplication::MyApplication(const char *conf, int &argc, char **argv)
    : QApplication(argc, argv)
    , renderer(KSharedConfig::openConfig(QFile::decodeName(conf)))
{
    connect(&timer, SIGNAL(timeout()), SLOT(slotTimeout()));
    connect(&renderer, SIGNAL(imageDone()), this, SLOT(renderDone()));
    renderer.enableTiling(true); // optimize
    renderer.changeWallpaper(); // cannot do it when we're killed, so do it now
    timer.start(60000);
    renderer.start();
}
Exemple #22
0
MyApplication::MyApplication( const char *conf )
	: KApplication(),
	  renderer( 0, new KSimpleConfig( QFile::decodeName( conf ) ) )
{
	connect( &timer, SIGNAL(timeout()), SLOT(slotTimeout()) );
	connect( &renderer, SIGNAL(imageDone( int )), this, SLOT(renderDone()) );
	renderer.enableTiling( true ); // optimize
	renderer.changeWallpaper(); // cannot do it when we're killed, so do it now
	timer.start( 60000 );
	renderer.start();
}
Exemple #23
0
CentralWidget::CentralWidget(QWidget *parent) : QWidget(parent), timeOut(DEFAULT_TIMEOUT)
{

    watcher = new QFutureWatcher<QSharedPointer<PatternViewMap>>();
    compiler = new PatternCompiler();
    txt = new TextBasicWidget(this);
    pattern = new PatternsBasicWidget(compiler,this);
    matches = new MatchesBasicWidget(this);
    timeoutTimer = new QTimer(this);
    timeoutTimer->setSingleShot(true);
    QSplitter* vert = new QSplitter();
    QSplitter* horiz = new QSplitter();
    QWidget* containter = new QWidget();
    QHBoxLayout* containterLay = new QHBoxLayout();
    QVBoxLayout* mainLay = new QVBoxLayout();
    containterLay->setContentsMargins(0,0,0,0);
    horiz->addWidget(txt);
    horiz->addWidget(pattern);
    containterLay->addWidget(horiz);
    containter->setLayout(containterLay);
    vert->setOrientation(Qt::Vertical);
    vert->addWidget(containter);
    vert->addWidget(matches);

//    vert->addWidget(progress);
    mainLay->addWidget(vert);
    setLayout(mainLay);
    connect(pattern,SIGNAL(matchClicked()), this,SLOT(slotAnalyze()));
    connect(matches,SIGNAL(patternWasUnchecked(QString)),txt,SLOT(slotPatternUncheked(QString)));
    connect(matches,SIGNAL(patternWasChecked(QString)),txt,SLOT(slotPatternChecked(QString)));
    connect(matches,SIGNAL(showAll()),txt,SLOT(slotHighlightAll()));
    connect(matches,SIGNAL(showAll()),pattern,SLOT(slotDisableMatch()));
    connect(matches,SIGNAL(hideAll()),txt,SLOT(slotDehighlightAll()));
    connect(matches,SIGNAL(rowClicked(int,int)),txt,SLOT(slotSelectFragment(int,int)));
    connect(matches,SIGNAL(patternWasUnchecked(QString)),this,SIGNAL(statusHighlighting()));
    connect(matches,SIGNAL(patternWasChecked(QString)),this,SIGNAL(statusHighlighting()));

    connect(txt,SIGNAL(tabChanged(int)),matches,SLOT(slotChangeTab(int)));
    connect(txt,SIGNAL(tabClosed(int)),matches,SLOT(slotCloseTab(int)));
    connect(txt,SIGNAL(editEnabled()),matches,SLOT(slotClear()));
    connect(txt,SIGNAL(editEnabled()),this,SLOT(slotEdit()));
    connect(txt,SIGNAL(checkingEnabled()),matches,SLOT(slotEnableChecking()));
    connect(txt,SIGNAL(checkingEnabled()),this,SIGNAL(statusReady()));
    connect(txt, SIGNAL(checkingEnabled()),pattern, SLOT(slotEnableMatch()));

    connect(watcher,SIGNAL(finished()),this,SLOT(slotDisplay()));
    connect(timeoutTimer,SIGNAL(timeout()),this,SLOT(slotTimeout()));

    //connect(watcher,SIGNAL(progressValueChanged(int)),this,SLOT(slotProgress(int)));
    if (QFile::exists(CRASH_TEXT) && QFile::exists(CRASH_PATTERNS)){
        loadAfterCrash(CRASH_TEXT, CRASH_PATTERNS);
    }
}
// ----------- SynchronousProcess
SynchronousProcess::SynchronousProcess() :
    m_d(new SynchronousProcessPrivate)
{
    m_d->m_timer.setInterval(1000);
    connect(&m_d->m_timer, SIGNAL(timeout()), this, SLOT(slotTimeout()));
    connect(&m_d->m_process, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(finished(int, QProcess::ExitStatus)));
    connect(&m_d->m_process, SIGNAL(error(QProcess::ProcessError)), this, SLOT(error(QProcess::ProcessError)));
    connect(&m_d->m_process, SIGNAL(readyReadStandardOutput()),
            this, SLOT(stdOutReady()));
    connect(&m_d->m_process, SIGNAL(readyReadStandardError()),
            this, SLOT(stdErrReady()));
}
MotionAwayPlugin::MotionAwayPlugin( QObject *parent, const char *name, const QStringList & /* args */ )
: Kopete::Plugin( MotionAwayPluginFactory::instance(), parent, name )
{
	kdDebug(14305) << k_funcinfo << "Called." << endl;
	/* This should be read from config someday may be */
	m_width = DEF_WIDTH;
	m_height = DEF_HEIGHT;
	m_quality = DEF_QUALITY;
	m_maxChanges = DEF_CHANGES;
	m_gap = DEF_GAP;

	/* We haven't took the first picture yet */
	m_tookFirst = false;

	m_captureTimer = new QTimer(this);
	m_awayTimer = new QTimer(this);

	connect( m_captureTimer, SIGNAL(timeout()), this, SLOT(slotCapture()) );
	connect( m_awayTimer, SIGNAL(timeout()), this, SLOT(slotTimeout()) );

	signal(SIGCHLD, SIG_IGN);

	m_imageRef.resize( m_width * m_height * 3);
	m_imageNew.resize( m_width * m_height * 3);
	m_imageOld.resize( m_width * m_height * 3);
	m_imageOut.resize( m_width * m_height * 3);


	kdDebug(14305) << k_funcinfo << "Opening Video4Linux Device" << endl;

	m_deviceHandler = open( videoDevice.latin1() , O_RDWR);

	if (m_deviceHandler < 0)
	{
		kdDebug(14305) << k_funcinfo << "Can't open Video4Linux Device" << endl;
	}
	else
	{
        kdDebug(14305) << k_funcinfo << "Worked! Setting Capture timers!" << endl;
		/* Capture first image, or we will get a alarm on start */
		getImage (m_deviceHandler, m_imageRef, DEF_WIDTH, DEF_HEIGHT, IN_DEFAULT, NORM_DEFAULT,
	    	VIDEO_PALETTE_RGB24);

        /* We have the first image now */
		m_tookFirst = true;
		m_wentAway = false;

		m_captureTimer->start( DEF_POLL_INTERVAL );
		m_awayTimer->start( awayTimeout * 60 * 1000 );
	}
	loadSettings();
	connect(this, SIGNAL(settingsChanged()), this, SLOT( loadSettings() ) );
}
Exemple #26
0
CDeviceGPSD::CDeviceGPSD(QObject * parent)
: IDevice("GPSD",parent)
, timer( new QTimer(this) )
{
    connect(timer, SIGNAL(timeout()), this, SLOT(slotTimeout()));

    int pipefd[ 2 ];
    // TODO: check for error
    pipe( pipefd );
    thread_fd = pipefd[ 1 ];
    thread = new CGPSDThread( pipefd[ 0 ] );
}
SimpleUI::SimpleUI()
     : KMainWindow(0, "NoatunSimpleUI"), UserInterface()
{
    setAcceptDrops( true );
    setCaption( i18n("Noatun") );
    setIcon( SmallIcon( "noatun" ) );

    setupCentralWidget();
    setupActions();

    contextMenu = video->popupMenu( this );

    setupGUI( StatusBar|Create, "simpleui.rc" );

    connect( napp->player(), SIGNAL(playing()), SLOT(slotPlaying()) );
    connect( napp->player(), SIGNAL(stopped()), SLOT(slotStopped()) );
    connect( napp->player(), SIGNAL(paused()), SLOT(slotPaused()) );
    connect( napp->player(), SIGNAL(timeout()), SLOT(slotTimeout()) );
    connect( napp->player(), SIGNAL(newSong()), SLOT(slotChanged()) );
    connect( napp->player(), SIGNAL(volumeChanged(int)), SLOT(slotVolumeChanged(int)) );
    connect( napp, SIGNAL(hideYourself()), SLOT(hide()) );
    connect( napp, SIGNAL(showYourself()), SLOT(show()) );

    napp->player()->handleButtons();

    resize( minimumSize() );

    // Show UI and calculate video widget frame
    show();

    extra_width  = (width() - video->width());
    extra_height = (height() - video->height());

    // Load configuration
    KConfig &config = *KGlobal::config();
    config.setGroup( "Simple" );
    QString str = config.readEntry( "View", "NormalSize" );

    if (str == "HalfSize")
        video->setHalfSize();
    else if (str == "NormalSize")
        video->setNormalSize();
    else if (str == "DoubleSize")
        video->setDoubleSize();
    else
        applyMainWindowSettings( &config, "Simple" );

    // PlayObject could be running, update video widget
    slotChanged();

    video->give();
}
Exemple #28
0
kSwarmSaver::kSwarmSaver( Drawable drawable ) : kScreenSaver( drawable )
{
	readSettings();

	colorContext = QColor::enterAllocContext();

	batchcount = maxLevels;

	initXLock( gc );
	initswarm( d );

	timer.start( speed );
	connect( &timer, SIGNAL( timeout() ), SLOT( slotTimeout() ) );
}
Exemple #29
0
kSpaceSaver::kSpaceSaver( Drawable drawable ) : kScreenSaver( drawable )
{
	rnd = new KRandomSequence();
	readSettings();
	counter = (int)warpinterval *WARPFACTOR;

	colorContext = TQColor::enterAllocContext();

	initXLock( mGc );
	initSpace( mDrawable );

	timer.start( speed );
	connect( &timer, TQT_SIGNAL( timeout() ), TQT_SLOT( slotTimeout() ) );
}
Exemple #30
0
EFXPreviewArea::EFXPreviewArea(QWidget* parent) : QFrame (parent), m_timer(this)
{
	QPalette p = palette();
	m_reverse = false;

	setAutoFillBackground(true);
	p.setColor(QPalette::Window, p.color(QPalette::Base));
	setPalette(p);

	setFrameStyle(StyledPanel | Sunken);

	m_iter = 0;
	connect(&m_timer, SIGNAL(timeout()), this, SLOT(slotTimeout()));
}