Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3f8db94113 |
+2
-2
@@ -26,10 +26,10 @@ SET( FINAL_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX} CACHE PATH "Final install path
|
||||
SET( CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake )
|
||||
|
||||
SET( QLSCRIBE_DBUS_SERVICE org.lightscribe )
|
||||
SET( QLSCRIBE_DBUS_MANAGER_SERVICE ${QLSCRIBE_DBUS_SERVICE}.printManager )
|
||||
SET( QLSCRIBE_DBUS_MANAGER_SERVICE ${QLSCRIBE_DBUS_SERVICE}.Manager )
|
||||
SET( QLSCRIBE_DBUS_DRIVES_SERVICE ${QLSCRIBE_DBUS_SERVICE}.drives )
|
||||
SET( QLSCRIBE_DBUS_PATH /org/lightscribe )
|
||||
SET( QLSCRIBE_DBUS_MANAGER_PATH ${QLSCRIBE_DBUS_PATH}/printManager ) # path to manager
|
||||
SET( QLSCRIBE_DBUS_MANAGER_PATH ${QLSCRIBE_DBUS_PATH}/Manager ) # path to manager
|
||||
SET( QLSCRIBE_DBUS_DRIVES_PATH ${QLSCRIBE_DBUS_PATH}/drives ) # base path under which drives located
|
||||
|
||||
SUBDIRS( src )
|
||||
|
||||
@@ -1,13 +1,5 @@
|
||||
NEWS - list of user-visible changes between releases of qlscribe
|
||||
|
||||
New in 0.12:
|
||||
Fixed bug for round text not updating last used font
|
||||
Main window stores/restores position and size from/to config
|
||||
Round text changes radius and angle when dragged by mouse instead of moving the center
|
||||
Added ability to open image as a document
|
||||
Bugfix for labels opened from commandline not updating menu
|
||||
Bugfix for not properly drawing partially covered window background
|
||||
|
||||
New in 0.11:
|
||||
Application settings added with default font to use and option to eject media
|
||||
Added functionality to eject media after print
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
#
|
||||
# $Id$
|
||||
|
||||
FIND_PATH( LSCRIBE_INCLUDE_DIR lightscribe.h /usr/local/include /usr/include/lightscribe $ENV{LIGHTSCRIBEDIR}/include )
|
||||
FIND_PATH( LSCRIBE_INCLUDE_DIR lightscribe.h /usr/local/include /usr/include/lightsribe $ENV{LIGHTSCRIBEDIR}/include )
|
||||
|
||||
FIND_LIBRARY( LSCRIBE_LIBRARY lightscribe /usr/local/lib /opt/lightscribe/lib /opt/lightscribe/lib32 $ENV{LIGHTSCRIBEDIR}/lib )
|
||||
|
||||
|
||||
Vendored
+1
-3
@@ -1,6 +1,4 @@
|
||||
qlscribe (0.13-0ubuntu1) unstable; urgency=low
|
||||
* Release 0.13 imported
|
||||
* Release 0.12 imported
|
||||
qlscribe (0.11-0ubuntu1) unstable; urgency=low
|
||||
* Release 0.11 imported
|
||||
* Release 0.10 imported
|
||||
* Release 0.9 imported
|
||||
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
/usr/share/dbus-1/system-services/org.lightscribe.printManager.service
|
||||
/usr/share/dbus-1/services/org.lightscribe.Manager.service
|
||||
|
||||
Vendored
+2
-1
@@ -2,7 +2,8 @@
|
||||
set -e
|
||||
|
||||
if [ "$1" = "remove" -o "$1" = "upgrade" ] ; then
|
||||
if PID=`pidof lscribed` ; then
|
||||
PID=`pidof lscribed`
|
||||
if [ "X$PID" != "X" ] ; then
|
||||
kill $PID
|
||||
fi
|
||||
fi
|
||||
|
||||
Vendored
+1
-1
@@ -17,7 +17,7 @@ configure-stamp:
|
||||
cd build; cmake .. -DCMAKE_INSTALL_PREFIX=$(CURDIR)/debian/qlscribe/usr \
|
||||
-DFINAL_INSTALL_PREFIX=/usr \
|
||||
-DDBUS_SYSTEM_POLICY_DIR=$(CURDIR)/debian/qlscribe/etc/dbus-1/system.d \
|
||||
-DDBUS_SYSTEM_SERVICE_DIR=$(CURDIR)/debian/qlscribe/usr/share/dbus-1/system-services
|
||||
-DDBUS_SYSTEM_SERVICE_DIR=$(CURDIR)/debian/qlscribe/usr/share/dbus-1/services
|
||||
|
||||
build: build-stamp
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ FIND_PACKAGE( Dbus32 REQUIRED )
|
||||
FIND_PACKAGE( LightScribe REQUIRED )
|
||||
|
||||
SET( LSCRIBED_CONF_FILE ${CMAKE_CURRENT_BINARY_DIR}/lightscribe.conf )
|
||||
SET( LSCRIBED_SERVICE_FILE ${CMAKE_CURRENT_BINARY_DIR}/${QLSCRIBE_DBUS_SERVICE}.printManager.service )
|
||||
SET( LSCRIBED_SERVICE_FILE ${CMAKE_CURRENT_BINARY_DIR}/${QLSCRIBE_DBUS_SERVICE}.Manager.service )
|
||||
|
||||
CONFIGURE_FILE( ${CMAKE_CURRENT_SOURCE_DIR}/lscribed.h.in ${CMAKE_CURRENT_BINARY_DIR}/lscribed.h @ONLY )
|
||||
CONFIGURE_FILE( ${CMAKE_CURRENT_SOURCE_DIR}/lightscribe.conf.in ${LSCRIBED_CONF_FILE} @ONLY )
|
||||
|
||||
@@ -45,7 +45,7 @@ DBusHandlerResult IntrospectHandler::processMessage( const Message &msg )
|
||||
std::string( DBusManagerPath + pathlen, sublen )
|
||||
+ "\"/>";
|
||||
} else
|
||||
introspect += "<node name=\"printManager\"/><node name=\"drives\"/>";
|
||||
introspect += "<node name=\"Manager\"/><node name=\"drives\"/>";
|
||||
}
|
||||
introspect += "</node>";
|
||||
|
||||
|
||||
@@ -7,12 +7,15 @@
|
||||
<!-- Only root can own the service -->
|
||||
<policy user="root">
|
||||
<allow own="@QLSCRIBE_DBUS_MANAGER_SERVICE@"/>
|
||||
<allow send_interface="@QLSCRIBE_DBUS_MANAGER_SERVICE@"/>
|
||||
<allow send_interface="@QLSCRIBE_DBUS_DRIVES_SERVICE@"/>
|
||||
</policy>
|
||||
|
||||
<!-- Allow anyone to invoke methods on the interfaces -->
|
||||
<policy context="default">
|
||||
<allow send_destination="@QLSCRIBE_DBUS_MANAGER_SERVICE@"/>
|
||||
<allow send_destination="@QLSCRIBE_DBUS_DRIVES_SERVICE@"/>
|
||||
<allow send_interface="@QLSCRIBE_DBUS_MANAGER_SERVICE@"/>
|
||||
<allow send_interface="@QLSCRIBE_DBUS_DRIVES_SERVICE@"/>
|
||||
<allow receive_interface="@QLSCRIBE_DBUS_DRIVES_SERVICE@"/>
|
||||
</policy>
|
||||
|
||||
</busconfig>
|
||||
|
||||
+4
-27
@@ -40,8 +40,6 @@
|
||||
#include <QCloseEvent>
|
||||
#include <QApplication>
|
||||
#include <QClipboard>
|
||||
#include <QSettings>
|
||||
#include <QImageReader>
|
||||
|
||||
|
||||
MainWindow::MainWindow( bool enablePrint )
|
||||
@@ -175,13 +173,6 @@ MainWindow::MainWindow( bool enablePrint )
|
||||
this, SLOT(updateMenu()) );
|
||||
|
||||
updateMenu();
|
||||
|
||||
QSettings settings;
|
||||
|
||||
settings.beginGroup( "MainWindow");
|
||||
resize( settings.value( "size", QSize(800, 400) ).toSize() );
|
||||
move( settings.value( "pos", QPoint(200, 200) ).toPoint() );
|
||||
settings.endGroup();
|
||||
}
|
||||
|
||||
MainWindow::~MainWindow()
|
||||
@@ -199,8 +190,6 @@ void MainWindow::open( const QStringList &files )
|
||||
delete newView;
|
||||
continue;
|
||||
}
|
||||
connect( scene, SIGNAL(selectionChanged()), this, SLOT(updateMenu()) );
|
||||
connect( scene, SIGNAL(changed()), this, SLOT(updateMenu()) );
|
||||
|
||||
QMdiSubWindow *subWindow = m_mdiArea->addSubWindow( newView );
|
||||
subWindow->show();
|
||||
@@ -266,13 +255,6 @@ bool MainWindow::saveScene( QCDScene *scene )
|
||||
return;
|
||||
}
|
||||
}
|
||||
QSettings settings;
|
||||
|
||||
settings.beginGroup( "MainWindow" );
|
||||
settings.setValue( "size", size());
|
||||
settings.setValue( "pos", pos());
|
||||
settings.endGroup();
|
||||
|
||||
event->accept();
|
||||
}
|
||||
|
||||
@@ -323,23 +305,18 @@ void MainWindow::onMenuInsert( int id )
|
||||
return;
|
||||
}
|
||||
|
||||
item->setFlag( QGraphicsItem::ItemIsMovable, true );
|
||||
item->setFlag( QGraphicsItem::ItemIsSelectable, true );
|
||||
cdscene->addItem( item );
|
||||
cdscene->setChanged();
|
||||
}
|
||||
|
||||
void MainWindow::onMenuOpen()
|
||||
{
|
||||
QString filter( tr("qlscribe document (*.qlx)\nImages ( ") );
|
||||
QList<QByteArray> list = QImageReader::supportedImageFormats();
|
||||
foreach( QByteArray arr, list ) {
|
||||
filter += QString( "*." ) + arr.data() + " ";
|
||||
}
|
||||
filter += tr( ")\nAll Files (*)" );
|
||||
|
||||
QString fileName = QFileDialog::getOpenFileName( this,
|
||||
tr( "Open:" ),
|
||||
QString(),
|
||||
filter );
|
||||
tr("qlscribe document (*.qlx)") );
|
||||
|
||||
if( fileName.isNull() )
|
||||
return;
|
||||
@@ -460,7 +437,7 @@ void MainWindow::onMenuAbout()
|
||||
QMessageBox::about( this,
|
||||
tr( "About" ),
|
||||
tr( "<h3>qlscribe - Qt lisghtScribe</h3>"
|
||||
"<p>release 0.13 $Revision$</p>"
|
||||
"<p>release 0.11 $Revision$</p>"
|
||||
"<p>visit project at home page "
|
||||
"<a href=\"http://qlscribe.sourceforge.net/\">qlscribe.sourceforge.net</a></p>" ) );
|
||||
}
|
||||
|
||||
+22
-46
@@ -20,7 +20,6 @@
|
||||
|
||||
#include "qcdscene.h"
|
||||
#include "qshapefactory.h"
|
||||
#include "qlightpixmapitem.h"
|
||||
|
||||
#include <QMenu>
|
||||
#include <QMessageBox>
|
||||
@@ -35,7 +34,6 @@
|
||||
#include <QApplication>
|
||||
#include <QClipboard>
|
||||
#include <QMimeData>
|
||||
#include <QRegExp>
|
||||
|
||||
QCDScene::QCDScene( QObject * parent )
|
||||
: QGraphicsScene( parent ),
|
||||
@@ -83,53 +81,31 @@ void QCDScene::start( LabelMode mode )
|
||||
|
||||
bool QCDScene::load( const QString &fileName, QString *errMessage )
|
||||
{
|
||||
if( QRegExp( ".*.\\.qlx$", Qt::CaseInsensitive ).exactMatch( fileName ) ) {
|
||||
QFile file( fileName );
|
||||
if( !file.open( QIODevice::ReadOnly | QIODevice::Text ) ) {
|
||||
if( errMessage )
|
||||
*errMessage = "cannot open file for reading";
|
||||
else
|
||||
QMessageBox::critical( 0, tr( "Error" ), tr( "Cannot open file for reading\n" ) + fileName );
|
||||
return false;
|
||||
}
|
||||
QXmlStreamReader reader( &file );
|
||||
try {
|
||||
read( reader );
|
||||
}
|
||||
catch( const QString &err ) {
|
||||
if( errMessage )
|
||||
*errMessage = err;
|
||||
else
|
||||
QMessageBox::critical( 0, tr( "Error" ), tr( "Cannot read file " ) + fileName + "\n" + err );
|
||||
return false;
|
||||
}
|
||||
m_fileName = fileName;
|
||||
m_saved = true;
|
||||
setName();
|
||||
|
||||
pushUndo();
|
||||
return true;
|
||||
}
|
||||
QShapeFactory &sfactory = QShapeFactory::instance();
|
||||
QLightPixmapItem *item =
|
||||
static_cast<QLightPixmapItem *>(sfactory.create( QShapeControllerPixmap::Type ) );
|
||||
addItem( item );
|
||||
if( item->loadImage( fileName ) ) {
|
||||
QSize size = item->pixmap().size();
|
||||
item->setOffset( -QPointF( size.height(), size.width() ) / 2.0 );
|
||||
item->setTransform( QTransform().scale( size.width() ? 120.0 / size.width() : 1.0,
|
||||
size.height() ? 120.0 / size.height() : 1.0 ) );
|
||||
setName();
|
||||
pushUndo();
|
||||
return true;
|
||||
} else {
|
||||
QFile file( fileName );
|
||||
if( !file.open( QIODevice::ReadOnly | QIODevice::Text ) ) {
|
||||
if( errMessage )
|
||||
*errMessage = "cannot load image";
|
||||
*errMessage = "cannot open file for reading";
|
||||
else
|
||||
QMessageBox::critical( 0, tr( "Error" ), tr( "Cannot load image " ) +
|
||||
fileName + "\n" );
|
||||
QMessageBox::critical( 0, tr( "Error" ), tr( "Cannot open file for reading\n" ) + fileName );
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
QXmlStreamReader reader( &file );
|
||||
try {
|
||||
read( reader );
|
||||
}
|
||||
catch( const QString &err ) {
|
||||
if( errMessage )
|
||||
*errMessage = err;
|
||||
else
|
||||
QMessageBox::critical( 0, tr( "Error" ), tr( "Cannot read file " ) + fileName + "\n" + err );
|
||||
return false;
|
||||
}
|
||||
m_fileName = fileName;
|
||||
m_saved = true;
|
||||
setName();
|
||||
|
||||
pushUndo();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
+2
-3
@@ -147,19 +147,18 @@ void QCDView::drawForeground ( QPainter * painter, const QRectF & rect )
|
||||
m_labelMode = cdscene->labelMode();
|
||||
|
||||
*m_mask = QPixmap( frameSize() );
|
||||
QRectF rectf( QPointF( -frameSize().width(), -frameSize().height() ), frameSize() * 2 );
|
||||
|
||||
{
|
||||
QPainter paint( m_mask );
|
||||
paint.setWorldTransform( painter->transform() );
|
||||
drawCD( &paint, rectf, false );
|
||||
drawCD( &paint, rect, false );
|
||||
}
|
||||
|
||||
{
|
||||
QPixmap alpha( frameSize() );
|
||||
QPainter paint( &alpha );
|
||||
paint.setWorldTransform( painter->transform() );
|
||||
drawCD( &paint, rectf, true );
|
||||
drawCD( &paint, rect, true );
|
||||
m_mask->setAlphaChannel( alpha );
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
#include "ui_qdialogroundtext.h"
|
||||
#include "qlightroundtextitem.h"
|
||||
#include "qcdscene.h"
|
||||
#include "qdialogsettings.h"
|
||||
|
||||
#include <QFontDialog>
|
||||
#include <QColorDialog>
|
||||
@@ -133,7 +132,6 @@ void QDialogRoundText::onFont()
|
||||
//font.setPointSizeF( font.pointSizeF() / 2.0 );
|
||||
if( ok ) {
|
||||
m_item->setFont( font );
|
||||
QDialogSettings::setLastUsedFont( font );
|
||||
fontChanged();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,17 +29,6 @@ QLightPixmapItem::QLightPixmapItem()
|
||||
{
|
||||
}
|
||||
|
||||
bool QLightPixmapItem::loadImage( const QString &name )
|
||||
{
|
||||
QPixmap pixmap( name );
|
||||
if( pixmap.isNull() )
|
||||
return false;
|
||||
m_imageName = name;
|
||||
setPixmap( pixmap );
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
QVariant QLightPixmapItem::itemChange( GraphicsItemChange change, const QVariant & value )
|
||||
{
|
||||
if( scene() && change == ItemPositionHasChanged )
|
||||
|
||||
@@ -25,11 +25,11 @@
|
||||
|
||||
#include "qshapefactory.h"
|
||||
|
||||
class QLightPixmapItem : public QGraphicsPixmapItem {
|
||||
class QLightPixmapItem : public QGraphicsPixmapItem
|
||||
{
|
||||
public:
|
||||
QLightPixmapItem();
|
||||
|
||||
bool loadImage( const QString &name );
|
||||
void imageName( const QString &name ) { m_imageName = name; }
|
||||
const QString &imageName() const { return m_imageName; }
|
||||
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
#include <QMessageBox>
|
||||
#include <QXmlStreamWriter>
|
||||
#include <QTextLayout>
|
||||
#include <QGraphicsSceneMouseEvent>
|
||||
|
||||
#include <math.h>
|
||||
|
||||
@@ -232,37 +231,13 @@ void QLightRoundTextItem::paint( QPainter *painter, const QStyleOptionGraphicsIt
|
||||
}
|
||||
}
|
||||
|
||||
inline
|
||||
double distance( const QPointF &p1, const QPointF &p2 )
|
||||
QVariant QLightRoundTextItem::itemChange( GraphicsItemChange change, const QVariant & value )
|
||||
{
|
||||
QPointF d = p1 - p2;
|
||||
return sqrt( d.x() * d.x() + d.y() * d.y() );
|
||||
}
|
||||
|
||||
inline
|
||||
double angle( const QPointF &p1, const QPointF &p2 )
|
||||
{
|
||||
QPointF d = p1 - p2;
|
||||
return atan2( d.y(), d.x() ) * 180.0 / 3.14159;
|
||||
}
|
||||
|
||||
void QLightRoundTextItem::mouseMoveEvent( QGraphicsSceneMouseEvent *event )
|
||||
{
|
||||
if( event->buttons() & Qt::LeftButton ) {
|
||||
double dradi = distance( scenePos(), event->lastScenePos() ) - distance( scenePos(), event->scenePos() );
|
||||
double dangle = ::angle( scenePos(), event->lastScenePos() ) - ::angle( scenePos(), event->scenePos() );
|
||||
|
||||
prepareGeometryChange();
|
||||
m_radius -= dradi;
|
||||
m_angle -= dangle;
|
||||
if( m_angle > 360.0 ) m_angle -= 360.0;
|
||||
if( m_angle < 0.0 ) m_angle += 360.0;
|
||||
|
||||
if( scene() && change == ItemPositionHasChanged )
|
||||
static_cast<QCDScene *>( scene() )->itemMoved();
|
||||
} else
|
||||
event->ignore();
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
RegisterController< QShapeControllerRoundText > regControllerRoundText;
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ public:
|
||||
virtual int type() const { return Type; }
|
||||
|
||||
protected:
|
||||
virtual void mouseMoveEvent( QGraphicsSceneMouseEvent *event );
|
||||
virtual QVariant itemChange ( GraphicsItemChange change, const QVariant & value );
|
||||
|
||||
private:
|
||||
QFont m_font;
|
||||
|
||||
@@ -118,13 +118,7 @@ QString QShapeFactory::name( int type ) const
|
||||
QGraphicsItem *QShapeFactory::create( int type ) const
|
||||
{
|
||||
QShapeController *ctrl = getController( type );
|
||||
if( !ctrl ) return 0;
|
||||
QGraphicsItem *item = ctrl->create();
|
||||
if( item ) {
|
||||
item->setFlag( QGraphicsItem::ItemIsMovable, true );
|
||||
item->setFlag( QGraphicsItem::ItemIsSelectable, true );
|
||||
}
|
||||
return item;
|
||||
return ctrl ? ctrl->create() : 0;
|
||||
}
|
||||
|
||||
bool QShapeFactory::edit( QGraphicsItem *item, QWidget *parent ) const
|
||||
|
||||
Reference in New Issue
Block a user