Skip to content
Permalink
Browse files
fixes
  • Loading branch information
NEDJIMAbelgacem authored and nyalldawson committed Jan 12, 2022
1 parent 7f975c3 commit 8b50d051a6fcb34205c9b679089525a4286f8b73
Showing with 13 additions and 19 deletions.
  1. +5 −5 src/app/3d/qgs3dviewsmanager.cpp
  2. +0 −2 src/app/3d/qgs3dviewsmanager.h
  3. +1 −5 src/app/qgisapp.cpp
  4. +2 −2 src/app/qgsappwindowmanager.cpp
  5. +2 −2 src/ui/3d/qgs3dviewsmanager.ui
  6. +3 −3 src/ui/qgisapp.ui
@@ -44,7 +44,7 @@ void Qgs3DViewsManager::duplicateClicked()
return;

QString existingViewName = mListModel.stringList()[ m3DViewsListView->selectionModel()->selectedRows().at( 0 ).row() ];
QString newViewName = askUserForATitle( existingViewName, "Duplicate", false );
QString newViewName = askUserForATitle( existingViewName, tr( "Duplicate" ), false );

QgisApp::instance()->duplicate3DMapView( existingViewName, newViewName );
reload();
@@ -69,7 +69,7 @@ void Qgs3DViewsManager::renameClicked()
return;

QString oldTitle = mListModel.stringList()[ m3DViewsListView->selectionModel()->selectedRows().at( 0 ).row() ];
QString newTitle = askUserForATitle( oldTitle, "Rename", true );
QString newTitle = askUserForATitle( oldTitle, tr( "Rename" ), true );

if ( newTitle.isEmpty() )
return;
@@ -114,9 +114,9 @@ QString Qgs3DViewsManager::askUserForATitle( QString oldTitle, QString action, b
QStringList notAllowedTitles = m3DMapViewsDom->keys();
if ( allowExistingTitle )
notAllowedTitles.removeOne( oldTitle );
QgsNewNameDialog dlg( QStringLiteral( "3D view" ), newTitle, QStringList(), notAllowedTitles, Qt::CaseSensitive, this );
dlg.setWindowTitle( QStringLiteral( "%1 3D Map View" ).arg( action ) );
dlg.setHintString( QStringLiteral( "Enter a unique 3D map view title" ) );
QgsNewNameDialog dlg( tr( "3D view" ), newTitle, QStringList(), notAllowedTitles, Qt::CaseSensitive, this );
dlg.setWindowTitle( tr( "%1 3D Map View" ).arg( action ) );
dlg.setHintString( tr( "Enter a unique 3D map view title" ) );
dlg.setOverwriteEnabled( false );
dlg.setAllowEmptyName( false );
dlg.setConflictingNameWarning( tr( "Title already exists!" ) );
@@ -31,8 +31,6 @@ class Qgs3DViewsManager : public QDialog, private Ui::Qgs3DViewsManager
QMap<QString, QDomElement> *m3DMapViewsDom = nullptr;
QMap<QString, Qgs3DMapCanvasDockWidget *> *m3DMapViewsWidgets = nullptr;

void reloadListModel();

QString askUserForATitle( QString oldTitle, QString action, bool allowExistingTitle );
};

@@ -13894,7 +13894,6 @@ void QgisApp::initLayouts()
void QgisApp::new3DMapCanvas()
{
#ifdef HAVE_3D

// initialize from project
QgsRectangle fullExtent = mMapCanvas->projectExtent();

@@ -13932,9 +13931,6 @@ void QgisApp::new3DMapCanvas()
}

createInitialized3DMapCanvasDock( name );
QWidget *dialog = static_cast< QgsAppWindowManager * >( QgsGui::windowManager() )->openApplicationDialog( QgsAppWindowManager::Dialog3DMapViewsManager );
Qgs3DViewsManager *manager = dynamic_cast< Qgs3DViewsManager *>( dialog );
manager->reload();
#endif
}

@@ -16879,7 +16875,7 @@ void QgisApp::readProject( const QDomDocument &doc )

elem3DMap = elem3DMap.nextSiblingElement( QStringLiteral( "view" ) );
}
for ( QString viewName : m3DMapViewsDom.keys() )
for ( QString viewName : m3DMapViewsWidgets.keys() )
{
readDockWidgetSettings( m3DMapViewsWidgets[ viewName ], m3DMapViewsDom[ viewName ] );
}
@@ -71,8 +71,8 @@ QWidget *QgsAppWindowManager::openApplicationDialog( QgsAppWindowManager::Applic
m3DMapViewsManagerDialog = new Qgs3DViewsManager( QgisApp::instance(), Qt::Window );
m3DMapViewsManagerDialog->setAttribute( Qt::WA_DeleteOnClose );
}
// m3DMapViewsManagerDialog->show();
// m3DMapViewsManagerDialog->activate();
m3DMapViewsManagerDialog->show();
m3DMapViewsManagerDialog->reload();
return m3DMapViewsManagerDialog;
}
}
@@ -11,7 +11,7 @@
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
<string>3D Map Views Manager</string>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0" colspan="4">
@@ -46,7 +46,7 @@
</sizepolicy>
</property>
<property name="text">
<string>&amp;Open</string>
<string>&amp;Open...</string>
</property>
</widget>
</item>
@@ -17,7 +17,7 @@
<x>0</x>
<y>0</y>
<width>1277</width>
<height>24</height>
<height>22</height>
</rect>
</property>
<property name="toolTip">
@@ -93,7 +93,7 @@
</property>
<widget class="QMenu" name="m3DMapViewsMenu">
<property name="title">
<string>&amp;3D map views</string>
<string>&amp;3D Map Views</string>
</property>
<addaction name="mActionNew3DMapCanvas"/>
<addaction name="mActionManage3DMapViews"/>
@@ -3615,7 +3615,7 @@ Shows placeholders for labels which could not be placed, e.g. due to overlaps wi
<normaloff>:/images/themes/default/mActionNew3DMap.svg</normaloff>:/images/themes/default/mActionNew3DMap.svg</iconset>
</property>
<property name="text">
<string>New &amp;3D Map Views</string>
<string>New &amp;3D Map View</string>
</property>
<property name="toolTip">
<string>New 3D Map View</string>

0 comments on commit 8b50d05

Please sign in to comment.