예제 #1
0
bool KAccelAction::init( const QString& sName, const QString& sLabel, const QString& sWhatsThis,
			const KShortcut& rgCutDefaults3, const KShortcut& rgCutDefaults4,
			const QObject* pObjSlot, const char* psMethodSlot,
			bool bConfigurable, bool bEnabled )
{
	m_sName = sName;
	m_sLabel = sLabel;
	m_sWhatsThis = sWhatsThis;
	m_cutDefault3 = rgCutDefaults3;
	m_cutDefault4 = rgCutDefaults4;
	m_pObjSlot = pObjSlot;
	m_psMethodSlot = psMethodSlot;
	m_bConfigurable = bConfigurable;
	m_bEnabled = bEnabled;
	m_nIDAccel = 0;
	m_cut = shortcutDefault();
	d->m_nConnections = 0;
	if( !m_bEnabled )
		kdDebug(125) << "KAccelAction::init( \"" << sName << "\" ): created with enabled = false" << endl;
	return true;
}
예제 #2
0
/** Initialize the accelerator @p id by checking if it is overridden
    in the configuration file (and if it isn't, use the default).
*/
static void initialize(StdAccel id)
{
    KConfigGroupSaver saver(KGlobal::config(), "Shortcuts");
    KStdAccelInfo *pInfo = infoPtr(id);

    if(!pInfo)
    {
        kdWarning(125) << "KStdAccel: id not found!" << endl; // -- ellis
        return;
    }

    if(saver.config()->hasKey(pInfo->psName))
    {
        QString s = saver.config()->readEntry(pInfo->psName);
        if(s != "none")
            pInfo->cut.init(s);
        else
            pInfo->cut.clear();
    }
    else
        pInfo->cut = shortcutDefault(id);
    pInfo->bInitialized = true;
}
예제 #3
0
QString KAccelAction::toStringInternal() const
	{ return m_cut.toStringInternal( &shortcutDefault() ); }
예제 #4
0
KDECORE_EXPORT int defaultKey(StdAccel id)
{
    return shortcutDefault(id).keyCodeQt();
}