~ubuntu-branches/ubuntu/hardy/kdebase-workspace/hardy

« back to all changes in this revision

Viewing changes to libs/plasma/appletbrowser.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2008-03-03 11:37:30 UTC
  • mfrom: (1.1.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20080303113730-ppdchskh93rr77le
Tags: 4:4.0.2-0ubuntu1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
87
87
        QString icon    = configGroup.readEntry("recommended." + id + ".icon");
88
88
        QString plugins = configGroup.readEntry("recommended." + id + ".plugins");
89
89
 
90
 
        appletList->addEmblem(i18n("Recommended by %1", caption), new KIcon(icon), 
 
90
        appletList->addEmblem(i18n("Recommended by %1", caption), new KIcon(icon),
91
91
                              KCategorizedItemsViewModels::Filter("recommended." + id, true));
92
92
        filterModel.addFilter(i18n("Recommended by %1", caption),
93
93
                              KCategorizedItemsViewModels::Filter("recommended." + id, true), new KIcon(icon));
161
161
        connect(addButton, SIGNAL(clicked()), this, SLOT(addApplet()));
162
162
        buttonLayout->addWidget( addButton );
163
163
 
164
 
        QPushButton *newButton = new QPushButton(i18n("Get New Widgets"), this ); //TODO: not overly happy with this text
 
164
/*        QPushButton *newButton = new QPushButton(i18n("Get New Widgets"), this ); //TODO: not overly happy with this text
165
165
        newButton->setEnabled( false ); //TODO: enable when GHNS integration is implemented
166
166
        connect(newButton, SIGNAL(clicked()), this, SLOT(downloadApplets()));
167
 
        buttonLayout->addWidget( newButton );
 
167
        buttonLayout->addWidget( newButton );*/
168
168
 
169
169
        layout->addItem( buttonLayout );
170
170
    }
171
171
 
172
172
    // Other Emblems
173
 
    d->appletList->addEmblem(i18n("Widgets I Have Used Before"), new KIcon("view-history"), 
 
173
    d->appletList->addEmblem(i18n("Widgets I Have Used Before"), new KIcon("view-history"),
174
174
                                KCategorizedItemsViewModels::Filter("used", true));
175
175
 
176
176
    d->initFilters();
230
230
    return d->application;
231
231
}
232
232
 
 
233
void AppletBrowserWidget::setContainment(Plasma::Containment *containment)
 
234
{
 
235
    d->containment = containment;
 
236
}
 
237
 
 
238
Containment *AppletBrowserWidget::containment() const
 
239
{
 
240
    return d->containment;
 
241
}
 
242
 
233
243
void AppletBrowserWidget::addApplet()
234
244
{
235
245
    kDebug() << "Button ADD clicked";
313
323
 
314
324
    setWindowTitle(i18n("Widgets"));
315
325
 
316
 
    setButtons(KDialog::Apply | KDialog::Close | KDialog::User1);
 
326
    setButtons(KDialog::Apply | KDialog::Close /*| KDialog::User1*/);
317
327
    setButtonText(KDialog::Apply, i18n("Add Widget"));
318
 
    setButtonText(KDialog::User1, i18n("Get New Widgets")); //TODO: not overly happy with this text
319
 
    enableButton(KDialog::User1, false); //TODO: enable when GHNS integration is implemented
 
328
//    setButtonText(KDialog::User1, i18n("Get New Widgets")); //TODO: not overly happy with this text
 
329
//    enableButton(KDialog::User1, false); //TODO: enable when GHNS integration is implemented
320
330
 
321
331
    connect(this, SIGNAL(applyClicked()), m_widget, SLOT(addApplet()));
322
 
    connect(this, SIGNAL(user1Clicked()), m_widget, SLOT(downloadApplets()));
 
332
//    connect(this, SIGNAL(user1Clicked()), m_widget, SLOT(downloadApplets()));
323
333
 
324
334
    QAction* quit = KStandardAction::quit(qApp, SLOT(quit()), this);
325
335
    addAction(quit);
339
349
    return m_widget->application();
340
350
}
341
351
 
 
352
void AppletBrowser::setContainment(Plasma::Containment *containment)
 
353
{
 
354
    m_widget->setContainment(containment);
 
355
}
 
356
 
 
357
Containment* AppletBrowser::containment() const
 
358
{
 
359
    return m_widget->containment();
 
360
}
 
361
 
342
362
} // namespace Plasma
343
363
 
344
364
#include "appletbrowser.moc"