File indexing completed on 2025-01-19 07:43:00
0001 /* This file is part of the KDE project 0002 0003 Copyright (C) 2007 by Lukas Appelhans <l.appelhans@gmx.de> 0004 0005 This program is free software; you can redistribute it and/or 0006 modify it under the terms of the GNU General Public 0007 License as published by the Free Software Foundation; either 0008 version 2 of the License, or (at your option) any later version. 0009 */ 0010 0011 #ifndef TRANSFERHISTORY_H 0012 #define TRANSFERHISTORY_H 0013 0014 #include "../../core/basedialog.h" 0015 0016 #include "ui_transferhistory.h" 0017 0018 class QFileSystemWatcher; 0019 class QModelIndex; 0020 class QProgressBar; 0021 class KLineEdit; 0022 class QPushButton; 0023 class TransferHistoryStore; 0024 class TransferHistoryItem; 0025 0026 class TransferHistory : public KGetSaveSizeDialog, Ui::TransferHistory 0027 { 0028 Q_OBJECT 0029 0030 public: 0031 TransferHistory(QWidget *parent = nullptr); 0032 ~TransferHistory() override; 0033 0034 QSize sizeHint() const override; 0035 0036 private: 0037 enum RangeType { Date = 0, Size = 1, Host = 2 }; 0038 void hideEvent(QHideEvent *event) override; 0039 QString statusText(int status) const; 0040 0041 bool save; 0042 QFileSystemWatcher *watcher; 0043 int m_rangeType; 0044 QWidget *m_view; 0045 QProgressBar *m_progressBar; 0046 QVBoxLayout *m_verticalLayout; 0047 KComboBox *m_rangeTypeCombobox; 0048 QHBoxLayout *m_hboxLayout; 0049 KLineEdit *m_searchBar; 0050 QAction *m_actionDelete_Selected; 0051 QAction *m_actionClear; 0052 QAction *m_actionDownload; 0053 QAction *m_openFile; 0054 QPushButton *m_clearButton; 0055 QPushButton *m_iconView; 0056 QPushButton *m_listView; 0057 bool m_iconModeEnabled; 0058 TransferHistoryStore *m_store; 0059 0060 public Q_SLOTS: 0061 void slotDeleteTransfer(const QString &url, const QModelIndex &index = QModelIndex()); 0062 0063 private Q_SLOTS: 0064 void slotDeleteTransfer(); 0065 void slotAddTransfers(); 0066 void slotClear(); 0067 void slotWriteDefault(); 0068 void slotDownload(); 0069 void slotOpenFile(const QModelIndex &index = QModelIndex()); 0070 void contextMenuEvent(QContextMenuEvent *event) override; 0071 void slotLoadRangeType(int type); 0072 void slotSetListMode(); 0073 void slotSetIconMode(); 0074 void slotElementLoaded(int number, int total, const TransferHistoryItem &item); 0075 void slotLoadFinished(); 0076 }; 0077 0078 #endif