Browse Source

Follow project coding style. Issue #2192.

adaptive-webui-19844
sledgehammer999 10 years ago
parent
commit
38455af791
  1. 1052
      src/addnewtorrentdialog.cpp
  2. 86
      src/addnewtorrentdialog.h

1052
src/addnewtorrentdialog.cpp

File diff suppressed because it is too large Load Diff

86
src/addnewtorrentdialog.h

@ -40,69 +40,69 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
namespace Ui { namespace Ui {
class AddNewTorrentDialog; class AddNewTorrentDialog;
} }
QT_END_NAMESPACE QT_END_NAMESPACE
class TorrentContentFilterModel; class TorrentContentFilterModel;
class PropListDelegate; class PropListDelegate;
class AddNewTorrentDialog : public QDialog class AddNewTorrentDialog: public QDialog
{ {
Q_OBJECT Q_OBJECT
public: public:
~AddNewTorrentDialog(); ~AddNewTorrentDialog();
static void showTorrent(const QString& torrent_path, const QString& from_url, QWidget *parent = 0); static void showTorrent(const QString& torrent_path, const QString& from_url, QWidget *parent = 0);
static void showMagnet(const QString& torrent_link, QWidget *parent = 0); static void showMagnet(const QString& torrent_link, QWidget *parent = 0);
protected: protected:
void showEvent(QShowEvent *event); void showEvent(QShowEvent *event);
private slots: private slots:
void showAdvancedSettings(bool show); void showAdvancedSettings(bool show);
void displayContentTreeMenu(const QPoint&); void displayContentTreeMenu(const QPoint&);
void updateDiskSpaceLabel(); void updateDiskSpaceLabel();
void onSavePathChanged(int); void onSavePathChanged(int);
void relayout(); void relayout();
void renameSelectedFile(); void renameSelectedFile();
void setdialogPosition(); void setdialogPosition();
void updateMetadata(const QTorrentHandle& h); void updateMetadata(const QTorrentHandle& h);
void browseButton_clicked(); void browseButton_clicked();
protected slots: protected slots:
virtual void accept(); virtual void accept();
virtual void reject(); virtual void reject();
private: private:
explicit AddNewTorrentDialog(QWidget *parent = 0); explicit AddNewTorrentDialog(QWidget *parent = 0);
bool loadTorrent(const QString& torrent_path, const QString& from_url); bool loadTorrent(const QString& torrent_path, const QString& from_url);
bool loadMagnet(const QString& magnet_uri); bool loadMagnet(const QString& magnet_uri);
void loadSavePathHistory(); void loadSavePathHistory();
void saveSavePathHistory() const; void saveSavePathHistory() const;
int indexOfSavePath(const QString& save_path); int indexOfSavePath(const QString& save_path);
void updateFileNameInSavePaths(const QString& new_filename); void updateFileNameInSavePaths(const QString& new_filename);
void loadState(); void loadState();
void saveState(); void saveState();
void setMetadataProgressIndicator(bool visibleIndicator, const QString &labelText = QString()); void setMetadataProgressIndicator(bool visibleIndicator, const QString &labelText = QString());
void setupTreeview(); void setupTreeview();
private: private:
Ui::AddNewTorrentDialog *ui; Ui::AddNewTorrentDialog *ui;
TorrentContentFilterModel *m_contentModel; TorrentContentFilterModel *m_contentModel;
PropListDelegate *m_contentDelegate; PropListDelegate *m_contentDelegate;
bool m_isMagnet; bool m_isMagnet;
bool m_hasMetadata; bool m_hasMetadata;
QString m_filePath; QString m_filePath;
QString m_url; QString m_url;
QString m_hash; QString m_hash;
boost::intrusive_ptr<libtorrent::torrent_info> m_torrentInfo; boost::intrusive_ptr<libtorrent::torrent_info> m_torrentInfo;
QStringList m_filesPath; QStringList m_filesPath;
bool m_hasRenamedFile; bool m_hasRenamedFile;
QShortcut *editHotkey; QShortcut *editHotkey;
QByteArray m_headerState; QByteArray m_headerState;
int m_oldIndex; int m_oldIndex;
}; };
#endif // ADDNEWTORRENTDIALOG_H #endif // ADDNEWTORRENTDIALOG_H

Loading…
Cancel
Save