Skip to content
Permalink
Browse files
Amend previously ommited docking feature of patch #2673.
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@13544 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mmassing committed May 21, 2010
1 parent 164caa5 commit a875ca520f459eee5f902e35a4496a58e355c6b6
@@ -70,11 +70,21 @@ void QgsGeorefConfigDialog::readSettings()
{
mShowCoordsCheckBox->setChecked( false );
}

if ( s.value( "/Plugin-GeoReferencer/Config/ShowDocked" ).toBool() )
{
mShowDockedCheckBox->setChecked( true );
}
else
{
mShowDockedCheckBox->setChecked( false );
}
}

void QgsGeorefConfigDialog::writeSettings()
{
QSettings s;
s.setValue( "/Plugin-GeoReferencer/Config/ShowId", mShowIDsCheckBox->isChecked() );
s.setValue( "/Plugin-GeoReferencer/Config/ShowCoords", mShowCoordsCheckBox->isChecked() );
s.setValue( "/Plugin-GeoReferencer/Config/ShowDocked", mShowDockedCheckBox->isChecked() );
}
@@ -19,15 +19,15 @@
<property name="title">
<string>Point tip</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QCheckBox" name="mShowIDsCheckBox">
<property name="text">
<string>Show IDs</string>
</property>
</widget>
</item>
<item>
<item row="1" column="0">
<widget class="QCheckBox" name="mShowCoordsCheckBox">
<property name="text">
<string>Show coords</string>
@@ -38,6 +38,13 @@
</widget>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="mShowDockedCheckBox">
<property name="text">
<string>Show Georeferencer window docked</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
@@ -86,6 +86,7 @@ QgsGeorefPluginGui::QgsGeorefPluginGui( QgisInterface* theQgisInterface, QWidget
, mMapCoordsDialog( 0 )
, mUseZeroForTrans( false )
, mLoadInQgis( false )
, mDock( 0 )
{
setupUi( this );

@@ -104,6 +105,33 @@ QgsGeorefPluginGui::QgsGeorefPluginGui( QgisInterface* theQgisInterface, QWidget
mActionLinkQGisToGeoref->setEnabled( false );

mCanvas->clearExtentHistory(); // reset zoomnext/zoomlast

QSettings s;
if ( s.value( "/Plugin-GeoReferencer/Config/ShowDocked" ).toBool() )
{
dockThisWindow( true );
}
}

void QgsGeorefPluginGui::dockThisWindow( bool dock )
{
if ( mDock )
{
setParent( 0 );
show();
mIface->removeDockWidget( mDock );
mDock->setWidget( 0 );
delete mDock;
mDock = 0;
}

if ( dock )
{
mDock = new QgsGeorefDockWidget( tr( "Georeferencer" ), mIface->mainWindow() );
mDock->setWidget( this );
connect( this, SIGNAL( destroyed() ), mDock, SLOT( close() ) );
mIface->addDockWidget( Qt::BottomDockWidgetArea, mDock );
}
}

QgsGeorefPluginGui::~QgsGeorefPluginGui()
@@ -123,6 +151,7 @@ QgsGeorefPluginGui::~QgsGeorefPluginGui()
delete mToolAddPoint;
delete mToolDeletePoint;
delete mToolMovePoint;
delete mDock;
}

// ----------------------------- protected --------------------------------- //
@@ -568,6 +597,17 @@ void QgsGeorefPluginGui::showGeorefConfigDialog()
{
mCanvas->refresh();
mIface->mapCanvas()->refresh();
QSettings s;
//update dock state
bool dock = s.value( "/Plugin-GeoReferencer/Config/ShowDocked" ).toBool();
if ( dock && !mDock )
{
dockThisWindow( true );
}
else if ( !dock && mDock )
{
dockThisWindow( false );
}
}
}

@@ -159,6 +159,9 @@ class QgsGeorefPluginGui : public QMainWindow, private Ui::QgsGeorefPluginGuiBas
void logRequaredGCPs();
void clearGCPData();

/**Docks / undocks this window*/
void dockThisWindow( bool dock );


QMenu *mPanelMenu;
QMenu *mToolbarMenu;
@@ -207,5 +210,7 @@ class QgsGeorefPluginGui : public QMainWindow, private Ui::QgsGeorefPluginGuiBas
bool mExtentsChangedRecursionGuard;
bool mGCPsDirty;
bool mLoadInQgis;

QDockWidget* mDock;
};
#endif

0 comments on commit a875ca5

Please sign in to comment.