Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c6729c6970 | |||
| 716c35655a | |||
| f856d58660 | |||
| a69001b273 | |||
| f7dbf18fb3 | |||
| df16dfcc47 | |||
| 000135760b | |||
| d3e38888b2 |
@@ -1,5 +1,13 @@
|
||||
NEWS - list of user-visible changes between releases of qlscribe
|
||||
|
||||
New in 0.14
|
||||
Added Software Render for preview to make preview when no drive is available
|
||||
Items have Z coordinate set to remove ambiguity
|
||||
Saves from previous versions will have Z coordinate of items reordered on load
|
||||
|
||||
New in 0.13:
|
||||
Fixes in dbus config for Ubuntu Jaunty
|
||||
|
||||
New in 0.12:
|
||||
Fixed bug for round text not updating last used font
|
||||
Main window stores/restores position and size from/to config
|
||||
|
||||
Vendored
+2
-1
@@ -1,4 +1,5 @@
|
||||
qlscribe (0.13-0ubuntu1) unstable; urgency=low
|
||||
qlscribe (0.14-0ubuntu1) unstable; urgency=low
|
||||
* Release 0.14 imported
|
||||
* Release 0.13 imported
|
||||
* Release 0.12 imported
|
||||
* Release 0.11 imported
|
||||
|
||||
Vendored
+1
-1
@@ -8,6 +8,6 @@ Homepage: http://qlscribe.sourceforge.net/
|
||||
|
||||
Package: qlscribe
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends}, lightscribe
|
||||
Depends: ${shlibs:Depends}
|
||||
Description: Qt based application to print lightScribe discs
|
||||
Qt lightScribe is a GUI application to burn labels on lightScribe capable drives.
|
||||
|
||||
Vendored
+2
-2
@@ -9,7 +9,7 @@ Upstream Author(s):
|
||||
|
||||
Copyright:
|
||||
|
||||
<Copyright (C) 2009 Vyacheslav Kononenko>
|
||||
<Copyright (C) 2009-2010 Vyacheslav Kononenko>
|
||||
|
||||
License:
|
||||
|
||||
@@ -30,7 +30,7 @@ License:
|
||||
On Debian systems, the complete text of the GNU General
|
||||
Public License can be found in `/usr/share/common-licenses/GPL'.
|
||||
|
||||
The Debian packaging is (C) 2009, Vyacheslav Kononenko <vyacheslav@kononenko.net> and
|
||||
The Debian packaging is (C) 2009-2010, Vyacheslav Kononenko <vyacheslav@kononenko.net> and
|
||||
is licensed under the GPL, see above.
|
||||
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -2,7 +2,7 @@
|
||||
set -e
|
||||
|
||||
if [ "$1" = "configure" ] ; then
|
||||
/etc/init.d/dbus reload
|
||||
invoke-rc.d dbus reload
|
||||
fi
|
||||
|
||||
#DEBHELPER#
|
||||
|
||||
Vendored
+1
-1
@@ -8,7 +8,7 @@ if [ "$1" = "remove" -o "$1" = "upgrade" ] ; then
|
||||
fi
|
||||
|
||||
if [ "$1" = "remove" ] ; then
|
||||
/etc/init.d/dbus reload
|
||||
invoke-rc.d dbus reload
|
||||
fi
|
||||
|
||||
#DEBHELPER#
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#define DBUSCPP_H
|
||||
|
||||
#include <dbus/dbus.h>
|
||||
#include <stdint.h>
|
||||
#include <string>
|
||||
#include <map>
|
||||
|
||||
|
||||
+90
-11
@@ -42,6 +42,7 @@
|
||||
#include <QClipboard>
|
||||
#include <QSettings>
|
||||
#include <QImageReader>
|
||||
#include <QPicture>
|
||||
|
||||
|
||||
MainWindow::MainWindow( bool enablePrint )
|
||||
@@ -323,7 +324,7 @@ void MainWindow::onMenuInsert( int id )
|
||||
return;
|
||||
}
|
||||
|
||||
cdscene->addItem( item );
|
||||
cdscene->addItem( item, true );
|
||||
cdscene->setChanged();
|
||||
}
|
||||
|
||||
@@ -380,6 +381,24 @@ void MainWindow::onMenuProperties()
|
||||
QDialogCDProperties::exec( this, scene );
|
||||
}
|
||||
|
||||
namespace {
|
||||
const int bigImageSize = 1600;
|
||||
}
|
||||
|
||||
inline
|
||||
void drawCircle( QPainter &painter, double radi )
|
||||
{
|
||||
const int half = bigImageSize / 2;
|
||||
painter.drawEllipse( QRectF( half - radi, half - radi, radi * 2, radi * 2 ) );
|
||||
}
|
||||
|
||||
inline
|
||||
void drawCircle( QPainterPath &path, double radi )
|
||||
{
|
||||
const int half = bigImageSize / 2;
|
||||
path.addEllipse( QRectF( half - radi, half - radi, radi * 2, radi * 2 ) );
|
||||
}
|
||||
|
||||
void MainWindow::onMenuPrintPreview()
|
||||
{
|
||||
QCDScene *cdscene = getScene( m_mdiArea );
|
||||
@@ -388,21 +407,81 @@ void MainWindow::onMenuPrintPreview()
|
||||
|
||||
PrintParameters params;
|
||||
params.m_labelMode = cdscene->labelMode();
|
||||
QLightDrive *drive = QDialogPrint::exec( this, params );
|
||||
if( !drive )
|
||||
QPair< bool, QLightDrive * > bd = QDialogPrint::exec( this, params, true );
|
||||
if( !bd.first )
|
||||
return;
|
||||
|
||||
try {
|
||||
QPixmap pixmap = drive->preview( params, cdscene, QSize( 400, 400 ) );
|
||||
if( !bd.second ) {
|
||||
// software "rendering"
|
||||
QPixmap image( bigImageSize, bigImageSize );
|
||||
image.fill( 0xFFFFFFFF );
|
||||
|
||||
cdscene->clearSelection();
|
||||
{
|
||||
QPainter painter( &image );
|
||||
QColor circleColor( 0xd8, 0xd8, 0xd8 );
|
||||
painter.setPen( circleColor );
|
||||
painter.setBrush( circleColor );
|
||||
drawCircle( painter, bigImageSize / 2 );
|
||||
|
||||
cdscene->render( &painter, image.rect() );
|
||||
|
||||
QPainterPath p1;
|
||||
p1.addRect( image.rect() );
|
||||
{
|
||||
QPainterPath p2;
|
||||
drawCircle( p2, bigImageSize / 2 );
|
||||
painter.setClipPath( p1.subtracted( p2 ) );
|
||||
painter.fillRect( image.rect(), Qt::white );
|
||||
painter.setClipPath( p1 );
|
||||
}
|
||||
|
||||
painter.setBrush( circleColor );
|
||||
|
||||
if( params.m_labelMode == modeTitle ) {
|
||||
// 3.22
|
||||
QPainterPath p2;
|
||||
drawCircle( p2, bigImageSize / 3.20 );
|
||||
painter.setClipPath( p1.subtracted( p2 ) );
|
||||
drawCircle( painter, bigImageSize / 2 );
|
||||
// 3.74
|
||||
painter.setClipPath( p1 );
|
||||
drawCircle( painter, bigImageSize / 3.74 );
|
||||
} else
|
||||
if( params.m_labelMode == modeContent ) {
|
||||
// 3.22
|
||||
QPainterPath p2;
|
||||
drawCircle( p2, bigImageSize / 3.20 );
|
||||
painter.setClipPath( p1.subtracted( p2 ) );
|
||||
drawCircle( painter, bigImageSize / 2 );
|
||||
|
||||
// 4.69
|
||||
painter.setClipPath( p1 );
|
||||
drawCircle( painter, bigImageSize / 4.69 );
|
||||
}
|
||||
|
||||
painter.setBrush( Qt::white );
|
||||
drawCircle( painter, bigImageSize / 4.93 );
|
||||
}
|
||||
QLabel *label = new QLabel;
|
||||
label->setPixmap( pixmap );
|
||||
label->setPixmap( image.scaled( QSize( 400, 400 ) ) );
|
||||
|
||||
QMdiSubWindow *subWindow = m_mdiArea->addSubWindow( label );
|
||||
subWindow->setWindowTitle( "Preview: " + cdscene->name() );
|
||||
subWindow->setWindowTitle( "Software preview: " + cdscene->name() );
|
||||
subWindow->show();
|
||||
}
|
||||
catch( const QString &err ) {
|
||||
QMessageBox::critical( this, tr( "Error on print preview" ), err );
|
||||
|
||||
} else {
|
||||
try {
|
||||
QPixmap pixmap = bd.second->preview( params, cdscene, QSize( 400, 400 ) );
|
||||
QLabel *label = new QLabel;
|
||||
label->setPixmap( pixmap );
|
||||
QMdiSubWindow *subWindow = m_mdiArea->addSubWindow( label );
|
||||
subWindow->setWindowTitle( "Preview: " + cdscene->name() );
|
||||
subWindow->show();
|
||||
}
|
||||
catch( const QString &err ) {
|
||||
QMessageBox::critical( this, tr( "Error on print preview" ), err );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -460,7 +539,7 @@ void MainWindow::onMenuAbout()
|
||||
QMessageBox::about( this,
|
||||
tr( "About" ),
|
||||
tr( "<h3>qlscribe - Qt lisghtScribe</h3>"
|
||||
"<p>release 0.13 $Revision$</p>"
|
||||
"<p>release 0.14 $Revision$</p>"
|
||||
"<p>visit project at home page "
|
||||
"<a href=\"http://qlscribe.sourceforge.net/\">qlscribe.sourceforge.net</a></p>" ) );
|
||||
}
|
||||
|
||||
+37
-5
@@ -108,12 +108,29 @@ bool QCDScene::load( const QString &fileName, QString *errMessage )
|
||||
setName();
|
||||
|
||||
pushUndo();
|
||||
|
||||
QList<QGraphicsItem *> list = items();
|
||||
bool oldFormat = true;
|
||||
foreach(QGraphicsItem *item, list ) {
|
||||
if( item->zValue() != 0.0 ) {
|
||||
oldFormat = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if( oldFormat ) {
|
||||
double z = 1.0;
|
||||
foreach(QGraphicsItem *item, list ) {
|
||||
item->setZValue( z );
|
||||
z += 0.1;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
QShapeFactory &sfactory = QShapeFactory::instance();
|
||||
QLightPixmapItem *item =
|
||||
static_cast<QLightPixmapItem *>(sfactory.create( QShapeControllerPixmap::Type ) );
|
||||
addItem( item );
|
||||
addItem( item, true );
|
||||
if( item->loadImage( fileName ) ) {
|
||||
QSize size = item->pixmap().size();
|
||||
item->setOffset( -QPointF( size.height(), size.width() ) / 2.0 );
|
||||
@@ -261,8 +278,22 @@ void QCDScene::write( QXmlStreamWriter &writer )
|
||||
writer.writeEndDocument();
|
||||
}
|
||||
|
||||
void QCDScene::addItem( QGraphicsItem *item, bool top )
|
||||
{
|
||||
if( top ) {
|
||||
double topZ = 1.0;
|
||||
QList<QGraphicsItem *> list = items();
|
||||
foreach(QGraphicsItem *item, list ) {
|
||||
if( item->zValue() >= topZ )
|
||||
topZ = item->zValue() + 0.1;
|
||||
}
|
||||
item->setZValue( topZ );
|
||||
}
|
||||
QGraphicsScene::addItem( item );
|
||||
}
|
||||
|
||||
bool QCDScene::readItem( QXmlStreamReader &reader )
|
||||
|
||||
bool QCDScene::readItem( QXmlStreamReader &reader, bool top )
|
||||
{
|
||||
QShapeFactory &sfactory = QShapeFactory::instance();
|
||||
|
||||
@@ -279,7 +310,7 @@ bool QCDScene::readItem( QXmlStreamReader &reader )
|
||||
if( item ) {
|
||||
item->setFlag( QGraphicsItem::ItemIsMovable, true );
|
||||
item->setFlag( QGraphicsItem::ItemIsSelectable, true );
|
||||
addItem( item );
|
||||
addItem( item, top );
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -308,7 +339,7 @@ void QCDScene::read( QXmlStreamReader &reader )
|
||||
}
|
||||
|
||||
if( elementName == "item" ) {
|
||||
readItem( reader );
|
||||
readItem( reader, false );
|
||||
} else
|
||||
throw QString( "QCDScene: unknown element \"" ) + elementName + "\"";
|
||||
}
|
||||
@@ -366,7 +397,7 @@ void QCDScene::getItemFromClipboard()
|
||||
QString elementName = reader.name().toString();
|
||||
|
||||
if( elementName == "item" ) {
|
||||
if( readItem( reader ) )
|
||||
if( readItem( reader, true ) )
|
||||
setChanged();
|
||||
}
|
||||
}
|
||||
@@ -489,3 +520,4 @@ void QCDScene::unredo( bool undo )
|
||||
}
|
||||
setChanged( false );
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -60,6 +60,7 @@ public:
|
||||
|
||||
void putItemToClipboard( bool move );
|
||||
void getItemFromClipboard();
|
||||
void addItem( QGraphicsItem *item, bool top );
|
||||
|
||||
void updateTitles() const;
|
||||
void redrawViews() const;
|
||||
@@ -82,7 +83,7 @@ private slots:
|
||||
|
||||
private:
|
||||
void write( QXmlStreamWriter &writer );
|
||||
bool readItem( QXmlStreamReader &reader );
|
||||
bool readItem( QXmlStreamReader &reader, bool top );
|
||||
void read( QXmlStreamReader &reader );
|
||||
void sendItemTo( bool front );
|
||||
void pushUndo();
|
||||
|
||||
@@ -68,7 +68,7 @@ bool QDialogPixmap::exec( QGraphicsItem *graphicsItem )
|
||||
m_item->imageName( item->imageName() );
|
||||
m_item->setTransform( item->transform() );
|
||||
|
||||
scene.addItem( m_item );
|
||||
scene.addItem( m_item, true );
|
||||
|
||||
m_ui->spinX->setValue( m_item->pos().x() );
|
||||
m_ui->spinY->setValue( m_item->pos().y() );
|
||||
|
||||
+14
-5
@@ -46,12 +46,14 @@ void QDialogPrint::changeEvent(QEvent *e)
|
||||
}
|
||||
}
|
||||
|
||||
QLightDrive *QDialogPrint::exec( QWidget *parent, PrintParameters ¶ms )
|
||||
QPair<bool, QLightDrive *> QDialogPrint::exec( QWidget *parent, PrintParameters ¶ms, bool preview )
|
||||
{
|
||||
QPair<bool, QLightDrive *> rez( false, 0 );
|
||||
|
||||
QList<QLightDrive *> drives = QLightScribe::instance()->getDrives();
|
||||
if( drives.isEmpty() ) {
|
||||
if( !preview && drives.isEmpty() ) {
|
||||
QMessageBox::critical( parent, tr( "Error" ), tr( "Cannot find any lightScribe drive" ) );
|
||||
return 0;
|
||||
return rez;
|
||||
}
|
||||
QDialogPrint dialog( parent );
|
||||
switch( params.m_labelMode ) {
|
||||
@@ -64,8 +66,11 @@ QLightDrive *QDialogPrint::exec( QWidget *parent, PrintParameters ¶ms )
|
||||
foreach( QLightDrive *drv, drives ) {
|
||||
dialog.m_ui->comboDrive->insertItem( index++, drv->displayName() );
|
||||
}
|
||||
if( preview )
|
||||
dialog.m_ui->comboDrive->insertItem( index++, tr( "Software renderer" ) );
|
||||
|
||||
if( dialog.QDialog::exec() == Rejected )
|
||||
return 0;
|
||||
return rez;
|
||||
|
||||
params = PrintParameters(); // reset to default
|
||||
|
||||
@@ -87,5 +92,9 @@ QLightDrive *QDialogPrint::exec( QWidget *parent, PrintParameters ¶ms )
|
||||
if( dialog.m_ui->radioMediaGeneric->isChecked() )
|
||||
params.m_mediaOptimizationLevel = mediaGeneric;
|
||||
|
||||
return drives.at( dialog.m_ui->comboDrive->currentIndex() );
|
||||
rez.first = true;
|
||||
if( dialog.m_ui->comboDrive->currentIndex() < drives.size() )
|
||||
rez.second = drives.at( dialog.m_ui->comboDrive->currentIndex() );
|
||||
|
||||
return rez;
|
||||
}
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ class QDialogPrint : public QDialog {
|
||||
Q_OBJECT
|
||||
Q_DISABLE_COPY(QDialogPrint)
|
||||
public:
|
||||
static QLightDrive *exec( QWidget *parent, PrintParameters ¶ms );
|
||||
static QPair<bool, QLightDrive *> exec( QWidget *parent, PrintParameters ¶ms, bool preview );
|
||||
|
||||
protected:
|
||||
explicit QDialogPrint(QWidget *parent = 0);
|
||||
|
||||
@@ -65,7 +65,7 @@ bool QDialogProgress::exec( QWidget *parent, QCDScene *scene )
|
||||
{
|
||||
PrintParameters params;
|
||||
params.m_labelMode = scene->labelMode();
|
||||
QLightDrive *drive = QDialogPrint::exec( parent, params );
|
||||
QLightDrive *drive = QDialogPrint::exec( parent, params, false ).second;
|
||||
if( !drive )
|
||||
return false;
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ bool QDialogRoundText::exec( QGraphicsItem *graphicsItem )
|
||||
m_item->setAlignment( item->alignment() );
|
||||
m_item->setOutside( item->outside() );
|
||||
|
||||
scene.addItem( m_item );
|
||||
scene.addItem( m_item, true );
|
||||
|
||||
m_ui->spinX->setValue( m_item->pos().x() );
|
||||
m_ui->spinY->setValue( m_item->pos().y() );
|
||||
|
||||
+1
-1
@@ -69,7 +69,7 @@ bool QDialogText::exec( QGraphicsItem *graphicsItem )
|
||||
m_item->setBrush( item->brush() );
|
||||
m_item->setTransform( item->transform() );
|
||||
|
||||
scene.addItem( m_item );
|
||||
scene.addItem( m_item, true );
|
||||
|
||||
m_ui->spinX->setValue( m_item->pos().x() );
|
||||
m_ui->spinY->setValue( m_item->pos().y() );
|
||||
|
||||
Reference in New Issue
Block a user