+ /* Folder chmod */
+ hbox = gtk_hbox_new(FALSE, 8);
+ gtk_widget_show(hbox);
+ gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
+
+ PACK_CHECK_BUTTON(hbox, checkbtn_folder_chmod,
+ _("Folder chmod: "));
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_folder_chmod), item->prefs->enable_folder_chmod);
+ gtk_signal_connect(GTK_OBJECT(checkbtn_folder_chmod), "toggled",
+ GTK_SIGNAL_FUNC(prefs_folder_item_folder_chmod_cb), dialog);
+
+ entry_folder_chmod = gtk_entry_new();
+ gtk_widget_show(entry_folder_chmod);
+ gtk_box_pack_start(GTK_BOX(hbox), entry_folder_chmod, FALSE, FALSE, 0);
+ gtk_editable_set_editable(GTK_EDITABLE(entry_folder_chmod), item->prefs->enable_folder_chmod);
+ if (item->prefs->folder_chmod) {
+ gint tmp;
+ gint mult;
+ gint count = 0;
+ char buf[64]; /* plenty enough for an integer */
+
+ tmp = item->prefs->folder_chmod;
+ while (tmp && (count < sizeof(buf) - 1)) {
+ mult = tmp / 8;
+ buf[count++] = '0' + (tmp - mult * 8);
+ tmp /= 8;
+ }
+ buf[count] = '\0';
+ gtk_entry_set_text(GTK_ENTRY(entry_folder_chmod), buf);
+ }
+