5 #include "tdeaccelaction.h"
9 #include <kglobalaccel.h>
10 #include <kinstance.h>
11 #include <tdeshortcut.h>
12 #include "tdeshortcutlist.h"
22 TDEShortcutList::~TDEShortcutList()
37 if(
name( i ) == sName )
48 for( uint i = 0; i < nSize; i++ ) {
61 TQVariant TDEShortcutList::getOther( Other, uint )
const
66 bool TDEShortcutList::setOther( Other, uint, TQVariant )
73 kdDebug(125) <<
"TDEShortcutList::readSettings( \"" << sConfigGroup <<
"\", " << pConfig <<
" ) start" <<
endl;
76 TQString sGroup = (!sConfigGroup.isEmpty()) ? sConfigGroup : TQString(
"Shortcuts");
80 if( sGroup ==
"Shortcuts" && pConfig->
hasGroup(
"Keys" ) ) {
84 kdDebug(125) <<
"\treadSettings( \"" << sGroup <<
"\", " << pConfig <<
" )" <<
endl;
90 for( uint i = 0; i < nSize; i++ ) {
93 if( !sEntry.isEmpty() ) {
94 if( sEntry ==
"none" )
101 kdDebug(125) <<
"\t" <<
name(i) <<
" = '" << sEntry <<
"'" <<
endl;
105 kdDebug(125) <<
"TDEShortcutList::readSettings done" <<
endl;
111 kdDebug(125) <<
"TDEShortcutList::writeSettings( " << sConfigGroup <<
", " << pConfig <<
", " << bWriteAll <<
", " << bGlobal <<
" )" <<
endl;
115 TQString sGroup = (!sConfigGroup.isEmpty()) ? sConfigGroup : TQString(
"Shortcuts");
123 uint nSize =
count();
124 for( uint i = 0; i < nSize; i++ ) {
126 const TQString& sName =
name(i);
127 bool bConfigHasAction = !pConfig->
readEntry( sName ).isEmpty();
131 if( bWriteAll || !bSameAsDefault ) {
132 TQString s =
shortcut(i).toStringInternal();
135 kdDebug(125) <<
"\twriting " << sName <<
" = " << s <<
endl;
136 pConfig->
writeEntry( sName, s,
true, bGlobal );
140 else if( bConfigHasAction ) {
141 kdDebug(125) <<
"\tremoving " << sName <<
" because == default" <<
endl;
155 class TDEAccelShortcutListPrivate
158 TQString m_configGroup;
162 : m_actions( pAccel->actions() )
164 d=
new TDEAccelShortcutListPrivate;
170 : m_actions( pAccel->actions() )
172 d=
new TDEAccelShortcutListPrivate;
178 : m_actions( actions )
180 d=
new TDEAccelShortcutListPrivate;
185 TDEAccelShortcutList::~TDEAccelShortcutList()
190 {
return m_actions.actionPtr(i)->name(); }
192 {
return m_actions.actionPtr(i)->label(); }
194 {
return m_actions.actionPtr(i)->whatsThis(); }
196 {
return m_actions.actionPtr(i)->shortcut(); }
198 {
return m_actions.actionPtr(i)->shortcutDefault(); }
200 {
return m_actions.actionPtr(i)->isConfigurable(); }
202 {
return m_actions.actionPtr(i)->setShortcut( cut ); }
203 TQVariant TDEAccelShortcutList::getOther( Other, uint )
const
204 {
return TQVariant(); }
207 bool TDEAccelShortcutList::setOther( Other, uint, TQVariant )