--------------Boundary-00=_7HHC6RK4JGWBEFXOSPVF Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline I always dislike sites that make me open way too many Konqueror-windows by= =20 using "target=3D_blank" and the like when it's not needed. Now I wrote a sm= all=20 patch for Konqueror, so you have the option not to open a new window but=20 rather open the link in the current window. I suppose I didn't use the best= =20 way to code this, but as it's only my second look at C/C++ code I just=20 decided to mimic slotPopupNewTab(). At least it works and maybe someone fin= ds=20 it useful. There's one (small) problem at least: the menu-option doesn't us= e=20 an icon. A good thing to implement might be to only show the 'open in curre= nt=20 window'-option when the link wants to open a new window, so the menu doesn'= t=20 get too cluttered with options that aren't of any use in a particular=20 situation. Please tell me what's wrong with the patch if you don't like it, I don't mi= nd=20 critical comments too much :). Jonathan Brugge --------------Boundary-00=_7HHC6RK4JGWBEFXOSPVF Content-Type: text/x-diff; charset="us-ascii"; name="current_window_cc.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="current_window_cc.diff" --- konq_mainwindow.cc Mon Apr 29 21:08:52 2002 +++ /home/kde3/konq_patches/konq_mainwindow.cc Mon Apr 29 21:36:13 2002 @@ -1991,6 +1991,17 @@ } } +void KonqMainWindow::slotOpenInCurrentWindow() +{ + KURL url; + KFileItemListIterator it ( popupItems ); + for ( ; it.current(); ++it ) + { + url = (*it)->url(); + slotOpenURL(url); + } +} + void KonqMainWindow::slotRemoveView() { // takes care of choosing the new active view @@ -3410,12 +3421,16 @@ KAction *actNewTab = new KAction( i18n( "New Tab" ), "tab_new", 0, this, SLOT( slotPopupNewTab() ), &popupMenuCollection, "newtab" ); actNewTab->setStatusText( i18n( "Open the document in a new tab" ) ); + KAction *actCurrentWindow = new KAction( i18n( "Current Window" ), 0, this, SLOT( slotOpenInCurrentWindow() ), &popupMenuCollection, "currentwindow" ); + actCurrentWindow->setStatusText( i18n( "Open the document in the current window" ) ); + QString name; for ( int i = 0; i < 30; i++) { name = pPopupMenu.text(pPopupMenu.idAt(i)); if (name == i18n( "New Window" )) { kdDebug(1202) << "Adding at index " << i+1 << endl; actNewTab->plug( &pPopupMenu, i+1 ); + actCurrentWindow->plug( &pPopupMenu, i+2 ); break; } } --------------Boundary-00=_7HHC6RK4JGWBEFXOSPVF Content-Type: text/x-diff; charset="us-ascii"; name="current_window_h.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="current_window_h.diff" --- ./konq_mainwindow.h Mon Apr 29 21:08:53 2002 +++ /home/kde3/konq_patches/konq_mainwindow.h Mon Apr 29 21:08:37 2002 @@ -370,6 +370,7 @@ void slotBreakOffTab(); void slotBreakOffTabPopup(); void slotPopupNewTab(); + void slotOpenInCurrentWindow(); void slotRemoveView(); void slotRemoveTab(); void slotRemoveTabPopup(); --------------Boundary-00=_7HHC6RK4JGWBEFXOSPVF-- >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<