1.1 --- a/mainwindow.cpp Wed May 31 12:27:38 2006 +0000
1.2 +++ b/mainwindow.cpp Wed May 31 12:27:38 2006 +0000
1.3 @@ -1161,9 +1161,9 @@
1.4 actionEditOpenURLTab->addTo ( branchContextMenu );
1.5 actionEditURL->addTo ( branchContextMenu );
1.6 actionEditHeading2URL->addTo ( branchContextMenu );
1.7 + actionEditBugzilla2URL->addTo( branchContextMenu );
1.8 if (settings.readBoolEntry( "/vym/mainwindow/showTestMenu",false))
1.9 {
1.10 - actionEditBugzilla2URL->addTo( branchContextMenu );
1.11 actionEditFATE2URL->addTo( branchContextMenu );
1.12 }
1.13 branchContextMenu->insertSeparator();
1.14 @@ -2230,23 +2230,40 @@
1.15 QString url=currentMapEditor()->getURL();
1.16 if (url=="") return;
1.17 QString browser=settings.readEntry("/vym/mainwindow/readerURL" );
1.18 - if (browser.contains("konqueror") && procBrowser && procBrowser->isRunning())
1.19 + if (procBrowser && procBrowser->isRunning())
1.20 {
1.21 - // Try to open new tab in existing browser
1.22 - QProcess *p=new QProcess (this);
1.23 - p->addArgument ("dcop");
1.24 - p->addArgument (QString("konqueror-%1").arg(procBrowser->processIdentifier()));
1.25 - p->addArgument ("konqueror-mainwindow#1");
1.26 - p->addArgument ("newTab");
1.27 - p->addArgument (url);
1.28 - if ( !p->start() )
1.29 - // try to set browser
1.30 - QMessageBox::warning(0,
1.31 - tr("Warning"),
1.32 - tr("Couldn't start %1 to open a new tab in %2.").arg("dcop").arg("konqueror"));
1.33 - } else
1.34 - // Open new browser
1.35 - editOpenURL();
1.36 + if (browser.contains("konqueror"))
1.37 + {
1.38 + // Try to open new tab in existing konqueror started previously by vym
1.39 + QProcess *p=new QProcess (this);
1.40 + p->addArgument ("dcop");
1.41 + p->addArgument (QString("konqueror-%1").arg(procBrowser->processIdentifier()));
1.42 + p->addArgument ("konqueror-mainwindow#1");
1.43 + p->addArgument ("newTab");
1.44 + p->addArgument (url);
1.45 + if ( !p->start() )
1.46 + // try to set browser
1.47 + QMessageBox::warning(0,
1.48 + tr("Warning"),
1.49 + tr("Couldn't start %1 to open a new tab in %2.").arg("dcop").arg("konqueror"));
1.50 + return;
1.51 + } else if (browser.contains ("firefox") || browser.contains ("mozilla") )
1.52 + {
1.53 + // Try to open new tab in firefox
1.54 + QProcess *p=new QProcess (this);
1.55 + p->addArgument (browser);
1.56 + p->addArgument ("-remote");
1.57 + p->addArgument (QString("openurl(%1,new-tab)").arg(url));
1.58 + if ( !p->start() )
1.59 + // try to set browser
1.60 + QMessageBox::warning(0,
1.61 + tr("Warning"),
1.62 + tr("Couldn't start %1 to open a new tab").arg(browser));
1.63 + return;
1.64 + }
1.65 + }
1.66 + // Open new browser
1.67 + editOpenURL();
1.68 }
1.69 }
1.70