WizAnimateAction::WizAnimateAction(QObject* parent)
    : QObject(parent)
    , m_target(NULL)
    , m_nIconIndex(-1)
    , m_timer(new QTimer())
{
    connect(m_timer, SIGNAL(timeout()), SLOT(on_timer_timeout()));
    m_timer->setInterval(100);
}
Esempio n. 2
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    QSettings s;
    restoreGeometry(s.value("geometry").toByteArray());

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

    //QUuid nullUuid = QUuid(0, 0, 16385, 128, 0, 0, 0, 0, 0, 0, 0);
}
Esempio n. 3
0
idle_detect::idle_detect(QObject *parent) :
    QObject(parent)
{
    connect(&timer,SIGNAL(timeout()),this,SLOT(on_timer_timeout()));
    idle.setProgram("xprintidle");
    waker.setProgram("xdotool");
    waker.setArguments(QStringList("click 1"));
    locker.setProgram("gnome-screensaver-command");
    locker.setArguments(QStringList("-l"));
    timer.setInterval(1000);
    timer.setSingleShot(false);
    timer.start();
    threshold=120000;
    time=0;
    s.clear();
}
Esempio n. 4
0
MemoryInfoPage::MemoryInfoPage(QWidget *parent) :
    QWidget(parent)
{
    m_pGroupBoxCPU = new  QGroupBox(tr("CPU"));
    m_pGroupBoxMemory = new QGroupBox(tr("Memory and Swap"));
    m_pLabelCPU = new QLabel(tr("CPU"));
    m_pProgressBarCPU = new QProgressBar;
    m_pLabelMemory = new QLabel(tr("Memory"));
    m_pProgressBarMemory = new QProgressBar;
    m_pLabelMemoryUsed = new QLabel(tr("Used:"));
    m_pLabelMemoryLeft = new QLabel(tr("Left:"));
    m_pLabelMemoryTotal = new QLabel(tr("Total:"));
    m_pLabelSwap = new QLabel(tr("Swap"));
    m_pProgressBarSwap = new QProgressBar;
    m_pLabelSwapUsed = new QLabel("Used:");
    m_pLabelSwapLeft = new QLabel(tr("Left"));
    m_pLabelSwapTotal = new QLabel(tr("Total:"));
    m_pHBoxLayoutCPU= new QHBoxLayout;
    m_pGridLayoutMemory = new QGridLayout;
    m_pVBoxLayoutMain = new QVBoxLayout;

    m_pLabelMemory->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
    m_pLabelSwap->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);

    m_pHBoxLayoutCPU->addWidget(m_pLabelCPU);
    m_pHBoxLayoutCPU->addWidget(m_pProgressBarCPU);
    m_pGroupBoxCPU->setLayout(m_pHBoxLayoutCPU);
    m_pGridLayoutMemory->addWidget(m_pLabelMemory, 0, 0, 1, 1);
    m_pGridLayoutMemory->addWidget(m_pProgressBarMemory, 0, 1, 1, 3);
    m_pGridLayoutMemory->addWidget(m_pLabelMemoryUsed, 1, 1, 1, 1);
    m_pGridLayoutMemory->addWidget(m_pLabelMemoryLeft, 1, 2, 1, 1);
    m_pGridLayoutMemory->addWidget(m_pLabelMemoryTotal, 1, 3, 1, 1);
    m_pGridLayoutMemory->addWidget(m_pLabelSwap, 2, 0, 1, 1);
    m_pGridLayoutMemory->addWidget(m_pProgressBarSwap, 2, 1, 1, 3);
    m_pGridLayoutMemory->addWidget(m_pLabelSwapUsed, 3, 1, 1, 1);
    m_pGridLayoutMemory->addWidget(m_pLabelSwapLeft, 3, 2, 1, 1);
    m_pGridLayoutMemory->addWidget(m_pLabelSwapTotal, 3, 3, 1, 1);
    m_pGroupBoxMemory->setLayout(m_pGridLayoutMemory);
    m_pVBoxLayoutMain->addWidget(m_pGroupBoxCPU);
    m_pVBoxLayoutMain->addWidget(m_pGroupBoxMemory);

    setLayout(m_pVBoxLayoutMain);

    m_pTimer = new QTimer(this);
    connect(m_pTimer, SIGNAL(timeout()), this, SLOT(on_timer_timeout()));
    m_pTimer->start(1000);
}
Esempio n. 5
0
YFileSystemWatcher::YFileSystemWatcher(const QString & filename)
    : m_watcher(new QFileSystemWatcher(this))
    , m_timer(new QTimer(this))
    , m_status(NoActivity)
    , m_filename(filename)
    , m_lastSize(0)
{
    connect(m_watcher.data(), SIGNAL(fileChanged(QString)), SLOT(on_watcher_fileChanged(const QString &)));
    connect(m_timer.data(), SIGNAL(timeout()), SLOT(on_timer_timeout()));

    m_watcher->addPath(m_filename);

    QFileInfo info(m_filename);
    m_lastModification = info.lastModified();
    m_lastSize = info.size();

    m_timer->start(250);
}
Esempio n. 6
0
f3_launcher::f3_launcher()
{
    errCode = f3_launcher_ok;
    float version = probeVersion();
    if (version == 0)
    {
        emitError(f3_launcher_no_cui);
        return;
    }
    if (version < 4.0 || !probeCommand(F3_PROBE_COMMAND))
    {
        emitError(f3_launcher_no_quick);
    }
    if (version <= 6.0)
    {
        emitError(f3_launcher_no_progress);
        showProgress = false;
    }
    else
    {
        emit f3_launcher_status_changed(f3_launcher_ready);
        showProgress = true;
    }

    options["mode"] = "legacy";
    options["cache"] = "none";
    options["memory"] = "full";
    options["destructive"] = "no";

    stage = 0;
    connect(&f3_cui,
            SIGNAL(finished(int,QProcess::ExitStatus)),
            this,
            SLOT(on_f3_cui_finished()));
    connect(&timer,
            SIGNAL(timeout()),
            this,
            SLOT(on_timer_timeout()));
    timer.setInterval(1500);

}