예제 #1
0
GameRow::GameRow(QWidget *parent, Game game) :
    QWidget(parent),
    game(game)
{
    QHBoxLayout* rowLayout = new QHBoxLayout;
    downloadButton = new QPushButton("Download");

    imageHolder = new QLabel();
    double ratio = double(Game::COVER_WIDTH) / Game::COVER_HEIGHT;

    imageHolder->setFixedWidth(int(COVER_HEIGHT * ratio));
    imageHolder->setFixedHeight(COVER_HEIGHT);
    imageHolder->setScaledContents(true);
    imageHolder->setObjectName("imageHolder");

    downloadProgress = new QProgressBar();
    downloadProgress->setMinimum(0);
    downloadProgress->setMaximum(100);

    rowLayout->addWidget(imageHolder);
    rowLayout->addWidget(new QLabel(game.title), 1);
    rowLayout->addWidget(downloadButton, 0);

    setLayout(rowLayout);

    connect(downloadButton, SIGNAL(clicked()), SLOT(onClickDownload()));

    refreshThumbnail();
}
AttachmentClickAtionDialog::AttachmentClickAtionDialog(bool b_rename_enabled, QWidget *parent) :
    QDialog(parent),
    ui(new Ui::AttachmentClickAtionDialog)
{
    ui->setupUi(this);
    //
    reset();
    //
    QObject::connect( this->ui->pushButtonOpen,     SIGNAL(clicked()), this, SLOT( onClickOpen    () ) );
    QObject::connect( this->ui->pushButtonDownload, SIGNAL(clicked()), this, SLOT( onClickDownload() ) );
    QObject::connect( this->ui->pushButtonRename,   SIGNAL(clicked()), this, SLOT( onClickRename  () ) );
    QObject::connect( this->ui->pushButtonCancel,   SIGNAL(clicked()), this, SLOT( onClickCancel  () ) );
    //TODO: make it optional in settings
    this->ui->pushButtonOpen->setFocus();
    //#
    this->ui->pushButtonRename->setEnabled(b_rename_enabled);
}