mainwindow.cpp
branchrelease-1-12-maintained
changeset 62 85683324f94a
parent 59 1c550f80c43b
child 64 4f305c07dd7c
     1.1 --- a/mainwindow.cpp	Mon Mar 16 15:40:49 2009 +0000
     1.2 +++ b/mainwindow.cpp	Thu Mar 19 11:48:33 2009 +0000
     1.3 @@ -342,10 +342,15 @@
     1.4  
     1.5  	fileImportMenu = fileMenu->addMenu (tr("Import","File menu"));
     1.6  
     1.7 -	a = new QAction(tr("KDE Bookmarks"), this);
     1.8 -	a->setStatusTip ( tr( "Import %1","Status tip file menu" ).arg(tr("KDE bookmarks")));
     1.9 +	a = new QAction(tr("KDE 3 Bookmarks"), this);
    1.10 +	a->setStatusTip ( tr( "Import %1","Status tip file menu" ).arg(tr("KDE 3 bookmarks")));
    1.11  	a->addTo (fileImportMenu);
    1.12 -	connect( a, SIGNAL( triggered() ), this, SLOT( fileImportKDEBookmarks() ) );
    1.13 +	connect( a, SIGNAL( triggered() ), this, SLOT( fileImportKDE3Bookmarks() ) );
    1.14 +
    1.15 +	a = new QAction(tr("KDE 4 Bookmarks"), this);
    1.16 +	a->setStatusTip ( tr( "Import %1","Status tip file menu" ).arg(tr("KDE 4 bookmarks")));
    1.17 +	a->addTo (fileImportMenu);
    1.18 +	connect( a, SIGNAL( triggered() ), this, SLOT( fileImportKDE4Bookmarks() ) );
    1.19  
    1.20      if (settings.value( "/mainwindow/showTestMenu",false).toBool()) 
    1.21  	{
    1.22 @@ -398,9 +403,14 @@
    1.23      connect( a, SIGNAL( triggered() ), this, SLOT( fileExportCSV() ) );
    1.24  	fileExportMenu->addAction (a);
    1.25  
    1.26 -	a = new QAction( tr("KDE Bookmarks","File menu"), this);
    1.27 -	a->setStatusTip( tr( "Export as %1").arg(tr("KDE Bookmarks" )));
    1.28 -	connect( a, SIGNAL( triggered() ), this, SLOT( fileExportKDEBookmarks() ) );
    1.29 +	a = new QAction( tr("KDE 3 Bookmarks","File menu"), this);
    1.30 +	a->setStatusTip( tr( "Export as %1").arg(tr("KDE 3 Bookmarks" )));
    1.31 +	connect( a, SIGNAL( triggered() ), this, SLOT( fileExportKDE3Bookmarks() ) );
    1.32 +	fileExportMenu->addAction (a);
    1.33 +
    1.34 +	a = new QAction( tr("KDE 4 Bookmarks","File menu"), this);
    1.35 +	a->setStatusTip( tr( "Export as %1").arg(tr("KDE 4 Bookmarks" )));
    1.36 +	connect( a, SIGNAL( triggered() ), this, SLOT( fileExportKDE4Bookmarks() ) );
    1.37  	fileExportMenu->addAction (a);
    1.38  
    1.39      a = new QAction( "Taskjuggler...", this );
    1.40 @@ -2066,11 +2076,19 @@
    1.41  	fileSaveAs (CompleteMap);
    1.42  }
    1.43  
    1.44 -void Main::fileImportKDEBookmarks()
    1.45 +void Main::fileImportKDE3Bookmarks()
    1.46  {
    1.47 -	ImportKDEBookmarks im;
    1.48 +	ImportKDE3Bookmarks im;
    1.49  	im.transform();
    1.50 -	if (success==fileLoad (im.getTransformedFile(),NewMap) && currentMapEditor() )
    1.51 +	if (aborted!=fileLoad (im.getTransformedFile(),NewMap) && currentMapEditor() )
    1.52 +		currentMapEditor()->setFilePath ("");
    1.53 +}
    1.54 +
    1.55 +void Main::fileImportKDE4Bookmarks()
    1.56 +{
    1.57 +	ImportKDE4Bookmarks im;
    1.58 +	im.transform();
    1.59 +	if (aborted!=fileLoad (im.getTransformedFile(),NewMap) && currentMapEditor() )
    1.60  		currentMapEditor()->setFilePath ("");
    1.61  }
    1.62  
    1.63 @@ -2092,7 +2110,7 @@
    1.64  		{
    1.65  			im.setFile (*it);
    1.66  			if (im.transform() && 
    1.67 -				success==fileLoad (im.getTransformedFile(),NewMap,FreemindMap) && 
    1.68 +				aborted!=fileLoad (im.getTransformedFile(),NewMap,FreemindMap) && 
    1.69  				currentMapEditor() )
    1.70  				currentMapEditor()->setFilePath ("");
    1.71  			++it;
    1.72 @@ -2232,9 +2250,20 @@
    1.73  	}
    1.74  }
    1.75  
    1.76 -void Main::fileExportKDEBookmarks()	//FIXME not scriptable yet
    1.77 +void Main::fileExportKDE3Bookmarks()	//FIXME not scriptable yet
    1.78  {
    1.79 -	ExportKDEBookmarks ex;
    1.80 +	ExportKDE3Bookmarks ex;
    1.81 +	MapEditor *me=currentMapEditor();
    1.82 +	if (me)
    1.83 +	{
    1.84 +		ex.setModel (me->getModel());
    1.85 +		ex.doExport();
    1.86 +	}	
    1.87 +}
    1.88 +
    1.89 +void Main::fileExportKDE4Bookmarks()	//FIXME not scriptable yet
    1.90 +{
    1.91 +	ExportKDE4Bookmarks ex;
    1.92  	MapEditor *me=currentMapEditor();
    1.93  	if (me)
    1.94  	{