1.7.17
authorinsilmaril
Mon, 15 May 2006 07:32:10 +0000
changeset 32740c4806dfef2
parent 326 7758f3ceb98a
child 328 33310803546c
1.7.17
mainwindow.cpp
     1.1 --- a/mainwindow.cpp	Mon May 15 07:32:10 2006 +0000
     1.2 +++ b/mainwindow.cpp	Mon May 15 07:32:10 2006 +0000
     1.3 @@ -1072,6 +1072,7 @@
     1.4  	a->setToggleAction(true);
     1.5  	a->setOn ( settings.readBoolEntry ("/vym/mapeditor/editmode/useDelKey",false) );
     1.6      a->addTo( menu );
     1.7 +    connect( a, SIGNAL( activated() ), this, SLOT( settingsToggleDelKey() ) );
     1.8  	actionSettingsUseDelKey=a;
     1.9  
    1.10      a= new QAction( tr( "Use exclusive flags in flag toolbars" ), QPixmap(), tr( "Exclusive flags" ), 0, this, "flaggroups" );
    1.11 @@ -1836,10 +1837,29 @@
    1.12  
    1.13  void Main::fileImportFirefoxBookmarks()
    1.14  {
    1.15 -	ImportFirefoxBookmarks im;
    1.16 -	im.transform();
    1.17 -	if (success==fileLoad (im.getTransformedFile(),NewMap) && currentMapEditor() )
    1.18 -		currentMapEditor()->setFilePath ("");
    1.19 +	QFileDialog *fd=new QFileDialog( this);
    1.20 +	fd->setDir (vymBaseDir.homeDirPath()+"/.mozilla/firefox");
    1.21 +	fd->setMode (QFileDialog::ExistingFiles);
    1.22 +	fd->addFilter ("Firefox "+tr("Bookmarks")+" (*.html)");
    1.23 +	fd->setCaption(tr("Import")+" "+"Firefox "+tr("Bookmarks"));
    1.24 +	fd->show();
    1.25 +
    1.26 +	if ( fd->exec() == QDialog::Accepted )
    1.27 +	{
    1.28 +		ImportFirefoxBookmarks im;
    1.29 +	    QStringList flist = fd->selectedFiles();
    1.30 +		QStringList::Iterator it = flist.begin();
    1.31 +		while( it != flist.end() ) 
    1.32 +		{
    1.33 +			im.setFile (*it);
    1.34 +			if (im.transform() && 
    1.35 +				success==fileLoad (im.getTransformedFile(),NewMap) && 
    1.36 +				currentMapEditor() )
    1.37 +				currentMapEditor()->setFilePath ("");
    1.38 +			++it;
    1.39 +		}
    1.40 +	}
    1.41 +	delete (fd);
    1.42  }
    1.43  
    1.44  void Main::fileImportMM()
    1.45 @@ -2640,6 +2660,17 @@
    1.46  	return ok;
    1.47  }
    1.48  
    1.49 +void Main::settingsToggleDelKey()
    1.50 +{
    1.51 +	if (actionSettingsUseDelKey->isOn())
    1.52 +	{
    1.53 +		actionEditDelete->setAccel (QKeySequence (Key_Delete));
    1.54 +	} else
    1.55 +	{
    1.56 +		actionEditDelete->setAccel (QKeySequence (""));
    1.57 +	}
    1.58 +}
    1.59 +
    1.60  void Main::windowToggleNoteEditor()
    1.61  {
    1.62  	if (textEditor->showWithMain() )