Diffstat (limited to 'noncore/tools/pimconverter/converter.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/tools/pimconverter/converter.cpp | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/noncore/tools/pimconverter/converter.cpp b/noncore/tools/pimconverter/converter.cpp index 7d34b24..ded59b6 100644 --- a/noncore/tools/pimconverter/converter.cpp +++ b/noncore/tools/pimconverter/converter.cpp @@ -16,2 +16,3 @@ #include <qcheckbox.h> +#include <qmessagebox.h> @@ -24,3 +25,4 @@ Converter::Converter(): m_selectedSourceFormat( XML ), - m_selectedDestFormat( SQL ) + m_selectedDestFormat( SQL ), + m_criticalState( false ) { @@ -53,2 +55,13 @@ void Converter::start_conversion(){ + odebug << "SourceFormat: " << m_selectedSourceFormat << oendl; + odebug << "DestFormat: " << m_selectedDestFormat << oendl; + if ( m_selectedSourceFormat == m_selectedDestFormat ){ + + QMessageBox::warning( this, "PimConverter", + tr( "It is not a good idea to use\n" ) + +tr( "the same source and destformat !" ), + tr( "Ok" ) ); + return; + } + switch( m_selectedSourceFormat ){ @@ -144,2 +157,4 @@ void Converter::start_conversion(){ + m_criticalState = true; + sourceDB -> load(); @@ -171,2 +186,4 @@ void Converter::start_conversion(){ + m_criticalState = false; + // Delete the frontends. Backends will be deleted automatically, too ! @@ -195,2 +212,17 @@ void Converter::start_conversion(){ +void Converter::closeEvent( QCloseEvent *e ) +{ + + /* Due to the fact that we don't have multitasking here, this + * critical handling don't make sense, but the future.. + */ + if ( m_criticalState ){ + e->ignore(); + return; + } + e->accept(); +} + + + int main( int argc, char** argv ) { |