File indexing completed on 2024-12-01 12:42:39

0001 /***************************************************************************
0002                           cshortcut.cpp  -  macro key/shortcut
0003                              -------------------
0004     begin                : St máj 28 2003
0005     copyright            : (C) 2003 by Tomas Mecir
0006     email                : kmuddy@kmuddy.com
0007  ***************************************************************************/
0008 
0009 /***************************************************************************
0010  *                                                                         *
0011  *   This program is free software; you can redistribute it and/or modify  *
0012  *   it under the terms of the GNU General Public License as published by  *
0013  *   the Free Software Foundation; either version 2 of the License, or     *
0014  *   (at your option) any later version.                                   *
0015  *                                                                         *
0016  ***************************************************************************/
0017 
0018 #include "cshortcut.h"
0019 
0020 #include <kconfig.h>
0021 #include <kconfiggroup.h>
0022 
0023 cShortcut::cShortcut (int _sess) : sess(_sess)
0024 {
0025   _key = _state = 0;
0026   sendit = true;
0027   overwriteinput = false;
0028 }
0029 
0030 cShortcut::~cShortcut ()
0031 {
0032 
0033 }
0034 
0035 cSaveableField *cShortcut::newInstance ()
0036 {
0037   return new cShortcut (sess);
0038 }
0039 
0040 void cShortcut::load (KConfig *config, const QString &group)
0041 {
0042   KConfigGroup g = config->group (group);
0043 
0044   setText (g.readEntry ("Text", ""));
0045   setKey (g.readEntry ("Key", 0));
0046   setState (g.readEntry ("State", 0));
0047   setSendIt (g.readEntry ("Send it", true));
0048   setOverwriteInput (g.readEntry ("Overwrite input", false));
0049 }
0050