~mateo-salta/nitroshare/nitroshare

« back to all changes in this revision

Viewing changes to src/dialogs/CAcceptPromptDialog.cpp

  • Committer: Nathan Osman
  • Date: 2012-07-03 18:54:45 UTC
  • Revision ID: admin@quickmediasolutions.com-20120703185445-39gkajlpzikj764i
Adjusted the wizard to make certain steps mandatory and added a nice animation to the broadcast discovery page.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
#include <dialogs/CAcceptPromptDialog.h>
18
18
#include "ui_CAcceptPromptDialog.h"
19
19
 
20
 
CAcceptPromptDialog::CAcceptPromptDialog(QString address, QList<CFileHeader *> & headers)
 
20
CAcceptPromptDialog::CAcceptPromptDialog(QString name, QList<CFileHeader *> & headers)
21
21
    : ui(new Ui::CAcceptPromptDialog)
22
22
{
23
23
    ui->setupUi(this);
24
24
    setWindowFlags(Qt::WindowStaysOnTopHint);
25
25
 
26
 
    // Set the label according to the parameters supplied
27
 
    ui->DescriptionLabel->setText(tr("%1 would like to send you the following file(s):").arg(address));
28
 
 
29
 
    // Make the first column a little bit wider
 
26
    /* Make the first column a little bit wider. */
30
27
    ui->FileList->setColumnWidth(ui->FileList->columnAt(1), 250);
31
28
 
32
 
    // Enter the files into the table
 
29
    /* Enter the files into the table, totalling up the size. */
 
30
    qint64 total_size = 0;
 
31
 
33
32
    foreach(CFileHeader * header, headers)
34
33
    {
35
34
        ui->FileList->insertRow(0);
36
 
 
37
35
        ui->FileList->setItem(0, 0, new QTableWidgetItem(header->GetFilename()));
38
36
 
39
37
        QTableWidgetItem * cell = new QTableWidgetItem(FormatSize(header->GetUncompressedSize()));
40
38
        cell->setTextAlignment(Qt::AlignRight | Qt::AlignVCenter);
41
39
        ui->FileList->setItem(0, 1, cell);
 
40
 
 
41
        total_size += header->GetUncompressedSize();
42
42
    }
 
43
 
 
44
    /* Set the labels according to the information supplied. */
 
45
    ui->DescriptionLabel->setText(tr("%1 would like to send you the following file(s) (%2):", "",
 
46
                                     headers.size()).arg(name).arg(total_size));
 
47
    ui->AcceptLabel->setText(tr("Do you wish to accept the file(s)?", "", headers.size()));
43
48
}
44
49
 
45
50
CAcceptPromptDialog::~CAcceptPromptDialog()