View Issue Details

IDProjectCategoryView StatusLast Update
0001678ScribusUser Interfacepublic2007-12-13 07:55
ReporterExScite Assigned Tofschmid  
PrioritynormalSeverityfeatureReproducibilityN/A
Status closedResolutionfixed 
PlatformMacintosh PowerBookOSMac OSXOS Version10.3.8
Product Version 
Target VersionFixed in Version1.3.5svn 
Summary0001678: Picture Management dialog needs a rewrite
DescriptionIf Picture Management reports you are missing pictures, the Search function comes up blank. I'm told that this is because it looks only in your home directory. You should be able to specify other directories. Also, as in DTP apps, if one missing picture is found in that directory and other missing pictures are also there, it should let you choose to fix all the broken links to this directory.
TagsNo tags attached.
Patch

Relationships

related to 0002467 closedcbradney Search for pictures function does not work on win32 
related to 0003814 closedcbradney Manage Pictures: Add button to search for all pictures in one directory 
has duplicate 0000516 closedfschmid Searching for a picture crashes scribus 
has duplicate 0002551 closedringerc manage picture isn't useful 
related to 0001811 closedringerc Tools - manage images: Search button does not work 
related to 0002376 closedringerc Source code requests 
related to 0002382 acknowledged Metabug: Code quality, structure, readability 
related to 0002463 closedjghali Issues with win32 build 

Activities

ringerc

2005-02-16 06:49

reporter   ~0003721

I tend to agree regarding the need to be able to resolve all broken links from a directory. I don't use the search function for images, so I can't comment on that.

I've updated your bug to more accurately refelect it's contents. It'd be great if you could select an appropriate severity and category in future.

louisdesjardins

2005-02-16 13:00

developer   ~0003729

If not a duplicate, this relates to bug 0001627: improvement for handling changes in images on disc

jb

2005-05-16 16:47

reporter   ~0004668

I have been working a bit to improve the "image managment dialog". One important missing feature is the ability to replace an image without changing its scaling/position (let's say you want to replace an image with its black&white copy to see if it looks better with or without colour).
So I added a "Replace" button.

Regarding the "Search" function, the way it actually works is not really user friendly. On my machine, it takes 80 seconds to search for one image! I let you imagine the problem if you have 10 or more images...

I think it may be better to have a "Locate" button that would allow the user to give the new path. All missing images would then be tested with the new folder.

I upload a screenshot of my current work. Please let me know what you think about it so I can continue working & submit a patch...

2005-05-16 16:47

 

imagemanager.png (13,300 bytes)
imagemanager.png (13,300 bytes)

ringerc

2005-07-13 15:01

reporter   ~0005563

Last edited: 2005-07-13 15:04

A whole bunch more work is needed on this.

jb, if you're interested then yes a cleanup of that dialog would not go astray. I've fixed the search responsiveness / lock-up issue, but a UI cleanup and some code tidying would be very good. So would the ability to retain image settings (but that needs to be done in ScribusView::LoadPict, which also needs other work like the ability to return an error code). I agree that a replace / browse button is also desirable, and the ability to search a custom path (easy to do now) would too.

Some better UI for progress on the new search code would be nice too.

ringerc

2005-07-13 15:16

reporter   ~0005567

Any rewrite should:
  - work non-modally, like a palette
  - handle doc changes in real time
  - use the new search code for responsiveness
  - let users browse for a pic not just search
  - let users specify an optional search base
  - support finding other missing images in the same dir as one that was found (and prompt the user with a dialog letting them select/deselect each one).

2005-07-18 15:30

 

picman.png (46,607 bytes)
picman.png (46,607 bytes)

jean-baptiste

2005-07-18 15:30

reporter   ~0005632

Ok, i've started a rewrite of the Picture Manager. Should be ready in a few days. Attached is a screenshot of the current status of my work...

2005-07-27 22:42

 

patch2.diff (50,248 bytes)
Index: scribus/scribus.cpp
===================================================================
RCS file: /cvs/Scribus/scribus/scribus.cpp,v
retrieving revision 1.228.2.447
diff -u -3 -p -u -r1.228.2.447 scribus.cpp
--- scribus/scribus.cpp	26 Jul 2005 23:10:13 -0000	1.228.2.447
+++ scribus/scribus.cpp	27 Jul 2005 22:40:17 -0000
@@ -76,7 +76,6 @@
 #include "editformats.h"
 #include "muster.h"
 #include "applytemplatedialog.h"
-#include "picstatus.h"
 #include "customfdialog.h"
 #include "cmsprefs.h"
 #include "annot.h"
@@ -144,6 +143,7 @@
 #include "marginWidget.h"
 #include "margindialog.h"
 #include "prefsmanager.h"
+#include "picstatus.h"
 
 using namespace std;
 
@@ -178,6 +178,7 @@ ScribusApp::ScribusApp()
 	scrMenuMgr=NULL;
 	undoManager=NULL;
 	prefsManager=NULL;
+	picManagerOpened=false;
 } // ScribusApp::ScribusApp()
 
 /*
@@ -9047,13 +9048,10 @@ void ScribusApp::restoreUngroupping(Simp
 
 void ScribusApp::StatusPic()
 {
-	if (HaveDoc)
+	if (HaveDoc && !picManagerOpened)
 	{
-		PicStatus *dia = new PicStatus(this, doc, view);
-		connect(dia, SIGNAL(selectPage(int)), this, SLOT(SelectFromOutlS(int)));
-		connect(dia, SIGNAL(selectMasterPage(QString)), this, SLOT(manageMasterPages(QString)));
-		dia->exec();
-		delete dia;
+		PicStatus *picManager = new PicStatus(this, doc, view);
+		picManager->show();
 	}
 }
 
Index: scribus/scribus.h
===================================================================
RCS file: /cvs/Scribus/scribus/scribus.h,v
retrieving revision 1.60.2.124
diff -u -3 -p -u -r1.60.2.124 scribus.h
--- scribus/scribus.h	26 Jul 2005 23:10:13 -0000	1.60.2.124
+++ scribus/scribus.h	27 Jul 2005 22:40:18 -0000
@@ -176,6 +176,8 @@ public:
 	double DispX;
 	double DispY;
 	int HaveDoc;
+	bool picManagerOpened;
+
 	PrefsContext* dirs;
 	/** view is the main widget which represents your working area. The View
 	 * class should handle all events of the view widget.  It is kept empty so
Index: scribus/scribusview.cpp
===================================================================
RCS file: /cvs/Scribus/scribus/scribusview.cpp,v
retrieving revision 1.76.2.256
diff -u -3 -p -u -r1.76.2.256 scribusview.cpp
--- scribus/scribusview.cpp	26 Jul 2005 23:10:13 -0000	1.76.2.256
+++ scribus/scribusview.cpp	27 Jul 2005 22:40:23 -0000
@@ -10936,12 +10936,12 @@ void ScribusView::editExtendedImagePrope
 	}
 }
 
-void ScribusView::LoadPict(QString fn, int ItNr, bool reload)
+void ScribusView::LoadPict(QString fn, int ItNr, bool reload, bool reinit)
 {
 	loadPict(fn, Doc->Items.at(ItNr), reload);
 }
 
-void ScribusView::loadPict(QString fn, PageItem *pageItem, bool reload)
+void ScribusView::loadPict(QString fn, PageItem *pageItem, bool reload, bool reinit)
 {
 	bool dummy;
 	QFileInfo fi = QFileInfo(fn);
@@ -10979,7 +10979,7 @@ void ScribusView::loadPict(QString fn, P
 		Item->PicAvail = true;
 		Item->PicArt = true;
 		Item->BBoxX = 0;
-		if (Item->Pfile != fn)
+		if (Item->Pfile != fn && reinit)
 		{
 			Item->LocalScX = 72.0 / xres;
 			Item->LocalScY = 72.0 / yres;
@@ -11659,6 +11659,7 @@ void ScribusView::PasteItem(struct CopyP
 		currItem->GrEndY = Buffer->GrEndY;
 		updateGradientVectors(currItem);
 	}
+	currItem->OwnPage = Doc->currentPage->PageNr;
 	currItem->setObjectAttributes(&(Buffer->pageItemAttributes));
 	setRedrawBounding(currItem);
 	currItem->OwnPage = OnPage(currItem);
Index: scribus/scribusview.h
===================================================================
RCS file: /cvs/Scribus/scribus/scribusview.h,v
retrieving revision 1.14.2.63
diff -u -3 -p -u -r1.14.2.63 scribusview.h
--- scribus/scribusview.h	26 Jul 2005 23:10:14 -0000	1.14.2.63
+++ scribus/scribusview.h	27 Jul 2005 22:40:23 -0000
@@ -252,8 +252,8 @@ public:
 	void chFSize(int size);
 	void FlipImageH();
 	void FlipImageV();
-	void LoadPict(QString fn, int ItNr, bool reload = false);
-	void loadPict(QString fn, PageItem *pageItem, bool reload = false);
+	void LoadPict(QString fn, int ItNr, bool reload = false, bool reload = true);
+	void loadPict(QString fn, PageItem *pageItem, bool reload = false, bool reload = true);
 	void AdjustPictScale(PageItem *currItem, bool reload = true);
 	void PasteItem(struct CopyPasteBuffer *Buffer, bool loading, bool drag = false);
 	void BuildAObj();
Index: scribus/picstatus.cpp
===================================================================
RCS file: /cvs/Scribus/scribus/picstatus.cpp,v
retrieving revision 1.12.2.12
diff -u -3 -p -u -r1.12.2.12 picstatus.cpp
--- scribus/picstatus.cpp	13 Jul 2005 16:56:12 -0000	1.12.2.12
+++ scribus/picstatus.cpp	27 Jul 2005 22:40:23 -0000
@@ -15,14 +15,17 @@
  *                                                                         *
  ***************************************************************************/
 
-#include "picstatus.h"
-#include "picstatus.moc"
 #include <qfileinfo.h>
 #include <qfiledialog.h>
 #include <qtoolbutton.h>
+#include <qpixmap.h>
 #include <qstringlist.h>
 #include <qtextstream.h>
+#include <qlistview.h>
 #include <qcursor.h>
+#include <qbutton.h>
+#include <qfont.h>
+
 #include <cstdio>
 #include "picsearch.h"
 #include "scribusdoc.h"
@@ -30,341 +33,629 @@
 #include "pageitem.h"
 #include "filesearch.h"
 #include "scribus.h"
+
 extern QPixmap loadIcon(QString nam);
 extern ScribusApp* ScApp;
 
-const unsigned short PicStatus::COL_FILENAME = 0;
-const unsigned short PicStatus::COL_PATH = 1;
-const unsigned short PicStatus::COL_PAGE = 2;
-const unsigned short PicStatus::COL_GOTO = 3;
-const unsigned short PicStatus::COL_PRINT = 4;
-const unsigned short PicStatus::COL_STATUS = 5;
-const unsigned short PicStatus::COL_SEARCH = 6;
-
-const QString PicStatus::trOK = PicStatus::tr("OK");
-const QString PicStatus::trMissing = PicStatus::tr("Missing");
-const QString PicStatus::trSearch = PicStatus::tr("Search");
-const QString PicStatus::trCancelSearch = PicStatus::tr("Cancel Search");
-const QString PicStatus::trGoto = PicStatus::tr("Goto");
+#include "picstatus.h"
+#include "picstatus.moc"
+
+
+m_CheckListItem::m_CheckListItem (QListView *parent, const QString &text):
+                QCheckListItem(parent,text,QCheckListItem::CheckBox)
+{}
+
+void m_CheckListItem::stateChange (bool value)
+{
+        emit statusChange ( this, value);
+}
+
+
+
+PicStatus::PicStatus(QWidget* parent, ScribusDoc *docu, ScribusView *viewi)
+                : pictureManager( parent, "pic", false,Qt::WDestructiveClose )
+{
+	QFont font(font());
+	font.setPointSize(font.pointSize()-2);
+	setFont(font);
+        doc = docu;
+        view = viewi;
+	pageItems=0;
+	masterItems=0;
+	ScApp->picManagerOpened=true;
+        pictureList->setSorting(1);
+
+	pictureList->setColumnAlignment (3,Qt::AlignHCenter);
+        pictureList->setColumnWidthMode (0,QListView::Manual);
+	pictureList->setColumnWidthMode (1,QListView::Manual);
+	pictureList->setColumnWidthMode (2,QListView::Manual);
+	pictureList->setColumnWidthMode (3,QListView::Manual);
+
+	pictureList->setColumnWidth (0,40);
+	pictureList->setColumnWidth (1,120);
+	pictureList->setColumnWidth (2,100);
+	pictureList->setColumnWidth (3,40);
+
+        watchTimer = new QTimer(this);
+        connect(watchTimer, SIGNAL(timeout()), this, SLOT(reloadList()));
+        ContextPopupMenu=new QPopupMenu(pictureList);
+ 	ContextPopupMenu->insertItem( tr("Show"),  this, SLOT(gotoPic()), CTRL+Key_H ,0);
+ 	ContextPopupMenu->insertItem( tr("Browse"),  this, SLOT(replacePic()), CTRL+Key_B ,1);
+        ContextPopupMenu->insertItem( tr("Search"), this, SLOT(searchPic()),    CTRL+Key_S ,2);
+ 	connect(pictureList,SIGNAL(contextMenuRequested( QListViewItem * , const QPoint &, int)),this,SLOT(showMenu(QListViewItem * , const QPoint &, int)));
+        
+	pictureList->setResizeMode(QListView::LastColumn);
+	QHeader * h = pictureList->header(); 
+	h->moveSection(0,4);
+	pictureList->repaint();
+
+	reloadList();
+
+        connect(pictureList, SIGNAL(doubleClicked ( QListViewItem *, const QPoint &, int )), this, SLOT(gotoPic()));
+        connect(pictureList, SIGNAL(selectionChanged ()), this, SLOT(checkState()));
+        connect(showButton, SIGNAL(clicked()), this, SLOT(gotoPic()));
+        connect(searchButton, SIGNAL(clicked()), this, SLOT(searchPic()));
+        connect(browseButton, SIGNAL(clicked()), this, SLOT(replacePic()));
+}
+
+PicStatus::~PicStatus()
+{
+        ScApp->picManagerOpened=false;
+}
+
 
 /*!
- \fn void PicStatus::PicStatus(QWidget* parent, ScribusDoc *docu, ScribusView *viewi)
- \author Franz Schmid
+ \fn void PicStatus::showMenu()
+ \author Jean-Baptiste Mardelle
  \date
- \brief Constructs a Dialog, which list all Images in the current Document. In this Dialog it is possible
-to search for missing Images.
- \param parent Pointer to parent window
- \param docu Pointer to the current Document
- \param viewi Pointer to the current View
- \retval None
+ \brief displays context menu on image item
+ \param None
+ \retval none
  */
+void PicStatus::showMenu(QListViewItem *it , const QPoint &, int)
+{
+if (!it) return;
+ContextPopupMenu->exec(QCursor::pos());
+}
 
-PicStatus::PicStatus(QWidget* parent, ScribusDoc *docu, ScribusView *viewi) :
-	QDialog( parent, "pic", true, 0 )
-{
-	uint p, i;
-	QString tmp;
-	setCaption( tr( "Manage Pictures" ) );
-	setIcon(loadIcon("AppIcon.png"));
-	doc = docu;
-	view = viewi;
-	ItemNrs.clear();
-	FlagsPic.clear();
-	PicStatusLayout = new QVBoxLayout( this );
-	PicStatusLayout->setSpacing( 6 );
-	PicStatusLayout->setMargin( 11 );
-
-	PicTable = new QTable( this, "PicTable" );
-	PicTable->setLeftMargin(0);
-	PicTable->verticalHeader()->hide();
-	PicTable->setNumCols( 7 );
-	Header = PicTable->horizontalHeader();
-	QString tmpc[] = { tr("Name"),  tr("Path"),  tr("Page"), " ",  tr("Print"),  tr("Status"), " "};
-	size_t ar = sizeof(tmpc) / sizeof(*tmpc);
-	for (uint a = 0; a < ar; ++a)
-		Header->setLabel(a, tmpc[a]);
-	Zeilen = 0;
-	for (i=0; i < doc->MasterItems.count(); ++i)
-	{
-		if (doc->MasterItems.at(i)->itemType() == PageItem::ImageFrame)
-		{
-			Zeilen++;
-			ItemNrs.append(i);
-		}
-	}
-	for (i=0; i<doc->Items.count(); ++i)
-	{
-		if (doc->Items.at(i)->itemType() == PageItem::ImageFrame)
-		{
-			Zeilen++;
-			ItemNrs.append(i);
-		}
-	}
-	PicTable->setNumRows(Zeilen);
-	int Zeilen2 = 0;
-	for (i=0; i < doc->MasterItems.count(); ++i)
-	{
-		if (doc->MasterItems.at(i)->itemType() == PageItem::ImageFrame)
-		{
-			QFileInfo fi = QFileInfo(doc->MasterItems.at(i)->Pfile);
-			PicTable->setText(Zeilen2, COL_FILENAME, fi.fileName());
-			PicTable->setText(Zeilen2, COL_PATH, fi.dirPath());
-			PicTable->setText(Zeilen2, COL_PAGE, doc->MasterItems.at(i)->OnMasterPage);
-			QToolButton *tb2 = new QToolButton(this, tmp.setNum(Zeilen2));
-			tb2->setText( trGoto);
-			tb2->setEraseColor(white);
-			PicTable->setColumnWidth(COL_GOTO, tb2->fontMetrics().width( trGoto)+10);
-			PicTable->setCellWidget(Zeilen2, COL_GOTO, tb2);
-			connect(tb2, SIGNAL(clicked()), this, SLOT(GotoPic()));
-			QCheckBox *cp2 = new QCheckBox(this, tmp.setNum(Zeilen2));
-			cp2->setText( tr("Yes"));
-			cp2->setChecked(doc->MasterItems.at(i)->printable());
-			cp2->setEraseColor(white);
-			FlagsPic.append(cp2);
-			PicTable->setCellWidget(Zeilen2, COL_PRINT, cp2);
-			connect(cp2, SIGNAL(clicked()), this, SLOT(PrintPic()));
-			if (doc->MasterItems.at(i)->PicAvail)
-				PicTable->setText(Zeilen2, COL_STATUS, trOK);
-			else
-				PicTable->setText(Zeilen2, COL_STATUS, trMissing);
-			QToolButton *tb = new QToolButton(this, tmp.setNum(Zeilen2));
-			tb->setText( trSearch);
-			PicTable->setColumnWidth(COL_SEARCH, tb->fontMetrics().width( trCancelSearch)+10);
-			tb->setEraseColor(white);
-			PicTable->setCellWidget(Zeilen2, COL_SEARCH, tb);
-			connect(tb, SIGNAL(clicked()), this, SLOT(SearchPic()));
-			Zeilen2++;
-		}
-	}
-	for (i=0; i< doc->Items.count(); ++i)
-	{
-		if (doc->Items.at(i)->itemType() == PageItem::ImageFrame)
-		{
-			QFileInfo fi = QFileInfo(doc->Items.at(i)->Pfile);
-			PicTable->setText(Zeilen2, COL_FILENAME, fi.fileName());
-			PicTable->setText(Zeilen2, COL_PATH, fi.dirPath());
-			p = doc->Items.at(i)->OwnPage;
-			PicTable->setText(Zeilen2, COL_PAGE, tmp.setNum(p+1));
-			QToolButton *tb2 = new QToolButton(this, tmp.setNum(Zeilen2));
-			tb2->setText( trGoto);
-			tb2->setEraseColor(white);
-			PicTable->setColumnWidth(COL_GOTO, tb2->fontMetrics().width( trGoto)+10);
-			PicTable->setCellWidget(Zeilen2, COL_GOTO, tb2);
-			connect(tb2, SIGNAL(clicked()), this, SLOT(GotoPic()));
-			QCheckBox *cp2 = new QCheckBox(this, tmp.setNum(Zeilen2));
-			cp2->setText( tr("Yes"));
-			cp2->setChecked(doc->Items.at(i)->printable());
-			cp2->setEraseColor(white);
-			FlagsPic.append(cp2);
-			PicTable->setCellWidget(Zeilen2, COL_PRINT, cp2);
-			connect(cp2, SIGNAL(clicked()), this, SLOT(PrintPic()));
-			if (doc->Items.at(i)->PicAvail)
-				PicTable->setText(Zeilen2, COL_STATUS, trOK);
-			else
-				PicTable->setText(Zeilen2, COL_STATUS, trMissing);
-			QToolButton *tb = new QToolButton(this, tmp.setNum(Zeilen2));
-			tb->setText( trSearch);
-			PicTable->setColumnWidth(COL_SEARCH, tb->fontMetrics().width( trCancelSearch)+10);
-			tb->setEraseColor(white);
-			PicTable->setCellWidget(Zeilen2, COL_SEARCH, tb);
-			connect(tb, SIGNAL(clicked()), this, SLOT(SearchPic()));
-			Zeilen2++;
-		}
-	}
 
-	PicTable->adjustColumn(COL_FILENAME);
-	PicTable->adjustColumn(COL_PATH);
-	PicTable->adjustColumn(COL_PAGE);
-	PicTable->adjustColumn(COL_PRINT);
-	PicTable->adjustColumn(COL_STATUS);
-	PicTable->setSorting(false);
-	PicTable->setSelectionMode(QTable::NoSelection);
-	PicTable->setColumnMovingEnabled(false);
-	PicTable->setRowMovingEnabled(false);
-	Header->setMovingEnabled(false);
-	PicTable->setColumnReadOnly(COL_FILENAME, true);
-	PicTable->setColumnReadOnly(COL_PATH, true);
-	PicTable->setColumnReadOnly(COL_PAGE, true);
-	PicTable->setColumnReadOnly(COL_STATUS, true);
-	PicStatusLayout->addWidget( PicTable );
-
-	Layout2 = new QHBoxLayout;
-	Layout2->setSpacing( 3 );
-	Layout2->setMargin( 0 );
-	QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
-	Layout2->addItem( spacer );
-
-	OkB = new QPushButton( tr( "OK" ), this, "OkB" );
-	Layout2->addWidget( OkB );
-	PicStatusLayout->addLayout( Layout2 );
+/*!
+ \fn void PicStatus::checkAvail()
+ \author Jean-Baptiste Mardelle
+ \date
+ \brief checks if the picture is currently available
+ \param None
+ \retval bool
+ */
+bool PicStatus::checkAvail()
+{
+QString m=static_cast<m_CheckListItem*>(pictureList->currentItem())->m_Index;
+        if (m.startsWith("+")) {
+                if (doc->MasterItems.at(m.toUInt())->PicAvail)
+                        return true;
+        } else if (doc->DocItems.at(m.toUInt())->PicAvail)
+                return true;
+return false;
+}
+
 
-	// signals and slots connections
-	connect( OkB, SIGNAL( clicked() ), this, SLOT( accept() ) );
+/*!
+ \fn void PicStatus::checkState()
+ \author Jean-Baptiste Mardelle
+ \date
+ \brief Enable / disable menu entries depending on selected image
+ \param None
+ \retval None
+ */
+void PicStatus::checkState()
+{
+if (!pictureList->currentItem()) return;
+bool isAvail=checkAvail();
+searchButton->setEnabled(!isAvail);
+ContextPopupMenu->setItemEnabled(2,!isAvail);
 }
 
+
+
 /*!
- \fn void PicStatus::GotoPic()
+ \fn void PicStatus::gotoPic()
  \author Franz Schmid
  \date
  \brief Moves to the Page containing the selected Image.
  \param None
  \retval None
  */
-void PicStatus::GotoPic()
+void PicStatus::gotoPic()
 {
-	QString pageText = PicTable->text(QString(sender()->name()).toInt(), 2);
-	bool ok = false;
-	int pageNum = pageText.toInt(&ok);
-	if (doc->masterPageMode)
-		ScApp->ActWin->muster->close();
-	if (!ok)
-		emit selectMasterPage(pageText);
-	else
-		emit selectPage(pageNum-1);
+        if (!pictureList->currentItem())
+                return;
+        QString pageText = pictureList->currentItem()->text(3);
+        QString ItNr = static_cast<m_CheckListItem*>(pictureList->currentItem())->m_Index;
+
+	// Master page names start with a +
+
+        if (ItNr.startsWith("+")) {
+                ScApp->manageMasterPages(pageText);
+		if (!doc->MasterItems.at(ItNr.toUInt())) reloadList();
+		else view->SelectItem(doc->MasterItems.at(ItNr.toUInt()), true, true);
+        } else {
+		if (doc->masterPageMode) ScApp->ActWin->muster->close();
+                view->Deselect(true);
+                view->GotoPage(pageText.toInt()-1);
+		if (!doc->DocItems.at(ItNr.toUInt())) reloadList();
+                else view->SelectItem(doc->DocItems.at(ItNr.toUInt()), true, true);
+        }
 }
 
+
 /*!
- \fn void PicStatus::SearchPic()
+ \fn void PicStatus::PrintPic()
  \author Franz Schmid
  \date
- \brief Searches for the given Picture. Displays a Dialog when more than one Picture is found.
+ \brief Enables or disables printing of the selected Image.
  \param None
  \retval None
  */
-void PicStatus::SearchPic()
+void PicStatus::printPic(m_CheckListItem* item, bool isOn)
 {
-	// FIXME: This is a pretty ugly hack IMO - carried over from the old
-	// SearchPic. Table handling needs work.
-	unsigned int row = QString(sender()->name()).toUInt();
-	QString fileName = PicTable->text(row, 0);
-	// Set up the search, then return to the event loop until it notifies us
-	// that it's done.
-	// Note: search will be deleted when this PicStatus is, so there's no
-	// need to worry about cleanup.
-	FileSearch* search = new FileSearch(this, fileName);
-	Q_CHECK_PTR(search);
-	connect(search,
-			SIGNAL(searchComplete(const QStringList&, const QString&)),
-			SLOT(SearchPicFinished(const QStringList&, const QString&)));
-	connect(search, SIGNAL(searchAborted(bool)), SLOT(SearchPicAborted(bool)));
-	// Set up the UI to let the user cancel the search, then start it
-	setSearchButton(row, true, search);
-	search->start();
+        QString ItNr = item->m_Index;
+	if (ItNr.startsWith("+"))
+                doc->MasterItems.at(ItNr.toUInt())->setPrintable(isOn);
+        else
+                doc->DocItems.at(ItNr.toUInt())->setPrintable(isOn);
 }
 
-void PicStatus::SearchPicAborted(bool userCancelled)
+
+/*!
+ \fn void PicStatus::replacePic()
+ \author Jean-Baptiste Mardelle
+ \date
+ \brief replace a current image with another file
+ \param None
+ \retval None
+ */
+void PicStatus::replacePic()
 {
-	const FileSearch* search = dynamic_cast<const FileSearch*>(sender());
-	Q_ASSERT(search);
-	// Restore button to normal "search"
-	unsigned int row = getRowByFileName(search->fileName());
-	setSearchButton(row, false, search);
-	// and inform user if it it wasn't them who asked to stop it.
-	if (!userCancelled)
-		// A running search failed
-		QMessageBox::warning(this, tr("Scribus - Image Search"),
-				tr("The search failed: %1").arg(search->failReason()),
-				QMessageBox::Ok|QMessageBox::Default|QMessageBox::Escape,
-				QMessageBox::NoButton);
+        if (!pictureList->currentItem())
+                return;
+        watchTimer->stop();
+        gotoPic();
+        QString fn=slotFileOpen(pictureList->currentItem()->text(2));
+        if (!fn.isEmpty()) {
+                view->LoadPict(fn,static_cast<m_CheckListItem*>(pictureList->currentItem())->m_Index.toUInt(),false,false);
+                view->DrawNew();
+                reloadItem(pictureList->currentItem());
+        }
+        watchTimer->start(10000, true);
 }
 
-void PicStatus::SearchPicFinished(const QStringList & matches, const QString & fileName)
+/*!
+ \fn void PicStatus::slotFileOpen()
+ \author Jean-Baptiste Mardelle
+ \date
+ \brief open file dialog to choose another image
+ \param None
+ \retval None
+ */
+QString PicStatus::slotFileOpen(QString path)
 {
-	const FileSearch* search = dynamic_cast<const FileSearch*>(sender());
-	Q_ASSERT(search);
-	// First, find out what row the search result is about
-	unsigned int row = getRowByFileName(fileName);
-	// Restore the gui to "search"
-	setSearchButton(row, false, search);
-	// Then display a dialog for the user to select images from
-	// if one or more were found
-	if (matches.count() == 0)
+        QString formats = "";
+        QString formatD = tr("All Supported Formats")+" (";
+        QString form1 = "";
+        QString form2 = "";
+        for ( uint i = 0; i < QImageIO::inputFormats().count(); ++i ) {
+                form1 = QString(QImageIO::inputFormats().at(i)).lower();
+                form2 = QString(QImageIO::inputFormats().at(i)).upper();
+                if (form1 == "jpeg") {
+                        form1 = "jpg";
+                        form2 = "JPG";
+                }
+                if ((form1 == "png") || (form1 == "xpm") || (form1 == "gif")) {
+                        formats += form2 + " (*."+form1+" *."+form2+");;";
+                        formatD += "*."+form1+" *."+form2+" ";
+                } else if (form1 == "jpg") {
+                        // JPEG is a special case because both .jpg and .jpeg
+                        // are acceptable extensions.
+                        formats += "JPEG (*.jpg *.jpeg *.JPG *.JPEG);;";
+                        formatD += "*.jpg *.jpeg *.JPG *.JPEG ";
+                }
+        }
+#ifdef HAVE_TIFF
+        formats += "TIFF (*.tif *.tiff *.TIF *TIFF);;";
+        formatD += "*.tif *.tiff *.TIF *TIFF";
+#endif
+
+        formats += "PSD (*.psd *.PSD);;";
+        formatD += " *.psd *.PSD";
+        formats += "EPS (*.eps *.EPS);;PDF (*.pdf *.PDF);;" + tr("All Files (*)");
+        formatD += " *.eps *.EPS *.pdf *.PDF";
+        formatD += ");;"+formats;
+        QString fileName = ScApp->CFileDialog( path, tr("Open"), formatD, "", true);
+        return fileName;
+
+}
+
+
+/*!
+ \fn void PicStatus::reloadItem()
+ \author Jean-Baptiste Mardelle
+ \date
+ \brief reload only current item in the list of images
+ \param None
+ \retval None
+ */
+void PicStatus::reloadItem(QListViewItem *item)
+{
+        uint p;
+        QString tmp;
+        QString ItNr = static_cast<m_CheckListItem*>(item)->m_Index;
+	if (ItNr.startsWith("+"))
 	{
-		QMessageBox::information(this, tr("Scribus - Image Search"),
-				tr("No images named \"%1\" were found.").arg(fileName),
-				QMessageBox::Ok|QMessageBox::Default|QMessageBox::Escape,
-				QMessageBox::NoButton);
+	QFileInfo fi = QFileInfo(doc->MasterItems.at(ItNr.toUInt())->Pfile);
+        if (doc->MasterItems.at(ItNr.toUInt())->printable())
+                static_cast<QCheckListItem*>(item)->setState(QCheckListItem::On);
+        else
+                static_cast<QCheckListItem*>(item)->setState(QCheckListItem::Off);
+        item->setText(1,fi.fileName());
+        item->setText(2,fi.dirPath());
+        item->setText(3,doc->MasterItems.at(ItNr.toUInt())->OnMasterPage);
+        if (doc->MasterItems.at(ItNr.toUInt())->PicAvail)
+                item->setPixmap(1,NULL);
+        else
+                item->setPixmap(1,loadIcon("pic_miss.png"));
 	}
 	else
 	{
-		PicSearch *dia = new PicSearch(this, fileName, matches);
-		if (dia->exec())
+        QFileInfo fi = QFileInfo(doc->DocItems.at(ItNr.toUInt())->Pfile);
+        p = doc->DocItems.at(ItNr.toUInt())->OwnPage;
+        if (doc->DocItems.at(ItNr.toUInt())->printable())
+                static_cast<QCheckListItem*>(item)->setState(QCheckListItem::On);
+        else
+                static_cast<QCheckListItem*>(item)->setState(QCheckListItem::Off);
+        item->setText(1,fi.fileName());
+        item->setText(2,fi.dirPath());
+        item->setText(3,tmp.setNum(p+1));
+        if (doc->DocItems.at(ItNr.toUInt())->PicAvail)
+                item->setPixmap(1,NULL);
+        else
+                item->setPixmap(1,loadIcon("pic_miss.png"));
+	}
+}
+
+/*!
+ \fn void PicStatus::SearchPic()
+ \author Franz Schmid
+ \date
+ \brief Searches for the given Picture. Displays a Dialog when more than one Picture is found.
+ \param None
+ \retval None
+ */
+void PicStatus::searchPic()
+{
+        watchTimer->stop();
+        QString fileName = pictureList->currentItem()->text(1);
+        searchParams=new pictureSearch(this);
+        searchParams->filePath->setText(pictureList->currentItem()->text(2));
+        searchParams->imageName->setText(tr("Search for %1 in: ").arg(fileName));
+        connect(searchParams,SIGNAL(startSearch(QString,bool,bool)),this,SLOT(startSearch(QString,bool,bool)));
+        connect(searchParams,SIGNAL(stopSearch()),this,SLOT(stopSearch()));
+        connect(searchParams,SIGNAL(replaceImage(QString,bool)),this,SLOT(replaceImage(QString,bool)));
+        searchParams->exec();
+        view->DrawNew();
+	reParseList();
+}
+
+
+/*!
+ \fn void PicStatus::replaceImage()
+ \author Jean-Baptiste Mardelle
+ \date
+ \brief replace missing image(s) with found files
+ \param None
+ \retval None
+ */
+void PicStatus::replaceImage(QString newUrl,bool replaceAll)
+{
+	QString currItN=static_cast<m_CheckListItem*>(pictureList->currentItem())->m_Index;
+        view->LoadPict(newUrl, currItN.toUInt(),false,false);
+        if (replaceAll) {
+                QString tmp;
+                QString list;
+                QString newpath=QFileInfo(newUrl).dirPath(true);
+                QDir dir(newUrl);
+                uint i=0;
+                QListViewItem * child = pictureList->firstChild();
+                while( child ) {
+                        QString ItN=static_cast<m_CheckListItem*>(child)->m_Index;
+			if (!ItN.startsWith("+"))
+			{
+			if  (!doc->DocItems.at(ItN.toUInt())->PicAvail) 
+			{
+                        if ((ItN!=currItN) && (!dir.entryInfoList(child->text(1), QDir::Files))) 
+				{
+					if (doc->masterPageMode) ScApp->ActWin->muster->close();
+					view->LoadPict(newpath+"/"+child->text(1),ItN.toUInt(),false,false);
+                                        i++;
+                                }
+                        }
+			}
+			else if (!doc->MasterItems.at(ItN.toUInt())->PicAvail)
+			{
+                        if ((ItN!=currItN) && (!dir.entryInfoList(child->text(1), QDir::Files))) 
+				{
+					if (!doc->masterPageMode) ScApp->manageMasterPages(child->text(3));
+					view->LoadPict(newpath+"/"+child->text(1),ItN.toUInt(),false,false);
+                                        i++;
+                                }
+			}
+			
+                        child = child->nextSibling();
+                }
+                if (i>0) {
+                if (currItN.startsWith("+"))
 		{
-			Q_ASSERT(!dia->Bild.isEmpty());
-			loadPictByRow(dia->Bild, row);
-			view->DrawNew();
+			if (!doc->masterPageMode) ScApp->manageMasterPages(pictureList->currentItem()->text(3));
 		}
-		delete dia;
-	}
+		else if (doc->masterPageMode) ScApp->ActWin->muster->close();
+		} 
+		else
+                        QMessageBox::warning(this, tr("Scribus - Image Search"),
+                                             tr("No other missing images found in:\n%1").arg(newpath),
+                                             QMessageBox::Ok|QMessageBox::Default|QMessageBox::Escape,
+                                             QMessageBox::NoButton);
+        }
+
 }
 
-bool PicStatus::loadPictByRow(const QString & newFilePath, unsigned int row)
+
+/*!
+ \fn void PicStatus::hasChanged()
+ \author Jean-Baptiste Mardelle
+ \date
+ \brief check if some image was inserted or removed
+ \param None
+ \retval None
+ */
+bool PicStatus::hasChanged()
 {
-	unsigned int itemNumber = ItemNrs[row];
-	// FIXME: error checking
-	view->LoadPict(newFilePath, itemNumber);
-	// WTF?
-	bool isMaster = PicTable->cellWidget(row, COL_GOTO)->isEnabled();
-	PageItem* item = isMaster ? doc->Items.at(itemNumber) : doc->MasterItems.at(itemNumber);
-	// Set missing flag again. Since we do no error checking of the load,
-	// missing will generally mean "failed to load".
-	PicTable->setText(row, COL_STATUS, item->PicAvail ? trOK : trMissing);
-	PicTable->setText(row, COL_PATH, QFileInfo(newFilePath).dirPath(true));
-	return item->PicAvail;
-}
-
-void PicStatus::setSearchButton(int row, bool toCancel, const FileSearch* searcher)
-{
-	QWidget* item = PicTable->cellWidget(row, COL_SEARCH);
-	Q_ASSERT(item);
-	QToolButton* tb = dynamic_cast<QToolButton*>(item);
-	Q_ASSERT(tb);
-	if (toCancel)
+uint m,i;
+m=0;
+for (i=0; i < doc->MasterItems.count(); ++i)
 	{
-		tb->setText( trCancelSearch );
-		disconnect(tb, SIGNAL(clicked()), this, SLOT(SearchPic()));
-		connect(tb, SIGNAL(clicked()), searcher, SLOT(cancel()));
+		if (doc->MasterItems.at(i)->itemType() == PageItem::ImageFrame && !doc->MasterItems.at(i)->Pfile.isEmpty())
+			m++;
 	}
-	else
+	if (m != masterItems) return false;
+	for (i=0; i<doc->DocItems.count(); ++i)
 	{
-		tb->setText(trSearch);
-		disconnect(tb, SIGNAL(clicked()), searcher, SLOT(cancel()));
-		connect(tb, SIGNAL(clicked()), SLOT(SearchPic()));
+		if (doc->DocItems.at(i)->itemType() == PageItem::ImageFrame && !doc->DocItems.at(i)->Pfile.isEmpty())
+			m++;
 	}
+	if (m != pageItems) return false;
+
+return true;
 }
 
-int PicStatus::getRowByFileName(const QString & fileName)
+
+/*!
+ \fn void PicStatus::reParseList()
+ \author Jean-Baptiste Mardelle
+ \date
+ \brief Reload each item in the list
+ \param None
+ \retval None
+ */
+void PicStatus::reParseList()
 {
-	bool found = false;
-	unsigned int row;
-	// This cast is OK since numRows must logically return >=0
-	for (row = 0; row < static_cast<unsigned int>(PicTable->numRows()); ++row)
-	{
-		if ( PicTable->text(row, 0) == fileName )
+QString tmp;
+QString id;
+QListViewItem *item = pictureList->firstChild();
+        while (item) {
+		id=static_cast<m_CheckListItem*>(item)->m_Index;
+		if (!id.startsWith("+"))
 		{
-			found = true;
-			break;
+			if (doc->DocItems.at(id.toUInt())->printable())
+                                static_cast<m_CheckListItem*>(item)->setState(QCheckListItem::On);
+                        else
+                                static_cast<m_CheckListItem*>(item)->setState(QCheckListItem::Off);
+	
+			QFileInfo fi = QFileInfo(doc->DocItems.at(id.toUInt())->Pfile);
+                        item->setText(1,fi.fileName());
+                        item->setText(2,fi.dirPath());
+                        item->setText(3,tmp.setNum(doc->DocItems.at(id.toUInt())->OwnPage+1));
+                        if (doc->DocItems.at(id.toUInt())->PicAvail)
+                                item->setPixmap(1,NULL);
+                        else
+                                item->setPixmap(1,loadIcon("pic_miss.png"));
 		}
+		else
+		{
+			if (doc->MasterItems.at(id.toUInt())->printable())
+                                static_cast<m_CheckListItem*>(item)->setState(QCheckListItem::On);
+                        else
+                                static_cast<m_CheckListItem*>(item)->setState(QCheckListItem::Off);
+	
+			QFileInfo fi = QFileInfo(doc->MasterItems.at(id.toUInt())->Pfile);
+                        item->setText(1,fi.fileName());
+                        item->setText(2,fi.dirPath());
+                        item->setText(3,doc->MasterItems.at(id.toUInt())->OnMasterPage);
+                        if (doc->MasterItems.at(id.toUInt())->PicAvail)
+                                item->setPixmap(1,NULL);
+                        else
+                                item->setPixmap(1,loadIcon("pic_miss.png"));
+		}
+                item = item->nextSibling();
+        }
+checkState();
+watchTimer->start(10000, true);
+}
+
+
+/*!
+ \fn void PicStatus::reloadList()
+ \author Jean-Baptiste Mardelle
+ \date
+ \brief Rebuild the entire list
+ \param None
+ \retval None
+ */
+void PicStatus::reloadList()
+{
+        watchTimer->stop();
+	if (hasChanged()) 
+	{
+		reParseList();
+		return;
+	}
+	
+        uint p, i;
+        QString tmp;
+        QString lastSelected=QString::null;
+
+        if (pictureList->currentItem()) 
+                lastSelected=static_cast<m_CheckListItem*>(pictureList->currentItem())->m_Index;
+
+        pictureList->clear();
+	pageItems=0;
+	masterItems=0;
+
+        for (i=0; i < doc->MasterItems.count(); ++i) {
+                if (doc->MasterItems.at(i)->itemType() == PageItem::ImageFrame && !doc->MasterItems.at(i)->Pfile.isEmpty()) {
+                        QFileInfo fi = QFileInfo(doc->MasterItems.at(i)->Pfile);
+                        m_CheckListItem *item = new m_CheckListItem( pictureList, QString::null);
+                        if (doc->MasterItems.at(i)->printable())
+                                item->setState(QCheckListItem::On);
+                        else
+                                item->setState(QCheckListItem::Off);
+
+                        item->setText(1,fi.fileName());
+                        item->setText(2,fi.dirPath());
+                        item->setText(3,doc->MasterItems.at(i)->OnMasterPage);
+                        if (doc->MasterItems.at(i)->PicAvail)
+                                item->setPixmap(1,NULL);
+                        else
+                                item->setPixmap(1,loadIcon("pic_miss.png"));
+                        item->m_Index=QString("+")+tmp.setNum(i);
+                        connect(item,SIGNAL(statusChange(m_CheckListItem*, bool )),this,SLOT(printPic(m_CheckListItem*, bool )));
+			masterItems++;
+
+                }
+        }
+
+        for (i=0; i< doc->DocItems.count(); ++i) {
+                if ((doc->DocItems.at(i)->itemType() == PageItem::ImageFrame) && !doc->DocItems.at(i)->Pfile.isEmpty()) {
+                        QFileInfo fi = QFileInfo(doc->DocItems.at(i)->Pfile);
+                        p = doc->DocItems.at(i)->OwnPage;
+                        m_CheckListItem *item = new m_CheckListItem (pictureList, QString::null);
+                        if (doc->DocItems.at(i)->printable())
+                                item->setState(QCheckListItem::On);
+                        else
+                                item->setState(QCheckListItem::Off);
+                        item->setText(1,fi.fileName());
+                        item->setText(2,fi.dirPath());
+                        item->setText(3,tmp.setNum(p+1));
+                        if (doc->DocItems.at(i)->PicAvail)
+                                item->setPixmap(1,NULL);
+                        else
+                                item->setPixmap(1,loadIcon("pic_miss.png"));
+                        item->m_Index=tmp.setNum(i);
+                        connect(item,SIGNAL(statusChange(m_CheckListItem*, bool )),this,SLOT(printPic(m_CheckListItem*, bool )));
+			pageItems++;
+                }
+        }
+
+        if (pictureList->firstChild()) {
+                if (!lastSelected.isEmpty())
+                        pictureList->setSelected(selectItem(lastSelected),true);
+                else
+                        pictureList->setSelected(pictureList->firstChild(),true);
+        pictureList->ensureItemVisible (pictureList->currentItem());
 	}
-	Q_ASSERT(found);
-	return row;
+        watchTimer->start(10000, true);
 }
 
+
 /*!
- \fn void PicStatus::PrintPic()
- \author Franz Schmid
+ \fn void PicStatus::reloadList()
+ \author Jean-Baptiste Mardelle
  \date
- \brief Enables or disables printing of the selected Image.
+ \brief Select an item in the list
  \param None
  \retval None
  */
-void PicStatus::PrintPic()
+QListViewItem* PicStatus::selectItem(QString mIndex)
 {
-	uint ZNr = QString(sender()->name()).toUInt();
-	uint ItNr = ItemNrs[ZNr];
-//	uint PgNr = PicTable->text(ZNr, 2).toInt()-1;
-	if (PicTable->cellWidget(ZNr, 3)->isEnabled())
-		doc->Items.at(ItNr)->setPrintable(FlagsPic.at(ZNr)->isChecked());
-	else
-		doc->MasterItems.at(ItNr)->setPrintable(FlagsPic.at(ZNr)->isChecked());
+        QListViewItem *item = pictureList->firstChild();
+        while (item) {
+                if ((static_cast<m_CheckListItem*>(item)->m_Index == mIndex))
+			return item;
+                item = item->nextSibling();
+        }
+	return pictureList->firstChild();
+}
+
+void PicStatus::stopSearch()
+{
+        if (search)
+                delete search;
 }
+
+void PicStatus::startSearch(QString url,bool recursive,bool replace)
+{
+        int rec;
+        if (recursive)
+                rec=-1;
+        else
+                rec=0;
+        search = new FileSearch(this, pictureList->currentItem()->text(1),url,rec);
+        Q_CHECK_PTR(search);
+        connect(search,
+                SIGNAL(searchComplete(const QStringList&, const QString&)),
+                SLOT(SearchPicFinished(const QStringList&, const QString&)));
+        connect(search, SIGNAL(searchAborted(bool)), SLOT(SearchPicAborted(bool)));
+        // Set up the UI to let the user cancel the search, then start it
+        //	setSearchButton(row, true, search);
+        search->start();
+}
+
+void PicStatus::SearchPicAborted(bool userCancelled)
+{
+        const FileSearch* search = dynamic_cast<const FileSearch*>(sender());
+        Q_ASSERT(search);
+        // Restore button to normal "search"
+        // and inform user if it it wasn't them who asked to stop it.
+        if (!userCancelled)
+                // A running search failed
+                QMessageBox::warning(this, tr("Scribus - Image Search"),
+                                     tr("The search failed: %1").arg(search->failReason()),
+                                     QMessageBox::Ok|QMessageBox::Default|QMessageBox::Escape,
+                                     QMessageBox::NoButton);
+        if (searchParams) {
+                searchParams->searchButton->setEnabled(true);
+                searchParams->stopButton->setEnabled(false);
+        }
+}
+
+void PicStatus::SearchPicFinished(const QStringList & matches, const QString & fileName)
+{
+        const FileSearch* search = dynamic_cast<const FileSearch*>(sender());
+        Q_ASSERT(search);
+
+        // Display a dialog for the user to select images from
+        // if one or more were found
+        if (matches.count() == 0) {
+                QMessageBox::information(this, tr("Scribus - Image Search"),
+                                         tr("No images named \"%1\" were found.").arg(fileName),
+                                         QMessageBox::Ok|QMessageBox::Default|QMessageBox::Escape,
+                                         QMessageBox::NoButton);
+                searchParams->searchButton->setEnabled(true);
+                searchParams->stopButton->setEnabled(false);
+        } else if (searchParams) {
+                searchParams->fileList->insertStringList(matches);
+                searchParams->fileList->setCurrentItem(0);
+                searchParams->searchButton->setEnabled(true);
+                searchParams->replaceButton->setEnabled(true);
+                searchParams->stopButton->setEnabled(false);
+        }
+}
+
Index: scribus/picstatus.h
===================================================================
RCS file: /cvs/Scribus/scribus/picstatus.h,v
retrieving revision 1.2.2.7
diff -u -3 -p -u -r1.2.2.7 picstatus.h
--- scribus/picstatus.h	13 Jul 2005 16:56:12 -0000	1.2.2.7
+++ scribus/picstatus.h	27 Jul 2005 22:40:23 -0000
@@ -1,5 +1,17 @@
-#ifndef PICSTATUS_H
-#define PICSTATUS_H
+//
+// C++ Interface: PicStatus
+//
+// Description: 
+//
+//
+// Author: Franz Schmid <Franz.Schmid@altmuehlnet.de>, (C) 2005
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+
+#ifndef PicStatus_H
+#define PicStatus_H
 
 #include <qdialog.h>
 #include <qpushbutton.h>
@@ -14,57 +26,60 @@ class ScribusDoc;
 class ScribusView;
 class FileSearch;
 
-class PicStatus : public QDialog
+#include "picturemanager.h"
+#include "picturesearch.h"
+
+class m_CheckListItem : public QObject,public QCheckListItem {
+  Q_OBJECT
+
+public:
+  m_CheckListItem( QListView *parent, const QString &text);
+  QString     m_Index;
+
+public slots:
+   void stateChange (bool);
+signals:
+   void statusChange (m_CheckListItem*, bool);
+};
+
+class PicStatus : public pictureManager
 { 
     Q_OBJECT
 
 public:
     PicStatus(QWidget* parent, ScribusDoc *docu, ScribusView *viewi);
-    ~PicStatus() {};
+    ~PicStatus();
 
-    QTable* PicTable;
-    QHeader *Header;
-    QPushButton* CancelB;
-    QPushButton* OkB;
     ScribusDoc *doc;
     ScribusView *view;
-    int Zeilen;
-    QPtrList<QCheckBox> FlagsPic;
-    QValueList<uint> ItemNrs;
+    FileSearch* search;
+    pictureSearch *searchParams;
+    QTimer *watchTimer;
+    int pageItems,masterItems;
+    QPopupMenu *ContextPopupMenu;
 
 private slots:
-    void GotoPic();
-    void SearchPic();
-    void SearchPicAborted(bool userCancelled);
+    void gotoPic();
+    void replacePic();
+    void searchPic();
     void SearchPicFinished(const QStringList & matches, const QString & fileName);
-    void PrintPic();
+    void SearchPicAborted(bool userCancelled);
+    void printPic(m_CheckListItem* item, bool isOn);
+    void startSearch(QString url,bool recursive,bool replace);
+    void stopSearch();
+    void replaceImage(QString newUrl,bool replaceAll);
+    void reloadList();
+    void reloadItem(QListViewItem *item);
+    QString slotFileOpen(QString path);
+    void checkState();
+    QListViewItem* selectItem(QString mIndex);
+    void reParseList();
+    bool hasChanged();
+    void showMenu(QListViewItem *it , const QPoint &, int);
+    bool checkAvail();
 
 protected:
-    QVBoxLayout* PicStatusLayout;
-    QHBoxLayout* Layout2;
 
-	// Return the row index for the row containing the specified
-	// filename. Behavour is undefined if the filename is not in the
-	// table.
-	int getRowByFileName(const QString& fileName);
-
-	// Toggle a searc button in the table between "Search" and "Cancel Search",
-	// fixing signal connections as well.
-	void PicStatus::setSearchButton(int row, bool toCancel, const FileSearch* searcher);
-
-	// Load the image specified into the PageItem shown on row `row'
-	bool PicStatus::loadPictByRow(const QString & newFilePath, unsigned int row);
-
-	// Column indexes
-	static const unsigned short COL_FILENAME;
-	static const unsigned short COL_PATH;
-	static const unsigned short COL_PAGE;
-	static const unsigned short COL_GOTO;
-	static const unsigned short COL_PRINT;
-	static const unsigned short COL_STATUS;
-	static const unsigned short COL_SEARCH;
-
-	// Common translated strings
 	static const QString trOK;
 	static const QString trMissing;
 	static const QString trSearch;
@@ -72,8 +87,10 @@ protected:
 	static const QString trGoto;
 
 signals:
-	void selectPage(int);
+	void selectPage(int,int);
 	void selectMasterPage(QString);
 };
 
-#endif // PICSTATUS_H
+
+
+#endif // PicStatus_H
Index: scribus/Makefile.am
===================================================================
RCS file: /cvs/Scribus/scribus/Makefile.am,v
retrieving revision 1.37.2.75
diff -u -3 -p -u -r1.37.2.75 Makefile.am
--- scribus/Makefile.am	24 Jul 2005 11:36:57 -0000	1.37.2.75
+++ scribus/Makefile.am	27 Jul 2005 22:40:24 -0000
@@ -179,7 +179,9 @@ scribus_SOURCES = \
 	werktoolb.cpp	\
 	scribus.cpp	\
 	scribusapp.cpp	\
-	main.cpp
+	main.cpp	\
+	picturemanager.ui	\
+	picturesearch.ui
 
 INTERFACES =
 TRANSLATIONS =
Index: scribus/icons/Makefile.am
===================================================================
RCS file: /cvs/Scribus/scribus/icons/Makefile.am,v
retrieving revision 1.28.2.55
diff -u -3 -p -u -r1.28.2.55 Makefile.am
--- scribus/icons/Makefile.am	24 Jul 2005 11:36:58 -0000	1.28.2.55
+++ scribus/icons/Makefile.am	27 Jul 2005 22:40:24 -0000
@@ -1,4 +1,4 @@
-EXTRA_DIST = mover.png above.png below.png firstline.png leftindent.png shade.png linespacing.png textbase.png textscaleh.png textkern.png textscalev.png wordsOnly.png shadow.png AllCaps.png DrawFrame.xpm DrawImageFrame.xpm DrawPolylineFrame.xpm DrawTable.xpm DrawTextFrame.xpm plugins.png filenew.png fileopen.png editcopy22.png edittrash.png font_otf16.png font_truetype16.png font_type1_16.png font_otf.png font_truetype.png font_type1.png acroread.png checkdoc.png vectorgfx.png ooo_draw.png ooo_writer.png key_bindings.png blend.png hyphenate.png scrap.png misc.png tools.png page.png guides.png font.png screen.png nftabout.xpm nftinfo.xpm dist.png tab.png view.png Kreuz.xpm Bild.xpm Bild16.xpm Editm.xpm Kreise.xpm Lock.xpm Lupe.xpm Rechtecke.xpm Rotieren.xpm Stift16.xpm Stift.xpm Text.xpm Text16.xpm Unlock.xpm DateiClose.png DateiNeu.xpm DateiOpen.xpm DateiPrint.xpm DateiSave2.png AppIcon2.png AppIcon.png LupeZ.xpm Gross.xpm Klein.xpm DragPix.xpm Rotieren2.xpm HandC.xpm scribus_logo.jpg DateiClos16.png DateiNeu16.png DateiOpen16.png DateiPrint16.png DateiSave16.png editcopy.png editcut.png editdelete.png editpaste.png exit.png doc.png image.png pdf.png postscript.png txt.png Zeichen.xpm Hoch.xpm Kapital.xpm Strike.xpm Tief.xpm Unter.xpm Kern.xpm Spacing.xpm Corner.xpm FlipH.xpm FlipV.xpm Winkel.xpm acrobat.png scribusicon.png text_block.png text_center.png text_left.png text_right.png Text2.xpm spline16.png spline.png triangle.png Stiftalt.xpm Stiftalt16.xpm beziertool.png beziertool16.png AddNode.png DeleteNode.png MoveAsym.png MoveKontrol.png MoveNode.png MoveSym.png BevelJoin.png ButtCap.png MiterJoin.png RoundJoin.png SquareCap.png ResetNode.png RoundCap.png Reset1Node.png BezierClose.png PolyCut.png AddPoint.png DelPoint.png Split.png Deletelayer.png Layervisible.xpm Lowerlayer.png Newlayer.png Raiselayer.png checkbox.png combobox.png listbox.png pushbutton.png textview.png charset.png goto.png document2.png trashcan.png trashcan2.png gohome.png bottom.png down.png top.png up.png irreg.png text_force.png ok.png ok22.png Revers.png hmirror.png vmirror.png shear_right.png shear_left.png shear_up.png shear_down.png Splash.png back.png start.png forward.png finish.png penciladd.png pencilsub.png outlined.png fill.png NoPrint.png unlock.png locked.png signature.png rotate_cw.png rotate_ccw.png crop.png expand.png frameresize.png framenoresize.png testfill.png frame_table16.png frame_table.png scribusdoc.png documentinfo.png documentinfo32.png filesaveas.png revert.png reload.png compfile.png reload16.png compfile16.png find.png find16.png addf.png removef.png launch.png launch16.png u_undo.png u_redo.png u_undo16.png u_redo16.png u_margins.png u_margins_locked.png u_align.png u_move.png u_resize.png u_rotate.png u_group.png u_fill.png u_shade.png u_lock.png u_unlock.png u_create.png u_delete.png u_fliph.png u_flipv.png u_cut.png u_transp.png u_line.png u_arrow.png u_font.png u_svg.png u_eps.png u_scale_image.png u_shape.png docattributes.png tabtocindex.png colorpicker.png wizard.png al_bottom_in.png al_bottom_out.png al_center_hor.png al_center_ver.png al_left_in.png al_left_out.png al_right_in.png al_right_out.png al_top_in.png al_top_out.png distribute_bottom.png distribute_hcentre.png distribute_hdist.png distribute_hdist_val.png distribute_left.png distribute_right.png distribute_top.png distribute_vcentre.png distribute_vdist.png distribute_vdist_val.png
+EXTRA_DIST = mover.png above.png below.png firstline.png leftindent.png shade.png linespacing.png textbase.png textscaleh.png textkern.png textscalev.png wordsOnly.png shadow.png AllCaps.png DrawFrame.xpm DrawImageFrame.xpm DrawPolylineFrame.xpm DrawTable.xpm DrawTextFrame.xpm plugins.png filenew.png fileopen.png editcopy22.png edittrash.png font_otf16.png font_truetype16.png font_type1_16.png font_otf.png font_truetype.png font_type1.png acroread.png checkdoc.png vectorgfx.png ooo_draw.png ooo_writer.png key_bindings.png blend.png hyphenate.png scrap.png misc.png tools.png page.png guides.png font.png screen.png nftabout.xpm nftinfo.xpm dist.png tab.png view.png Kreuz.xpm Bild.xpm Bild16.xpm Editm.xpm Kreise.xpm Lock.xpm Lupe.xpm Rechtecke.xpm Rotieren.xpm Stift16.xpm Stift.xpm Text.xpm Text16.xpm Unlock.xpm DateiClose.png DateiNeu.xpm DateiOpen.xpm DateiPrint.xpm DateiSave2.png AppIcon2.png AppIcon.png LupeZ.xpm Gross.xpm Klein.xpm DragPix.xpm Rotieren2.xpm HandC.xpm scribus_logo.jpg DateiClos16.png DateiNeu16.png DateiOpen16.png DateiPrint16.png DateiSave16.png editcopy.png editcut.png editdelete.png editpaste.png exit.png doc.png image.png pdf.png postscript.png txt.png Zeichen.xpm Hoch.xpm Kapital.xpm Strike.xpm Tief.xpm Unter.xpm Kern.xpm Spacing.xpm Corner.xpm FlipH.xpm FlipV.xpm Winkel.xpm acrobat.png scribusicon.png text_block.png text_center.png text_left.png text_right.png Text2.xpm spline16.png spline.png triangle.png Stiftalt.xpm Stiftalt16.xpm beziertool.png beziertool16.png AddNode.png DeleteNode.png MoveAsym.png MoveKontrol.png MoveNode.png MoveSym.png BevelJoin.png ButtCap.png MiterJoin.png RoundJoin.png SquareCap.png ResetNode.png RoundCap.png Reset1Node.png BezierClose.png PolyCut.png AddPoint.png DelPoint.png Split.png Deletelayer.png Layervisible.xpm Lowerlayer.png Newlayer.png Raiselayer.png checkbox.png combobox.png listbox.png pushbutton.png textview.png charset.png goto.png document2.png trashcan.png trashcan2.png gohome.png bottom.png down.png top.png up.png irreg.png text_force.png ok.png ok22.png Revers.png hmirror.png vmirror.png shear_right.png shear_left.png shear_up.png shear_down.png Splash.png back.png start.png forward.png finish.png penciladd.png pencilsub.png outlined.png fill.png NoPrint.png unlock.png locked.png signature.png rotate_cw.png rotate_ccw.png crop.png expand.png frameresize.png framenoresize.png testfill.png frame_table16.png frame_table.png scribusdoc.png documentinfo.png documentinfo32.png filesaveas.png revert.png reload.png compfile.png reload16.png compfile16.png find.png find16.png addf.png removef.png launch.png launch16.png u_undo.png u_redo.png u_undo16.png u_redo16.png u_margins.png u_margins_locked.png u_align.png u_move.png u_resize.png u_rotate.png u_group.png u_fill.png u_shade.png u_lock.png u_unlock.png u_create.png u_delete.png u_fliph.png u_flipv.png u_cut.png u_transp.png u_line.png u_arrow.png u_font.png u_svg.png u_eps.png u_scale_image.png u_shape.png docattributes.png tabtocindex.png colorpicker.png wizard.png al_bottom_in.png al_bottom_out.png al_center_hor.png al_center_ver.png al_left_in.png al_left_out.png al_right_in.png al_right_out.png al_top_in.png al_top_out.png distribute_bottom.png distribute_hcentre.png distribute_hdist.png distribute_hdist_val.png distribute_left.png distribute_right.png distribute_top.png distribute_vcentre.png distribute_vdist.png distribute_vdist_val.png pic_miss.png
 
 install-data-local:
 	$(mkinstalldirs) $(prefix)/share/scribus/icons/
patch2.diff (50,248 bytes)

2005-07-27 22:46

 

patch2_uifiles.tar.gz (2,966 bytes)

jean-baptiste

2005-07-27 22:51

reporter   ~0005748

Ok, here is my patch against current 1.3.x cvs

It is a rewrite of picture managment. Changes/improvements:
The image management window now works like a palette, you can work on
your document with image management opened, it will update itself every
10 seconds to reflect changes to the document.

You can now sort the image list by name, path or page

"Show" button (or double click on an entry) now moves to the relevant
page and selects the image.
"Browse" button allows you to replace selected image with another one
without losing image settings (size, ...)
"Search" button allows you to find missing images. You can tell Scribus
where to start looking & if you want to search subfolders. It can also
replace other missing images automatically.


Instructions: download patch2.diff and patch2_uifiles.tar.gz
put patch2.diff in Scribus root, then: patch -p0 < patch2.diff
uncompress patch2_uifiles.tar.gz in Scribus/scribus and move pic_miss.png in Scribus/scribus/icons.

comments/questions welcome.

ringerc

2005-07-28 03:22

reporter   ~0005753

That's great Jean.

I'll try to have a look over this in a little while... things are pretty busy at work.

A quick glance makes me wonder what picManageOpened is for. It seems to be used to test whether to create the UI for the pic manager. If so, perhaps it's better to just test:

if (!picManager)
   ... create the picmanager

Picmanager should preferably also sanely handle being launched, and being open, when there are no documents open.

I'll have a proper look over your patch when I get a chance. Thanks again.

ringerc

2005-07-28 13:50

reporter   ~0005764

OK... I've had a bit of a better read. I haven't yet tried the patch and there are still a few bits I'm unclear on. Anyway, your comments on the below would be much appreciated - and rememember, I'm no expert so if you think I'm wrong please tell me so.

- Comments, please. The current Scribus code is severely lacking, but we're trying to fix that as we go.

- I'm not too fond of using a timer to force-rescan all the images. I imagine it might be the only way with the way Scribus's innards severely neglect the Qt event driven stuff, though. I'm still not big on the idea. What we *should* be doing is listening on a signal, either from each image PageItem or possibly from the ScribusDoc or ScribusView, to notify us when something changes. The chances of any of the mentioned classes being able to provide us this service reliably right now are unfortunately minimal.

- I'd prefer to avoid fixed column widths, and I'm not sure we should be changing the user's font size. If we do tweak the font size, it needs to be done in a globally configurable way.

- Under what circumstances might PicStatus::showMenu(...) get called with a null QListViewItem* ? There is nothing in the code to tell the reader that, or explain why returning silently is correct. If you meant "must not be null" you should use a Q_ASSERT, or just comment that your code assumes this. A couple of other places have similar issues.

- Rather than copying code from ScribusApp::slotFileOpen, it's probably better to tidy that up so that the bit that displays the image file dialog is separate. You can then just call it from your code.

- I'm not especially sure I like the way all the mapping of table entries to page items is tied up in the checkbox item class. On the other side, I'm not sure I have any useful suggestions on a better way right now. The more removed that logic is from the GUI code in the table, the happier I'll be ... and this is at least a bunch better than what used to be there (*shudder*).

- PicStatus has a lot of public members that don't look like they should be public.

- (trivial) If the trOK etc statics are going to be removed, then their declaration in the header should be too.

- (trivial) There are a few coding style issues I can fix up - indenting, naming methods LikeThis not likeThis, etc.

2005-08-01 14:24

 

patch3.diff (50,664 bytes)
Index: scribus/Makefile.am
===================================================================
RCS file: /cvs/Scribus/scribus/Makefile.am,v
retrieving revision 1.37.2.77
diff -u -3 -p -u -r1.37.2.77 Makefile.am
--- scribus/Makefile.am	31 Jul 2005 13:12:50 -0000	1.37.2.77
+++ scribus/Makefile.am	1 Aug 2005 14:19:28 -0000
@@ -180,7 +180,9 @@ scribus_SOURCES = \
 	werktoolb.cpp	\
 	scribus.cpp	\
 	scribusapp.cpp	\
-	main.cpp
+	main.cpp	\
+	picturemanager.ui	\
+	picturesearch.ui
 
 INTERFACES =
 TRANSLATIONS =
Index: scribus/picstatus.cpp
===================================================================
RCS file: /cvs/Scribus/scribus/picstatus.cpp,v
retrieving revision 1.12.2.12
diff -u -3 -p -u -r1.12.2.12 picstatus.cpp
--- scribus/picstatus.cpp	13 Jul 2005 16:56:12 -0000	1.12.2.12
+++ scribus/picstatus.cpp	1 Aug 2005 14:19:29 -0000
@@ -15,14 +15,17 @@
  *                                                                         *
  ***************************************************************************/
 
-#include "picstatus.h"
-#include "picstatus.moc"
 #include <qfileinfo.h>
 #include <qfiledialog.h>
 #include <qtoolbutton.h>
+#include <qpixmap.h>
 #include <qstringlist.h>
 #include <qtextstream.h>
+#include <qlistview.h>
 #include <qcursor.h>
+#include <qbutton.h>
+#include <qfont.h>
+
 #include <cstdio>
 #include "picsearch.h"
 #include "scribusdoc.h"
@@ -30,341 +33,600 @@
 #include "pageitem.h"
 #include "filesearch.h"
 #include "scribus.h"
+
 extern QPixmap loadIcon(QString nam);
 extern ScribusApp* ScApp;
 
-const unsigned short PicStatus::COL_FILENAME = 0;
-const unsigned short PicStatus::COL_PATH = 1;
-const unsigned short PicStatus::COL_PAGE = 2;
-const unsigned short PicStatus::COL_GOTO = 3;
-const unsigned short PicStatus::COL_PRINT = 4;
-const unsigned short PicStatus::COL_STATUS = 5;
-const unsigned short PicStatus::COL_SEARCH = 6;
-
-const QString PicStatus::trOK = PicStatus::tr("OK");
-const QString PicStatus::trMissing = PicStatus::tr("Missing");
-const QString PicStatus::trSearch = PicStatus::tr("Search");
-const QString PicStatus::trCancelSearch = PicStatus::tr("Cancel Search");
-const QString PicStatus::trGoto = PicStatus::tr("Goto");
+#include "picstatus.h"
+#include "picstatus.moc"
+
+// reimplement QCheckListItem, adding an internal QString value (m_Index) to each QListViewItem, 
+// which will be used to store the document or master index of the Picture Frame. Master items 
+// will have a "+" prepended to their m_Index string. That way, we can always know if a picture is on 
+// a master page or in the document.
+
+m_CheckListItem::m_CheckListItem (QListView *parent, const QString &text):
+                QCheckListItem(parent,text,QCheckListItem::CheckBox)
+{}
+
+void m_CheckListItem::stateChange (bool value)
+{
+        emit statusChange ( this, value);
+}
+
+
+
+PicStatus::PicStatus(QWidget* parent, ScribusDoc *docu, ScribusView *viewi)
+                : pictureManager( parent, "pic", false,Qt::WDestructiveClose )
+{
+	// The commented lines below reduce the font size by 2 points, making the dialog smaller, 
+	// maybe we could implement this for all palettes... commented in the meantime.
+
+	//QFont font(font());
+	//font.setPointSize(font.pointSize()-2);
+	//setFont(font);
+
+        doc = docu;
+        view = viewi;
+	pageItems=0;
+	masterItems=0;
+
+	// Some basic layout stuff for the image list...
+        pictureList->setSorting(1);
+
+	pictureList->setColumnAlignment (3,Qt::AlignHCenter);
+        pictureList->setColumnWidthMode (0,QListView::Manual);
+	pictureList->setColumnWidthMode (1,QListView::Manual);
+	pictureList->setColumnWidthMode (2,QListView::Manual);
+	pictureList->setColumnWidthMode (3,QListView::Manual);
+
+	pictureList->setColumnWidth (0,40);
+	pictureList->setColumnWidth (1,120);
+	pictureList->setColumnWidth (2,100);
+	pictureList->setColumnWidth (3,40);
+
+	pictureList->setResizeMode(QListView::LastColumn);
+
+	// Hack to move the print checkbox to the last column. QT currently doesn't allow an easy way to handle this for QCheckListItem
+
+	QHeader * h = pictureList->header(); 
+	h->moveSection(0,4);
+	pictureList->repaint();
+
+        // Initialize the timer. The image list is checked every 10 seconds for a change.
+	// There might be a better way to keep the list up to date (using signals emited by Image Frames, but 
+	// it currently would need much changes in scribus code)
+
+	watchTimer = new QTimer(this);
+        connect(watchTimer, SIGNAL(timeout()), this, SLOT(reloadList()));
+
+	// Create context popup menu for image items
+
+        ContextPopupMenu=new QPopupMenu(pictureList);
+ 	ContextPopupMenu->insertItem( tr("Show"),  this, SLOT(gotoPic()), CTRL+Key_H ,0);
+ 	ContextPopupMenu->insertItem( tr("Browse"),  this, SLOT(replacePic()), CTRL+Key_B ,1);
+        ContextPopupMenu->insertItem( tr("Search"), this, SLOT(searchPic()),    CTRL+Key_S ,2);
+ 	connect(pictureList,SIGNAL(contextMenuRequested( QListViewItem * , const QPoint &, int)),this,SLOT(showMenu(QListViewItem * , const QPoint &, int)));
+        
+	// Fill the list
+
+	reloadList();
+
+
+        connect(pictureList, SIGNAL(doubleClicked ( QListViewItem *, const QPoint &, int )), this, SLOT(gotoPic()));
+        connect(pictureList, SIGNAL(selectionChanged ()), this, SLOT(checkState()));
+        connect(showButton, SIGNAL(clicked()), this, SLOT(gotoPic()));
+        connect(searchButton, SIGNAL(clicked()), this, SLOT(searchPic()));
+        connect(browseButton, SIGNAL(clicked()), this, SLOT(replacePic()));
+}
+
 
 /*!
- \fn void PicStatus::PicStatus(QWidget* parent, ScribusDoc *docu, ScribusView *viewi)
- \author Franz Schmid
+ \fn void PicStatus::showMenu()
+ \author Jean-Baptiste Mardelle
  \date
- \brief Constructs a Dialog, which list all Images in the current Document. In this Dialog it is possible
-to search for missing Images.
- \param parent Pointer to parent window
- \param docu Pointer to the current Document
- \param viewi Pointer to the current View
- \retval None
+ \brief displays context menu on image item
+ \param None
+ \retval none
  */
+void PicStatus::showMenu(QListViewItem *it , const QPoint &, int)
+{
+// if user clicks in a blank area, don't display menu.
+if (!it) return;
+ContextPopupMenu->exec(QCursor::pos());
+}
 
-PicStatus::PicStatus(QWidget* parent, ScribusDoc *docu, ScribusView *viewi) :
-	QDialog( parent, "pic", true, 0 )
-{
-	uint p, i;
-	QString tmp;
-	setCaption( tr( "Manage Pictures" ) );
-	setIcon(loadIcon("AppIcon.png"));
-	doc = docu;
-	view = viewi;
-	ItemNrs.clear();
-	FlagsPic.clear();
-	PicStatusLayout = new QVBoxLayout( this );
-	PicStatusLayout->setSpacing( 6 );
-	PicStatusLayout->setMargin( 11 );
-
-	PicTable = new QTable( this, "PicTable" );
-	PicTable->setLeftMargin(0);
-	PicTable->verticalHeader()->hide();
-	PicTable->setNumCols( 7 );
-	Header = PicTable->horizontalHeader();
-	QString tmpc[] = { tr("Name"),  tr("Path"),  tr("Page"), " ",  tr("Print"),  tr("Status"), " "};
-	size_t ar = sizeof(tmpc) / sizeof(*tmpc);
-	for (uint a = 0; a < ar; ++a)
-		Header->setLabel(a, tmpc[a]);
-	Zeilen = 0;
-	for (i=0; i < doc->MasterItems.count(); ++i)
-	{
-		if (doc->MasterItems.at(i)->itemType() == PageItem::ImageFrame)
-		{
-			Zeilen++;
-			ItemNrs.append(i);
-		}
-	}
-	for (i=0; i<doc->Items.count(); ++i)
-	{
-		if (doc->Items.at(i)->itemType() == PageItem::ImageFrame)
-		{
-			Zeilen++;
-			ItemNrs.append(i);
-		}
-	}
-	PicTable->setNumRows(Zeilen);
-	int Zeilen2 = 0;
-	for (i=0; i < doc->MasterItems.count(); ++i)
-	{
-		if (doc->MasterItems.at(i)->itemType() == PageItem::ImageFrame)
-		{
-			QFileInfo fi = QFileInfo(doc->MasterItems.at(i)->Pfile);
-			PicTable->setText(Zeilen2, COL_FILENAME, fi.fileName());
-			PicTable->setText(Zeilen2, COL_PATH, fi.dirPath());
-			PicTable->setText(Zeilen2, COL_PAGE, doc->MasterItems.at(i)->OnMasterPage);
-			QToolButton *tb2 = new QToolButton(this, tmp.setNum(Zeilen2));
-			tb2->setText( trGoto);
-			tb2->setEraseColor(white);
-			PicTable->setColumnWidth(COL_GOTO, tb2->fontMetrics().width( trGoto)+10);
-			PicTable->setCellWidget(Zeilen2, COL_GOTO, tb2);
-			connect(tb2, SIGNAL(clicked()), this, SLOT(GotoPic()));
-			QCheckBox *cp2 = new QCheckBox(this, tmp.setNum(Zeilen2));
-			cp2->setText( tr("Yes"));
-			cp2->setChecked(doc->MasterItems.at(i)->printable());
-			cp2->setEraseColor(white);
-			FlagsPic.append(cp2);
-			PicTable->setCellWidget(Zeilen2, COL_PRINT, cp2);
-			connect(cp2, SIGNAL(clicked()), this, SLOT(PrintPic()));
-			if (doc->MasterItems.at(i)->PicAvail)
-				PicTable->setText(Zeilen2, COL_STATUS, trOK);
-			else
-				PicTable->setText(Zeilen2, COL_STATUS, trMissing);
-			QToolButton *tb = new QToolButton(this, tmp.setNum(Zeilen2));
-			tb->setText( trSearch);
-			PicTable->setColumnWidth(COL_SEARCH, tb->fontMetrics().width( trCancelSearch)+10);
-			tb->setEraseColor(white);
-			PicTable->setCellWidget(Zeilen2, COL_SEARCH, tb);
-			connect(tb, SIGNAL(clicked()), this, SLOT(SearchPic()));
-			Zeilen2++;
-		}
-	}
-	for (i=0; i< doc->Items.count(); ++i)
-	{
-		if (doc->Items.at(i)->itemType() == PageItem::ImageFrame)
-		{
-			QFileInfo fi = QFileInfo(doc->Items.at(i)->Pfile);
-			PicTable->setText(Zeilen2, COL_FILENAME, fi.fileName());
-			PicTable->setText(Zeilen2, COL_PATH, fi.dirPath());
-			p = doc->Items.at(i)->OwnPage;
-			PicTable->setText(Zeilen2, COL_PAGE, tmp.setNum(p+1));
-			QToolButton *tb2 = new QToolButton(this, tmp.setNum(Zeilen2));
-			tb2->setText( trGoto);
-			tb2->setEraseColor(white);
-			PicTable->setColumnWidth(COL_GOTO, tb2->fontMetrics().width( trGoto)+10);
-			PicTable->setCellWidget(Zeilen2, COL_GOTO, tb2);
-			connect(tb2, SIGNAL(clicked()), this, SLOT(GotoPic()));
-			QCheckBox *cp2 = new QCheckBox(this, tmp.setNum(Zeilen2));
-			cp2->setText( tr("Yes"));
-			cp2->setChecked(doc->Items.at(i)->printable());
-			cp2->setEraseColor(white);
-			FlagsPic.append(cp2);
-			PicTable->setCellWidget(Zeilen2, COL_PRINT, cp2);
-			connect(cp2, SIGNAL(clicked()), this, SLOT(PrintPic()));
-			if (doc->Items.at(i)->PicAvail)
-				PicTable->setText(Zeilen2, COL_STATUS, trOK);
-			else
-				PicTable->setText(Zeilen2, COL_STATUS, trMissing);
-			QToolButton *tb = new QToolButton(this, tmp.setNum(Zeilen2));
-			tb->setText( trSearch);
-			PicTable->setColumnWidth(COL_SEARCH, tb->fontMetrics().width( trCancelSearch)+10);
-			tb->setEraseColor(white);
-			PicTable->setCellWidget(Zeilen2, COL_SEARCH, tb);
-			connect(tb, SIGNAL(clicked()), this, SLOT(SearchPic()));
-			Zeilen2++;
-		}
-	}
 
-	PicTable->adjustColumn(COL_FILENAME);
-	PicTable->adjustColumn(COL_PATH);
-	PicTable->adjustColumn(COL_PAGE);
-	PicTable->adjustColumn(COL_PRINT);
-	PicTable->adjustColumn(COL_STATUS);
-	PicTable->setSorting(false);
-	PicTable->setSelectionMode(QTable::NoSelection);
-	PicTable->setColumnMovingEnabled(false);
-	PicTable->setRowMovingEnabled(false);
-	Header->setMovingEnabled(false);
-	PicTable->setColumnReadOnly(COL_FILENAME, true);
-	PicTable->setColumnReadOnly(COL_PATH, true);
-	PicTable->setColumnReadOnly(COL_PAGE, true);
-	PicTable->setColumnReadOnly(COL_STATUS, true);
-	PicStatusLayout->addWidget( PicTable );
-
-	Layout2 = new QHBoxLayout;
-	Layout2->setSpacing( 3 );
-	Layout2->setMargin( 0 );
-	QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
-	Layout2->addItem( spacer );
-
-	OkB = new QPushButton( tr( "OK" ), this, "OkB" );
-	Layout2->addWidget( OkB );
-	PicStatusLayout->addLayout( Layout2 );
+/*!
+ \fn void PicStatus::checkAvail()
+ \author Jean-Baptiste Mardelle
+ \date
+ \brief checks if the picture is currently available
+ \param None
+ \retval bool
+ */
+bool PicStatus::checkAvail()
+{
+QString m=static_cast<m_CheckListItem*>(pictureList->currentItem())->m_Index;
+        if (m.startsWith("+")) {  // check if it is a master item
+                if (doc->MasterItems.at(m.toUInt())->PicAvail)
+                        return true;
+        } else if (doc->DocItems.at(m.toUInt())->PicAvail)
+                return true;
+return false;
+}
+
 
-	// signals and slots connections
-	connect( OkB, SIGNAL( clicked() ), this, SLOT( accept() ) );
+/*!
+ \fn void PicStatus::checkState()
+ \author Jean-Baptiste Mardelle
+ \date
+ \brief Enable / disable menu entries depending on selected image
+ \param None
+ \retval None
+ */
+void PicStatus::checkState()
+{
+if (!pictureList->currentItem()) return;
+bool isAvail=checkAvail();
+searchButton->setEnabled(!isAvail);
+ContextPopupMenu->setItemEnabled(2,!isAvail);
 }
 
+
+
 /*!
- \fn void PicStatus::GotoPic()
+ \fn void PicStatus::gotoPic()
  \author Franz Schmid
  \date
  \brief Moves to the Page containing the selected Image.
  \param None
  \retval None
  */
-void PicStatus::GotoPic()
+void PicStatus::gotoPic()
 {
-	QString pageText = PicTable->text(QString(sender()->name()).toInt(), 2);
-	bool ok = false;
-	int pageNum = pageText.toInt(&ok);
-	if (doc->masterPageMode)
-		ScApp->ActWin->muster->close();
-	if (!ok)
-		emit selectMasterPage(pageText);
-	else
-		emit selectPage(pageNum-1);
+        if (!pictureList->currentItem())
+                return;
+
+        QString pageText = pictureList->currentItem()->text(3);
+        QString ItNr = static_cast<m_CheckListItem*>(pictureList->currentItem())->m_Index;
+
+	// If it is a master item, start master mode then select item. If the item doesn't exist anymore 
+	// (was deleted in the meantime), reload the picture list.
+
+        if (ItNr.startsWith("+")) {
+                ScApp->manageMasterPages(pageText);
+		if (!doc->MasterItems.at(ItNr.toUInt())) reloadList();
+		else view->SelectItem(doc->MasterItems.at(ItNr.toUInt()), true, true);
+        } 
+	// if it is a document item, go to appropriate page then select item.
+	else {
+		if (doc->masterPageMode) ScApp->ActWin->muster->close();
+                view->Deselect(true);
+                view->GotoPage(pageText.toInt()-1);
+		if (!doc->DocItems.at(ItNr.toUInt())) reloadList();
+                else view->SelectItem(doc->DocItems.at(ItNr.toUInt()), true, true);
+        }
 }
 
+
 /*!
- \fn void PicStatus::SearchPic()
+ \fn void PicStatus::PrintPic()
  \author Franz Schmid
  \date
- \brief Searches for the given Picture. Displays a Dialog when more than one Picture is found.
+ \brief Enables or disables printing of the selected Image.
  \param None
  \retval None
  */
-void PicStatus::SearchPic()
+void PicStatus::printPic(m_CheckListItem* item, bool isOn)
 {
-	// FIXME: This is a pretty ugly hack IMO - carried over from the old
-	// SearchPic. Table handling needs work.
-	unsigned int row = QString(sender()->name()).toUInt();
-	QString fileName = PicTable->text(row, 0);
-	// Set up the search, then return to the event loop until it notifies us
-	// that it's done.
-	// Note: search will be deleted when this PicStatus is, so there's no
-	// need to worry about cleanup.
-	FileSearch* search = new FileSearch(this, fileName);
-	Q_CHECK_PTR(search);
-	connect(search,
-			SIGNAL(searchComplete(const QStringList&, const QString&)),
-			SLOT(SearchPicFinished(const QStringList&, const QString&)));
-	connect(search, SIGNAL(searchAborted(bool)), SLOT(SearchPicAborted(bool)));
-	// Set up the UI to let the user cancel the search, then start it
-	setSearchButton(row, true, search);
-	search->start();
+        QString ItNr = item->m_Index;
+	if (ItNr.startsWith("+"))
+                doc->MasterItems.at(ItNr.toUInt())->setPrintable(isOn);
+        else
+                doc->DocItems.at(ItNr.toUInt())->setPrintable(isOn);
 }
 
-void PicStatus::SearchPicAborted(bool userCancelled)
+
+/*!
+ \fn void PicStatus::replacePic()
+ \author Jean-Baptiste Mardelle
+ \date
+ \brief replace a current image with another file
+ \param None
+ \retval None
+ */
+void PicStatus::replacePic()
 {
-	const FileSearch* search = dynamic_cast<const FileSearch*>(sender());
-	Q_ASSERT(search);
-	// Restore button to normal "search"
-	unsigned int row = getRowByFileName(search->fileName());
-	setSearchButton(row, false, search);
-	// and inform user if it it wasn't them who asked to stop it.
-	if (!userCancelled)
-		// A running search failed
-		QMessageBox::warning(this, tr("Scribus - Image Search"),
-				tr("The search failed: %1").arg(search->failReason()),
-				QMessageBox::Ok|QMessageBox::Default|QMessageBox::Escape,
-				QMessageBox::NoButton);
+        if (!pictureList->currentItem())
+                return;
+        watchTimer->stop();
+
+	// Select the image in the view
+        gotoPic();
+
+	// Open file dialog
+        QString fn=ScApp->slotImageOpen(pictureList->currentItem()->text(2));
+        if (!fn.isEmpty()) {
+		// Load image without reinit, so that we keep the picture properties (position, zoom,...)
+                view->LoadPict(fn,static_cast<m_CheckListItem*>(pictureList->currentItem())->m_Index.toUInt(),false,false);
+                view->DrawNew();
+                reloadItem(pictureList->currentItem());
+        }
+        watchTimer->start(10000, true);
 }
 
-void PicStatus::SearchPicFinished(const QStringList & matches, const QString & fileName)
+
+/*!
+ \fn void PicStatus::reloadItem()
+ \author Jean-Baptiste Mardelle
+ \date
+ \brief reload only current item in the list of images
+ \param None
+ \retval None
+ */
+void PicStatus::reloadItem(QListViewItem *item)
 {
-	const FileSearch* search = dynamic_cast<const FileSearch*>(sender());
-	Q_ASSERT(search);
-	// First, find out what row the search result is about
-	unsigned int row = getRowByFileName(fileName);
-	// Restore the gui to "search"
-	setSearchButton(row, false, search);
-	// Then display a dialog for the user to select images from
-	// if one or more were found
-	if (matches.count() == 0)
+        uint p;
+        QString tmp;
+        QString ItNr = static_cast<m_CheckListItem*>(item)->m_Index;
+	if (ItNr.startsWith("+"))
 	{
-		QMessageBox::information(this, tr("Scribus - Image Search"),
-				tr("No images named \"%1\" were found.").arg(fileName),
-				QMessageBox::Ok|QMessageBox::Default|QMessageBox::Escape,
-				QMessageBox::NoButton);
+	QFileInfo fi = QFileInfo(doc->MasterItems.at(ItNr.toUInt())->Pfile);
+        if (doc->MasterItems.at(ItNr.toUInt())->printable())
+                static_cast<QCheckListItem*>(item)->setState(QCheckListItem::On);
+        else
+                static_cast<QCheckListItem*>(item)->setState(QCheckListItem::Off);
+        item->setText(1,fi.fileName());
+        item->setText(2,fi.dirPath());
+        item->setText(3,doc->MasterItems.at(ItNr.toUInt())->OnMasterPage);
+        if (doc->MasterItems.at(ItNr.toUInt())->PicAvail)
+                item->setPixmap(1,NULL);
+        else
+                item->setPixmap(1,loadIcon("pic_miss.png"));
 	}
 	else
 	{
-		PicSearch *dia = new PicSearch(this, fileName, matches);
-		if (dia->exec())
-		{
-			Q_ASSERT(!dia->Bild.isEmpty());
-			loadPictByRow(dia->Bild, row);
-			view->DrawNew();
-		}
-		delete dia;
+        QFileInfo fi = QFileInfo(doc->DocItems.at(ItNr.toUInt())->Pfile);
+        p = doc->DocItems.at(ItNr.toUInt())->OwnPage;
+        if (doc->DocItems.at(ItNr.toUInt())->printable())
+                static_cast<QCheckListItem*>(item)->setState(QCheckListItem::On);
+        else
+                static_cast<QCheckListItem*>(item)->setState(QCheckListItem::Off);
+        item->setText(1,fi.fileName());
+        item->setText(2,fi.dirPath());
+        item->setText(3,tmp.setNum(p+1));
+        if (doc->DocItems.at(ItNr.toUInt())->PicAvail)
+                item->setPixmap(1,NULL);
+        else
+                item->setPixmap(1,loadIcon("pic_miss.png"));
 	}
 }
 
-bool PicStatus::loadPictByRow(const QString & newFilePath, unsigned int row)
+/*!
+ \fn void PicStatus::SearchPic()
+ \author Franz Schmid
+ \date
+ \brief Searches for the given Picture. Displays a Dialog when more than one Picture is found.
+ \param None
+ \retval None
+ */
+void PicStatus::searchPic()
 {
-	unsigned int itemNumber = ItemNrs[row];
-	// FIXME: error checking
-	view->LoadPict(newFilePath, itemNumber);
-	// WTF?
-	bool isMaster = PicTable->cellWidget(row, COL_GOTO)->isEnabled();
-	PageItem* item = isMaster ? doc->Items.at(itemNumber) : doc->MasterItems.at(itemNumber);
-	// Set missing flag again. Since we do no error checking of the load,
-	// missing will generally mean "failed to load".
-	PicTable->setText(row, COL_STATUS, item->PicAvail ? trOK : trMissing);
-	PicTable->setText(row, COL_PATH, QFileInfo(newFilePath).dirPath(true));
-	return item->PicAvail;
-}
-
-void PicStatus::setSearchButton(int row, bool toCancel, const FileSearch* searcher)
-{
-	QWidget* item = PicTable->cellWidget(row, COL_SEARCH);
-	Q_ASSERT(item);
-	QToolButton* tb = dynamic_cast<QToolButton*>(item);
-	Q_ASSERT(tb);
-	if (toCancel)
-	{
-		tb->setText( trCancelSearch );
-		disconnect(tb, SIGNAL(clicked()), this, SLOT(SearchPic()));
-		connect(tb, SIGNAL(clicked()), searcher, SLOT(cancel()));
-	}
+        watchTimer->stop();
+        QString fileName = pictureList->currentItem()->text(1);
+        searchParams=new pictureSearch(this);
+        searchParams->filePath->setText(pictureList->currentItem()->text(2));
+        searchParams->imageName->setText(tr("Search for %1 in: ").arg(fileName));
+        connect(searchParams,SIGNAL(startSearch(QString,bool,bool)),this,SLOT(startSearch(QString,bool,bool)));
+        connect(searchParams,SIGNAL(stopSearch()),this,SLOT(stopSearch()));
+        connect(searchParams,SIGNAL(replaceImage(QString,bool)),this,SLOT(replaceImage(QString,bool)));
+        searchParams->exec();
+        view->DrawNew();
+	reParseList();
+}
+
+
+/*!
+ \fn void PicStatus::replaceImage()
+ \author Jean-Baptiste Mardelle
+ \date
+ \brief replace missing image(s) with found files
+ \param None
+ \retval None
+ */
+void PicStatus::replaceImage(QString newUrl,bool replaceAll)
+{
+	uint i;
+	// if replaceAll, check for all missing pictures in the chosen directory
+
+        if (replaceAll) {
+		
+                QString newpath=QFileInfo(newUrl).dirPath(true)+"/";
+                QDir dir(newUrl);
+
+		// Parse all list to find missing pictures
+                QListViewItem * child = pictureList->firstChild();
+                while( child ) {
+                        QString ItN=static_cast<m_CheckListItem*>(child)->m_Index;
+
+			// check if it is a Master item
+			if (ItN.startsWith("+"))
+			{
+			// Check if picture is missing and its name is found in the selected directory
+			if ((!doc->MasterItems.at(ItN.toUInt())->PicAvail) && (!dir.entryInfoList(child->text(1), QDir::Files))) 
+				{
+					if (!doc->masterPageMode) ScApp->manageMasterPages(child->text(3));
+					view->LoadPict(newpath+child->text(1),ItN.toUInt(),false,false);
+                                        i++;
+                                }
+			}
+			else if ((!doc->DocItems.at(ItN.toUInt())->PicAvail) && (!dir.entryInfoList(child->text(1), QDir::Files)))
+				{
+					if (doc->masterPageMode) ScApp->ActWin->muster->close();
+					view->LoadPict(newpath+child->text(1),ItN.toUInt(),false,false);
+                                        i++;
+                                }
+			
+                        child = child->nextSibling();
+                }
+                if (i>1) {
+		// if other missing images were found, restore the previous working state (document or master mode)
+
+                if (static_cast<m_CheckListItem*>(pictureList->currentItem())->m_Index.startsWith("+"))
+		{
+			if (!doc->masterPageMode) ScApp->manageMasterPages(pictureList->currentItem()->text(3));
+		}
+		else if (doc->masterPageMode) ScApp->ActWin->muster->close();
+		} 
+		else
+                        QMessageBox::warning(this, tr("Scribus - Image Search"),
+                                             tr("No other missing images found in:\n%1").arg(newpath),
+                                             QMessageBox::Ok|QMessageBox::Default|QMessageBox::Escape,
+                                             QMessageBox::NoButton);
+        }
 	else
 	{
-		tb->setText(trSearch);
-		disconnect(tb, SIGNAL(clicked()), searcher, SLOT(cancel()));
-		connect(tb, SIGNAL(clicked()), SLOT(SearchPic()));
+	// replace only the current image
+        view->LoadPict(newUrl, static_cast<m_CheckListItem*>(pictureList->currentItem())->m_Index.toUInt(),false,false);
 	}
+
+}
+
+
+/*!
+ \fn void PicStatus::hasChanged()
+ \author Jean-Baptiste Mardelle
+ \date
+ \brief check if some image was inserted or removed
+ \param None
+ \retval None
+ */
+bool PicStatus::hasChanged()
+{
+
+// check if any image was inserted or removed from document or master, 
+// so that we don't reload the entire list if nothing changed.
+uint m,i;
+m=0;
+
+for (i=0; i<doc->DocItems.count(); ++i)
+{
+	if (doc->DocItems.at(i)->itemType() == PageItem::ImageFrame && !doc->DocItems.at(i)->Pfile.isEmpty())
+		m++;
 }
+if (m != pageItems) return true;
 
-int PicStatus::getRowByFileName(const QString & fileName)
+for (i=0; i < doc->MasterItems.count(); ++i)
 {
-	bool found = false;
-	unsigned int row;
-	// This cast is OK since numRows must logically return >=0
-	for (row = 0; row < static_cast<unsigned int>(PicTable->numRows()); ++row)
+	if (doc->MasterItems.at(i)->itemType() == PageItem::ImageFrame && !doc->MasterItems.at(i)->Pfile.isEmpty())
+		m++;
+}
+if (m != masterItems) return true;
+
+return false;
+}
+
+
+/*!
+ \fn void PicStatus::reParseList()
+ \author Jean-Baptiste Mardelle
+ \date
+ \brief Reload each item in the list
+ \param None
+ \retval None
+ */
+void PicStatus::reParseList()
+{
+// Parse all list and reload values
+
+QListViewItem *item = pictureList->firstChild();
+        while (item) {
+		reloadItem(item);
+                item = item->nextSibling();
+        }
+checkState();
+watchTimer->start(10000, true);
+}
+
+
+/*!
+ \fn void PicStatus::reloadList()
+ \author Jean-Baptiste Mardelle
+ \date
+ \brief Rebuild the entire list
+ \param None
+ \retval None
+ */
+void PicStatus::reloadList()
+{
+// clear list and rebuild it from scratch
+
+        watchTimer->stop();
+	if (!hasChanged()) 
 	{
-		if ( PicTable->text(row, 0) == fileName )
-		{
-			found = true;
-			break;
-		}
+		reParseList();
+		return;
 	}
-	Q_ASSERT(found);
-	return row;
+	
+        uint p, i;
+        QString tmp;
+        QString lastSelected;
+
+	// if the list was not empty, remember currently selected item
+        if (pictureList->currentItem()) 
+                lastSelected=static_cast<m_CheckListItem*>(pictureList->currentItem())->m_Index;
+
+	// clear all items in the list
+        pictureList->clear();
+	pageItems=0;
+	masterItems=0;
+
+	// Parse all Master items and look for non empty image frames
+        for (i=0; i < doc->MasterItems.count(); ++i) {
+                if (doc->MasterItems.at(i)->itemType() == PageItem::ImageFrame && !doc->MasterItems.at(i)->Pfile.isEmpty()) {
+
+			// create new entry in the picture list
+                        QFileInfo fi = QFileInfo(doc->MasterItems.at(i)->Pfile);
+                        m_CheckListItem *item = new m_CheckListItem( pictureList, QString::null);
+                        if (doc->MasterItems.at(i)->printable())
+                                item->setState(QCheckListItem::On);
+                        else
+                                item->setState(QCheckListItem::Off);
+
+                        item->setText(1,fi.fileName());
+                        item->setText(2,fi.dirPath());
+                        item->setText(3,doc->MasterItems.at(i)->OnMasterPage);
+
+			// If picture is missing, display a "missing" image
+                        if (!doc->MasterItems.at(i)->PicAvail)
+                                item->setPixmap(1,loadIcon("pic_miss.png"));
+
+			// It is a master item, so we prepend a "+" sign to the index to make a difference.
+                        item->m_Index=QString("+")+tmp.setNum(i);
+                        connect(item,SIGNAL(statusChange(m_CheckListItem*, bool )),this,SLOT(printPic(m_CheckListItem*, bool )));
+			masterItems++;
+
+                }
+        }
+
+        for (i=0; i< doc->DocItems.count(); ++i) {
+                if ((doc->DocItems.at(i)->itemType() == PageItem::ImageFrame) && !doc->DocItems.at(i)->Pfile.isEmpty()) {
+                        QFileInfo fi = QFileInfo(doc->DocItems.at(i)->Pfile);
+                        p = doc->DocItems.at(i)->OwnPage;
+                        m_CheckListItem *item = new m_CheckListItem (pictureList, QString::null);
+                        if (doc->DocItems.at(i)->printable())
+                                item->setState(QCheckListItem::On);
+                        else
+                                item->setState(QCheckListItem::Off);
+                        item->setText(1,fi.fileName());
+                        item->setText(2,fi.dirPath());
+                        item->setText(3,tmp.setNum(p+1));
+
+			// If picture is missing, display a "missing" image
+                        if (!doc->DocItems.at(i)->PicAvail)
+                                item->setPixmap(1,loadIcon("pic_miss.png"));
+                        item->m_Index=tmp.setNum(i);
+                        connect(item,SIGNAL(statusChange(m_CheckListItem*, bool )),this,SLOT(printPic(m_CheckListItem*, bool )));
+			pageItems++;
+                }
+        }
+
+	// If an item was selected before rebuilding the list, select it now.
+        if (pictureList->firstChild()) {
+                if (!lastSelected.isEmpty())
+                        pictureList->setSelected(selectItem(lastSelected),true);
+                else
+                        pictureList->setSelected(pictureList->firstChild(),true);
+        pictureList->ensureItemVisible (pictureList->currentItem());
+	}
+
+	// start parsing timer again
+        watchTimer->start(10000, true);
 }
 
+
 /*!
- \fn void PicStatus::PrintPic()
- \author Franz Schmid
+ \fn void PicStatus::selectItem()
+ \author Jean-Baptiste Mardelle
  \date
- \brief Enables or disables printing of the selected Image.
+ \brief Select an item in the list
  \param None
  \retval None
  */
-void PicStatus::PrintPic()
+QListViewItem* PicStatus::selectItem(QString mIndex)
 {
-	uint ZNr = QString(sender()->name()).toUInt();
-	uint ItNr = ItemNrs[ZNr];
-//	uint PgNr = PicTable->text(ZNr, 2).toInt()-1;
-	if (PicTable->cellWidget(ZNr, 3)->isEnabled())
-		doc->Items.at(ItNr)->setPrintable(FlagsPic.at(ZNr)->isChecked());
-	else
-		doc->MasterItems.at(ItNr)->setPrintable(FlagsPic.at(ZNr)->isChecked());
+        QListViewItem *item = pictureList->firstChild();
+        while (item) {
+                if ((static_cast<m_CheckListItem*>(item)->m_Index == mIndex))
+			return item;
+                item = item->nextSibling();
+        }
+	return pictureList->firstChild();
+}
+
+void PicStatus::stopSearch()
+{
+        if (search)
+                delete search;
+}
+
+void PicStatus::startSearch(QString url,bool recursive,bool replace)
+{
+        int rec;
+        if (recursive)
+                rec=-1;
+        else
+                rec=0;
+        search = new FileSearch(this, pictureList->currentItem()->text(1),url,rec);
+        Q_CHECK_PTR(search);
+        connect(search,
+                SIGNAL(searchComplete(const QStringList&, const QString&)),
+                SLOT(SearchPicFinished(const QStringList&, const QString&)));
+        connect(search, SIGNAL(searchAborted(bool)), SLOT(SearchPicAborted(bool)));
+        // Set up the UI to let the user cancel the search, then start it
+        //	setSearchButton(row, true, search);
+        search->start();
 }
+
+void PicStatus::SearchPicAborted(bool userCancelled)
+{
+        const FileSearch* search = dynamic_cast<const FileSearch*>(sender());
+        Q_ASSERT(search);
+        // Restore button to normal "search"
+        // and inform user if it it wasn't them who asked to stop it.
+        if (!userCancelled)
+                // A running search failed
+                QMessageBox::warning(this, tr("Scribus - Image Search"),
+                                     tr("The search failed: %1").arg(search->failReason()),
+                                     QMessageBox::Ok|QMessageBox::Default|QMessageBox::Escape,
+                                     QMessageBox::NoButton);
+        if (searchParams) {
+                searchParams->searchButton->setEnabled(true);
+                searchParams->stopButton->setEnabled(false);
+        }
+}
+
+void PicStatus::SearchPicFinished(const QStringList & matches, const QString & fileName)
+{
+        const FileSearch* search = dynamic_cast<const FileSearch*>(sender());
+        Q_ASSERT(search);
+
+        // Display a dialog for the user to select images from
+        // if one or more were found
+        if (matches.count() == 0) {
+                QMessageBox::information(this, tr("Scribus - Image Search"),
+                                         tr("No images named \"%1\" were found.").arg(fileName),
+                                         QMessageBox::Ok|QMessageBox::Default|QMessageBox::Escape,
+                                         QMessageBox::NoButton);
+                searchParams->searchButton->setEnabled(true);
+                searchParams->stopButton->setEnabled(false);
+        } else if (searchParams) {
+                searchParams->fileList->insertStringList(matches);
+                searchParams->fileList->setCurrentItem(0);
+                searchParams->searchButton->setEnabled(true);
+                searchParams->replaceButton->setEnabled(true);
+                searchParams->stopButton->setEnabled(false);
+        }
+}
+
Index: scribus/picstatus.h
===================================================================
RCS file: /cvs/Scribus/scribus/picstatus.h,v
retrieving revision 1.2.2.7
diff -u -3 -p -u -r1.2.2.7 picstatus.h
--- scribus/picstatus.h	13 Jul 2005 16:56:12 -0000	1.2.2.7
+++ scribus/picstatus.h	1 Aug 2005 14:19:29 -0000
@@ -1,5 +1,17 @@
-#ifndef PICSTATUS_H
-#define PICSTATUS_H
+//
+// C++ Interface: PicStatus
+//
+// Description: 
+//
+//
+// Author: Franz Schmid <Franz.Schmid@altmuehlnet.de>, (C) 2005
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+
+#ifndef PicStatus_H
+#define PicStatus_H
 
 #include <qdialog.h>
 #include <qpushbutton.h>
@@ -14,57 +26,60 @@ class ScribusDoc;
 class ScribusView;
 class FileSearch;
 
-class PicStatus : public QDialog
+#include "picturemanager.h"
+#include "picturesearch.h"
+
+class m_CheckListItem : public QObject,public QCheckListItem {
+  Q_OBJECT
+
+public:
+  m_CheckListItem( QListView *parent, const QString &text);
+  QString     m_Index;
+
+public slots:
+   void stateChange (bool);
+signals:
+   void statusChange (m_CheckListItem*, bool);
+};
+
+class PicStatus : public pictureManager
 { 
     Q_OBJECT
 
 public:
     PicStatus(QWidget* parent, ScribusDoc *docu, ScribusView *viewi);
-    ~PicStatus() {};
+    ~PicStatus(){};
 
-    QTable* PicTable;
-    QHeader *Header;
-    QPushButton* CancelB;
-    QPushButton* OkB;
+private:
     ScribusDoc *doc;
     ScribusView *view;
-    int Zeilen;
-    QPtrList<QCheckBox> FlagsPic;
-    QValueList<uint> ItemNrs;
+    FileSearch* search;
+    pictureSearch *searchParams;
+    QTimer *watchTimer;
+    int pageItems,masterItems;
+    QPopupMenu *ContextPopupMenu;
 
 private slots:
-    void GotoPic();
-    void SearchPic();
-    void SearchPicAborted(bool userCancelled);
+    void gotoPic();
+    void replacePic();
+    void searchPic();
     void SearchPicFinished(const QStringList & matches, const QString & fileName);
-    void PrintPic();
+    void SearchPicAborted(bool userCancelled);
+    void printPic(m_CheckListItem* item, bool isOn);
+    void startSearch(QString url,bool recursive,bool replace);
+    void stopSearch();
+    void replaceImage(QString newUrl,bool replaceAll);
+    void reloadList();
+    void reloadItem(QListViewItem *item);
+    void checkState();
+    QListViewItem* selectItem(QString mIndex);
+    void reParseList();
+    bool hasChanged();
+    void showMenu(QListViewItem *it , const QPoint &, int);
+    bool checkAvail();
 
 protected:
-    QVBoxLayout* PicStatusLayout;
-    QHBoxLayout* Layout2;
 
-	// Return the row index for the row containing the specified
-	// filename. Behavour is undefined if the filename is not in the
-	// table.
-	int getRowByFileName(const QString& fileName);
-
-	// Toggle a searc button in the table between "Search" and "Cancel Search",
-	// fixing signal connections as well.
-	void PicStatus::setSearchButton(int row, bool toCancel, const FileSearch* searcher);
-
-	// Load the image specified into the PageItem shown on row `row'
-	bool PicStatus::loadPictByRow(const QString & newFilePath, unsigned int row);
-
-	// Column indexes
-	static const unsigned short COL_FILENAME;
-	static const unsigned short COL_PATH;
-	static const unsigned short COL_PAGE;
-	static const unsigned short COL_GOTO;
-	static const unsigned short COL_PRINT;
-	static const unsigned short COL_STATUS;
-	static const unsigned short COL_SEARCH;
-
-	// Common translated strings
 	static const QString trOK;
 	static const QString trMissing;
 	static const QString trSearch;
@@ -72,8 +87,10 @@ protected:
 	static const QString trGoto;
 
 signals:
-	void selectPage(int);
+	void selectPage(int,int);
 	void selectMasterPage(QString);
 };
 
-#endif // PICSTATUS_H
+
+
+#endif // PicStatus_H
Index: scribus/scribus.cpp
===================================================================
RCS file: /cvs/Scribus/scribus/scribus.cpp,v
retrieving revision 1.228.2.458
diff -u -3 -p -u -r1.228.2.458 scribus.cpp
--- scribus/scribus.cpp	31 Jul 2005 20:14:57 -0000	1.228.2.458
+++ scribus/scribus.cpp	1 Aug 2005 14:19:35 -0000
@@ -76,7 +76,6 @@
 #include "editformats.h"
 #include "muster.h"
 #include "applytemplatedialog.h"
-#include "picstatus.h"
 #include "customfdialog.h"
 #include "cmsprefs.h"
 #include "annot.h"
@@ -144,8 +143,10 @@
 #include "marginWidget.h"
 #include "margindialog.h"
 #include "prefsmanager.h"
+#include "picstatus.h"
 #include "pagelayout.h"
 
+
 using namespace std;
 
 #ifdef HAVE_CMS
@@ -4615,14 +4616,9 @@ bool ScribusApp::loadDoc(QString fileNam
 	return ret;
 }
 
-void ScribusApp::slotFileOpen()
+QString ScribusApp::slotImageOpen(QString path)
 {
-	if (view->SelItem.count() != 0)
-	{
-		PageItem *currItem = view->SelItem.at(0);
-		if (currItem->itemType() == PageItem::ImageFrame)
-		{
-			QString formats = "";
+QString formats = "";
 			QString formatD = tr("All Supported Formats")+" (";
 			QString form1 = "";
 			QString form2 = "";
@@ -4658,12 +4654,27 @@ void ScribusApp::slotFileOpen()
 			formatD += " *.eps *.EPS *.pdf *.PDF";
 			formatD += ");;"+formats;
 			QString docDir = ".";
-			QString prefsDocDir=prefsManager->documentDir();
-			if (!prefsDocDir.isEmpty())
-				docDir = dirs->get("images", prefsDocDir);
+			if (!path.isEmpty()) docDir=path;
 			else
-				docDir = dirs->get("images", ".");
+			{
+				QString prefsDocDir=prefsManager->documentDir();
+				if (!prefsDocDir.isEmpty())
+					docDir = dirs->get("images", prefsDocDir);
+				else
+					docDir = dirs->get("images", ".");
+			}
 			QString fileName = CFileDialog( docDir, tr("Open"), formatD, "", true);
+return fileName;
+}
+
+void ScribusApp::slotFileOpen()
+{
+	if (view->SelItem.count() != 0)
+	{
+		PageItem *currItem = view->SelItem.at(0);
+		if (currItem->itemType() == PageItem::ImageFrame)
+		{
+		QString fileName = slotImageOpen();
 			if (!fileName.isEmpty())
 			{
 				dirs->set("images", fileName.left(fileName.findRev("/")));
@@ -8989,13 +9000,10 @@ void ScribusApp::restoreUngroupping(Simp
 
 void ScribusApp::StatusPic()
 {
-	if (HaveDoc)
+	if (HaveDoc && !picManager)
 	{
-		PicStatus *dia = new PicStatus(this, doc, view);
-		connect(dia, SIGNAL(selectPage(int)), this, SLOT(SelectFromOutlS(int)));
-		connect(dia, SIGNAL(selectMasterPage(QString)), this, SLOT(manageMasterPages(QString)));
-		dia->exec();
-		delete dia;
+		picManager = new PicStatus(this, doc, view);
+		picManager->show();
 	}
 }
 
Index: scribus/scribus.h
===================================================================
RCS file: /cvs/Scribus/scribus/scribus.h,v
retrieving revision 1.60.2.127
diff -u -3 -p -u -r1.60.2.127 scribus.h
--- scribus/scribus.h	31 Jul 2005 20:14:57 -0000	1.60.2.127
+++ scribus/scribus.h	1 Aug 2005 14:19:35 -0000
@@ -89,6 +89,7 @@ class ActionManager;
 class AlignDistributePalette;
 class TOCGenerator;
 class PrefsManager;
+class PicStatus;
 
 /**
   * This Class is the base class for your application. It sets up the main
@@ -177,7 +178,9 @@ public:
 	double DispX;
 	double DispY;
 	int HaveDoc;
+
 	QString noneString;
+
 	PrefsContext* dirs;
 	/** view is the main widget which represents your working area. The View
 	 * class should handle all events of the view widget.  It is kept empty so
@@ -281,6 +284,8 @@ public slots:
 	bool slotFileNew();
 	bool slotPageImport();
 	bool loadPage(QString fileName, int Nr, bool Mpa);
+	/** return the name of an image file */
+	QString slotImageOpen(QString path = QString::null);
 	/** open a document */
 	void slotFileOpen();
 	void slotFileAppend();
@@ -551,6 +556,7 @@ private:
 	int DocNr;
 	UndoManager *undoManager;
 	PrefsManager *prefsManager;
+	PicStatus *picManager;
 	bool PrinterUsed;
 	struct PDe {
 					QString Pname;
Index: scribus/scribusview.cpp
===================================================================
RCS file: /cvs/Scribus/scribus/scribusview.cpp,v
retrieving revision 1.76.2.266
diff -u -3 -p -u -r1.76.2.266 scribusview.cpp
--- scribus/scribusview.cpp	31 Jul 2005 20:14:57 -0000	1.76.2.266
+++ scribus/scribusview.cpp	1 Aug 2005 14:19:42 -0000
@@ -10890,12 +10890,12 @@ void ScribusView::editExtendedImagePrope
 	}
 }
 
-void ScribusView::LoadPict(QString fn, int ItNr, bool reload)
+void ScribusView::LoadPict(QString fn, int ItNr, bool reload, bool reinit)
 {
 	loadPict(fn, Doc->Items.at(ItNr), reload);
 }
 
-void ScribusView::loadPict(QString fn, PageItem *pageItem, bool reload)
+void ScribusView::loadPict(QString fn, PageItem *pageItem, bool reload, bool reinit)
 {
 	bool dummy;
 	QFileInfo fi = QFileInfo(fn);
@@ -10933,7 +10933,7 @@ void ScribusView::loadPict(QString fn, P
 		Item->PicAvail = true;
 		Item->PicArt = true;
 		Item->BBoxX = 0;
-		if (Item->Pfile != fn)
+		if (Item->Pfile != fn && reinit)
 		{
 			Item->LocalScX = 72.0 / xres;
 			Item->LocalScY = 72.0 / yres;
Index: scribus/scribusview.h
===================================================================
RCS file: /cvs/Scribus/scribus/scribusview.h,v
retrieving revision 1.14.2.64
diff -u -3 -p -u -r1.14.2.64 scribusview.h
--- scribus/scribusview.h	28 Jul 2005 21:38:57 -0000	1.14.2.64
+++ scribus/scribusview.h	1 Aug 2005 14:19:42 -0000
@@ -256,8 +256,8 @@ public:
 	void chFSize(int size);
 	void FlipImageH();
 	void FlipImageV();
-	void LoadPict(QString fn, int ItNr, bool reload = false);
-	void loadPict(QString fn, PageItem *pageItem, bool reload = false);
+	void LoadPict(QString fn, int ItNr, bool reload = false, bool reload = true);
+	void loadPict(QString fn, PageItem *pageItem, bool reload = false, bool reload = true);
 	void AdjustPictScale(PageItem *currItem, bool reload = true);
 	void PasteItem(struct CopyPasteBuffer *Buffer, bool loading, bool drag = false);
 	void BuildAObj();
Index: scribus/icons/Makefile.am
===================================================================
RCS file: /cvs/Scribus/scribus/icons/Makefile.am,v
retrieving revision 1.28.2.56
diff -u -3 -p -u -r1.28.2.56 Makefile.am
--- scribus/icons/Makefile.am	31 Jul 2005 13:12:50 -0000	1.28.2.56
+++ scribus/icons/Makefile.am	1 Aug 2005 14:19:43 -0000
@@ -1,4 +1,5 @@
-EXTRA_DIST = pagedouble.png pagequadro.png pagesingle.png pagetriple.png mover.png above.png below.png firstline.png leftindent.png shade.png linespacing.png textbase.png textscaleh.png textkern.png textscalev.png wordsOnly.png shadow.png AllCaps.png DrawFrame.xpm DrawImageFrame.xpm DrawPolylineFrame.xpm DrawTable.xpm DrawTextFrame.xpm plugins.png filenew.png fileopen.png editcopy22.png edittrash.png font_otf16.png font_truetype16.png font_type1_16.png font_otf.png font_truetype.png font_type1.png acroread.png checkdoc.png vectorgfx.png ooo_draw.png ooo_writer.png key_bindings.png blend.png hyphenate.png scrap.png misc.png tools.png page.png guides.png font.png screen.png nftabout.xpm nftinfo.xpm dist.png tab.png view.png Kreuz.xpm Bild.xpm Bild16.xpm Editm.xpm Kreise.xpm Lock.xpm Lupe.xpm Rechtecke.xpm Rotieren.xpm Stift16.xpm Stift.xpm Text.xpm Text16.xpm Unlock.xpm DateiClose.png DateiNeu.xpm DateiOpen.xpm DateiPrint.xpm DateiSave2.png AppIcon2.png AppIcon.png LupeZ.xpm Gross.xpm Klein.xpm DragPix.xpm Rotieren2.xpm HandC.xpm scribus_logo.jpg DateiClos16.png DateiNeu16.png DateiOpen16.png DateiPrint16.png DateiSave16.png editcopy.png editcut.png editdelete.png editpaste.png exit.png doc.png image.png pdf.png postscript.png txt.png Zeichen.xpm Hoch.xpm Kapital.xpm Strike.xpm Tief.xpm Unter.xpm Kern.xpm Spacing.xpm Corner.xpm FlipH.xpm FlipV.xpm Winkel.xpm acrobat.png scribusicon.png text_block.png text_center.png text_left.png text_right.png Text2.xpm spline16.png spline.png triangle.png Stiftalt.xpm Stiftalt16.xpm beziertool.png beziertool16.png AddNode.png DeleteNode.png MoveAsym.png MoveKontrol.png MoveNode.png MoveSym.png BevelJoin.png ButtCap.png MiterJoin.png RoundJoin.png SquareCap.png ResetNode.png RoundCap.png Reset1Node.png BezierClose.png PolyCut.png AddPoint.png DelPoint.png Split.png Deletelayer.png Layervisible.xpm Lowerlayer.png Newlayer.png Raiselayer.png checkbox.png combobox.png listbox.png pushbutton.png textview.png charset.png goto.png document2.png trashcan.png trashcan2.png gohome.png bottom.png down.png top.png up.png irreg.png text_force.png ok.png ok22.png Revers.png hmirror.png vmirror.png shear_right.png shear_left.png shear_up.png shear_down.png Splash.png back.png start.png forward.png finish.png penciladd.png pencilsub.png outlined.png fill.png NoPrint.png unlock.png locked.png signature.png rotate_cw.png rotate_ccw.png crop.png expand.png frameresize.png framenoresize.png testfill.png frame_table16.png frame_table.png scribusdoc.png documentinfo.png documentinfo32.png filesaveas.png revert.png reload.png compfile.png reload16.png compfile16.png find.png find16.png addf.png removef.png launch.png launch16.png u_undo.png u_redo.png u_undo16.png u_redo16.png u_margins.png u_margins_locked.png u_align.png u_move.png u_resize.png u_rotate.png u_group.png u_fill.png u_shade.png u_lock.png u_unlock.png u_create.png u_delete.png u_fliph.png u_flipv.png u_cut.png u_transp.png u_line.png u_arrow.png u_font.png u_svg.png u_eps.png u_scale_image.png u_shape.png docattributes.png tabtocindex.png colorpicker.png wizard.png al_bottom_in.png al_bottom_out.png al_center_hor.png al_center_ver.png al_left_in.png al_left_out.png al_right_in.png al_right_out.png al_top_in.png al_top_out.png distribute_bottom.png distribute_hcentre.png distribute_hdist.png distribute_hdist_val.png distribute_left.png distribute_right.png distribute_top.png distribute_vcentre.png distribute_vdist.png distribute_vdist_val.png
+
+EXTRA_DIST = pagedouble.png pagequadro.png pagesingle.png pagetriple.png mover.png above.png below.png firstline.png leftindent.png shade.png linespacing.png textbase.png textscaleh.png textkern.png textscalev.png wordsOnly.png shadow.png AllCaps.png DrawFrame.xpm DrawImageFrame.xpm DrawPolylineFrame.xpm DrawTable.xpm DrawTextFrame.xpm plugins.png filenew.png fileopen.png editcopy22.png edittrash.png font_otf16.png font_truetype16.png font_type1_16.png font_otf.png font_truetype.png font_type1.png acroread.png checkdoc.png vectorgfx.png ooo_draw.png ooo_writer.png key_bindings.png blend.png hyphenate.png scrap.png misc.png tools.png page.png guides.png font.png screen.png nftabout.xpm nftinfo.xpm dist.png tab.png view.png Kreuz.xpm Bild.xpm Bild16.xpm Editm.xpm Kreise.xpm Lock.xpm Lupe.xpm Rechtecke.xpm Rotieren.xpm Stift16.xpm Stift.xpm Text.xpm Text16.xpm Unlock.xpm DateiClose.png DateiNeu.xpm DateiOpen.xpm DateiPrint.xpm DateiSave2.png AppIcon2.png AppIcon.png LupeZ.xpm Gross.xpm Klein.xpm DragPix.xpm Rotieren2.xpm HandC.xpm scribus_logo.jpg DateiClos16.png DateiNeu16.png DateiOpen16.png DateiPrint16.png DateiSave16.png editcopy.png editcut.png editdelete.png editpaste.png exit.png doc.png image.png pdf.png postscript.png txt.png Zeichen.xpm Hoch.xpm Kapital.xpm Strike.xpm Tief.xpm Unter.xpm Kern.xpm Spacing.xpm Corner.xpm FlipH.xpm FlipV.xpm Winkel.xpm acrobat.png scribusicon.png text_block.png text_center.png text_left.png text_right.png Text2.xpm spline16.png spline.png triangle.png Stiftalt.xpm Stiftalt16.xpm beziertool.png beziertool16.png AddNode.png DeleteNode.png MoveAsym.png MoveKontrol.png MoveNode.png MoveSym.png BevelJoin.png ButtCap.png MiterJoin.png RoundJoin.png SquareCap.png ResetNode.png RoundCap.png Reset1Node.png BezierClose.png PolyCut.png AddPoint.png DelPoint.png Split.png Deletelayer.png Layervisible.xpm Lowerlayer.png Newlayer.png Raiselayer.png checkbox.png combobox.png listbox.png pushbutton.png textview.png charset.png goto.png document2.png trashcan.png trashcan2.png gohome.png bottom.png down.png top.png up.png irreg.png text_force.png ok.png ok22.png Revers.png hmirror.png vmirror.png shear_right.png shear_left.png shear_up.png shear_down.png Splash.png back.png start.png forward.png finish.png penciladd.png pencilsub.png outlined.png fill.png NoPrint.png unlock.png locked.png signature.png rotate_cw.png rotate_ccw.png crop.png expand.png frameresize.png framenoresize.png testfill.png frame_table16.png frame_table.png scribusdoc.png documentinfo.png documentinfo32.png filesaveas.png revert.png reload.png compfile.png reload16.png compfile16.png find.png find16.png addf.png removef.png launch.png launch16.png u_undo.png u_redo.png u_undo16.png u_redo16.png u_margins.png u_margins_locked.png u_align.png u_move.png u_resize.png u_rotate.png u_group.png u_fill.png u_shade.png u_lock.png u_unlock.png u_create.png u_delete.png u_fliph.png u_flipv.png u_cut.png u_transp.png u_line.png u_arrow.png u_font.png u_svg.png u_eps.png u_scale_image.png u_shape.png docattributes.png tabtocindex.png colorpicker.png wizard.png al_bottom_in.png al_bottom_out.png al_center_hor.png al_center_ver.png al_left_in.png al_left_out.png al_right_in.png al_right_out.png al_top_in.png al_top_out.png distribute_bottom.png distribute_hcentre.png distribute_hdist.png distribute_hdist_val.png distribute_left.png distribute_right.png distribute_top.png distribute_vcentre.png distribute_vdist.png distribute_vdist_val.png  pic_miss.png
 
 install-data-local:
 	$(mkinstalldirs) $(prefix)/share/scribus/icons/
patch3.diff (50,664 bytes)

jean-baptiste

2005-08-01 15:13

reporter   ~0005802

New version of my patch against current cvs (patch3.diff):

* added comments

* about the timer approach: I first tried to implement the picture manager using signals and slots, but currently, there is no signal attached to items, and I am not sure it has a sense to do so much changes to the code just for the picture manager. Besides that, I think it could be very complex to manage all cases in a proper way, and new features could easily break the thing.

* columns have an initial width because there seems to be some bug in QT
with QListView that have their columns reordered, giving very weird results in auto mode.

* Under what circumstances might PicStatus::showMenu(...) get called with
a null QListViewItem* ? Not sure to understand what is the problem with that... It is called with a null QListViewItem when the user right clicks on the empty area of the listview. Menu should not be displayed in that case...

* I otherwise made some improvements to avoid duplicate code.

Feel free to use and change the code if you want.

ringerc

2005-08-22 05:24

reporter   ~0006191

Thanks for that.

I'm currently swamped, and won't be able to review your changes for a couple of weeks. Sorry. With luck someone else will be able to check them out.

ringerc

2005-09-12 06:10

reporter   ~0006518

aamehl in 0002251 noted issues with:
  - the dialog being modal
  - search flexibility

Issue History

Date Modified Username Field Change
2005-02-16 01:13 ExScite New Issue
2005-02-16 06:49 ringerc Note Added: 0003721
2005-02-16 06:49 ringerc Severity minor => feature
2005-02-16 06:49 ringerc Category General => User Interface
2005-02-16 06:49 ringerc Summary In Picture Management, Search function needs improvement => Search in Picture Management should search user specified directory list, pick up all matching images in dir.
2005-02-16 13:00 louisdesjardins Note Added: 0003729
2005-05-16 16:47 jb Note Added: 0004668
2005-05-16 16:47 jb File Added: imagemanager.png
2005-06-01 22:22 ringerc Relationship added related to 0001811
2005-06-01 22:23 ringerc Status new => acknowledged
2005-07-13 15:01 ringerc Note Added: 0005563
2005-07-13 15:04 ringerc Note Edited: 0005563
2005-07-13 15:13 ringerc Summary Search in Picture Management should search user specified directory list, pick up all matching images in dir. => Picture Management dialog needs a rewrite
2005-07-13 15:16 ringerc Note Added: 0005567
2005-07-18 15:30 jean-baptiste File Added: picman.png
2005-07-18 15:30 jean-baptiste Note Added: 0005632
2005-07-27 22:42 jean-baptiste File Added: patch2.diff
2005-07-27 22:46 jean-baptiste File Added: patch2_uifiles.tar.gz
2005-07-27 22:51 jean-baptiste Note Added: 0005748
2005-07-28 03:22 ringerc Note Added: 0005753
2005-07-28 13:50 ringerc Note Added: 0005764
2005-08-01 14:24 jean-baptiste File Added: patch3.diff
2005-08-01 15:13 jean-baptiste Note Added: 0005802
2005-08-03 15:44 ringerc Relationship added related to 0002376
2005-08-03 16:31 ringerc Relationship added related to 0002382
2005-08-21 16:04 jghali Relationship added related to 0002463
2005-08-21 22:13 plinnell Relationship added related to 0002467
2005-08-22 05:24 ringerc Note Added: 0006191
2005-09-07 21:51 plinnell Relationship added has duplicate 0000516
2005-09-12 06:07 ringerc Relationship added has duplicate 0002551
2005-09-12 06:10 ringerc Note Added: 0006518
2006-05-14 00:02 mhanski Relationship added related to 0003814
2007-02-26 23:40 cbradney Status acknowledged => assigned
2007-02-26 23:40 cbradney Assigned To => fschmid
2007-12-05 21:08 plinnell Status assigned => resolved
2007-12-05 21:08 plinnell Fixed in Version => 1.3.5svn
2007-12-05 21:08 plinnell Resolution open => fixed
2007-12-13 07:54 cbradney Status resolved => closed