<property name="page_increment">10</property>
<property name="page_size">10</property>
</object>
+ <object class="GtkFileChooserDialog" id="folders-dialog">
+ <property name="can_default">True</property>
+ <property name="has_default">True</property>
+ <property name="border_width">5</property>
+ <property name="title" translatable="yes">Select folders</property>
+ <property name="modal">True</property>
+ <property name="destroy_with_parent">True</property>
+ <property name="type_hint">dialog</property>
+ <property name="transient_for">preferences-dialog</property>
+ <property name="has_separator">False</property>
+ <property name="select_multiple">True</property>
+ <property name="action">select-folder</property>
+ <property name="local_only">False</property>
+ <child internal-child="vbox">
+ <object class="GtkVBox" id="dialog-vbox2">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">2</property>
+ <child>
+ <placeholder/>
+ </child>
+ <child internal-child="action_area">
+ <object class="GtkHButtonBox" id="dialog-action_area2">
+ <property name="visible">True</property>
+ <property name="layout_style">end</property>
+ <child>
+ <object class="GtkButton" id="button4">
+ <property name="label" translatable="yes">gtk-cancel</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="button5">
+ <property name="label" translatable="yes">gtk-open</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="has_default">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <action-widgets>
+ <action-widget response="-6">button4</action-widget>
+ <action-widget response="-5">button5</action-widget>
+ </action-widgets>
+ </object>
<object class="GtkSizeGroup" id="general-labels-sizegroup">
<property name="mode">both</property>
</object>
const string FOLDERS_KEY = "folders";
const string FOLDERS_TEXTVIEW = FOLDERS_KEY + "-treeview";
const string FOLDERS_LISTSTORE = FOLDERS_KEY + "-liststore";
+ const string FOLDERS_DIALOG = FOLDERS_KEY + "-dialog";
private TreeView treeview;
private ListStore liststore;
+ private FileChooserDialog dialog;
public FolderPrefSection (Builder builder,
Configuration config) {
assert (this.treeview != null);
this.liststore = (ListStore) builder.get_object (FOLDERS_LISTSTORE);
assert (this.liststore != null);
+ this.dialog = (FileChooserDialog) builder.get_object (FOLDERS_DIALOG);
+ assert (this.dialog != null);
treeview.insert_column_with_attributes (-1,
"paths",
[CCode (instance_pos = -1)]
public void on_add_button_clicked (Button button) {
+ if (this.dialog.run () == ResponseType.OK) {
+ TreeIter iter;
+
+ var uris = this.dialog.get_uris ();
+
+ foreach (var uri in uris) {
+ this.liststore.append (out iter);
+ this.liststore.set (iter, 0, uri, -1);
+ }
+ }
+
+ this.dialog.hide ();
}
[CCode (instance_pos = -1)]