18 #include <QApplication>
19 #include <QDomDocument>
21 #include <QMessageBox>
22 #include <QPushButton>
36 Q_UNUSED( projectDom );
46 messageBox.
addButton(
tr(
"Ignore" ), QMessageBox::ActionRole );
50 messageBox.
addButton( QMessageBox :: Cancel );
53 messageBox.
setText(
tr(
"Unable to open one or more project layers.\nChoose "
54 "ignore to continue loading without the missing layers. Choose cancel to "
55 "return to your pre-project load state. Choose OK to try to find the "
56 "missing layers." ) );
57 messageBox.
setIcon( QMessageBox::Critical );
64 QgsDebugMsg(
"want to find missing layers is true" );
88 if ( QString::null == type )
95 if (
"raster" == type )
101 else if (
"vector" == type )
118 if ( dataSourceNode.
isNull() )
122 return QString::null;
148 #ifdef HAVE_POSTGRESQL
149 else if ( ds.
contains(
"dbname=" ) )
182 dataSourceText.
setData( dataSource );
205 memoryQualifier =
"lastVectorFileFilter";
211 memoryQualifier =
"lastRasterFileFilter";
225 QString myFileFilters = originalDataSource.
fileName() +
";;" + fileFilters;
294 i != layerNodes.
end();
bool GUI_EXPORT openFilesRememberingFilter(QString const &filterName, QString const &filters, QStringList &selectedFiles, QString &enc, QString &title, bool cancelAll)
Open files, preferring to have the default file selector be the last one used, if any; also...
QString attribute(const QString &name, const QString &defValue) const
static QgsProviderRegistry * instance(QString pluginPath=QString::null)
means of accessing canonical single instance
ProviderType providerType(QDomNode &layerNode)
return the physical storage type associated with the given layer
void findLayers(const QString &fileFilters, const QList< QDomNode > &layerNodes)
find relocated data sources for given layers
QgsProjectBadLayerGuiHandler()
QString tr(const char *sourceText, const char *disambiguation, int n)
static bool mIgnore
Flag to store the Ignore button press of MessageBox used by QgsLegend.
QDomElement toElement() const
void setData(const QString &v)
DataType dataType(QDomNode &layerNode)
returns data type associated with the given QgsProject file Dom node
void setWindowTitle(const QString &title)
QString absoluteFilePath() const
void setText(const QString &text)
bool findMissingFile(const QString &fileFilters, QDomNode &layerNode)
this is used to locate files that have moved or otherwise are missing
void setOverrideCursor(const QCursor &cursor)
QString dataSource(QDomNode &layerNode)
return the data source for the given layer
void restoreOverrideCursor()
DataType
file data representation
QDomNode namedItem(const QString &name) const
bool contains(QChar ch, Qt::CaseSensitivity cs) const
bool read(const QFileInfo &file)
read project file
virtual QString fileVectorFilters() const
return vector file filter string
QDomNode firstChild() const
void setDataSource(QDomNode &layerNode, const QString &dataSource)
set the datasource element to the new value
ProviderType
the three flavors for data
static QgsProject * instance()
access to canonical QgsProject instance
bool findLayer(const QString &fileFilters, const QDomNode &constLayerNode)
find relocated data source for the given layer
QString arg(qlonglong a, int fieldWidth, int base, const QChar &fillChar) const
virtual void handleBadLayers(QList< QDomNode > layers, QDomDocument projectDom) override
implementation of the handler