Revert "BROWSER add optional button box to dock widget"

This reverts commit 5a2cf2968ded40e53246553ae122d96d37f77a26.
This commit is contained in:
Alessandro Pasotti 2023-10-05 10:05:35 +02:00 committed by Nyall Dawson
parent 3ecf3d5f61
commit 9695f1f808
4 changed files with 0 additions and 68 deletions

View File

@ -234,17 +234,6 @@ Splitter has been moved.
no longer used.
%End
void setButtonBoxVisibility( bool visible );
%Docstring
Set button box visibility to ``visible``.
.. note::
The button box is hidden by default.
.. versionadded:: 3.34
%End
signals:
void openFile( const QString &fileName, const QString &fileTypeHint = QString() );
%Docstring
@ -257,20 +246,6 @@ Emitted when drop uri list needs to be handled
void connectionsChanged();
%Docstring
Connections changed in the browser
%End
void helpRequested();
%Docstring
Emitted when the help button in the button box is clicked
.. versionadded:: 3.34
%End
void rejected();
%Docstring
Emitted when the close button in the button box is clicked
.. versionadded:: 3.34
%End
};

View File

@ -23,7 +23,6 @@
#include <QVBoxLayout>
#include <QFileDialog>
#include <QDialogButtonBox>
QgsBrowserDockWidget::QgsBrowserDockWidget( const QString &name, QgsBrowserGuiModel *browserModel, QWidget *parent )
: QgsDockWidget( parent )
@ -40,15 +39,6 @@ QgsBrowserDockWidget::QgsBrowserDockWidget( const QString &name, QgsBrowserGuiMo
mWidget = new QgsBrowserWidget( browserModel );
layout->addWidget( mWidget );
mButtonBox = new QDialogButtonBox( QDialogButtonBox::StandardButton::Close | QDialogButtonBox::StandardButton::Help, this );
mButtonBox->setVisible( false );
layout->addWidget( mButtonBox );
// Forward signals from button box
connect( mButtonBox, &QDialogButtonBox::helpRequested, this, &QgsBrowserDockWidget::helpRequested );
connect( mButtonBox, &QDialogButtonBox::rejected, this, &QgsBrowserDockWidget::rejected );
// Connect action signals
connect( mWidget, &QgsBrowserWidget::openFile, this, &QgsBrowserDockWidget::openFile );
connect( mWidget, &QgsBrowserWidget::handleDropUriList, this, &QgsBrowserDockWidget::handleDropUriList );
connect( mWidget, &QgsBrowserWidget::connectionsChanged, this, &QgsBrowserDockWidget::connectionsChanged );
@ -236,8 +226,3 @@ void QgsBrowserDockWidget::setActiveIndex( const QModelIndex &index )
void QgsBrowserDockWidget::splitterMoved()
{
}
void QgsBrowserDockWidget::setButtonBoxVisibility( bool visible )
{
mButtonBox->setVisible( visible );
}

View File

@ -22,8 +22,6 @@
class QgsMessageBar;
class QgsBrowserWidget;
class QDialogButtonBox;
class QAbstractButton;
/**
* \ingroup gui
@ -223,13 +221,6 @@ class GUI_EXPORT QgsBrowserDockWidget : public QgsDockWidget
*/
Q_DECL_DEPRECATED void splitterMoved() SIP_DEPRECATED;
/**
* Set button box visibility to \a visible.
* \note The button box is hidden by default.
* \since QGIS 3.34
*/
void setButtonBoxVisibility( bool visible );
signals:
//! Emitted when a file needs to be opened
void openFile( const QString &fileName, const QString &fileTypeHint = QString() );
@ -238,22 +229,9 @@ class GUI_EXPORT QgsBrowserDockWidget : public QgsDockWidget
//! Connections changed in the browser
void connectionsChanged();
/**
* Emitted when the help button in the button box is clicked
* \since QGIS 3.34
*/
void helpRequested();
/**
* Emitted when the close button in the button box is clicked
* \since QGIS 3.34
*/
void rejected();
private:
QgsBrowserWidget *mWidget = nullptr;
QDialogButtonBox *mButtonBox = nullptr;
};
#endif // QGSBROWSERDOCKWIDGET_H

View File

@ -67,12 +67,6 @@ QgsDataSourceManagerDialog::QgsDataSourceManagerDialog( QgsBrowserGuiModel *brow
connect( mBrowserWidget, &QgsBrowserDockWidget::openFile, this, &QgsDataSourceManagerDialog::openFile );
connect( mBrowserWidget, &QgsBrowserDockWidget::connectionsChanged, this, &QgsDataSourceManagerDialog::connectionsChanged );
connect( this, &QgsDataSourceManagerDialog::updateProjectHome, mBrowserWidget->browserWidget(), &QgsBrowserWidget::updateProjectHome );
connect( mBrowserWidget, &QgsBrowserDockWidget::helpRequested, this, [ = ]()
{
QgsHelp::openHelp( QStringLiteral( "managing_data_source/opening_data.html#the-browser-panel" ) );
} );
connect( mBrowserWidget, &QgsBrowserDockWidget::rejected, this, &QgsDataSourceManagerDialog::reject );
mBrowserWidget->setButtonBoxVisibility( true );
// Add registered source select dialogs
const QList<QgsSourceSelectProvider *> sourceSelectProviders = QgsGui::sourceSelectProviderRegistry()->providers( );