예제 #1
0
void Notification::setup(QPWRDEvents *_ev, QPWRDClient *_cl)
{
    ev = _ev;
    cl = _cl;

    connect(ev, SIGNAL(backlightChanged(int,int)), this, SLOT(backlightChanged(int,int)));
    connect(ev, SIGNAL(batteryStateChanged(int,PWRBatteryStatus)), this, SLOT(batteryStateChanged(int,PWRBatteryStatus)));
    connect(ev, SIGNAL(acLineStateChanged(bool)), this, SLOT(acLineStateChanged(bool)));
    connect(ev, SIGNAL(profileChanged(QString)), this, SLOT(profileChanged(QString)));
}
예제 #2
0
파일: player.cpp 프로젝트: AresDice/shotcut
void Player::onProducerOpened(bool play)
{
    m_duration = MLT.producer()->get_length();
    m_isSeekable = MLT.isSeekable();
    MLT.producer()->set("ignore_points", 1);
    m_scrubber->setFramerate(MLT.profile().fps());
    m_scrubber->setScale(m_duration);
    if (!MLT.isPlaylist())
        m_scrubber->setMarkers(QList<int>());
    m_inPointLabel->setText("--:--:--:-- / ");
    m_selectedLabel->setText("--:--:--:--");
    if (m_isSeekable) {
        m_durationLabel->setText(QString(MLT.producer()->get_length_time()).prepend(" / "));
        m_previousIn = MLT.isClip()? MLT.producer()->get_in() : -1;
        m_scrubber->setEnabled(true);
        m_scrubber->setInPoint(m_previousIn);
        m_previousOut = MLT.isClip()? MLT.producer()->get_out() : -1;
        m_scrubber->setOutPoint(m_previousOut);
    }
    else {
        m_durationLabel->setText(tr("Live").prepend(" / "));
        m_scrubber->setDisabled(true);
        // cause scrubber redraw
        m_scrubber->setScale(m_duration);
    }
    m_positionSpinner->setEnabled(m_isSeekable);
    onVolumeChanged(m_volumeSlider->value());
    m_savedVolume = MLT.volume();
    onMuteButtonToggled(Settings.playerMuted());
    toggleZoom(Settings.playerZoom() > 0.0f);

    actionPlay->setEnabled(true);
    actionSkipPrevious->setEnabled(m_isSeekable);
    actionSkipNext->setEnabled(m_isSeekable);
    actionRewind->setEnabled(m_isSeekable);
    actionFastForward->setEnabled(m_isSeekable);

    if (!MLT.profile().is_explicit())
        emit profileChanged();
    connectTransport(MLT.transportControl());

    // Closing the previous producer might call pause() milliseconds before
    // calling play() here. Delays while purging the consumer on pause can
    // interfere with the play() call. So, we delay play a little to let
    // pause purging to complete.
    if (play) {
        if (m_pauseAfterOpen) {
            m_pauseAfterOpen = false;
            QTimer::singleShot(500, this, SLOT(postProducerOpened()));
        } else {
            if (MLT.consumer()->is_stopped()) {
                this->play();
            } else {
                // This seek purges the consumer to prevent latent end-of-stream detection.
                seek(0);
                QTimer::singleShot(500, this, SLOT(play()));
            }
        }
    }
}
예제 #3
0
LoginDialog::LoginDialog(bool bInit, Client *client)
        : LoginDialogBase(NULL, "logindlg",
                          client ? false : true,
                          client ? WDestructiveClose : 0)
{
    m_bInit  = bInit;
    m_bProfileChanged = false;
    m_profile = CorePlugin::m_plugin->getProfile();
    m_client = client;
    SET_WNDPROC("login")
    setIcon(Pict("licq"));
    setButtonsPict(this);
    if (m_client){
        setCaption(caption());
    }else{
        setCaption(i18n("Select profile"));
    }
    if (m_client){
        chkSave->hide();
        chkNoShow->hide();
        btnDelete->hide();
        cmbProfile->hide();
        lblProfile->hide();
    }
    chkSave->setChecked(CorePlugin::m_plugin->getSavePasswd());
    chkNoShow->setChecked(CorePlugin::m_plugin->getNoShow());
    connect(buttonOk, SIGNAL(clicked()), this, SLOT(apply()));
    connect(chkSave, SIGNAL(toggled(bool)), this, SLOT(saveToggled(bool)));
    saveToggled(CorePlugin::m_plugin->getSavePasswd());
    fill();
    connect(cmbProfile, SIGNAL(activated(int)), this, SLOT(profileChanged(int)));
    connect(btnDelete, SIGNAL(clicked()), this, SLOT(profileDelete()));
    profileChanged(cmbProfile->currentItem());
}
예제 #4
0
void OptionsSimple::updateProfiles()
{
    const QString lastProfile = cProfile->currentText();
    QStringList sProfile;
    cProfile->clear();

    sProfile += i18n("Very low");
    sProfile += i18n("Low");
    sProfile += i18n("Medium");
    sProfile += i18n("High");
    sProfile += i18n("Very high");
    sProfile += i18n("Lossless");
//     sProfile += i18n("Hybrid"); // currently unused
    sProfile += config->customProfiles();
    sProfile += i18n("User defined");
    cProfile->addItems( sProfile );

    if( cProfile->findText(lastProfile) != -1 )
    {
        cProfile->setCurrentIndex( cProfile->findText(lastProfile) );
    }
    else
    {
        profileChanged();
    }
}
예제 #5
0
void AccountManager::setAuthURL(const QUrl& authURL) {
    if (_authURL != authURL) {
        _authURL = authURL;

        qDebug() << "URL for node authentication has been changed to" << qPrintable(_authURL.toString());
        qDebug() << "Re-setting authentication flow.";

        // check if there are existing access tokens to load from settings
        QSettings settings;
        settings.beginGroup(ACCOUNTS_GROUP);

        foreach(const QString& key, settings.allKeys()) {
            // take a key copy to perform the double slash replacement
            QString keyCopy(key);
            QUrl keyURL(keyCopy.replace("slashslash", "//"));

            if (keyURL == _authURL) {
                // pull out the stored access token and store it in memory
                _accountInfo = settings.value(key).value<DataServerAccountInfo>();
                qDebug() << "Found a data-server access token for" << qPrintable(keyURL.toString());

                // profile info isn't guaranteed to be saved too
                if (_accountInfo.hasProfile()) {
                    emit profileChanged();
                } else {
                    requestProfile();
                }
            }
        }

        // tell listeners that the auth endpoint has changed
        emit authEndpointChanged();
    }
예제 #6
0
void ProfileAction::setProfile(const QString &profile)
{
    Q_D(ProfileAction);
    if (d->profile != profile) {
        d->profile = profile;
        emit profileChanged();
    }
}
void ProfileControl::setProfile(const QString &profile)
{
    if (profile != m_profile) {
        m_profile = profile;
        emit profileChanged(profile);
        profile_set_profile(profile.toUtf8().constData());
    }
}
예제 #8
0
XmppClient::XmppClient() :
    _xmppClient(),
    _xmppMUCManager()
{
    AccountManager& accountManager = AccountManager::getInstance();
    connect(&accountManager, SIGNAL(profileChanged()), this, SLOT(connectToServer()));
    connect(&accountManager, SIGNAL(logoutComplete()), this, SLOT(disconnectFromServer()));
}
예제 #9
0
void ESURegistration::setProfile(ESURegistration::Profile profile)
{
    if( d->profile != profile ) {
        d->profile = profile;

        Q_EMIT profileChanged();
        Q_EMIT isRegistrarChanged();
        Q_EMIT isRegistrarMainChanged();
    }
}
예제 #10
0
AbstractXmlItemObject * UsersModel::newItem()
{
    User *newItem = new User(this);
    connect(newItem, SIGNAL(idChanged()), this, SLOT(itemDataChanged()));
    connect(newItem, SIGNAL(additionalDataChanged()), this, SLOT(itemDataChanged()));

    connect(newItem, SIGNAL(profileChanged()), this, SLOT(itemDataChanged()));
    connect(newItem, SIGNAL(onlineChanged()), this, SLOT(itemDataChanged()));
    connect(newItem, SIGNAL(friendshipAcceptedChanged()), this, SLOT(itemDataChanged()));
    return newItem;
}
예제 #11
0
void OptionsSimple::outputDirectoryChanged()
{
    const QString profileName = cProfile->currentText();
    ConversionOptions *conversionOptions = config->data.profiles.value( profileName );
    if( conversionOptions )
    {
        if( conversionOptions->outputDirectoryMode != outputDirectory->mode() || conversionOptions->outputDirectory != outputDirectory->directory() )
        {
            cProfile->setCurrentIndex( cProfile->findText(i18n("User defined")) );
            profileChanged();
        }
    }
}
예제 #12
0
WindowFacade::WindowFacade(QObject *parent) : QObject(parent) {
    mainWindow = (MainWindow*)parent;    
    genericWindowFactory = new GenericWindowFactory(parent);
    compass = new Compass(parent);
    gameDataContainer = GameDataContainer::Instance();
    clientSettings = ClientSettings::getInstance();
    settings = HighlightSettings::getInstance();
    generalSettings = GeneralSettings::getInstance();
    mainLogger = new MainLogger(this);

    rxRemoveTags.setPattern("<[^>]*>");

    writePrompt = true;

    connect(mainWindow, SIGNAL(profileChanged()), this, SLOT(reloadSettings()));
    connect(this, SIGNAL(updateWindowSettings()), mainLogger, SLOT(updateSettings()));
}
예제 #13
0
void GameProfile::setCurrentPlayer(const QString &name)
{
    if (name.isEmpty()) return;

    int index = -1;
    for (int i = 0; i < m_players.count(); i++)
        if (m_players.at(i)->name == name) {
            index = i;
            break;
        }
    if (index == -1) {
        m_players.append(new PlayerInfo(name));
        m_current = m_players.count() - 1;
    }
    else
        m_current = index;

    emit profileChanged();
}
예제 #14
0
void ColordEngine::init()
{
    // Creates a ColorD interface, it must be created with new
    // otherwise the object will be deleted when this block ends
    QDBusInterface *interface;
    interface = new QDBusInterface(QLatin1String("org.freedesktop.ColorManager"),
                                   QLatin1String("/org/freedesktop/ColorManager"),
                                   QLatin1String("org.freedesktop.ColorManager"),
                                   QDBusConnection::systemBus(),
                                   this);
    // listen to colord for device events
    connect(interface, SIGNAL(DeviceAdded(QDBusObjectPath)),
            this, SLOT(deviceAdded(QDBusObjectPath)));
    connect(interface, SIGNAL(DeviceRemoved(QDBusObjectPath)),
            this, SLOT(deviceRemoved(QDBusObjectPath)));
    connect(interface, SIGNAL(DeviceChanged(QDBusObjectPath)),
            this, SLOT(deviceChanged(QDBusObjectPath)));

    // listen to colord for profile events
    connect(interface, SIGNAL(ProfileAdded(QDBusObjectPath)),
            this, SLOT(profileAdded(QDBusObjectPath)));
    connect(interface, SIGNAL(ProfileRemoved(QDBusObjectPath)),
            this, SLOT(profileRemoved(QDBusObjectPath)));
    connect(interface, SIGNAL(ProfileChanged(QDBusObjectPath)),
            this, SLOT(profileChanged(QDBusObjectPath)));

    // Ask for profiles
    QDBusMessage msg;
    msg = QDBusMessage::createMethodCall(QLatin1String("org.freedesktop.ColorManager"),
                                         QLatin1String("/org/freedesktop/ColorManager"),
                                         QLatin1String("org.freedesktop.ColorManager"),
                                         QLatin1String("GetProfiles"));
    QDBusConnection::systemBus().callWithCallback(msg, this, SLOT(gotProfiles(QDBusMessage)));

    // Ask for devices
    QDBusMessage message;
    message = QDBusMessage::createMethodCall(QLatin1String("org.freedesktop.ColorManager"),
                                             QLatin1String("/org/freedesktop/ColorManager"),
                                             QLatin1String("org.freedesktop.ColorManager"),
                                             QLatin1String("GetDevices"));
    QDBusConnection::systemBus().callWithCallback(message, this, SLOT(gotDevices(QDBusMessage)));
}
예제 #15
0
LoginDialog::LoginDialog(bool bInit, Client *client, const QString &text, const char *loginProfile)
        : LoginDialogBase(NULL, "logindlg",
                          client ? false : true,
                          client ? WDestructiveClose : 0)
{
    m_bInit  = bInit;
    m_bProfileChanged = false;
    m_profile = CorePlugin::m_plugin->getProfile();
    m_client = client;
    m_bLogin = false;
    if (loginProfile && *loginProfile){
        m_loginProfile = loginProfile;
    }else{
        btnDelete->hide();
    }
    SET_WNDPROC("login")
    setButtonsPict(this);
    lblMessage->setText(text);
    if (m_client){
        setCaption(caption() + " " + QString::fromLocal8Bit(client->name().c_str()));
        setIcon(Pict(m_client->protocol()->description()->icon));
    }else{
        setCaption(i18n("Select profile"));
        setIcon(Pict("licq"));
    }
    if (m_client){
        chkSave->hide();
        chkNoShow->hide();
        btnDelete->hide();
        cmbProfile->hide();
        lblProfile->hide();
    }
    chkSave->setChecked(CorePlugin::m_plugin->getSavePasswd());
    chkNoShow->setChecked(CorePlugin::m_plugin->getNoShow());
    connect(chkSave, SIGNAL(toggled(bool)), this, SLOT(saveToggled(bool)));
    saveToggled(CorePlugin::m_plugin->getSavePasswd());
    fill();
    connect(cmbProfile, SIGNAL(activated(int)), this, SLOT(profileChanged(int)));
    connect(btnDelete, SIGNAL(clicked()), this, SLOT(profileDelete()));
    profileChanged(cmbProfile->currentItem());
}
예제 #16
0
int StatusBarInfo::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QObject::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: profileChanged((*reinterpret_cast< QSystemDeviceInfo::Profile(*)>(_a[1]))); break;
        case 1: signalStrengthChanged((*reinterpret_cast< QSystemNetworkInfo::NetworkMode(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break;
        case 2: batteryBarsChanged((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 3: chargingChanged((*reinterpret_cast< QSystemDeviceInfo::PowerState(*)>(_a[1]))); break;
        case 4: networkModeChanged((*reinterpret_cast< QSystemNetworkInfo::NetworkMode(*)>(_a[1]))); break;
        case 5: networkNameChanged((*reinterpret_cast< QSystemNetworkInfo::NetworkMode(*)>(_a[1])),(*reinterpret_cast< const QString(*)>(_a[2]))); break;
        case 6: bluetoothChanged((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 7: stateChanged((*reinterpret_cast< QSystemNetworkInfo::NetworkMode(*)>(_a[1])),(*reinterpret_cast< QSystemNetworkInfo::NetworkStatus(*)>(_a[2]))); break;
        default: ;
        }
        _id -= 8;
    }
    return _id;
}
예제 #17
0
void LearningProgressModel::setProfile(Profile* profile)
{
    if (profile != m_profile)
    {
        if (m_profile)
        {
            m_profile->disconnect(this);
        }

        m_profile = profile;

        if (m_profile)
        {
            connect(m_profile, SIGNAL(idChanged()), SLOT(update()));
            connect(m_profile, SIGNAL(destroyed()), SLOT(profileDestroyed()));
        }

        update();
        emit profileChanged();
    }
}
예제 #18
0
/*!
  \internal

  Create a new RingControl instance with the specified \a parent.
 */
RingControl::RingControl(QObject *parent)
: QObject(parent)
{
    d = new RingControlPrivate;
    d->videoAdaptor = new QtopiaIpcAdaptor( "QPE/VideoRingtone", this );
    QtopiaIpcAdaptor::connect( d->videoAdaptor, MESSAGE(videoRingtoneFailed()),
                               this, SLOT(videoRingtoneFailed()) );

    d->profileManager = new QPhoneProfileManager(this);
    QPhoneProfile prof = d->profileManager->activeProfile();
    setVolume(prof.volume());
    setMsgRingTime(prof.msgAlertDuration());

    connect(DialerControl::instance(), SIGNAL(stateChanged()),
            this, SLOT(stateChanged()));

    QObject::connect(d->profileManager,
                     SIGNAL(activeProfileChanged(QPhoneProfile)),
                     this,
                     SLOT(profileChanged()));

    QObject::connect(qtopiaTask<SystemSuspend>(), SIGNAL(systemSuspending()),
            this, SLOT(stopMessageAlert()));

    // Implement ringtone service
    RingtoneServiceProxy *ringtoneServiceProxy = new RingtoneServiceProxy(this);
    connect(ringtoneServiceProxy, SIGNAL(doStartMessageRingtone()),
            this, SLOT(startMessageRingtone()));
    connect(ringtoneServiceProxy, SIGNAL(doStopMessageRingtone()),
            this, SLOT(stopMessageRingtone()));
    connect(ringtoneServiceProxy, SIGNAL(doStartRingtone(QString)),
            this, SLOT(startRingtone(QString)));
    connect(ringtoneServiceProxy, SIGNAL(doStopRingtone(QString)),
            this, SLOT(stopRingtone(QString)));
    connect(ringtoneServiceProxy, SIGNAL(doMuteRing()),
            this, SLOT(muteRing()));

    d->curAlertType = QPhoneProfile::Off;
}
예제 #19
0
파일: gamescene.cpp 프로젝트: neoclust/jag
GameScene::GameScene(QWidget *parent) :
    QGraphicsScene(parent),
    myLock(false)
{
  inputDisabled = true;

  dconfirm = new ConfirmDialog();
  addWidget(dconfirm, Qt::FramelessWindowHint);
  dconfirm->hide();

  menu = new MenuWidget();
  addWidget(menu);
  menu->activate();

  connect(menu, SIGNAL(menuNew()), this, SLOT(on_menuNew()));
  connect(menu, SIGNAL(menuContinue()), this, SLOT(on_menuContinue()));
  connect(menu, SIGNAL(menuExit()), this, SLOT(on_menuExit()));
  connect(menu, SIGNAL(menuPauseBack()), this, SLOT(on_menuPauseBack()));
  connect(menu, SIGNAL(menuRestartLevel()), this, SLOT(on_menuRestartLevel()));
  connect(menu, SIGNAL(menuAbandonGame()), this, SLOT(on_menuAbandonGame()));
  connect(menu, SIGNAL(menuThemeChanged()), this, SLOT(on_menuThemeChanged()));
  connect(menu, SIGNAL(menuGameStart()), this, SLOT(on_menuGameStart()));
  connect(menu, SIGNAL(menuLevelPack()), this, SLOT(on_menuLevelPack()));

  stat = new StatInfo();

  connect(gameProfile, SIGNAL(profileChanged()), this, SLOT(initProfile()));

  rows = cols = 0;

  xoff = 20;
  yoff = 10;

  advanceTimer = new QTimer(this);
  advanceTimer->setInterval(30);
  connect(advanceTimer, SIGNAL(timeout()), this, SLOT(nextCycle()));

  timeTimer = new QTimer(this);
  timeTimer->setInterval(1000);
  connect(timeTimer, SIGNAL(timeout()), this, SLOT(countTime()));

  bonusTimer = new QTimer(this);
  bonusTimer->setInterval(500);
  connect(bonusTimer, SIGNAL(timeout()), this, SLOT(countBonusTime()));

  hintTimer = new QTimer(this);
  hintTimer->setInterval(10000);
  connect(hintTimer, SIGNAL(timeout()), this, SLOT(hintAvailableMoves()));

  // init components
  GameStock::init();

  toolset = new ToolSet();

  gameBonus = new GameBonus();

  setSceneRect(0,0, WIDTH, HEIGHT);

  // set background
  gameBackground = new GameBackground();
  setBackgroundBrush(Qt::black);

  setDefaultGameCursor();

  // update max level for current pack
  max_level = gameProfile->levelPackCount(gameProfile->currentLevelPack());

  // very first initialization
  initGame();
}
예제 #20
0
void KisInputManager::Private::setupActions()
{
    QList<KisAbstractInputAction*> actions = KisInputProfileManager::instance()->actions();
    foreach(KisAbstractInputAction *action, actions) {
        if(dynamic_cast<KisToolInvocationAction*>(action)) {
            defaultInputAction = action;
        }
    }

    connect(KisInputProfileManager::instance(), SIGNAL(currentProfileChanged()), q, SLOT(profileChanged()));
    if(KisInputProfileManager::instance()->currentProfile()) {
        q->profileChanged();
    }
}
예제 #21
0
void TerminalModel::setProfileKey(const QString& key)
{
    _profileKey = key;
    emit profileChanged(key);
}
예제 #22
0
    void properties()
    {
        // GIVEN
        Qt3DRender::QGraphicsApiFilter apiFilter;

        {
            // WHEN
            QSignalSpy spy(&apiFilter, SIGNAL(apiChanged(Qt3DRender::QGraphicsApiFilter::Api)));
            apiFilter.setApi(Qt3DRender::QGraphicsApiFilter::OpenGL);

            // THEN
            QCOMPARE(apiFilter.api(), Qt3DRender::QGraphicsApiFilter::OpenGL);
            bool shouldEmitSignal = (QOpenGLContext::openGLModuleType() != QOpenGLContext::LibGL);
            QCOMPARE(spy.isEmpty(), !shouldEmitSignal);
        }

        {
            // WHEN
            QSignalSpy spy(&apiFilter, SIGNAL(profileChanged(Qt3DRender::QGraphicsApiFilter::OpenGLProfile)));
            apiFilter.setProfile(Qt3DRender::QGraphicsApiFilter::CoreProfile);

            // THEN
            QCOMPARE(apiFilter.profile(), Qt3DRender::QGraphicsApiFilter::CoreProfile);
            QCOMPARE(spy.count(), 1);
        }

        {
            // WHEN
            QSignalSpy spy(&apiFilter, SIGNAL(majorVersionChanged(int)));
            apiFilter.setMajorVersion(4);

            // THEN
            QCOMPARE(apiFilter.majorVersion(), 4);
            QCOMPARE(spy.count(), 1);
        }

        {
            // WHEN
            QSignalSpy spy(&apiFilter, SIGNAL(minorVersionChanged(int)));
            apiFilter.setMinorVersion(5);

            // THEN
            QCOMPARE(apiFilter.minorVersion(), 5);
            QCOMPARE(spy.count(), 1);
        }

        {
            // WHEN
            QSignalSpy spy(&apiFilter, SIGNAL(extensionsChanged(QStringList)));
            const auto extensions = (QStringList() << QLatin1String("extension1") << QLatin1String("extension2"));
            apiFilter.setExtensions(extensions);

            // THEN
            QCOMPARE(apiFilter.extensions(), extensions);
            QCOMPARE(spy.count(), 1);
        }

        {
            // WHEN
            QSignalSpy spy(&apiFilter, SIGNAL(vendorChanged(QString)));
            const QLatin1String vendor("Triangles McTriangleFace");
            apiFilter.setVendor(vendor);

            // THEN
            QCOMPARE(apiFilter.vendor(), vendor);
            QCOMPARE(spy.count(), 1);
        }
    }
예제 #23
0
파일: Session.cpp 프로젝트: Artox/qtmoko
void Session::setProfileKey(const QString& key)
{
    _profileKey = key;
    emit profileChanged(key);
}
예제 #24
0
void OptionsSimple::setCurrentProfile( const QString& profile )
{
    // TODO check profile (and don't change, if not available)
    cProfile->setCurrentIndex( cProfile->findText(profile) );
    profileChanged();
}