[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    [patch] to add "close on click" functionality to konqueror
From:       Luke Kenneth Casson Leighton <lkcl () lkcl ! net>
Date:       2004-07-19 12:48:27
Message-ID: 20040719124827.GA27960 () lkcl ! net
[Download RAW message or body]

patch attached - compilation is taking so damn long that i'm sending
this to the list for review assistance and comments before the thing's
finished.

[i've raised a bug 260195@bugs.debian.org for this one.]

the idea is to have konqueror close a window when you click on an icon
_in_ a window.

the principle is to have desktop icons and also icons in a folder where
the icons run the following commands:

icon 1: konqueror --profile Office
icon 2: konqueror --profile Games
icon 3: konqueror --profile Internet
...
icon N: konqueror --profile NNNN

then, when you click on the desktop icons, the profile opens
up a Konqueror window which has no menu, no toolbars - nothing
but icons e.g.  for the Office profile it will show you a
whole bunch of KOffice and OpenOffice icons.

now, in the Office profile, the close-on-click option is selected.

so, when you click one of the icons, the program is run, and also
the konqueror Office profile window closes.

in other words, konqueror-with-the-new-"close-on-click" option turns
konqueror into a menu.

the neat thing is that the Office profile can have a background
specific to Office usage, it can have its window location and
size set, and can generally be made really useful and simple.

on the distribution i am setting up i intend to use this
to REPLACE the kde menu because i find the KDE menu to be
so overcrowded, cluttered and awkward that it's a complete arse to
find anything and to navigate to it.

with a really stonking big window [konqueror --profile Internet]
covering 20% of the desktop, mouse accuracy is a secondary
consideration :)

i've been using computers for 15 years and i find "Start" menus to be
totally impossible to navigate correctly and quickly with a mouse.

the guys at microsoft in the NT team who wrote newshell.exe
didn't do us many favours :)

anyway.

issues i'm having is that closeURL() doesn't do what i expect
it to do: close the URL i.e file:/home/whoever/whatever :)

so, how do i get to close the actual konqueror window i.e.
emulate the same effect as ctrl-q or alt-f4 or
whatever-it-takes-to-activate-the-file-quit-menu-option?

thanks,

l.


-- 
-- 
Information I post is with honesty, integrity, and the expectation that
you will take full responsibility if acting on the information contained,
and that, should you find it to be flawed or even mildly useful, you
will act with both honesty and integrity in return - and tell me.
--
<a href="http://lkcl.net">      lkcl.net      </a> <br />
<a href="mailto:lkcl@lkcl.net"> lkcl@lkcl.net </a> <br />


diff -ur orig/kdebase-3.2.2/kcontrol/konq/behaviour.cpp \
                kdebase-3.2.2/kcontrol/konq/behaviour.cpp
--- orig/kdebase-3.2.2/kcontrol/konq/behaviour.cpp	2003-10-28 21:57:38.000000000 \
                +0000
+++ kdebase-3.2.2/kcontrol/konq/behaviour.cpp	2004-07-19 12:52:17.000000000 +0100
@@ -65,6 +65,14 @@
     connect(cbNewWin, SIGNAL(clicked()), this, SLOT(changed()));
     connect(cbNewWin, SIGNAL(toggled(bool)), SLOT(updateWinPixmap(bool)));
 
+   // ----
+
+    cbClickExit = new QCheckBox(i18n("&Close Window on new"), vbox);
+    QWhatsThis::add( cbClickExit, i18n("If this option is checked, Konqueror will \
close the current" +                                    "window when you run a \
program, URL or open a new folder.")); +    connect(cbClickExit, SIGNAL(clicked()), \
this, SLOT(changed())); +    connect(cbClickExit, SIGNAL(toggled(bool)), \
SLOT(updateWinPixmap(bool))); +
     // ----
 
     cbListProgress = new QCheckBox( i18n( "&Show network operations in a single \
window" ), vbox ); @@ -171,6 +179,9 @@
     cbNewWin->setChecked( g_pConfig->readBoolEntry("AlwaysNewWin", false) );
     updateWinPixmap(cbNewWin->isChecked());
 
+    cbClickExit->setChecked( g_pConfig->readBoolEntry("ClickExit", false) );
+    updateWinPixmap(cbClickExit->isChecked());
+
     homeURL->setURL(g_pConfig->readPathEntry("HomeURL", "~"));
 
     bool stips = g_pConfig->readBoolEntry( "ShowFileTips", true );
@@ -200,6 +211,7 @@
 void KBehaviourOptions::defaults()
 {
     cbNewWin->setChecked(false);
+    cbClickExit->setChecked(false);
 
     homeURL->setURL("~");
 
@@ -223,6 +235,7 @@
     g_pConfig->setGroup( groupname );
 
     g_pConfig->writeEntry( "AlwaysNewWin", cbNewWin->isChecked() );
+    g_pConfig->writeEntry( "ClickExit", cbClickExit->isChecked() );
     g_pConfig->writePathEntry( "HomeURL", homeURL->url().isEmpty()? "~" : \
homeURL->url() );  
     g_pConfig->writeEntry( "ShowFileTips", cbShowTips->isChecked() );
diff -ur orig/kdebase-3.2.2/kcontrol/konq/behaviour.h \
                kdebase-3.2.2/kcontrol/konq/behaviour.h
--- orig/kdebase-3.2.2/kcontrol/konq/behaviour.h	2003-10-28 21:57:38.000000000 +0000
+++ kdebase-3.2.2/kcontrol/konq/behaviour.h	2004-07-19 11:25:17.000000000 +0100
@@ -54,6 +54,7 @@
   QString groupname;
 
   QCheckBox *cbNewWin;
+  QCheckBox *cbClickExit;
   QCheckBox *cbListProgress;
 
   QLabel *winPixmap;
diff -ur orig/kdebase-3.2.2/libkonq/konq_dirpart.cc \
                kdebase-3.2.2/libkonq/konq_dirpart.cc
--- orig/kdebase-3.2.2/libkonq/konq_dirpart.cc	2004-01-10 20:52:43.000000000 +0000
+++ kdebase-3.2.2/libkonq/konq_dirpart.cc	2004-07-19 11:46:40.000000000 +0100
@@ -205,12 +205,18 @@
         KParts::WindowArgs wargs;
         KParts::ReadOnlyPart* dummy;
         emit m_extension->createNewWindow( url, args, wargs, dummy );
+
     }
     else
     {
         kdDebug() << "emit m_extension->openURLRequest( " << url.url() << "," << \
args.serviceType << ")" << endl;  emit m_extension->openURLRequest( url, args );
     }
+	if (KonqFMSettings::settings()->alwaysNewWin() && 
+	    KonqFMSettings::settings()->clickExit())
+	{
+		closeURL();
+	}
 }
 
 void KonqDirPart::mmbClicked( KFileItem * fileItem )
diff -ur orig/kdebase-3.2.2/libkonq/konq_settings.cc \
                kdebase-3.2.2/libkonq/konq_settings.cc
--- orig/kdebase-3.2.2/libkonq/konq_settings.cc	2004-02-05 15:05:52.000000000 +0000
+++ kdebase-3.2.2/libkonq/konq_settings.cc	2004-07-19 11:33:27.000000000 +0100
@@ -95,6 +95,7 @@
 
   // Behaviour
   m_alwaysNewWin = config->readBoolEntry( "AlwaysNewWin", FALSE );
+  m_clickExit = config->readBoolEntry( "ClickExit", FALSE );
 
   m_homeURL = config->readPathEntry("HomeURL", "~");
 
diff -ur orig/kdebase-3.2.2/libkonq/konq_settings.h \
                kdebase-3.2.2/libkonq/konq_settings.h
--- orig/kdebase-3.2.2/libkonq/konq_settings.h	2004-02-05 15:05:52.000000000 +0000
+++ kdebase-3.2.2/libkonq/konq_settings.h	2004-07-19 11:32:15.000000000 +0100
@@ -77,6 +77,7 @@
   bool underlineLink() const { return m_underlineLink; }
   bool fileSizeInBytes() const { return m_fileSizeInBytes; }
   bool alwaysNewWin() const { return m_alwaysNewWin; }
+  bool clickExit() const { return m_clickExit; }
   const QString & homeURL() const { return m_homeURL; }
 
   bool showFileTips() const {return m_showFileTips; }
@@ -103,6 +104,7 @@
   bool m_underlineLink;
   bool m_fileSizeInBytes;
   bool m_alwaysNewWin;
+  bool m_clickExit;
   bool m_bTreeFollow;
 
   QMap<QString, QString> m_embedMap;



>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic