• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdenetwork API Reference
  • KDE Home
  • Contact Us
 

kget

  • sources
  • kde-4.12
  • kdenetwork
  • kget
  • ui
  • metalinkcreator
metalinkcreator.h
Go to the documentation of this file.
1 /***************************************************************************
2 * Copyright (C) 2009 Matthias Fuchs <mat69@gmx.net> *
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; either version 2 of the License, or *
7 * (at your option) any later version. *
8 * *
9 * This program is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
13 * *
14 * You should have received a copy of the GNU General Public License *
15 * along with this program; if not, write to the *
16 * Free Software Foundation, Inc., *
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
18 ***************************************************************************/
19 
20 #ifndef METALINKCREATOR_H
21 #define METALINKCREATOR_H
22 
23 #include <KAssistantDialog>
24 
25 #include "metalinker.h"
26 #include "filehandler.h"
27 
28 #include "ui_introduction.h"
29 #include "ui_files.h"
30 
31 namespace KGetMetalink
32 {
33  class Metalink;
34 }
35 
36 class CountryModel;
37 class GeneralWidget;
38 class LanguageModel;
39 class QDragEnterEvent;
40 class QShowEvent;
41 class QSortFilterProxyModel;
42 class QStandardItemModel;
43 
44 class FileWidget : public QWidget
45 {
46  Q_OBJECT
47 
48  public:
49  FileWidget(QWidget *parent = 0);
50 
51  signals:
52  void urlsDropped(const QList<KUrl> &files);
53 
54  protected:
55  void dragEnterEvent(QDragEnterEvent *event);
56  void dropEvent(QDropEvent *event);
57 };
58 
59 class MetalinkCreator : public KAssistantDialog
60 {
61  Q_OBJECT
62 
63  public:
64  MetalinkCreator(QWidget *parent = 0);
65  ~MetalinkCreator();
66 
67  public slots:
72  void slotAddFile();
73 
74  void slotAddFile(const KGetMetalink::File &file);
75 
79  void slotFileEdited(const QString &oldFileName, const QString &newFileName);
80 
86  void slotHandleDropped(const QStringList &types, bool createPartial);
87 
88  private slots:
92  void slotDelayedCreation();
93 
97  void slotUpdateAssistantButtons(KPageWidgetItem *to = 0, KPageWidgetItem *from = 0);
98 
99  void slotUpdateIntroductionNextButton();
100 
101  void slotUpdateFilesButtons();
102 
106  void slotRemoveFile();
107 
111  void slotFileProperties();
112 
116  void slotAddLocalFilesClicked();
117 
121  void slotAddClicked();
122 
126  void slotSave();
127 
128  void slotThreadFinished();//TODO description
129 
130  void slotOpenDragDlg();
131 
132  private:
138  void fileDlg(KGetMetalink::File *file, bool edit = false);
139 
143  void create();
144 
148  void load();
149 
150  void createIntroduction();
151 
152  void createGeneral();
153  void loadGeneral();
154  void saveGeneral();
155 
156  void createFiles();
157  void loadFiles();
158 
159  private:
160  FileHandlerThread m_thread;
161  DirectoryHandler *m_handler;
162  KGetMetalink::Metalink metalink;
163  int m_needUrlCount;
164 
165  KGetMetalink::File m_tempFile;
166  KGetMetalink::Resources m_tempResources;
167  KGetMetalink::CommonData m_tempCommonData;
168  bool m_createPartial;
169 
170  QSortFilterProxyModel *m_countrySort;
171  LanguageModel *m_languageModel;
172  QSortFilterProxyModel *m_languageSort;
173 
174  Ui::Introduction uiIntroduction;
175  KPageWidgetItem *m_introduction;
176 
177  GeneralWidget *m_general;
178  KPageWidgetItem *m_generalPage;
179 
180  Ui::Files uiFiles;
181  KPageWidgetItem *m_files;
182 
183  QStandardItemModel *m_filesModel;
184 };
185 
186 #endif
FileWidget::FileWidget
FileWidget(QWidget *parent=0)
Definition: metalinkcreator.cpp:40
DirectoryHandler
Gets the name and the size of the files of a list of urls, also enters directories recursively if nee...
Definition: filehandler.h:68
MetalinkCreator::~MetalinkCreator
~MetalinkCreator()
Definition: metalinkcreator.cpp:94
QWidget
FileWidget
Definition: metalinkcreator.h:44
QStandardItemModel
KGetMetalink::File
Definition: metalinker.h:239
FileWidget::dropEvent
void dropEvent(QDropEvent *event)
Definition: metalinkcreator.cpp:55
GeneralWidget
Definition: generalwidget.h:32
KAssistantDialog
filehandler.h
Metalink
Definition: metalink.h:23
MetalinkCreator::slotAddFile
void slotAddFile()
Adds m_tempFile to metalink and clears it for future reuse, also adds the filename to the filemodel...
Definition: metalinkcreator.cpp:277
metalinker.h
MetalinkCreator
Definition: metalinkcreator.h:59
KGetMetalink::Metalink
Definition: metalinker.h:299
FileWidget::dragEnterEvent
void dragEnterEvent(QDragEnterEvent *event)
Definition: metalinkcreator.cpp:47
MetalinkCreator::slotFileEdited
void slotFileEdited(const QString &oldFileName, const QString &newFileName)
This slot is used to update the filename in the filemodel if needed.
Definition: metalinkcreator.cpp:301
KGetMetalink::CommonData
Files, File and Metadata contain this Metadata not as member and only for compatibility.
Definition: metalinker.h:93
CountryModel
The following models are there to store the localized names and the codes of languages and countries ...
Definition: localemodels.h:35
QSortFilterProxyModel
MetalinkCreator::MetalinkCreator
MetalinkCreator(QWidget *parent=0)
Definition: metalinkcreator.cpp:71
KGetMetalink::Resources
Definition: metalinker.h:190
FileWidget::urlsDropped
void urlsDropped(const QList< KUrl > &files)
MetalinkCreator::slotHandleDropped
void slotHandleDropped(const QStringList &types, bool createPartial)
Handles the dropped files, calls dialogs if needed etc.
Definition: metalinkcreator.cpp:394
LanguageModel
The LanguageModel stores localized names as well as the codes of languages.
Definition: localemodels.h:56
FileHandlerThread
Calculates the checksum and partial checksums for files and adds KGetMetalink::Resources and KGetMeta...
Definition: filehandler.h:38
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:53:17 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kget

Skip menu "kget"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdenetwork API Reference

Skip menu "kdenetwork API Reference"
  • kget
  • kopete
  •   kopete
  •   libkopete
  • krdc
  • krfb

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal