aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2008-06-07 23:31:04 +0000
committerChristian Grothoff <christian@grothoff.org>2008-06-07 23:31:04 +0000
commitf04a0e55193e33fb9a0f5f2885ce26f43d971837 (patch)
tree85df38d4772e5139b7a108066da98c34e0ad7e77
parentd75c14d47342d8db493c8ef47a2236dfa0132af7 (diff)
downloadgnunet-gtk-f04a0e55193e33fb9a0f5f2885ce26f43d971837.tar.gz
gnunet-gtk-f04a0e55193e33fb9a0f5f2885ce26f43d971837.zip
done
-rw-r--r--TODO10
-rw-r--r--gnunet-gtk.glade73
-rw-r--r--pixmaps/self.pngbin0 -> 2010 bytes
-rw-r--r--pixmaps/self.svg172
-rw-r--r--src/plugins/chat/chat.c100
5 files changed, 331 insertions, 24 deletions
diff --git a/TODO b/TODO
index e4ab33f5..fd0c55dc 100644
--- a/TODO
+++ b/TODO
@@ -3,14 +3,6 @@ This is just the current plan, plans change.
3Annotations: 3Annotations:
4 RC == Release Critical 4 RC == Release Critical
5 5
60.8.0 (new core features):
7- chat improvements:
8 * allow leaving chat rooms
9 * allow sending / joining by pressing ENTER
10 * indicate who we are in the member list
11 * add various options for sending messages
12 * indicate how a message was received (private, signed, etc.)
13
140.8.1 (expand basics): 60.8.1 (expand basics):
15- improved search: 7- improved search:
16 * implement search bookmarking (e.g. user could add/edit/delete 8 * implement search bookmarking (e.g. user could add/edit/delete
@@ -20,6 +12,8 @@ Annotations:
20 pattern that must be matched for the lines to be displayed 12 pattern that must be matched for the lines to be displayed
21 (to further prune search results, for example) 13 (to further prune search results, for example)
22- improved chat: 14- improved chat:
15 * add various options for sending messages
16 * indicate how a message was received (private, signed, etc.)
23 * allow specifying metadata with nickname 17 * allow specifying metadata with nickname
24 * show chatroom member metadata (right-click pop-up) 18 * show chatroom member metadata (right-click pop-up)
25- unindexing: 19- unindexing:
diff --git a/gnunet-gtk.glade b/gnunet-gtk.glade
index d004360c..4802bbee 100644
--- a/gnunet-gtk.glade
+++ b/gnunet-gtk.glade
@@ -3144,7 +3144,7 @@ Press ENTER to add the data.</atkproperty>
3144 </packing> 3144 </packing>
3145 </child> 3145 </child>
3146 <child> 3146 <child>
3147 <widget class="GtkButton" id="searchCloseButton"> 3147 <widget class="GtkButton" id="searchCloseButtonOnPage">
3148 <property name="visible">True</property> 3148 <property name="visible">True</property>
3149 <property name="can_focus">True</property> 3149 <property name="can_focus">True</property>
3150 <property name="tooltip" translatable="yes">Close search tab (also aborts search)</property> 3150 <property name="tooltip" translatable="yes">Close search tab (also aborts search)</property>
@@ -3311,6 +3311,8 @@ Press ENTER to add the data.</atkproperty>
3311 <property name="visible">True</property> 3311 <property name="visible">True</property>
3312 <property name="can_focus">True</property> 3312 <property name="can_focus">True</property>
3313 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> 3313 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
3314 <signal name="activate" handler="on_chat_frame_send_button_click_event_"/>
3315 <accelerator key="Return" modifiers="" signal="activate"/>
3314 </widget> 3316 </widget>
3315 <packing> 3317 <packing>
3316 <property name="padding">5</property> 3318 <property name="padding">5</property>
@@ -3324,8 +3326,8 @@ Press ENTER to add the data.</atkproperty>
3324 <property name="has_default">True</property> 3326 <property name="has_default">True</property>
3325 <property name="tooltip" translatable="yes">Broadcast the message to all participants in the current chat room</property> 3327 <property name="tooltip" translatable="yes">Broadcast the message to all participants in the current chat room</property>
3326 <property name="response_id">0</property> 3328 <property name="response_id">0</property>
3327 <signal name="clicked" handler="on_chat_frame_send_button_click_event_"/> 3329 <signal name="activate" handler="on_chat_frame_send_button_click_event_"/>
3328 <accelerator key="Return" modifiers="GDK_CONTROL_MASK" signal="activate"/> 3330 <accelerator key="Return" modifiers="" signal="activate"/>
3329 <child> 3331 <child>
3330 <widget class="GtkAlignment" id="alignment6"> 3332 <widget class="GtkAlignment" id="alignment6">
3331 <property name="visible">True</property> 3333 <property name="visible">True</property>
@@ -3348,8 +3350,7 @@ Press ENTER to add the data.</atkproperty>
3348 <child> 3350 <child>
3349 <widget class="GtkLabel" id="label69"> 3351 <widget class="GtkLabel" id="label69">
3350 <property name="visible">True</property> 3352 <property name="visible">True</property>
3351 <property name="label" translatable="yes">Sen_d</property> 3353 <property name="label" translatable="yes">Send</property>
3352 <property name="use_underline">True</property>
3353 </widget> 3354 </widget>
3354 <packing> 3355 <packing>
3355 <property name="expand">False</property> 3356 <property name="expand">False</property>
@@ -3380,6 +3381,16 @@ Press ENTER to add the data.</atkproperty>
3380 </widget> 3381 </widget>
3381 </child> 3382 </child>
3382 <child> 3383 <child>
3384 <widget class="GtkVSeparator" id="vseparator2">
3385 <property name="visible">True</property>
3386 </widget>
3387 <packing>
3388 <property name="expand">False</property>
3389 <property name="padding">2</property>
3390 <property name="position">1</property>
3391 </packing>
3392 </child>
3393 <child>
3383 <widget class="GtkScrolledWindow" id="chatScroll"> 3394 <widget class="GtkScrolledWindow" id="chatScroll">
3384 <property name="visible">True</property> 3395 <property name="visible">True</property>
3385 <property name="can_focus">True</property> 3396 <property name="can_focus">True</property>
@@ -3389,16 +3400,18 @@ Press ENTER to add the data.</atkproperty>
3389 <property name="shadow_type">GTK_SHADOW_IN</property> 3400 <property name="shadow_type">GTK_SHADOW_IN</property>
3390 <child> 3401 <child>
3391 <widget class="GtkTreeView" id="roomMembersTreeView"> 3402 <widget class="GtkTreeView" id="roomMembersTreeView">
3403 <property name="width_request">200</property>
3392 <property name="visible">True</property> 3404 <property name="visible">True</property>
3393 <property name="can_focus">True</property> 3405 <property name="can_focus">True</property>
3394 <property name="headers_clickable">True</property> 3406 <property name="headers_clickable">True</property>
3407 <property name="rules_hint">True</property>
3395 </widget> 3408 </widget>
3396 </child> 3409 </child>
3397 </widget> 3410 </widget>
3398 <packing> 3411 <packing>
3399 <property name="expand">False</property> 3412 <property name="expand">False</property>
3400 <property name="fill">False</property> 3413 <property name="fill">False</property>
3401 <property name="position">1</property> 3414 <property name="position">2</property>
3402 </packing> 3415 </packing>
3403 </child> 3416 </child>
3404 </widget> 3417 </widget>
@@ -4363,7 +4376,7 @@ Alex Jones &lt;alexrjones@ntlworld.com&gt;</property>
4363 <property name="label">gtk-cancel</property> 4376 <property name="label">gtk-cancel</property>
4364 <property name="use_stock">True</property> 4377 <property name="use_stock">True</property>
4365 <property name="response_id">-6</property> 4378 <property name="response_id">-6</property>
4366 <accelerator key="Escape" modifiers="GDK_MOD1_MASK" signal="activate"/> 4379 <accelerator key="Escape" modifiers="" signal="activate"/>
4367 </widget> 4380 </widget>
4368 </child> 4381 </child>
4369 <child> 4382 <child>
@@ -4855,7 +4868,7 @@ Alex Jones &lt;alexrjones@ntlworld.com&gt;</property>
4855 </packing> 4868 </packing>
4856 </child> 4869 </child>
4857 <child> 4870 <child>
4858 <widget class="GtkButton" id="searchCloseButton1"> 4871 <widget class="GtkButton" id="searchCloseButton">
4859 <property name="visible">True</property> 4872 <property name="visible">True</property>
4860 <property name="tooltip" translatable="yes">Stop the search and close the tab</property> 4873 <property name="tooltip" translatable="yes">Stop the search and close the tab</property>
4861 <property name="relief">GTK_RELIEF_NONE</property> 4874 <property name="relief">GTK_RELIEF_NONE</property>
@@ -4928,4 +4941,48 @@ Alex Jones &lt;alexrjones@ntlworld.com&gt;</property>
4928 </widget> 4941 </widget>
4929 </child> 4942 </child>
4930 </widget> 4943 </widget>
4944 <widget class="GtkWindow" id="chatTabLabelWindow">
4945 <property name="visible">True</property>
4946 <property name="title" translatable="yes">Chat Tab Label with Close Button</property>
4947 <child>
4948 <widget class="GtkHBox" id="chatTabHBox">
4949 <property name="visible">True</property>
4950 <child>
4951 <widget class="GtkLabel" id="chatTabLabel">
4952 <property name="visible">True</property>
4953 <property name="xpad">5</property>
4954 <property name="label" translatable="yes">FIXME</property>
4955 <property name="use_underline">True</property>
4956 <property name="mnemonic_widget">chatCloseButton</property>
4957 <property name="single_line_mode">True</property>
4958 </widget>
4959 <packing>
4960 <property name="expand">False</property>
4961 <property name="fill">False</property>
4962 </packing>
4963 </child>
4964 <child>
4965 <widget class="GtkButton" id="chatCloseButton">
4966 <property name="visible">True</property>
4967 <property name="tooltip" translatable="yes">Leave the chat room and close the tab</property>
4968 <property name="relief">GTK_RELIEF_NONE</property>
4969 <property name="response_id">0</property>
4970 <signal name="clicked" handler="on_closeChatButton_clicked_" object="chatTabHBox"/>
4971 <child>
4972 <widget class="GtkImage" id="image9">
4973 <property name="visible">True</property>
4974 <property name="stock">gtk-cancel</property>
4975 <property name="icon_size">1</property>
4976 </widget>
4977 </child>
4978 </widget>
4979 <packing>
4980 <property name="expand">False</property>
4981 <property name="fill">False</property>
4982 <property name="position">1</property>
4983 </packing>
4984 </child>
4985 </widget>
4986 </child>
4987 </widget>
4931</glade-interface> 4988</glade-interface>
diff --git a/pixmaps/self.png b/pixmaps/self.png
new file mode 100644
index 00000000..bed8ea26
--- /dev/null
+++ b/pixmaps/self.png
Binary files differ
diff --git a/pixmaps/self.svg b/pixmaps/self.svg
new file mode 100644
index 00000000..4a97911f
--- /dev/null
+++ b/pixmaps/self.svg
@@ -0,0 +1,172 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!-- Created with Inkscape (http://www.inkscape.org/) -->
3<svg
4 xmlns:svg="http://www.w3.org/2000/svg"
5 xmlns="http://www.w3.org/2000/svg"
6 version="1.0"
7 width="400"
8 height="400"
9 id="svg24159">
10 <defs
11 id="defs24161" />
12 <g
13 id="layer1">
14 <g
15 transform="matrix(0.651999,0,0,0.651999,-51.23088,-96.82474)"
16 id="g879">
17 <g
18 transform="translate(87.13029,195.4545)"
19 style="font-size:12px;fill:#000000;fill-opacity:1;stroke:#000000;stroke-opacity:0.99122799"
20 id="g670">
21 <path
22 d="M 294.895,259.711 C 285.199,267.084 283.042,269.56 277.684,277.719 C 275.745,280.868 272.124,288.227 271.134,293.164 C 270.145,298.1 269.404,305.262 269.407,309.055 C 269.419,321.908 273.51,329.971 277.978,329.69 C 281.97,329.232 287.05,325.069 294.748,315.614"
23 style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0.99122799"
24 id="path584" />
25 <path
26 d="M 294.895,259.711 C 285.199,267.084 283.042,269.56 277.684,277.719 C 275.745,280.868 272.124,288.227 271.134,293.164 C 270.145,298.1 269.404,305.262 269.407,309.055 C 269.419,321.908 273.51,329.971 277.978,329.69 C 281.97,329.232 287.05,325.069 294.748,315.614"
27 transform="matrix(-1,0,0,1,596.772,0.208099)"
28 style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-linecap:butt;stroke-linejoin:bevel;stroke-opacity:0.99122799"
29 id="path585" />
30 <path
31 d="M 211.888,203.561 C 225.348,201.202 238.391,199.676 251.851,198.15 C 269.474,193.709 278.355,213.83 273.498,228.955 C 267.393,242.415 258.79,254.21 248.938,265.588 C 241.306,274.191 232.214,275.583 223.544,272.664 C 216.546,270.724 210.083,266.421 203.145,256.43 C 200.093,247.826 197.457,243.385 193.571,232.701 C 190.519,222.849 195.266,208.101 211.888,203.561 z "
32 transform="translate(0.588722,-3.051758e-5)"
33 style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0.99122799"
34 id="path586" />
35 <path
36 d="M 211.888,203.561 C 225.348,201.202 238.391,199.676 251.851,198.15 C 269.474,193.709 278.355,213.83 273.498,228.955 C 267.393,242.415 258.79,254.21 248.938,265.588 C 241.306,274.191 232.214,275.583 223.544,272.664 C 216.546,270.724 210.083,266.421 203.145,256.43 C 200.093,247.826 197.457,243.385 193.571,232.701 C 190.519,222.849 195.266,208.101 211.888,203.561 z "
37 transform="matrix(-1,0,0,1,596.4468,-3.051758e-5)"
38 style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0.99122799"
39 id="path587" />
40 </g>
41 <g
42 transform="translate(87.13029,195.4545)"
43 style="font-size:12px;stroke:#000000;stroke-opacity:0.99122799"
44 id="g775">
45 <g
46 style="fill:none;fill-opacity:1;stroke:#000000;stroke-opacity:0.99122799"
47 id="g740">
48 <g
49 style="font-size:12px;fill:none;fill-opacity:1;stroke:#000000;stroke-opacity:0.99122799"
50 id="g652">
51 <path
52 d="M 212.232,318.53 C 217.922,331.874 219.682,336.945 223.785,350.248 C 227.281,362.537 228.566,370.042 230.726,387.506"
53 style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:6.25;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:0.99122799"
54 id="path611" />
55 <path
56 d="M 212.232,318.53 C 217.922,331.874 219.682,336.945 223.785,350.248 C 227.281,362.537 228.566,370.042 230.726,387.506"
57 transform="matrix(-1,0,0,1,596.3183,-0.735886)"
58 style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:6.25;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:0.99122799"
59 id="path612" />
60 <g
61 style="fill:none;fill-opacity:1;stroke:#000000;stroke-opacity:0.99122799"
62 id="g637">
63 <path
64 d="M 236.516,349.732 C 251.234,358.759 276.677,360.151 299.472,359.741 C 324.866,359.612 346.605,357.778 360.881,349.144"
65 style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:0.99122799"
66 id="path588" />
67 <path
68 d="M 241.667,373.282 C 257.905,383.486 277.001,386.99 298.993,386.16 C 321.835,385.604 339.344,383.682 354.994,372.988"
69 style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:0.99122799"
70 id="path608" />
71 <g
72 style="fill:none;fill-opacity:1;stroke:#000000;stroke-opacity:0.99122799"
73 id="g625">
74 <path
75 d="M 229.893,385.644 C 247.26,406.592 271.501,410.229 299.066,410.959 C 328.585,412.036 358.232,400.314 365.885,385.645"
76 style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:6.25;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:0.99122799"
77 id="path609" />
78 <g
79 style="fill:none;fill-opacity:1;stroke:#000000;stroke-opacity:0.99122799"
80 id="g615">
81 <path
82 d="M 241.444,354.256 L 241.028,395.468"
83 style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:0.99122799"
84 id="path589" />
85 <path
86 d="M 254.973,358.627 L 254.765,402.753"
87 style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:0.99122799"
88 id="path592" />
89 <path
90 d="M 269.959,360.5 L 269.543,406.708"
91 style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:0.99122799"
92 id="path593" />
93 <path
94 d="M 283.489,361.541 L 283.28,408.373"
95 style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:0.99122799"
96 id="path594" />
97 <path
98 d="M 298.683,361.957 L 298.683,408.789"
99 style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:0.99122799"
100 id="path595" />
101 <path
102 d="M 313.253,361.749 L 313.461,408.581"
103 style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:0.99122799"
104 id="path598" />
105 <path
106 d="M 326.782,360.5 L 327.198,406.5"
107 transform="translate(-0.41626,-3.051758e-5)"
108 style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:0.99122799"
109 id="path599" />
110 <path
111 d="M 341.56,358.003 L 341.768,402.129"
112 style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:0.99122799"
113 id="path604" />
114 <path
115 d="M 355.297,352.591 L 355.714,394.219"
116 style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:0.99122799"
117 id="path606" />
118 </g>
119 </g>
120 </g>
121 </g>
122 <g
123 style="font-size:12px;fill:none;fill-opacity:1;stroke:#000000;stroke-opacity:0.99122799"
124 id="g675">
125 <path
126 d="M 171.498,235.561 C 152.362,216.958 138.988,184.673 137.132,149.809 C 135.117,111.389 155.35,73.2389 185.669,51.4898 C 219.638,27.5804 276.435,20.9678 311.751,22.7523 C 335.672,22.7689 388.957,35.1725 407.766,49.18 C 440.76,73.1701 458.454,107.22 459.68,146.03 C 461.493,185.013 445.074,214.705 424.969,233.236"
127 style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:12.5;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:0.99122799"
128 id="path573" />
129 <path
130 d="M 172.662,126.267 C 164.91,133.049 165.888,143.244 167.284,158.459 C 168.386,170.019 175.762,181.398 176.15,191.959 C 178.862,214.244 172.274,236.529 169.173,254.745 C 167.041,275.673 173.05,293.695 180.801,300.671 C 188.552,307.551 198.557,310.4 209.069,313.607 C 218.62,316.105 223.573,320.449 230.797,325.835 C 239.403,334.972 241.456,342.529 241.262,351.831"
131 style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:12.5;stroke-linecap:butt;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:0.99122799"
132 id="path580" />
133 <path
134 d="M 172.662,126.267 C 164.91,133.049 165.888,143.244 167.284,158.459 C 168.386,170.019 175.762,181.398 176.15,191.959 C 178.862,214.244 172.274,236.529 169.173,254.745 C 167.041,275.673 173.05,293.695 180.801,300.671 C 188.552,307.551 202.738,311.246 209.069,313.607 C 216.446,316.188 223.989,320.865 230.797,326.251 C 238.987,334.139 241.456,342.529 241.262,351.831"
135 transform="matrix(-1,0,0,1,597.7228,-0.58139)"
136 style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:12.5;stroke-linecap:butt;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:0.99122799"
137 id="path581" />
138 <path
139 d="M 194.821,310.959 C 201.759,327.749 209.113,344.123 209.807,361.329 C 206.616,375.205 207.587,391.579 211.056,404.623 C 215.497,422.523 232.842,443.753 250.188,450.83 C 267.949,457.282 279.05,458.948 298.892,458.948"
140 style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:12.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:0.99122799"
141 id="path613" />
142 <path
143 d="M 194.821,310.959 C 201.759,327.749 209.113,344.123 209.807,361.329 C 206.616,375.205 207.587,391.579 211.056,404.623 C 215.497,422.523 233.05,443.129 250.396,450.206 C 267.741,457.283 278.841,458.948 298.684,458.948"
144 transform="matrix(-1,0,0,1,596.7438,-3.051758e-5)"
145 style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:12.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:0.99122799"
146 id="path614" />
147 </g>
148 </g>
149 <g
150 style="stroke:#000000;stroke-opacity:0.99122799"
151 id="g770">
152 <path
153 d="M 391.308,389.636 L 459.58,421.274 C 467.905,424.743 474.565,423.633 480.81,421.69 C 490.662,418.776 498.432,420.442 506.619,423.772 C 516.471,428.767 516.75,435.844 510.367,442.921 C 504.539,449.72 498.71,453.189 491.634,459.988 C 490.107,470.95 491.078,481.08 486.221,491.21 C 480.116,500.09 473.594,498.564 463.326,489.128 C 452.919,481.079 456.665,472.199 441.679,459.155 L 378.403,426.269 L 378.403,426.269"
154 style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:12.5;stroke-linecap:butt;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:0.99122799"
155 id="path765" />
156 <path
157 d="M 204.812,389.22 C 182.055,401.292 161.38,412.531 135.293,422.522 C 114.062,427.795 114.895,414.752 89.0851,423.355 C 81.7307,429.183 81.8695,437.508 87.8363,443.752 C 94.7745,450.552 99.6313,454.854 105.737,460.821 C 107.68,469.424 107.957,476.778 109.067,487.046 C 113.23,499.674 122.388,498.98 130.297,492.875 C 133.766,488.573 138.068,484.688 140.704,479.97 C 144.312,473.726 148.336,466.649 153.193,460.821 L 216.052,427.518"
158 style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:12.5;stroke-linecap:butt;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:0.99122799"
159 id="path766" />
160 <path
161 d="M 401.299,321.365 C 427.109,308.599 448.339,298.33 471.651,286.813 C 485.943,274.88 482.336,263.362 493.715,254.759 C 504.954,244.074 512.447,246.711 516.61,252.678 C 520.634,262.807 522.577,272.937 522.022,283.483 C 532.706,293.335 538.396,299.024 544.502,308.045 C 545.334,319.423 535.343,324.14 523.271,324.279 C 507.452,327.193 504.954,317.202 487.054,324.279 L 392.557,368.821 L 392.557,368.821"
162 style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:12.5;stroke-linecap:square;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:0.99122799"
163 id="path767" />
164 <path
165 d="M 197.22,322.353 C 171.12,309.597 149.436,300.079 123.63,285.852 C 109.599,274.666 114.113,262.008 97.1383,251.706 C 89.6812,247.978 84.2847,246.31 78.2994,256.416 C 74.4727,265.444 74.7671,275.059 74.1784,284.381 C 67.5063,291.543 59.9511,295.763 54.4564,304.692 C 46.5087,317.448 58.5773,321.667 65.0532,323.237 C 83.4995,327.848 90.1715,319.508 107.146,322.942 C 140.213,338.347 173.573,354.34 205.462,370.039"
166 style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:12.5;stroke-linecap:butt;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:0.99122799"
167 id="path769" />
168 </g>
169 </g>
170 </g>
171 </g>
172</svg>
diff --git a/src/plugins/chat/chat.c b/src/plugins/chat/chat.c
index e4cbfa2f..99305457 100644
--- a/src/plugins/chat/chat.c
+++ b/src/plugins/chat/chat.c
@@ -54,7 +54,9 @@ struct GNUNET_CHAT_gui_chat_client
54 GtkListStore *nick_model; 54 GtkListStore *nick_model;
55 GtkWidget *chatFrame; 55 GtkWidget *chatFrame;
56 GtkWidget *chat_entry; 56 GtkWidget *chat_entry;
57 GtkWidget *tab_label;
57 GladeXML *chatXML; 58 GladeXML *chatXML;
59 GladeXML *labelXML;
58 struct GNUNET_CHAT_Room *room; 60 struct GNUNET_CHAT_Room *room;
59 GNUNET_HashCode mypid; 61 GNUNET_HashCode mypid;
60}; 62};
@@ -160,6 +162,55 @@ remove_nick_save_call (void *arg)
160 return NULL; 162 return NULL;
161} 163}
162 164
165
166/**
167 * This method is called when the user clicks on
168 * the "CANCEL (X)" button in the TAB of the
169 * chat notebook.
170 */
171void
172on_closeChatButton_clicked_chat (GtkWidget * chatPage,
173 GtkWidget * closeButton)
174{
175 struct GNUNET_CHAT_gui_chat_client *pos;
176 struct GNUNET_CHAT_gui_chat_client *prev;
177 GtkNotebook *chatnotebook;
178 int index;
179 int i;
180
181 prev = NULL;
182 pos = list;
183 while (pos != NULL)
184 {
185 if (pos->tab_label == chatPage)
186 break;
187 prev = pos;
188 pos = pos->next;
189 }
190 if (prev == NULL)
191 list = pos->next;
192 else
193 prev->next = pos;
194 GNUNET_GE_ASSERT (NULL, pos != NULL);
195 GNUNET_GTK_run_with_save_calls
196 ((GNUNET_ThreadMainFunction)&GNUNET_CHAT_leave_room, pos->room);
197
198 chatnotebook =
199 GTK_NOTEBOOK(glade_xml_get_widget (GNUNET_GTK_get_main_glade_XML (), "chatnotebook"));
200 /* remove page from notebook */
201 index = -1;
202 for (i = gtk_notebook_get_n_pages (chatnotebook) - 1; i >= 0; i--)
203 if (pos->chatFrame == gtk_notebook_get_nth_page (chatnotebook, i))
204 index = i;
205 GNUNET_GE_BREAK (NULL, index != -1);
206 gtk_notebook_remove_page (chatnotebook, index);
207 UNREF (pos->chatXML);
208 UNREF (pos->labelXML);
209 GNUNET_free(pos);
210}
211
212
213
163/** 214/**
164 * A message was sent in the chat to us. 215 * A message was sent in the chat to us.
165 * 216 *
@@ -206,12 +257,29 @@ member_list_callback (void *cls,
206 struct GNUNET_CHAT_gui_chat_client *client = cls; 257 struct GNUNET_CHAT_gui_chat_client *client = cls;
207 struct GNUNET_CHAT_safe_nick_write_struct writearg; 258 struct GNUNET_CHAT_safe_nick_write_struct writearg;
208 char *nick; 259 char *nick;
260 char *path;
261 char *filename;
209 262
210 GNUNET_hash (pkey, sizeof (GNUNET_RSA_PublicKey), &writearg.pid); 263 GNUNET_hash (pkey, sizeof (GNUNET_RSA_PublicKey), &writearg.pid);
211 nick = GNUNET_pseudonym_id_to_name (chat_ectx, chat_cfg, &writearg.pid); 264 nick = GNUNET_pseudonym_id_to_name (chat_ectx, chat_cfg, &writearg.pid);
212 writearg.model = client->nick_model; 265 writearg.model = client->nick_model;
213 /* FIXME: set icon if pid == ours */
214 writearg.icon = NULL; 266 writearg.icon = NULL;
267 if (0 == memcmp(&writearg.pid,
268 &client->mypid,
269 sizeof(GNUNET_HashCode)))
270 {
271 path = GNUNET_get_installation_path (GNUNET_IPK_DATADIR);
272 filename =
273 GNUNET_malloc (strlen (path) +
274 strlen ("/../gnunet-gtk/self.png") + 2);
275 strcpy (filename, path);
276 GNUNET_free (path);
277 strcat (filename, "/../gnunet-gtk/self.png");
278 writearg.icon
279 = gdk_pixbuf_new_from_file(filename,
280 NULL);
281 GNUNET_free(filename);
282 }
215 writearg.meta = member_info; 283 writearg.meta = member_info;
216 writearg.nick = nick; 284 writearg.nick = nick;
217 if (member_info != NULL) 285 if (member_info != NULL)
@@ -219,6 +287,8 @@ member_list_callback (void *cls,
219 else 287 else
220 GNUNET_GTK_save_call (&remove_nick_save_call, &writearg); 288 GNUNET_GTK_save_call (&remove_nick_save_call, &writearg);
221 GNUNET_free (nick); 289 GNUNET_free (nick);
290 if (writearg.icon != NULL)
291 g_object_unref(writearg.icon);
222 return GNUNET_OK; 292 return GNUNET_OK;
223} 293}
224 294
@@ -231,22 +301,26 @@ on_chat_frame_send_button_click_event_chat (GtkWidget * widget, gpointer data)
231 301
232 GNUNET_mutex_lock (lock); 302 GNUNET_mutex_lock (lock);
233 pos = list; 303 pos = list;
234 while ((pos != NULL) && (pos->send_button != widget)) 304 while ((pos != NULL) && (pos->send_button != widget) &&
305 (pos->chat_entry != widget) )
235 pos = pos->next; 306 pos = pos->next;
236 GNUNET_GE_ASSERT (NULL, pos != NULL); 307 GNUNET_GE_ASSERT (NULL, pos != NULL);
237 308
238 message = (const char *) gtk_entry_get_text (GTK_ENTRY (pos->chat_entry)); 309 message = (const char *) gtk_entry_get_text (GTK_ENTRY (pos->chat_entry));
239 GNUNET_CHAT_send_message (pos->room, 310 if (strlen(message) > 0)
240 message, GNUNET_CHAT_MSG_OPTION_NONE, NULL, &seq); 311 {
241 gtk_entry_set_text (GTK_ENTRY (pos->chat_entry), ""); 312 GNUNET_CHAT_send_message (pos->room,
313 message, GNUNET_CHAT_MSG_OPTION_NONE, NULL, &seq);
314 gtk_entry_set_text (GTK_ENTRY (pos->chat_entry), "");
315 }
242 GNUNET_mutex_unlock (lock); 316 GNUNET_mutex_unlock (lock);
243} 317}
244 318
245static void 319static void
246create_chat_room_tab (const char *room_name, const char *nick) 320create_chat_room_tab (const char *room_name, const char *nick)
247{ 321{
248 GtkWidget *chatLabel;
249 GtkWidget *chatnotebook; 322 GtkWidget *chatnotebook;
323 GtkLabel *label;
250 GtkTreeView *treeview; 324 GtkTreeView *treeview;
251 struct GNUNET_CHAT_gui_chat_client *client; 325 struct GNUNET_CHAT_gui_chat_client *client;
252 struct GNUNET_MetaData *meta; 326 struct GNUNET_MetaData *meta;
@@ -264,9 +338,19 @@ create_chat_room_tab (const char *room_name, const char *nick)
264 GNUNET_GTK_connect_glade_with_plugins (client->chatXML); 338 GNUNET_GTK_connect_glade_with_plugins (client->chatXML);
265 client->chatFrame = 339 client->chatFrame =
266 GNUNET_GTK_extract_main_widget_from_window (client->chatXML, "chatFrame"); 340 GNUNET_GTK_extract_main_widget_from_window (client->chatXML, "chatFrame");
267 chatLabel = gtk_label_new (room_name); 341 client->labelXML =
342 glade_xml_new (GNUNET_GTK_get_glade_filename (),
343 "chatTabLabelWindow", PACKAGE_NAME);
344 GNUNET_GTK_connect_glade_with_plugins (client->labelXML);
345 client->tab_label
346 = GNUNET_GTK_extract_main_widget_from_window (client->labelXML,
347 "chatTabLabelWindow");
348 label = GTK_LABEL (glade_xml_get_widget (client->labelXML,
349 "chatTabLabel"));
350 gtk_label_set (label, room_name);
268 gtk_notebook_append_page (GTK_NOTEBOOK (chatnotebook), 351 gtk_notebook_append_page (GTK_NOTEBOOK (chatnotebook),
269 client->chatFrame, chatLabel); 352 client->chatFrame,
353 client->tab_label);
270 gtk_widget_show (chatnotebook); 354 gtk_widget_show (chatnotebook);
271 355
272 client->nick_model = gtk_list_store_new (CHAT_NUM, G_TYPE_STRING, /* nickname */ 356 client->nick_model = gtk_list_store_new (CHAT_NUM, G_TYPE_STRING, /* nickname */