forked from KDE/kdev-upload
-
Notifications
You must be signed in to change notification settings - Fork 0
/
kdevuploadplugin.h
109 lines (88 loc) · 3.65 KB
/
kdevuploadplugin.h
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
/***************************************************************************
* Copyright 2007 Niko Sams <[email protected]> *
* *
* 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 KDEVUPLOADPLUGIN_H
#define KDEVUPLOADPLUGIN_H
#include <QList>
#include <QtCore/QVariant>
#include <interfaces/iplugin.h>
class QSignalMapper;
class QStandardItemModel;
class KActionMenu;
class QAction;
namespace KDevelop {
class ProjectBaseItem;
class IProject;
class IDocument;
}
class UploadProfileModel;
class FilesTreeViewFactory;
class AllProfilesModel;
class UploadPlugin : public KDevelop::IPlugin
{
Q_OBJECT
public:
UploadPlugin(QObject *parent, const QVariantList & = QVariantList() );
~UploadPlugin() override;
/**
* Returns the Upload-Action for the Contextmenu.
*/
KDevelop::ContextMenuExtension contextMenuExtension(KDevelop::Context* context, QWidget* parent) override;
/**
* Returns (and creates) the outputModel used for UploadPlugin.
* Creates the output-view (only the first time called)
*/
QStandardItemModel* outputModel();
int perProjectConfigPages() const override;
KDevelop::ConfigPage* perProjectConfigPage(int number, const KDevelop::ProjectConfigOptions& options, QWidget* parent) override;
private Q_SLOTS:
/**
* Opens the UploadDialog with the previously selected file as root.
* Executed from context-menu
*/
void upload();
/**
* Uploads the previously selected file without any futher actions needed by the user.
* Executed from context-menu
*/
void quickUpload();
/**
* Opens the UploadDialog for the project.
* Executed by the upload-action in the Project-menu
*/
void projectUpload(QObject* project);
void quickUploadCurrentFile();
/**
* Called when project was opened, adds a upload-action to the project-menu.
*/
void projectOpened(KDevelop::IProject*);
/**
* Called when project was closed, removes the upload-action from the project-menu.
*/
void projectClosed(KDevelop::IProject*);
/**
* Checks if there are any upload profiles, hides the ProfilesFileTree if there are none.
*/
void profilesRowChanged();
void documentActivated(KDevelop::IDocument*);
void documentClosed(KDevelop::IDocument*);
private:
void setupActions();
QList<KDevelop::ProjectBaseItem*> m_ctxUrlList; ///< selected files when the contextmenu was requested
KActionMenu* m_projectUploadActionMenu; ///< upload ActionMenu, displayed in the Project-Menu
QAction* m_quickUploadCurrentFile;
QMap<KDevelop::IProject*, QAction*> m_projectUploadActions; ///< upload actions for every open project
QMap<KDevelop::IProject*, UploadProfileModel*> m_projectProfileModels; ///< UploadProfileModels for every open project
QSignalMapper* m_signalMapper; ///< signal mapper for upload actions, to get the correct project
QStandardItemModel* m_outputModel; ///< model for log-output
FilesTreeViewFactory* m_filesTreeViewFactory; ///< factory for ProjectFilesTree
AllProfilesModel* m_allProfilesModel; ///< model for all profiles
};
#endif
// kate: space-indent on; indent-width 4; tab-width 4; replace-tabs on