Changeset View
Changeset View
Standalone View
Standalone View
krusader/Dialogs/newftpgui.cpp
Show First 20 Lines • Show All 57 Lines • ▼ Show 20 Line(s) | |||||
58 | * with the name 'name' and widget flags set to 'f' | 58 | * with the name 'name' and widget flags set to 'f' | ||
59 | */ | 59 | */ | ||
60 | newFTPGUI::newFTPGUI(QWidget* parent) : QDialog(parent) | 60 | newFTPGUI::newFTPGUI(QWidget* parent) : QDialog(parent) | ||
61 | { | 61 | { | ||
62 | setModal(true); | 62 | setModal(true); | ||
63 | setWindowTitle(i18n("New Network Connection")); | 63 | setWindowTitle(i18n("New Network Connection")); | ||
64 | resize(500, 240); | 64 | resize(500, 240); | ||
65 | 65 | | |||
66 | QVBoxLayout *mainLayout = new QVBoxLayout; | 66 | auto *mainLayout = new QVBoxLayout; | ||
67 | setLayout(mainLayout); | 67 | setLayout(mainLayout); | ||
68 | 68 | | |||
69 | QSizePolicy policy(QSizePolicy::Preferred, QSizePolicy::Preferred); | 69 | QSizePolicy policy(QSizePolicy::Preferred, QSizePolicy::Preferred); | ||
70 | policy.setHeightForWidth(sizePolicy().hasHeightForWidth()); | 70 | policy.setHeightForWidth(sizePolicy().hasHeightForWidth()); | ||
71 | setSizePolicy(policy); | 71 | setSizePolicy(policy); | ||
72 | 72 | | |||
73 | iconLabel = new QLabel(this); | 73 | iconLabel = new QLabel(this); | ||
74 | iconLabel->setPixmap(Icon("network-wired").pixmap(32)); | 74 | iconLabel->setPixmap(Icon("network-wired").pixmap(32)); | ||
Show All 12 Lines | |||||
87 | prefix->setObjectName(QString::fromUtf8("protocol")); | 87 | prefix->setObjectName(QString::fromUtf8("protocol")); | ||
88 | prefix->setSizePolicy(SIZE_MINIMUM); | 88 | prefix->setSizePolicy(SIZE_MINIMUM); | ||
89 | 89 | | |||
90 | url = new KHistoryComboBox(this); | 90 | url = new KHistoryComboBox(this); | ||
91 | url->setMaxCount(50); | 91 | url->setMaxCount(50); | ||
92 | url->setMinimumContentsLength(10); | 92 | url->setMinimumContentsLength(10); | ||
93 | 93 | | |||
94 | const QStringList availableProtocols = KProtocolInfo::protocols(); | 94 | const QStringList availableProtocols = KProtocolInfo::protocols(); | ||
95 | for (const QString protocol : sProtocols) { | 95 | for (const QString& protocol : sProtocols) { | ||
96 | if (availableProtocols.contains(protocol)) | 96 | if (availableProtocols.contains(protocol)) | ||
97 | prefix->addItem(protocol + QStringLiteral("://")); | 97 | prefix->addItem(protocol + QStringLiteral("://")); | ||
98 | } | 98 | } | ||
99 | 99 | | |||
100 | // load the history and completion list after creating the history combo | 100 | // load the history and completion list after creating the history combo | ||
101 | KConfigGroup group(krConfig, "Private"); | 101 | KConfigGroup group(krConfig, "Private"); | ||
102 | QStringList list = group.readEntry("newFTP Completion list", QStringList()); | 102 | QStringList list = group.readEntry("newFTP Completion list", QStringList()); | ||
103 | url->completionObject()->setItems(list); | 103 | url->completionObject()->setItems(list); | ||
Show All 12 Lines | |||||
116 | port->setSizePolicy(SIZE_MINIMUM); | 116 | port->setSizePolicy(SIZE_MINIMUM); | ||
117 | 117 | | |||
118 | usernameLabel = new QLabel(i18n("Username:"), this); | 118 | usernameLabel = new QLabel(i18n("Username:"), this); | ||
119 | username = new KLineEdit(this); | 119 | username = new KLineEdit(this); | ||
120 | passwordLabel = new QLabel(i18n("Password:"), this); | 120 | passwordLabel = new QLabel(i18n("Password:"), this); | ||
121 | password = new KLineEdit(this); | 121 | password = new KLineEdit(this); | ||
122 | password->setEchoMode(QLineEdit::Password); | 122 | password->setEchoMode(QLineEdit::Password); | ||
123 | 123 | | |||
124 | QHBoxLayout *horizontalLayout = new QHBoxLayout(); | 124 | auto *horizontalLayout = new QHBoxLayout(); | ||
125 | horizontalLayout->addWidget(iconLabel); | 125 | horizontalLayout->addWidget(iconLabel); | ||
126 | horizontalLayout->addWidget(aboutLabel); | 126 | horizontalLayout->addWidget(aboutLabel); | ||
127 | 127 | | |||
128 | QGridLayout *gridLayout = new QGridLayout(); | 128 | auto *gridLayout = new QGridLayout(); | ||
129 | gridLayout->addWidget(protocolLabel, 0, 0, 1, 1); | 129 | gridLayout->addWidget(protocolLabel, 0, 0, 1, 1); | ||
130 | gridLayout->addWidget(hostLabel, 0, 1, 1, 1); | 130 | gridLayout->addWidget(hostLabel, 0, 1, 1, 1); | ||
131 | gridLayout->addWidget(portLabel, 0, 2, 1, 1); | 131 | gridLayout->addWidget(portLabel, 0, 2, 1, 1); | ||
132 | gridLayout->addWidget(prefix, 1, 0, 1, 1); | 132 | gridLayout->addWidget(prefix, 1, 0, 1, 1); | ||
133 | gridLayout->addWidget(url, 1, 1, 1, 1); | 133 | gridLayout->addWidget(url, 1, 1, 1, 1); | ||
134 | gridLayout->addWidget(port, 1, 2, 1, 1); | 134 | gridLayout->addWidget(port, 1, 2, 1, 1); | ||
135 | gridLayout->addWidget(usernameLabel, 2, 0, 1, 1); | 135 | gridLayout->addWidget(usernameLabel, 2, 0, 1, 1); | ||
136 | gridLayout->addWidget(username, 3, 0, 1, 3); | 136 | gridLayout->addWidget(username, 3, 0, 1, 3); | ||
137 | gridLayout->addWidget(passwordLabel, 4, 0, 1, 1); | 137 | gridLayout->addWidget(passwordLabel, 4, 0, 1, 1); | ||
138 | gridLayout->addWidget(password, 5, 0, 1, 3); | 138 | gridLayout->addWidget(password, 5, 0, 1, 3); | ||
139 | 139 | | |||
140 | QGridLayout *widgetLayout = new QGridLayout(); | 140 | auto *widgetLayout = new QGridLayout(); | ||
141 | widgetLayout->addLayout(horizontalLayout, 0, 0, 1, 1); | 141 | widgetLayout->addLayout(horizontalLayout, 0, 0, 1, 1); | ||
142 | widgetLayout->addLayout(gridLayout, 1, 0, 1, 1); | 142 | widgetLayout->addLayout(gridLayout, 1, 0, 1, 1); | ||
143 | mainLayout->addLayout(widgetLayout); | 143 | mainLayout->addLayout(widgetLayout); | ||
144 | 144 | | |||
145 | QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel); | 145 | QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel); | ||
146 | mainLayout->addWidget(buttonBox); | 146 | mainLayout->addWidget(buttonBox); | ||
147 | QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok); | 147 | QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok); | ||
148 | okButton->setText(i18n("&Connect")); | 148 | okButton->setText(i18n("&Connect")); | ||
▲ Show 20 Lines • Show All 57 Lines • Show Last 20 Lines |