1Config::Model::TkUI(3)User Contributed Perl DocumentationConfig::Model::TkUI(3)
2
3
4

NAME

6       Config::Model::TkUI - Tk GUI to edit config data through Config::Model
7

SYNOPSIS

9        use Config::Model::TkUI;
10
11        # init trace
12        Log::Log4perl->easy_init($WARN);
13
14        # create configuration instance
15        my $model = Config::Model -> new ;
16        my $inst = $model->instance (root_class_name => 'a_config_class',
17                                     instance_name   => 'test');
18        my $root = $inst -> config_root ;
19
20        # Tk part
21        my $mw = MainWindow-> new ;
22        $mw->withdraw ;
23        $mw->ConfigModelUI (-root => $root) ;
24
25        MainLoop ;
26

DESCRIPTION

28       This class provides a GUI for Config::Model.
29
30       With this class, Config::Model and an actual configuration model (like
31       Config::Model::Xorg), you get a tool to edit configuration files (e.g.
32       "/etc/X11/xorg.conf").
33

USAGE

35   Left side tree
36       ·   Click on '+' and '-' boxes to open or close content
37
38       ·   Left-click on item to open a viewer widget.
39
40       ·   Double-click or hit "return" on any item to open an editor widget
41
42       ·   Use Ctrl-C to copy configuration data in an internal buffer
43
44       ·   Use Ctrl-V to copy configuration data from the internal buffer to
45           the configuration tree. Beware, there's no "undo" operation.
46
47       ·   Before saving your modifications, you can review the change list
48           with the menu entry "File -> show unsaved changes". This list is
49           cleared after performing a "File -> save".
50
51       ·   Pasting cut buffer into:
52
53           ·   a leaf element will store the content of the buffer into the
54               element.
55
56           ·   a list element will split the content of the buffer with /\n/
57               or /,/ and push the resulting array at the end of the list
58               element.
59
60           ·   a hash element will use the content of the cut buffer to create
61               a new key in the hash element.
62
63   Font size and big screens
64       Font type and size can be adjusted using menu: "Options -> Font" menu.
65       This setup is saved in file "~/.cme/config/tkui.yml".
66
67   Search
68       Hit "Ctrl-F" or use menu "Edit -> Search" to open a search widget at
69       the bottom of the window.
70
71       Enter a keyword in the entry widget and click on "Next" button.
72
73       The keyword will be searched in the configuration tree, in element
74       name, in element value and in documentation.
75
76   Editor widget
77       The right side of the widget is either a viewer or an editor. When
78       clicking on store in the editor, the new data is stored in the tree
79       represented on the left side of TkUI. The new data will be stored in
80       the configuration file only when "File-"save> menu is invoked.
81
82   Wizard
83       A wizard can be launched either with "File -> Wizard" menu entry or
84       with "Run Wizard" button.
85
86       The wizard will scan the configuration tree and stop on all items
87       flagged as important in the model. It will also stop on all erroneous
88       items (mostly missing mandatory values).
89

Methods

91   save(callback)
92       Save modified data in configuration file. The callback function is
93       called only if the save was done without error. The callback is called
94       with $@ in case of failed save.
95

TODO

97       - add tabular view ?  - expand the whole tree at once - add plug-in
98       mechanism so that dedicated widget
99         can be used for some config Class (Could be handy for
100         Xorg::ServerLayout)
101

More information

103       ·   See Config::Model home page <https://github.com/dod38fr/config-
104           model/wiki>
105
106       ·   Or Author's blog <http://ddumont.wordpress.com> where you can find
107           many post about Config::Model.
108

FEEDBACK and HELP wanted

110       This project needs feedback from its users. Please send your feedbacks,
111       comments and ideas to the author.
112
113       ·   Look and feel of Perl/Tk interface can be improved
114
115       ·   A nicer logo (maybe a penguin with a wrench...) would be welcomed
116
117       ·   Config::Model could use a web interface
118
119       ·   May be also an interface based on Gtk or Wx for better integration
120           in Desktop
121

SEE ALSO

123       ·   Config::Model, cme
124
125       ·   https://github.com/dod38fr/config-model-tkui/wiki
126
127
128
129perl v5.28.1                      2019-02-02            Config::Model::TkUI(3)
Impressum