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

List:       kde-core-devel
Subject:    Patch for kpropsdlg
From:       Laurent Montel <lmontel () mandrakesoft ! com>
Date:       2001-07-25 8:58:15
[Download RAW message or body]

Hi,

I created a little patch for kpropsdlg.
So now when we display properties of a file,
in KApplicationPropsPlugin page we enable/disable ">>" / "<<" button
when qlistbox is empty or not.

Could you test my patch and said me if it's good.

thanks
bye

["kpropsdlg.diff" (text/x-diff)]

cvs server: Diffing .
Index: kpropsdlg.cpp
===================================================================
RCS file: /home/kde/kdelibs/kfile/kpropsdlg.cpp,v
retrieving revision 1.188
diff -u -u -p -r1.188 kpropsdlg.cpp
--- kpropsdlg.cpp	2001/06/17 12:30:13	1.188
+++ kpropsdlg.cpp	2001/07/25 08:54:09
@@ -2000,6 +2000,8 @@ KApplicationPropsPlugin::KApplicationPro
   for ( ; it2 != mimeTypes.end(); ++it2 )
     addMimeType ( (*it2)->name() );
 
+  updateButton();
+
   connect( availableExtensionsList, SIGNAL( selected( int ) ),
            this, SIGNAL( changed() ) );
   connect( addExtensionButton, SIGNAL( clicked() ),
@@ -2024,6 +2026,12 @@ KApplicationPropsPlugin::~KApplicationPr
 //   return i18n ("&Application");
 // }
 
+void KApplicationPropsPlugin::updateButton()
+{
+    addExtensionButton->setEnabled(availableExtensionsList->count()>0);
+    delExtensionButton->setEnabled(extensionsList->count()>0);
+}
+
 void KApplicationPropsPlugin::addMimeType( const QString & name )
 {
   // Add a mimetype to the list of available mime types if not in the extensionsList
@@ -2097,6 +2105,7 @@ void KApplicationPropsPlugin::slotAddExt
   extensionsList->insertItem( availableExtensionsList->text( pos ) );
   extensionsList->sort();
   availableExtensionsList->removeItem( pos );
+  updateButton();
 }
 
 void KApplicationPropsPlugin::slotDelExtension()
@@ -2109,6 +2118,7 @@ void KApplicationPropsPlugin::slotDelExt
   availableExtensionsList->insertItem( extensionsList->text( pos ) );
   availableExtensionsList->sort();
   extensionsList->removeItem( pos );
+  updateButton();
 }
 
 /* ----------------------------------------------------
Index: kpropsdlg.h
===================================================================
RCS file: /home/kde/kdelibs/kfile/kpropsdlg.h,v
retrieving revision 1.64
diff -u -u -p -r1.64 kpropsdlg.h
--- kpropsdlg.h	2001/05/27 09:50:12	1.64
+++ kpropsdlg.h	2001/07/25 08:54:09
@@ -580,6 +580,7 @@ public slots:
 private:
 
   void addMimeType( const QString & name );
+  void updateButton();
 
   QLineEdit *commentEdit;
   QLineEdit *nameEdit;
cvs server: Diffing acl_prop_page


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

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