• R/O
  • HTTP
  • SSH
  • HTTPS

origin: Commit

gpet(Gui Policy Editor for TOMOYO Linux) repository


Commit MetaInfo

Revision8def10aec6e5991eefcf7156cddab7b1773e8164 (tree)
Zeit2011-08-21 00:31:48
Autoryocto <yocto@user...>
Commiteryocto

Log Message

Ver. 0.3

Ändern Zusammenfassung

Diff

--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,34 @@
1+2011/06/18 yocto <yocto@users.sourceforge.jp>
2+
3+ 0.3 Released
4+
5+ * Enter key is enabled in the dialog box
6+ Domain window: profile list dialog
7+ Profile window: profile edit dialog
8+ Domain, ACL, Exception, Profile, Manager window: add dialog
9+
10+ * Search dialog enhancement
11+ Match case
12+ Wrap around
13+ Close dialog
14+
15+ * Path name displayed as it is.
16+ Domain, ACL, Exception window: display, search, add
17+ The command name of the Process window is still octal.
18+ When space and multi byte character, etc. are included in the path name
19+ input by an additional dialog, it encloses it with single quotation ['].
20+ Single quotes in the path name ['] may contain escaped with a backslash
21+ [\'] should be.
22+
23+ * Statistics window display was changed to display the local date and time.
24+
25+ * Added support for copy of the cursor line.(Profile window)
26+
27+ * Added a toolbar to the Manager window.
28+
29+ * Added a toolbar and Apply button to the Statistics window.
30+
31+
132 2011/04/25 yocto <yocto@users.sourceforge.jp>
233
334 0.2.1 Update
@@ -28,14 +59,14 @@
2859 * Added support for Extraction of redundant ACL entries.
2960 Ctrl+O
3061
31- * Added support for copy of the cursor line.(domain、ACL、exception)
62+ * Added support for copy of the cursor line.(Domain, ACL, Exception window)
3263 Ctrl+C
3364
3465 * Added support for search dialog.
3566
3667
3768
38-2011/04/23 yocto <yocto@users.sourceforge.jp>
69+2010/12/18 yocto <yocto@users.sourceforge.jp>
3970
4071 0.1 Released
4172
--- /dev/null
+++ b/ChangeLog.ja
@@ -0,0 +1,77 @@
1+2011/06/18 yocto <yocto@users.sourceforge.jp>
2+
3+ 0.3 Released
4+
5+ * ダイアログでのenter key有効化
6+ domainウィンドウ:プロファイル設定ダイアログ
7+ profileウィンドウ:プロファイル変更ダイアログ
8+ domain, ACL, exception, profile, managerウィンドウ:追加ダイアログ
9+
10+ * 検索ダイアログに機能追加
11+ 大文字と小文字を区別する (M)atch case
12+ 折返しも対象にする (W)rap around
13+ enterで閉じる Close (d)ialog
14+
15+ * パス名の漢字等をそのまま表示
16+ domain, ACL, exceptionウィンドウの表示、検索、追加で有効
17+ processウィンドウのコマンド名は8進表記のまま
18+ 追加ダイアログで入力するパス名にスペースや漢字等が含まれる場合は
19+ シングルクォーテーション[']で囲む
20+ パス名に[']が含まれる場合は\エスケープ[\']する
21+
22+ * Statisticsの日時をローカルタイム表示に変更
23+
24+ * カーソル行データコピーを追加:profile
25+
26+ * managerウィンドウにツールバーを追加
27+
28+ * Statisticsウィンドウにツールバー、適用ボタンを追加
29+
30+
31+2011/04/25 yocto <yocto@users.sourceforge.jp>
32+
33+ 0.2.1 Update
34+
35+ * ドキュメントのインストールディレクトリを
36+ 「/usr/doc/gpet/」から「/usr/share/doc/gpet/」に修正
37+
38+
39+2011/04/23 yocto <yocto@users.sourceforge.jp>
40+
41+ 0.2 Released
42+
43+ * ベースとなるccs-editpolicyをccstools 1.8.1 20110401版 に変更
44+
45+ * ACLウィンドウの切離し機能を追加
46+ メニュー > 表示 > ACLウィンドウ切離し
47+
48+ * メニューの memory usage を Statistics に変更
49+ ショーカットキー Ctrl+U を Ctrl+S に変更
50+
51+ * オフラインモードとネットワークモードに対応
52+ 現状はccs-editpolicy同様、起動引数で指定です。
53+
54+ * フォント及び色のリソースファイルに対応 gpetrc.sample 追加
55+ 下記のようにコピーして中身を変更してください
56+ cp /usr/share/doc/gpetrc.sample ~/.gpetrc
57+
58+ * プロセスモードのショーカットキーを Ctrl+O から Ctrl+@ に変更
59+
60+ * ACLの冗長エントリ抽出(パターン化支援)機能を追加
61+ ショーカットキー Ctrl+O
62+
63+ * ウィンドウキャプションにモード表示を追加
64+
65+ * エントリ追加時にカーソルを追加項目に移動するように変更
66+
67+ * カーソル行データコピー domain、ACL、exception
68+ コピー時にクリップボード(OSバッファ)にもコピーする
69+
70+ * ダイアログ検索を追加 domain、ACL、exception、profile
71+
72+
73+2010/12/18 yocto <yocto@users.sourceforge.jp>
74+
75+ 0.1 Released
76+
77+ * 初期リリース
--- a/INSTALL
+++ b/INSTALL
@@ -1,4 +1,4 @@
1-gpet 0.2.1 2011-04-25
1+gpet 0.3 2011-06-18
22
33 gpet (Gui Policy Editor for TOMOYO Linux)
44 Build / Install / Run / Uninstall
@@ -8,9 +8,9 @@ $ sudo apt-get install gcc make libncurses-dev
88
99 $ sudo apt-get install intltool libgtk2.0-dev libgconf2-dev
1010
11-$ tar xjvf gpet-0.2.1.tar.bz2
11+$ tar xjvf gpet-0.3.tar.bz2
1212
13-$ cd gpet-0.2.1
13+$ cd gpet-0.3
1414 $ ./configure --prefix /usr
1515
1616 $ make
@@ -37,26 +37,26 @@ $ cp /usr/share/doc/gpet/gpetrc.sample ~/.gpetrc
3737
3838
3939 *** Instll location ***
40-/usr
41-├── doc
42-│   └── gpet
43-│   ├── AUTHORS
44-│   ├── COPYING
45-│   ├── ChangeLog
46-│   ├── INSTALL
47-│   ├── NEWS
48-│   ├── README
49-│   └── gpetrc.sample
50-├── sbin
51-│   └── gpet
52-└── share
53- ├── gpet
54- │   └── pixmaps
55- │   └── tomoyo.png
56- └── locale
57- └── ja
58- └── LC_MESSAGES
59- └── gpet.mo
40+|-- sbin
41+| `-- gpet
42+`-- share
43+ |-- doc
44+ | `-- gpet
45+ | |-- AUTHORS
46+ | |-- COPYING
47+ | |-- ChangeLog
48+ | |-- ChangeLog.ja
49+ | |-- INSTALL
50+ | |-- NEWS
51+ | |-- README
52+ | `-- gpetrc.sample
53+ |-- gpet
54+ | `-- pixmaps
55+ | `-- tomoyo.png
56+ `-- locale
57+ `-- ja
58+ `-- LC_MESSAGES
59+ `-- gpet.mo
6060
6161
6262 *** Uninstall ***
--- a/Makefile.am
+++ b/Makefile.am
@@ -11,7 +11,7 @@ gpetdoc_DATA = \
1111 COPYING\
1212 AUTHORS\
1313 ChangeLog\
14- ChangeLog.jp\
14+ ChangeLog.ja\
1515 INSTALL\
1616 NEWS\
1717 gpetrc.sample
--- a/configure.ac
+++ b/configure.ac
@@ -1,7 +1,7 @@
11 dnl Process this file with autoconf to produce a configure script.
22 dnl Created by Anjuta application wizard.
33
4-AC_INIT(gpet, 0.2.1)
4+AC_INIT(gpet, 0.3)
55
66 __GPET=gpet
77 AC_SUBST(__GPET)
--- a/po/ja.po
+++ b/po/ja.po
@@ -8,8 +8,8 @@ msgid ""
88 msgstr ""
99 "Project-Id-Version: 0.1\n"
1010 "Report-Msgid-Bugs-To: \n"
11-"POT-Creation-Date: 2011-04-22 23:05+0900\n"
12-"PO-Revision-Date: 2011-04-22 23:04+0900\n"
11+"POT-Creation-Date: 2011-06-10 13:56+0900\n"
12+"PO-Revision-Date: 2011-06-10 13:56+0900\n"
1313 "Last-Translator: Yoshihiro Kusuno <yocto@users.sourceforge.jp>\n"
1414 "Language-Team: Japanese < >\n"
1515 "Language: \n"
@@ -17,44 +17,44 @@ msgstr ""
1717 "Content-Type: text/plain; charset=UTF-8\n"
1818 "Content-Transfer-Encoding: 8bit\n"
1919
20-#: ../src/gpet.c:1135
20+#: ../src/gpet.c:1193
2121 msgid "offline"
2222 msgstr "オフライン"
2323
24-#: ../src/gpet.c:1135
24+#: ../src/gpet.c:1193
2525 msgid "nework"
2626 msgstr "ネットワーク"
2727
28-#: ../src/gpet.c:1135
28+#: ../src/gpet.c:1193
2929 msgid "online"
3030 msgstr "オンライン"
3131
32-#: ../src/gpet.c:1179 ../src/gpet.c:1184 ../src/menu.c:79
32+#: ../src/gpet.c:1237 ../src/gpet.c:1242 ../src/menu.c:79
3333 msgid "Statistics"
3434 msgstr "統計情報"
3535
36-#: ../src/gpet.c:1190 ../src/gpet.c:1194 ../src/gpet.c:1199
36+#: ../src/gpet.c:1248 ../src/gpet.c:1252 ../src/gpet.c:1257
3737 msgid "Manager Policy"
3838 msgstr "マネージャ 一覧"
3939
40-#: ../src/gpet.c:1205 ../src/gpet.c:1209 ../src/gpet.c:1214
40+#: ../src/gpet.c:1263 ../src/gpet.c:1267 ../src/gpet.c:1272
4141 msgid "Domain Policy Editor"
4242 msgstr "ドメインポリシーエディタ"
4343
44-#: ../src/gpet.c:1385 ../src/gpet.c:1410
44+#: ../src/gpet.c:1443 ../src/gpet.c:1468
4545 msgid "gpet"
4646 msgstr "gpet"
4747
4848 #. create tab
49-#: ../src/gpet.c:1517 ../src/menu.c:352
49+#: ../src/gpet.c:1575 ../src/menu.c:469
5050 msgid "Domain Transition"
5151 msgstr "ドメイン遷移 一覧"
5252
53-#: ../src/gpet.c:1518
53+#: ../src/gpet.c:1576
5454 msgid "Exception Policy"
5555 msgstr "例外ポリシー 一覧"
5656
57-#: ../src/gpet.c:1519
57+#: ../src/gpet.c:1577
5858 msgid "Profile"
5959 msgstr "プロファイル 一覧"
6060
@@ -62,7 +62,7 @@ msgstr "プロファイル 一覧"
6262 msgid "_File"
6363 msgstr "ファイル(_F)"
6464
65-#: ../src/menu.c:47 ../src/other.c:47
65+#: ../src/menu.c:47 ../src/other.c:48
6666 msgid "_Edit"
6767 msgstr "編集(_E)"
6868
@@ -90,19 +90,19 @@ msgstr "編集(_E)"
9090 msgid "Set or Edit the selected line"
9191 msgstr "選択した行を修正します。"
9292
93-#: ../src/menu.c:56 ../src/other.c:49
93+#: ../src/menu.c:56 ../src/other.c:50
9494 msgid "_Add"
9595 msgstr "追加(_A)"
9696
97-#: ../src/menu.c:57 ../src/other.c:50
97+#: ../src/menu.c:57 ../src/other.c:51
9898 msgid "Append line"
9999 msgstr "追加します。"
100100
101-#: ../src/menu.c:58 ../src/other.c:51
101+#: ../src/menu.c:58 ../src/other.c:52
102102 msgid "_Delete"
103103 msgstr "削除(_D)"
104104
105-#: ../src/menu.c:59 ../src/other.c:52
105+#: ../src/menu.c:59 ../src/other.c:53
106106 msgid "Delete the selected line"
107107 msgstr "選択した行を削除します。"
108108
@@ -123,8 +123,8 @@ msgid "Extraction of redundant ACL entries"
123123 msgstr "冗長なACLエントリを削除するためのサポートをします。"
124124
125125 #: ../src/menu.c:67
126-msgid "_Search"
127-msgstr "検索(_S)"
126+msgid "_Search..."
127+msgstr "検索...(_S)"
128128
129129 #: ../src/menu.c:68
130130 msgid "Search for text"
@@ -155,16 +155,16 @@ msgid "Refresh to the latest information"
155155 msgstr "再読み込みを行います。"
156156
157157 #: ../src/menu.c:76
158-msgid "_Manager"
159-msgstr "マネージャ(_M)"
158+msgid "_Manager..."
159+msgstr "マネージャ...(_M)"
160160
161161 #: ../src/menu.c:77
162162 msgid "Manager Profile Editor"
163163 msgstr "マネージャ 一覧"
164164
165165 #: ../src/menu.c:78
166-msgid "_Statistics"
167-msgstr "統計情報(_S)"
166+msgid "_Statistics..."
167+msgstr "統計情報...(_S)"
168168
169169 #: ../src/menu.c:81
170170 msgid "_About"
@@ -190,11 +190,11 @@ msgstr "ACLウィンドウ切離し"
190190 msgid "Detach ACL window"
191191 msgstr "ドメインポリシーを別ウィンドウで表示します。"
192192
193-#: ../src/menu.c:349
193+#: ../src/menu.c:466
194194 msgid "Process State"
195195 msgstr "プロセス 一覧"
196196
197-#: ../src/menu.c:627
197+#: ../src/menu.c:748
198198 #, c-format
199199 msgid ""
200200 "<span foreground='red' size='x-large'><b>Delete</b> the %d selected "
@@ -203,7 +203,7 @@ msgstr ""
203203 "<span foreground='red' size='x-large'>選択した %d行の例外ポリシーを<b>削除</"
204204 "b>します。</span>"
205205
206-#: ../src/menu.c:630
206+#: ../src/menu.c:751
207207 #, c-format
208208 msgid ""
209209 "<span foreground='red' size='x-large'><b>Delete</b> the selected exception "
@@ -212,7 +212,7 @@ msgstr ""
212212 "<span foreground='red' size='x-large'>選択した 例外ポリシーを<b>削除</b>しま"
213213 "す。</span>"
214214
215-#: ../src/menu.c:647
215+#: ../src/menu.c:768
216216 #, c-format
217217 msgid ""
218218 "<span foreground='red' size='x-large'><b>Delete</b> the %d selected domains?"
@@ -221,7 +221,7 @@ msgstr ""
221221 "<span foreground='red' size='x-large'>選択した %d行のドメインを<b>削除</b>し"
222222 "ます。</span>"
223223
224-#: ../src/menu.c:650
224+#: ../src/menu.c:771
225225 #, c-format
226226 msgid ""
227227 "<span foreground='red' size='x-large'><b>Delete</b> the selected domain?</"
@@ -230,7 +230,7 @@ msgstr ""
230230 "<span foreground='red' size='x-large'>選択した ドメインを<b>削除</b>します。"
231231 "</span>"
232232
233-#: ../src/menu.c:669
233+#: ../src/menu.c:790
234234 #, c-format
235235 msgid ""
236236 "<span foreground='blue' size='x-large'><b>Delete</b> the %d selected "
@@ -239,7 +239,7 @@ msgstr ""
239239 "<span foreground='red' size='x-large'>選択した %d行のポリシーを<b>削除</b>し"
240240 "ます。</span>"
241241
242-#: ../src/menu.c:672
242+#: ../src/menu.c:793
243243 #, c-format
244244 msgid ""
245245 "<span foreground='blue' size='x-large'><b>Delete</b> the selected policy?</"
@@ -248,101 +248,113 @@ msgstr ""
248248 "<span foreground='red' size='x-large'>選択した ポリシーを<b>削除</b>します。"
249249 "</span>"
250250
251-#: ../src/menu.c:813
251+#: ../src/menu.c:1027
252252 msgid "Add Domain"
253253 msgstr "ドメインを追加します。"
254254
255-#: ../src/menu.c:820
255+#: ../src/menu.c:1034
256256 msgid "Add Acl"
257257 msgstr "ドメインに対するアクセス許可を追加します。"
258258
259-#: ../src/menu.c:832
259+#: ../src/menu.c:1046
260260 msgid "Add Exception"
261261 msgstr "例外ポリシーを追加します。"
262262
263-#: ../src/menu.c:840
263+#: ../src/menu.c:1054
264264 msgid "Add Profile (0 - 255)"
265265 msgstr "プロファイルを追加します。 (0 - 255)"
266266
267-#: ../src/menu.c:976
267+#: ../src/menu.c:1196
268268 msgid "Profile list"
269269 msgstr "プロファイルを選択します。"
270270
271-#: ../src/menu.c:1039
271+#: ../src/menu.c:1271
272272 msgid "Profile Edit"
273273 msgstr "プロファイルを変更します。"
274274
275-#: ../src/menu.c:1120
275+#: ../src/menu.c:1355
276276 msgid "Yoshihiro Kusuno <yocto@users.sourceforge.jp>"
277277 msgstr "楠野 佳宏 <yocto@users.sourceforge.jp>"
278278
279-#: ../src/menu.c:1121
279+#: ../src/menu.c:1356
280280 msgid "ccstools --- kumaneko san"
281281 msgstr "ccstools --- 熊猫さん"
282282
283-#: ../src/menu.c:1123
283+#: ../src/menu.c:1358
284284 msgid "Yoshihiro Kusuno"
285285 msgstr "楠野 佳宏"
286286
287-#: ../src/other.c:48
287+#: ../src/other.c:49
288288 msgid "Edit the selected line"
289289 msgstr "選択した行を修正します。"
290290
291-#: ../src/other.c:224
291+#: ../src/other.c:228
292292 msgid "File Selection Dialog"
293293 msgstr "ファイルの選択"
294294
295-#: ../src/other.c:264
295+#: ../src/other.c:278
296296 msgid "Manager Add"
297297 msgstr "マネージャを追加します。"
298298
299-#: ../src/other.c:342
299+#: ../src/other.c:358
300300 #, c-format
301301 msgid "Delete the %d selected managers?"
302302 msgstr "選択した %d行のマネージャ登録を削除します。"
303303
304-#: ../src/other.c:343
304+#: ../src/other.c:359
305305 #, c-format
306306 msgid "Delete the selected manager?"
307307 msgstr "選択したマネージャ登録を削除します。"
308308
309-#: ../src/other.c:560
309+#: ../src/other.c:598
310310 msgid " "
311311 msgstr " "
312312
313-#: ../src/other.c:567
313+#: ../src/other.c:605
314314 msgid "Now (bytes)"
315315 msgstr "使用量(バイト)"
316316
317-#: ../src/other.c:577
317+#: ../src/other.c:615
318318 msgid "Quota (bytes)"
319319 msgstr "最大 (バイト)"
320320
321-#: ../src/search.c:366
321+#: ../src/search.c:424
322322 msgid "Process Search for :"
323323 msgstr "プロセス 一覧 検索文字列 :"
324324
325-#: ../src/search.c:368
325+#: ../src/search.c:426
326326 msgid "Domain Search for :"
327327 msgstr "ドメイン 一覧 検索文字列 :"
328328
329-#: ../src/search.c:372
329+#: ../src/search.c:430
330330 msgid "ACL Search for :"
331331 msgstr "ドメインポリシー 一覧 検索文字列 :"
332332
333-#: ../src/search.c:375
333+#: ../src/search.c:433
334334 msgid "Exception Search for :"
335335 msgstr "例外ポリシー 一覧 検索文字列 :"
336336
337-#: ../src/search.c:378
337+#: ../src/search.c:436
338338 msgid "Profile Search for :"
339339 msgstr "プロファイル 一覧 検索文字列 :"
340340
341-#: ../src/search.c:382
341+#: ../src/search.c:440
342342 msgid "Search for :"
343343 msgstr "検索文字列 :"
344344
345-#: ../src/search.c:403
345+#: ../src/search.c:475
346+msgid "_Match case"
347+msgstr "大文字と小文字を区別する(_M)"
348+
349+#: ../src/search.c:481
350+msgid "_Wrap around"
351+msgstr "折返しも対象にする(_W)"
352+
353+#: ../src/search.c:487
354+msgid "Close _dialog"
355+msgstr "エンターで閉じる(_D)"
356+
357+#: ../src/search.c:516
346358 msgid "Find"
347359 msgstr "検索"
348360
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -46,6 +46,7 @@ gpet_SOURCES = \
4646 menu.c \
4747 g_undef.h \
4848 conf.c \
49+ conf.h \
4950 process.c \
5051 other.c \
5152 search.c \
--- a/src/conf.c
+++ b/src/conf.c
@@ -29,14 +29,33 @@
2929 #include <glib/gi18n.h>
3030
3131 #include "gpet.h"
32+#include "conf.h"
3233
3334 #define PRINT_WARN(err) {g_warning("%s", err->message);g_error_free(err);err = NULL;}
3435
3536 #define DIRECTORY "/apps/gpet"
36-#define WINDOW_POSITION DIRECTORY"/window_position"
37+#define WINDOW_POSITION DIRECTORY"/window_position"
3738 #define WINDOW_SIZE DIRECTORY"/window_size"
38-#define ACL_WINDOW_SIZE DIRECTORY"/acl_window_size"
39-#define PANED_POSITION DIRECTORY"/paned_position"
39+#define ACL_WINDOW_SIZE DIRECTORY"/acl_window_size"
40+#define PANED_POSITION DIRECTORY"/paned_position"
41+
42+#define SEARCH_DIR DIRECTORY"/search"
43+#define MATCH SEARCH_DIR"/match_case"
44+#define WRAP SEARCH_DIR"/wrap_around"
45+#define CLOSE SEARCH_DIR"/close_dialog"
46+
47+
48+static search_conf_t save_search = {TRUE, FALSE, FALSE};
49+
50+void get_conf_search(search_conf_t *conf)
51+{
52+ *conf = save_search;
53+}
54+
55+void put_conf_search(search_conf_t *conf)
56+{
57+ save_search = *conf;
58+}
4059
4160 void read_config(transition_t *tran)
4261 {
@@ -45,6 +64,7 @@ void read_config(transition_t *tran)
4564 gint x, y, w, h;
4665 GtkPaned *paned;
4766 gint paned_position;
67+ gboolean tmp_bool;
4868
4969 gtk_widget_set_size_request(tran->window, 640, 480);
5070 gtk_widget_set_size_request(tran->acl_window, 600, 400);
@@ -82,6 +102,29 @@ void read_config(transition_t *tran)
82102 else
83103 PRINT_WARN(err);
84104 }
105+
106+
107+ if (!gconf_client_dir_exists(client, SEARCH_DIR, &err)) {
108+ return;
109+ }
110+
111+ tmp_bool = gconf_client_get_bool(client, MATCH, &err);
112+ if (!err)
113+ save_search.match = tmp_bool;
114+ else
115+ PRINT_WARN(err);
116+
117+ tmp_bool = gconf_client_get_bool(client, WRAP, &err);
118+ if (!err)
119+ save_search.wrap = tmp_bool;
120+ else
121+ PRINT_WARN(err);
122+
123+ tmp_bool = gconf_client_get_bool(client, CLOSE, &err);
124+ if (!err)
125+ save_search.close = tmp_bool;
126+ else
127+ PRINT_WARN(err);
85128 }
86129
87130 void write_config(transition_t *tran)
@@ -128,5 +171,24 @@ void write_config(transition_t *tran)
128171 PRINT_WARN(err);
129172 }
130173 }
174+
175+
176+ if (!gconf_client_dir_exists(client, SEARCH_DIR, &err)) {
177+ gconf_client_add_dir(client, SEARCH_DIR,
178+ GCONF_CLIENT_PRELOAD_NONE, &err);
179+ }
180+ if (err) {
181+ PRINT_WARN(err);
182+ return;
183+ }
184+
185+ if (!gconf_client_set_bool(client, MATCH, save_search.match, &err))
186+ PRINT_WARN(err);
187+
188+ if (!gconf_client_set_bool(client, WRAP, save_search.wrap, &err))
189+ PRINT_WARN(err);
190+
191+ if (!gconf_client_set_bool(client, CLOSE, save_search.close, &err))
192+ PRINT_WARN(err);
131193 }
132194
--- /dev/null
+++ b/src/conf.h
@@ -0,0 +1,37 @@
1+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
2+/*
3+ * Gui Policy Editor for TOMOYO Linux
4+ *
5+ * conf.h
6+ * Copyright (C) Yoshihiro Kusuno 2011 <yocto@users.sourceforge.jp>
7+ *
8+ * This program is free software; you can redistribute it and/or modify
9+ * it under the terms of the GNU General Public License as published by
10+ * the Free Software Foundation; either version 2 of the License, or
11+ * (at your option) any later version.
12+ *
13+ * This program is distributed in the hope that it will be useful,
14+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+ * GNU Library General Public License for more details.
17+ *
18+ * You should have received a copy of the GNU General Public License
19+ * along with this program; if not, write to the Free Software
20+ * Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA
21+ */
22+
23+#ifndef __CONF_H__
24+#define __CONF_H__
25+
26+typedef struct _search_conf_t {
27+ gboolean match;
28+ gboolean wrap;
29+ gboolean close;
30+} search_conf_t;
31+
32+
33+void get_conf_search(search_conf_t *conf);
34+void put_conf_search(search_conf_t *conf);
35+
36+
37+#endif /* __CONF_H__ */
--- a/src/gpet.c
+++ b/src/gpet.c
@@ -36,6 +36,42 @@
3636 #include "gpet.h"
3737
3838 /*---------------------------------------------------------------------------*/
39+/* from util.c (ccs-patch-1.8.1-20110505) */
40+static gboolean is_octal_char(const char *str)
41+{
42+ return *str >= '0' && *str++ <= '3' &&
43+ *str >= '0' && *str++ <= '7' &&
44+ *str >= '0' && *str <= '7';
45+}
46+/* from util.c (ccs-patch-1.8.1-20110505) */
47+static gchar octal_char_to_binary(const char *str)
48+{
49+ return ((str[0] - '0') << 6) + ((str[1] - '0') << 3) + (str[2] - '0');
50+}
51+
52+gchar *decode_from_octal_str(const char *name)
53+{
54+ gchar *tmp, buff[strlen(name)+1];
55+
56+ if (!name)
57+ return NULL;
58+
59+ tmp = buff;
60+ for( ; *name; name++, tmp++) {
61+ if (*name == '\\' && is_octal_char(name + 1)) {
62+ name++;
63+ *tmp = octal_char_to_binary(name);
64+ name += 2;
65+ } else {
66+ *tmp = *name;
67+ }
68+ }
69+ *tmp = *name;
70+
71+ return g_strdup(buff);
72+}
73+
74+/*---------------------------------------------------------------------------*/
3975 enum tree_column_pos {
4076 COLUMN_INDEX, // data index (invisible)
4177 COLUMN_NUMBER, // n
@@ -55,12 +91,14 @@ static int add_tree_store(GtkTreeStore *store, GtkTreeIter *parent_iter,
5591 {
5692 GtkTreeIter iter;
5793 gchar *color = "black";
58- gchar *str_num, *str_prof;
94+ gchar *str_num, *str_prof, *name;
5995 gchar *line = NULL, *is_dis = NULL, *domain;
6096 const char *sp;
6197 const struct ccs_transition_control_entry *transition_control;
6298 int n, number, redirect_index = -1;
6399
100+//g_print("add_tree_store index[%3d] nest[%2d]\n", *index, nest);
101+
64102 sp = ccs_domain_name(dp, *index);
65103 for (n = 0; ; n++) {
66104 const char *cp = strchr(sp, ' ');
@@ -68,6 +106,7 @@ static int add_tree_store(GtkTreeStore *store, GtkTreeIter *parent_iter,
68106 break;
69107 sp = cp + 1;
70108 }
109+ name = decode_from_octal_str(sp);
71110
72111 gtk_tree_store_append(store, &iter, parent_iter);
73112 number = dp->list[*index].number;
@@ -120,7 +159,7 @@ static int add_tree_store(GtkTreeStore *store, GtkTreeIter *parent_iter,
120159 }
121160 domain = g_strdup_printf("%s%s%s%s%s",
122161 dp->list[*index].is_dd ? "( " : "",
123- sp,
162+ name,
124163 dp->list[*index].is_dd ? " )" : "",
125164 line ? line : "",
126165 is_dis ? is_dis : ""
@@ -128,6 +167,7 @@ static int add_tree_store(GtkTreeStore *store, GtkTreeIter *parent_iter,
128167 gtk_tree_store_set(store, &iter, COLUMN_DOMAIN_NAME, domain,
129168 COLUMN_COLOR, color,
130169 COLUMN_REDIRECT, redirect_index, -1);
170+ g_free(name);
131171 g_free(line);
132172 g_free(is_dis);
133173 g_free(domain);
@@ -159,7 +199,7 @@ void add_tree_data(GtkTreeView *treeview, struct ccs_domain_policy *dp)
159199 int index = 0, nest = -1;
160200
161201 store = GTK_TREE_STORE(gtk_tree_view_get_model(treeview));
162- gtk_tree_store_clear(store);
202+ gtk_tree_store_clear(store); // TODO 遅い
163203 add_tree_store(store, iter, dp, &index, nest);
164204 }
165205 /*---------------------------------------------------------------------------*/
@@ -284,14 +324,19 @@ void add_list_data(generic_list_t *generic, gboolean alias_flag)
284324 gtk_list_store_append(store, &iter);
285325
286326 if (alias_flag) {
327+ gchar *ope = decode_from_octal_str(
328+ generic->list[i].operand);
329+
287330 alias = (gchar *)
288331 ccs_directives[generic->list[i].directive].alias;
289332 gtk_list_store_set(store, &iter,
290333 LIST_NUMBER, str_num,
291334 LIST_COLON, ":",
292335 LIST_ALIAS, alias,
293- LIST_OPERAND, generic->list[i].operand,
336+// LIST_OPERAND, generic->list[i].operand,
337+ LIST_OPERAND, ope, // test
294338 -1);
339+ g_free(ope); // test
295340 } else {
296341 profile = g_strdup_printf("%3u-",
297342 generic->list[i].directive);
@@ -406,7 +451,7 @@ gint get_current_domain_index(transition_t *transition)
406451 return index;
407452 }
408453
409-gchar *get_alias_and_operand(GtkWidget *view)
454+gchar *get_alias_and_operand(GtkWidget *view, gboolean alias_flag)
410455 {
411456 GtkTreeSelection *selection;
412457 GtkTreeIter iter;
@@ -421,9 +466,17 @@ gchar *get_alias_and_operand(GtkWidget *view)
421466 list = gtk_tree_selection_get_selected_rows(selection, NULL);
422467 model = gtk_tree_view_get_model(GTK_TREE_VIEW(view));
423468 gtk_tree_model_get_iter(model, &iter, g_list_first(list)->data);
424- gtk_tree_model_get(model, &iter,
469+ if (alias_flag) {
470+ gtk_tree_model_get(model, &iter,
425471 LIST_ALIAS, &alias, LIST_OPERAND, &operand, -1);
426- str_buff = g_strdup_printf("%s %s", alias, operand);
472+ str_buff = g_strdup_printf("%s %s", alias, operand);
473+ g_free(alias);
474+ g_free(operand);
475+ } else {
476+ gtk_tree_model_get(model, &iter,
477+ LIST_OPERAND, &operand, -1);
478+ str_buff = g_strchug(operand);
479+ }
427480 }
428481
429482 return str_buff;
@@ -434,10 +487,9 @@ static gboolean move_pos_list(GtkTreeModel *model, GtkTreePath *path,
434487 {
435488 GtkWidget *view = NULL;
436489 GtkTreeSelection *selection;
437- const char *domain;
438490 gint index;
439- gchar *alias = NULL, *operand = NULL, *str_buff = NULL;
440- gchar *entry;
491+ gchar *alias = NULL, *operand = NULL;
492+ gchar *entry, *str_buff = NULL;
441493 int cmp = -1;
442494
443495
@@ -447,8 +499,9 @@ static gboolean move_pos_list(GtkTreeModel *model, GtkTreePath *path,
447499 case ADDENTRY_DOMAIN_LIST :
448500 view = transition->treeview;
449501 gtk_tree_model_get(model, iter, COLUMN_INDEX, &index, -1);
450- domain = ccs_domain_name(transition->dp, index);
451- cmp = strcmp(entry, domain);
502+ str_buff = decode_from_octal_str(
503+ ccs_domain_name(transition->dp, index));
504+ cmp = strcmp(entry, str_buff);
452505 break;
453506 case ADDENTRY_ACL_LIST :
454507 view = transition->acl.listview;
@@ -475,6 +528,7 @@ static gboolean move_pos_list(GtkTreeModel *model, GtkTreePath *path,
475528 g_free(alias);
476529 g_free(operand);
477530 g_free(str_buff);
531+ g_free(entry);
478532
479533 selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(view));
480534
@@ -545,13 +599,14 @@ void set_position_addentry(transition_t *transition, GtkTreePath **path)
545599 static void cb_selection(GtkTreeSelection *selection,
546600 transition_t *transition)
547601 {
548- GtkTreeIter iter;
549- gint select_count;
550- GtkTreeModel *model;
551- GList *list;
552- gint index;
602+ GtkTreeIter iter;
603+ gint select_count;
604+ GtkTreeModel *model;
605+ GList *list;
606+ gint index;
553607 GtkTreePath *path = NULL;
554608 GtkTreeViewColumn *column = NULL;
609+ gchar *name;
555610
556611 DEBUG_PRINT("In **************************** \n");
557612 select_count = gtk_tree_selection_count_selected_rows(selection);
@@ -567,8 +622,9 @@ static void cb_selection(GtkTreeSelection *selection,
567622 g_list_free(list);
568623 gtk_tree_model_get(model, &iter, COLUMN_INDEX, &index, -1);
569624 DEBUG_PRINT("--- index [%4d] ---\n", index);
570- gtk_entry_set_text(GTK_ENTRY(transition->domainbar),
571- ccs_domain_name(transition->dp, index));
625+ name = decode_from_octal_str(ccs_domain_name(transition->dp, index));
626+ gtk_entry_set_text(GTK_ENTRY(transition->domainbar), name);
627+ g_free(name);
572628
573629 gtk_tree_view_get_cursor(GTK_TREE_VIEW(
574630 transition->acl.listview), &path, &column);
@@ -735,6 +791,7 @@ void set_sensitive(GtkActionGroup *actions, int task_flag,
735791 case CCS_SCREEN_PROFILE_LIST :
736792 sens_edt = TRUE;
737793 sens_add = TRUE;
794+ sens_cpy = TRUE;
738795 break;
739796 }
740797
@@ -1009,6 +1066,7 @@ g_free(str_path);
10091066 gtk_tree_selection_unselect_path(selection, path);
10101067 }
10111068
1069+ g_free(str_num);
10121070 return FALSE;
10131071 }
10141072
--- a/src/gpet.h
+++ b/src/gpet.h
@@ -129,10 +129,11 @@ const char *get_policy_dir(void);
129129 const char *get_domain_last_name(const int index);
130130
131131 // gpet.c
132+gchar *decode_from_octal_str(const char *name);
132133 void add_tree_data(GtkTreeView *treeview, struct ccs_domain_policy *dp);
133134 void add_list_data(generic_list_t *generic, gboolean alias_flag);
134135 gint get_current_domain_index(transition_t *transition);
135-gchar *get_alias_and_operand(GtkWidget *view);
136+gchar *get_alias_and_operand(GtkWidget *view, gboolean alias_flag);
136137 void set_position_addentry(transition_t *transition, GtkTreePath **path);
137138 void set_sensitive(GtkActionGroup *actions, int task_flag,
138139 enum ccs_screen_type current_page);
@@ -155,6 +156,7 @@ int gpet_main(void);
155156 GtkWidget *create_menu(GtkWidget *parent, transition_t *transition,
156157 GtkWidget **toolbar);
157158 void disp_statusbar(transition_t *transition, int scr);
159+gchar *encode_to_octal_str(const char *str);
158160 void view_cursor_set(GtkWidget *view,
159161 GtkTreePath *path, GtkTreeViewColumn *column);
160162 void refresh_transition(GtkAction *action, transition_t *transition);
--- a/src/interface.inc
+++ b/src/interface.inc
@@ -94,6 +94,9 @@ static void generic_acl_copy(struct ccs_generic_acl **src, int src_cnt,
9494 while (dst_cnt)
9595 free((void *)((*dst)[--dst_cnt].operand));
9696
97+ if (src_cnt < 1)
98+ return;
99+
97100 *dst = realloc(*dst, src_cnt * sizeof(struct ccs_generic_acl));
98101 if (!(*dst))
99102 ccs_out_of_memory();
--- a/src/menu.c
+++ b/src/menu.c
@@ -64,7 +64,7 @@ static GtkActionEntry entries[] = {
6464 N_("_OptimizationSupport"), "<control>O",
6565 N_("Extraction of redundant ACL entries"), G_CALLBACK(optimize_acl)},
6666
67- {"Search", GTK_STOCK_FIND, N_("_Search"), "<control>F",
67+ {"Search", GTK_STOCK_FIND, N_("_Search..."), "<control>F",
6868 N_("Search for text"), G_CALLBACK(search_input)},
6969 {"SearchBack", GTK_STOCK_GO_BACK, N_("Search_Backwards"), "<control><shift>G",
7070 N_("Search backwards for the same text"), G_CALLBACK(search_back)},
@@ -73,9 +73,9 @@ static GtkActionEntry entries[] = {
7373
7474 {"Refresh", GTK_STOCK_REFRESH, N_("_Refresh"), "<control>R",
7575 N_("Refresh to the latest information"), G_CALLBACK(refresh_transition)},
76- {"Manager", GTK_STOCK_DND, N_("_Manager"), "<control>M",
76+ {"Manager", GTK_STOCK_DND, N_("_Manager..."), "<control>M",
7777 N_("Manager Profile Editor"), G_CALLBACK(manager_transition)},
78- {"Memory", GTK_STOCK_DND, N_("_Statistics"), "<control>S",
78+ {"Memory", GTK_STOCK_DND, N_("_Statistics..."), "<control>S",
7979 N_("Statistics"), G_CALLBACK(memory_transition)},
8080
8181 {"About", GTK_STOCK_ABOUT, N_("_About"), "<alt>A",
@@ -256,6 +256,123 @@ void disp_statusbar(transition_t *transition, int scr)
256256 transition->contextid, status_str);
257257 g_free(status_str);
258258 }
259+/*---------------------------------------------------------------------------*/
260+/* from realpath.c (ccs-patch-1.8.1-20110505) */
261+gchar *encode_to_octal_str(const char *str)
262+{
263+ int i;
264+ int str_len;
265+ int len = 0;
266+ const char *p = str;
267+ char *cp;
268+ char *cp0;
269+
270+ if (!p)
271+ return NULL;
272+
273+ str_len = strlen(str);
274+ for (i = 0; i < str_len; i++) {
275+ const unsigned char c = p[i];
276+ if (c == '\\')
277+// len += 2;
278+ len++;
279+ else if (c > ' ' && c < 127)
280+ len++;
281+ else
282+ len += 4;
283+ }
284+ len++;
285+
286+ /* Reserve space for appending "/". */
287+ cp = g_malloc0(len + 10);
288+ if (!cp)
289+ return NULL;
290+
291+ cp0 = cp;
292+ p = str;
293+ for (i = 0; i < str_len; i++) {
294+ const unsigned char c = p[i];
295+ if (c == '\\') {
296+ *cp++ = '\\';
297+// *cp++ = '\\';
298+ } else if (c > ' ' && c < 127) {
299+ *cp++ = c;
300+ } else {
301+ *cp++ = '\\';
302+ *cp++ = (c >> 6) + '0';
303+ *cp++ = ((c >> 3) & 7) + '0';
304+ *cp++ = (c & 7) + '0';
305+ }
306+ }
307+ return cp0;
308+}
309+
310+static gint encode_copy(gchar *cp, gchar *buff)
311+{
312+ gchar *str;
313+ gint len;
314+
315+ if (!*cp)
316+ return 0;
317+
318+ str = encode_to_octal_str(cp);
319+ strcpy(buff, str);
320+ len = strlen(str) - 1;
321+ g_free(str);
322+
323+ return len;
324+}
325+
326+static gchar *escape_str_encode(const char *input)
327+{
328+ gchar *str, *cp0, *cp1;
329+ gchar *tmp, buff[strlen(input)*3+1];
330+ gboolean match = FALSE;
331+
332+ if (!input)
333+ return NULL;
334+
335+ cp0 = str = g_strdup(input);
336+ tmp = buff;
337+ for( ; *cp0; cp0++, tmp++) {
338+ if (*cp0 == '\\' && *(cp0 + 1) == '\'') {
339+ *tmp = *++cp0;
340+ } else if (*cp0 == '\'') { // start "
341+ cp1 = ++cp0;
342+ for ( ; *cp0; cp0++) {
343+ if (*cp0 == '\\' && *(cp0 + 1) == '\'') {
344+ if (cp1 < cp0) {
345+ *cp0 = '\0';
346+ tmp += encode_copy(cp1, tmp);
347+ tmp++;
348+ } else {
349+ *tmp = *(cp0 + 1);
350+ }
351+ cp1 = ++cp0;
352+ } else if (*cp0 == '\'') { // end "
353+ *cp0 = '\0';
354+ match = TRUE;
355+ break;
356+ }
357+ }
358+
359+ if (match) {
360+ tmp += encode_copy(cp1, tmp);
361+ match = FALSE;
362+ } else {
363+ g_warning(" [\']pair not match!");
364+ cp0 = cp1;
365+ *tmp = *cp0;
366+ }
367+ } else {
368+ *tmp = *cp0;
369+ }
370+ }
371+ *tmp = *cp0;
372+
373+ g_free(str);
374+ return g_strdup(buff);
375+}
259376 /*-------+---------+---------+---------+---------+---------+---------+--------*/
260377 static void terminate(GtkAction *action, transition_t *transition)
261378 {
@@ -494,16 +611,20 @@ static void copy_line(GtkAction *action, transition_t *transition)
494611 index = get_current_domain_index(transition);
495612 view = transition->treeview;
496613 if (index >= 0)
497- insert_history_buffer(view, g_strdup(
614+ insert_history_buffer(view, decode_from_octal_str(
498615 ccs_domain_name(transition->dp, index)));
499616 break;
500617 case CCS_SCREEN_ACL_LIST :
501618 view = transition->acl.listview;
502- insert_history_buffer(view, get_alias_and_operand(view));
619+ insert_history_buffer(view, get_alias_and_operand(view, TRUE));
503620 break;
504621 case CCS_SCREEN_EXCEPTION_LIST :
505622 view = transition->exp.listview;
506- insert_history_buffer(view, get_alias_and_operand(view));
623+ insert_history_buffer(view, get_alias_and_operand(view, TRUE));
624+ break;
625+ case CCS_SCREEN_PROFILE_LIST :
626+ view = transition->prf.listview;
627+ insert_history_buffer(view, get_alias_and_operand(view, FALSE));
507628 break;
508629 default :
509630 break;
@@ -693,7 +814,25 @@ static gchar *Last_entry_string = NULL;
693814
694815 gchar *get_combo_entry_last(void)
695816 {
696- return Last_entry_string;
817+ gchar *str, *buff;
818+ gchar *cp;
819+
820+ buff = g_malloc0(strlen(Last_entry_string) + 1);
821+ if (!buff)
822+ return NULL;
823+
824+ str = buff;
825+ for (cp = Last_entry_string; *cp; cp++) {
826+ if (*cp == '\\' && *(cp + 1) == '\'') {
827+ *str++ = *++cp;
828+ } else if (*cp != '\'') {
829+ *str++ = *cp;
830+ }
831+ }
832+ *str = *cp;
833+
834+//g_print("[%s]\n", buff);
835+ return buff;
697836 }
698837
699838 static void insert_history_buffer(GtkWidget *view, gchar *entry)
@@ -710,8 +849,10 @@ static void insert_history_buffer(GtkWidget *view, gchar *entry)
710849 gtk_clipboard_set_text(clipboard, entry, -1);
711850
712851 for (list = combolist; list; list = g_list_next(list)) {
713- if (strcmp(entry, (gchar *)list->data) == 0)
852+ if (strcmp(entry, (gchar *)list->data) == 0) {
853+ g_free(entry);
714854 return;
855+ }
715856 }
716857
717858 combolist = g_list_insert(combolist, entry, 0);
@@ -723,7 +864,59 @@ static void insert_history_buffer(GtkWidget *view, gchar *entry)
723864 }
724865 }
725866
726-static gint combo_entry_activate(GtkWidget *combo, gchar **new_text)
867+static gchar *normalize_strdup(gchar *input)
868+{
869+ gchar *cp;
870+ gint len = strlen(input);
871+ gchar *str, *buff;
872+ gboolean match = FALSE;
873+
874+ if (len < 1)
875+ return NULL;
876+
877+ cp = input + len - 1;
878+ if (g_ascii_isspace(*cp)) {
879+ while (len && g_ascii_isspace(*cp)) {
880+ cp--;
881+ len--;
882+ }
883+ }
884+
885+ cp = input;
886+ while (len && g_ascii_isspace(*cp)) {
887+ cp++;
888+ len--;
889+ }
890+
891+ buff = g_malloc0(len + 1);
892+ if (!buff)
893+ return NULL;
894+
895+ str = buff;
896+ while (len && *cp) {
897+ if (*cp == '\\' && *(cp + 1) == '\'') {
898+ *str++ = *cp++;
899+ len--;
900+ } else if (*cp == '\'') {
901+ match = match ? FALSE : TRUE;
902+ } else {
903+ if (!match && g_ascii_isspace(*cp)) {
904+ while (g_ascii_isspace(*(cp+1))) {
905+ cp++;
906+ len--;
907+ }
908+ }
909+ }
910+ *str++ = *cp++;
911+ len--;
912+ }
913+ *str = '\0';
914+
915+//g_print("%2d[%s]\n", len, buff);
916+ return buff;
917+}
918+
919+static gint combo_entry_apply(GtkWidget *combo, gchar **new_text)
727920 {
728921 GtkComboBox *combobox;
729922 GList *list;
@@ -735,7 +928,9 @@ static gint combo_entry_activate(GtkWidget *combo, gchar **new_text)
735928 return 1;
736929
737930 g_free(Last_entry_string);
738- Last_entry_string = g_strdup(*new_text);
931+ Last_entry_string = normalize_strdup(*new_text);
932+ g_free(*new_text);
933+ *new_text = g_strdup(Last_entry_string);
739934
740935 for (list = combolist; list; list = g_list_next(list)) {
741936 if (strcmp(*new_text, (gchar *)list->data) == 0) {
@@ -757,6 +952,17 @@ static gint combo_entry_activate(GtkWidget *combo, gchar **new_text)
757952 return exist_flag ? 1 : 0;
758953 }
759954
955+static void cb_combo_entry_activate(GtkEntry *entry, GtkWidget *dialog)
956+{
957+ const gchar *input = gtk_entry_get_text(entry);
958+
959+ if (!input || strcmp(input, "") == 0)
960+ return;
961+
962+ gtk_dialog_response(GTK_DIALOG(dialog), GTK_RESPONSE_APPLY);
963+}
964+
965+/*---------------------------------------------------------------------------*/
760966 static gint append_dialog(transition_t *transition,
761967 gchar *title, gchar **input)
762968 {
@@ -777,6 +983,9 @@ static gint append_dialog(transition_t *transition,
777983 NULL);
778984
779985 combo = gtk_combo_box_entry_new_text();
986+ g_signal_connect(G_OBJECT(GTK_BIN(combo)->child) , "activate" ,
987+ G_CALLBACK(cb_combo_entry_activate), dialog);
988+
780989 gtk_combo_box_set_active(GTK_COMBO_BOX(combo), 0);
781990
782991 for (list = combolist; list; list = g_list_next(list)) {
@@ -791,7 +1000,12 @@ static gint append_dialog(transition_t *transition,
7911000
7921001 response = gtk_dialog_run(GTK_DIALOG(dialog));
7931002 if (response == GTK_RESPONSE_APPLY) {
794- combo_entry_activate(combo, input);
1003+ gchar *tmp;
1004+ combo_entry_apply(combo, input);
1005+ tmp = escape_str_encode(*input);
1006+// g_print("[%s]:[%s]\n", *input, tmp);
1007+ g_free(*input);
1008+ *input = tmp;
7951009 result = 0;
7961010 }
7971011 gtk_widget_destroy(dialog);
@@ -955,6 +1169,12 @@ static gboolean apply_profile(transition_t *transition,
9551169 }
9561170 }
9571171
1172+static void cb_profile_activate(GtkTreeView *treeview, GtkTreePath *treepath,
1173+ GtkTreeViewColumn *treeviewcolumn, GtkWidget *dialog)
1174+{
1175+ gtk_dialog_response(GTK_DIALOG(dialog), GTK_RESPONSE_APPLY);
1176+}
1177+
9581178 static void set_domain(transition_t *transition)
9591179 {
9601180 GtkTreeSelection *domain_selection;
@@ -981,6 +1201,8 @@ static void set_domain(transition_t *transition)
9811201 NULL);
9821202
9831203 listview = create_list_profile();
1204+ g_signal_connect(G_OBJECT(listview), "row-activated",
1205+ G_CALLBACK(cb_profile_activate), dialog);
9841206 add_list_profile(listview, &(transition->prf));
9851207 view_cursor_set(listview, NULL, NULL);
9861208 gtk_container_add(
@@ -1004,6 +1226,16 @@ retry_profile:
10041226 gtk_widget_destroy(dialog);
10051227 }
10061228
1229+static void cb_profile_entry_activate(GtkEntry *entry, GtkWidget *dialog)
1230+{
1231+ const gchar *input = gtk_entry_get_text(entry);
1232+
1233+ if (!input || strcmp(input, "") == 0)
1234+ return;
1235+
1236+ gtk_dialog_response(GTK_DIALOG(dialog), GTK_RESPONSE_APPLY);
1237+}
1238+
10071239 static void edit_profile(transition_t *transition)
10081240 {
10091241 GtkWidget *dialog;
@@ -1043,6 +1275,9 @@ static void edit_profile(transition_t *transition)
10431275 GTK_STOCK_APPLY, GTK_RESPONSE_APPLY,
10441276 NULL);
10451277
1278+ g_signal_connect(G_OBJECT(entry) , "activate" ,
1279+ G_CALLBACK(cb_profile_entry_activate), dialog);
1280+
10461281 hbox = gtk_hbox_new(FALSE, 5);
10471282 gtk_container_add(
10481283 GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), hbox);
@@ -1133,8 +1368,8 @@ static void show_about_dialog(void)
11331368 gtk_about_dialog_set_copyright(about,
11341369 "Copyright(C) 2010,2011 TOMOYO Linux Project");
11351370 gtk_about_dialog_set_comments(about,
1136- "Gui Policy Editor for TOMOYO Linux 1.8"
1137- " or AKARI 1.0"
1371+ "Gui Policy Editor for TOMOYO Linux 1.8.1"
1372+ " or AKARI 1.0.11"
11381373 "\n(based on ccs-editpolicy:ccstools)");
11391374 gtk_about_dialog_set_website(about, "http://sourceforge.jp/projects/gpet/");
11401375 // gtk_about_dialog_set_website_label(about, "http://tomoyo.sourceforge.jp/");
--- a/src/other.c
+++ b/src/other.c
@@ -26,6 +26,7 @@
2626
2727 #include <gtk/gtk.h>
2828 #include <glib/gi18n.h>
29+#include <glib/gprintf.h>
2930
3031 #include "gpet.h"
3132
@@ -178,7 +179,8 @@ static void add_list_manager(generic_list_t *man)
178179 gtk_widget_grab_focus(man->listview);
179180 }
180181
181-static void create_manager_view(GtkWidget *dialog, GtkWidget *listview)
182+static void create_manager_view(GtkWidget *dialog, GtkWidget *toolbar,
183+ GtkWidget *listview)
182184 {
183185 GtkWidget *scrolledwin;
184186
@@ -189,6 +191,8 @@ static void create_manager_view(GtkWidget *dialog, GtkWidget *listview)
189191 GTK_SCROLLED_WINDOW(scrolledwin), GTK_SHADOW_IN);
190192
191193 gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox),
194+ toolbar, FALSE, FALSE, 0);
195+ gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox),
192196 scrolledwin, TRUE, TRUE, 0);
193197 gtk_container_add(GTK_CONTAINER(scrolledwin), listview);
194198
@@ -251,6 +255,16 @@ static void cb_button(GtkButton *button, gpointer data)
251255 gtk_widget_destroy(dialog);
252256 }
253257
258+static void cb_manager_entry_activate(GtkEntry *entry, GtkWidget *dialog)
259+{
260+ const gchar *input = gtk_entry_get_text(entry);
261+
262+ if (!input || strcmp(input, "") == 0)
263+ return;
264+
265+ gtk_dialog_response(GTK_DIALOG(dialog), GTK_RESPONSE_APPLY);
266+}
267+
254268 static void append_manager(GtkAction *action, other_t *data)
255269 {
256270 GtkWidget *dialog;
@@ -273,6 +287,8 @@ static void append_manager(GtkAction *action, other_t *data)
273287 GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), hbox);
274288
275289 entry = gtk_entry_new();
290+ g_signal_connect(G_OBJECT(entry) , "activate" ,
291+ G_CALLBACK(cb_manager_entry_activate), dialog);
276292 gtk_box_pack_start(GTK_BOX(hbox), entry, TRUE, TRUE, 0);
277293 g_object_set_data(G_OBJECT(entry), "parent", (gpointer)dialog);
278294
@@ -369,6 +385,7 @@ void manager_main(transition_t *transition)
369385 {
370386 other_t data;
371387 GtkWidget *dialog;
388+ GtkWidget *toolbar;
372389 GtkWidget *listview;
373390 gchar *title;
374391 gint response;
@@ -381,9 +398,9 @@ void manager_main(transition_t *transition)
381398 NULL);
382399 g_free(title);
383400
384- create_dialog_menu(dialog, &data);
401+ toolbar = create_dialog_menu(dialog, &data);
385402 listview = create_list_manager();
386- create_manager_view(dialog, listview);
403+ create_manager_view(dialog, toolbar, listview);
387404
388405 data.dialog = dialog;
389406 data.manager.listview = listview;
@@ -415,6 +432,25 @@ void manager_main(transition_t *transition)
415432 transition->current_page = CCS_SCREEN_DOMAIN_LIST;
416433 }
417434 /*-------+---------+---------+---------+---------+---------+---------+--------*/
435+static void cnv_local_time(gchar *date, gchar *time)
436+{
437+ struct tm t, *lt;
438+ time_t timet;
439+
440+ memset(&t, 0, sizeof(t));
441+ sscanf(date, "%d/%d/%d", &(t.tm_year), &(t.tm_mon), &(t.tm_mday));
442+ sscanf(time, "%d:%d:%d", &(t.tm_hour), &(t.tm_min), &(t.tm_sec));
443+
444+ t.tm_year -= 1900;
445+ t.tm_mon--;
446+ timet = timegm(&t);
447+ lt = localtime(&timet);
448+
449+ g_sprintf(date, "%04d/%02d/%02d",
450+ lt->tm_year+1900, lt->tm_mon+1, lt->tm_mday);
451+ g_sprintf(time, "%02d:%02d:%02d", lt->tm_hour, lt->tm_min, lt->tm_sec);
452+}
453+
418454 static void get_disp_column(const char *data, gchar **head,
419455 gchar **now_str, gchar **quota_str)
420456 {
@@ -427,19 +463,19 @@ static void get_disp_column(const char *data, gchar **head,
427463 memset(name, 0, sizeof(name));
428464 memset(date, 0, sizeof(date));
429465 memset(time, 0, sizeof(time));
430- if ((cnt = sscanf(data, "Policy update: %u %s %s %s",
466+ if ((cnt = sscanf(data, "Policy update: %u (%s %s %s)",
431467 &now, name, date, time)) >= 1) {
432468 *head = "Policy update";
433469 } else if ((cnt = sscanf(data,
434- "Policy violation in learning mode: %u %s %s %s",
470+ "Policy violation in learning mode: %u (%s %s %s)",
435471 &now, name, date, time)) >= 1) {
436472 *head = "Policy violation in learning mode";
437473 } else if ((cnt = sscanf(data,
438- "Policy violation in permissive mode: %u %s %s %s",
474+ "Policy violation in permissive mode: %u (%s %s %s)",
439475 &now, name, date, time)) >= 1) {
440476 *head = "Policy violation in permissive mode";
441477 } else if ((cnt = sscanf(data,
442- "Policy violation in enforcing mode: %u %s %s %s",
478+ "Policy violation in enforcing mode: %u (%s %s %s)",
443479 &now, name, date, time)) >= 1) {
444480 *head = "Policy violation in enforcing mode";
445481 } else if ((cnt = sscanf(data,
@@ -467,10 +503,12 @@ static void get_disp_column(const char *data, gchar **head,
467503 bQuota = FALSE;
468504
469505 *now_str = bNow ? g_strdup_printf("%u", now) : g_strdup("");
470- if (strlen(name))
506+ if (strlen(name)) {
507+ cnv_local_time(date, time);
471508 *quota_str = g_strdup_printf("%s %s %s", name, date, time);
472- else
509+ } else {
473510 *quota_str = bQuota ? g_strdup_printf("%u", quota) : g_strdup("");
511+ }
474512 }
475513
476514 enum mem_column_pos {
@@ -584,7 +622,8 @@ static GtkWidget *create_list_memory(generic_list_t *mem)
584622 return treeview;
585623 }
586624
587-static void create_memory_view(GtkWidget *dialog, GtkWidget *listview)
625+static void create_memory_view(GtkWidget *dialog, GtkWidget *toolbar,
626+ GtkWidget *listview)
588627 {
589628 GtkWidget *scrolledwin;
590629
@@ -595,6 +634,8 @@ static void create_memory_view(GtkWidget *dialog, GtkWidget *listview)
595634 GTK_SCROLLED_WINDOW(scrolledwin), GTK_SHADOW_IN);
596635
597636 gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox),
637+ toolbar, FALSE, FALSE, 0);
638+ gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox),
598639 scrolledwin, TRUE, TRUE, 0);
599640 gtk_container_add(GTK_CONTAINER(scrolledwin), listview);
600641
@@ -623,6 +664,7 @@ void memory_main(transition_t *transition)
623664 {
624665 other_t data;
625666 GtkWidget *dialog;
667+ GtkWidget *toolbar;
626668 GtkWidget *listview;
627669 gchar *title;
628670 gint response;
@@ -631,18 +673,19 @@ void memory_main(transition_t *transition)
631673 dialog = gtk_dialog_new_with_buttons(title,
632674 GTK_WINDOW(transition->window),
633675 GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
634- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
635676 GTK_STOCK_APPLY, GTK_RESPONSE_APPLY,
677+ GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
678+ GTK_STOCK_OK, GTK_RESPONSE_OK,
636679 NULL);
637680 g_free(title);
638681
639682 data.dialog = dialog;
640683 data.memory.count = 0;
641684 data.memory.list = NULL;
642- create_dialog_menu(dialog, &data);
685+ toolbar = create_dialog_menu(dialog, &data);
643686 listview = create_list_memory(&(data.memory));
644687 data.memory.listview = listview;
645- create_memory_view(dialog, listview);
688+ create_memory_view(dialog, toolbar, listview);
646689
647690 add_list_memory(&(data.memory));
648691
@@ -655,8 +698,9 @@ void memory_main(transition_t *transition)
655698 gtk_widget_set_name(dialog, "GpetStatisticsDialog"); // .gpetrc
656699 gtk_widget_show_all(dialog);
657700
701+retry_memory:
658702 response = gtk_dialog_run(GTK_DIALOG(dialog));
659- if (response == GTK_RESPONSE_APPLY) {
703+ if (response == GTK_RESPONSE_APPLY || response == GTK_RESPONSE_OK) {
660704 char *err_buff = NULL;
661705 DEBUG_PRINT("Apply button was pressed.\n");
662706 if (set_memory(data.memory.list,
@@ -664,6 +708,11 @@ void memory_main(transition_t *transition)
664708 g_warning("%s", err_buff);
665709 free(err_buff);
666710 }
711+
712+ if (response == GTK_RESPONSE_APPLY) {
713+ add_list_memory(&(data.memory));
714+ goto retry_memory;
715+ }
667716 } else {
668717 DEBUG_PRINT("Another response was recieved.\n");
669718 }
--- a/src/process.c
+++ b/src/process.c
@@ -30,11 +30,11 @@
3030 #include "gpet.h"
3131
3232 enum task_column_pos {
33- COLUMN_INDEX, // data index (invisible)
33+ COLUMN_INDEX, // data index (invisible)
3434 COLUMN_NUMBER, // n
35- COLUMN_COLON, // :
35+ COLUMN_COLON, // :
3636 COLUMN_PROFILE, // profile
37- COLUMN_NAME, // process name + pid + domain name
37+ COLUMN_NAME, // process name + pid + domain name
3838 N_COLUMNS_TREE
3939 };
4040
@@ -45,6 +45,7 @@ static int add_task_tree_store(GtkTreeStore *store,
4545 {
4646 GtkTreeIter iter;
4747 gchar *str_prof;
48+ gchar *str_domain;
4849 gchar *line;
4950 int n = 0, index;
5051
@@ -52,18 +53,20 @@ static int add_task_tree_store(GtkTreeStore *store,
5253
5354 index = tsk->task[*number].index;
5455 str_prof = g_strdup_printf("%3u", tsk->task[*number].profile);
56+ str_domain = decode_from_octal_str(tsk->task[*number].domain);
5557 line = g_strdup_printf("%s (%u) %s",
5658 tsk->task[*number].name,
5759 tsk->task[*number].pid,
58- tsk->task[*number].domain);
60+ str_domain);
5961 gtk_tree_store_set(store, &iter,
6062 COLUMN_INDEX, index,
6163 COLUMN_NUMBER, *number,
6264 COLUMN_COLON, ":",
63- COLUMN_PROFILE, str_prof,
65+ COLUMN_PROFILE, str_prof,
6466 COLUMN_NAME, line,
6567 -1);
6668 DEBUG_PRINT("[%3d]%3d(%d):%s %s\n", index, *number, nest, str_prof, line);
69+ g_free(str_domain);
6770 g_free(str_prof);
6871 g_free(line);
6972
@@ -148,11 +151,12 @@ static gboolean cb_select_process(GtkTreeView *treeview,
148151 static void cb_selection_proc(GtkTreeSelection *selection,
149152 transition_t *transition)
150153 {
151- GtkTreeIter iter;
152- gint select_count;
153- GtkTreeModel *model;
154- GList *list;
155- gint index;
154+ GtkTreeIter iter;
155+ gint select_count;
156+ GtkTreeModel *model;
157+ GList *list;
158+ gint index;
159+ gchar *str_domain;
156160 GtkTreePath *path = NULL;
157161 GtkTreeViewColumn *column = NULL;
158162
@@ -167,8 +171,10 @@ static void cb_selection_proc(GtkTreeSelection *selection,
167171 g_list_foreach(list, (GFunc)gtk_tree_path_free, NULL);
168172 g_list_free(list);
169173 gtk_tree_model_get(model, &iter, COLUMN_INDEX, &index, -1);
170- gtk_entry_set_text(GTK_ENTRY(transition->domainbar),
171- transition->tsk.task[index].domain);
174+
175+ str_domain = decode_from_octal_str(transition->tsk.task[index].domain);
176+ gtk_entry_set_text(GTK_ENTRY(transition->domainbar), str_domain);
177+ g_free(str_domain);
172178
173179 gtk_tree_view_get_cursor(GTK_TREE_VIEW(
174180 transition->acl.listview), &path, &column);
--- a/src/search.c
+++ b/src/search.c
@@ -28,10 +28,12 @@
2828 #include <glib/gi18n.h>
2929
3030 #include "gpet.h"
31+#include "conf.h"
3132
3233 typedef struct _search_t {
3334 transition_t *tran;
3435 GtkWidget *combo;
36+ GtkWidget *dialog;
3537 } search_t;
3638
3739 #define COMBO_LIST_LIMIT 10
@@ -217,14 +219,42 @@ static gint get_current_index(transition_t *transition)
217219 static void search(transition_t *transition, gboolean forward)
218220 {
219221 GtkWidget *view = NULL;
220- gint index, count;
222+ gint index, start_index, count;
221223 gchar *str_p = NULL;
224+ gchar *haystack = NULL;
225+ gchar *tmp_entry, *entry = NULL;
226+ search_conf_t conf;
222227
223- index = get_current_index(transition);
228+ if (!S_entry || strcmp(S_entry, "") == 0)
229+ return;
230+
231+ get_conf_search(&conf);
232+
233+ tmp_entry = encode_to_octal_str(S_entry);
234+ entry = conf.match ? g_strdup(tmp_entry) : g_ascii_strup(tmp_entry, -1);
235+ g_free(tmp_entry);
236+
237+ start_index = index = get_current_index(transition);
224238 count = get_list_count(transition);
225- while (S_entry) {
226- forward ? index++ : index--;
227- if (index < 0 || count <= index)
239+ while (entry) {
240+ if (forward) {
241+ index++;
242+ if (count <= index) {
243+ if (conf.wrap)
244+ index = 0;
245+ else
246+ break;
247+ }
248+ } else {
249+ index--;
250+ if (index < 0) {
251+ if (conf.wrap)
252+ index = count - 1;
253+ else
254+ break;
255+ }
256+ }
257+ if (index == start_index)
228258 break;
229259
230260 switch((int)transition->current_page) {
@@ -263,18 +293,25 @@ static void search(transition_t *transition, gboolean forward)
263293 break;
264294 }
265295
266- if(g_strrstr(str_p, S_entry)) {
296+ g_free(haystack);
297+ haystack = conf.match ?
298+ g_strdup(str_p) : g_ascii_strup(str_p, -1);
299+
300+ if (transition->current_page != CCS_SCREEN_DOMAIN_LIST)
301+ g_free(str_p);
302+
303+ if(g_strrstr(haystack, entry)) {
267304 GtkTreeModel *model;
268305 put_locate_index(transition, index);
269306 model = gtk_tree_view_get_model(GTK_TREE_VIEW(view));
270307 gtk_tree_model_foreach(model,
271308 (GtkTreeModelForeachFunc)search_pos_list, transition);
309+ g_free(haystack);
272310 break;
273311 }
274312 }
275313
276- if (transition->current_page != CCS_SCREEN_DOMAIN_LIST)
277- g_free(str_p);
314+ g_free(entry);
278315
279316 gtk_action_set_sensitive(gtk_action_group_get_action(
280317 transition->actions, "SearchBack"), TRUE);
@@ -298,7 +335,7 @@ static void cb_combo_changed(GtkComboBox *combobox, gpointer nothing)
298335 }
299336 }
300337
301-static void cb_combo_entry_activate(GtkEntry *entry, search_t *srch)
338+static void cb_search_entry_activate(GtkEntry *entry, search_t *srch)
302339 {
303340 GtkComboBox *combobox;
304341 gchar *new_text;
@@ -307,12 +344,13 @@ static void cb_combo_entry_activate(GtkEntry *entry, search_t *srch)
307344
308345 combobox = GTK_COMBO_BOX(srch->combo);
309346 new_text = gtk_combo_box_get_active_text(combobox);
310- if(!new_text || strcmp(new_text, "") == 0)
347+ if (!new_text || strcmp(new_text, "") == 0) {
311348 return;
349+ }
312350
313351 g_free(S_entry);
314352 S_entry = g_strdup(new_text);
315-// g_print("cb_combo_entry_activate[%s]\n", new_text);
353+// g_print("cb_search_entry_activate[%s]\n", new_text);
316354
317355 for (list = combolist; list; list = g_list_next(list)) {
318356 if (strcmp(new_text, (gchar *)list->data) == 0) {
@@ -330,20 +368,36 @@ static void cb_combo_entry_activate(GtkEntry *entry, search_t *srch)
330368 }
331369 }
332370
333- if (entry)
371+ if (entry) {
372+ search_conf_t conf;
334373 search(srch->tran, TRUE);
374+ get_conf_search(&conf);
375+ if (conf.close)
376+ gtk_dialog_response(GTK_DIALOG(srch->dialog),
377+ GTK_RESPONSE_CLOSE);
378+ }
335379 }
336380
337381 static void cb_btn_prev_clicked(GtkButton *widget , search_t *srch)
338382 {
339- cb_combo_entry_activate(NULL, srch);
383+ search_conf_t conf;
384+ cb_search_entry_activate(NULL, srch);
340385 search(srch->tran, FALSE);
386+ get_conf_search(&conf);
387+ if (conf.close)
388+ gtk_dialog_response(GTK_DIALOG(srch->dialog),
389+ GTK_RESPONSE_CLOSE);
341390 }
342391
343392 static void cb_btn_next_clicked(GtkButton *widget , search_t *srch)
344393 {
345- cb_combo_entry_activate(NULL, srch);
394+ search_conf_t conf;
395+ cb_search_entry_activate(NULL, srch);
346396 search(srch->tran, TRUE);
397+ get_conf_search(&conf);
398+ if (conf.close)
399+ gtk_dialog_response(GTK_DIALOG(srch->dialog),
400+ GTK_RESPONSE_CLOSE);
347401 }
348402 /*-------+---------+---------+---------+---------+---------+---------+--------*/
349403 GList *insert_item(GtkComboBox *combobox,
@@ -389,6 +443,60 @@ static gchar *search_title(transition_t *transition)
389443 return title;
390444 }
391445
446+static void cb_toggled_match(GtkToggleButton *widget, search_conf_t *conf)
447+{
448+ conf->match = gtk_toggle_button_get_active(widget);
449+ put_conf_search(conf);
450+}
451+static void cb_toggled_wrap(GtkToggleButton *widget, search_conf_t *conf)
452+{
453+ conf->wrap = gtk_toggle_button_get_active(widget);
454+ put_conf_search(conf);
455+}
456+static void cb_toggled_close(GtkToggleButton *widget, search_conf_t *conf)
457+{
458+ conf->close = gtk_toggle_button_get_active(widget);
459+ put_conf_search(conf);
460+}
461+
462+static void create_check_box(GtkWidget *parent, search_conf_t *conf)
463+{
464+ GtkWidget *hbox, *vbox_l, *vbox_r;
465+ GtkWidget *match, *wrap, *close;
466+
467+ hbox = gtk_hbox_new(FALSE, 15);
468+ gtk_box_pack_start(GTK_BOX(parent), hbox, TRUE, TRUE, 10);
469+
470+ vbox_l = gtk_vbox_new(FALSE, 5);
471+ gtk_box_pack_start(GTK_BOX(hbox), vbox_l, TRUE, FALSE, 0);
472+ vbox_r = gtk_vbox_new(FALSE, 5);
473+ gtk_box_pack_start(GTK_BOX(hbox), vbox_r, TRUE, FALSE, 0);
474+
475+ match = gtk_check_button_new_with_mnemonic(_("_Match case"));
476+ gtk_box_pack_start(GTK_BOX(vbox_l), match, TRUE, FALSE, 0);
477+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(match), conf->match);
478+ g_signal_connect(G_OBJECT(match), "toggled",
479+ G_CALLBACK(cb_toggled_match), conf);
480+
481+ wrap = gtk_check_button_new_with_mnemonic(_("_Wrap around"));
482+ gtk_box_pack_start(GTK_BOX(vbox_l), wrap, TRUE, FALSE, 0);
483+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(wrap), conf->wrap);
484+ g_signal_connect(G_OBJECT(wrap), "toggled",
485+ G_CALLBACK(cb_toggled_wrap), conf);
486+
487+ close = gtk_check_button_new_with_mnemonic(_("Close _dialog"));
488+ gtk_box_pack_start(GTK_BOX(vbox_r), close, FALSE, FALSE, 0);
489+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(close), conf->close);
490+ g_signal_connect(G_OBJECT(close), "toggled",
491+ G_CALLBACK(cb_toggled_close), conf);
492+
493+/*
494+ 大文字と小文字を区別する (M)atch case
495+ 折返しも対象にする (W)rap around
496+ enterで閉じる Close (d)ialog
497+*/
498+}
499+
392500 void search_input(GtkAction *action, transition_t *transition)
393501 {
394502 GtkWidget *dialog, *parent;
@@ -398,6 +506,7 @@ void search_input(GtkAction *action, transition_t *transition)
398506 GtkWidget *btn_next, *btn_prev;
399507 GList *list;
400508 search_t srch;
509+ search_conf_t conf;
401510 gint response;
402511
403512 parent = (transition->acl_detached &&
@@ -425,10 +534,11 @@ void search_input(GtkAction *action, transition_t *transition)
425534 entry = gtk_combo_box_entry_new_text();
426535 srch.tran = transition;
427536 srch.combo = entry;
537+ srch.dialog = dialog;
428538 g_signal_connect(G_OBJECT(entry) , "changed",
429539 G_CALLBACK(cb_combo_changed), NULL);
430540 g_signal_connect(G_OBJECT(GTK_BIN(entry)->child) , "activate" ,
431- G_CALLBACK(cb_combo_entry_activate), &srch);
541+ G_CALLBACK(cb_search_entry_activate), &srch);
432542 gtk_box_pack_start(GTK_BOX(vbox_l), entry, FALSE, FALSE, 0);
433543
434544 for (list = combolist; list; list = g_list_next(list)) {
@@ -437,20 +547,23 @@ void search_input(GtkAction *action, transition_t *transition)
437547 }
438548 gtk_combo_box_set_active(GTK_COMBO_BOX(entry), 0);
439549
550+ get_conf_search(&conf);
551+ create_check_box(vbox_l, &conf);
552+
440553 vbox_r = gtk_vbox_new(FALSE, 5);
441554 gtk_box_pack_start(GTK_BOX(hbox), vbox_r, FALSE, FALSE, 0);
442555
443556 btn_prev = gtk_button_new_from_stock(GTK_STOCK_GO_BACK);
444- gtk_box_pack_start(GTK_BOX(vbox_r), btn_prev, FALSE, FALSE, 0);
557+ gtk_box_pack_start(GTK_BOX(vbox_r), btn_prev, TRUE, TRUE, 0);
445558 g_signal_connect(G_OBJECT(btn_prev) , "clicked" ,
446559 G_CALLBACK (cb_btn_prev_clicked) , &srch);
447560
448561 btn_next = gtk_button_new_from_stock(GTK_STOCK_GO_FORWARD);
449- gtk_box_pack_start(GTK_BOX(vbox_r), btn_next, FALSE, FALSE, 0);
562+ gtk_box_pack_start(GTK_BOX(vbox_r), btn_next, TRUE, TRUE, 0);
450563 g_signal_connect(G_OBJECT(btn_next) , "clicked" ,
451564 G_CALLBACK (cb_btn_next_clicked) , &srch);
452565
453- gtk_widget_set_size_request(dialog, 400, -1);
566+ gtk_widget_set_size_request(dialog, 520, -1);
454567 put_locate_index(transition, get_current_index(transition));
455568 gtk_widget_show_all(dialog);
456569
Show on old repository browser