Ejemplo n.º 1
0
PoweroffDialog::PoweroffDialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::PoweroffDialog),
    m_timer(new QTimer(this))
{
    ui->setupUi(this);
    connect(ui->btnExecute, SIGNAL(clicked())
            , this, SLOT(btnExecute_click()));
    connect(ui->btnCancel, SIGNAL(clicked())
            , this, SLOT(btnCancel_click()));
    connect(this, SIGNAL(accepted())
            , this, SLOT(dialog_accepted()));
    connect(this, SIGNAL(rejected())
            , this, SLOT(dialog_rejected()));
    connect(m_timer, SIGNAL(timeout())
            , this, SLOT(timer_event()));

    // setup timer
    m_timer->setInterval(1000); // 1 second
    m_timer->setSingleShot(false); // always execute the timer
    m_timer->stop();

    // topmost frameless window
    setWindowFlags(Qt::Window
                   | Qt::WindowStaysOnTopHint
                   | Qt::FramelessWindowHint
                   | Qt::ToolTip);
}
Ejemplo n.º 2
0
AditionalFileDialog::AditionalFileDialog(QWidget *parent, QString a_file, QMap<PisiSPBase::AFileAttr, QString> attr) :
    QDialog(parent),
    ui(new Ui::AditionalFileDialog),
    a_file(a_file),
    attr(attr)
{
    ui->setupUi(this);

    ui->le_file->setText(a_file);
    ui->le_target->setText(attr.value(PisiSPBase::TARGET));
    set_permissions(attr.value(PisiSPBase::PERMISSION));
    ui->le_owner->setText(attr.value(PisiSPBase::OWNER));
    ui->le_group->setText(attr.value(PisiSPBase::GROUP));

    connect(this, SIGNAL(accepted()), SLOT(dialog_accepted()));
}