# HG changeset patch # User insilmaril # Date 1143576244 0 # Node ID 7d91b35c1b6fff006ff540db6668648b44acf8d3 # Parent 96b8406d4a2f2ae3992dedb5d11f0e42e6d62cdd 1.7.13 Tabs in Konqueror diff -r 96b8406d4a2f -r 7d91b35c1b6f lang/vym_de.ts --- a/lang/vym_de.ts Mon Mar 27 20:21:58 2006 +0000 +++ b/lang/vym_de.ts Tue Mar 28 20:04:04 2006 +0000 @@ -718,7 +718,7 @@ Set application to open an URL - URLs öffnen mit... + URLs öffnen mit... Edit branch after adding it @@ -875,11 +875,11 @@ Enter path for pdf reader: - Pfad für pdf-Anwendung: + Pfad für pdf-Anwendung: Enter path for application to open an URL: - Pfad zum Öffnen von URLs: + Pfad zum Öffnen von URLs: Save &As @@ -954,7 +954,7 @@ Couldn't find a viewer to read vym.pdf. Please use Settings-> - Konnte kein Programm zum Anzeigen von vym.pdf + Konnte kein Programm zum Anzeigen von vym.pdf finden. Bitte benutzen Sie Einstellungen-> @@ -1552,6 +1552,31 @@ Use hide flags Während des Exports das "Verbergen" Flag verwenden + + Open URL in new tab + URL in neuen Tab öffnen + + + Warning + Warnung + + + Couldn't find a viewer to open %1. + + Konnte kein Programm zum Öffnen von %1 finden. + + + Please use Settings-> + Bitte setzen sie einen Pfad in Einstellungen-> + + + Couldn't start %1 to open a new tab in %2. + Konnte %1 nicht starten um einen neuen Tab mit %2 zu öffnen. + + + Set application to open PDF files + PDFs öffnen mit + MapEditor diff -r 96b8406d4a2f -r 7d91b35c1b6f lang/vym_en.ts --- a/lang/vym_en.ts Mon Mar 27 20:21:58 2006 +0000 +++ b/lang/vym_en.ts Tue Mar 28 20:04:04 2006 +0000 @@ -806,14 +806,6 @@ - Enter path for pdf reader: - - - - Enter path for application to open an URL: - - - Critcal error @@ -823,11 +815,6 @@ - Couldn't find a viewer to read vym.pdf. -Please use Settings-> - - - Add a branch by inserting and making selection its child @@ -1192,6 +1179,35 @@ Use hide flags + + Open URL in new tab + + + + Warning + + + + Couldn't find a viewer to open %1. + + + + + Please use Settings-> + + + + Set application to open an URL + + + + Couldn't start %1 to open a new tab in %2. + + + + Set application to open PDF files + + MapEditor diff -r 96b8406d4a2f -r 7d91b35c1b6f lang/vym_es.ts --- a/lang/vym_es.ts Mon Mar 27 20:21:58 2006 +0000 +++ b/lang/vym_es.ts Tue Mar 28 20:04:04 2006 +0000 @@ -746,7 +746,7 @@ Set application to open an URL - Configurar aplicación para abrir una URL + Configurar aplicación para abrir una URL Edit branch after adding it @@ -1017,11 +1017,11 @@ Enter path for pdf reader: - Ingrese ruta para lector de pdf: + Ingrese ruta para lector de pdf: Enter path for application to open an URL: - Ingrese la ruta para aplicación para abrir una URL: + Ingrese la ruta para aplicación para abrir una URL: Critcal error @@ -1036,7 +1036,7 @@ Couldn't find a viewer to read vym.pdf. Please use Settings-> - No puede buscar un visor para leer vym.pdf. + No puede buscar un visor para leer vym.pdf. Por favor use Configuración-> @@ -1410,6 +1410,31 @@ Use hide flags + + Open URL in new tab + + + + Warning + Advertencia + + + Couldn't find a viewer to open %1. + + + + + Please use Settings-> + + + + Couldn't start %1 to open a new tab in %2. + + + + Set application to open PDF files + + MapEditor diff -r 96b8406d4a2f -r 7d91b35c1b6f lang/vym_it.ts --- a/lang/vym_it.ts Mon Mar 27 20:21:58 2006 +0000 +++ b/lang/vym_it.ts Tue Mar 28 20:04:04 2006 +0000 @@ -748,7 +748,7 @@ Set application to open an URL - Scegli l'applicazione per aprire gli URL + Scegli l'applicazione per aprire gli URL Edit branch after adding it @@ -1024,11 +1024,11 @@ Enter path for pdf reader: - Seleziona il percorso del lettore pdf: + Seleziona il percorso del lettore pdf: Enter path for application to open an URL: - Seleziona il percorso dell'aplicazione per aprire gli URL: + Seleziona il percorso dell'aplicazione per aprire gli URL: Critcal error @@ -1043,7 +1043,7 @@ Couldn't find a viewer to read vym.pdf. Please use Settings-> - Non è possibile trovare un lettore per il file vym.pdf + Non è possibile trovare un lettore per il file vym.pdf Per favore usare Preferenze-> @@ -1419,6 +1419,31 @@ Couldn't open map %1 + + Open URL in new tab + + + + Warning + Attenzione + + + Couldn't find a viewer to open %1. + + + + + Please use Settings-> + + + + Couldn't start %1 to open a new tab in %2. + + + + Set application to open PDF files + + MapEditor diff -r 96b8406d4a2f -r 7d91b35c1b6f main.cpp --- a/main.cpp Mon Mar 27 20:21:58 2006 +0000 +++ b/main.cpp Tue Mar 28 20:04:04 2006 +0000 @@ -45,6 +45,7 @@ QAction *actionEditMoveDown; QAction *actionEditToggleScroll; QAction *actionEditOpenURL; +QAction *actionEditOpenURLTab; QAction *actionEditURL; QAction *actionEditHeading2URL; QAction *actionEditBugzilla2URL; diff -r 96b8406d4a2f -r 7d91b35c1b6f mainwindow.cpp --- a/mainwindow.cpp Mon Mar 27 20:21:58 2006 +0000 +++ b/mainwindow.cpp Tue Mar 28 20:04:04 2006 +0000 @@ -101,6 +101,7 @@ extern QAction *actionEditMoveDown; extern QAction *actionEditToggleScroll; extern QAction* actionEditOpenURL; +extern QAction* actionEditOpenURLTab; extern QAction* actionEditURL; extern QAction* actionEditHeading2URL; extern QAction* actionEditBugzilla2URL; @@ -207,6 +208,8 @@ makeSubDirs (clipboardDir); clipboardEmpty=true; + procBrowser=NULL; + // FIXME not used currently // Set random seed (random used for object IDs) // QTime t = QTime::currentTime(); // set random seed @@ -519,6 +522,11 @@ a->setEnabled (false); actionEditOpenURL=a; + a = new QAction( tr( "Open URL in new tab" ), QPixmap(), tr( "Open URL in new tab" ), ALT + Key_U, this, "urltab" ); + connect( a, SIGNAL( activated() ), this, SLOT( editOpenURLTab() ) ); + a->setEnabled (false); + actionEditOpenURLTab=a; + a = new QAction( tr( "Edit URL" ), QPixmap(), tr( "Edit URL"+QString("...") ), SHIFT + CTRL + Key_U, this, "url" ); connect( a, SIGNAL( activated() ), this, SLOT( editURL() ) ); a->setEnabled (false); @@ -1134,6 +1142,7 @@ branchContextMenu->insertSeparator(); actionEditOpenURL->addTo ( branchContextMenu ); + actionEditOpenURLTab->addTo ( branchContextMenu ); actionEditURL->addTo ( branchContextMenu ); actionEditHeading2URL->addTo ( branchContextMenu ); if (settings.readBoolEntry( "/vym/mainwindow/showTestMenu",false)) @@ -2177,8 +2186,53 @@ void Main::editOpenURL() { + // Open new browser if (currentMapEditor()) - currentMapEditor()->openURL(); + { + QString url=currentMapEditor()->getURL(); + if (url=="") return; + QString browser=settings.readEntry("/vym/mainwindow/readerURL" ); + procBrowser = new QProcess( this ); + + procBrowser->addArgument( browser); + procBrowser->addArgument( url); + + if ( !procBrowser->start() ) + { + // try to set path to browser + QMessageBox::warning(0, + tr("Warning"), + tr("Couldn't find a viewer to open %1.\n").arg(url)+ + tr("Please use Settings->")+tr("Set application to open an URL")); + settingsURL() ; + } + } +} +void Main::editOpenURLTab() +{ + if (currentMapEditor()) + { + QString url=currentMapEditor()->getURL(); + if (url=="") return; + QString browser=settings.readEntry("/vym/mainwindow/readerURL" ); + if (browser.contains("konqueror") && procBrowser && procBrowser->isRunning()) + { + // Try to open new tab in existing browser + QProcess *p=new QProcess (this); + p->addArgument ("dcop"); + p->addArgument (QString("konqueror-%1").arg(procBrowser->processIdentifier())); + p->addArgument ("konqueror-mainwindow#1"); + p->addArgument ("newTab"); + p->addArgument (url); + if ( !p->start() ) + // try to set browser + QMessageBox::warning(0, + tr("Warning"), + tr("Couldn't start %1 to open a new tab in %2.").arg("dcop").arg("konqueror")); + } else + // Open new browser + editOpenURL(); + } } void Main::editURL() @@ -2573,7 +2627,7 @@ // Default browser is set in constructor bool ok; QString text = QInputDialog::getText( - "VYM", tr("Enter path for pdf reader:"), QLineEdit::Normal, + "VYM", tr("Set application to open PDF files")+":", QLineEdit::Normal, settings.readEntry("/vym/mainwindow/readerPDF"), &ok, this ); if (ok) settings.writeEntry ("/vym/mainwindow/readerPDF",text); @@ -2586,7 +2640,7 @@ // Default browser is set in constructor bool ok; QString text = QInputDialog::getText( - "VYM", tr("Enter path for application to open an URL:"), QLineEdit::Normal, + "VYM", tr("Set application to open an URL")+":", QLineEdit::Normal, settings.readEntry("/vym/mainwindow/readerURL") , &ok, this ); if (ok) @@ -2686,10 +2740,11 @@ if ( !pdfProc->start() ) { // error handling - QMessageBox::critical(0, - tr("Critcal error"), - tr("Couldn't find a viewer to read vym.pdf.\n" - "Please use Settings->")+tr("Set application to open pdf files")); + QMessageBox::warning(0, + tr("Warning"), + tr("Couldn't find a viewer to open %1.\n").arg("vym.pdf")+ + tr("Please use Settings->")+tr("Set application to open PDF files")); + settingsPDF(); return; } } diff -r 96b8406d4a2f -r 7d91b35c1b6f mainwindow.h --- a/mainwindow.h Mon Mar 27 20:21:58 2006 +0000 +++ b/mainwindow.h Tue Mar 28 20:04:04 2006 +0000 @@ -91,6 +91,7 @@ void editFindChanged(); public slots: void editOpenURL(); + void editOpenURLTab(); private slots: void editURL(); void editHeading2URL(); @@ -176,12 +177,13 @@ void helpAboutQT(); private: - QCanvas* canvas; +// not needed? QCanvas* canvas; QTabWidget *tabWidget; FindWindow *findWindow; QStringList lastMaps; int maxLastMaps; QString lastFileDir; + QProcess *procBrowser; }; diff -r 96b8406d4a2f -r 7d91b35c1b6f mapeditor.cpp --- a/mapeditor.cpp Mon Mar 27 20:21:58 2006 +0000 +++ b/mapeditor.cpp Tue Mar 28 20:04:04 2006 +0000 @@ -59,6 +59,7 @@ extern QAction *actionEditMoveDown; extern QAction *actionEditToggleScroll; extern QAction *actionEditOpenURL; +extern QAction *actionEditOpenURLTab; extern QAction *actionEditURL; extern QAction *actionEditHeading2URL; extern QAction *actionEditBugzilla2URL; @@ -2211,28 +2212,6 @@ EOFind=false; } -void MapEditor::openURL() -{ - if (selection ) - { - if (typeid(*selection) == typeid(BranchObj) || - typeid(*selection) == typeid(MapCenterObj)) - { - QString url=((BranchObj*)selection)->getURL(); - - QProcess *proc = new QProcess( this ); - - proc->addArgument( settings.readEntry("/vym/mainwindow/readerURL" )); - proc->addArgument( url); - - if ( !proc->start() ) - // error handling - if (mainWindow->settingsURL() ) - openURL(); - } - } -} - void MapEditor::editURL() { if (selection && (typeid(*selection) == typeid(BranchObj) || @@ -2253,6 +2232,15 @@ } } +QString MapEditor::getURL() +{ + if (selection && (typeid(*selection) == typeid(BranchObj) || + typeid(*selection) == typeid(MapCenterObj)) ) + return ((BranchObj*)selection)->getURL(); + else + return ""; +} + void MapEditor::editHeading2URL() { if (selection && (typeid(*selection) == typeid(BranchObj) || @@ -2531,10 +2519,15 @@ actionEditToggleScroll->setOn(false); if ( bo->getURL().isEmpty() ) + { actionEditOpenURL->setEnabled (false); + actionEditOpenURLTab->setEnabled (false); + } else + { actionEditOpenURL->setEnabled (true); - + actionEditOpenURLTab->setEnabled (true); + } if ( bo->getVymLink().isEmpty() ) { actionEditOpenVymLink->setEnabled (false); @@ -3172,7 +3165,12 @@ { // Do not move, if systemFlag clicked if (foname=="url") - openURL(); + { + if (e->state() & QMouseEvent::ControlButton) + mainWindow->editOpenURLTab(); + else + mainWindow->editOpenURL(); + } else if (foname=="vymLink") { mainWindow->editOpenVymLink(); diff -r 96b8406d4a2f -r 7d91b35c1b6f mapeditor.h --- a/mapeditor.h Mon Mar 27 20:21:58 2006 +0000 +++ b/mapeditor.h Tue Mar 28 20:04:04 2006 +0000 @@ -122,8 +122,8 @@ virtual void setViewCenter(); // needed for zooming BranchObj* findText(QString,bool); // Find object void findReset(); // Reset Find - void openURL(); // open URL in external browser void editURL(); // edit the URL + QString getURL(); // returns URL of selection or "" void editHeading2URL(); // copy heading to URL void editBugzilla2URL(); // create URL to Bugzilla void editFATE2URL(); // create URL to FATE diff -r 96b8406d4a2f -r 7d91b35c1b6f tex/vym.changelog --- a/tex/vym.changelog Mon Mar 27 20:21:58 2006 +0000 +++ b/tex/vym.changelog Tue Mar 28 20:04:04 2006 +0000 @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Mar 28 21:54:31 CEST 2006 - uwe + +- Version 1.7.13 +- Feature: Konqueror can open URLs in new tabs now. + ------------------------------------------------------------------- Thu Mar 23 13:26:46 CET 2006 - uwedr diff -r 96b8406d4a2f -r 7d91b35c1b6f tex/vym.tex --- a/tex/vym.tex Mon Mar 27 20:21:58 2006 +0000 +++ b/tex/vym.tex Tue Mar 28 20:04:04 2006 +0000 @@ -508,6 +508,10 @@ \begin{center} \includegraphics[width=0.5cm]{flag-url.png} \end{center} +If you use konqueror as browser, \vym will remember the konqueror which +was opened first by \vym. You can also press \key{Alt} and click to +open the link in a new tab then. + If you want to keep bookmarks in a map, select a branch where you want to add the bookmark, then simply drag the URL from your browser to the map. Also you could use an existing heading as URL: Right click onto the @@ -847,7 +851,7 @@ \subsubsection*{Create a xLink} Choose the link mode from the modifier toolbar (by clicking or pressing \key{L}). Select the branch, where the xLink should start. Press the -modifier key \key{Ctr} and simultanously click on the branch where the +modifier key \key{Ctrl} and simultanously click on the branch where the link should end. (The link is already drawn before you release the mouse key). If you release the mouse over a branch the xLink becomes permanent. diff -r 96b8406d4a2f -r 7d91b35c1b6f version.h --- a/version.h Mon Mar 27 20:21:58 2006 +0000 +++ b/version.h Tue Mar 28 20:04:04 2006 +0000 @@ -2,7 +2,7 @@ #define VERSION_H #define __VYM "VYM" -#define __VYM_VERSION "1.7.12" -#define __BUILD_DATE "March 27, 2006" +#define __VYM_VERSION "1.7.13" +#define __BUILD_DATE "March 28, 2006" #endif