17 Commits

Author SHA1 Message Date
ruglory c67c6bc864 Tagging the 0.12 release
git-svn-id: https://svn.code.sf.net/p/qlscribe/svn/tags/release-0.12@153 cac9541e-1b8d-4bfa-827e-589bba606050
2009-04-24 00:44:48 +00:00
ruglory d32d6ab1e6 Prepared for 0.12
git-svn-id: https://svn.code.sf.net/p/qlscribe/svn/trunk@152 cac9541e-1b8d-4bfa-827e-589bba606050
2009-04-24 00:40:45 +00:00
ruglory 06b2f841dc Bugfix for not properly drawing partically covered window background
git-svn-id: https://svn.code.sf.net/p/qlscribe/svn/trunk@151 cac9541e-1b8d-4bfa-827e-589bba606050
2009-04-24 00:32:52 +00:00
ruglory b55b148cca Bugfix for error in open qlx
git-svn-id: https://svn.code.sf.net/p/qlscribe/svn/trunk@150 cac9541e-1b8d-4bfa-827e-589bba606050
2009-04-24 00:32:10 +00:00
ruglory 086181cd8f Bugfix for labels opened from commandline not updating menu
git-svn-id: https://svn.code.sf.net/p/qlscribe/svn/trunk@149 cac9541e-1b8d-4bfa-827e-589bba606050
2009-04-24 00:31:23 +00:00
ruglory 51402c10d6 Added ability to open image as a document
git-svn-id: https://svn.code.sf.net/p/qlscribe/svn/trunk@148 cac9541e-1b8d-4bfa-827e-589bba606050
2009-04-23 20:52:17 +00:00
ruglory c298a43b2f Round text changes radius and angle when is dragged by mouse instead of moving the center
git-svn-id: https://svn.code.sf.net/p/qlscribe/svn/trunk@147 cac9541e-1b8d-4bfa-827e-589bba606050
2009-04-22 02:48:03 +00:00
ruglory 577280f001 Main window stores/restores position and size from/to config
git-svn-id: https://svn.code.sf.net/p/qlscribe/svn/trunk@146 cac9541e-1b8d-4bfa-827e-589bba606050
2009-04-20 20:41:25 +00:00
ruglory be3a94cf74 Typo fixed
git-svn-id: https://svn.code.sf.net/p/qlscribe/svn/trunk@145 cac9541e-1b8d-4bfa-827e-589bba606050
2009-04-15 05:58:13 +00:00
ruglory 9537ece5fd Prepared for 0.12 prerelease
git-svn-id: https://svn.code.sf.net/p/qlscribe/svn/trunk@144 cac9541e-1b8d-4bfa-827e-589bba606050
2009-04-15 05:55:54 +00:00
ruglory 704cfe0831 Fixed bug for round text not updateting last used font
git-svn-id: https://svn.code.sf.net/p/qlscribe/svn/trunk@143 cac9541e-1b8d-4bfa-827e-589bba606050
2009-04-15 05:55:10 +00:00
ruglory 72c3e11909 Prepared for 0.11
git-svn-id: https://svn.code.sf.net/p/qlscribe/svn/trunk@141 cac9541e-1b8d-4bfa-827e-589bba606050
2009-04-04 03:41:06 +00:00
ruglory 9f94e61ad6 Added ability to eject media after print
Report to syslog added


git-svn-id: https://svn.code.sf.net/p/qlscribe/svn/trunk@140 cac9541e-1b8d-4bfa-827e-589bba606050
2009-04-04 03:36:07 +00:00
ruglory ce0b6d2ee4 Program settings added
Added option to eject media after print


git-svn-id: https://svn.code.sf.net/p/qlscribe/svn/trunk@139 cac9541e-1b8d-4bfa-827e-589bba606050
2009-04-04 03:11:42 +00:00
ruglory a455e2e8ca deb package updated so dbus config files are installed/removed by dpkg
git-svn-id: https://svn.code.sf.net/p/qlscribe/svn/trunk@138 cac9541e-1b8d-4bfa-827e-589bba606050
2009-03-27 05:02:09 +00:00
ruglory 0e045cbf01 prepared for 0.11
git-svn-id: https://svn.code.sf.net/p/qlscribe/svn/trunk@137 cac9541e-1b8d-4bfa-827e-589bba606050
2009-03-27 04:33:04 +00:00
ruglory ecdd91d206 Gentoo patch-3 accepted
git-svn-id: https://svn.code.sf.net/p/qlscribe/svn/trunk@136 cac9541e-1b8d-4bfa-827e-589bba606050
2009-03-27 04:31:29 +00:00
35 changed files with 585 additions and 116 deletions
+13
View File
@@ -1,5 +1,18 @@
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
Debian packages use standard procedure to install/upgrade config files
New in 0.10:
Undo/Redo mechanism implemented
Some minor bugfixes
+1 -1
View File
@@ -18,7 +18,7 @@
#
# $Id$
FIND_PATH( LSCRIBE_INCLUDE_DIR lightscribe.h /usr/local/include /usr/include/lightsribe $ENV{LIGHTSCRIBEDIR}/include )
FIND_PATH( LSCRIBE_INCLUDE_DIR lightscribe.h /usr/local/include /usr/include/lightscribe $ENV{LIGHTSCRIBEDIR}/include )
FIND_LIBRARY( LSCRIBE_LIBRARY lightscribe /usr/local/lib /opt/lightscribe/lib /opt/lightscribe/lib32 $ENV{LIGHTSCRIBEDIR}/lib )
+3 -1
View File
@@ -1,4 +1,6 @@
qlscribe (0.10-0ubuntu1) unstable; urgency=low
qlscribe (0.12-0ubuntu1) unstable; urgency=low
* Release 0.12 imported
* Release 0.11 imported
* Release 0.10 imported
* Release 0.9 imported
* Release 0.8 imported
+1
View File
@@ -0,0 +1 @@
/usr/share/dbus-1/services/org.lightscribe.Manager.service
-2
View File
@@ -2,8 +2,6 @@
set -e
if [ "$1" = "configure" ] ; then
cp -f /usr/share/qlscribe/lightscribe.conf /etc/dbus-1/system.d/
cp -f /usr/share/qlscribe/org.lightscribe.Manager.service /usr/share/dbus-1/system-services/
/etc/init.d/dbus reload
fi
-2
View File
@@ -9,8 +9,6 @@ if [ "$1" = "remove" -o "$1" = "upgrade" ] ; then
fi
if [ "$1" = "remove" ] ; then
rm -f /etc/dbus-1/system.d/lightscribe.conf
rm -f /usr/share/dbus-1/system-services/org.lightscribe.Manager.service
/etc/init.d/dbus reload
fi
+3 -3
View File
@@ -15,9 +15,9 @@ configure-stamp:
# Add here commands to configure the package.
mkdir -p build
cd build; cmake .. -DCMAKE_INSTALL_PREFIX=$(CURDIR)/debian/qlscribe/usr \
-DFINAL_INSTALL_PREFIX=/usr
touch configure-stamp
-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/services
build: build-stamp
+12 -3
View File
@@ -36,11 +36,21 @@ ENDIF( CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND CMAKE_COMPILER_IS_GNUCXX )
IF (DBUS_SYSTEM_POLICY_DIR)
INSTALL( FILES ${LSCRIBED_CONF_FILE} DESTINATION ${DBUS_SYSTEM_POLICY_DIR})
endif (DBUS_SYSTEM_POLICY_DIR)
ELSE (DBUS_SYSTEM_POLICY_DIR)
MESSAGE(STATUS "It is necessary to specify the directory where the client policy file for Qt Lightscribe is installed as DBUS_SYSTEM_POLICY_DIR.")
MESSAGE(STATUS "Otherwise it will be installed into share/qlscribe")
MESSAGE(STATUS "Normally this is /etc/dbus-1/system.d on a Linux system")
INSTALL( FILES ${LSCRIBED_CONF_FILE} DESTINATION share/qlscribe )
ENDIF (DBUS_SYSTEM_POLICY_DIR)
IF (DBUS_SYSTEM_SERVICE_DIR)
INSTALL( FILES ${LSCRIBED_SERVICE_FILE} DESTINATION ${DBUS_SYSTEM_SERVICE_DIR})
endif (DBUS_SYSTEM_SERVICE_DIR)
ELSE (DBUS_SYSTEM_SERVICE_DIR)
MESSAGE(STATUS "It is necessary to specify the directory where the client service file for Qt Lightscribe is installed as DBUS_SYSTEM_SERVICE_DIR.")
MESSAGE(STATUS "Otherwise it will be installed into share/qlscribe")
MESSAGE(STATUS "Normally this is /usr/share/dbus-1/services on a Linux system")
INSTALL( FILES ${LSCRIBED_SERVICE_FILE} DESTINATION share/qlscribe )
ENDIF (DBUS_SYSTEM_SERVICE_DIR)
SET( LSCRIBED_SRCS main.cpp dbuscpp.cpp drives.cpp managerhandler.cpp drivehandler.cpp
introspecthandler.cpp )
@@ -54,5 +64,4 @@ ADD_EXECUTABLE( lscribed ${LSCRIBED_SRCS} )
TARGET_LINK_LIBRARIES( lscribed ${LSCRIBE_LIBRARIES} ${DBUS_LIBRARIES} pthread )
INSTALL( TARGETS lscribed DESTINATION sbin )
INSTALL( FILES ${LSCRIBED_CONF_FILE} ${LSCRIBED_SERVICE_FILE} DESTINATION share/qlscribe )
+2 -2
View File
@@ -46,12 +46,12 @@ static const char *strDriveIntrospect =
</signal>\
<method name=\"preview\">\
<arg type=\"s\" direction=\"out\"/>\
<arg name=\"params\" type=\"(iiii)\" direction=\"in\"/>\
<arg name=\"params\" type=\"(iiiii)\" direction=\"in\"/>\
<arg name=\"image\" type=\"ay\" direction=\"in\"/>\
<arg name=\"previewSize\" type=\"(ii)\" direction=\"in\"/>\
</method>\
<method name=\"print\">\
<arg name=\"params\" type=\"(iiii)\" direction=\"in\"/>\
<arg name=\"params\" type=\"(iiiii)\" direction=\"in\"/>\
<arg name=\"image\" type=\"ay\" direction=\"in\"/>\
</method>\
<method name=\"abort\">\
+54 -39
View File
@@ -24,10 +24,12 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <syslog.h>
#include <lightscribe_cxx.h>
#include <fstream>
#include <iostream>
using namespace LightScribe;
static pthread_key_t drivesKey;
@@ -197,6 +199,7 @@ void Drive::routine()
LS_DrawOptions options;
LS_PrintQuality quality;
LS_MediaOptimizationLevel level;
bool eject= false;
char *image = 0;
int imageSize = 0;
@@ -205,15 +208,16 @@ void Drive::routine()
try {
DBusCpp::MessageConstIter iter = m_message->constIter();
if( iter.signature() != "(iiii)" )
throw std::string( "invalid argument for params: " ) + iter.signature() + ", (iiii) expected";
if( iter.signature() != "(iiiii)" )
throw std::string( "invalid argument for params: " ) + iter.signature() + ", (iiiii) expected";
DBusCpp::MessageConstIter sub = iter.recurse();
mode = LS_LabelMode( sub.getValue<int32_t>() ); sub.next();
options = LS_DrawOptions( sub.getValue<int32_t>() ); sub.next();
quality = LS_PrintQuality( sub.getValue<int32_t>() ); sub.next();
level = LS_MediaOptimizationLevel( sub.getValue<int32_t>() );
level = LS_MediaOptimizationLevel( sub.getValue<int32_t>() ); sub.next();
eject = sub.getValue<int32_t>();
if( !iter.next() )
throw std::string( "image argument missing" );
@@ -240,6 +244,7 @@ void Drive::routine()
std::cout << "exception " << str << std::endl;
DBusCpp::Message reply = m_message->newError( DBUS_ERROR_INVALID_ARGS, str.c_str() );
man.connection().send( reply );
syslog( LOG_ERR, "error in parsing request: %s", str.c_str() );
continue;
}
@@ -278,15 +283,49 @@ void Drive::routine()
DiscPrinter printer = printers.Item( m_index );
function = "LS_DiscPrinter_OpenPrintSession";
DiscPrintSession session = printer.OpenPrintSession();
{
function = "LS_DiscPrinter_OpenPrintSession";
DiscPrintSession session = printer.OpenPrintSession();
DBusCpp::Message reply = m_message->newMethodReturn();
DBusCpp::Message reply = m_message->newMethodReturn();
if( preview ) {
if( preview ) {
function = "LS_DiscPrintSession_PrintPreview";
session.PrintPreview( LS_windows_bitmap,
syslog( LOG_INFO, "generating preview into temp file %s", tmpFile.c_str() );
function = "LS_DiscPrintSession_PrintPreview";
session.PrintPreview( LS_windows_bitmap,
mode,
options,
quality,
level,
image + 14,
bitmapHeaderSize - 14,
image + bitmapHeaderSize,
imageSize - bitmapHeaderSize,
const_cast< char *>( tmpFile.c_str() ),
LS_windows_bitmap,
size,
true );
reply.append( tmpFile );
man.connection().send( reply );
} else {
syslog( LOG_INFO, "printing label with parameters: mode %d, options %d, quality %d, level %d, eject %d",
mode, options, quality, level, eject );
LS_PrintCallbacks callbacks;
callbacks.AbortLabel = clAbortLabel;
callbacks.ReportPrepareProgress = clReportPrepareProgress;
callbacks.ReportLabelProgress = clReportLabelProgress;
callbacks.ReportFinished = clReportFinished;
callbacks.ReportLabelTimeEstimate = clReportLabelTimeEstimate;
session.SetProgressCallback( &callbacks );
man.connection().send( reply );
function = 0;
session.PrintDisc( LS_windows_bitmap,
mode,
options,
quality,
@@ -294,37 +333,11 @@ void Drive::routine()
image + 14,
bitmapHeaderSize - 14,
image + bitmapHeaderSize,
imageSize - bitmapHeaderSize,
const_cast< char *>( tmpFile.c_str() ),
LS_windows_bitmap,
size,
true );
reply.append( tmpFile );
man.connection().send( reply );
} else {
LS_PrintCallbacks callbacks;
callbacks.AbortLabel = clAbortLabel;
callbacks.ReportPrepareProgress = clReportPrepareProgress;
callbacks.ReportLabelProgress = clReportLabelProgress;
callbacks.ReportFinished = clReportFinished;
callbacks.ReportLabelTimeEstimate = clReportLabelTimeEstimate;
session.SetProgressCallback( &callbacks );
man.connection().send( reply );
function = 0;
session.PrintDisc( LS_windows_bitmap,
mode,
options,
quality,
level,
image + 14,
bitmapHeaderSize - 14,
image + bitmapHeaderSize,
imageSize - bitmapHeaderSize );
imageSize - bitmapHeaderSize );
}
}
if( !preview && eject )
printer.OpenDriveTray();
}
catch( LightScribe::LSException &ex ) {
if( function ) {
@@ -332,6 +345,7 @@ void Drive::routine()
sprintf( message, "\"%s()\" failed with code 0x%X", function, ex.GetCode() );
DBusCpp::Message reply = m_message->newError( DBUS_ERROR_FAILED, message );
man.connection().send( reply );
syslog( LOG_ERR, "%s", message );
} else
clReportFinished( ex.GetCode() );
continue;
@@ -339,6 +353,7 @@ void Drive::routine()
catch( const std::string &str ) {
DBusCpp::Message reply = m_message->newError( DBUS_ERROR_FAILED, str.c_str() );
man.connection().send( reply );
syslog( LOG_ERR, "operation failed: \"%s\"", str.c_str() );
continue;
}
}
+5
View File
@@ -22,6 +22,7 @@
#include <string.h>
#include <signal.h>
#include <stdlib.h>
#include <syslog.h>
#include "lscribed.h"
#include "dbuscpp.h"
@@ -52,6 +53,7 @@ void onAlarm( int )
lastActivity = curr;
return;
}
syslog( LOG_INFO, "terminating due to inactivity timeout" );
terminateOnTimeout = true;
}
@@ -65,6 +67,7 @@ void usage()
int main( int argc, char **argv )
{
openlog( "lscribed", LOG_PID, LOG_DAEMON );
for( int i = 1; i < argc; ++i ) {
if( strcmp( argv[i], "--help" ) == 0 ) {
usage();
@@ -102,11 +105,13 @@ int main( int argc, char **argv )
int ret = dbus_bus_request_name( conn.ptr(), DBusServiceName, DBUS_NAME_FLAG_REPLACE_EXISTING, &err );
if( dbus_error_is_set( &err ) ) {
std::cerr << "dbus_bus_request_name error: " << err.message << std::endl;
syslog( LOG_ERR, "dbus_bus_request_name error: %s", err.message );
dbus_error_free( &err );
return 2;
}
if( ret != DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER ) {
std::cerr << "could not get ownership of \"" << DBusServiceName << "\" terminating" << std::endl;
syslog( LOG_ERR, "could not get ownership of \"%s\" terminating", DBusServiceName );
return 3;
}
+4 -3
View File
@@ -24,14 +24,15 @@ SET( QT_USE_QTDBUS 1 )
SET( QLSCRIBE_SRCS main.cpp mainwindow.cpp qcdscene.cpp qcdview.cpp
qdialogpixmap.cpp qdialogroundtext.cpp qdialogtext.cpp qlightroundtextitem.cpp
qlightscribe.cpp qshapefactory.cpp qlighttextitem.cpp qlightpixmapitem.cpp
qdialogprint.cpp qdialogprogress.cpp qdialogcdproperties.cpp qconsoleprintprogress.cpp)
qdialogprint.cpp qdialogprogress.cpp qdialogcdproperties.cpp qconsoleprintprogress.cpp
qdialogsettings.cpp )
SET( QLSCRIBE_UIS qdialogtext.ui qdialogroundtext.ui qdialogpixmap.ui
qdialogprint.ui qdialogprogress.ui qdialogcdproperties.ui)
qdialogprint.ui qdialogprogress.ui qdialogcdproperties.ui qdialogsettings.ui )
SET( QLSCRIBE_MOC_HDRS mainwindow.h qcdscene.h qdialogpixmap.h qdialogroundtext.h
qdialogtext.h qlightscribe.h qdialogprint.h qdialogprogress.h
qdialogcdproperties.h qconsoleprintprogress.h)
qdialogcdproperties.h qconsoleprintprogress.h qdialogsettings.h )
ADD_DEFINITIONS( -Wall )
+2 -2
View File
@@ -47,13 +47,13 @@
<annotation name="com.trolltech.QtDBus.QtTypeName.In0" value="const PrintParameters &amp;"/>
<annotation name="com.trolltech.QtDBus.QtTypeName.In2" value="QSize"/>
<arg type="s" direction="out"/>
<arg name="params" type="(iiii)" direction="in"/>
<arg name="params" type="(iiiii)" direction="in"/>
<arg name="image" type="ay" direction="in"/>
<arg name="previewSize" type="(ii)" direction="in"/>
</method>
<method name="print">
<annotation name="com.trolltech.QtDBus.QtTypeName.In0" value="const PrintParameters &amp;"/>
<arg name="params" type="(iiii)" direction="in"/>
<arg name="params" type="(iiiii)" direction="in"/>
<arg name="image" type="ay" direction="in"/>
</method>
<method name="abort">
+3
View File
@@ -56,6 +56,9 @@ void usage()
int main( int argc, char **argv )
{
QApplication app( argc, argv );
app.setApplicationName( "qlscribe" );
//app.setOrganizationName( "" );
app.setOrganizationDomain( "qlscribe.sourceforge.org" );
app.addLibraryPath( "/usr/lib32/qt4/plugins" );
app.setWindowIcon( QIcon( ":/qlscribe64.png" ) );
+43 -7
View File
@@ -27,6 +27,7 @@
#include "qdialogprint.h"
#include "qdialogprogress.h"
#include "qdialogcdproperties.h"
#include "qdialogsettings.h"
#include <QMenuBar>
#include <QStatusBar>
@@ -39,6 +40,8 @@
#include <QCloseEvent>
#include <QApplication>
#include <QClipboard>
#include <QSettings>
#include <QImageReader>
MainWindow::MainWindow( bool enablePrint )
@@ -74,7 +77,8 @@ MainWindow::MainWindow( bool enablePrint )
m_menuFile->addAction( tr( "Open...", "Menu item \"Open\"" ),
this,
SLOT(onMenuOpen()) );
SLOT(onMenuOpen()),
QKeySequence( Qt::CTRL + Qt::Key_O ) );
m_actionSave = m_menuFile->addAction( tr( "Save", "Menu item \"Save\"" ),
this,
@@ -107,7 +111,7 @@ MainWindow::MainWindow( bool enablePrint )
m_menuFile->addAction( tr( "Exit", "Menu item \"Exit\"" ),
this,
SLOT(close()),
QKeySequence( Qt::CTRL + Qt::Key_X ) );
QKeySequence( Qt::CTRL + Qt::Key_Q ) );
m_menuEdit = menuBar()->addMenu( tr( "Edit", "Menu item \"Edit\"" ) );
@@ -139,6 +143,12 @@ MainWindow::MainWindow( bool enablePrint )
m_menuInsert = m_menuEdit->addMenu( tr( "Insert", "Menu item \"Insert\"" ) );
m_menuEdit->addSeparator();
m_actionSettings = m_menuEdit->addAction( tr( "Settings...", "Menu item \"Settings\"" ),
this,
SLOT(onMenuSettings()) );
m_menuHelp = menuBar()->addMenu( tr( "Help", "Menu item \"Help\"" ) );
m_menuHelp->addAction( tr( "About...", "Menu item \"About\"" ),
@@ -165,6 +175,13 @@ 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()
@@ -182,6 +199,8 @@ 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();
@@ -247,6 +266,13 @@ bool MainWindow::saveScene( QCDScene *scene )
return;
}
}
QSettings settings;
settings.beginGroup( "MainWindow" );
settings.setValue( "size", size());
settings.setValue( "pos", pos());
settings.endGroup();
event->accept();
}
@@ -297,18 +323,23 @@ 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(),
tr("qlscribe document (*.qlx)") );
filter );
if( fileName.isNull() )
return;
@@ -379,8 +410,8 @@ void MainWindow::onMenuPrint()
{
QCDScene *cdscene = getScene( m_mdiArea );
if( !cdscene )
return;
try {
QDialogProgress::exec( this, cdscene );
}
@@ -429,7 +460,7 @@ void MainWindow::onMenuAbout()
QMessageBox::about( this,
tr( "About" ),
tr( "<h3>qlscribe - Qt lisghtScribe</h3>"
"<p>release 0.10 $Revision$</p>"
"<p>release 0.12 $Revision$</p>"
"<p>visit project at home page "
"<a href=\"http://qlscribe.sourceforge.net/\">qlscribe.sourceforge.net</a></p>" ) );
}
@@ -439,6 +470,11 @@ void MainWindow::onMenuQtAbout()
QMessageBox::aboutQt( this );
}
void MainWindow::onMenuSettings()
{
QDialogSettings::exec( this );
}
void MainWindow::updateMenu()
{
QCDScene *scene = getScene( m_mdiArea );
+2
View File
@@ -53,6 +53,7 @@ private slots:
void onMenuCopy();
void onMenuCut();
void onMenuPaste();
void onMenuSettings();
void onMenuInsert( int id );
void onMenuAbout();
void onMenuQtAbout();
@@ -79,6 +80,7 @@ private:
QAction *m_actionCopy;
QAction *m_actionCut;
QAction *m_actionPaste;
QAction *m_actionSettings;
QSignalMapper *m_insertMapper;
QSignalMapper *m_newLabelMapper;
+48 -24
View File
@@ -20,6 +20,7 @@
#include "qcdscene.h"
#include "qshapefactory.h"
#include "qlightpixmapitem.h"
#include <QMenu>
#include <QMessageBox>
@@ -34,6 +35,7 @@
#include <QApplication>
#include <QClipboard>
#include <QMimeData>
#include <QRegExp>
QCDScene::QCDScene( QObject * parent )
: QGraphicsScene( parent ),
@@ -81,31 +83,53 @@ void QCDScene::start( LabelMode mode )
bool QCDScene::load( const QString &fileName, QString *errMessage )
{
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();
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;
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 {
if( errMessage )
*errMessage = "cannot load image";
else
QMessageBox::critical( 0, tr( "Error" ), tr( "Cannot load image " ) +
fileName + "\n" );
}
return false;
}
+3 -2
View File
@@ -147,18 +147,19 @@ 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, rect, false );
drawCD( &paint, rectf, false );
}
{
QPixmap alpha( frameSize() );
QPainter paint( &alpha );
paint.setWorldTransform( painter->transform() );
drawCD( &paint, rect, true );
drawCD( &paint, rectf, true );
m_mask->setAlphaChannel( alpha );
}
+3
View File
@@ -28,6 +28,7 @@
#include <QAbstractButton>
#include <QTime>
#include <QTimer>
#include <QSettings>
QDialogProgress::QDialogProgress( QWidget *parent, QLightDrive *drive )
: QDialog(parent),
@@ -68,6 +69,8 @@ bool QDialogProgress::exec( QWidget *parent, QCDScene *scene )
if( !drive )
return false;
params.m_ejectAfterComplete = QSettings().value( cfgEjectAfterFinish, false ).toBool();
QDialogProgress dialog( parent, drive );
dialog.setWindowTitle( tr( "Printing: " ) + scene->name() );
+2
View File
@@ -22,6 +22,7 @@
#include "ui_qdialogroundtext.h"
#include "qlightroundtextitem.h"
#include "qcdscene.h"
#include "qdialogsettings.h"
#include <QFontDialog>
#include <QColorDialog>
@@ -132,6 +133,7 @@ void QDialogRoundText::onFont()
//font.setPointSizeF( font.pointSizeF() / 2.0 );
if( ok ) {
m_item->setFont( font );
QDialogSettings::setLastUsedFont( font );
fontChanged();
}
}
+99
View File
@@ -0,0 +1,99 @@
/* qlscribe - Qt based application to print lightScribe discs
Copyright (C) 2009 Vyacheslav Kononenko <vyacheslav@kononenko.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
$Id$ */
#include "qdialogsettings.h"
#include "ui_qdialogsettings.h"
#include "qlscribe.h"
#include <QSettings>
#include <QFontDialog>
QFont *QDialogSettings::m_lastUsedFont = 0;
QDialogSettings::QDialogSettings(QWidget *parent) :
QDialog( parent ),
m_ui( new Ui::QDialogSettings )
{
m_ui->setupUi( this );
connect( m_ui->btnFont, SIGNAL(clicked()), this, SLOT(onFont()) );
connect( m_ui->btnLastUsedFont, SIGNAL(clicked()), this, SLOT(onLastUsedFont()) );
m_ui->btnLastUsedFont->setEnabled( m_lastUsedFont );
}
QDialogSettings::~QDialogSettings()
{
delete m_ui;
}
void QDialogSettings::changeEvent(QEvent *e)
{
switch (e->type()) {
case QEvent::LanguageChange:
m_ui->retranslateUi(this);
break;
default:
break;
}
}
bool QDialogSettings::exec( QWidget *parent )
{
QDialogSettings dialog( parent );
QSettings sts;
dialog.m_font = sts.value( cfgDefaultFont ).value<QFont>();
dialog.m_ui->fontName->setCurrentFont( dialog.m_font );
dialog.m_ui->chkEject->setChecked( sts.value( cfgEjectAfterFinish, false ).toBool() );
if( dialog.QDialog::exec() == Rejected ) return false;
sts.setValue( cfgDefaultFont, dialog.m_font );
sts.setValue( cfgEjectAfterFinish, dialog.m_ui->chkEject->isChecked() );
return true;
}
void QDialogSettings::onFont()
{
bool ok = true;
QFont font = QFontDialog::getFont( &ok, m_font, this );
if( ok ) {
m_font = font;
m_ui->fontName->setCurrentFont( font );
}
}
void QDialogSettings::onLastUsedFont()
{
if( m_lastUsedFont ) {
m_font = *m_lastUsedFont;
m_ui->fontName->setCurrentFont( *m_lastUsedFont );
}
}
void QDialogSettings::setLastUsedFont( const QFont &font )
{
if( !m_lastUsedFont ) m_lastUsedFont = new QFont( font );
else *m_lastUsedFont = font;
}
QFont QDialogSettings::defaultFont()
{
return QSettings().value( cfgDefaultFont ).value<QFont>();
}
+56
View File
@@ -0,0 +1,56 @@
/* qlscribe - Qt based application to print lightScribe discs
Copyright (C) 2009 Vyacheslav Kononenko <vyacheslav@kononenko.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
$Id$ */
#ifndef QDIALOGSETTINGS_H
#define QDIALOGSETTINGS_H
#include <QtGui/QDialog>
namespace Ui {
class QDialogSettings;
}
class QDialogSettings : public QDialog {
Q_OBJECT
Q_DISABLE_COPY(QDialogSettings)
public:
static bool exec( QWidget *parent = 0 );
static void setLastUsedFont( const QFont &font );
static QFont defaultFont();
private:
explicit QDialogSettings( QWidget *parent = 0 );
virtual ~QDialogSettings();
protected:
virtual void changeEvent(QEvent *e);
private slots:
void onFont();
void onLastUsedFont();
private:
Ui::QDialogSettings *m_ui;
QFont m_font;
static QFont *m_lastUsedFont;
};
#endif // QDIALOGSETTINGS_H
+140
View File
@@ -0,0 +1,140 @@
<ui version="4.0" >
<class>QDialogSettings</class>
<widget class="QDialog" name="QDialogSettings" >
<property name="windowModality" >
<enum>Qt::NonModal</enum>
</property>
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>305</width>
<height>156</height>
</rect>
</property>
<property name="windowTitle" >
<string>Settings</string>
</property>
<property name="modal" >
<bool>false</bool>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2" >
<item>
<widget class="QFrame" name="frame" >
<property name="frameShape" >
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow" >
<enum>QFrame::Raised</enum>
</property>
<layout class="QVBoxLayout" name="verticalLayout" >
<item>
<layout class="QFormLayout" name="formLayout" >
<item row="0" column="0" >
<widget class="QLabel" name="label" >
<property name="text" >
<string>Default font:</string>
</property>
</widget>
</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>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout" >
<item>
<spacer name="horizontalSpacer" >
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="btnFont" >
<property name="text" >
<string>Font...</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btnLastUsedFont" >
<property name="text" >
<string>Last used</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QCheckBox" name="chkEject" >
<property name="text" >
<string>Eject tray after finish</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox" >
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons" >
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>QDialogSettings</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel" >
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel" >
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>QDialogSettings</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel" >
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel" >
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>
+2
View File
@@ -21,6 +21,7 @@
#include "qdialogtext.h"
#include "ui_qdialogtext.h"
#include "qcdscene.h"
#include "qdialogsettings.h"
#include <QGraphicsSimpleTextItem>
#include <QFontDialog>
@@ -97,6 +98,7 @@ void QDialogText::onFont()
QFont font = QFontDialog::getFont( &ok, m_item->font(), this );
if( ok ) {
m_item->setFont( font );
QDialogSettings::setLastUsedFont( font );
fontChanged();
}
}
+2 -5
View File
@@ -1,8 +1,8 @@
<ui version="4.0" >
<class>QDialogText</class>
<widget class="QDialog" name="QDialogText" >
<property name="windowModality" >
<enum>Qt::NonModal</enum>
<property name="enabled" >
<bool>true</bool>
</property>
<property name="geometry" >
<rect>
@@ -15,9 +15,6 @@
<property name="windowTitle" >
<string>Text properties</string>
</property>
<property name="modal" >
<bool>false</bool>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_3" >
<item>
<layout class="QVBoxLayout" name="verticalLayout" >
+11
View File
@@ -29,6 +29,17 @@ 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 )
+2 -2
View File
@@ -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; }
+32 -5
View File
@@ -21,6 +21,7 @@
#include "qlightroundtextitem.h"
#include "qdialogroundtext.h"
#include "qcdscene.h"
#include "qdialogsettings.h"
#include <QPainter>
#include <QFontMetrics>
@@ -28,6 +29,7 @@
#include <QMessageBox>
#include <QXmlStreamWriter>
#include <QTextLayout>
#include <QGraphicsSceneMouseEvent>
#include <math.h>
@@ -230,14 +232,38 @@ void QLightRoundTextItem::paint( QPainter *painter, const QStyleOptionGraphicsIt
}
}
QVariant QLightRoundTextItem::itemChange( GraphicsItemChange change, const QVariant & value )
inline
double distance( const QPointF &p1, const QPointF &p2 )
{
if( scene() && change == ItemPositionHasChanged )
static_cast<QCDScene *>( scene() )->itemMoved();
return 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;
static_cast<QCDScene *>( scene() )->itemMoved();
} else
event->ignore();
}
RegisterController< QShapeControllerRoundText > regControllerRoundText;
QString QShapeControllerRoundText::name() const
@@ -253,6 +279,7 @@ QString QShapeControllerRoundText::menuName() const
QGraphicsItem *QShapeControllerRoundText::create() const
{
QLightRoundTextItem *item = new QLightRoundTextItem;
item->setFont( QDialogSettings::defaultFont() );
return item;
}
+1 -1
View File
@@ -55,7 +55,7 @@ public:
virtual int type() const { return Type; }
protected:
virtual QVariant itemChange ( GraphicsItemChange change, const QVariant & value );
virtual void mouseMoveEvent( QGraphicsSceneMouseEvent *event );
private:
QFont m_font;
+5 -4
View File
@@ -37,7 +37,7 @@
QDBusArgument &operator<<( QDBusArgument &argument, const PrintParameters &p )
{
argument.beginStructure();
argument << p.m_labelMode << p.m_drawOptions << p.m_printQuality << p.m_mediaOptimizationLevel;
argument << p.m_labelMode << p.m_drawOptions << p.m_printQuality << p.m_mediaOptimizationLevel << (int) p.m_ejectAfterComplete;
argument.endStructure();
return argument;
}
@@ -46,13 +46,14 @@
const QDBusArgument &operator>>( const QDBusArgument &argument, PrintParameters &p )
{
argument.beginStructure();
int drawOptions = 0, labelMode = 0, mediaOptimizationLevel = 0, printQuality = 0;
argument >> labelMode >> drawOptions >> printQuality >> mediaOptimizationLevel;
int drawOptions = 0, labelMode = 0, mediaOptimizationLevel = 0, printQuality = 0, ejectAfterComplete = 0;
argument >> labelMode >> drawOptions >> printQuality >> mediaOptimizationLevel >> ejectAfterComplete;
argument.endStructure();
p = PrintParameters( LabelMode( labelMode ),
DrawOptions( drawOptions ),
PrintQuality( printQuality ),
MediaOptimizationLevel( mediaOptimizationLevel ) );
MediaOptimizationLevel( mediaOptimizationLevel ),
ejectAfterComplete );
return argument;
}
+10 -3
View File
@@ -35,13 +35,20 @@ struct PrintParameters {
DrawOptions m_drawOptions;
PrintQuality m_printQuality;
MediaOptimizationLevel m_mediaOptimizationLevel;
bool m_ejectAfterComplete;
PrintParameters()
: m_labelMode( modeFull ), m_drawOptions( drawDefault ),
m_printQuality( qualityBest ), m_mediaOptimizationLevel( mediaRecognized ) {}
PrintParameters( LabelMode labelMode, DrawOptions drawOptions, PrintQuality printQuality, MediaOptimizationLevel mediaOptimizationLevel )
m_printQuality( qualityBest ), m_mediaOptimizationLevel( mediaRecognized ), m_ejectAfterComplete( false ) {}
PrintParameters( LabelMode labelMode,
DrawOptions drawOptions,
PrintQuality printQuality,
MediaOptimizationLevel mediaOptimizationLevel,
bool ejectAfterComplete )
: m_labelMode( labelMode ), m_drawOptions( drawOptions ),
m_printQuality( printQuality ), m_mediaOptimizationLevel( mediaOptimizationLevel ) {}
m_printQuality( printQuality ), m_mediaOptimizationLevel( mediaOptimizationLevel ),
m_ejectAfterComplete( ejectAfterComplete )
{}
};
Q_DECLARE_METATYPE( PrintParameters );
+3 -1
View File
@@ -21,6 +21,7 @@
#include "qlighttextitem.h"
#include "qdialogtext.h"
#include "qcdscene.h"
#include "qdialogsettings.h"
#include <QXmlStreamWriter>
#include <QXmlStreamReader>
@@ -53,7 +54,8 @@ QString QShapeControllerText::menuName() const
QGraphicsItem *QShapeControllerText::create() const
{
QGraphicsItem *item = new QLightTextItem;
QLightTextItem *item = new QLightTextItem;
item->setFont( QDialogSettings::defaultFont() );
item->setTransform( QTransform().scale( 0.5, 0.5 ), true );
item->setPos( 0, -40.0 );
+5
View File
@@ -64,4 +64,9 @@ const char * const itemMimeType = "application/x-qlscribe;item";
const char * const DBusServiceName = "@QLSCRIBE_DBUS_MANAGER_SERVICE@";
const char * const DBusManagerPath = "@QLSCRIBE_DBUS_MANAGER_PATH@";
// config keys
const char * const cfgDefaultFont = "DefaultTextFont";
const char * const cfgEjectAfterFinish = "EjectAfterFinish";
#endif // QLSCRIBE_H
+6 -3
View File
@@ -20,7 +20,8 @@ SOURCES += main.cpp \
qlighttextitem.cpp \
qlightpixmapitem.cpp \
qdialogcdproperties.cpp \
qconsoleprintprogress.cpp
qconsoleprintprogress.cpp \
qdialogsettings.cpp
QMAKE_LIBS += -llightscribe
HEADERS += mainwindow.h \
qlightroundtextitem.h \
@@ -36,10 +37,12 @@ HEADERS += mainwindow.h \
qlighttextitem.h \
qlightpixmapitem.h \
qdialogcdproperties.h \
qconsoleprintprogress.h
qconsoleprintprogress.h \
qdialogsettings.h
FORMS += qdialogtext.ui \
qdialogroundtext.ui \
qdialogpixmap.ui \
qdialogprint.ui \
qdialogprogress.ui \
qdialogcdproperties.ui
qdialogcdproperties.ui \
qdialogsettings.ui
+7 -1
View File
@@ -118,7 +118,13 @@ QString QShapeFactory::name( int type ) const
QGraphicsItem *QShapeFactory::create( int type ) const
{
QShapeController *ctrl = getController( type );
return ctrl ? ctrl->create() : 0;
if( !ctrl ) return 0;
QGraphicsItem *item = ctrl->create();
if( item ) {
item->setFlag( QGraphicsItem::ItemIsMovable, true );
item->setFlag( QGraphicsItem::ItemIsSelectable, true );
}
return item;
}
bool QShapeFactory::edit( QGraphicsItem *item, QWidget *parent ) const