Index: scribus/scribus.cpp
===================================================================
--- scribus/scribus.cpp	(révision 18561)
+++ scribus/scribus.cpp	(copie de travail)
@@ -4357,6 +4357,7 @@
 			Apply_MasterPage(doc->DocPages.at(p)->MPageNam, p, false);
 		}
 		view->reformPages(false);
+       checkExternals();    /* search images paths */
 		doc->setLoading(false);
 //		if (fileLoader->fileType() > FORMATID_NATIVEIMPORTEND)
 //			scrActions["fileSave"]->setEnabled(false);
@@ -4419,6 +4420,9 @@
 	return ret;
 }
 
+
+
+
 bool ScribusMainWindow::postLoadDoc()
 {
 	//FIXME Just return for now, if we arent using the GUI
@@ -11346,6 +11350,78 @@
 	return docWasChanged;
 }
 
+void ScribusMainWindow::checkExternals() /* search images */
+{
+       QString searchPath = QString();
+       bool reUsePath = false;
+       for (int a = 0; a < doc->Items->count(); ++a)
+       {
+               PageItem *currItem = doc->Items->at(a);
+               if (!currItem->Pfile.isEmpty())
+               {
+                       QFileInfo fi = QFileInfo(currItem->Pfile);
+                       if (!fi.exists())
+                       {
+                               if (!searchPath.isEmpty())
+                               {
+                                       QFile f(searchPath + "/" + fi.fileName());
+                                       if (f.exists())
+                                       {
+                                               fi.setFile(f);
+                                               currItem->Pfile = fi.absoluteFilePath();
+                                               currItem->PictureIsAvailable = true;
+                                               continue;
+                                       }
+                                       else
+                                               searchPath.clear();
+                               }
+                               QString wdir = QDir::fromNativeSeparators( fi.path() );
+                               QString fname = fi.fileName();
+
+                               CustomFDialog *dia = new CustomFDialog(qApp->activeWindow(), wdir, tr("Find Missing External File: ") + fi.filePath(), QString(), fdShowPreview + fdExistingFiles);
+                               QCheckBox* usePath = new QCheckBox(dia);
+                               usePath->setText( tr("Search other missing files in selected directory"));
+                               usePath->setToolTip( tr("If other missing files were found then first they will searched in that directory and dialog does not appear."));
+                               usePath->setChecked(reUsePath);
+                               dia->addWidgets(usePath);
+                               QCheckBox* stopSearch = new QCheckBox(dia);
+                               stopSearch->setText( tr("Stop searching of missing files"));
+                               stopSearch->setChecked(false);
+                               dia->addWidgets(stopSearch);
+                               dia->setSelection(fname);
+
+                               if (dia->exec() == QDialog::Accepted)
+                               {
+                                       fname = dia->selectedFile();
+                                       if (!fname.isEmpty())
+                                       {
+                                               fi = QFileInfo(fname);
+                                               currItem->loadImage(fi.absoluteFilePath(), false);
+                                               if (usePath->isChecked())
+                                               {
+                                                       searchPath = fi.absolutePath();
+                                                       reUsePath = true;
+                                               }
+                                               else
+                                               {
+                                                       searchPath.clear();
+                                                       reUsePath = false;
+                                               }
+                                       }
+                               }
+                               if (stopSearch->isChecked())
+                               {
+                                       delete dia;
+                                       doc->updatePic();
+                                       return;
+                               }
+                               delete dia;
+                       }
+               }
+       }
+       doc->updatePic();
+}
+
 bool ScribusMainWindow::editMarkDlg(Mark *mrk, PageItem_TextFrame* currItem)
 {
 	MarkInsert* editMDialog = NULL;
Index: scribus/canvasmode_normal.cpp
===================================================================
--- scribus/canvasmode_normal.cpp	(révision 18561)
+++ scribus/canvasmode_normal.cpp	(copie de travail)
@@ -1888,6 +1888,7 @@
 		m_doc->SnapGuides = savedAlignGuides;
 		m_doc->SnapElement = savedAlignElement;
 		m_doc->setLoading(false);
+        m_ScMW->checkExternals(); /* search image */
 		m_doc->view()->DrawNew();
 		if (m_doc->m_Selection->count() > 0)
 		{
Index: scribus/scribus.h
===================================================================
--- scribus/scribus.h	(révision 18561)
+++ scribus/scribus.h	(copie de travail)
@@ -540,6 +540,8 @@
 	void slotUpdateMarks();
 	bool editMarkDlg(Mark *mrk, PageItem_TextFrame* currItem = NULL);
 	void testQTQuick2_1();
+    // ! \brief check for missing externals files (images for now)
+     void checkExternals();
 
 signals:
 	void AppModeChanged(int oldMode, int newMode);
@@ -639,7 +641,9 @@
 	bool insertMarkDialog(PageItem_TextFrame* item, MarkType mT, ScItemsState* &is);
 	int m_marksCount; //remember marks count from last call
 	bool m_WasAutoSave;
-	bool m_pagePalVisible;
+    bool m_pagePalVisible;
+
+
 };
 
 #endif

