Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Network
Konqueror
Commits
44a28c5e
Commit
44a28c5e
authored
Mar 28, 2021
by
Jonathan Marten
Browse files
webarchiver: Disable the "Create" button if no valid source URL
parent
1c38a978
Changes
2
Hide whitespace changes
Inline
Side-by-side
plugins/webarchiver/app/archivedialog.cpp
View file @
44a28c5e
...
...
@@ -109,9 +109,6 @@ ArchiveDialog::ArchiveDialog(const QUrl &url, QWidget *parent)
Q_ASSERT
(
m_cancelButton
!=
nullptr
);
connect
(
m_cancelButton
,
&
QAbstractButton
::
clicked
,
this
,
&
QWidget
::
close
);
// TODO: verify user entries, enable/disable button
//enableButtonOk(false);
QWidget
*
w
=
new
QWidget
(
this
);
// main widget
QVBoxLayout
*
vbl
=
new
QVBoxLayout
(
w
);
// main vertical layout
KConfigSkeletonItem
*
ski
;
// config for creating widgets
...
...
@@ -121,6 +118,8 @@ ArchiveDialog::ArchiveDialog(const QUrl &url, QWidget *parent)
m_pageUrlReq
=
new
KUrlRequester
(
url
,
this
);
m_pageUrlReq
->
setToolTip
(
i18n
(
"The URL of the page that is to be archived"
));
slotSourceUrlChanged
(
m_pageUrlReq
->
text
());
connect
(
m_pageUrlReq
,
&
KUrlRequester
::
textChanged
,
this
,
&
ArchiveDialog
::
slotSourceUrlChanged
);
fl
->
addRow
(
i18n
(
"Source &URL:"
),
m_pageUrlReq
);
fl
->
addRow
(
QString
(),
new
QWidget
(
this
));
...
...
@@ -252,6 +251,12 @@ void ArchiveDialog::cleanup()
}
void
ArchiveDialog
::
slotSourceUrlChanged
(
const
QString
&
text
)
{
m_archiveButton
->
setEnabled
(
QUrl
::
fromUserInput
(
text
).
isValid
());
}
void
ArchiveDialog
::
slotArchiveTypeChanged
(
int
idx
)
{
const
QString
saveType
=
m_typeCombo
->
itemData
(
idx
).
toString
();
...
...
plugins/webarchiver/app/archivedialog.h
View file @
44a28c5e
...
...
@@ -58,6 +58,7 @@ protected:
protected
slots
:
void
slotArchiveTypeChanged
(
int
idx
);
void
slotSourceUrlChanged
(
const
QString
&
text
);
void
slotMessageLinkActivated
(
const
QString
&
link
);
private
slots
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment