comparison ui/createcertlistdialog.cpp @ 428:d1819cd56dee

Updated dialog layout.
author Raimund Renkert <rrenkert@intevation.de>
date Thu, 17 Apr 2014 13:16:43 +0200
parents d7cda835abd6
children efd1bd85112f
comparison
equal deleted inserted replaced
427:d08e39b913ee 428:d1819cd56dee
28 { 28 {
29 /* Top level layout / widgets */ 29 /* Top level layout / widgets */
30 QVBoxLayout *topLayout = new QVBoxLayout; 30 QVBoxLayout *topLayout = new QVBoxLayout;
31 QVBoxLayout *headerLayout = new QVBoxLayout; 31 QVBoxLayout *headerLayout = new QVBoxLayout;
32 QHBoxLayout *headerSubLayout = new QHBoxLayout; 32 QHBoxLayout *headerSubLayout = new QHBoxLayout;
33 QVBoxLayout *centerLayout = new QVBoxLayout; 33 QHBoxLayout *centerLayout = new QHBoxLayout;
34 QHBoxLayout *bottomLayout = new QHBoxLayout; 34 QHBoxLayout *bottomLayout = new QHBoxLayout;
35 QHBoxLayout *certLayout = new QHBoxLayout; 35 QVBoxLayout *labelLayout = new QVBoxLayout;
36 QHBoxLayout *saveLayout = new QHBoxLayout; 36 QVBoxLayout *fieldLayout = new QVBoxLayout;
37 QVBoxLayout *buttonLayout = new QVBoxLayout;
37 38
38 QLabel *header = new QLabel("<h3>" + tr("Save certificate list") + "</h3>"); 39 QLabel *header = new QLabel("<h3>" + tr("Save certificate list") + "</h3>");
39 QLabel *description = new QLabel( 40 QLabel *description = new QLabel(
40 tr("Save all managed root certificates in a new, signed certificate list.")); 41 tr("Save all managed root certificates in a new, signed certificate list."));
41 headerSubLayout->insertSpacing(0, 40); 42 headerSubLayout->insertSpacing(0, 40);
44 headerSeparator->setFrameShape(QFrame::HLine); 45 headerSeparator->setFrameShape(QFrame::HLine);
45 headerSeparator->setFrameShadow(QFrame::Sunken); 46 headerSeparator->setFrameShadow(QFrame::Sunken);
46 headerLayout->addWidget(header); 47 headerLayout->addWidget(header);
47 headerLayout->addLayout(headerSubLayout); 48 headerLayout->addLayout(headerSubLayout);
48 headerLayout->addWidget(headerSeparator); 49 headerLayout->addWidget(headerSeparator);
50 headerLayout->insertSpacing(3, 10);
49 51
50 QLabel *certLabel = new QLabel("Select signature certificate (secret key):"); 52 QLabel *certLabel = new QLabel("Select signature certificate (secret key):");
51 certLabel->setFixedWidth(205); 53 QLabel *saveLabel = new QLabel("Select output folder:");
54 labelLayout->addWidget(certLabel);
55 labelLayout->addWidget(saveLabel);
56
52 mCertFile = new QLineEdit(); 57 mCertFile = new QLineEdit();
58 mSaveFile = new QLineEdit();
59 fieldLayout->addWidget(mCertFile);
60 fieldLayout->addWidget(mSaveFile);
61
53 QPushButton *certSelect = new QPushButton("..."); 62 QPushButton *certSelect = new QPushButton("...");
63 certSelect->setFixedWidth(30);
54 connect(certSelect, SIGNAL(clicked()), this, SLOT(openCertificateSelect())); 64 connect(certSelect, SIGNAL(clicked()), this, SLOT(openCertificateSelect()));
55 certSelect->setFixedWidth(30);
56 certLayout->addWidget(certLabel);
57 certLayout->addWidget(mCertFile);
58 certLayout->addWidget(certSelect);
59
60 QLabel *saveLabel = new QLabel("Select output folder:");
61 saveLabel->setFixedWidth(205);
62 mSaveFile = new QLineEdit();
63 QPushButton *saveSelect = new QPushButton("..."); 65 QPushButton *saveSelect = new QPushButton("...");
64 connect(saveSelect, SIGNAL(clicked()), this, SLOT(openSaveLocation())); 66 connect(saveSelect, SIGNAL(clicked()), this, SLOT(openSaveLocation()));
65 saveSelect->setFixedWidth(30); 67 saveSelect->setFixedWidth(30);
68 buttonLayout->addWidget(certSelect);
69 buttonLayout->addWidget(saveSelect);
66 70
67 QString footerText = tr("In addition, each certificate list will be saved " 71 QString footerText = tr("In addition, each certificate list will be saved "
68 "automatically in the archive directory:\n"); 72 "automatically in the archive directory:\n");
69 // TODO print out the path, not the displayName. 73 // TODO print out the path, not the displayName.
70 footerText.append(QStandardPaths::writableLocation( 74 footerText.append(QStandardPaths::writableLocation(
71 QStandardPaths::DataLocation)); 75 QStandardPaths::DataLocation));
72 //footerText.append(QStandardPaths::displayName(QStandardPaths::DataLocation)); 76 //footerText.append(QStandardPaths::displayName(QStandardPaths::DataLocation));
73 QLabel *footer = new QLabel(footerText); 77 QLabel *footer = new QLabel(footerText);
74 saveLayout->addWidget(saveLabel);
75 saveLayout->addWidget(mSaveFile);
76 saveLayout->addWidget(saveSelect);
77 78
78 centerLayout->insertSpacing(0, 10); 79 centerLayout->addLayout(labelLayout);
79 centerLayout->addLayout(certLayout); 80 centerLayout->addLayout(fieldLayout);
80 centerLayout->addLayout(saveLayout); 81 centerLayout->addLayout(buttonLayout);
81 centerLayout->insertSpacing(3, 10);
82 82
83 QPushButton *create = new QPushButton(tr("Sign list")); 83 QPushButton *create = new QPushButton(tr("Save list"));
84 connect(create, SIGNAL(clicked()), this, SLOT(createList())); 84 connect(create, SIGNAL(clicked()), this, SLOT(createList()));
85 QPushButton *cancel = new QPushButton(tr("Cancel")); 85 QPushButton *cancel = new QPushButton(tr("Cancel"));
86 connect(cancel, SIGNAL(clicked()), this, SLOT(close())); 86 connect(cancel, SIGNAL(clicked()), this, SLOT(close()));
87 bottomLayout->insertStretch(0, 10); 87 bottomLayout->insertStretch(0, 10);
88 bottomLayout->addWidget(create); 88 bottomLayout->addWidget(create);
94 94
95 topLayout->addLayout(headerLayout); 95 topLayout->addLayout(headerLayout);
96 topLayout->addLayout(centerLayout); 96 topLayout->addLayout(centerLayout);
97 topLayout->insertStretch(2, 10); 97 topLayout->insertStretch(2, 10);
98 topLayout->addWidget(footer); 98 topLayout->addWidget(footer);
99 topLayout->insertSpacing(4, 10);
99 topLayout->addWidget(bottomSeparator); 100 topLayout->addWidget(bottomSeparator);
100 topLayout->addLayout(bottomLayout); 101 topLayout->addLayout(bottomLayout);
101 102
102 setLayout(topLayout); 103 setLayout(topLayout);
103 104

http://wald.intevation.org/projects/trustbridge/