1Config::Model::TkUI(3)User Contributed Perl DocumentationConfig::Model::TkUI(3)
2
3
4
6 Config::Model::TkUI - Tk GUI to edit config data through Config::Model
7
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
19 # Tk part
20 my $mw = MainWindow-> new ;
21 $mw->withdraw ;
22 $mw->ConfigModelUI (-instance => $inst) ;
23
24 MainLoop ;
25
27 This class provides a GUI for Config::Model.
28
29 With this class, Config::Model and an actual configuration model (like
30 Config::Model::Xorg), you get a tool to edit configuration files (e.g.
31 "/etc/X11/xorg.conf").
32
34 Left side tree
35 • Click on '+' and '-' boxes to open or close content
36
37 • Left-click on item to open a viewer widget.
38
39 • Double-click or hit "return" on any item to open an editor widget
40
41 • Use Ctrl-C to copy configuration data in an internal buffer
42
43 • Use Ctrl-V to copy configuration data from the internal buffer to
44 the configuration tree. Beware, there's no "undo" operation.
45
46 • Before saving your modifications, you can review the change list
47 with the menu entry "File -> show unsaved changes". This list is
48 cleared after performing a "File -> save".
49
50 • Pasting cut buffer into:
51
52 • a leaf element will store the content of the buffer into the
53 element.
54
55 • a list element will split the content of the buffer with /\n/
56 or /,/ and push the resulting array at the end of the list
57 element.
58
59 • a hash element will use the content of the cut buffer to create
60 a new key in the hash element.
61
62 Font size and big screens
63 Font type and size can be adjusted using menu: "Options -> Font" menu.
64 This setup is saved in file "~/.cme/config/tkui.yml".
65
66 Search
67 Hit "Ctrl-F" or use menu "Edit -> Search" to open a search widget at
68 the bottom of the window.
69
70 Enter a keyword in the entry widget and click on "Next" button.
71
72 The keyword will be searched in the configuration tree, in element
73 name, in element value and in documentation.
74
75 Editor widget
76 The right side of the widget is either a viewer or an editor. When
77 clicking on store in the editor, the new data is stored in the tree
78 represented on the left side of TkUI. The new data will be stored in
79 the configuration file only when "File-"save> menu is invoked.
80
81 Wizard
82 A wizard can be launched either with "File -> Wizard" menu entry or
83 with "Run Wizard" button.
84
85 The wizard will scan the configuration tree and stop on all items
86 flagged as important in the model. It will also stop on all erroneous
87 items (mostly missing mandatory values).
88
90 save(callback)
91 Save modified data in configuration file. The callback function is
92 called only if the save was done without error. The callback is called
93 with $@ in case of failed save.
94
96 - add tabular view ? - expand the whole tree at once - add plug-in
97 mechanism so that dedicated widget
98 can be used for some config Class (Could be handy for
99 Xorg::ServerLayout)
100
102 • See Config::Model home page <https://github.com/dod38fr/config-
103 model/wiki>
104
105 • Or Author's blog <http://ddumont.wordpress.com> where you can find
106 many post about Config::Model.
107
109 This project needs feedback from its users. Please send your feedbacks,
110 comments and ideas to the author.
111
112 • Look and feel of Perl/Tk interface can be improved
113
114 • A nicer logo (maybe a penguin with a wrench...) would be welcomed
115
116 • Config::Model could use a web interface
117
118 • May be also an interface based on Gtk or Wx for better integration
119 in Desktop
120
122 • Config::Model, cme
123
124 • https://github.com/dod38fr/config-model-tkui/wiki
125
126
127
128perl v5.34.0 2022-01-21 Config::Model::TkUI(3)