comparison src/gui/dialog/settings/torrents.cc @ 393:963047512d34

*: clang-format
author Paper <paper@tflc.us>
date Fri, 07 Nov 2025 07:16:15 -0500
parents b1f625b0227c
children
comparison
equal deleted inserted replaced
392:a72d6d7b3568 393:963047512d34
6 #include <QLineEdit> 6 #include <QLineEdit>
7 #include <QSizePolicy> 7 #include <QSizePolicy>
8 #include <QVBoxLayout> 8 #include <QVBoxLayout>
9 #include <algorithm> 9 #include <algorithm>
10 10
11 QWidget* SettingsPageTorrents::CreateGeneralWidget() { 11 QWidget *SettingsPageTorrents::CreateGeneralWidget()
12 QWidget* result = new QWidget(this); 12 {
13 QWidget *result = new QWidget(this);
13 result->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Maximum); 14 result->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Maximum);
14 15
15 QVBoxLayout* full_layout = new QVBoxLayout(result); 16 QVBoxLayout *full_layout = new QVBoxLayout(result);
16 17
17 { 18 {
18 /* URLs */ 19 /* URLs */
19 QGroupBox* group = new QGroupBox(tr("URLs"), result); 20 QGroupBox *group = new QGroupBox(tr("URLs"), result);
20 group->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Maximum); 21 group->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Maximum);
21 22
22 QVBoxLayout* group_layout = new QVBoxLayout(group); 23 QVBoxLayout *group_layout = new QVBoxLayout(group);
23 24
24 { 25 {
25 /* Feed link */ 26 /* Feed link */
26 QWidget* widget = new QWidget(group); 27 QWidget *widget = new QWidget(group);
27 QVBoxLayout* widget_layout = new QVBoxLayout(widget); 28 QVBoxLayout *widget_layout = new QVBoxLayout(widget);
28 29
29 { 30 {
30 QLabel* sync_combo_box_label = new QLabel(tr("URL of the RSS feed to check:"), widget); 31 QLabel *sync_combo_box_label = new QLabel(tr("URL of the RSS feed to check:"), widget);
31 widget_layout->addWidget(sync_combo_box_label); 32 widget_layout->addWidget(sync_combo_box_label);
32 } 33 }
33 34
34 { 35 {
35 /* Username: this literally never gets used btw */ 36 /* Username: this literally never gets used btw */
36 QLineEdit* lineedit = new QLineEdit(Strings::ToQString(feed_link), widget); 37 QLineEdit *lineedit = new QLineEdit(Strings::ToQString(feed_link), widget);
37 connect(lineedit, &QLineEdit::editingFinished, this, 38 connect(lineedit, &QLineEdit::editingFinished, this,
38 [this, lineedit] { feed_link = Strings::ToUtf8String(lineedit->text()); }); 39 [this, lineedit] { feed_link = Strings::ToUtf8String(lineedit->text()); });
39 widget_layout->addWidget(lineedit); 40 widget_layout->addWidget(lineedit);
40 } 41 }
41 42
49 full_layout->addStretch(); 50 full_layout->addStretch();
50 51
51 return result; 52 return result;
52 } 53 }
53 54
54 void SettingsPageTorrents::SaveInfo() { 55 void SettingsPageTorrents::SaveInfo()
56 {
55 session.config.torrents.feed_link = feed_link; 57 session.config.torrents.feed_link = feed_link;
56 } 58 }
57 59
58 SettingsPageTorrents::SettingsPageTorrents(QWidget* parent) : SettingsPage(parent, tr("Torrents")) { 60 SettingsPageTorrents::SettingsPageTorrents(QWidget *parent) : SettingsPage(parent, tr("Torrents"))
61 {
59 feed_link = session.config.torrents.feed_link; 62 feed_link = session.config.torrents.feed_link;
60 AddTab(CreateGeneralWidget(), tr("General")); 63 AddTab(CreateGeneralWidget(), tr("General"));
61 } 64 }