From kde-bugs-dist Sat May 28 10:15:24 2005 From: Andreas Zehender Date: Sat, 28 May 2005 10:15:24 +0000 To: kde-bugs-dist Subject: [Bug 101677] Ask on export, if changed propertys should be saved Message-Id: <20050528101524.22013.qmail () ktown ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-bugs-dist&m=111727533425428 ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is. http://bugs.kde.org/show_bug.cgi?id=101677 az azweb de changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |FIXED ------- Additional Comments From az azweb de 2005-05-28 12:15 ------- SVN commit 419002 by azehende: ask user to save pending changes on export and save BUG: 101677 M +3 -0 ChangeLog M +1 -0 pmdialogview.cpp M +7 -0 pmpart.cpp M +11 -0 pmpart.h M +9 -1 pmshell.cpp M +1 -0 pmshell.h --- trunk/KDE/kdegraphics/kpovmodeler/ChangeLog #419001:419002 @ -78,3 +78,6 @ - Added local and global detail levels too: Sphere, Cylinder, Cone, Torus, Disc, Blob Sphere, Blob Cylinder, Lathe, SOR, Prism, SQE, Sphere sweep and Heightfield. + +Version 1.2 + - The user is asked if pending changes should be saved before saving or exporting --- trunk/KDE/kdegraphics/kpovmodeler/pmdialogview.cpp #419001:419002 @ -158,6 +158,7 @ SLOT( slotObjectChanged( PMObject*, const int, QObject* ) ) ); connect( part, SIGNAL( clear( ) ), SLOT( slotClear( ) ) ); connect( part, SIGNAL( aboutToRender( ) ), SLOT( slotAboutToRender( ) ) ); + connect( part, SIGNAL( aboutToSave( ) ), SLOT( slotAboutToRender( ) ) ); connect( this, SIGNAL( objectChanged( PMObject*, const int, QObject* ) ), part, SLOT( slotObjectChanged( PMObject*, const int, QObject* ) ) ); --- trunk/KDE/kdegraphics/kpovmodeler/pmpart.cpp #419001:419002 @ -1391,6 +1391,8 @ void PMPart::slotFileExport( ) { + emit aboutToSave( ); + QString fileName, filter; PMIOFormat* selectedFormat = 0; @ -2874,4 +2876,9 @ } +void PMPart::slotAboutToSave( ) +{ + emit aboutToSave( ); +} + #include "pmpart.moc" --- trunk/KDE/kdegraphics/kpovmodeler/pmpart.h #419001:419002 @ -702,6 +702,11 @ /** Set the scene object. Must be used with extreme care. */ void setScene( PMScene* scene ); + /** + * Emits the aboutToSave signal + */ + void slotAboutToSave( ); + signals: /** * Signal that is emitted when an object is changed. @ -735,6 +740,12 @ * Views should ask the user to save pending changes. */ void aboutToRender( ); + /** + * Emitted before the scene is saved or exported + * + * Views should ask the user to save pending changes. + */ + void aboutToSave( ); protected: /** --- trunk/KDE/kdegraphics/kpovmodeler/pmshell.cpp #419001:419002 @ -411,13 +411,15 @ void PMShell::slotFileSave( ) { + m_pPart->slotAboutToSave( ); + if( m_pPart->isModified( ) ) { if( !m_pPart->url( ).isEmpty( ) && m_pPart->isReadWrite( ) ) m_pPart->saveAs( m_pPart->url( ) ); else - slotFileSaveAs( ); + saveAs( ); setCaption( m_pPart->url( ).prettyURL( ) ); } else @ -426,6 +428,12 @ void PMShell::slotFileSaveAs( ) { + m_pPart->slotAboutToSave( ); + saveAs( ); +} + +void PMShell::saveAs( ) +{ KFileDialog dlg( QString::null, QString( "*.kpm|" ) + i18n( "Povray Modeler Files (*.kpm)" ) + QString( "\n*|" ) + i18n( "All Files" ), --- trunk/KDE/kdegraphics/kpovmodeler/pmshell.h #419001:419002 @ -127,6 +127,7 @ protected: virtual bool queryClose( ); virtual void showEvent( QShowEvent* ); + void saveAs( ); public: /**