Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 842bcab6ce |
@@ -1,13 +1,5 @@
|
||||
NEWS - list of user-visible changes between releases of qlscribe
|
||||
|
||||
New in 0.5:
|
||||
Bugfix for crash on writing
|
||||
CD inner size increased to 25mm on QCDView
|
||||
Maximum image size increased to 150
|
||||
Fixed bug with not setting color on round text
|
||||
Text scaled to 1/2
|
||||
Fixed bug with missing button "OK" on pixmap edit dialog
|
||||
|
||||
New in 0.4:
|
||||
Scene detects when item is moved by mouse and changes status to unsaved
|
||||
On installation sticky bit is set, qlscribe becomes root when burns label
|
||||
|
||||
+1
-2
@@ -37,7 +37,6 @@
|
||||
#include <QLabel>
|
||||
#include <QCloseEvent>
|
||||
|
||||
|
||||
MainWindow::MainWindow( bool enablePrint )
|
||||
: QMainWindow( 0 ),
|
||||
m_mdiArea( new QMdiArea( this ) ),
|
||||
@@ -300,7 +299,7 @@ void MainWindow::onMenuAbout()
|
||||
QMessageBox::about( this,
|
||||
tr( "About" ),
|
||||
tr( "<h3>qlscribe - Qt lisghtScribe</h3>"
|
||||
"<p>release 0.5 $Revision$</p>"
|
||||
"<p>release 0.4 $Revision$</p>"
|
||||
"<p>visit project at home page "
|
||||
"<a href=\"http://qlscribe.sourceforge.net/\">qlscribe.sourceforge.net</a></p>" ) );
|
||||
}
|
||||
|
||||
+1
-1
@@ -96,7 +96,7 @@ void QCDView::drawCD( QPainter *painter, const QRectF & rect, bool alpha )
|
||||
drawCircle( painter, 59.0 );
|
||||
|
||||
painter->setBrush( alpha ? Qt::lightGray : Qt::darkGray );
|
||||
drawCircle( painter, 25.0 );
|
||||
drawCircle( painter, 21.7 );
|
||||
|
||||
painter->setBrush( alpha ? Qt::white : Qt::gray );
|
||||
drawCircle( painter, 10.7 );
|
||||
|
||||
@@ -79,7 +79,6 @@ bool QDialogPixmap::exec( QGraphicsItem *graphicsItem )
|
||||
m_ui->spinWidth->setValue( scale.x() );
|
||||
m_ui->spinHeight->setValue( scale.y() );
|
||||
m_ui->lockedRatio->setChecked( scale.x() == scale.y() ? Qt::Checked : Qt::Unchecked );
|
||||
m_ui->buttonBox->setStandardButtons( m_ui->buttonBox->standardButtons() | QDialogButtonBox::Ok );
|
||||
}
|
||||
|
||||
connect( m_ui->spinX, SIGNAL(valueChanged(double)),
|
||||
|
||||
@@ -94,7 +94,7 @@
|
||||
<double>1.000000000000000</double>
|
||||
</property>
|
||||
<property name="maximum" >
|
||||
<double>200.000000000000000</double>
|
||||
<double>70.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -111,7 +111,7 @@
|
||||
<double>1.000000000000000</double>
|
||||
</property>
|
||||
<property name="maximum" >
|
||||
<double>200.000000000000000</double>
|
||||
<double>70.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
@@ -129,7 +129,6 @@ void QDialogRoundText::onFont()
|
||||
{
|
||||
bool ok = true;
|
||||
QFont font = QFontDialog::getFont( &ok, m_item->font(), this );
|
||||
//font.setPointSizeF( font.pointSizeF() / 2.0 );
|
||||
if( ok ) {
|
||||
m_item->setFont( font );
|
||||
fontChanged();
|
||||
|
||||
@@ -206,9 +206,6 @@
|
||||
</item>
|
||||
<item row="0" column="1" >
|
||||
<widget class="QFontComboBox" name="fontName" >
|
||||
<property name="enabled" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="editable" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
|
||||
+1
-2
@@ -16,7 +16,7 @@
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
$Id$ */
|
||||
$Id:$ */
|
||||
|
||||
#include "qdialogtext.h"
|
||||
#include "ui_qdialogtext.h"
|
||||
@@ -66,7 +66,6 @@ bool QDialogText::exec( QGraphicsItem *graphicsItem )
|
||||
m_item->setText( item->text() );
|
||||
m_item->setFont( item->font() );
|
||||
m_item->setBrush( item->brush() );
|
||||
m_item->setTransform( item->transform() );
|
||||
|
||||
scene.addItem( m_item );
|
||||
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
#include <QStyleOptionGraphicsItem>
|
||||
#include <QMessageBox>
|
||||
#include <QXmlStreamWriter>
|
||||
#include <QTextLayout>
|
||||
|
||||
#include <math.h>
|
||||
|
||||
@@ -38,7 +37,6 @@ QLightRoundTextItem::QLightRoundTextItem( QGraphicsItem *parent )
|
||||
m_alignment( Qt::AlignLeft ),
|
||||
m_outside( true )
|
||||
{
|
||||
setBrush( Qt::black );
|
||||
}
|
||||
|
||||
const QFont & QLightRoundTextItem::font() const
|
||||
@@ -120,9 +118,7 @@ QRectF QLightRoundTextItem::boundingRect() const
|
||||
|
||||
QPainterPath QLightRoundTextItem::shape() const
|
||||
{
|
||||
QFont font( m_font );
|
||||
font.setPointSizeF( m_font.pointSizeF() / 2 );
|
||||
QFontMetrics mcs( font );
|
||||
QFontMetrics mcs( m_font );
|
||||
double arcAngle = 0.0;
|
||||
const double pad = 1;
|
||||
|
||||
@@ -176,13 +172,11 @@ void QLightRoundTextItem::paint( QPainter *painter, const QStyleOptionGraphicsIt
|
||||
if( !painter || !m_radius ) return;
|
||||
painter->save();
|
||||
|
||||
QFont font( m_font );
|
||||
font.setPointSizeF( m_font.pointSizeF() / 2 );
|
||||
painter->setFont( font );
|
||||
painter->setFont( m_font );
|
||||
|
||||
//painter->drawEllipse( - m_radius, - m_radius, m_radius * 2, m_radius * 2 );
|
||||
|
||||
QFontMetrics mcs( font );
|
||||
QFontMetrics mcs( m_font );
|
||||
|
||||
const double radi = m_radius - ( m_outside ? 0 : mcs.xHeight() );
|
||||
const double diam = 2 * radi;
|
||||
@@ -199,14 +193,8 @@ void QLightRoundTextItem::paint( QPainter *painter, const QStyleOptionGraphicsIt
|
||||
|
||||
QTransform trans;
|
||||
trans.rotateRadians( angle );
|
||||
painter->setRenderHint( QPainter::TextAntialiasing, true );
|
||||
painter->setWorldTransform( trans, true );
|
||||
|
||||
QPen p;
|
||||
p.setBrush( brush() );
|
||||
painter->setPen( p );
|
||||
painter->setBrush( Qt::NoBrush );
|
||||
|
||||
int prevWidth = 0;
|
||||
for( int i = 0; i < m_text.size(); ++i ) {
|
||||
QChar ch = m_text[ i ];
|
||||
@@ -215,7 +203,6 @@ void QLightRoundTextItem::paint( QPainter *painter, const QStyleOptionGraphicsIt
|
||||
trans.reset();
|
||||
trans.rotateRadians( m_outside ? d : -d );
|
||||
painter->setWorldTransform( trans, true );
|
||||
|
||||
prevWidth = mcs.width( ch );
|
||||
|
||||
painter->drawText( int( -prevWidth / 2.0 ),
|
||||
@@ -252,8 +239,7 @@ QString QShapeControllerRoundText::menuName() const
|
||||
|
||||
QGraphicsItem *QShapeControllerRoundText::create() const
|
||||
{
|
||||
QLightRoundTextItem *item = new QLightRoundTextItem;
|
||||
return item;
|
||||
return new QLightRoundTextItem;
|
||||
}
|
||||
|
||||
QItemDialog *QShapeControllerRoundText::createDialog( QWidget *parent ) const
|
||||
|
||||
+25
-77
@@ -202,66 +202,6 @@ bool QLightScribe::clReportLabelTimeEstimate(long time)
|
||||
}
|
||||
|
||||
|
||||
|
||||
namespace {
|
||||
class AutoUidSetter {
|
||||
public:
|
||||
AutoUidSetter() : m_saved( 0 ) {}
|
||||
AutoUidSetter( uid_t userId ) : m_saved( 0 ) { set( userId ); }
|
||||
~AutoUidSetter() { unset(); }
|
||||
|
||||
void set( uid_t userId )
|
||||
{
|
||||
if( userId ) {
|
||||
setreuid( userId, 0 );
|
||||
m_saved = userId;
|
||||
}
|
||||
}
|
||||
void unset()
|
||||
{
|
||||
if( m_saved ) {
|
||||
setreuid( 0, m_saved );
|
||||
m_saved = 0;
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
uid_t m_saved;
|
||||
};
|
||||
|
||||
typedef void (LightScribe::DiscPrinter::*DiscPrinterOp)();
|
||||
|
||||
template<DiscPrinterOp dlock, DiscPrinterOp dunlock >
|
||||
class AutoOp {
|
||||
public:
|
||||
AutoOp( LightScribe::DiscPrinter &printer ) : m_printer( &printer ), m_locked( false ) {}
|
||||
AutoOp() { unlock(); }
|
||||
|
||||
void lock()
|
||||
{
|
||||
if( !m_locked ) {
|
||||
(m_printer->*dlock)();
|
||||
m_locked = true;
|
||||
}
|
||||
}
|
||||
|
||||
void unlock()
|
||||
{
|
||||
if( m_locked ) {
|
||||
try {
|
||||
(m_printer->*dunlock)();
|
||||
}
|
||||
catch(...){}
|
||||
m_locked = false;
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
LightScribe::DiscPrinter *m_printer;
|
||||
bool m_locked;
|
||||
};
|
||||
}
|
||||
|
||||
extern uid_t realUserId;
|
||||
|
||||
void QLightScribe::run()
|
||||
@@ -317,17 +257,12 @@ void QLightScribe::run()
|
||||
throw tr( "Cannot find drive: \"" ) + m_task->m_selectedDrive->displayName() + "\"";
|
||||
|
||||
DiscPrinter printer = printers.Item( found );
|
||||
|
||||
AutoUidSetter autoUid;
|
||||
AutoOp< &DiscPrinter::AddExclusiveUse, &DiscPrinter::ReleaseExclusiveUse > autoExclusive( printer );
|
||||
AutoOp< &DiscPrinter::LockDriveTray, &DiscPrinter::UnlockDriveTray > autoLock( printer );
|
||||
|
||||
if( m_task->m_action == Task::print ) {
|
||||
autoUid.set( realUserId );
|
||||
setreuid( realUserId, 0 );
|
||||
function = "LS_DiscPrinter_AddExclusiveUse";
|
||||
autoExclusive.lock();
|
||||
printer.AddExclusiveUse();
|
||||
function = "LS_DiscPrinter_LockDriveTray";
|
||||
autoLock.lock();
|
||||
printer.LockDriveTray();
|
||||
}
|
||||
|
||||
{
|
||||
@@ -373,18 +308,31 @@ void QLightScribe::run()
|
||||
m_task = 0;
|
||||
lock.unlock();
|
||||
// print here
|
||||
session.PrintDisc( LS_windows_bitmap,
|
||||
LS_LabelMode( params.m_labelMode ),
|
||||
LS_DrawOptions( params.m_drawOptions ),
|
||||
LS_PrintQuality( params.m_printQuality ),
|
||||
LS_MediaOptimizationLevel( params.m_mediaOptimizationLevel ),
|
||||
ba.data() + 14,
|
||||
bitmapHeaderSize - 14,
|
||||
ba.data() + bitmapHeaderSize,
|
||||
ba.size() - bitmapHeaderSize );
|
||||
try {
|
||||
session.PrintDisc( LS_windows_bitmap,
|
||||
LS_LabelMode( params.m_labelMode ),
|
||||
LS_DrawOptions( params.m_drawOptions ),
|
||||
LS_PrintQuality( params.m_printQuality ),
|
||||
LS_MediaOptimizationLevel( params.m_mediaOptimizationLevel ),
|
||||
ba.data() + 14,
|
||||
bitmapHeaderSize - 14,
|
||||
ba.data() + bitmapHeaderSize,
|
||||
ba.size() - bitmapHeaderSize );
|
||||
}
|
||||
catch( LightScribe::LSException &ex ) {
|
||||
emit finished( ex.GetCode() );
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( m_task->m_action == Task::print ) {
|
||||
function = "LS_DiscPrinter_UnlockDriveTray";
|
||||
printer.UnlockDriveTray();
|
||||
function = "LS_DiscPrinter_ReleaseExclusiveUse";
|
||||
printer.ReleaseExclusiveUse();
|
||||
setreuid( 0, realUserId );
|
||||
}
|
||||
function = "";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,10 +53,7 @@ QString QShapeControllerText::menuName() const
|
||||
|
||||
QGraphicsItem *QShapeControllerText::create() const
|
||||
{
|
||||
QGraphicsItem *item = new QLightTextItem;
|
||||
item->setTransform( QTransform().scale( 0.5, 0.5 ), true );
|
||||
|
||||
return item;
|
||||
return new QLightTextItem;
|
||||
}
|
||||
|
||||
QItemDialog *QShapeControllerText::createDialog( QWidget *parent ) const
|
||||
|
||||
Reference in New Issue
Block a user