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...
static QgsProviderRegistry * instance(const QString &pluginPath=QString::null)
Means of accessing canonical single instance.
QString attribute(const QString &name, const QString &defValue) const
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 These QDom objects represent QgsProject nodes that map t...
QgsProjectBadLayerGuiHandler()
virtual void handleBadLayers(const QList< QDomNode > &layers, const QDomDocument &projectDom) override
Implementation of the handler.
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.
virtual QString fileVectorFilters() const
Return vector file filter string.
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)
Reads a project file.
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()
Returns the QgsProject singleton 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