1 //************************************************************************** 2 // Copyright 2006 - 2017 Martin Koller, kollix@aon.at 3 // 4 // This program is free software; you can redistribute it and/or modify 5 // it under the terms of the GNU General Public License as published by 6 // the Free Software Foundation, version 2 of the License 7 // 8 //************************************************************************** 9 10 #ifndef _MAIN_WIDGET_H_ 11 #define _MAIN_WIDGET_H_ 12 13 #include <QWidget> 14 #include <QTime> 15 #include "kio/global.h" 16 #include <ui_MainWidgetBase.h> 17 18 class Selector; 19 20 class MainWidget : public QWidget 21 { 22 Q_OBJECT 23 24 public: 25 explicit MainWidget(QWidget *parent); 26 27 void setSelector(Selector * s); getTargetLineEdit() const28 KLineEdit *getTargetLineEdit() const { return ui.targetDir; } 29 30 public Q_SLOTS: 31 void setTargetURL(const QString &url); 32 void startBackup(); 33 void setIsIncrementalBackup(bool incremental); 34 35 private: 36 Selector *selector; 37 Ui::MainWidgetBase ui; 38 39 private Q_SLOTS: 40 void getMediaSize(); 41 void updateElapsed(const QTime &); 42 void updateTotalBytes(); 43 void setFileProgress(int percent); 44 void setCapacity(KIO::filesize_t bytes); 45 }; 46 47 #endif 48