6 Commits

Author SHA1 Message Date
ruglory e24833268e Tagging the 0.10 release
git-svn-id: https://svn.code.sf.net/p/qlscribe/svn/tags/release-0.10@135 cac9541e-1b8d-4bfa-827e-589bba606050
2009-03-25 03:06:18 +00:00
ruglory a112d90ce9 Ready for 0.10
git-svn-id: https://svn.code.sf.net/p/qlscribe/svn/trunk@134 cac9541e-1b8d-4bfa-827e-589bba606050
2009-03-25 02:55:00 +00:00
ruglory dfe6ab4495 Gentoo patch from Mario Fetka
git-svn-id: https://svn.code.sf.net/p/qlscribe/svn/trunk@133 cac9541e-1b8d-4bfa-827e-589bba606050
2009-03-25 02:47:58 +00:00
ruglory 10639af10e Undo/redo implemented
git-svn-id: https://svn.code.sf.net/p/qlscribe/svn/trunk@132 cac9541e-1b8d-4bfa-827e-589bba606050
2009-03-24 22:26:57 +00:00
ruglory 7b8838c2cd doc updated
git-svn-id: https://svn.code.sf.net/p/qlscribe/svn/trunk@131 cac9541e-1b8d-4bfa-827e-589bba606050
2009-03-12 22:28:53 +00:00
ruglory 471b00cd56 debian file fixed for 0.9
git-svn-id: https://svn.code.sf.net/p/qlscribe/svn/trunk@130 cac9541e-1b8d-4bfa-827e-589bba606050
2009-03-11 01:06:14 +00:00
12 changed files with 162 additions and 19 deletions
+4
View File
@@ -1,5 +1,9 @@
NEWS - list of user-visible changes between releases of qlscribe
New in 0.10:
Undo/Redo mechanism implemented
Some minor bugfixes
New in 0.9:
Parameter --image added to print label in console mode into image
Parameter --file added to process file in format KEY=VALUE
+2 -2
View File
@@ -18,9 +18,9 @@
#
# $Id$
FIND_PATH( LSCRIBE_INCLUDE_DIR lightscribe.h /usr/local/include $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 $ENV{LIGHTSCRIBEDIR}/lib )
FIND_LIBRARY( LSCRIBE_LIBRARY lightscribe /usr/local/lib /opt/lightscribe/lib /opt/lightscribe/lib32 $ENV{LIGHTSCRIBEDIR}/lib )
if( LSCRIBE_INCLUDE_DIR AND LSCRIBE_LIBRARY )
SET( LSCRIBE_FOUND TRUE )
+3 -1
View File
@@ -1,4 +1,6 @@
qlscribe (0.8-0ubuntu1) unstable; urgency=low
qlscribe (0.10-0ubuntu1) unstable; urgency=low
* Release 0.10 imported
* Release 0.9 imported
* Release 0.8 imported
* Initial release
+2 -2
View File
@@ -70,7 +70,7 @@ your disk id from http://www.freedb.org/ or similar. Copy it and run this comman
<p>Check that file have proper data, it should look similar
to this:</p>
<code><pre># xmcd CD database file
<pre><code># xmcd CD database file
#^M
# Track frame offsets:
@@ -105,7 +105,7 @@ EXTT2=
EXTT3=
EXTT4=
EXTT5=
PLAYORDER=</pre></code>
PLAYORDER=</code></pre>
<h4>5 Test you template</h4>
<p>Now we can test how our created at step 2-3 template works with the data. Run qlscribe
in console mode to print label as an image:</p>
+8
View File
@@ -34,6 +34,14 @@ IF( CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND CMAKE_COMPILER_IS_GNUCXX )
SET( CMAKE_EXE_LINKER_FLAGS "-m32 -pthread ${CMAKE_EXE_LINKER_FLAGS}" )
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)
IF (DBUS_SYSTEM_SERVICE_DIR)
INSTALL( FILES ${LSCRIBED_SERVICE_FILE} DESTINATION ${DBUS_SYSTEM_SERVICE_DIR})
endif (DBUS_SYSTEM_SERVICE_DIR)
SET( LSCRIBED_SRCS main.cpp dbuscpp.cpp drives.cpp managerhandler.cpp drivehandler.cpp
introspecthandler.cpp )
+33 -2
View File
@@ -112,6 +112,16 @@ MainWindow::MainWindow( bool enablePrint )
m_menuEdit = menuBar()->addMenu( tr( "Edit", "Menu item \"Edit\"" ) );
m_actionUndo = m_menuEdit->addAction( tr( "Undo", "Menu item \"Undo\"" ),
this,
SLOT(onMenuUndo()),
QKeySequence( Qt::CTRL + Qt::Key_Z ) );
m_actionRedo = m_menuEdit->addAction( tr( "Redo", "Menu item \"Redo\"" ),
this,
SLOT(onMenuRedo()),
QKeySequence( Qt::CTRL + Qt::Key_R ) );
m_actionCopy = m_menuEdit->addAction( tr( "Copy", "Menu item \"Copy\"" ),
this,
SLOT(onMenuCopy()),
@@ -244,10 +254,11 @@ void MainWindow::onMenuNewLabel( int mode )
{
QCDView *newView = new QCDView;
QCDScene *scene = new QCDScene( newView );
scene->setLabelMode( LabelMode( mode ) );
scene->start( LabelMode( mode ) );
newView->setScene( scene );
scene->setName();
connect( scene, SIGNAL(selectionChanged()), this, SLOT(updateMenu()) );
connect( scene, SIGNAL(changed()), this, SLOT(updateMenu()) );
QMdiSubWindow *subWindow = m_mdiArea->addSubWindow( newView );
subWindow->show();
@@ -311,6 +322,7 @@ void MainWindow::onMenuOpen()
return;
}
connect( scene, SIGNAL(selectionChanged()), this, SLOT(updateMenu()) );
connect( scene, SIGNAL(changed()), this, SLOT(updateMenu()) );
QMdiSubWindow *subWindow = m_mdiArea->addSubWindow( newView );
subWindow->show();
@@ -377,6 +389,20 @@ void MainWindow::onMenuPrint()
}
}
void MainWindow::onMenuUndo()
{
QCDScene *scene = getScene( m_mdiArea );
if( scene )
scene->undo();
}
void MainWindow::onMenuRedo()
{
QCDScene *scene = getScene( m_mdiArea );
if( scene )
scene->redo();
}
void MainWindow::onMenuCopy()
{
QCDScene *scene = getScene( m_mdiArea );
@@ -403,7 +429,7 @@ void MainWindow::onMenuAbout()
QMessageBox::about( this,
tr( "About" ),
tr( "<h3>qlscribe - Qt lisghtScribe</h3>"
"<p>release 0.9 $Revision$</p>"
"<p>release 0.10 $Revision$</p>"
"<p>visit project at home page "
"<a href=\"http://qlscribe.sourceforge.net/\">qlscribe.sourceforge.net</a></p>" ) );
}
@@ -425,10 +451,15 @@ void MainWindow::updateMenu()
m_menuInsert->setEnabled( scene );
if( !scene ) {
m_actionUndo->setEnabled( false );
m_actionRedo->setEnabled( false );
m_actionCopy->setEnabled( false );
m_actionCut->setEnabled( false );
m_actionPaste->setEnabled( false );
} else {
m_actionUndo->setEnabled( scene->canUndo() );
m_actionRedo->setEnabled( scene->canRedo() );
const QMimeData *mdata = QApplication::clipboard()->mimeData();
m_actionPaste->setEnabled( mdata && mdata->hasFormat( itemMimeType ) );
+4
View File
@@ -48,6 +48,8 @@ private slots:
void onMenuProperties();
void onMenuPrintPreview();
void onMenuPrint();
void onMenuUndo();
void onMenuRedo();
void onMenuCopy();
void onMenuCut();
void onMenuPaste();
@@ -72,6 +74,8 @@ private:
QAction *m_actionLabelProperties;
QAction *m_actionPrint;
QAction *m_actionPrintPreview;
QAction *m_actionUndo;
QAction *m_actionRedo;
QAction *m_actionCopy;
QAction *m_actionCut;
QAction *m_actionPaste;
+79 -2
View File
@@ -39,10 +39,13 @@ QCDScene::QCDScene( QObject * parent )
: QGraphicsScene( parent ),
m_index( 0 ),
m_saved( true ),
m_itemMoved( false ),
m_labelMode( modeFull ),
m_cdColor( Qt::white )
m_cdColor( Qt::white ),
m_undoPosition( m_undoBuffer.end() )
{
setSceneRect( -60.0, -60.0, 60.0 * 2, 60.0 * 2 );
}
//#include <iostream>
@@ -70,6 +73,12 @@ void QCDScene::replace( const QString2String &strings )
}
}
void QCDScene::start( LabelMode mode )
{
setLabelMode( mode );
pushUndo();
}
bool QCDScene::load( const QString &fileName, QString *errMessage )
{
QFile file( fileName );
@@ -94,9 +103,12 @@ bool QCDScene::load( const QString &fileName, QString *errMessage )
m_fileName = fileName;
m_saved = true;
setName();
pushUndo();
return true;
}
bool QCDScene::save()
{
QFile file( m_fileName );
@@ -143,10 +155,32 @@ void QCDScene::setName()
updateTitles();
}
void QCDScene::setChanged()
void QCDScene::setChanged( bool undo )
{
m_saved = false;
updateTitles();
if( undo && m_undoPosition != m_undoBuffer.end() )
pushUndo();
emit changed();
}
void QCDScene::pushUndo()
{
if( canRedo() ) {
UndoBuffer::iterator pos = m_undoBuffer.begin() + 1 + ( m_undoPosition - m_undoBuffer.begin() );
m_undoBuffer.erase( pos, m_undoBuffer.end() );
}
QString data;
QXmlStreamWriter writer( &data );
write( writer );
m_undoBuffer.push_back( data );
if( m_undoBuffer.size() > 20 )
m_undoBuffer.pop_front();
m_undoPosition = m_undoBuffer.end() - 1;
}
void QCDScene::updateTitles() const
@@ -330,6 +364,16 @@ void QCDScene::contextMenuEvent( QGraphicsSceneContextMenuEvent *mouseEvent )
menu.exec( mouseEvent->screenPos() );
}
void QCDScene::mouseReleaseEvent ( QGraphicsSceneMouseEvent *mouseEvent )
{
if( m_itemMoved ) {
setChanged();
m_itemMoved = false;
}
QGraphicsScene::mouseReleaseEvent( mouseEvent );
}
void QCDScene::onMenuEdit()
{
QList<QGraphicsItem *> list = selectedItems();
@@ -387,4 +431,37 @@ void QCDScene::sendItemTo( bool front )
zValue = item->zValue() - 0.1;
}
selectedItem->setZValue( zValue );
setChanged();
}
bool QCDScene::canUndo() const
{
return m_undoPosition - m_undoBuffer.begin() > 0;
}
bool QCDScene::canRedo() const
{
return m_undoBuffer.end() - m_undoPosition > 1;
}
void QCDScene::unredo( bool undo )
{
if( undo ) {
if( !canUndo() )
return;
--m_undoPosition;
} else {
if( !canRedo() )
return;
++m_undoPosition;
}
try {
clear();
QXmlStreamReader reader( *m_undoPosition );
read( reader );
}
catch(...) {
}
setChanged( false );
}
+24 -7
View File
@@ -44,13 +44,19 @@ public:
bool isSaved() const { return m_saved; }
bool isUnnamed() const { return m_fileName.isEmpty(); }
bool canUndo() const;
bool canRedo() const;
void setChanged();
void itemMoved() { m_itemMoved = true; }
void setChanged( bool undo = true );
void setName();
void start( LabelMode mode );
bool load( const QString &fileName, QString *errMessage = 0 );
void replace( const QString2String &strings );
bool save();
bool saveAs( const QString &fileName );
void undo() { unredo( true ); }
void redo() { unredo( false ); }
void putItemToClipboard( bool move );
void getItemFromClipboard();
@@ -59,8 +65,12 @@ public:
void redrawViews() const;
QString name() const { return m_name; }
signals:
void changed();
protected:
virtual void contextMenuEvent( QGraphicsSceneContextMenuEvent *contextMenuEvent );
virtual void mouseReleaseEvent ( QGraphicsSceneMouseEvent *mouseEvent );
private slots:
void onMenuEdit();
@@ -75,14 +85,21 @@ private:
bool readItem( QXmlStreamReader &reader );
void read( QXmlStreamReader &reader );
void sendItemTo( bool front );
void pushUndo();
void unredo( bool undo );
private:
QString m_name;
QString m_fileName;
int m_index;
bool m_saved;
LabelMode m_labelMode;
QColor m_cdColor;
typedef QList<QString> UndoBuffer;
QString m_name;
QString m_fileName;
int m_index;
bool m_saved;
bool m_itemMoved;
LabelMode m_labelMode;
QColor m_cdColor;
UndoBuffer m_undoBuffer;
UndoBuffer::const_iterator m_undoPosition;
};
#endif //QCDSCENE_H
+1 -1
View File
@@ -32,7 +32,7 @@ QLightPixmapItem::QLightPixmapItem()
QVariant QLightPixmapItem::itemChange( GraphicsItemChange change, const QVariant & value )
{
if( scene() && change == ItemPositionHasChanged )
static_cast<QCDScene *>( scene() )->setChanged();
static_cast<QCDScene *>( scene() )->itemMoved();
return value;
}
+1 -1
View File
@@ -233,7 +233,7 @@ void QLightRoundTextItem::paint( QPainter *painter, const QStyleOptionGraphicsIt
QVariant QLightRoundTextItem::itemChange( GraphicsItemChange change, const QVariant & value )
{
if( scene() && change == ItemPositionHasChanged )
static_cast<QCDScene *>( scene() )->setChanged();
static_cast<QCDScene *>( scene() )->itemMoved();
return value;
}
+1 -1
View File
@@ -33,7 +33,7 @@ QLightTextItem::QLightTextItem()
QVariant QLightTextItem::itemChange( GraphicsItemChange change, const QVariant & value )
{
if( scene() && change == ItemPositionHasChanged )
static_cast<QCDScene *>( scene() )->setChanged();
static_cast<QCDScene *>( scene() )->itemMoved();
return value;
}