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

List:       kde-commits
Subject:    kdebase/kate/app
From:       Anders Lund <anders () alweb ! dk>
Date:       2005-03-28 12:09:14
Message-ID: 20050328120914.49B98630 () office ! kde ! org
[Download RAW message or body]

CVS commit by alund: 

Add an option to set the sorting to the configuration panel.
CCBUG: 102280


  M +17 -0     katefilelist.cpp   1.67
  M +2 -1      katefilelist.h   1.30


--- kdebase/kate/app/katefilelist.h  #1.29:1.30
@@ -178,5 +178,6 @@ class KFLConfigPage : public Kate::Confi
     class QCheckBox *cbEnableShading;
     class KColorButton *kcbViewShade, *kcbEditShade;
-    class QLabel *lEditShade, *lViewShade;
+    class QLabel *lEditShade, *lViewShade, *lSort;
+    class QComboBox *cmbSort;
     KateFileList *m_filelist;
 

--- kdebase/kate/app/katefilelist.cpp  #1.66:1.67
@@ -33,4 +33,5 @@
 #include <qcolor.h>
 #include <qcheckbox.h>
+#include <qhbox.h>
 #include <qlayout.h>
 #include <qgroupbox.h>
@@ -567,4 +568,14 @@ KFLConfigPage::KFLConfigPage( QWidget* p
   lo->addWidget( kcbEditShade, 3, 1 );
 
+  // sorting
+  QHBox *hbSorting = new QHBox( this );
+  lo1->addWidget( hbSorting );
+  lSort = new QLabel( i18n("&Sort by:"), hbSorting );
+  cmbSort = new QComboBox( hbSorting );
+  lSort->setBuddy( cmbSort );
+  QStringList l;
+  l << i18n("Opening Order") << i18n("Document Name") << i18n("URL");
+  cmbSort->insertStringList( l );
+
   lo1->insertStretch( -1, 10 );
 
@@ -580,4 +591,7 @@ KFLConfigPage::KFLConfigPage( QWidget* p
       "most of this color.") );
 
+  QWhatsThis::add( cmbSort, i18n(
+      "Set the sorting method for the documents.") );
+
   reload();
 
@@ -587,4 +601,5 @@ KFLConfigPage::KFLConfigPage( QWidget* p
   connect( kcbViewShade, SIGNAL(changed(const QColor&)), this, SLOT(slotMyChanged()) );
   connect( kcbEditShade, SIGNAL(changed(const QColor&)), this, SLOT(slotMyChanged()) );
+  connect( cmbSort, SIGNAL(activated(int)), this, SLOT(slotMyChanged()) );
 }
 
@@ -599,4 +614,5 @@ void KFLConfigPage::apply()
   m_filelist->m_editShade = kcbEditShade->color();
   m_filelist->m_enableBgShading = cbEnableShading->isChecked();
+  m_filelist->setSortType( cmbSort->currentItem() );
   // repaint the affected items
   m_filelist->triggerUpdate();
@@ -611,4 +627,5 @@ void KFLConfigPage::reload()
   kcbViewShade->setColor( config->readColorEntry("View Shade", &m_filelist->m_viewShade ) );
   kcbEditShade->setColor( config->readColorEntry("Edit Shade", &m_filelist->m_editShade ) );
+  cmbSort->setCurrentItem( m_filelist->sortType() );
   m_changed = false;
 }


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

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