diff options
author | Michele Calgaro <michele.calgaro@yahoo.it> | 2025-08-28 22:44:34 +0900 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2025-08-31 23:30:34 +0900 |
commit | f9abd9d505434c9244c03eac708e29a0ca042f6b (patch) | |
tree | 30a197ab4c413849188bc131ff859212e636c821 /src/app/Panel/listpanel.h | |
parent | 14d42d284de233f9937becf3fc9ee0dabede3b21 (diff) | |
download | krusader-r14.1.x.tar.gz krusader-r14.1.x.zip |
Restructure source foldersr14.1.x
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
(cherry picked from commit 086012dcad8a976a0dabbb7cbc20c9cb612cdfa9)
Diffstat (limited to 'src/app/Panel/listpanel.h')
-rw-r--r-- | src/app/Panel/listpanel.h | 212 |
1 files changed, 212 insertions, 0 deletions
diff --git a/src/app/Panel/listpanel.h b/src/app/Panel/listpanel.h new file mode 100644 index 0000000..e78e2fb --- /dev/null +++ b/src/app/Panel/listpanel.h @@ -0,0 +1,212 @@ +/*************************************************************************** + listpanel.h + ------------------- + begin : Thu May 4 2000 + copyright : (C) 2000 by Shie Erlich & Rafi Yanai + e-mail : krusader@users.sourceforge.net + web site : http://krusader.sourceforge.net +--------------------------------------------------------------------------- + Description +*************************************************************************** + + A + + db dD d8888b. db db .d8888. .d8b. d8888b. d88888b d8888b. + 88 ,8P' 88 `8D 88 88 88' YP d8' `8b 88 `8D 88' 88 `8D + 88,8P 88oobY' 88 88 `8bo. 88ooo88 88 88 88ooooo 88oobY' + 88`8b 88`8b 88 88 `Y8b. 88~~~88 88 88 88~~~~~ 88`8b + 88 `88. 88 `88. 88b d88 db 8D 88 88 88 .8D 88. 88 `88. + YP YD 88 YD ~Y8888P' `8888Y' YP YP Y8888D' Y88888P 88 YD + + H e a d e r F i l e + +*************************************************************************** +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +***************************************************************************/ + + +#ifndef LISTPANEL_H +#define LISTPANEL_H + +#include <kpropsdlg.h> +#include <tdefileitem.h> +#include <kurl.h> +#include <tqwidget.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqstring.h> +#include <tqpixmap.h> +#include <tqtoolbutton.h> +#include <tqpopupmenu.h> +#include <tqdir.h> +#include <tqpixmapcache.h> +#include <tqiconset.h> +#include <tqptrstack.h> +#include <tqtextbrowser.h> +#include <keditcl.h> +#include <klineedit.h> +#include <tqguardedptr.h> +#include "krview.h" +#include "../Dialogs/krsqueezedtextlabel.h" + +// use our version of it, until kde fixes theirs +#include "../MountMan/kdiskfreesp.h" + +#define PROP_SYNC_BUTTON_ON 1 + +class vfs; +class vfile; +class KRdirWatch; +class KrView; +class KURLRequester; +class BookmarksButton; +class KrQuickSearch; +class DirHistoryButton; +class DirHistoryQueue; +class MediaButton; +class PanelPopup; +class SyncBrowseButton; +class KrBookmarkButton; +class KPushButton; +class ListPanelFunc; +class TQHeader; + +class ListPanel : public TQWidget { + friend class ListPanelFunc; + TQ_OBJECT + +public: + #define ITEM2VFILE(PANEL_PTR, KRVIEWITEM) PANEL_PTR->func->files()->vfs_search(KRVIEWITEM->name()) + #define NAME2VFILE(PANEL_PTR, STRING_NAME) PANEL_PTR->func->files()->vfs_search(STRING_NAME) + // constructor create the panel, but DOESN'T fill it with data, use start() + ListPanel( TQString panelType, TQWidget *parent, bool &left, const char *name = 0 ); + ~ListPanel(); + void start( KURL url = KURL(), bool immediate = false ); + + const TQString & getType() { return panelType; } + void changeType( const TQString & ); + + KURL virtualPath() const; + TQString realPath() const; + TQString getCurrentName(); + void getSelectedNames( TQStringList* fileNames ) { + view->getSelectedItems( fileNames ); + } + void setPanelToolbar(); + bool isLeft() {return _left;} + void jumpBack(); + void setJumpBack( KURL url ); + + int getProperties(); + void setProperties( int ); + +public slots: + void gotStats( const TQString &mountPoint, unsigned long kBSize, unsigned long kBUsed, unsigned long kBAvail); // displays filesystem status + void popRightClickMenu( const TQPoint& ); + void popEmptyRightClickMenu( const TQPoint & ); + void select( KRQuery query, bool select); + void select( bool, bool ); // see doc in ListPanel + void invertSelection(); // see doc in ListPanel + void compareDirs(); + void slotFocusOnMe(); // give this VFS the focus (the path bar) + void slotUpdate(); // when the vfs finish to update... + void slotUpdateTotals(); + void slotStartUpdate(); // internal + void slotGetStats( const KURL& url ); // get the disk-free stats + void setFilter( KrViewProperties::FilterSpec f ); + void slotFocusAndCDRoot(); + void slotFocusAndCDHome(); + void slotFocusAndCDup(); + void slotFocusAndCDOther(); + void togglePanelPopup(); + // for signals from vfs' dirwatch + void slotItemAdded(vfile *vf); + void slotItemDeleted(const TQString& name); + void slotItemUpdated(vfile *vf); + void slotCleared(); + void panelActive(); // called when the panel becomes active + void panelInactive(); // called when panel becomes inactive + + + ///////////////////////// service functions - called internally //////////////////////// + inline void setOther( ListPanel *panel ) { + otherPanel = panel; + } + void prepareToDelete(); // internal use only + +protected: + virtual void keyPressEvent( TQKeyEvent *e ); + virtual void showEvent( TQShowEvent * ); + virtual void hideEvent( TQHideEvent * ); + virtual bool eventFilter ( TQObject * watched, TQEvent * e ); + + void createView(); + +protected slots: + void handleDropOnView(TQDropEvent *, TQWidget *destWidget=0); // handles drops on the view only + void handleDropOnTotals( TQDropEvent * ); // handles drops on the totals line + void handleDropOnStatus( TQDropEvent * ); // handles drops on the status line + void startDragging( TQStringList, TQPixmap ); + // those handle the in-panel refresh notifications + void slotJobStarted(TDEIO::Job* job); + void inlineRefreshInfoMessage( TDEIO::Job* job, const TQString &msg ); + void inlineRefreshListResult(TDEIO::Job* job); + void inlineRefreshPercent( TDEIO::Job*, unsigned long ); + void inlineRefreshCancel(); + +signals: + void signalStatus( TQString msg ); // emmited when we need to update the status bar + void cmdLineUpdate( TQString p ); // emitted when we need to update the command line + void pathChanged( ListPanel *panel ); + void activePanelChanged( ListPanel *p ); // emitted when the user changes panels + void finishedDragging(); // currently + +public: + TQString panelType; + ListPanelFunc *func; + KrView *view; + ListPanel *otherPanel; + int colorMask; + bool compareMode; + //FilterSpec filter; + KRQuery filterMask; + TQPixmap currDragPix; + TQListViewItem *currDragItem; + KDiskFreeSp* statsAgent; + KrSqueezedTextLabel *status, *totals; + KrQuickSearch *quickSearch; + KURLRequester *origin; + TQGridLayout *layout; + TQToolButton *cdRootButton; + TQToolButton *cdHomeButton; + TQToolButton *cdUpButton; + TQToolButton *cdOtherButton; + TQToolButton *popupBtn; + TQToolButton *clearOrigin; + PanelPopup *popup; + KrBookmarkButton *bookmarksButton; + DirHistoryQueue* dirHistoryQueue; + DirHistoryButton* historyButton; + MediaButton *mediaButton; + SyncBrowseButton *syncBrowseButton; + KPushButton *inlineRefreshCancelButton; + TDEIO::Job *inlineRefreshJob; + TQSplitter *splt; + TQHeader * header; + +protected: + KURL _realPath; // named with _ to keep realPath() compatability + KURL _jumpBackURL; + + +private: + bool &_left; + TQValueList<int> popupSizes; +}; + +#endif |