MCPcopy Create free account
hub / github.com/SaschaWillems/VulkanCapsViewer / settingsDialog

Method settingsDialog

settingsDialog.cpp:47–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45}
46
47settingsDialog::settingsDialog(QWidget *parent, Settings appSet) : QDialog(parent)
48{
49 appSettings = appSet;
50
51 QFormLayout *formLayout = new QFormLayout;
52
53 QLabel* labelCaption = new QLabel();
54 labelCaption->setText("General settings");
55 labelCaption->setStyleSheet("font: 75 11pt;");
56
57 formLayout->addRow(labelCaption);
58 formLayout->addRow(tr("Submitter:"), createLineEdit("editSubmitterName"));
59
60 labelCaption = new QLabel();
61 labelCaption->setText("Proxy Settings");
62 labelCaption->setStyleSheet("font: 75 11pt;");
63 formLayout->addRow(labelCaption);
64
65 formLayout->addRow(tr("DNS Name / IP:"), createLineEdit("editProxyDns"));
66 formLayout->addRow(tr("Port:"), createLineEdit("editProxyPort"));
67 formLayout->addRow(tr("User name (if required):"), createLineEdit("editProxyUser"));
68 formLayout->addRow(tr("Password (if required):"), createLineEdit("editProxyPassword"));
69 formLayout->addRow(tr("Use proxy settings for upload"), createCheckBox("checkBoxUseProxy"));
70
71 QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
72 connect(buttonBox, SIGNAL(accepted()), this, SLOT(slotAccept()), Qt::QueuedConnection);
73 connect(buttonBox, SIGNAL(rejected()), this, SLOT(slotCancel()), Qt::QueuedConnection);
74
75 formLayout->addWidget(buttonBox);
76
77 setLayout(formLayout);
78 setWindowTitle("Settings");
79
80 // Restore settings
81 QSettings settings("saschawillems", "vulkancapsviewer");
82 this->findChild<QLineEdit*>("editSubmitterName", Qt::FindChildrenRecursively)->setText(settings.value("global/submitterName", "").toString());
83 this->findChild<QLineEdit*>("editProxyDns", Qt::FindChildrenRecursively)->setText(settings.value("proxy/dns", "").toString());
84 this->findChild<QLineEdit*>("editProxyPort", Qt::FindChildrenRecursively)->setText(settings.value("proxy/port", "").toString());
85 this->findChild<QLineEdit*>("editProxyUser", Qt::FindChildrenRecursively)->setText(settings.value("proxy/user", "").toString());
86 this->findChild<QLineEdit*>("editProxyPassword", Qt::FindChildrenRecursively)->setText(settings.value("proxy/password", "").toString());
87 this->findChild<QCheckBox*>("checkBoxUseProxy", Qt::FindChildrenRecursively)->setChecked(settings.value("proxy/enabled", "false").toBool());
88}
89
90
91settingsDialog::~settingsDialog()

Callers

nothing calls this directly

Calls 2

createLineEditFunction · 0.85
createCheckBoxFunction · 0.85

Tested by

no test coverage detected