diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-01-01 21:34:52 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-01-01 21:34:52 +0000 |
commit | 1c7b8abe61da8c807442251eb98604be743ea3b2 (patch) | |
tree | 98b03d3f75e72ac42a7c0c71e91f5dbf895aaf16 | |
parent | 52f7c1ad4b7c8f60b8a8644f9b5d132c26e48523 (diff) | |
download | gnunet-gtk-1c7b8abe61da8c807442251eb98604be743ea3b2.tar.gz gnunet-gtk-1c7b8abe61da8c807442251eb98604be743ea3b2.zip |
-add replication spin button for publishing files -- 2030
-rw-r--r-- | contrib/gnunet_fs_gtk_publish_file_dialog.glade | 65 | ||||
-rw-r--r-- | src/fs/gnunet-fs-gtk-main_window_file_publish.c | 6 |
2 files changed, 60 insertions, 11 deletions
diff --git a/contrib/gnunet_fs_gtk_publish_file_dialog.glade b/contrib/gnunet_fs_gtk_publish_file_dialog.glade index 66aaf7cf..0d67aa11 100644 --- a/contrib/gnunet_fs_gtk_publish_file_dialog.glade +++ b/contrib/gnunet_fs_gtk_publish_file_dialog.glade | |||
@@ -1,4 +1,4 @@ | |||
1 | <?xml version="1.0" encoding="UTF-8"?> | 1 | <?xml version="1.0"?> |
2 | <interface> | 2 | <interface> |
3 | <requires lib="gtk+" version="2.20"/> | 3 | <requires lib="gtk+" version="2.20"/> |
4 | <!-- interface-naming-policy project-wide --> | 4 | <!-- interface-naming-policy project-wide --> |
@@ -13,10 +13,12 @@ | |||
13 | <child internal-child="vbox"> | 13 | <child internal-child="vbox"> |
14 | <object class="GtkVBox" id="dialog-vbox1"> | 14 | <object class="GtkVBox" id="dialog-vbox1"> |
15 | <property name="visible">True</property> | 15 | <property name="visible">True</property> |
16 | <property name="orientation">vertical</property> | ||
16 | <property name="spacing">2</property> | 17 | <property name="spacing">2</property> |
17 | <child> | 18 | <child> |
18 | <object class="GtkVBox" id="vbox1"> | 19 | <object class="GtkVBox" id="vbox1"> |
19 | <property name="visible">True</property> | 20 | <property name="visible">True</property> |
21 | <property name="orientation">vertical</property> | ||
20 | <child> | 22 | <child> |
21 | <object class="GtkHBox" id="hbox1"> | 23 | <object class="GtkHBox" id="hbox1"> |
22 | <property name="visible">True</property> | 24 | <property name="visible">True</property> |
@@ -26,7 +28,6 @@ | |||
26 | <property name="visible">True</property> | 28 | <property name="visible">True</property> |
27 | <property name="can_focus">True</property> | 29 | <property name="can_focus">True</property> |
28 | <property name="receives_default">False</property> | 30 | <property name="receives_default">False</property> |
29 | <property name="use_action_appearance">False</property> | ||
30 | <property name="use_underline">True</property> | 31 | <property name="use_underline">True</property> |
31 | <property name="active">True</property> | 32 | <property name="active">True</property> |
32 | <property name="draw_indicator">True</property> | 33 | <property name="draw_indicator">True</property> |
@@ -56,7 +57,7 @@ | |||
56 | <object class="GtkSpinButton" id="GNUNET_GTK_publish_file_dialog_priority_spin_button"> | 57 | <object class="GtkSpinButton" id="GNUNET_GTK_publish_file_dialog_priority_spin_button"> |
57 | <property name="visible">True</property> | 58 | <property name="visible">True</property> |
58 | <property name="can_focus">True</property> | 59 | <property name="can_focus">True</property> |
59 | <property name="invisible_char">•</property> | 60 | <property name="invisible_char">•</property> |
60 | <property name="adjustment">priority_adjustment</property> | 61 | <property name="adjustment">priority_adjustment</property> |
61 | <property name="numeric">True</property> | 62 | <property name="numeric">True</property> |
62 | </object> | 63 | </object> |
@@ -92,7 +93,7 @@ | |||
92 | <object class="GtkSpinButton" id="GNUNET_GTK_publish_file_dialog_expiration_year_spin_button"> | 93 | <object class="GtkSpinButton" id="GNUNET_GTK_publish_file_dialog_expiration_year_spin_button"> |
93 | <property name="visible">True</property> | 94 | <property name="visible">True</property> |
94 | <property name="can_focus">True</property> | 95 | <property name="can_focus">True</property> |
95 | <property name="invisible_char">•</property> | 96 | <property name="invisible_char">•</property> |
96 | <property name="adjustment">expiration_year_adjustment</property> | 97 | <property name="adjustment">expiration_year_adjustment</property> |
97 | <property name="numeric">True</property> | 98 | <property name="numeric">True</property> |
98 | </object> | 99 | </object> |
@@ -117,10 +118,10 @@ | |||
117 | <object class="GtkSpinButton" id="GNUNET_GTK_publish_file_dialog_anonymity_spin_button"> | 118 | <object class="GtkSpinButton" id="GNUNET_GTK_publish_file_dialog_anonymity_spin_button"> |
118 | <property name="visible">True</property> | 119 | <property name="visible">True</property> |
119 | <property name="can_focus">True</property> | 120 | <property name="can_focus">True</property> |
120 | <property name="invisible_char">•</property> | 121 | <property name="invisible_char">•</property> |
121 | <property name="adjustment">anonymity_adjustment</property> | 122 | <property name="adjustment">anonymity_adjustment</property> |
122 | <property name="numeric">True</property> | 123 | <property name="numeric">True</property> |
123 | <signal name="value-changed" handler="GNUNET_GTK_anonymity_spin_button_value_changed_cb" swapped="no"/> | 124 | <signal name="value_changed" handler="GNUNET_GTK_anonymity_spin_button_value_changed_cb"/> |
124 | </object> | 125 | </object> |
125 | <packing> | 126 | <packing> |
126 | <property name="expand">False</property> | 127 | <property name="expand">False</property> |
@@ -134,6 +135,47 @@ | |||
134 | <property name="position">1</property> | 135 | <property name="position">1</property> |
135 | </packing> | 136 | </packing> |
136 | </child> | 137 | </child> |
138 | <child> | ||
139 | <object class="GtkHBox" id="hbox3"> | ||
140 | <property name="visible">True</property> | ||
141 | <child> | ||
142 | <object class="GtkLabel" id="GNUNET_GTK_publish_file_dialog_replication_label"> | ||
143 | <property name="visible">True</property> | ||
144 | <property name="label" translatable="yes">_Replication:</property> | ||
145 | <property name="use_underline">True</property> | ||
146 | </object> | ||
147 | <packing> | ||
148 | <property name="expand">False</property> | ||
149 | <property name="padding">20</property> | ||
150 | <property name="position">0</property> | ||
151 | </packing> | ||
152 | </child> | ||
153 | <child> | ||
154 | <object class="GtkSpinButton" id="GNUNET_GTK_publish_file_dialog_replication_spin_button"> | ||
155 | <property name="visible">True</property> | ||
156 | <property name="can_focus">True</property> | ||
157 | <property name="invisible_char">●</property> | ||
158 | <property name="adjustment">replication_adjustment</property> | ||
159 | <property name="numeric">True</property> | ||
160 | </object> | ||
161 | <packing> | ||
162 | <property name="expand">False</property> | ||
163 | <property name="padding">1</property> | ||
164 | <property name="position">1</property> | ||
165 | </packing> | ||
166 | </child> | ||
167 | <child> | ||
168 | <placeholder/> | ||
169 | </child> | ||
170 | <child> | ||
171 | <placeholder/> | ||
172 | </child> | ||
173 | </object> | ||
174 | <packing> | ||
175 | <property name="expand">False</property> | ||
176 | <property name="position">2</property> | ||
177 | </packing> | ||
178 | </child> | ||
137 | </object> | 179 | </object> |
138 | <packing> | 180 | <packing> |
139 | <property name="position">2</property> | 181 | <property name="position">2</property> |
@@ -149,7 +191,6 @@ | |||
149 | <property name="visible">True</property> | 191 | <property name="visible">True</property> |
150 | <property name="can_focus">True</property> | 192 | <property name="can_focus">True</property> |
151 | <property name="receives_default">True</property> | 193 | <property name="receives_default">True</property> |
152 | <property name="use_action_appearance">False</property> | ||
153 | <property name="use_stock">True</property> | 194 | <property name="use_stock">True</property> |
154 | </object> | 195 | </object> |
155 | <packing> | 196 | <packing> |
@@ -165,7 +206,6 @@ | |||
165 | <property name="can_focus">True</property> | 206 | <property name="can_focus">True</property> |
166 | <property name="can_default">True</property> | 207 | <property name="can_default">True</property> |
167 | <property name="receives_default">True</property> | 208 | <property name="receives_default">True</property> |
168 | <property name="use_action_appearance">False</property> | ||
169 | <property name="use_stock">True</property> | 209 | <property name="use_stock">True</property> |
170 | </object> | 210 | </object> |
171 | <packing> | 211 | <packing> |
@@ -189,8 +229,8 @@ | |||
189 | </action-widgets> | 229 | </action-widgets> |
190 | </object> | 230 | </object> |
191 | <object class="GtkAdjustment" id="priority_adjustment"> | 231 | <object class="GtkAdjustment" id="priority_adjustment"> |
192 | <property name="upper">100000000</property> | ||
193 | <property name="value">1000</property> | 232 | <property name="value">1000</property> |
233 | <property name="upper">100000000</property> | ||
194 | <property name="step_increment">1</property> | 234 | <property name="step_increment">1</property> |
195 | <property name="page_increment">10</property> | 235 | <property name="page_increment">10</property> |
196 | </object> | 236 | </object> |
@@ -203,8 +243,8 @@ | |||
203 | </columns> | 243 | </columns> |
204 | </object> | 244 | </object> |
205 | <object class="GtkAdjustment" id="anonymity_adjustment"> | 245 | <object class="GtkAdjustment" id="anonymity_adjustment"> |
206 | <property name="upper">10000000</property> | ||
207 | <property name="value">1</property> | 246 | <property name="value">1</property> |
247 | <property name="upper">10000000</property> | ||
208 | <property name="step_increment">1</property> | 248 | <property name="step_increment">1</property> |
209 | <property name="page_increment">10</property> | 249 | <property name="page_increment">10</property> |
210 | </object> | 250 | </object> |
@@ -213,4 +253,9 @@ | |||
213 | <property name="step_increment">1</property> | 253 | <property name="step_increment">1</property> |
214 | <property name="page_increment">10</property> | 254 | <property name="page_increment">10</property> |
215 | </object> | 255 | </object> |
256 | <object class="GtkAdjustment" id="replication_adjustment"> | ||
257 | <property name="upper">99999</property> | ||
258 | <property name="step_increment">1</property> | ||
259 | <property name="page_increment">10</property> | ||
260 | </object> | ||
216 | </interface> | 261 | </interface> |
diff --git a/src/fs/gnunet-fs-gtk-main_window_file_publish.c b/src/fs/gnunet-fs-gtk-main_window_file_publish.c index e5efd423..e8b94fd8 100644 --- a/src/fs/gnunet-fs-gtk-main_window_file_publish.c +++ b/src/fs/gnunet-fs-gtk-main_window_file_publish.c | |||
@@ -1814,7 +1814,11 @@ GNUNET_GTK_publish_file_dialog_response_cb (GtkDialog * dialog, | |||
1814 | (builder, | 1814 | (builder, |
1815 | "GNUNET_GTK_publish_file_dialog_priority_spin_button"))); | 1815 | "GNUNET_GTK_publish_file_dialog_priority_spin_button"))); |
1816 | bo.expiration_time = GNUNET_FS_GTK_get_expiration_time (sb); | 1816 | bo.expiration_time = GNUNET_FS_GTK_get_expiration_time (sb); |
1817 | bo.replication_level = 1; /* FIXME... */ | 1817 | bo.replication_level = |
1818 | gtk_spin_button_get_value (GTK_SPIN_BUTTON | ||
1819 | (gtk_builder_get_object | ||
1820 | (builder, | ||
1821 | "GNUNET_GTK_publish_file_dialog_replication_spin_button"))); | ||
1818 | do_index = | 1822 | do_index = |
1819 | gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON | 1823 | gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON |
1820 | (gtk_builder_get_object | 1824 | (gtk_builder_get_object |