• 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
newtransferdialog.h
Go to the documentation of this file.
1 /* This file is part of the KDE project
2 
3  Copyright (C) 2005 Dario Massarin <nekkar@libero.it>
4  Copyright (C) 2007 by Javier Goday <jgoday@gmail.com>
5  Copyright (C) 2008 - 2009 by Lukas Appelhans <l.appelhans@gmx.de>
6  Copyright (C) 2010 Matthias Fuchs <mat69@gmx.net>
7 
8  This program is free software; you can redistribute it and/or
9  modify it under the terms of the GNU General Public
10  License as published by the Free Software Foundation; either
11  version 2 of the License, or (at your option) any later version.
12 */
13 
14 #ifndef NEW_TRANSFER_DIALOG_H
15 #define NEW_TRANSFER_DIALOG_H
16 
17 #include <KDialog>
18 #include <KUrl>
19 
20 #include "ui_newtransferwidget.h"
21 
22 class KJob;
23 class TransferHandler;
24 
35 class NewTransferDialog : public KDialog
36 {
37  Q_OBJECT
38 
39  friend class NewTransferDialogHandler;
40 
41  public:
42  ~NewTransferDialog();
43 
44  public slots:
49  void setDefaultDestination();
50 
51  private slots:
52  void inputTimer();
53  void checkInput();
54  void slotFinished(int resultCode);
55 
56  private:
57  explicit NewTransferDialog(QWidget *parent = 0);
58 
62  void showDialog(KUrl::List list, const QString &suggestedFileName = QString());
63  void prepareDialog();
64  bool isEmpty();
65 
69  void setMultiple(bool useMultiple);
70 
74  void setSource(const KUrl::List &sources);
75 
76  void setDestinationFileName(const QString &filename);
77  void setDestination();
78 
79  void setWarning(const QString &warning);
80  void setInformation(const QString &information);
81 
82  void dialogAccepted();
83 
84  void clear();
85 
86  private:
87  Ui::NewTransferWidget ui;
88  QWidget *m_window;
89  QTimer *m_timer;
90  KUrl::List m_sources;
91 
92  //points to a folder if m_multiple otherwise to the destination
93  KUrl m_destination;
94 
95  TransferHandler *m_existingTransfer;
96 
97  QBrush m_existingFileBackground;
98  QBrush m_normalBackground;
99 
100  bool m_multiple;
101  bool m_overWriteSingle;
102 };
103 
104 class NewTransferDialogHandler : public QObject
105 {
106  Q_OBJECT
107 
108  public:
109  explicit NewTransferDialogHandler(QObject *parent = 0);
110  ~NewTransferDialogHandler();
111 
115  static void showNewTransferDialog(const KUrl &url = KUrl());
116 
126  static void showNewTransferDialog(KUrl::List list);
127 
128  private slots:
129  void slotMostLocalUrlResult(KJob *job);
130 
131  private:
132  void handleUrls(const int jobId);
133  void createDialog(const KUrl::List &urls, const QString &suggestedFileName);
134 
135  private:
136  struct UrlData {
137  KUrl::List urls;
138  QString folder;
139  QString suggestedFileName;
140  QWidget *parent;
141  };
142 
146  int m_nextJobId;
147 
152  QHash<int, int> m_numJobs;
153 
159  QHash<int, UrlData> m_urls;
160 
161  QPointer<NewTransferDialog> m_dialog;
162 };
163 
164 #endif
NewTransferDialog::setDefaultDestination
void setDefaultDestination()
Called when the transfer group or the urlREquester changed, the dialog sets the default destination f...
Definition: newtransferdialog.cpp:234
TransferHandler
Class TransferHandler:
Definition: transferhandler.h:48
QWidget
NewTransferDialogHandler
Definition: newtransferdialog.h:104
KDialog
QObject
NewTransferDialog::~NewTransferDialog
~NewTransferDialog()
Definition: newtransferdialog.cpp:87
NewTransferDialog
Dialog to allow add one or more transfers to kget.
Definition: newtransferdialog.h:35
NewTransferDialogHandler::NewTransferDialogHandler
NewTransferDialogHandler(QObject *parent=0)
NOTE some checks in this class might seem redundant, though target is to display as few dialogs...
Definition: newtransferdialog.cpp:482
NewTransferDialogHandler::showNewTransferDialog
static void showNewTransferDialog(const KUrl &url=KUrl())
Definition: newtransferdialog.cpp:493
NewTransferDialogHandler::~NewTransferDialogHandler
~NewTransferDialogHandler()
Definition: newtransferdialog.cpp:488
KJob
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