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

List:       kde-devel
Subject:    [PATCH] netscape plugin viewer configuration
From:       Till Krech <till () snafu ! de>
Date:       2002-10-27 17:58:52
[Download RAW message or body]

Hi,

I made this small patch to the kcontrol module for the nspluginviewer.
It replaces the lineedit for the plugin scan paths with a KURLRequester which 
improves greatly the usability (and consistency with the rest of KDE).

Is there any chance that it can still go in ?

regards, Till
-- 
Till Krech from Berlin, Germany is happy with
SuSE Linux 8.0 (i386) 2.4.18-64GB-SMP * KDE: 3.0.9 (KDE 3.1 RC1)
Qt: 3.1.0-b2 * gcc version 3.2

["kcontrol-konqhtml.diff" (text/x-diff)]

Index: nsconfigwidget.ui
===================================================================
RCS file: /home/kde/kdebase/kcontrol/konqhtml/nsconfigwidget.ui,v
retrieving revision 1.4
diff -u -p -r1.4 nsconfigwidget.ui
--- nsconfigwidget.ui	2002/08/14 11:58:31	1.4
+++ nsconfigwidget.ui	2002/10/27 17:46:38
@@ -179,7 +179,7 @@
                                 </property>
                             </widget>
                             <widget row="0"  column="0" >
-                                <class>QLineEdit</class>
+                                <class>KURLRequester</class>
                                 <property stdset="1">
                                     <name>name</name>
                                     <cstring>dirEdit</cstring>
@@ -188,6 +188,10 @@
                                     <name>enabled</name>
                                     <bool>false</bool>
                                 </property>
+                                <property stdset="1">
+                                    <name>mode</name>
+                                    <number>18</number>
+                                </property>
                             </widget>
                             <widget row="3"  column="2" >
                                 <class>QPushButton</class>
@@ -254,28 +258,6 @@
                                     </size>
                                 </property>
                             </spacer>
-                            <widget row="0"  column="1" >
-                                <class>QToolButton</class>
-                                <property stdset="1">
-                                    <name>name</name>
-                                    <cstring>dirBrowse</cstring>
-                                </property>
-                                <property stdset="1">
-                                    <name>enabled</name>
-                                    <bool>false</bool>
-                                </property>
-                                <property stdset="1">
-                                    <name>sizePolicy</name>
-                                    <sizepolicy>
-                                        <hsizetype>1</hsizetype>
-                                        <vsizetype>1</vsizetype>
-                                    </sizepolicy>
-                                </property>
-                                <property stdset="1">
-                                    <name>text</name>
-                                    <string>...</string>
-                                </property>
-                            </widget>
                         </grid>
                     </widget>
                 </vbox>
Index: pluginopts.cpp
===================================================================
RCS file: /home/kde/kdebase/kcontrol/konqhtml/pluginopts.cpp,v
retrieving revision 1.15
diff -u -p -r1.15 pluginopts.cpp
--- pluginopts.cpp	2002/10/04 22:45:58	1.15
+++ pluginopts.cpp	2002/10/27 17:46:38
@@ -23,6 +23,7 @@
 #include <kiconloader.h>
 #include <qlineedit.h>
 #include <kfiledialog.h>
+#include <kurlrequester.h>
 
 #include <qlayout.h>
 #include <qtoolbutton.h>
@@ -132,9 +133,8 @@ void KPluginOptions::defaults()
 
     m_widget->scanAtStartup->setChecked( false );
 
-    m_widget->dirEdit->setText("");
+    m_widget->dirEdit->setURL("");
     m_widget->dirEdit->setEnabled( false );
-    m_widget->dirBrowse->setEnabled( false );
     m_widget->dirRemove->setEnabled( false );
 
     dirLoad( config );
@@ -272,7 +272,7 @@ extern "C"
 
 void KPluginOptions::dirInit()
 {
-    connect( m_widget->dirBrowse, SIGNAL(clicked()), SLOT(dirBrowse()) );
+    m_widget->dirEdit->setCaption(i18n("Select Plugin Scan Directory"));
     connect( m_widget->dirNew, SIGNAL(clicked()), SLOT(dirNew()) );
     connect( m_widget->dirRemove, SIGNAL(clicked()), SLOT(dirRemove()) );
     connect( m_widget->dirUp, SIGNAL(clicked()), SLOT(dirUp()) );
@@ -338,26 +338,14 @@ void KPluginOptions::dirSave( KConfig *c
 void KPluginOptions::dirSelect( QListBoxItem *item )
 {
     m_widget->dirEdit->setEnabled( item!=0 );
-    m_widget->dirBrowse->setEnabled( item!=0 );
     m_widget->dirRemove->setEnabled( item!=0 );
 
     unsigned cur = m_widget->dirList->currentItem();
     m_widget->dirDown->setEnabled( item!=0 && cur<m_widget->dirList->count()-1 );
     m_widget->dirUp->setEnabled( item!=0 && cur>0 );
 
-    m_widget->dirEdit->setText( item!=0 ? item->text() : QString::null );
+    m_widget->dirEdit->setURL( item!=0 ? item->text() : QString::null );
 
-}
-
-
-void KPluginOptions::dirBrowse()
-{
-    QString path = KFileDialog::getExistingDirectory( QString::null,  this,
-                                                i18n("Select Plugin Scan Directory") );
-    if ( !path.isEmpty() ) {
-        m_widget->dirEdit->setText( path );
-        change();
-    }
 }
 
 
Index: pluginopts.h
===================================================================
RCS file: /home/kde/kdebase/kcontrol/konqhtml/pluginopts.h,v
retrieving revision 1.5
diff -u -p -r1.5 pluginopts.h
--- pluginopts.h	2002/09/21 00:26:50	1.5
+++ pluginopts.h	2002/10/27 17:46:38
@@ -65,7 +65,6 @@ private:
   void dirSave( KConfig *config );
 
  protected slots:
-  void dirBrowse();
   void dirNew();
   void dirRemove();
   void dirUp();

>> 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