summaryrefslogtreecommitdiff
path: root/Userland/Applications/Spreadsheet/csv_import.gml
blob: 520b79491eceeb0a06c5a5393ea11fc608a84a58 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
@GUI::Widget {
    layout: @GUI::VerticalBoxLayout {
        margins: [20]
    }

    @GUI::HorizontalSplitter {
        @GUI::Widget {
            name: "csv_options"
            layout: @GUI::VerticalBoxLayout {}

            @GUI::Widget {
                layout: @GUI::HorizontalBoxLayout {}

                @GUI::GroupBox {
                    title: "Delimiter"
                    layout: @GUI::VerticalBoxLayout {
                        margins: [10, 8, 8]
                    }

                    @GUI::RadioButton {
                        name: "delimiter_comma_radio"
                        text: "Comma"
                        autosize: true
                    }

                    @GUI::RadioButton {
                        name: "delimiter_semicolon_radio"
                        text: "Semicolon"
                        autosize: true
                    }

                    @GUI::RadioButton {
                        name: "delimiter_tab_radio"
                        text: "Tab"
                        autosize: true
                    }

                    @GUI::RadioButton {
                        name: "delimiter_space_radio"
                        text: "Space"
                        autosize: true
                    }

                    @GUI::Widget {
                        fixed_height: 25
                        layout: @GUI::HorizontalBoxLayout {}

                        @GUI::RadioButton {
                            name: "delimiter_other_radio"
                            text: "Other: "
                            autosize: true
                        }

                        @GUI::TextBox {
                            name: "delimiter_other_text_box"
                            text: ""
                        }
                    }
                }

                @GUI::GroupBox {
                    title: "Quote"
                    layout: @GUI::VerticalBoxLayout {
                        margins: [10, 8, 8]
                    }

                    @GUI::RadioButton {
                        name: "quote_single_radio"
                        text: "Single Quotes"
                        autosize: true
                    }

                    @GUI::RadioButton {
                        name: "quote_double_radio"
                        text: "Double Quotes"
                        autosize: true
                    }

                    @GUI::Widget {
                        fixed_height: 25
                        layout: @GUI::HorizontalBoxLayout {}

                        @GUI::RadioButton {
                            name: "quote_other_radio"
                            text: "Other: "
                            autosize: true
                        }

                        @GUI::TextBox {
                            name: "quote_other_text_box"
                            text: ""
                        }
                    }

                    @GUI::Widget {}

                    @GUI::Widget {
                        fixed_height: 25
                        layout: @GUI::HorizontalBoxLayout {}

                        @GUI::Label {
                            text: "Escape by "
                            autosize: true
                        }

                        @GUI::ComboBox {
                            name: "quote_escape_combo_box"
                            model_only: true
                        }
                    }

                    @GUI::Widget {}
                }
            }

            @GUI::GroupBox {
                title: "Trim Field Spaces"
                fixed_height: 40
                layout: @GUI::VerticalBoxLayout {
                    margins: [4, 4, 0]
                }

                @GUI::Widget {
                    layout: @GUI::HorizontalBoxLayout {}

                    @GUI::CheckBox {
                        name: "trim_leading_field_spaces_check_box"
                        text: "Leading spaces"
                    }

                    @GUI::CheckBox {
                        name: "trim_trailing_field_spaces_check_box"
                        text: "Trailing spaces"
                    }
                }
            }

            @GUI::CheckBox {
                fixed_height: 15
                name: "read_header_check_box"
                text: "Read a header row"
            }
        }

        @GUI::GroupBox {
            title: "Data Preview"
            fixed_width: 150
            layout: @GUI::VerticalBoxLayout {
                margins: [10, 8, 8]
            }

            @GUI::StackWidget {
                name: "data_preview_widget"

                @GUI::TableView {
                    name: "data_preview_table_view"
                }

                @GUI::Label {
                    name: "data_preview_error_label"
                    word_wrap: true
                }
            }
        }
    }
}