summaryrefslogtreecommitdiff
path: root/noncore/tools/pimconverter/converter.cpp
Unidiff
Diffstat (limited to 'noncore/tools/pimconverter/converter.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/tools/pimconverter/converter.cpp29
1 files changed, 8 insertions, 21 deletions
diff --git a/noncore/tools/pimconverter/converter.cpp b/noncore/tools/pimconverter/converter.cpp
index ded59b6..e9de3c3 100644
--- a/noncore/tools/pimconverter/converter.cpp
+++ b/noncore/tools/pimconverter/converter.cpp
@@ -1,11 +1,10 @@
1#include "converter.h" 1#include "converter.h"
2 2
3/* OPIE */ 3/* OPIE */
4#include <qpe/qpeapplication.h> 4#include <opie2/oapplicationfactory.h>
5
6#include <opie2/odebug.h> 5#include <opie2/odebug.h>
7#include <opie2/opimglobal.h> 6#include <opie2/opimglobal.h>
8// Include SQL related header files 7// Include SQL related header files
9#define __USE_SQL 8#define __USE_SQL
10#include <opie2/opimaccessfactory.h> 9#include <opie2/opimaccessfactory.h>
11 10
@@ -14,16 +13,19 @@
14#include <qprogressbar.h> 13#include <qprogressbar.h>
15#include <qcombobox.h> 14#include <qcombobox.h>
16#include <qcheckbox.h> 15#include <qcheckbox.h>
17#include <qmessagebox.h> 16#include <qmessagebox.h>
18 17
19 18
19OPIE_EXPORT_APP( Opie::Core::OApplicationFactory<Converter> )
20
20using namespace Opie; 21using namespace Opie;
21using namespace Pim; 22using namespace Pim;
22 23
23Converter::Converter(): 24Converter::Converter(QWidget *p, const char* n, WFlags fl):
25 converter_base( p, n, fl ),
24 m_selectedDatabase( ADDRESSBOOK ), 26 m_selectedDatabase( ADDRESSBOOK ),
25 m_selectedSourceFormat( XML ), 27 m_selectedSourceFormat( XML ),
26 m_selectedDestFormat( SQL ), 28 m_selectedDestFormat( SQL ),
27 m_criticalState( false ) 29 m_criticalState( false )
28{ 30{
29 m_dataBaseSelector -> setCurrentItem( m_selectedDatabase ); 31 m_dataBaseSelector -> setCurrentItem( m_selectedDatabase );
@@ -53,17 +55,17 @@ void Converter::start_conversion(){
53 OPimBase* sourceDB; 55 OPimBase* sourceDB;
54 OPimBase* destDB; 56 OPimBase* destDB;
55 57
56 odebug << "SourceFormat: " << m_selectedSourceFormat << oendl; 58 odebug << "SourceFormat: " << m_selectedSourceFormat << oendl;
57 odebug << "DestFormat: " << m_selectedDestFormat << oendl; 59 odebug << "DestFormat: " << m_selectedDestFormat << oendl;
58 if ( m_selectedSourceFormat == m_selectedDestFormat ){ 60 if ( m_selectedSourceFormat == m_selectedDestFormat ){
59 61
60 QMessageBox::warning( this, "PimConverter", 62 QMessageBox::warning( this, "PimConverter",
61 tr( "It is not a good idea to use\n" ) 63 tr( "It is not a good idea to use\n" )
62 +tr( "the same source and destformat !" ), 64 +tr( "the same source and destformat !" ),
63 tr( "Ok" ) ); 65 tr( "Ok" ) );
64 return; 66 return;
65 } 67 }
66 68
67 switch( m_selectedSourceFormat ){ 69 switch( m_selectedSourceFormat ){
68 case XML: 70 case XML:
69 odebug << "XMLSourceDB = " << m_selectedDatabase << "" << oendl; 71 odebug << "XMLSourceDB = " << m_selectedDatabase << "" << oendl;
@@ -209,31 +211,16 @@ void Converter::start_conversion(){
209 211
210 owarn << "Conversion is finished and needed " << t.elapsed() << " ms !" << oendl; 212 owarn << "Conversion is finished and needed " << t.elapsed() << " ms !" << oendl;
211} 213}
212 214
213void Converter::closeEvent( QCloseEvent *e ) 215void Converter::closeEvent( QCloseEvent *e )
214{ 216{
215 217
216 /* Due to the fact that we don't have multitasking here, this 218 /* Due to the fact that we don't have multitasking here, this
217 * critical handling don't make sense, but the future.. 219 * critical handling don't make sense, but the future..
218 */ 220 */
219 if ( m_criticalState ){ 221 if ( m_criticalState ){
220 e->ignore(); 222 e->ignore();
221 return; 223 return;
222 } 224 }
223 e->accept(); 225 e->accept();
224} 226}
225
226
227
228int main( int argc, char** argv ) {
229
230 QPEApplication a( argc, argv );
231
232 Converter dlg;
233
234 a.showMainWidget( &dlg );
235 // dlg. showMaximized ( );
236
237 return a.exec();
238
239}