tdeprint: make KPrinter::setOrientation and KPrinter::setPageSize non locking by default and add ability to specify their locking behavior.

This is a backward compatible API change and a non compatible ABI change.

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
pull/194/head
Michele Calgaro 2 years ago
parent ea10b6290d
commit 9cff750d6c
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -597,13 +597,16 @@ int KPrinter::metric(int m) const
return val; return val;
} }
void KPrinter::setOrientation(Orientation o) void KPrinter::setOrientation(Orientation o, bool locking)
{ {
KMFactory::self()->settings()->orientation = o; KMFactory::self()->settings()->orientation = o;
setOption("kde-orientation",(o == Landscape ? "Landscape" : "Portrait")); setOption("kde-orientation",(o == Landscape ? "Landscape" : "Portrait"));
d->m_impl->broadcastOption("kde-orientation",(o == Landscape ? "Landscape" : "Portrait")); d->m_impl->broadcastOption("kde-orientation",(o == Landscape ? "Landscape" : "Portrait"));
if (locking)
{
d->m_impl->broadcastOption( "kde-orientation-fixed", "1" ); d->m_impl->broadcastOption( "kde-orientation-fixed", "1" );
} }
}
void KPrinter::setOption( const TQString& key, const TQString& value, bool broadcast ) void KPrinter::setOption( const TQString& key, const TQString& value, bool broadcast )
{ {
@ -612,12 +615,15 @@ void KPrinter::setOption( const TQString& key, const TQString& value, bool broad
d->m_impl->broadcastOption( key, value ); d->m_impl->broadcastOption( key, value );
} }
void KPrinter::setPageSize(PageSize s) void KPrinter::setPageSize(PageSize s, bool locking)
{ {
KMFactory::self()->settings()->pageSize = s; KMFactory::self()->settings()->pageSize = s;
setOption("kde-pagesize",TQString::number((int)s),true); setOption("kde-pagesize",TQString::number((int)s),true);
if (locking)
{
d->m_impl->broadcastOption( "kde-pagesize-fixed", "1" ); d->m_impl->broadcastOption( "kde-pagesize-fixed", "1" );
} }
}
void KPrinter::setOptions(const TQMap<TQString,TQString>& opts) void KPrinter::setOptions(const TQMap<TQString,TQString>& opts)
{ // This functions remove all options except those with "kde-..." { // This functions remove all options except those with "kde-..."

@ -289,7 +289,7 @@ public:
/** /**
* See TQPrinter::setOrientation(). * See TQPrinter::setOrientation().
*/ */
void setOrientation(Orientation); void setOrientation(Orientation, bool locking = false);
/** /**
* See TQPrinter::pageOrder(). * See TQPrinter::pageOrder().
*/ */
@ -347,7 +347,7 @@ public:
/** /**
* See TQPrinter::setPageSize(). * See TQPrinter::setPageSize().
*/ */
void setPageSize(PageSize); void setPageSize(PageSize, bool locking = false);
/** /**
* See TQPrinter::printerName(). * See TQPrinter::printerName().
*/ */

Loading…
Cancel
Save