Changeset View
Changeset View
Standalone View
Standalone View
uploadpreferences.cpp
Context not available. | |||||
12 | #include <QVBoxLayout> | 12 | #include <QVBoxLayout> | ||
---|---|---|---|---|---|
13 | #include <QStandardItemModel> | 13 | #include <QStandardItemModel> | ||
14 | 14 | | |||
15 | #include <kpluginfactory.h> | | |||
16 | #include <kpluginloader.h> | | |||
17 | | ||||
18 | #include <interfaces/icore.h> | 15 | #include <interfaces/icore.h> | ||
19 | #include <interfaces/iplugincontroller.h> | 16 | #include <interfaces/iplugincontroller.h> | ||
20 | #include <interfaces/iprojectcontroller.h> | 17 | #include <interfaces/iprojectcontroller.h> | ||
Context not available. | |||||
25 | #include "ui_uploadpreferences.h" | 22 | #include "ui_uploadpreferences.h" | ||
26 | #include "uploadprofiledlg.h" | 23 | #include "uploadprofiledlg.h" | ||
27 | #include "uploadprofileitem.h" | 24 | #include "uploadprofileitem.h" | ||
28 | #include "kdevuploadplugin.h" | | |||
29 | 25 | | |||
30 | using namespace KDevelop; | 26 | using namespace KDevelop; | ||
31 | 27 | | |||
32 | K_PLUGIN_FACTORY(UploadPreferencesFactory, registerPlugin<UploadPreferences>(); ) | 28 | UploadPreferences::UploadPreferences( KDevelop::IPlugin* plugin, const KDevelop::ProjectConfigOptions& options, QWidget* parent ) | ||
33 | 29 | : ProjectConfigPage<UploadSettings>(plugin, options, parent) | |||
34 | UploadPreferences::UploadPreferences( QWidget *parent, const QVariantList &args ) | | |||
35 | : KCModule( parent, args ) | | |||
36 | { | 30 | { | ||
37 | IProject* project = nullptr; | 31 | IProject* project = options.project; | ||
38 | Q_FOREACH (IProject* p, KDevelop::ICore::self()->projectController()->projects()) { | | |||
39 | if (p->projectFile().path() == args.at(1).toString()) { | | |||
40 | project = p; | | |||
41 | break; | | |||
42 | } | | |||
43 | } | | |||
44 | Q_ASSERT(project); | | |||
45 | | ||||
46 | | ||||
47 | setButtons(Help | Apply); | | |||
48 | | ||||
49 | QVBoxLayout * l = new QVBoxLayout( this ); | | |||
50 | setLayout(l); | | |||
51 | QWidget* w = new QWidget(); | | |||
52 | l->addWidget(w); | | |||
53 | 32 | | |||
54 | m_ui = new Ui::UploadPreferences(); | 33 | m_ui = new Ui::UploadPreferences(); | ||
55 | m_ui->setupUi(w); | 34 | m_ui->setupUi(this); | ||
56 | 35 | | |||
57 | m_model = new UploadProfileModel(); | 36 | m_model = new UploadProfileModel(); | ||
58 | m_model->setProject(project); | 37 | m_model->setProject(project); | ||
59 | m_ui->profilesList->setModel(m_model); | 38 | m_ui->profilesList->setModel(m_model); | ||
60 | 39 | | |||
40 | | ||||
61 | connect(m_model, SIGNAL(dataChanged(QModelIndex, QModelIndex)), | 41 | connect(m_model, SIGNAL(dataChanged(QModelIndex, QModelIndex)), | ||
62 | this, SLOT(changed())); | 42 | this, SLOT(changed())); | ||
63 | connect(m_model, SIGNAL(rowsRemoved(QModelIndex, int, int)), | 43 | connect(m_model, SIGNAL(rowsRemoved(QModelIndex, int, int)), | ||
Context not available. | |||||
80 | delete m_ui; | 60 | delete m_ui; | ||
81 | } | 61 | } | ||
82 | 62 | | |||
83 | void UploadPreferences::save() | 63 | void UploadPreferences::reset() | ||
64 | { | ||||
65 | ProjectConfigPage::reset(); | ||||
66 | } | ||||
67 | | ||||
68 | void UploadPreferences::apply() | ||||
84 | { | 69 | { | ||
85 | m_model->submit(); | 70 | m_model->submit(); | ||
71 | ProjectConfigPage::apply(); | ||||
72 | } | ||||
73 | | ||||
74 | void UploadPreferences::defaults() | ||||
75 | { | ||||
76 | ProjectConfigPage::defaults(); | ||||
86 | } | 77 | } | ||
87 | 78 | | |||
88 | void UploadPreferences::addProfile() | 79 | void UploadPreferences::addProfile() | ||
Context not available. | |||||
114 | } | 105 | } | ||
115 | } | 106 | } | ||
116 | 107 | | |||
117 | #include "uploadpreferences.moc" | 108 | QString UploadPreferences::name() const | ||
109 | { | ||||
110 | return i18n("Upload"); | ||||
111 | } | ||||
112 | | ||||
113 | QString UploadPreferences::fullName() const | ||||
114 | { | ||||
115 | return i18n("Configure Upload settings"); | ||||
116 | } | ||||
117 | | ||||
118 | QIcon UploadPreferences::icon() const | ||||
119 | { | ||||
120 | return QIcon::fromTheme(QStringLiteral("go-up")); | ||||
121 | } | ||||
122 | | ||||
118 | // kate: space-indent on; indent-width 4; tab-width 4; replace-tabs on | 123 | // kate: space-indent on; indent-width 4; tab-width 4; replace-tabs on | ||
Context not available. |