//BEGIN Class Button
Button::Button( const QString & id, CNItem * parent, bool isToggle, const QRect & r, KtlQCanvas * canvas )
	: Widget( id, parent, r, canvas )
{
	b_isToggle = isToggle;
	m_button = new ToolButton(0l);
	m_button->setUsesTextLabel(false);
	m_button->setToggleButton(b_isToggle);
	connect( m_button, SIGNAL(pressed()), this, SLOT(slotStateChanged()) );
	connect( m_button, SIGNAL(released()), this, SLOT(slotStateChanged()) );
	posChanged();
}
Beispiel #2
0
ndManager::ndManager()
    :QMainWindow(0),
      mainDock(0),
      importedFile(false),
      newFile(false),
      managerView(0L),
      parameterView(0)
{

    setObjectName("NDManager");
    mMainToolBar = new QToolBar();
    mMainToolBar->setObjectName("maintoolbar");

    addToolBar(mMainToolBar);

    //Create a ndManagereDoc which will hold the document manipulated by the application.
    doc = new ndManagerDoc(this);

    //Setup the actions
    setupActions();

    initStatusBar();
    //Disable some actions at startup (see the ndManager.rc file)
    slotStateChanged("initState");

    slotViewStatusBar();
    readSettings();
}
Beispiel #3
0
void ndManager::createParameterView(QMap<int, QList<int> >& anatomicalGroups,QMap<QString, QMap<int,QString> >& attributes,
                                    QMap<int, QList<int> >& spikeGroups,QMap<int, QMap<QString,QString> >& spikeGroupsInformation,QMap<int, QStringList >& units,
                                    GeneralInformation& generalInformation,QMap<QString,double>& acquisitionSystemInfo,QMap<QString,double>& videoInformation,
                                    QList<FileInformation>& files,QList<ChannelColors>& channelColors,QMap<int,int>& channelOffsets,
                                    NeuroscopeVideoInfo& neuroscopeVideoInfo,QList<ProgramInformation>& programs,
                                    double lfpRate,float screenGain,int nbSamples,int peakSampleIndex,const QString& traceBackgroundImage){

    //Create the mainDock (parameter view)
    delete mainDock;
    mainDock = new QDockWidget(tr("Parameters"));

    parameterView = new ParameterView(this,*doc,mainDock,"ParameterView",mExpertMode->isChecked());

    connect(parameterView,SIGNAL(nbSpikeGroupsHasBeenModified(int)),this,SLOT(nbSpikeGroupsModified(int)));
    connect(parameterView,SIGNAL(fileHasBeenModified(QStringList)),this,SLOT(fileModification(QStringList)));
    //connect(parameterView,SIGNAL(scriptListHasBeenModified(QStringList)),this,SLOT(scriptModification(QStringList)));



    parameterView->initialize(anatomicalGroups,attributes,spikeGroups,spikeGroupsInformation,units,generalInformation,
                              acquisitionSystemInfo,videoInformation,files,channelColors,channelOffsets,neuroscopeVideoInfo,programs,lfpRate,screenGain,nbSamples,peakSampleIndex,traceBackgroundImage);

    mainDock->setWidget(parameterView);
    //allow dock on the Bottom side only
    setCentralWidget(parameterView); // central widget in a KDE mainwindow <=> setMainWidget
    //Enable some actions now that a document is open (see the klustersui.rc file)
    slotStateChanged("documentState");

}
Beispiel #4
0
AssignNameWidgetHidingStateChanger::AssignNameWidgetHidingStateChanger(FaceItem* const item)
    : HidingStateChanger(item->widget(), "mode", item)
{
    // The WidgetProxyItem
    addItem(item->hudWidget());

    connect(this, SIGNAL(stateChanged()),
            this, SLOT(slotStateChanged()));
}
Beispiel #5
0
ProcessEx::ProcessEx(QObject *parent)
    : QProcess(parent), m_suppressFinish(false)
{
    connect(this,SIGNAL(stateChanged(QProcess::ProcessState)),this,SLOT(slotStateChanged(QProcess::ProcessState)));
    connect(this,SIGNAL(readyReadStandardOutput()),this,SLOT(slotReadOutput()));
    connect(this,SIGNAL(readyReadStandardError()),this,SLOT(slotReadError()));
    connect(this,SIGNAL(error(QProcess::ProcessError)),this,SLOT(slotError(QProcess::ProcessError)));
    connect(this,SIGNAL(finished(int,QProcess::ExitStatus)),this,SLOT(slotFinished(int,QProcess::ExitStatus)));
}
Beispiel #6
0
void GDBOutputWidget::currentSessionChanged(KDevelop::IDebugSession* s)
{
    DebugSession *session = qobject_cast<DebugSession*>(s);
    if (!session) return;
     connect( this,       SIGNAL(userGDBCmd(QString)),
             session, SLOT(slotUserGDBCmd(QString)));
     connect( this,       SIGNAL(breakInto()),
             session, SLOT(interruptDebugger()));

     connect( session, SIGNAL(gdbInternalCommandStdout(QString)),
             this,       SLOT(slotInternalCommandStdout(QString)) );
     connect( session, SIGNAL(gdbUserCommandStdout(QString)),
             this,       SLOT(slotUserCommandStdout(QString)) );

     connect( session, SIGNAL(gdbStateChanged(DBGStateFlags,DBGStateFlags)),
             this,       SLOT(slotStateChanged(DBGStateFlags,DBGStateFlags)));

     slotStateChanged(s_none, session->debuggerState());
}
void AutoBarcodeScanner::createConnections() {
    // error handling
    connect(m_camera, SIGNAL(error(QCamera::Error)), this, SLOT(slotCameraError(QCamera::Error)));

    // for debugging
    connect(m_camera, SIGNAL(statusChanged(QCamera::Status)),
            this, SLOT(slotStatusChanged(QCamera::Status)));
    connect(m_camera, SIGNAL(stateChanged(QCamera::State)),
            this, SLOT(slotStateChanged(QCamera::State)));
}
void Solid::Control::ModemGsmUssdInterface::makeConnections(QObject * source)
{
    if (source) {
        QObject::connect(source, SIGNAL(stateChanged(QString)),
                this, SLOT(slotStateChanged(QString)));
        QObject::connect(source, SIGNAL(networkNotificationChanged(QString)),
                this, SLOT(slotNetworkNotificationChanged(QString)));
        QObject::connect(source, SIGNAL(networkRequestChanged(QString)),
                this, SLOT(slotNetworkRequestChanged(QString)));
    }
}
void Button::setState( bool state )
{
	if ( this->state() == state )
		return;
	
	if ( isToggle() )
		m_button->setOn(state);
	else
		m_button->setDown(state);
	
	slotStateChanged();
}
void
EngineController::initializePhonon()
{
    DEBUG_BLOCK

    delete m_media;
    delete m_audio;
    delete m_preamp;

    PERF_LOG( "EngineController: loading phonon objects" )
    m_media = new Phonon::MediaObject( this );
    m_audio = new Phonon::AudioOutput( Phonon::MusicCategory, this );

    m_path = Phonon::createPath( m_media, m_audio );
    
    // HACK we turn off replaygain manually on OSX, until the phonon coreaudio backend is fixed.
    // as the default is specified in the .cfg file, we can't just tell it to be a different default on OSX
#ifdef Q_WS_MAC
    AmarokConfig::setReplayGainMode( AmarokConfig::EnumReplayGainMode::Off );
#endif

    // only create pre-amp if we have replaygain on, preamp can cause phonon issues
    if( AmarokConfig::replayGainMode() != AmarokConfig::EnumReplayGainMode::Off )
    {   
        m_preamp = new Phonon::VolumeFaderEffect( this );
        m_path.insertEffect( m_preamp );
    }

    m_media->setTickInterval( 100 );
    debug() << "Tick Interval (actual): " << m_media->tickInterval();
    PERF_LOG( "EngineController: loaded phonon objects" )

    // Get the next track when there is 2 seconds left on the current one.
    m_media->setPrefinishMark( 2000 );

    connect( m_media, SIGNAL( finished() ), SLOT( slotQueueEnded() ) );
    connect( m_media, SIGNAL( aboutToFinish()), SLOT( slotAboutToFinish() ) );
    connect( m_media, SIGNAL( metaDataChanged() ), SLOT( slotMetaDataChanged() ) );
    connect( m_media, SIGNAL( stateChanged( Phonon::State, Phonon::State ) ), SLOT( slotStateChanged( Phonon::State, Phonon::State ) ) );
    connect( m_media, SIGNAL( tick( qint64 ) ), SLOT( slotTick( qint64 ) ) );
    connect( m_media, SIGNAL( totalTimeChanged( qint64 ) ), SLOT( slotTrackLengthChanged( qint64 ) ) );
    connect( m_media, SIGNAL( currentSourceChanged( const Phonon::MediaSource & ) ), SLOT( slotNewTrackPlaying( const Phonon::MediaSource & ) ) );

    
    //TODO: The xine engine does not support crossfading. Cannot get the gstreamer engine to work, will test this once I do.
#if 0
    if( AmarokConfig::trackDelayLength() > -1 )
        m_media->setTransitionTime( AmarokConfig::trackDelayLength() ); // Also Handles gapless.
    else if( AmarokConfig::crossfadeLength() > 0 )  // TODO: Handle the possible options on when to crossfade.. the values are not documented anywhere however
        m_media->setTransitionTime( -AmarokConfig::crossfadeLength() );
#endif
}
int CServiceSendFtpGprs::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = CServiceAbstractObject::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: signalSendData(); break;
        case 1: slotUpdate(); break;
        case 2: slotSendFile(); break;
        case 3: slotStateChanged((*reinterpret_cast< int(*)>(_a[1]))); break;
        default: ;
        }
        _id -= 4;
    }
    return _id;
}
Beispiel #12
0
void GDBOutputWidget::currentSessionChanged(KDevelop::IDebugSession* s)
{
    DebugSession *session = qobject_cast<DebugSession*>(s);
    if (!session) return;
     connect(this, &GDBOutputWidget::userGDBCmd,
             session, &DebugSession::slotUserGDBCmd);
     connect(this, &GDBOutputWidget::breakInto,
             session, &DebugSession::interruptDebugger);

     connect(session, &DebugSession::gdbInternalCommandStdout,
             this, &GDBOutputWidget::slotInternalCommandStdout);
     connect(session, &DebugSession::gdbUserCommandStdout,
             this, &GDBOutputWidget::slotUserCommandStdout);

     connect(session, &DebugSession::gdbStateChanged,
             this, &GDBOutputWidget::slotStateChanged);

     slotStateChanged(s_none, session->debuggerState());
}
OwncloudSetupWizard::OwncloudSetupWizard( FolderMan *folderMan, QObject *parent ) :
    QObject( parent ),
    _ocInfo(0),
    _folderMan(folderMan)
{
    _process = new QProcess( this );

    QObject::connect(_process, SIGNAL(readyReadStandardOutput()),
                     SLOT(slotReadyReadStandardOutput()));

    QObject::connect(_process, SIGNAL(readyReadStandardError()),
                     SLOT(slotReadyReadStandardError()));

    QObject::connect(_process, SIGNAL(stateChanged(QProcess::ProcessState)),
                     SLOT(slotStateChanged(QProcess::ProcessState)));

    QObject::connect(_process, SIGNAL(error(QProcess::ProcessError)),
                     SLOT(slotError(QProcess::ProcessError)));

    QObject::connect(_process, SIGNAL(started()),
                     SLOT(slotStarted()));

    QObject::connect(_process, SIGNAL(finished(int, QProcess::ExitStatus)),
                     SLOT(slotProcessFinished(int, QProcess::ExitStatus)));


    _ocWizard = new OwncloudWizard();

    connect( _ocWizard, SIGNAL(connectToOCUrl( const QString& ) ),
             this, SLOT(slotConnectToOCUrl( const QString& )));

    connect( _ocWizard, SIGNAL(installOCServer()),
             this, SLOT(slotInstallOCServer()));

    connect( _ocWizard, SIGNAL(installOCLocalhost()),
             this, SLOT(slotCreateOCLocalhost()));

    // in case of cancel, terminate the owncloud-admin script.
    connect( _ocWizard, SIGNAL(rejected()), _process, SLOT(terminate()));

}
void BarcodeScanner::createConnections() {
    // init connections
    connect(camera, SIGNAL(lockStatusChanged(QCamera::LockStatus, QCamera::LockChangeReason)),
            this, SLOT(slotLockStatusChanged(QCamera::LockStatus)));
    connect(imageCapture, SIGNAL(imageSaved(int, QString)), this, SLOT(slotImageSaved()));

    // error handling
    connect(camera, SIGNAL(lockFailed()), this, SLOT(slotLockFailed()));
    connect(imageCapture, SIGNAL(error(int, QCameraImageCapture::Error, const QString&)), this, SLOT(slotCaptureFailed()));
    connect(camera, SIGNAL(error(QCamera::Error)), this, SLOT(slotCameraError(QCamera::Error)));

    // to stop camera after scan process if necessary
    connect(this, SIGNAL(decodingFinished(const QString)),
            this, SLOT(slotDecodingFinished()));

    // for debugging
    connect(camera, SIGNAL(statusChanged(QCamera::Status)),
            this, SLOT(slotStatusChanged(QCamera::Status)));
    connect(camera, SIGNAL(stateChanged(QCamera::State)),
            this, SLOT(slotStateChanged(QCamera::State)));
}
Beispiel #15
0
Mpris2::Mpris2(TrayIcon* trayicon) : QObject(trayicon)
{
    m_trayicon = trayicon;

    if (!QDBusConnection::sessionBus().registerService("org.mpris.MediaPlayer2.kdoubanfm")) {
        kWarning() << "registerService failed";
        return;
    }

    new MprisAdaptor(this);
    new MprisPlayerAdaptor(this);

    QDBusConnection::sessionBus().registerObject("/org/mpris/MediaPlayer2", this);

    connect(m_trayicon->m_media, SIGNAL(currentSourceChanged(Phonon::MediaSource)),
            this, SLOT(slotCurrentSourceChanged()));
    connect(m_trayicon->m_media, SIGNAL(stateChanged(Phonon::State,Phonon::State)),
            this, SLOT(slotStateChanged(Phonon::State,Phonon::State)));
    connect(m_trayicon->m_output, SIGNAL(volumeChanged(qreal)),
            this, SLOT(slotVolumeChanged(qreal)));
}
Beispiel #16
0
GDBOutputWidget::GDBOutputWidget(CppDebuggerPlugin* plugin, QWidget *parent) :
    QWidget(parent),
    m_userGDBCmdEditor(0),
    m_Interrupt(0),
    m_gdbView(0),
    showInternalCommands_(false),
    maxLines_(5000)
{
    setWindowIcon(QIcon::fromTheme("dialog-scripts", windowIcon()));
    setWindowTitle(i18n("GDB Output"));
    setWhatsThis(i18n("<b>GDB output</b><p>"
                    "Shows all gdb commands being executed. "
                    "You can also issue any other gdb command while debugging.</p>"));

    m_gdbView = new OutputTextEdit(this);
    m_gdbView->setReadOnly(true);

    m_userGDBCmdEditor = new KHistoryComboBox (this);

    QLabel *label = new QLabel(i18n("&GDB cmd:"), this);
    label->setBuddy(m_userGDBCmdEditor);

    m_Interrupt = new QToolButton( this );
    m_Interrupt->setIcon ( QIcon::fromTheme( "media-playback-pause" ) );
    m_Interrupt->setToolTip( i18n ( "Pause execution of the app to enter gdb commands" ) );

    QVBoxLayout *topLayout = new QVBoxLayout(this);
    topLayout->addWidget(m_gdbView);
    topLayout->setStretchFactor(m_gdbView, 1);
    topLayout->setMargin(0);

    QBoxLayout *userGDBCmdEntry = new QHBoxLayout();
    userGDBCmdEntry->addWidget(label);
    userGDBCmdEntry->addWidget(m_userGDBCmdEditor);
    userGDBCmdEntry->setStretchFactor(m_userGDBCmdEditor, 1);
    userGDBCmdEntry->addWidget(m_Interrupt);
    topLayout->addLayout(userGDBCmdEntry);

    setLayout(topLayout);

    slotStateChanged(s_none, s_dbgNotStarted);

    connect(m_userGDBCmdEditor, static_cast<void(KHistoryComboBox::*)()>(&KHistoryComboBox::returnPressed),
            this, &GDBOutputWidget::slotGDBCmd);
    connect(m_Interrupt, &QToolButton::clicked, this, &GDBOutputWidget::breakInto);

    updateTimer_.setSingleShot(true);
    connect(&updateTimer_, &QTimer::timeout,
             this, &GDBOutputWidget::flushPending);

    connect(KDevelop::ICore::self()->debugController(), &KDevelop::IDebugController::currentSessionChanged,
            this, &GDBOutputWidget::currentSessionChanged);

    connect(plugin, &CppDebuggerPlugin::reset, this, &GDBOutputWidget::clear);
    connect(plugin, &CppDebuggerPlugin::raiseGdbConsoleViews, this, &GDBOutputWidget::requestRaise);

    currentSessionChanged(KDevelop::ICore::self()->debugController()->currentSession());

//     TODO Port to KF5
//     connect(KGlobalSettings::self(), SIGNAL(kdisplayPaletteChanged()),
//             this, SLOT(updateColors()));
    updateColors();

}
Beispiel #17
0
PhononAudioOutput::PhononAudioOutput() :
    offset_(0)
{
    audioOutput_ = new Phonon::AudioOutput(Phonon::MusicCategory, this);
    mediaObject_ = new Phonon::MediaObject(this);
    Phonon::createPath(mediaObject_, audioOutput_);
    QObject::connect(mediaObject_, SIGNAL(aboutToFinish()), this, SLOT(aboutToFinishHandler()));
    QObject::connect(mediaObject_, SIGNAL(currentSourceChanged(const Phonon::MediaSource &)), this, SLOT(currentSourceChangedHandler()));
    QObject::connect(mediaObject_, SIGNAL(tick(qint64)), this, SLOT(tickHandler(qint64)));
    QObject::connect(mediaObject_, SIGNAL(stateChanged(Phonon::State,Phonon::State)), this, SLOT(slotStateChanged(Phonon::State)));
    QObject::connect(mediaObject_, SIGNAL(seekableChanged(bool)), this, SLOT(slotSeekableChanged(bool)));
    QObject::connect(mediaObject_, SIGNAL(finished()), this, SLOT(slotFinished()));
    mediaObject_->setTickInterval(1000);
}