Tristan Matthews pushed to branch master at VideoLAN / VLC
Commits:
51b6d57e by Atul Singh at 2026-02-27T19:50:19+00:00
qt: Add 'Clear History' button to network URL open dialog
Resolves issue where users had no way to clear browsing history
of network feed URLs in the Open Network dialog.
Features:
- Added 'Clear History' button next to URL combobox
- Clears both visual dropdown and persistent QSettings storage
- Button automatically disabled when 'save-recentplay' is off
- Addresses privacy concerns with NSFW URLs mentioned in issue
- Maintains existing UI layout and behavior
Fixes #29607
- - - - -
3 changed files:
- modules/gui/qt/dialogs/open/open_net.ui
- modules/gui/qt/dialogs/open/open_panels.cpp
- modules/gui/qt/dialogs/open/open_panels.hpp
Changes:
=====================================
modules/gui/qt/dialogs/open/open_net.ui
=====================================
@@ -55,20 +55,40 @@ http://www.yourtube.com/watch?v=gg64x</string>
</widget>
</item>
<item row="1" column="0">
- <widget class="QComboBox" name="urlComboBox">
- <property name="maximumSize">
- <size>
- <width>600</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="editable">
- <bool>true</bool>
- </property>
- <property name="insertPolicy">
- <enum>QComboBox::NoInsert</enum>
- </property>
- </widget>
+ <layout class="QHBoxLayout">
+ <item>
+ <widget class="QComboBox" name="urlComboBox">
+ <property name="maximumSize">
+ <size>
+ <width>600</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="editable">
+ <bool>true</bool>
+ </property>
+ <property name="insertPolicy">
+ <enum>QComboBox::NoInsert</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="clearHistoryButton">
+ <property name="text">
+ <string>Clear History</string>
+ </property>
+ <property name="toolTip">
+ <string>Clear the network URL browsing history</string>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>100</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ </layout>
</item>
</layout>
</widget>
=====================================
modules/gui/qt/dialogs/open/open_panels.cpp
=====================================
@@ -54,6 +54,7 @@
#include <QMimeData>
#include <QDropEvent>
#include <QRegularExpression>
+#include <QPushButton>
#define I_DEVICE_TOOLTIP \
I_DIR_OR_FOLDER( N_("Select a device or a VIDEO_TS directory"), \
@@ -686,6 +687,7 @@ NetOpenPanel::NetOpenPanel( QWidget *_parent, qt_intf_t
*_p_intf ) :
{
ui.setupUi( this );
connect( ui.urlComboBox, &QComboBox::editTextChanged, this,
&NetOpenPanel::updateMRL );
+ connect( ui.clearHistoryButton, &QPushButton::clicked, this,
&NetOpenPanel::clearHistory );
/* */
if( var_InheritBool( p_intf, "save-recentplay" ) )
@@ -696,7 +698,10 @@ NetOpenPanel::NetOpenPanel( QWidget *_parent, qt_intf_t
*_p_intf ) :
ui.urlComboBox->setMaxCount( 10 );
}
else
+ {
b_recentList = false;
+ ui.clearHistoryButton->setEnabled( false );
+ }
QFont smallFont = QApplication::font();
smallFont.setPointSize( smallFont.pointSize() - 1 );
@@ -768,6 +773,17 @@ void NetOpenPanel::updateMRL()
emit mrlUpdated( qsl, "" );
}
+void NetOpenPanel::clearHistory()
+{
+ if( !b_recentList ) return;
+
+ // Clear the combobox contents
+ ui.urlComboBox->clear();
+
+ // Clear the stored history
+ getSettings()->remove( "OpenDialog/netMRL" );
+}
+
/**************************************************************************
* Open Capture device ( DVB, PVR, V4L, and similar ) *
**************************************************************************/
=====================================
modules/gui/qt/dialogs/open/open_panels.hpp
=====================================
@@ -158,6 +158,7 @@ private:
bool b_recentList;
public slots:
void updateMRL() override;
+ void clearHistory();
};
class DiscOpenPanel: public OpenPanel
View it on GitLab:
https://code.videolan.org/videolan/vlc/-/commit/51b6d57ede4da2d9df835a1b49c2891c013ac219
--
View it on GitLab:
https://code.videolan.org/videolan/vlc/-/commit/51b6d57ede4da2d9df835a1b49c2891c013ac219
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance_______________________________________________
vlc-commits mailing list
[email protected]
https://mailman.videolan.org/listinfo/vlc-commits