Browse Source

PropertiesWidget: Some coding style

adaptive-webui-19844
thalieht 8 years ago
parent
commit
b360c5453b
  1. 38
      src/gui/properties/propertieswidget.cpp
  2. 30
      src/gui/properties/propertieswidget.h

38
src/gui/properties/propertieswidget.cpp

@ -30,40 +30,40 @@
#include "propertieswidget.h" #include "propertieswidget.h"
#include <QAction>
#include <QBitArray>
#include <QDebug> #include <QDebug>
#include <QTimer> #include <QFileDialog>
#include <QListWidgetItem>
#include <QVBoxLayout>
#include <QStackedWidget>
#include <QSplitter>
#include <QHeaderView> #include <QHeaderView>
#include <QAction> #include <QListWidgetItem>
#include <QMenu> #include <QMenu>
#include <QFileDialog> #include <QSplitter>
#include <QBitArray> #include <QStackedWidget>
#include <QThread> #include <QThread>
#include <QTimer>
#include <QVBoxLayout>
#include "base/bittorrent/session.h" #include "base/bittorrent/session.h"
#include "base/preferences.h" #include "base/preferences.h"
#include "base/unicodestrings.h"
#include "base/utils/fs.h" #include "base/utils/fs.h"
#include "base/utils/misc.h" #include "base/utils/misc.h"
#include "base/utils/string.h" #include "base/utils/string.h"
#include "base/unicodestrings.h" #include "autoexpandabledialog.h"
#include "proplistdelegate.h" #include "downloadedpiecesbar.h"
#include "torrentcontentfiltermodel.h" #include "guiiconprovider.h"
#include "torrentcontentmodel.h" #include "lineedit.h"
#include "peerlistwidget.h"
#include "speedwidget.h"
#include "trackerlist.h"
#include "mainwindow.h" #include "mainwindow.h"
#include "messageboxraised.h" #include "messageboxraised.h"
#include "downloadedpiecesbar.h" #include "peerlistwidget.h"
#include "pieceavailabilitybar.h" #include "pieceavailabilitybar.h"
#include "proplistdelegate.h"
#include "proptabbar.h" #include "proptabbar.h"
#include "guiiconprovider.h" #include "speedwidget.h"
#include "lineedit.h" #include "torrentcontentfiltermodel.h"
#include "torrentcontentmodel.h"
#include "trackerlist.h"
#include "transferlistwidget.h" #include "transferlistwidget.h"
#include "autoexpandabledialog.h"
#include "ui_propertieswidget.h" #include "ui_propertieswidget.h"

30
src/gui/properties/propertieswidget.h

@ -33,8 +33,8 @@
#include <QShortcut> #include <QShortcut>
#include <QWidget> #include <QWidget>
#include "base/bittorrent/torrenthandle.h"
#include "base/bittorrent/torrenthandle.h"
class TransferListWidget; class TransferListWidget;
class TorrentContentFilterModel; class TorrentContentFilterModel;
@ -67,9 +67,12 @@ class PropertiesWidget: public QWidget
Q_DISABLE_COPY(PropertiesWidget) Q_DISABLE_COPY(PropertiesWidget)
public: public:
enum SlideState {REDUCED, VISIBLE}; enum SlideState
{
REDUCED,
VISIBLE
};
public:
PropertiesWidget(QWidget *parent, MainWindow *main_window, TransferListWidget *transferList); PropertiesWidget(QWidget *parent, MainWindow *main_window, TransferListWidget *transferList);
~PropertiesWidget(); ~PropertiesWidget();
BitTorrent::TorrentHandle *getCurrentTorrent() const; BitTorrent::TorrentHandle *getCurrentTorrent() const;
@ -78,6 +81,16 @@ public:
QTreeView *getFilesList() const; QTreeView *getFilesList() const;
SpeedWidget *getSpeedWidget() const { return speedWidget; } SpeedWidget *getSpeedWidget() const { return speedWidget; }
public slots:
void setVisibility(bool visible);
void loadDynamicData();
void clear();
void readSettings();
void saveSettings();
void reloadPreferences();
void openDoubleClickedFile(const QModelIndex &);
void loadTrackers(BitTorrent::TorrentHandle *const torrent);
protected: protected:
QPushButton *getButtonFromIndex(int index); QPushButton *getButtonFromIndex(int index);
bool applyPriorities(); bool applyPriorities();
@ -98,21 +111,10 @@ protected slots:
void renameSelectedFile(); void renameSelectedFile();
void openSelectedFile(); void openSelectedFile();
public slots:
void setVisibility(bool visible);
void loadDynamicData();
void clear();
void readSettings();
void saveSettings();
void reloadPreferences();
void openDoubleClickedFile(const QModelIndex &);
void loadTrackers(BitTorrent::TorrentHandle *const torrent);
private: private:
void openFile(const QModelIndex &index); void openFile(const QModelIndex &index);
void openFolder(const QModelIndex &index, bool containing_folder); void openFolder(const QModelIndex &index, bool containing_folder);
private:
Ui::PropertiesWidget *m_ui; Ui::PropertiesWidget *m_ui;
TransferListWidget *transferList; TransferListWidget *transferList;
MainWindow *main_window; MainWindow *main_window;

Loading…
Cancel
Save