Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 5833 → Rev 5834

/branches/Version13x/Scribus/scribus/picstatus.h
52,6 → 52,7
\brief Searches for the given Picture. Displays a Dialog when more than one Picture is found.
*/
void SearchPic();
void searchAllPics();
void SearchPicAborted(bool userCancelled);
void SearchPicFinished(const QStringList & matches, const QString & fileName);
/*!
108,8 → 109,9
private:
QTable* PicTable;
QHeader *Header;
QPushButton* CancelB;
QPushButton* OkB;
QPushButton* cancelButton;
QPushButton* okButton;
QPushButton* searchAllButton;
ScribusDoc *m_Doc;
int Zeilen;
QPtrList<QCheckBox> FlagsPic;
/branches/Version13x/Scribus/scribus/scribusdoc.cpp
2899,6 → 2899,8
m_ScMW->HaveRaster(pageItem->isRaster);
//TODO: Previously commented out.. unsure why, remove later
//emit UpdtObj(PageNr, ItNr);
//CB: probably because we are therefore not always refreshing the view when an image changes...
emit refreshItem(pageItem);
changed();
}
return true;
/branches/Version13x/Scribus/scribus/picstatus.cpp
29,6 → 29,7
#include <qtoolbutton.h>
#include <qstringlist.h>
#include <qtextstream.h>
#include <qtooltip.h>
#include <qcursor.h>
#include <cstdio>
#include "picsearch.h"
187,7 → 188,7
PicTable->adjustColumn(COL_PRINT);
PicTable->adjustColumn(COL_STATUS);
PicTable->setSorting(false);
PicTable->setSelectionMode(QTable::NoSelection);
PicTable->setSelectionMode(QTable::MultiRow);
PicTable->setColumnMovingEnabled(false);
PicTable->setRowMovingEnabled(false);
Header->setMovingEnabled(false);
203,13 → 204,17
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 );
searchAllButton = new QPushButton( tr( "Set New Location" ), this, "searchAllButton" );
Layout2->addWidget( searchAllButton );
okButton = new QPushButton( tr( "Close" ), this, "okButton" );
Layout2->addWidget( okButton );
PicStatusLayout->addLayout( Layout2 );
 
// signals and slots connections
connect( OkB, SIGNAL( clicked() ), this, SLOT( accept() ) );
connect( searchAllButton, SIGNAL( clicked() ), this, SLOT( searchAllPics() ) );
connect( okButton, SIGNAL( clicked() ), this, SLOT( accept() ) );
QToolTip::add( searchAllButton, "<qt>" + tr( "Set a new location for the selected items. Useful when you may have moved the document but not the images." ) + "</qt>");
}
 
void PicStatus::languageChange()
237,15 → 242,15
{
// FIXME: This is a pretty ugly hack IMO - carried over from the old
// SearchPic. Table handling needs work.
QString workDir;
QString searchBase;
unsigned int row = QString(sender()->name()).toUInt();
QString fileName = PicTable->text(row, COL_FILENAME);
QString workDir;
#ifndef _WIN32
workDir = QDir::homeDirPath();
#endif
// Pictures may be located completely outside home or documents directory
// so ask base search directory first
QString searchBase;
searchBase = QFileDialog::getExistingDirectory( workDir, NULL, NULL, tr("Select a base directory for search"));
if( searchBase.isEmpty() || !QDir().exists(searchBase) )
return;
379,3 → 384,29
else
m_Doc->MasterItems.at(ItNr)->setPrintEnabled(FlagsPic.at(ZNr)->isChecked());
}
 
void PicStatus::searchAllPics( )
{
QString workDir;
#ifndef _WIN32
workDir = QDir::homeDirPath();
#endif
QString searchBase = QFileDialog::getExistingDirectory( workDir, NULL, NULL, tr("Select a base directory for your selected rows"));
if( searchBase.isEmpty() || !QDir().exists(searchBase) )
return;
uint updated=0;
for (int i=0; i<PicTable->numRows(); ++i)
{
if (PicTable->isRowSelected(i))
{
QString newName=searchBase+PicTable->text(i, COL_FILENAME);
if (QFile::exists(newName))
{
if (loadPictByRow(newName, i))
++updated;
}
}
}
if (updated>0)
PicTable->adjustColumn(COL_PREVIEW);
}