Skip to content

Commit f61c2e6

Browse files
committed
#3336 linkdialog: add button to clear link name and fetch title of webpage again
Signed-off-by: Patrizio Bekerle <patrizio@bekerle.com>
1 parent 5d2b938 commit f61c2e6

File tree

4 files changed

+38
-12
lines changed

4 files changed

+38
-12
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
- A new shortcut `Ctrl + Shift + Enter` was added to add a new line above the current
66
(for [#3335](https://github.com/pbek/QOwnNotes/issues/3335))
7+
- In the link dialog there now is a new button to clear the link name an fetch
8+
the webpage title again (for [#3336](https://github.com/pbek/QOwnNotes/issues/3336))
79

810
## 25.8.0
911

src/dialogs/linkdialog.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,3 +449,8 @@ void LinkDialog::startTitleFetchRequest(const QUrl &url) {
449449
connect(reply, SIGNAL(downloadProgress(qint64, qint64)), this,
450450
SLOT(downloadProgress(qint64, qint64)));
451451
}
452+
453+
void LinkDialog::on_refreshButton_clicked() {
454+
ui->nameLineEdit->clear();
455+
on_urlEdit_textChanged(ui->urlEdit->text());
456+
}

src/dialogs/linkdialog.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ class LinkDialog : public MasterDialog {
4949

5050
void on_tabWidget_currentChanged(int index);
5151

52+
void on_refreshButton_clicked();
53+
5254
private:
5355
Ui::LinkDialog *ui;
5456
int firstVisibleNoteListRow;

src/dialogs/linkdialog.ui

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,24 @@
6464
</property>
6565
</widget>
6666
</item>
67-
<item row="3" column="1" colspan="2">
67+
<item row="1" column="3">
68+
<widget class="QPushButton" name="fileUrlButton">
69+
<property name="toolTip">
70+
<string>Select local file or directory to link to</string>
71+
</property>
72+
<property name="text">
73+
<string notr="true">…</string>
74+
</property>
75+
</widget>
76+
</item>
77+
<item row="2" column="1" colspan="3">
78+
<widget class="QProgressBar" name="downloadProgressBar">
79+
<property name="value">
80+
<number>24</number>
81+
</property>
82+
</widget>
83+
</item>
84+
<item row="3" column="1" colspan="3">
6885
<spacer name="verticalSpacer">
6986
<property name="orientation">
7087
<enum>Qt::Vertical</enum>
@@ -78,19 +95,19 @@
7895
</spacer>
7996
</item>
8097
<item row="1" column="2">
81-
<widget class="QPushButton" name="fileUrlButton">
82-
<property name="toolTip">
83-
<string>Select local file or directory to link to</string>
98+
<widget class="QPushButton" name="refreshButton">
99+
<property name="sizePolicy">
100+
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
101+
<horstretch>0</horstretch>
102+
<verstretch>0</verstretch>
103+
</sizepolicy>
84104
</property>
85-
<property name="text">
86-
<string notr="true">…</string>
105+
<property name="toolTip">
106+
<string>Clear link name and fetch title of webpage again</string>
87107
</property>
88-
</widget>
89-
</item>
90-
<item row="2" column="1" colspan="2">
91-
<widget class="QProgressBar" name="downloadProgressBar">
92-
<property name="value">
93-
<number>24</number>
108+
<property name="icon">
109+
<iconset theme="QIcon::ThemeIcon::ViewRefresh" resource="../breeze-qownnotes.qrc">
110+
<normaloff>:/icons/breeze-qownnotes/16x16/view-refresh.svg</normaloff>:/icons/breeze-qownnotes/16x16/view-refresh.svg</iconset>
94111
</property>
95112
</widget>
96113
</item>

0 commit comments

Comments
 (0)