コード例 #1
0
PlayerEngine::PlayerEngine (QTableWidget* _table) : table(_table), curSong(NULL)
{
	setStatus(STATUS_STOPPED);

	srandom((unsigned int)time(NULL) + getpid() + getppid() + 42);

	songTimer.setInterval(1000);
	QObject::connect(&songTimer, SIGNAL(timeout()), this, SLOT(slotTimerTimeout()));
}
コード例 #2
0
KisDelayedSaveDialog::KisDelayedSaveDialog(KisImageSP image, QWidget *parent)
    : QDialog(parent),
      ui(new Ui::KisDelayedSaveDialog),
      m_d(new Private(image))
{
    KIS_ASSERT_RECOVER_NOOP(image);

    ui->setupUi(this);

    connect(ui->btnCancel, SIGNAL(clicked()), SLOT(slotCancelRequested()));
    connect(&m_d->updateTimer, SIGNAL(timeout()), SLOT(slotTimerTimeout()));

    m_d->image->compositeProgressProxy()->addProxy(ui->progressBar);
}
コード例 #3
0
ファイル: inputmanager.cpp プロジェクト: Andersbakken/qlc-svn
InputManager::InputManager(QWidget* parent, Qt::WindowFlags flags)
    : QWidget(parent, flags)
{
    /* Create a new layout for this widget */
    new QVBoxLayout(this);

    /* Toolbar */
    m_toolbar = new QToolBar(tr("Input Manager"), this);
    m_toolbar->addAction(QIcon(":/edit.png"), tr("Edit Mapping"),
                         this, SLOT(slotEditClicked()));
    layout()->addWidget(m_toolbar);

    /* Tree */
    m_tree = new QTreeWidget(this);
    layout()->addWidget(m_tree);
    m_tree->setRootIsDecorated(false);
    m_tree->setItemsExpandable(false);
    m_tree->setSortingEnabled(false);
    m_tree->setAllColumnsShowFocus(true);
    m_tree->header()->setResizeMode(QHeaderView::ResizeToContents);

    QStringList columns;
    columns << tr("Universe") << tr("Plugin") << tr("Input") << tr("Profile")
            << tr("Editor universe");
    m_tree->setHeaderLabels(columns);

    connect(m_tree, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)),
            this, SLOT(slotEditClicked()));

    /* Timer that clears the input data icon after a while */
    m_timer = new QTimer(this);
    m_timer->setSingleShot(true);
    connect(m_timer, SIGNAL(timeout()), this, SLOT(slotTimerTimeout()));

    /* Listen to input map's input data signals */
    connect(_app->inputMap(), SIGNAL(inputValueChanged(quint32,quint32,uchar)),
            this, SLOT(slotInputValueChanged(quint32,quint32,uchar)));

    /* Listen to document changes */
    connect(_app, SIGNAL(documentChanged(Doc*)),
            this, SLOT(slotDocumentChanged(Doc*)));
    /* Use the initial document */
    slotDocumentChanged(_app->doc());

    /* Listen to plugin configuration changes */
    connect(_app->inputMap(), SIGNAL(pluginConfigurationChanged(const QString&)),
            this, SLOT(slotPluginConfigurationChanged()));
}
コード例 #4
0
InputProfileEditor::InputProfileEditor(QWidget* parent, QLCInputProfile* profile,
                                       InputOutputMap *ioMap)
    : QDialog(parent)
    , m_ioMap(ioMap)
    , m_wizardActive(false)
    , m_latestItem(NULL)
{
    Q_ASSERT(ioMap != NULL);

    setupUi(this);

    /* Connect the buttons to slots */
    connect(m_addButton, SIGNAL(clicked()),
            this, SLOT(slotAddClicked()));
    connect(m_removeButton, SIGNAL(clicked()),
            this, SLOT(slotRemoveClicked()));
    connect(m_editButton, SIGNAL(clicked()),
            this, SLOT(slotEditClicked()));
    connect(m_wizardButton, SIGNAL(clicked(bool)),
            this, SLOT(slotWizardClicked(bool)));
    connect(m_tree, SIGNAL(itemClicked(QTreeWidgetItem*,int)),
            this, SLOT(slotItemClicked(QTreeWidgetItem*,int)));
    connect(m_tree, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)),
            this, SLOT(slotEditClicked()));
    connect(m_movementCombo, SIGNAL(currentIndexChanged(int)),
            this, SLOT(slotMovementComboChanged(int)));
    connect(m_sensitivitySpin, SIGNAL(valueChanged(int)),
            this, SLOT(slotSensitivitySpinChanged(int)));

    /* Listen to input data */
    connect(m_ioMap, SIGNAL(inputValueChanged(quint32, quint32, uchar, const QString&)),
            this, SLOT(slotInputValueChanged(quint32, quint32, uchar, const QString&)));

    if (profile == NULL)
    {
        m_profile = new QLCInputProfile();
    }
    else
    {
        m_profile = new QLCInputProfile(*profile);
        if ((QFile::permissions(m_profile->path()) &
                QFile::WriteUser) == 0)
        {
            QMessageBox::warning(this, tr("File not writable"),
                                 tr("You do not have permission to write to "
                                    "the file %1. You might not be able to "
                                    "save your modifications to the profile.")
                                 .arg(QDir::toNativeSeparators(
                                          m_profile->path())));
        }
    }

    /* Profile manufacturer & model */
    m_manufacturerEdit->setText(m_profile->manufacturer());
    m_modelEdit->setText(m_profile->model());

    m_behaviourBox->hide();
    /* Fill up the tree with profile's channels */
    fillTree();

    /* Timer that clears the input data icon after a while */
    m_timer = new QTimer(this);
    m_timer->setSingleShot(true);
    connect(m_timer, SIGNAL(timeout()), this, SLOT(slotTimerTimeout()));

    QSettings settings;
    QVariant var = settings.value(SETTINGS_GEOMETRY);
    if (var.isValid() == true)
        restoreGeometry(var.toByteArray());
    AppUtil::ensureWidgetIsVisible(this);
}
コード例 #5
0
Kopete::Away::Away() : QObject( kapp , "Kopete::Away")
{
    int dummy = 0;
    dummy = dummy; // shut up

    d = new KopeteAwayPrivate;

    // Set up the away messages
    d->awayMessage = QString::null;
    d->autoAwayMessage = QString::null;
    d->useAutoAwayMessage = false;
    d->globalAway = false;
    d->autoaway = false;
    d->useAutoAway = true;

    // Empty the list
    d->awayMessageList.clear();

    // set the XAutoLock info
#ifdef Q_WS_X11
    Display *dsp = qt_xdisplay();
#endif
    d->mouse_x = d->mouse_y=0;
    d->mouse_mask = 0;
#ifdef Q_WS_X11
    d->root = DefaultRootWindow (dsp);
    d->screen = ScreenOfDisplay (dsp, DefaultScreen (dsp));
#endif
    d->useXidle = false;
    d->useMit = false;
#ifdef HasXidle
    d->useXidle = XidleQueryExtension(qt_xdisplay(), &dummy, &dummy);
#endif
#ifdef HasScreenSaver
    if(!d->useXidle)
        d->useMit = XScreenSaverQueryExtension(qt_xdisplay(), &dummy, &dummy);
#endif
#ifdef Q_WS_X11
    d->xIdleTime = 0;
#endif
    kdDebug(14010) << k_funcinfo << "Idle detection methods:" << endl;
    kdDebug(14010) << k_funcinfo << "\tKScreensaverIface::isBlanked()" << endl;
#ifdef Q_WS_X11
    kdDebug(14010) << k_funcinfo << "\tX11 XQueryPointer()" << endl;
#endif
    if (d->useXidle)
    {
        kdDebug(14010) << k_funcinfo << "\tX11 Xidle extension" << endl;
    }
    if (d->useMit)
    {
        kdDebug(14010) << k_funcinfo << "\tX11 MIT Screensaver extension" << endl;
    }


    load();
    KSettings::Dispatcher::self()->registerInstance( KGlobal::instance(), this, SLOT( load() ) );
    // Set up the config object
    KConfig *config = KGlobal::config();
    /* Load the saved away messages */
    config->setGroup("Away Messages");

    // Away Messages
    if(config->hasKey("Messages"))
    {
        d->awayMessageList = config->readListEntry("Messages");
    }
    else if(config->hasKey("Titles"))  // Old config format
    {
        QStringList titles = config->readListEntry("Titles");  // Get the titles
        for(QStringList::iterator i = titles.begin(); i != titles.end(); ++i)
        {
            d->awayMessageList.append( config->readEntry(*i) ); // And add it to the list
        }

        /* Save this list to disk */
        save();
    }
    else
    {
        d->awayMessageList.append( i18n( "Sorry, I am busy right now" ) );
        d->awayMessageList.append( i18n( "I am gone right now, but I will be back later" ) );

        /* Save this list to disk */
        save();
    }

    // Auto away message
    if(config->hasKey("AutoAwayMessage"))
    {
        d->autoAwayMessage = config->readEntry("AutoAwayMessage");
    }
    else
    {
        d->autoAwayMessage = i18n( "I am gone right now, but I will be back later" );

        // Save the default auto away message to disk
        save();
    }

    // init the timer
    d->timer = new QTimer(this, "AwayTimer");
    connect(d->timer, SIGNAL(timeout()), this, SLOT(slotTimerTimeout()));
    d->timer->start(4000);

    //init the time and other
    setActive();
}
コード例 #6
0
InputOutputManager::InputOutputManager(QWidget* parent, Doc* doc)
    : QWidget(parent)
    , m_doc(doc)
    , m_editor(NULL)
{
    Q_ASSERT(s_instance == NULL);
    s_instance = this;

    Q_ASSERT(doc != NULL);
    
    m_inputMap = doc->inputMap();
    m_outputMap = doc->outputMap();

    /* Create a new layout for this widget */
    new QVBoxLayout(this);
    layout()->setContentsMargins(0, 0, 0, 0);
    layout()->setSpacing(0);

    m_splitter = new QSplitter(Qt::Horizontal, this);
    layout()->addWidget(m_splitter);

    /* Tree */
    m_tree = new QTreeWidget(this);
    m_splitter->addWidget(m_tree);
    m_tree->setRootIsDecorated(false);
    m_tree->setItemsExpandable(false);
    m_tree->setSortingEnabled(false);
    m_tree->setAllColumnsShowFocus(true);

    QWidget* gcontainer = new QWidget(this);
    m_splitter->addWidget(gcontainer);
    gcontainer->setLayout(new QVBoxLayout);
    gcontainer->layout()->setContentsMargins(0, 0, 0, 0);

    QStringList columns;
    columns << tr("Universe") << tr("Input") << tr("Output") << tr("Feedback") << tr("Profile");
    m_tree->setHeaderLabels(columns);

    connect(m_tree, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)),
            this, SLOT(slotCurrentItemChanged()));

    /* Timer that clears the input data icon after a while */
    m_icon = QIcon(":/input.png");
    m_timer = new QTimer(this);
    m_timer->setSingleShot(true);
    connect(m_timer, SIGNAL(timeout()), this, SLOT(slotTimerTimeout()));

    /* Listen to input map's input data signals */
    connect(m_inputMap, SIGNAL(inputValueChanged(quint32,quint32,uchar)),
            this, SLOT(slotInputValueChanged(quint32,quint32,uchar)));

    /* Listen to plugin configuration changes */
    connect(m_inputMap, SIGNAL(pluginConfigurationChanged(const QString&)),
            this, SLOT(updateTree()));

    updateTree();
    m_tree->setCurrentItem(m_tree->topLevelItem(0));
    //slotCurrentItemChanged();

    QSettings settings;
    QVariant var = settings.value(SETTINGS_SPLITTER);
    if (var.isValid() == true)
        m_splitter->restoreState(var.toByteArray());
}