Skip to content
Permalink
Browse files

[BUGFIX][NEEDS-DOCS] add command line option to hide browser (refs #1…

  • Loading branch information
jef-n committed Sep 23, 2018
1 parent 7623ee8 commit 4911d2e7457549ead085a8a3f690348afde6e54a
@@ -135,6 +135,7 @@ void usage( const QString &appName )
<< QStringLiteral( "\t[--authdbdirectory path] use the given directory for authentication database\n" )
<< QStringLiteral( "\t[--code path]\trun the given python file on load\n" )
<< QStringLiteral( "\t[--defaultui]\tstart by resetting user ui settings to default\n" )
<< QStringLiteral( "\t[--hide-browser]\thide the browser widget\n" )
<< QStringLiteral( "\t[--dxf-export filename.dxf]\temit dxf output of loaded datasets to given file\n" )
<< QStringLiteral( "\t[--dxf-extent xmin,ymin,xmax,ymax]\tset extent to export to dxf\n" )
<< QStringLiteral( "\t[--dxf-symbology-mode none|symbollayer|feature]\tsymbology mode for dxf output\n" )
@@ -511,6 +512,7 @@ int main( int argc, char *argv[] )
bool myHideSplash = false;
bool settingsMigrationForce = false;
bool mySkipVersionCheck = false;
bool hideBrowser = false;
#if defined(ANDROID)
QgsDebugMsg( QString( "Android: Splash hidden" ) );
myHideSplash = true;
@@ -618,6 +620,10 @@ int main( int argc, char *argv[] )
{
mySnapshotWidth = QString( args[++i] ).toInt();
}
else if ( arg == QLatin1String( "--hide-browser" ) )
{
hideBrowser = true;
}
else if ( i + 1 < argc && ( arg == QLatin1String( "--height" ) || arg == QLatin1String( "-h" ) ) )
{
mySnapshotHeight = QString( args[++i] ).toInt();
@@ -1243,6 +1249,13 @@ int main( int argc, char *argv[] )
settings.remove( QStringLiteral( "/qgis/restoreDefaultWindowState" ) );
}

if ( hideBrowser )
{
if ( settings.value( QStringLiteral( "/Windows/Data Source Manager/tab" ) ).toInt() == 0 )
settings.setValue( QStringLiteral( "/Windows/Data Source Manager/tab" ), 1 );
settings.setValue( QStringLiteral( "/UI/hidebrowser" ), true );
}

// set max. thread count
// this should be done in QgsApplication::init() but it doesn't know the settings dir.
QgsApplication::setMaxThreads( settings.value( QStringLiteral( "qgis/max_threads" ), -1 ).toInt() );
@@ -4291,6 +4291,13 @@ void QgisApp::restoreWindowState()
QgsDebugMsg( "restore of UI state failed" );
}

if ( settings.value( QStringLiteral( "UI/hidebrowser" ), false ).toBool() )
{
mBrowserWidget->hide();
mBrowserWidget2->hide();
settings.remove( QStringLiteral( "UI/hidebrowser" ) );
}

// restore window geometry
if ( !restoreGeometry( settings.value( QStringLiteral( "UI/geometry" ) ).toByteArray() ) )
{
@@ -15,9 +15,9 @@
#include "qgsattributerelationedit.h"
#include "ui_qgsattributerelationedit.h"

QgsAttributeRelationEdit::QgsAttributeRelationEdit( const QString &relationid, QWidget *parent ) :
QWidget( parent ),
mRelationId( relationid )
QgsAttributeRelationEdit::QgsAttributeRelationEdit( const QString &relationid, QWidget *parent )
: QWidget( parent )
, mRelationId( relationid )
{
setupUi( this );
coCardinality->setToolTip( tr( "For a many to many (N:M) relation, the direct link has to be selected. The in-between table will be hidden." ) );
@@ -28,21 +28,22 @@
#include "qgsmessagelog.h"
#include "qgsgui.h"

QgsDataSourceManagerDialog::QgsDataSourceManagerDialog( QgsBrowserModel *browserModel, QWidget *parent, QgsMapCanvas *canvas, Qt::WindowFlags fl ) :
QgsOptionsDialogBase( QStringLiteral( "Data Source Manager" ), parent, fl ),
ui( new Ui::QgsDataSourceManagerDialog ),
mPreviousRow( -1 ),
mMapCanvas( canvas )
QgsDataSourceManagerDialog::QgsDataSourceManagerDialog( QgsBrowserModel *browserModel, QWidget *parent, QgsMapCanvas *canvas, Qt::WindowFlags fl )
: QgsOptionsDialogBase( QStringLiteral( "Data Source Manager" ), parent, fl )
, ui( new Ui::QgsDataSourceManagerDialog )
, mPreviousRow( -1 )
, mMapCanvas( canvas )
{

ui->setupUi( this );
ui->verticalLayout_2->setSpacing( 6 );
ui->verticalLayout_2->setMargin( 0 );
ui->verticalLayout_2->setContentsMargins( 0, 0, 0, 0 );

// QgsOptionsDialogBase handles saving/restoring of geometry, splitter and current tab states,
// switching vertical tabs between icon/text to icon-only modes (splitter collapsed to left),
// and connecting QDialogButtonBox's accepted/rejected signals to dialog's accept/reject slots
initOptionsBase( true );
initOptionsBase( false );

// Bind list index to the stacked dialogs
connect( ui->mOptionsListWidget, &QListWidget::currentRowChanged, this, &QgsDataSourceManagerDialog::setCurrentPage );
@@ -71,6 +72,7 @@ QgsDataSourceManagerDialog::QgsDataSourceManagerDialog( QgsBrowserModel *browser
addProviderDialog( dlg, provider->providerKey(), provider->text(), provider->icon( ), provider->toolTip( ) );
}

restoreOptionsBaseUi( QStringLiteral( "Data Source Manager" ) );
}

QgsDataSourceManagerDialog::~QgsDataSourceManagerDialog()
@@ -181,7 +181,7 @@ void QgsOptionsDialogBase::restoreOptionsBaseUi( const QString &title )
int curIndx = mSettings->value( QStringLiteral( "/Windows/%1/tab" ).arg( mOptsKey ), 0 ).toInt();

// if the last used tab is out of range or not enabled display the first enabled one
if ( mOptStackedWidget->count() < ( curIndx + 1 )
if ( mOptStackedWidget->count() < curIndx + 1
|| !mOptStackedWidget->widget( curIndx )->isEnabled() )
{
curIndx = 0;
@@ -561,7 +561,7 @@ class GRASS_LIB_EXPORT QgsGrass : public QObject
// path to QGIS GRASS modules like qgis.g.info etc.
static QString qgisGrassModulePath()
{
#ifdef _MSC_VER
#if defined(_MSC_VER) && !defined(USING_NMAKE) && !defined(USING_NINJA)
if ( QgsApplication::isRunningFromBuildDir() )
{
return QCoreApplication::applicationDirPath() + "/../../grass/modules/" + QgsApplication::cfgIntDir();
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>QgsOpstionDialogTemplate</class>
<widget class="QDialog" name="QgsOpstionDialogTemplate">
<class>QgsOptionDialogTemplate</class>
<widget class="QDialog" name="QgsOptionDialogTemplate">
<property name="geometry">
<rect>
<x>0</x>
@@ -24,8 +24,8 @@
#include <QApplication>
#include <QToolBar>

TestRendererGUI::TestRendererGUI( QWidget *parent ) :
QMainWindow( parent )
TestRendererGUI::TestRendererGUI( QWidget *parent )
: QMainWindow( parent )
{
resize( 640, 480 );

0 comments on commit 4911d2e

Please sign in to comment.
You can’t perform that action at this time.