File indexing completed on 2024-04-21 04:35:57

0001 /***************************************************************************
0002 *   Copyright 2007 Niko Sams <niko.sams@gmail.com>                        *
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 ***************************************************************************/
0010 
0011 #ifndef UPLOADDIALOG_H
0012 #define UPLOADDIALOG_H
0013 
0014 #include <QDialog>
0015 #include <QModelIndex>
0016 
0017 class QAbstractButton;
0018 class QProgressDialog;
0019 class QMenu;
0020 class KJob;
0021 namespace KDevelop {
0022     class IProject;
0023     class ProjectBaseItem;
0024 }
0025 class UploadProjectModel;
0026 class UploadProfileModel;
0027 class UploadProfileDlg;
0028 class UploadPlugin;
0029 namespace Ui {
0030     class UploadDialog;
0031 }
0032 
0033 /**
0034  * Dialog where the user can select the files to upload
0035  */
0036 class UploadDialog : public QDialog
0037 {
0038     Q_OBJECT
0039 
0040 public:
0041     UploadDialog(KDevelop::IProject* project, UploadPlugin* plugin, QWidget *parent = nullptr);
0042     ~UploadDialog() override;
0043 
0044     /**
0045      * Set the root-item, only items below this are displayed
0046      */
0047     void setRootItem(KDevelop::ProjectBaseItem* item);
0048 
0049     /**
0050      * Set the UploadProfileModel
0051      */
0052     void setProfileModel(UploadProfileModel* model);
0053 
0054 private Q_SLOTS:
0055     /**
0056      * Starts the upload
0057      */
0058     void startUpload();
0059 
0060     /**
0061      * Current profile changed, sets the new profile to the model
0062      */
0063     void profileChanged(int index);
0064 
0065     /**
0066      * Opens the  UploadProfileDlg to edit the current profile
0067      */
0068     void modifyProfile();
0069 
0070     /**
0071      * Called when the upload successfully finished, closes the UploadDialog
0072      */
0073     void uploadFinished();
0074 
0075 protected:
0076     /**
0077      * Event-filter for tree context-menu.
0078      */
0079     bool eventFilter(QObject* obj, QEvent* event) override;
0080 
0081 private:
0082     Ui::UploadDialog* m_ui;
0083     KDevelop::IProject* m_project;
0084     UploadProjectModel* m_uploadProjectModel;
0085     UploadProfileModel* m_profileModel;
0086     UploadProfileDlg* m_editProfileDlg;
0087     UploadPlugin* m_plugin;
0088     QMenu* m_treeContextMenu;
0089 };
0090 
0091 
0092 #endif
0093 // kate: space-indent on; indent-width 4; tab-width 4; replace-tabs on