Put a space between the parameter name and its description when prompting for it.
[synfig.git] / synfig-studio / trunk / src / gtkmm / keymapsettings.cpp
blob787b0543cd1600d632072e75c26c8012c317eabb
1 /* === S Y N F I G ========================================================= */
2 /*! \file keymapsettings.cpp
3 ** \brief Contains Info for Key Map settings
4 **
5 ** $Id$
6 **
7 ** \legal
8 ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
9 **
10 ** This package is free software; you can redistribute it and/or
11 ** modify it under the terms of the GNU General Public License as
12 ** published by the Free Software Foundation; either version 2 of
13 ** the License, or (at your option) any later version.
15 ** This package is distributed in the hope that it will be useful,
16 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 ** General Public License for more details.
19 ** \endlegal
21 /* ========================================================================= */
23 /* === H E A D E R S ======================================================= */
25 #ifdef USING_PCH
26 # include "pch.h"
27 #else
28 #ifdef HAVE_CONFIG_H
29 # include <config.h>
30 #endif
32 #include "keymapsettings.h"
34 #include <gtkmm/accelkey.h>
35 #include <gtkmm/accelmap.h>
36 #include <gtk/gtkaccelmap.h>
38 #include "general.h"
40 #endif
42 /* === U S I N G =========================================================== */
44 using namespace std;
45 //using namespace etl;
46 //using namespace synfig;
47 using namespace studio;
49 using namespace Gtk;
50 //using namespace Gtk::Menu_Helpers;
52 /* === M A C R O S ========================================================= */
54 /* === G L O B A L S ======================================================= */
56 /* === P R O C E D U R E S ================================================= */
58 /* === M E T H O D S ======================================================= */
60 /* === E N T R Y P O I N T ================================================= */
62 // KeyMapSettings Definitions
63 KeyMapSettings::KeyMapSettings()
67 KeyMapSettings::~KeyMapSettings()
71 bool KeyMapSettings::set_key(const char *path, guint key, Gdk::ModifierType mod, bool replace)
73 if(gtk_accel_map_lookup_entry(path,NULL))
75 return AccelMap::change_entry(path,key,mod,replace);
76 }else
78 AccelMap::add_entry(path,key,mod);
79 return true;
83 bool KeyMapSettings::get_key(const char *path, Gtk::AccelKey *key)
85 GtkAccelKey ac;
86 if(gtk_accel_map_lookup_entry(path,&ac))
88 *key = AccelKey(ac.accel_key,(Gdk::ModifierType)ac.accel_mods,string(path));
89 return true;
92 return false;
95 bool KeyMapSettings::load(const char *filename)
97 string n(filename);
98 n += ".skm";
100 AccelMap::load(filename);
102 return true;
105 bool KeyMapSettings::save(const char *filename)
107 string n(filename);
108 n += ".skm";
110 AccelMap::save(filename);
112 return true;