* Generic builtin icons now supported

* Final fixups to builtin desktop icon configuration


git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1179152 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
v3.5.13-sru
tpearson 14 years ago
parent 0dfb53e20e
commit e975b7cec7

@ -389,7 +389,7 @@
<cstring>mediaListView</cstring>
</property>
<property name="enabled">
<bool>false</bool>
<bool>true</bool>
</property>
<property name="fullWidth">
<bool>true</bool>
@ -403,14 +403,6 @@
</widget>
</vbox>
</widget>
<connections>
<connection>
<sender>enableMediaBox</sender>
<signal>toggled(bool)</signal>
<receiver>mediaListView</receiver>
<slot>setEnabled(bool)</slot>
</connection>
</connections>
<tabstops>
<tabstop>autoLineupIconsBox</tabstop>
<tabstop>showHiddenBox</tabstop>

@ -132,6 +132,7 @@ DesktopBehavior::DesktopBehavior(KConfig *config, TQWidget *parent, const char *
connect(vrootBox, TQT_SIGNAL(clicked()), this, TQT_SIGNAL(changed()));
connect(autoLineupIconsBox, TQT_SIGNAL(clicked()), this, TQT_SIGNAL(changed()));
connect(toolTipBox, TQT_SIGNAL(clicked()), this, TQT_SIGNAL(changed()));
connect(mediaListView, TQT_SIGNAL(clicked(TQListViewItem *)), this, TQT_SLOT(mediaListViewChanged(TQListViewItem *)));
strMouseButton1 = i18n("&Left button:");
strButtonTxt1 = i18n( "You can choose what happens when"
@ -228,6 +229,24 @@ DesktopBehavior::DesktopBehavior(KConfig *config, TQWidget *parent, const char *
load();
}
void DesktopBehavior::mediaListViewChanged(TQListViewItem * item)
{
// FIXME: This should check to make sure an item was actually checked/unchecked before emitting changed()
emit changed();
}
void DesktopBehavior::setMediaListViewEnabled(bool enabled)
{
for (DesktopBehaviorMediaItem *it=static_cast<DesktopBehaviorMediaItem *>(mediaListView->firstChild());
it; it=static_cast<DesktopBehaviorMediaItem *>(it->nextSibling()))
{
if (it->mimeType().startsWith("media/builtin-") == false)
it->setVisible(enabled);
else
it->setVisible(TRUE);
}
}
void DesktopBehavior::fillMediaListView()
{
mediaListView->clear();
@ -242,7 +261,6 @@ void DesktopBehavior::fillMediaListView()
{
bool ok=excludedMedia.contains((*it2)->name())==0;
new DesktopBehaviorMediaItem (this, mediaListView, (*it2)->comment(), (*it2)->name(),ok);
}
}
}
@ -405,7 +423,7 @@ void DesktopBehavior::enableChanged()
{
behaviorTab->setTabEnabled(behaviorTab->page(2), enabled);
enableMediaBox->setEnabled(enabled);
mediaListView->setEnabled(enableMediaBox->isChecked());
setMediaListViewEnabled(enableMediaBox->isChecked());
}
changed();

@ -45,12 +45,14 @@ private slots:
void enableChanged();
void comboBoxChanged();
void editButtonPressed();
void mediaListViewChanged(TQListViewItem * item);
private:
KConfig *g_pConfig;
void fillMediaListView();
void saveMediaListView();
void setMediaListViewEnabled(bool enabled);
// Combo for the menus
void fillMenuCombo( TQComboBox * combo );

@ -842,34 +842,8 @@ bool KDIconView::deleteGlobalDesktopFiles()
if ( isDesktopFile(fItem) ) {
KSimpleConfig cfg( fItem->url().path(), true );
cfg.setDesktopGroup();
if ( cfg.readEntry( "X-Trinity-BuiltIn" ) == "true" &&
cfg.readEntry( "Name" ) == "My Documents" ) {
removeBuiltinIcon("My Documents");
continue;
}
if ( cfg.readEntry( "X-Trinity-BuiltIn" ) == "true" &&
cfg.readEntry( "Name" ) == "My Computer" ) {
removeBuiltinIcon("My Computer");
continue;
}
if ( cfg.readEntry( "X-Trinity-BuiltIn" ) == "true" &&
cfg.readEntry( "Name" ) == "My Network Places" ) {
removeBuiltinIcon("My Network Places");
continue;
}
if ( cfg.readEntry( "X-Trinity-BuiltIn" ) == "true" &&
cfg.readEntry( "Name" ) == "Printers" ) {
removeBuiltinIcon("Printers");
continue;
}
if ( cfg.readEntry( "X-Trinity-BuiltIn" ) == "true" &&
cfg.readEntry( "Name" ) == "Trash" ) {
removeBuiltinIcon("Trash");
continue;
}
if ( cfg.readEntry( "X-Trinity-BuiltIn" ) == "true" &&
cfg.readEntry( "Name" ) == "Web Browser" ) {
removeBuiltinIcon("Web Browser");
if ( cfg.readEntry( "X-Trinity-BuiltIn" ) == "true" ) {
removeBuiltinIcon(cfg.readEntry( "Name" ));
continue;
}
}

Loading…
Cancel
Save