summaryrefslogtreecommitdiffstats
path: root/quanta/project/projectupload.h
blob: c307189964481d7dafc6a63b7b010848cc45777b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
/***************************************************************************
                          projectupload.h  -  description
                             -------------------
    begin                : Wed Nov 15 2000
    copyright            : (C) 2000 by Dmitry Poplavsky & Alexander Yakovlev & Eric Laffoon <pdima@users.sourceforge.net,yshurik@penguinpowered.com,sequitur@easystreet.com>
                           (C) 2002, 2004 Andras Mantia <amantia@kde.org>
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef PROJECTUPLOAD_H
#define PROJECTUPLOAD_H

#include "projectuploads.h"
#include "project.h"

#include <tqdom.h>
#include <tqptrlist.h>
#include <tqstringlist.h>

#include <tdeio/job.h>

/**
  *@author Dmitry Poplavsky & Alexander Yakovlev & Andras Mantia
  */

class KURL;
class Project;
class UploadProfileDlgS;

class ProjectUpload : public ProjectUploadS
{
  Q_OBJECT
  
public:
  /** Initializes the dialog. If showOnlyProfiles is true, the dialog
  displays only the list of profiles, no real upload can be performed.
  If quickUpload is true, the upload starts immediately without checking
  for modifications or confirmation from the user. The url will be
  uploaded to the default profile */
  ProjectUpload(const KURL& url, const TQString& profileName = TQString(), bool showOnlyProfiles = false, bool quickUpload = false, bool markOnly = false, const char * name = 0);
  ~ProjectUpload();
  TQString defaultProfile();

public slots: // Public slots
  /** No descriptions */
  void slotBuildTree();

protected slots:
  void startUpload();
  void upload();
  void uploadFinished( TDEIO::Job *job );
  void uploadProgress ( TDEIO::Job *job, unsigned long percent );
  void uploadMessage ( TDEIO::Job *, const TQString & msg );
  void slotUploadNext();

  void clearSelection();
  void selectAll();
  void selectModified();
  void invertSelection();
  void expandAll();
  void collapseAll();
  void clearProjectModified();

  void slotNewProfile();
  void slotEditProfile();
  void slotRemoveProfile();
  void slotNewProfileSelected(const TQString &profileName);

  virtual void resizeEvent( TQResizeEvent * );
  virtual void reject();


signals: // Signals
  /** No descriptions */
  void uploadNext();
  void eventHappened(const TQString&, const TQString&, const TQString&);

private:
  void buildSelectedItemList();
  void fillProfileDlg(UploadProfileDlgS *profileDlg);
  void readProfileDlg(UploadProfileDlgS *profileDlg);
  void setProfileTooltip();
  void loadRemoteUploadInfo();
  void saveRemoteUploadInfo();
  void initProjectInfo(const TQString& defaultProfile);
  void initBaseUrl(); /// Reads the current profile setting and initialize the baseUrl from it

  KURL::List modified; // modified files
  TQValueList<TQListViewItem*> needsConfirmation;
  TQPtrList<TQListViewItem> toUpload; // list of files , still didn't uploaded
  TQListViewItem *currentItem;
  KURL currentURL;
  KURL::List madeDirs;
  KURL *baseUrl;
  KURL startUrl;
  bool stopUpload;
  bool uploadInProgress;
  bool suspendUpload;
  TQString m_lastPassword;
  Project *m_project;
  TQString m_defaultProfile;
  TQDomElement m_currentProfileElement;
  TQDomElement m_lastEditedProfileElement;
  TQDomNode m_profilesNode;
  TQDomDocument m_uploadStatusDom;
  TQMap<TQString, int> m_uploadTimeList;
  bool m_profilesOnly;
  bool m_quickUpload;
};

#endif