author | zautrix <zautrix> | 2005-04-02 12:16:34 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-04-02 12:16:34 (UTC) |
commit | 997e7660a81baa2b8aeb1b66a3cc3ebe54e00ebe (patch) (unidiff) | |
tree | f788b37459574b5cea0d2ab874882c6a396c240d /microkde/kdeui | |
parent | e0d51120d2f0c178115746e0c1357af40f95bc77 (diff) | |
download | kdepimpi-997e7660a81baa2b8aeb1b66a3cc3ebe54e00ebe.zip kdepimpi-997e7660a81baa2b8aeb1b66a3cc3ebe54e00ebe.tar.gz kdepimpi-997e7660a81baa2b8aeb1b66a3cc3ebe54e00ebe.tar.bz2 |
more fixes
-rw-r--r-- | microkde/kdeui/ktoolbar.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/microkde/kdeui/ktoolbar.cpp b/microkde/kdeui/ktoolbar.cpp index 35d4916..36ede81 100644 --- a/microkde/kdeui/ktoolbar.cpp +++ b/microkde/kdeui/ktoolbar.cpp | |||
@@ -1132,64 +1132,65 @@ void KToolBar::saveState() | |||
1132 | 1132 | ||
1133 | if (just_append) | 1133 | if (just_append) |
1134 | local.documentElement().appendChild( current ); | 1134 | local.documentElement().appendChild( current ); |
1135 | 1135 | ||
1136 | KXMLGUIFactory::saveConfigFile(local, d->m_xmlguiClient->localXMLFile(), d->m_xmlguiClient->instance() ); | 1136 | KXMLGUIFactory::saveConfigFile(local, d->m_xmlguiClient->localXMLFile(), d->m_xmlguiClient->instance() ); |
1137 | 1137 | ||
1138 | return; | 1138 | return; |
1139 | } | 1139 | } |
1140 | */ | 1140 | */ |
1141 | // if that didn't work, we save to the config file | 1141 | // if that didn't work, we save to the config file |
1142 | KConfig *config = KGlobal::config(); | 1142 | KConfig *config = KGlobal::config(); |
1143 | saveSettings(config, QString::null); | 1143 | saveSettings(config, QString::null); |
1144 | config->sync(); | 1144 | config->sync(); |
1145 | } | 1145 | } |
1146 | 1146 | ||
1147 | QString KToolBar::settingsGroup() | 1147 | QString KToolBar::settingsGroup() |
1148 | { | 1148 | { |
1149 | QString configGroup; | 1149 | QString configGroup; |
1150 | if (!::qstrcmp(name(), "unnamed") || !::qstrcmp(name(), "mainToolBar")) | 1150 | if (!::qstrcmp(name(), "unnamed") || !::qstrcmp(name(), "mainToolBar")) |
1151 | configGroup = "Toolbar style"; | 1151 | configGroup = "Toolbar style"; |
1152 | else | 1152 | else |
1153 | configGroup = QString(name()) + " Toolbar style"; | 1153 | configGroup = QString(name()) + " Toolbar style"; |
1154 | if ( this->mainWindow() ) | 1154 | if ( this->mainWindow() ) |
1155 | { | 1155 | { |
1156 | configGroup.prepend(" "); | 1156 | configGroup.prepend(" "); |
1157 | configGroup.prepend( this->mainWindow()->name() ); | 1157 | configGroup.prepend( this->mainWindow()->name() ); |
1158 | } | 1158 | } |
1159 | return configGroup; | 1159 | return configGroup; |
1160 | } | 1160 | } |
1161 | 1161 | ||
1162 | void KToolBar::saveSettings(KConfig *config, const QString &_configGroup) | 1162 | void KToolBar::saveSettings(KConfig *config, const QString &_configGroup) |
1163 | { | 1163 | { |
1164 | return; | ||
1164 | QString configGroup = _configGroup; | 1165 | QString configGroup = _configGroup; |
1165 | if (configGroup.isEmpty()) | 1166 | if (configGroup.isEmpty()) |
1166 | configGroup = settingsGroup(); | 1167 | configGroup = settingsGroup(); |
1167 | //kdDebug(220) << "KToolBar::saveSettings group=" << _configGroup << " -> " << configGroup << endl; | 1168 | //kdDebug(220) << "KToolBar::saveSettings group=" << _configGroup << " -> " << configGroup << endl; |
1168 | 1169 | ||
1169 | QString position, icontext; | 1170 | QString position, icontext; |
1170 | int index; | 1171 | int index; |
1171 | getAttributes( position, icontext, index ); | 1172 | getAttributes( position, icontext, index ); |
1172 | 1173 | ||
1173 | //kdDebug(220) << "KToolBar::saveSettings " << name() << " newLine=" << newLine << endl; | 1174 | //kdDebug(220) << "KToolBar::saveSettings " << name() << " newLine=" << newLine << endl; |
1174 | 1175 | ||
1175 | KConfigGroupSaver saver(config, configGroup); | 1176 | KConfigGroupSaver saver(config, configGroup); |
1176 | 1177 | ||
1177 | if ( position != d->PositionDefault ) | 1178 | if ( position != d->PositionDefault ) |
1178 | config->writeEntry("Position", position); | 1179 | config->writeEntry("Position", position); |
1179 | else | 1180 | else |
1180 | config->deleteEntry("Position"); | 1181 | config->deleteEntry("Position"); |
1181 | 1182 | ||
1182 | if ( icontext != d->IconTextDefault ) | 1183 | if ( icontext != d->IconTextDefault ) |
1183 | config->writeEntry("IconText", icontext); | 1184 | config->writeEntry("IconText", icontext); |
1184 | else | 1185 | else |
1185 | config->deleteEntry("IconText"); | 1186 | config->deleteEntry("IconText"); |
1186 | 1187 | ||
1187 | if ( iconSize() != d->IconSizeDefault ) | 1188 | if ( iconSize() != d->IconSizeDefault ) |
1188 | config->writeEntry("IconSize", iconSize()); | 1189 | config->writeEntry("IconSize", iconSize()); |
1189 | else | 1190 | else |
1190 | config->deleteEntry("IconSize"); | 1191 | config->deleteEntry("IconSize"); |
1191 | 1192 | ||
1192 | if ( isHidden() != d->HiddenDefault ) | 1193 | if ( isHidden() != d->HiddenDefault ) |
1193 | config->writeEntry("Hidden", isHidden()); | 1194 | config->writeEntry("Hidden", isHidden()); |
1194 | else | 1195 | else |
1195 | config->deleteEntry("Hidden"); | 1196 | config->deleteEntry("Hidden"); |
@@ -1575,64 +1576,65 @@ bool KToolBar::highlightSetting() | |||
1575 | { | 1576 | { |
1576 | QString grpToolbar(QString::fromLatin1("Toolbar style")); | 1577 | QString grpToolbar(QString::fromLatin1("Toolbar style")); |
1577 | KConfigGroupSaver saver(KGlobal::config(), grpToolbar); | 1578 | KConfigGroupSaver saver(KGlobal::config(), grpToolbar); |
1578 | return KGlobal::config()->readBoolEntry(QString::fromLatin1("Highlighting"),true); | 1579 | return KGlobal::config()->readBoolEntry(QString::fromLatin1("Highlighting"),true); |
1579 | } | 1580 | } |
1580 | 1581 | ||
1581 | //static | 1582 | //static |
1582 | bool KToolBar::transparentSetting() | 1583 | bool KToolBar::transparentSetting() |
1583 | { | 1584 | { |
1584 | QString grpToolbar(QString::fromLatin1("Toolbar style")); | 1585 | QString grpToolbar(QString::fromLatin1("Toolbar style")); |
1585 | KConfigGroupSaver saver(KGlobal::config(), grpToolbar); | 1586 | KConfigGroupSaver saver(KGlobal::config(), grpToolbar); |
1586 | return KGlobal::config()->readBoolEntry(QString::fromLatin1("TransparentMoving"),true); | 1587 | return KGlobal::config()->readBoolEntry(QString::fromLatin1("TransparentMoving"),true); |
1587 | } | 1588 | } |
1588 | 1589 | ||
1589 | //static | 1590 | //static |
1590 | KToolBar::IconText KToolBar::iconTextSetting() | 1591 | KToolBar::IconText KToolBar::iconTextSetting() |
1591 | { | 1592 | { |
1592 | QString grpToolbar(QString::fromLatin1("Toolbar style")); | 1593 | QString grpToolbar(QString::fromLatin1("Toolbar style")); |
1593 | KConfigGroupSaver saver(KGlobal::config(), grpToolbar); | 1594 | KConfigGroupSaver saver(KGlobal::config(), grpToolbar); |
1594 | QString icontext = KGlobal::config()->readEntry(QString::fromLatin1("IconText"),QString::fromLatin1("IconOnly")); | 1595 | QString icontext = KGlobal::config()->readEntry(QString::fromLatin1("IconText"),QString::fromLatin1("IconOnly")); |
1595 | if ( icontext == "IconTextRight" ) | 1596 | if ( icontext == "IconTextRight" ) |
1596 | return IconTextRight; | 1597 | return IconTextRight; |
1597 | else if ( icontext == "IconTextBottom" ) | 1598 | else if ( icontext == "IconTextBottom" ) |
1598 | return IconTextBottom; | 1599 | return IconTextBottom; |
1599 | else if ( icontext == "TextOnly" ) | 1600 | else if ( icontext == "TextOnly" ) |
1600 | return TextOnly; | 1601 | return TextOnly; |
1601 | else | 1602 | else |
1602 | return IconOnly; | 1603 | return IconOnly; |
1603 | } | 1604 | } |
1604 | 1605 | ||
1605 | void KToolBar::applyAppearanceSettings(KConfig *config, const QString &_configGroup, bool forceGlobal) | 1606 | void KToolBar::applyAppearanceSettings(KConfig *config, const QString &_configGroup, bool forceGlobal) |
1606 | { | 1607 | { |
1608 | return; | ||
1607 | QString configGroup = _configGroup.isEmpty() ? settingsGroup() : _configGroup; | 1609 | QString configGroup = _configGroup.isEmpty() ? settingsGroup() : _configGroup; |
1608 | //kdDebug(220) << "KToolBar::applyAppearanceSettings: configGroup=" << configGroup << endl; | 1610 | //kdDebug(220) << "KToolBar::applyAppearanceSettings: configGroup=" << configGroup << endl; |
1609 | // We have application-specific settings in the XML file, | 1611 | // We have application-specific settings in the XML file, |
1610 | // and nothing in the application's config file | 1612 | // and nothing in the application's config file |
1611 | // -> don't apply the global defaults, the XML ones are preferred | 1613 | // -> don't apply the global defaults, the XML ones are preferred |
1612 | // See applySettings for a full explanation | 1614 | // See applySettings for a full explanation |
1613 | /*US :we do not support xml files | 1615 | /*US :we do not support xml files |
1614 | if ( d->m_xmlguiClient && !d->m_xmlguiClient->xmlFile().isEmpty() && | 1616 | if ( d->m_xmlguiClient && !d->m_xmlguiClient->xmlFile().isEmpty() && |
1615 | !config->hasGroup(configGroup) ) | 1617 | !config->hasGroup(configGroup) ) |
1616 | { | 1618 | { |
1617 | //kdDebug(220) << "skipping global defaults, using XML ones instead" << endl; | 1619 | //kdDebug(220) << "skipping global defaults, using XML ones instead" << endl; |
1618 | return; | 1620 | return; |
1619 | } | 1621 | } |
1620 | */ | 1622 | */ |
1621 | if ( !config->hasGroup(configGroup) ) | 1623 | if ( !config->hasGroup(configGroup) ) |
1622 | { | 1624 | { |
1623 | //kdDebug(220) << "skipping global defaults, using XML ones instead" << endl; | 1625 | //kdDebug(220) << "skipping global defaults, using XML ones instead" << endl; |
1624 | return; | 1626 | return; |
1625 | } | 1627 | } |
1626 | 1628 | ||
1627 | 1629 | ||
1628 | KConfig *gconfig = KGlobal::config(); | 1630 | KConfig *gconfig = KGlobal::config(); |
1629 | /*US | 1631 | /*US |
1630 | static const QString &attrIconText = KGlobal::staticQString("IconText"); | 1632 | static const QString &attrIconText = KGlobal::staticQString("IconText"); |
1631 | static const QString &attrHighlight = KGlobal::staticQString("Highlighting"); | 1633 | static const QString &attrHighlight = KGlobal::staticQString("Highlighting"); |
1632 | static const QString &attrTrans = KGlobal::staticQString("TransparentMoving"); | 1634 | static const QString &attrTrans = KGlobal::staticQString("TransparentMoving"); |
1633 | static const QString &attrSize = KGlobal::staticQString("IconSize"); | 1635 | static const QString &attrSize = KGlobal::staticQString("IconSize"); |
1634 | */ | 1636 | */ |
1635 | // we actually do this in two steps. | 1637 | // we actually do this in two steps. |
1636 | // First, we read in the global styles [Toolbar style] (from the KControl module). | 1638 | // First, we read in the global styles [Toolbar style] (from the KControl module). |
1637 | // Then, if the toolbar is NOT 'mainToolBar', we will also try to read in [barname Toolbar style] | 1639 | // Then, if the toolbar is NOT 'mainToolBar', we will also try to read in [barname Toolbar style] |
1638 | bool highlight; | 1640 | bool highlight; |