~smartboyhw/ubuntu/raring/calligra/2.6.0-0ubuntu1

« back to all changes in this revision

Viewing changes to kexi/formeditor/factories/stdwidgetfactory.cpp

  • Committer: Package Import Robot
  • Author(s): Philip Muškovac
  • Date: 2012-10-23 21:09:16 UTC
  • mfrom: (1.1.13)
  • Revision ID: package-import@ubuntu.com-20121023210916-m82w6zxnxhaxz7va
Tags: 1:2.5.90-0ubuntu1
* New upstream alpha release (LP: #1070436)
  - Add libkactivities-dev and libopenimageio-dev to build-depends
  - Add kubuntu_build_calligraactive.diff to build calligraactive by default
  - Add package for calligraauthor and move files that are shared between
    calligrawords and calligraauthor to calligrawords-common
* Document the patches
* Remove numbers from patches so they follow the same naming scheme as
  the rest of our patches.
* calligra-data breaks replaces krita-data (<< 1:2.5.3) (LP: #1071686)

Show diffs side-by-side

added added

removed removed

Lines of Context:
47
47
#include <KDebug>
48
48
 
49
49
#include <KInputDialog>
50
 
#include <KIcon>
51
50
#include <KAction>
52
51
 
 
52
#include <KoIcon.h>
53
53
 
54
54
#include <koproperty/Property.h>
55
55
#include <koproperty/Set.h>
137
137
EditRichTextAction::EditRichTextAction(KFormDesigner::Container *container, 
138
138
                                       QWidget *receiver, QObject *parent,
139
139
                                       StdWidgetFactory *factory)
140
 
    : KAction(KIcon("document-edit"),
 
140
    : KAction(koIcon("document-edit"),
141
141
              i18nc("Edit rich text for a widget", "Edit Rich Text"),
142
142
              parent)
143
143
    , m_container(container)
181
181
        : KFormDesigner::WidgetFactory(parent, "stdwidgets")
182
182
{
183
183
    KFormDesigner::WidgetInfo *wFormWidget = new KFormDesigner::WidgetInfo(this);
184
 
    wFormWidget->setPixmap("form");
 
184
    wFormWidget->setIconName(koIconName("form"));
185
185
    wFormWidget->setClassName("FormWidgetBase");
186
186
    wFormWidget->setName(i18n("Form"));
187
187
    wFormWidget->setNamePrefix(i18nc("This string will be used to name widgets of this class. It must _not_ contain white "
190
190
    addClass(wFormWidget);
191
191
 
192
192
    KFormDesigner::WidgetInfo *wCustomWidget = new KFormDesigner::WidgetInfo(this);
193
 
    wCustomWidget->setPixmap("unknown_widget");
 
193
    wCustomWidget->setIconName(koIconName("unknown_widget"));
194
194
    wCustomWidget->setClassName("CustomWidget");
195
195
    wCustomWidget->setName(i18n("Custom Widget"));
196
196
    wCustomWidget->setNamePrefix(i18nc("This string will be used to name widgets of this class. It must _not_ contain white "
199
199
    addClass(wCustomWidget);
200
200
 
201
201
    KFormDesigner::WidgetInfo *wLabel = new KFormDesigner::WidgetInfo(this);
202
 
    wLabel->setPixmap("label");
 
202
    wLabel->setIconName(koIconName("label"));
203
203
    wLabel->setClassName("QLabel");
204
204
    wLabel->setName(i18n("Text Label"));
205
205
    wLabel->setNamePrefix(
209
209
    addClass(wLabel);
210
210
 
211
211
    KFormDesigner::WidgetInfo *wPixLabel = new KFormDesigner::WidgetInfo(this);
212
 
    wPixLabel->setPixmap("pixmaplabel");
 
212
    wPixLabel->setIconName(koIconName("pixmaplabel"));
213
213
    wPixLabel->setClassName("KexiPictureLabel");
214
214
    wPixLabel->setName(i18n("Picture Label"));
215
215
//! @todo Qt designer compatibility: maybe use this class when QLabel has a pixmap set...?
222
222
    addClass(wPixLabel);
223
223
 
224
224
    KFormDesigner::WidgetInfo *wLineEdit = new KFormDesigner::WidgetInfo(this);
225
 
    wLineEdit->setPixmap("lineedit");
 
225
    wLineEdit->setIconName(koIconName("lineedit"));
226
226
    wLineEdit->setClassName("KLineEdit");
227
227
    wLineEdit->addAlternateClassName("QLineEdit");
228
228
    wLineEdit->setIncludeFileName("klineedit.h");
234
234
 
235
235
#ifndef KEXI_NO_FORM_SPRING_ELEMENT
236
236
    KFormDesigner::WidgetInfo *wSpring = new KFormDesigner::WidgetInfo(this);
237
 
    wSpring->setPixmap("spring");
 
237
    wSpring->setIconName(koIconName("spring"));
238
238
    wSpring->setClassName("Spring");
239
239
    wSpring->setName(i18n("Spring"));
240
240
    wSpring->setNamePrefix(
250
250
#endif
251
251
 
252
252
    KFormDesigner::WidgetInfo *wPushButton = new KFormDesigner::WidgetInfo(this);
253
 
    wPushButton->setPixmap("button");
 
253
    wPushButton->setIconName(koIconName("button"));
254
254
    wPushButton->setClassName("KPushButton");
255
255
    wPushButton->addAlternateClassName("QPushButton");
256
256
    wPushButton->setIncludeFileName("kpushbutton.h");
262
262
    addClass(wPushButton);
263
263
 
264
264
    KFormDesigner::WidgetInfo *wRadioButton = new KFormDesigner::WidgetInfo(this);
265
 
    wRadioButton->setPixmap("radio");
 
265
    wRadioButton->setIconName(koIconName("radio"));
266
266
    wRadioButton->setClassName("QRadioButton");
267
267
    wRadioButton->setName(i18n("Option Button"));
268
268
    wRadioButton->setNamePrefix(
271
271
    addClass(wRadioButton);
272
272
 
273
273
    KFormDesigner::WidgetInfo *wCheckBox = new KFormDesigner::WidgetInfo(this);
274
 
    wCheckBox->setPixmap("check");
 
274
    wCheckBox->setIconName(koIconName("check"));
275
275
    wCheckBox->setClassName("QCheckBox");
276
276
    wCheckBox->setName(i18n("Check Box"));
277
277
    wCheckBox->setNamePrefix(
280
280
    addClass(wCheckBox);
281
281
 
282
282
    KFormDesigner::WidgetInfo *wSpinBox = new KFormDesigner::WidgetInfo(this);
283
 
    wSpinBox->setPixmap("spin");
 
283
    wSpinBox->setIconName(koIconName("spin"));
284
284
    wSpinBox->setClassName("KIntSpinBox");
285
285
    wSpinBox->addAlternateClassName("QSpinBox");
286
286
    wSpinBox->setIncludeFileName("knuminput.h");
291
291
    addClass(wSpinBox);
292
292
 
293
293
    KFormDesigner::WidgetInfo *wComboBox = new KFormDesigner::WidgetInfo(this);
294
 
    wComboBox->setPixmap("combo");
 
294
    wComboBox->setIconName(koIconName("combo"));
295
295
    wComboBox->setClassName("KComboBox");
296
296
    wComboBox->addAlternateClassName("QComboBox");
297
297
    wComboBox->setIncludeFileName("kcombobox.h");
304
304
 
305
305
#ifndef KEXI_FORMS_NO_LIST_WIDGET
306
306
    KFormDesigner::WidgetInfo *wListBox = new KFormDesigner::WidgetInfo(this);
307
 
    wListBox->setPixmap("listbox");
 
307
    wListBox->setIconName(koIconName("listbox"));
308
308
    wListBox->setClassName("KListBox");
309
309
    wListBox->addAlternateClassName("QListBox");
310
310
    wListBox->addAlternateClassName("KListBox");
317
317
    addClass(wListBox);
318
318
 
319
319
    KFormDesigner::WidgetInfo *wTreeWidget = new KFormDesigner::WidgetInfo(this);
320
 
    wTreeWidget->setPixmap("listwidget");
 
320
    wTreeWidget->setIconName(koIconName("listwidget"));
321
321
    wTreeWidget->setClassName("QTreetWidget");
322
322
//?    wTreeWidget->addAlternateClassName("QListView");
323
323
//?    wTreeWidget->addAlternateClassName("KListView");
331
331
#endif
332
332
 
333
333
    KFormDesigner::WidgetInfo *wTextEdit = new KFormDesigner::WidgetInfo(this);
334
 
    wTextEdit->setPixmap("textedit");
 
334
    wTextEdit->setIconName(koIconName("textedit"));
335
335
    wTextEdit->setClassName("KTextEdit");
336
336
    wTextEdit->addAlternateClassName("QTextEdit");
337
337
    wTextEdit->setIncludeFileName("ktextedit.h");
343
343
    addClass(wTextEdit);
344
344
 
345
345
    KFormDesigner::WidgetInfo *wSlider = new KFormDesigner::WidgetInfo(this);
346
 
    wSlider->setPixmap("slider");
 
346
    wSlider->setIconName(koIconName("slider"));
347
347
    wSlider->setClassName("QSlider");
348
348
    wSlider->setName(i18n("Slider"));
349
349
    wSlider->setNamePrefix(
352
352
    addClass(wSlider);
353
353
 
354
354
    KFormDesigner::WidgetInfo *wProgressBar = new KFormDesigner::WidgetInfo(this);
355
 
    wProgressBar->setPixmap("progress");
 
355
    wProgressBar->setIconName(koIconName("progress"));
356
356
    wProgressBar->setClassName("QProgressBar");
357
357
    wProgressBar->setName(i18n("Progress Bar"));
358
358
    wProgressBar->setNamePrefix(
361
361
    addClass(wProgressBar);
362
362
 
363
363
    KFormDesigner::WidgetInfo *wLine = new KFormDesigner::WidgetInfo(this);
364
 
    wLine->setPixmap("line");
 
364
    wLine->setIconName(koIconName("line"));
365
365
    wLine->setClassName("Line");
366
366
    wLine->setName(i18n("Line"));
367
367
    wLine->setNamePrefix(
376
376
    addClass(wLine);
377
377
 
378
378
    KFormDesigner::WidgetInfo *wDate = new KFormDesigner::WidgetInfo(this);
379
 
    wDate->setPixmap("dateedit");
 
379
    wDate->setIconName(koIconName("dateedit"));
380
380
    wDate->setClassName("QDateEdit");
381
381
    wDate->addAlternateClassName("KDateWidget");
382
382
    wDate->setIncludeFileName("qdateedit.h");
388
388
    addClass(wDate);
389
389
 
390
390
    KFormDesigner::WidgetInfo *wTime = new KFormDesigner::WidgetInfo(this);
391
 
    wTime->setPixmap("timeedit");
 
391
    wTime->setIconName(koIconName("timeedit"));
392
392
    wTime->setClassName("QTimeEdit");
393
393
    wTime->addAlternateClassName("KTimeWidget");
394
394
    wTime->setIncludeFileName("qtimewidget.h");
400
400
    addClass(wTime);
401
401
 
402
402
    KFormDesigner::WidgetInfo *wDateTime = new KFormDesigner::WidgetInfo(this);
403
 
    wDateTime->setPixmap("datetimeedit");
 
403
    wDateTime->setIconName(koIconName("datetimeedit"));
404
404
    wDateTime->setClassName("QDateTimeEdit");
405
405
    wDateTime->addAlternateClassName("KDateTimeWidget");
406
406
    wDateTime->setIncludeFileName("qdatetimewidget.h");
490
490
    if (c == "QLabel")
491
491
        w = new QLabel(text, p);
492
492
    else if (c == "KexiPictureLabel")
493
 
        w = new KexiPictureLabel(DesktopIcon("image-x-generic"), p);
 
493
        w = new KexiPictureLabel(koDesktopIcon("image-x-generic"), p);
494
494
    else if (c == "KLineEdit") {
495
495
        w = new KLineEdit(p);
496
496
//2.0        if (designMode)
587
587
    }
588
588
#ifndef KEXI_FORMS_NO_LIST_WIDGET
589
589
    else if (classname == "QTreeWidget") {
590
 
        menu->addAction(KIcon("document-properties"), i18n("Edit Contents of List Widget"), 
 
590
        menu->addAction(koIcon("document-properties"), i18n("Edit Contents of List Widget"), 
591
591
            this, SLOT(editListContents()));
592
592
        return true;
593
593
    }