mainwindow.cpp
changeset 216 d5a0ea67c91d
parent 205 30c4a6c7ff10
child 227 38ad83f1d4ce
     1.1 --- a/mainwindow.cpp	Wed Feb 15 12:54:55 2006 +0000
     1.2 +++ b/mainwindow.cpp	Tue Feb 21 16:18:23 2006 +0000
     1.3 @@ -390,6 +390,10 @@
     1.4  	connect( a, SIGNAL( activated() ), this, SLOT( fileImportKDEBookmarks() ) );
     1.5  	a->addTo (importMenu);
     1.6  
     1.7 +	a = new QAction( tr( "Import")+" "+tr("Mind Manager" ), QPixmap(), tr("Mind Manager"), 0, this, "importMM" );
     1.8 +	connect( a, SIGNAL( activated() ), this, SLOT( fileImportMM() ) );
     1.9 +	a->addTo (importMenu);
    1.10 +
    1.11      a = new QAction( tr( "Import directory structure (experimental)" ), QPixmap(), tr( "Import Dir"+QString("...") ), 0, this, "export" );
    1.12      connect( a, SIGNAL( activated() ), this, SLOT( fileImportDir() ) );
    1.13      a->addTo( importMenu);
    1.14 @@ -1123,7 +1127,9 @@
    1.15  
    1.16  	branchContextMenu->insertSeparator();	
    1.17  	actionFormatIncludeImagesVer->addTo( branchContextMenu );
    1.18 -	// FIXME not implemented yet actionFormatIncludeImagesHor->addTo( branchContextMenu );
    1.19 +    if (settings.readBoolEntry( "/vym/mainwindow/showTestMenu",false)) 
    1.20 +		// FIXME not implemented yet 
    1.21 +		actionFormatIncludeImagesHor->addTo( branchContextMenu );
    1.22  	actionFormatHideLinkUnselected->addTo( branchContextMenu );
    1.23  
    1.24  	// Context Menu for links in a branch menu
    1.25 @@ -1778,12 +1784,6 @@
    1.26  	fileSaveAs (CompleteMap);
    1.27  }
    1.28  
    1.29 -void Main::fileImportDir()
    1.30 -{
    1.31 -	if (currentMapEditor())
    1.32 -		currentMapEditor()->importDir();	
    1.33 -}
    1.34 -
    1.35  void Main::fileImportKDEBookmarks()
    1.36  {
    1.37  	ImportKDEBookmarks im;
    1.38 @@ -1792,6 +1792,44 @@
    1.39  		currentMapEditor()->setFilePath ("");
    1.40  }
    1.41  
    1.42 +void Main::fileImportMM()
    1.43 +{
    1.44 +	ImportMM im;
    1.45 +
    1.46 +	QFileDialog *fd=new QFileDialog( this);
    1.47 +	if (!lastFileDir.isEmpty()) 
    1.48 +		fd->setDir (lastFileDir);
    1.49 +	fd->setMode (QFileDialog::ExistingFiles);
    1.50 +	fd->addFilter ("Mind Manager (*.mmap)");
    1.51 +	fd->setCaption(tr("Import")+" "+"Mind Manager");
    1.52 +	fd->show();
    1.53 +
    1.54 +	if ( fd->exec() == QDialog::Accepted )
    1.55 +	{
    1.56 +		lastFileDir=fd->dirPath();
    1.57 +	    QStringList flist = fd->selectedFiles();
    1.58 +		QStringList::Iterator it = flist.begin();
    1.59 +		while( it != flist.end() ) 
    1.60 +		{
    1.61 +			im.setFile (*it);
    1.62 +			if (im.transform() && 
    1.63 +				success==fileLoad (im.getTransformedFile(),NewMap) && 
    1.64 +				currentMapEditor() )
    1.65 +				currentMapEditor()->setFilePath ("");
    1.66 +
    1.67 +			++it;
    1.68 +		}
    1.69 +	}
    1.70 +	delete (fd);
    1.71 +
    1.72 +}
    1.73 +
    1.74 +void Main::fileImportDir()
    1.75 +{
    1.76 +	if (currentMapEditor())
    1.77 +		currentMapEditor()->importDir();	
    1.78 +}
    1.79 +
    1.80  void Main::fileExportXML()
    1.81  {
    1.82  	if (currentMapEditor())