MCPcopy Create free account
hub / github.com/LeFroid/Viper-Browser / CookieModifyDialog

Method CookieModifyDialog

src/ui/cookies/CookieModifyDialog.cpp:7–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5#include <QPushButton>
6
7CookieModifyDialog::CookieModifyDialog(QWidget *parent) :
8 QDialog(parent),
9 ui(new Ui::CookieModifyDialog),
10 m_cookie()
11{
12 ui->setupUi(this);
13
14 // Populate combo box texts
15 ui->comboBoxSecure->addItem(tr("Any type of connection"), false);
16 ui->comboBoxSecure->addItem(tr("Encrypted connections only"), true);
17
18 ui->comboBoxHttpOnly->addItem(tr("Yes"), true);
19 ui->comboBoxHttpOnly->addItem(tr("No"), false);
20
21 ui->comboBoxExpireType->addItem(tr("Date"), static_cast<int>(ExpireType::Date));
22 ui->comboBoxExpireType->addItem(tr("At the end of this session"), static_cast<int>(ExpireType::Session));
23
24 // Set default expiration date to a year from now
25 QDateTime nextYear = QDateTime::currentDateTime().addYears(1);
26 ui->dateTimeEdit->setDateTime(nextYear);
27
28 // Connect change in selection of expire combo box type to act of hiding or showing date time widget for expiration
29 connect(ui->comboBoxExpireType, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, &CookieModifyDialog::onExpireTypeChanged);
30
31 // Connect save button with cookie modification
32 connect(ui->buttonBox, &QDialogButtonBox::clicked, this, &CookieModifyDialog::setCookieData);
33}
34
35CookieModifyDialog::~CookieModifyDialog()
36{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected