File indexing completed on 2024-04-28 04:57:36

0001 /***************************************************************************
0002  *   Copyright (C) 2009 Matthias Fuchs <mat69@gmx.net>                     *
0003  *                                                                         *
0004  *   This program is free software; you can redistribute it and/or modify  *
0005  *   it under the terms of the GNU General Public License as published by  *
0006  *   the Free Software Foundation; either version 2 of the License, or     *
0007  *   (at your option) any later version.                                   *
0008  *                                                                         *
0009  *   This program is distributed in the hope that it will be useful,       *
0010  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
0011  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
0012  *   GNU General Public License for more details.                          *
0013  *                                                                         *
0014  *   You should have received a copy of the GNU General Public License     *
0015  *   along with this program; if not, write to the                         *
0016  *   Free Software Foundation, Inc.,                                       *
0017  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA .        *
0018  ***************************************************************************/
0019 
0020 #ifndef FILEDLG_H
0021 #define FILEDLG_H
0022 
0023 #include "../../core/basedialog.h"
0024 #include "ui_commondata.h"
0025 #include "ui_filedlg.h"
0026 #include "ui_urlwidget.h"
0027 
0028 namespace KGetMetalink
0029 {
0030 class File;
0031 }
0032 
0033 class QSortFilterProxyModel;
0034 class VerificationModel;
0035 class UrlWidget;
0036 
0037 class FileDlg : public KGetSaveSizeDialog
0038 {
0039     Q_OBJECT
0040 
0041 public:
0042     FileDlg(KGetMetalink::File *file,
0043             const QStringList &currentFileNames,
0044             QSortFilterProxyModel *countrySort,
0045             QSortFilterProxyModel *languageSort,
0046             QWidget *parent,
0047             bool edit = false);
0048 
0049 Q_SIGNALS:
0050     void addFile();
0051     void fileEdited(const QString &oldFileName, const QString &newFileName);
0052 
0053 private Q_SLOTS:
0054     void slotUpdateOkButton();
0055     void slotOkClicked();
0056 
0057     // verification stuff
0058     void slotUpdateVerificationButtons();
0059     void slotAddHash();
0060     void slotRemoveHash();
0061 
0062 private:
0063     KGetMetalink::File *m_file;
0064     QString m_initialFileName;
0065     QStringList m_currentFileNames;
0066     VerificationModel *m_verificationModel;
0067     QSortFilterProxyModel *m_verificationProxy;
0068     bool m_edit;
0069     UrlWidget *m_urlWidget;
0070     Ui::FileDlg ui;
0071     Ui::CommonData uiData;
0072     QHash<QString, int> m_diggestLength;
0073 };
0074 
0075 #endif