diff options
author | Vincent Reher <tde@4reher.org> | 2021-11-02 09:11:34 -0700 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2021-12-17 21:45:37 +0900 |
commit | 9cd504156b4fff688cd427af7244f6522f2e5da8 (patch) | |
tree | d514e92ec9441bca8b84aa31a1ee293a31d07186 /konqueror/listview/konq_listview.h | |
parent | 76fe6863ce1338d0e1dd0a9bc84630187a21ed11 (diff) | |
download | tdebase-9cd504156b4fff688cd427af7244f6522f2e5da8.tar.gz tdebase-9cd504156b4fff688cd427af7244f6522f2e5da8.zip |
Introduce additional sorting / grouping options and actions for Konqueror
listviews, available through new submenu: View => Sort
Options:
(1) "Group Directories First" - Toggle on/off option to group directories
before non-directories. Comparable to iconview's "Folders First" option.
(2) "Group Hidden First" - Toggle on/off option to group hidden entities
(aka dotfiles) before non-hidden.
Option-related settings are stored in config/konqlistviewrc
Actions:
(1) "Reverse Sort Order" - Toggle sort order of the current sort column.
Action bound to key Ctrl+R.
(2) "Alternate Sort Order" - Toggle sorting between 2 most recent sort
columns selected by mouse click. The existing sort order for the
sort columns is preserved. Action bound to key Ctrl+S.
Action-related settings are stored in config/konquerorrc/[Listview_file]
Signed-off-by: Vincent Reher <tde@4reher.org>
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'konqueror/listview/konq_listview.h')
-rw-r--r-- | konqueror/listview/konq_listview.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/konqueror/listview/konq_listview.h b/konqueror/listview/konq_listview.h index 4c3719bd0..666ae7743 100644 --- a/konqueror/listview/konq_listview.h +++ b/konqueror/listview/konq_listview.h @@ -63,8 +63,10 @@ class KonqListView : public KonqDirPart { friend class KonqBaseListViewWidget; friend class ListViewBrowserExtension; + Q_OBJECT TQ_PROPERTY( bool supportsUndo READ supportsUndo ) + public: KonqListView( TQWidget *parentWidget, TQObject *parent, const char *name, const TQString& mode ); virtual ~KonqListView(); @@ -128,6 +130,11 @@ protected slots: void slotSaveColumnWidths(); // delayed void slotHeaderClicked(int sec); + void slotToggleDisplayDirectoriesFirst(); + void slotToggleDisplayHiddenFirst(); + void slotSortAlternate(); + void slotSortReverse(); + // This comes from KonqDirPart, it's for the "Find" feature virtual void slotStarted() { m_pListView->slotStarted(); } virtual void slotCanceled() { m_pListView->slotCanceled(); } @@ -148,12 +155,27 @@ private: KMimeTypeResolver<KonqBaseListViewItem,KonqListView> *m_mimeTypeResolver; TQTimer *m_headerTimer; + bool toggleColumnAlternate = true; + TQString m_sortColumnNamePrimary; + int m_sortColumnIndexPrimary; + int m_sortColumnOrderPrimary; + TQString m_sortColumnNameAlternate; + int m_sortColumnIndexAlternate; + int m_sortColumnOrderAlternate; + + void resetSortConfig(); + void checkSortConfig(); + void sortListView(uint which); + TDEAction *m_paSelect; TDEAction *m_paUnselect; TDEAction *m_paSelectAll; TDEAction *m_paUnselectAll; TDEAction *m_paInvertSelection; + TDEAction *m_paSortAlternate; + TDEAction *m_paSortReverse; + // These 2 actions are 'fake' actions. They are defined so that the keyboard shortcuts // can be set from the 'Configure Shortcuts..." dialog. // The real actions are performed in the TDEListViewLineEdit::keyPressEvent() in tdeui @@ -174,6 +196,9 @@ private: TDEToggleAction *m_paShowGroup; TDEToggleAction *m_paShowPermissions; TDEToggleAction *m_paShowURL; + + TDEToggleAction *m_paDisplayDirectoriesFirst; + TDEToggleAction *m_paDisplayHiddenFirst; }; class ListViewBrowserExtension : public KonqDirPartBrowserExtension |